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: <bma...@us...> - 2008-10-03 13:07:06
|
Revision: 4027 http://fudaa.svn.sourceforge.net/fudaa/?rev=4027&view=rev Author: bmarchan Date: 2008-10-03 13:06:52 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Doc. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttribute.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttribute.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttribute.java 2008-10-03 10:57:09 UTC (rev 4026) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttribute.java 2008-10-03 13:06:52 UTC (rev 4027) @@ -206,6 +206,12 @@ return userData_; } + /** + * Calcul du hashcode. + * La surchage est necessaire, pour que 2 instances r\xE9pondant au contrat att1.equals(att2)==true aient le m\xEAme hashcode. + * En particulier utilis\xE9 comme cl\xE9 des HashMap.<p> + * Nous supposons que le hashcode est unique calcul\xE9 comme ca... + */ public int hashCode() { int r = 17 * getClass().hashCode(); r += name_.hashCode() * 7; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-10-03 10:57:18
|
Revision: 4026 http://fudaa.svn.sourceforge.net/fudaa/?rev=4026&view=rev Author: emmanuel_martin Date: 2008-10-03 10:57:09 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Am?\195?\169lioration du comportement de la boite d'edition. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2008-10-02 18:32:19 UTC (rev 4025) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2008-10-03 10:57:09 UTC (rev 4026) @@ -77,6 +77,13 @@ ((BPaletteEdition)palette_).resetPalette(); } + private void unactivePaletteCreation(){ + if(calqueEdition_!=null) + calqueEdition_.cancelEdition(); + if(palette_!=null) + ((BPaletteEdition)palette_).resetPaletteCreation(); + } + /** * Le calque target, c'est \xE0 dire le calque actif. */ @@ -137,7 +144,7 @@ * Appel\xE9e quand il y a un changement de selection dans l'arbre des calques. */ public void valueChanged(final TreeSelectionEvent _e) { - unactivePanel(); + unactivePaletteCreation(); if(editor_.getPanel().getController().getCqSelectionI()!=null) editor_.getPanel().getController().getCqSelectionI().setGele(false); setTarget(getTarget((TreeSelectionModel) _e.getSource())); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java 2008-10-02 18:32:19 UTC (rev 4025) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java 2008-10-03 10:57:09 UTC (rev 4026) @@ -319,6 +319,7 @@ /** * Reset la palette : ferme le panel de construction de forme en cours. + * et d\xE9active tout les autres bouton du panel */ public void resetPalette(){ for(int i=0;i<globalButtons_.size();i++){ @@ -333,6 +334,21 @@ } /** + * reset les boutons d'\xE9ditions du panel + */ + public void resetPaletteCreation() { + for(int i=0;i<globalButtons_.size();i++){ + if(globalButtons_.get(i)!=null){ + AbstractButton button = (AbstractButton)globalButtons_.get(i); + if(button.isSelected()&&button.getActionCommand().matches("GLOBAL_ADD_[a-zA-Z0-9]*")){ + button.setSelected(false); + sendCommand(button.getActionCommand()); + } + } + } + } + + /** * Retourne vrai si un des boutons de cr\xE9ation de forme est actif. */ public boolean isEditionOnGoing(){ @@ -469,6 +485,8 @@ * @param _target le nouveau receveur de commande */ public final void setTargetClient(final BPaletteEditionClientInterface _target) { + if(_target==null) + resetPalette(); target_ = _target; if (target_ == null) { setAllEnable(false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-02 18:33:00
|
Revision: 4025 http://fudaa.svn.sourceforge.net/fudaa/?rev=4025&view=rev Author: hadouxad Date: 2008-10-02 18:32:19 +0000 (Thu, 02 Oct 2008) Log Message: ----------- - d?\195?\169but de l'algodes lignes de courant - l'interface de choix des donn?\195?\169es pour les lignes de courant - mise en place du target pour les importations de courbes, il ne reste plus qu'a instancier les les treemodel qui vont bien. - cr?\195?\169ation de toutes les interfaces pour les import scopGENE et scop s, t, tout est en place C'est du lourd avec choix pour scopgene du type de graphe (cardlayout pour gerer les plusieurs cas...) Tout est fait jusque a la cr?\195?\169ation des ?\195?\169volutions regulieres pour le scopGene, tout est g?\195?\169r?\195?\169; spatial, temporel, corr?\195?\169l?\195?\169 Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 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/ScopeWriterGENE.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 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/tr_en.fr_txt 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/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardImportScope.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/classes/ 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/TrComputeCurrentLine.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-10-02 16:17:18 UTC (rev 4024) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -172,7 +172,7 @@ // -- on est arriv\xE9 a une ligne de pas de temps, on ajoute le pas de temps // dans la structure --// String valuePasDetemps = in_.getLine(); - structure.addPasDeTemps(valuePasDetemps); + structure.addSeparator(valuePasDetemps); in_.readFields(); @@ -191,7 +191,7 @@ value = in_.doubleField(i); - structure.addValueForVariableAtPdt(value, i, valuePasDetemps); + structure.addValueForVariableAtSeparator(value, i, valuePasDetemps); } } // on lit la suite @@ -216,7 +216,7 @@ // -- on est arriv\xE9 a une ligne de pas de temps --// String valuePasDetemps = in_.getLine(); - structure.addPasDeTemps(valuePasDetemps); + structure.addSeparator(valuePasDetemps); in_.readFields(); @@ -237,7 +237,7 @@ // on inscrit la valeur pour la variable du pas de temps // correspondant double value = in_.doubleField(0); - structure.addValueForVariableAtPdt(value, indiceVar, valuePasDetemps); + structure.addValueForVariableAtSeparator(value, indiceVar, valuePasDetemps); indiceVar++; // on lit la var suivante 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-02 16:17:18 UTC (rev 4024) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -19,6 +19,8 @@ public abstract void printResults(); + public abstract EvolutionReguliere[] returnEvolReguliere(); + /** * Structure pour les fichiers s ou t Par convention les x sont les premieres * variables. @@ -183,8 +185,8 @@ double[] tabY = new double[listeY.size()]; for (int j = 0; j < listeX.size(); j++) { - tabX[i] = listeX.get(i); - tabY[i] = listeY.get(i); + tabX[j] = listeX.get(j); + tabY[j] = listeY.get(j); } @@ -266,12 +268,12 @@ public static class Gene extends ScopeStructure { /** - * Map qui donne a chaque pas de temps sa liste de valeurs pour chaque + * Map qui donne a chaque separator sa liste de valeurs pour chaque * variables. */ private Map<String, ArrayList<ArrayList<Double>>> data_ = new HashMap<String, ArrayList<ArrayList<Double>>>(); - private List<String> listePasDeTemps = new ArrayList<String>(); + private List<String> listeSeparator = new ArrayList<String>(); private List<String> listeVariales_ = new ArrayList<String>(); @@ -298,7 +300,7 @@ - public List<Double> getAllX(String pdt) { + public ArrayList<Double> getAllX(String pdt) { return data_.get(pdt).get(0); } @@ -316,6 +318,27 @@ getAllX(pdt).add(x); } + + public double getXMax(){ + double max=getX(0,listeSeparator.get(0)); + + for(int j=0;j<listeSeparator.size();j++) + for(int i=1;i<getAllX(listeSeparator.get(j)).size();i++) + if(max<getX(i,listeSeparator.get(j))) + max=getX(i,listeSeparator.get(j)); + return max; + } + + public double getXMin(){ + double min=getX(0,listeSeparator.get(0)); + + for(int j=0;j<listeSeparator.size();j++) + for(int i=1;i<getAllX(listeSeparator.get(j)).size();i++) + if(min>getX(i,listeSeparator.get(j))) + min=getX(i,listeSeparator.get(j)); + return min; + } + /** * Methode qui insert le x dans les variables que si il n'existe pas deja. * @@ -331,10 +354,10 @@ - public void addPasDeTemps(String ligne) { + public void addSeparator(String ligne) { ligne = ligne.replace(KEY.getBlocCommentaireGENE(), ""); - listePasDeTemps.add(ligne); + listeSeparator.add(ligne); // on ajoute un enregistrment dans data pour le pas de temps // correspondant @@ -355,8 +378,8 @@ // // } - public int getNbPasDeTemps() { - return listePasDeTemps.size(); + public int getNbSeparator() { + return listeSeparator.size(); } @@ -364,23 +387,23 @@ return listeVariales_.size(); } - public ArrayList<ArrayList<Double>> getListeVarForPasDeTemps(String pdt) { + public ArrayList<ArrayList<Double>> getListeVarForSeparator(String pdt) { return data_.get(pdt); } - public ArrayList<ArrayList<Double>> getListeVarForPasDeTemps(int pdt) { - return data_.get(listePasDeTemps.get(pdt)); + public ArrayList<ArrayList<Double>> getListeVarForSeparator(int pdt) { + return data_.get(listeSeparator.get(pdt)); } - public ArrayList<Double> getListValueForVariableForPDT(String pdt, int var) { + public ArrayList<Double> getListValueForVariableForSeparator(String separator, int var) { - return getListeVarForPasDeTemps(pdt).get(var); + return getListeVarForSeparator(separator).get(var); } - public void addValueForVariableAtPdt(double value, int indexVariable, String valuePasDetemps) { - ArrayList<Double> listeValueOfVar = getListValueForVariableForPDT(valuePasDetemps, indexVariable); + public void addValueForVariableAtSeparator(double value, int indexVariable, String nameSeparator) { + ArrayList<Double> listeValueOfVar = getListValueForVariableForSeparator(nameSeparator, indexVariable); // if (listeValueOfVar == null) // listeValueOfVar = new ArrayList<Double>(); @@ -403,14 +426,14 @@ * retourne l equivalent d une ligne du fichier qui contient les valeurs * pour chaque variables pour un pas de temps donn\xE9. * - * @param pasDetemps + * @param separator * @return */ - public String getAllValuesForVariableAndPasDeTemps(String pasDetemps,int indiceValue) { + public String getAllValuesForVariableAndSeparator(String separator,int indiceValue) { String ligneBrochette = ""; for (int i = 0; i < listeVariales_.size(); i++) { - ArrayList<Double> listeValueOfVar = getListValueForVariableForPDT(pasDetemps, i); + ArrayList<Double> listeValueOfVar = getListValueForVariableForSeparator(separator, i); if (i != 0) ligneBrochette += " "; if (listeValueOfVar.get(indiceValue) != KEY.VALUE_UNDEFINED) @@ -423,8 +446,8 @@ } - public String getPasDeTemps(int i) { - return listePasDeTemps.get(i); + public String getSeparator(int i) { + return listeSeparator.get(i); } public String getVariable(int i) { return listeVariales_.get(i); @@ -441,26 +464,26 @@ public EvolutionReguliere[] returnEvolReguliere() { - EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbPasDeTemps() * getNbVariables()]; + EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbSeparator() * getNbVariables()]; // -- on parcours tous les pas de temps --// - for (int h = 0; h < getNbPasDeTemps(); h++) { + for (int h = 0; h < getNbSeparator(); h++) { - String pdt = getPasDeTemps(h); + String pdt = getSeparator(h); - // -- on parcours toutes les variables --// - for (int i = 0; i < getNbVariables(); i++) { + // -- on parcours toutes les variables et non les x --// + for (int i = 1; i < getNbVariables(); i++) { String nomVar = getVariable(i); List<Double> listeX = getAllX(pdt); - List<Double> listeY = getListValueForVariableForPDT(pdt, i); + List<Double> listeY = getListValueForVariableForSeparator(pdt, i); double[] tabX = new double[listeX.size()]; double[] tabY = new double[listeY.size()]; for (int j = 0; j < listeX.size(); j++) { - tabX[i] = listeX.get(i); - tabY[i] = listeY.get(i); + tabX[j] = listeX.get(j); + tabY[j] = listeY.get(j); } @@ -472,6 +495,190 @@ return evolReg; } + /** + * A utiliser poru transformer scopgen en evol temporelles. + * On cree une courbe par variables, et on prend les points de tous les separaor pou les former. + * @return + */ + public EvolutionReguliere[] returnEvolRegulierePourTemporelles() { + EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbVariables()]; + + + // -- on parcours toutes les variables et non les x, on a une seule variable --// + for (int i = 1; i < getNbVariables(); i++) { + String nomVar = getVariable(i); + + List<Double> listeTOTALX =new ArrayList<Double>(); + List<Double> listeTOTALY = new ArrayList<Double>(); + + for(int k=0;k<getNbSeparator();k++){ + + //on recupere les x de ce separator + List<Double> listX=getListValueForVariableForSeparator(getSeparator(k), 0); + //on recupere les y de la variable de la courbe + List<Double> listY=getListValueForVariableForSeparator(getSeparator(k), i); + + //on ajoute tout cela au x et y totaux + listeTOTALX.addAll(listX); + listeTOTALY.addAll(listY); + + + } + + //creation de l evol reguliere + double[] tabX = new double[listeTOTALX.size()]; + double[] tabY = new double[listeTOTALX.size()]; + for (int j = 0; j < listeTOTALX.size(); j++) { + tabX[j] = listeTOTALX.get(j); + tabY[j] = listeTOTALY.get(j); + } + evolReg[i] = new EvolutionReguliere(tabX, tabY, false); + evolReg[i].setNom("courbe de " + nomVar); + + + } + + return evolReg; + } + + /** + * Methode reservee pour les correlations, on genere une courbe a la fois. + *les x seront la variable du separator specifi\xE9 + *les Y idem + * @return + */ + public EvolutionReguliere[] returnEvolReguliereCorrelation(int varX,int varY,int separatorX,int separatorY){ + EvolutionReguliere[] evolReg = new EvolutionReguliere[1]; + + List<Double> listeX=getListValueForVariableForSeparator(getSeparator(separatorX), varX+1); + List<Double> listeY=getListValueForVariableForSeparator(getSeparator(separatorY), varY+1); + + double[] tabX = new double[listeX.size()]; + double[] tabY = new double[listeY.size()]; + + for (int j = 0; j < listeX.size(); j++) { + tabX[j] = listeX.get(j); + tabY[j] = listeY.get(j); + + } + + evolReg[0] = new EvolutionReguliere(tabX, tabY, false); + evolReg[0].setNom("courbe corr\xE9l\xE9e X="+getVariable(varX+1)+"/Y="+getVariable(varY+1)); + + + return evolReg; + } + + + /** + * Methode qui reduit la structure en ne conservant que les separator de debut et de fin. + * la liste des variables dont les indices doivents etre incr\xE9ment\xE9s car pas de x. + * et ne garder que le x choisi et interpoler les valeur de facon lin\xE9aire. + * @param debSeparator + * @param finSeparator + * @param listVariables + * @param xchoosen + */ + public void restreindreStructure(int debSeparator,int finSeparator,int[] listVariables, double xchoosen){ + + //on reduit les separator a la liste voulue + restreindreStructure(debSeparator, finSeparator); + + //on reduit les variables + restreindreStructure(listVariables); + + //on interpole pour le x choisi + restreindreStructure(xchoosen); + + printResults(); + } + + public void restreindreStructure(int debSeparator,int finSeparator){ + Map<String, ArrayList<ArrayList<Double>>> newdata_ = new HashMap<String, ArrayList<ArrayList<Double>>>(); + List<String> newlisteSeparator = new ArrayList<String>(); + + + // on ajoute les separator de la plage + for(int i=0;i<getNbSeparator();i++){ + if(i>=debSeparator && i<=finSeparator){ + String newSepa= getSeparator(i); + newlisteSeparator.add(newSepa); + newdata_.put(newSepa, getListeVarForSeparator(i)); + } + } + listeSeparator=newlisteSeparator; + data_=newdata_; + + } + + public void restreindreStructure(int[] listVariables){ + Map<String, ArrayList<ArrayList<Double>>> newdata_ = new HashMap<String, ArrayList<ArrayList<Double>>>(); + List<String> newlisteVariables = new ArrayList<String>(); + + //on ajoute par defaut les x + newlisteVariables.add(getVariable(0)); + + + + //on ajout les news variabels + for(int j=0;j<listVariables.length;j++) + newlisteVariables.add(getVariable(listVariables[j]+1)); + + // on ajoute uniquement les datas de ces variables + for(int i=0;i<getNbSeparator();i++){ + + ArrayList<ArrayList<Double>> newVariablePerValidator=new ArrayList<ArrayList<Double>>(); + + //on ajoute tout dabord tous les x + newVariablePerValidator.add(getAllX(getSeparator(i))); + + for(int j=0;j<listVariables.length;j++){ + //il faut incrementer de 1 car pas de X pris en compte pour les choix de var or ici c est l'elt 0 + int selectedVar=listVariables[j]+1; + newVariablePerValidator.add(getListValueForVariableForSeparator(getSeparator(i), selectedVar)); + + + } + newdata_.put(getSeparator(i), newVariablePerValidator); + + } + listeVariales_=newlisteVariables; + data_=newdata_; + + } + + public void restreindreStructure(double xchoosen){ + + for(int i=0;i<getNbSeparator();i++){ + + ArrayList<Double> listeX=getAllX(getSeparator(i)); + + int indiceProche=0; + double xProche=listeX.get(0); + //etape 1 on recherche le x le plus proche du xchoosen + for(int k=1;k<listeX.size();k++){ + double test=listeX.get(k); + if(Math.abs(test-xchoosen)<Math.abs(xProche-xchoosen)){ + xProche=test; + indiceProche=k; + } + } + + //on ne conserve dans chaque liste des variables que la valeur correspondante au xProche + for(int j=0;j<getNbVariables();j++){ + + ArrayList<Double> listeValueVar=getListValueForVariableForSeparator(getSeparator(i), j); + double conservVar=listeValueVar.get(indiceProche); + for(int h=0;h<listeValueVar.size();) + listeValueVar.remove(h); + listeValueVar.add(conservVar); + + + } + } + + } + @Override public void printResults() { // titres @@ -486,19 +693,19 @@ } // tableau de val mode non eclatee - String tableauVal = "0 " + KEY.getScopeGENESeparator(getPasDeTemps(0)) + " 0 0 0 0 0 0 0 0"; + String tableauVal = "0 " + KEY.getScopeGENESeparator(getSeparator(0)) + " 0 0 0 0 0 0 0 0"; System.err.print("\n" + tableauVal); // pour chaque pas de temps - for (int i = 0; i < listePasDeTemps.size(); i++) { + for (int i = 0; i < listeSeparator.size(); i++) { // separator pas de temps - System.err.print("\n " + getPasDeTemps(i)); + System.err.print("\n " + getSeparator(i)); - int nbValuesForThisPdt = getListeVarForPasDeTemps(i).get(0).size(); + int nbValuesForThisPdt = getListeVarForSeparator(i).get(0).size(); // -- parcours la liste des donnees for (int k = 0; k < nbValuesForThisPdt; k++) { - System.err.print("\n" + getAllValuesForVariableAndPasDeTemps(getPasDeTemps(i), k)); + System.err.print("\n" + getAllValuesForVariableAndSeparator(getSeparator(i), k)); } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeWriterGENE.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeWriterGENE.java 2008-10-02 16:17:18 UTC (rev 4024) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeWriterGENE.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -1,6 +1,8 @@ package org.fudaa.dodico.telemac.io; import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Calendar; import org.fudaa.ctulu.CtuluActivity; import org.fudaa.ctulu.fileformat.FileFormatVersionInterface; @@ -69,11 +71,12 @@ } protected void writeHeader(ScopeStructure.Gene _struct) throws IOException { - String bc = key_.getBlocCommentaireGENE(); - setProgression(0, H2dResource.getS("Cr\xE9ation des en-t\xEAtes") + bc); - for (int i = 0; i < _struct.getNbTitles(); i++) { - writelnToOut(bc + _struct.getTitle(i)); - } + String bc = key_.getBlocCommentaireGENE(); + setProgression(0, H2dResource.getS("Cr\xE9ation des en-t\xEAtes") + bc); + writelnToOut(bc + H2dResource.getS("Fichier g\xE9n\xE9r\xE9 par Fudaa") + bc); + final String date = new SimpleDateFormat("yyyy-M-d k:mm:ss").format(Calendar.getInstance().getTime()); + writelnToOut(bc + "Version " + key_.getVersion() + " - Date " + date + bc); + writelnToOut(bc); } @@ -86,7 +89,7 @@ writelnToOut(_struct.getVariable(i)); } // tableau de val mode non eclatee - String tableauVal = "0 " + key_.getScopeGENESeparator(_struct.getPasDeTemps(0)) + " 0 0 0 0 0 0 0 0"; + String tableauVal = "0 " + key_.getScopeGENESeparator(_struct.getSeparator(0)) + " 0 0 0 0 0 0 0 0"; writelnToOut(tableauVal); } @@ -94,15 +97,15 @@ setProgression(30, H2dResource.getS("Cr\xE9ation des donn\xE9es")); // pour chaque pas de temps - for (int i = 0; i < _struct.getNbPasDeTemps(); i++) { + for (int i = 0; i < _struct.getNbSeparator(); i++) { // separator pas de temps - writelnToOut(_struct.getPasDeTemps(i)); + writelnToOut(_struct.getSeparator(i)); // -- parcours la liste des donnees - int nbValuesForThisPdt = _struct.getListeVarForPasDeTemps(i).get(0).size(); + int nbValuesForThisPdt = _struct.getListeVarForSeparator(i).get(0).size(); for (int k = 0; k < nbValuesForThisPdt; k++) { - writelnToOut(_struct.getAllValuesForVariableAndPasDeTemps(_struct.getPasDeTemps(i), k)); + writelnToOut(_struct.getAllValuesForVariableAndSeparator(_struct.getSeparator(i), k)); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java 2008-10-02 16:17:18 UTC (rev 4024) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -4,6 +4,7 @@ import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGCourbeChild; @@ -32,18 +33,26 @@ */ - public static EGGraphe createGrapheTemporel(ScopeStructure.SorT data_,ProgressionInterface prog){ + public static void createGraphe(FudaaCourbeImporter.Target target,ScopeStructure _data, CtuluCommandManager _mng,ProgressionInterface _prog){ - return createGrapheSpatialGraphe(data_, prog); + createGraphe(target,_data.returnEvolReguliere(), _mng, _prog); } + public static void createGraphe(FudaaCourbeImporter.Target target,EvolutionReguliere[] _data, CtuluCommandManager _mng,ProgressionInterface _prog){ + + + target.importCourbes(_data, _mng, _prog); + } + + + /** * genere un graphe spatial * @param data_ * @return */ - public static EGGraphe createGrapheSpatialGraphe(ScopeStructure.SorT data_,ProgressionInterface prog){ + public static void createGrapheSpatialGrapheOLD(FudaaCourbeImporter.Target target,ScopeStructure.SorT data_,ProgressionInterface prog){ EGGrapheTreeModel model=new EGGrapheTreeModel(); double[] tabX=new double[data_.getAllX().size()]; @@ -74,20 +83,7 @@ EGGraphe graphe=new EGGraphe(model); - return graphe; - } - - -public static EGGraphe createGrapheSpatialGENE(ScopeStructure.Gene data_,ProgressionInterface prog){ - - return null; } - -public static EGGraphe createGrapheTemporelGENE(ScopeStructure.Gene data_,ProgressionInterface prog){ - - - return null; } -} 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-02 16:17:18 UTC (rev 4024) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -1,20 +1,28 @@ package org.fudaa.fudaa.commun.courbe; import java.awt.BorderLayout; +import java.awt.CardLayout; import java.awt.FlowLayout; +import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; 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.JTextField; +import javax.swing.ListSelectionModel; import javax.swing.filechooser.FileFilter; import org.fudaa.ctulu.CtuluCommandManager; @@ -28,6 +36,7 @@ import org.fudaa.ctulu.gui.CtuluLibSwing; 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; @@ -44,12 +53,14 @@ 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; import org.fudaa.fudaa.tr.common.TrResource; import com.memoire.bu.BuButton; 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; @@ -69,7 +80,7 @@ //donnees haut niveau FudaaCommonImplementation impl_; - + FudaaCourbeImporter.Target target_; /** * type de fomat: * 0 => scops @@ -93,17 +104,19 @@ BuTextField plageFin_=new BuTextField(5); double xMin; double xMax; - JList listVariables_; + JList listVariablesST_; public static class ImportAction extends EbliActionSimple { final FudaaCommonImplementation ui_; - public ImportAction(final FudaaCommonImplementation _ui) { + FudaaCourbeImporter.Target target_; + public ImportAction(final FudaaCommonImplementation _ui,FudaaCourbeImporter.Target target) { super(BuResource.BU.getString("Importer au format scope"), BuResource.BU.getIcon("IMPORTER"), "IMPORTER"); - ui_ = _ui; + ui_ = _ui; + target_=target; } public void actionPerformed(final ActionEvent _e) { - FudaaCourbeWizardImportScope wizard=new FudaaCourbeWizardImportScope(ui_); + FudaaCourbeWizardImportScope wizard=new FudaaCourbeWizardImportScope(ui_,target_); BuWizardDialog DialogWizard = new BuWizardDialog(ui_.getFrame(), wizard); // --affichage du wizard --// DialogWizard.setSize(600, 500); @@ -113,7 +126,7 @@ } - public FudaaCourbeWizardImportScope(FudaaCommonImplementation impl) { + public FudaaCourbeWizardImportScope(FudaaCommonImplementation impl,FudaaCourbeImporter.Target target) { super(); impl_=impl; @@ -301,10 +314,10 @@ for(int i=1;i<dataST().getNbVariables();i++) listeVar[i-1]=dataST().getVariable(i); - listVariables_=new JList(listeVar); - listVariables_.setSelectedIndex(0); - content.add(listVariables_,BorderLayout.CENTER); - listVariables_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); + listVariablesST_=new JList(listeVar); + listVariablesST_.setSelectedIndex(0); + content.add(listVariablesST_,BorderLayout.CENTER); + listVariablesST_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); plageDeb_.setCharValidator(BuCharValidator.FLOAT); plageDeb_.setStringValidator(BuStringValidator.FLOAT); @@ -331,14 +344,216 @@ } + + JComboBox comBoChoixTypeGraphe_=new JComboBox(new String[]{TrResource.getS("Profil Spatial"),TrResource.getS("Evolution temporelle"),TrResource.getS("Corr\xE9lation")}); + JList listSeparator_,listSeparatorDebPlage_,listSeparatorFinPlage_, listSeparatorCorrel1_,listSeparatorCorrel2_; + JList listVariablesGENE_,listVariablesGENE2_,listVariablesGENECorrlX_,listVariablesGENECorrlY_; + CardLayout layoutParamGene=new CardLayout(); + BuTextField fieldX=new BuTextField(10); /** + * Liste des couples a importer. + * Ces couples utilisent la classe coupleVarSepartor + */ + JList listCoupleSpatiauxGENE_; + DefaultListModel modelCoupleSpatiauxGENE_; + public class CoupleVarSepartor{ + String nomVar,nomSeparator; + ArrayList<Double> listX; + ArrayList<Double> listY; + public CoupleVarSepartor(String nomVar, String nomSeparator, + ArrayList<Double> listX, ArrayList<Double> listY) { + this.nomVar = nomVar; + this.nomSeparator = nomSeparator; + this.listX = listX; + this.listY = listY; + } + @Override + public String toString() { + // TODO Auto-generated method stub + return "("+nomVar+"/"+nomSeparator+")"; + } + + public EvolutionReguliere transform(boolean _time){ + double[] tabX = new double[listX.size()]; + double[] tabY = new double[listY.size()]; + for (int j = 0; j < listX.size(); j++) { + tabX[j] = listX.get(j); + tabY[j] = listY.get(j); + } + EvolutionReguliere evol=new EvolutionReguliere(tabX, tabY,_time); + evol.setNom(nomVar+" "+nomSeparator); + return evol; + } + + } + + /** * Creation du panel scopGene pour choisir ses parametres * @return */ JPanel buildPanelScopeGENE(){ + final JPanel content=new JPanel(new BorderLayout()); + content.add(comBoChoixTypeGraphe_,BorderLayout.NORTH); + final JPanel container=new JPanel(layoutParamGene); + content.add(container,BorderLayout.CENTER); + comBoChoixTypeGraphe_.setAction(new AbstractAction(){ + public void actionPerformed(ActionEvent arg0) { + String val=(String) comBoChoixTypeGraphe_.getSelectedItem(); + layoutParamGene.show(container, val); + //layoutParamGene.next(container); +// content.revalidate(); +// container.revalidate(); + + } + }); + + //-- ACHTUNG!!! DANS LES SPEC ON VEUT POUVOIR SAISIR DES COUPLES SEPARATOR/VARIABLES --// + //-- creation de la liste des variables --// + String[] listeVar=new String[dataG().getNbVariables()-1]; + //on ne prends pas les x + for(int i=1;i<dataG().getNbVariables();i++) + 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"))); - return null; + //-- creation de la liste des separators --// + listeVar=new String[dataG().getNbSeparator()]; + //on ne prends pas les x + for(int i=0;i<dataG().getNbSeparator();i++) + 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_); + 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); + //-- 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(){ + public void actionPerformed(ActionEvent e) { + if(listSeparator_.getSelectedIndex()==-1) + impl_.error(TrResource.getS("Il faut choisir une valeur num\xE9rique de s\xE9parateur.")); + else if(listVariablesGENE_.getSelectedIndex()==-1) + impl_.error(TrResource.getS("Il faut choisir une variable.")); + else{ + //-- creation du couple choisi en recherchant les bonnes donn\xE9es dans la structure --// + int indiceVarChoisie=listVariablesGENE_.getSelectedIndex()+1; + String varChoisie=dataG().getVariable(indiceVarChoisie); + String separatorChoisi=dataG().getSeparator(listSeparator_.getSelectedIndex()); + CoupleVarSepartor newCouple=new CoupleVarSepartor(varChoisie,separatorChoisi,dataG().getAllX(separatorChoisi),dataG().getListValueForVariableForSeparator(separatorChoisi,indiceVarChoisie)); + modelCoupleSpatiauxGENE_.addElement(newCouple); + } + } + + }); + BuButton supprimer=new BuButton(FudaaResource.FUDAA.getIcon("crystal_enlever"), TrResource.getS("Enlever")); + supprimer.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e) { + if(listCoupleSpatiauxGENE_.getSelectedIndex()==-1) + impl_.error(TrResource.getS("Il faut choisir une valeur du couple \xE0 supprimer")); + + else{ + modelCoupleSpatiauxGENE_.remove(listCoupleSpatiauxGENE_.getSelectedIndex()); + } + } + + }); + //ajout des boutons + JPanel panelActions=new JPanel(new FlowLayout()); + panelActions.add(ajouter); + panelActions.add(supprimer); + paramProfils.add(panelActions, BorderLayout.SOUTH); + + //-- panel reserv\xE9 aux courbes temporelles --// + JPanel paramTempo=new JPanel(new BorderLayout()); + container.add(paramTempo, TrResource.getS("Evolution temporelle")); + listeVar=new String[dataG().getNbVariables()-1]; + for(int i=1;i<dataG().getNbVariables();i++) + 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_); + listData.add(listData2); + listData2.add(listSeparatorDebPlage_); + listData2.add(listSeparatorFinPlage_); + paramTempo.add(listData,BorderLayout.CENTER); + + //textField contenant le x choisi + xMax=dataG().getXMax(); + xMin=dataG().getXMin(); + JPanel panelInfo=new JPanel(); + panelInfo.add(new JLabel(TrResource.getS("Veuillez saisir le X:") +xMin+"<=X<="+xMax)); + fieldX.setCharValidator(BuCharValidator.FLOAT); + fieldX.setStringValidator(BuStringValidator.FLOAT); + fieldX.setValueValidator(BuValueValidator.FLOAT); + panelInfo.add(fieldX); + paramTempo.add(panelInfo,BorderLayout.SOUTH); + fieldX.setText(""+((xMax+xMin)/2)); + + + + //-- panel reserv\xE9s au corr\xE9lations --// + JPanel paramCorrel=new JPanel(new GridLayout(2,2)); + container.add(paramCorrel, TrResource.getS("Corr\xE9lation")); + + listeVar=new String[dataG().getNbVariables()-1]; + for(int i=1;i<dataG().getNbVariables();i++) + 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()]; + for(int i=0;i<dataG().getNbSeparator();i++) + 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_); + + return content; } JPanel buildPanelParametresImportation(){ @@ -403,27 +618,57 @@ impl_.setMainMessage(CtuluLib.getS("Structure modification")); prog.setProgression(10); prog.setDesc(CtuluLib.getS("Structure modification")); - if(typeFormat_<=1) - dataST().restreindreStructure(listVariables_.getSelectedIndices(),Double.parseDouble(plageDeb_.getText()),Double.parseDouble(plageFin_.getText())); - - + if(typeFormat_<=1){ + dataST().restreindreStructure(listVariablesST_.getSelectedIndices(),Double.parseDouble(plageDeb_.getText()),Double.parseDouble(plageFin_.getText())); impl_.setMainProgression(30); impl_.setMainMessage(CtuluLib.getS("Cr\xE9ation du graphe")); - // creation du graphe - switch(typeFormat_){ - case 0: - //cas s - result_=FudaaCourbeImporterScope.createGrapheSpatialGraphe(dataST(),prog);break; - case 1: - //cas scopT - result_=FudaaCourbeImporterScope.createGrapheTemporel(dataST(),prog);break; - case 2: - //cas scopGENE - result_=FudaaCourbeImporterScope.createGrapheTemporelGENE(dataG(),prog);break; - } - - //-- mise en forme du resultata g\xE9n\xE9r\xE9 --// - createGraphImported(result_); + FudaaCourbeImporterScope.createGraphe(target_, data_, null, prog); + } + else{ + //-- format scopeGen, selon le type de format g\xE9n\xE9r\xE9--// + if(comBoChoixTypeGraphe_.getSelectedIndex()==0){ + //profil spatial, on recupere la liste des couples solutions + EvolutionReguliere[] tabEvol=new EvolutionReguliere[modelCoupleSpatiauxGENE_.getSize()]; + for(int i=0;i<modelCoupleSpatiauxGENE_.getSize();i++) + tabEvol[i]=((CoupleVarSepartor) modelCoupleSpatiauxGENE_.getElementAt(i)).transform(false); + + impl_.setMainProgression(30); + impl_.setMainMessage(CtuluLib.getS("Cr\xE9ation du graphe")); + FudaaCourbeImporterScope.createGraphe(target_, tabEvol, null, prog); + }else + if(comBoChoixTypeGraphe_.getSelectedIndex()==1){ + //profil spatial + int debSeparator=listSeparatorDebPlage_.getSelectedIndex(); + int finSeparator=listSeparatorFinPlage_.getSelectedIndex(); + int[] selectedVariables= listVariablesGENE2_.getSelectedIndices(); + double xchoosen=Double.parseDouble(fieldX.getText()); + dataG().restreindreStructure(debSeparator,finSeparator,selectedVariables,xchoosen); + + impl_.setMainProgression(30); + impl_.setMainMessage(CtuluLib.getS("Cr\xE9ation du graphe")); + //on cree les evol reguliere SPECIFIQUES pour ces courbes. + FudaaCourbeImporterScope.createGraphe(target_, dataG().returnEvolRegulierePourTemporelles(), null, prog); + + }else{ + //correlation + impl_.setMainProgression(30); + impl_.setMainMessage(CtuluLib.getS("Cr\xE9ation du graphe")); + //on cree les evol reguliere SPECIFIQUES pour ces courbes. + int varX=listVariablesGENECorrlX_.getSelectedIndex(); + int varY=listVariablesGENECorrlY_.getSelectedIndex(); + + int plageX=listSeparatorCorrel1_.getSelectedIndex(); + int plageY=listSeparatorCorrel2_.getSelectedIndex(); + + FudaaCourbeImporterScope.createGraphe(target_, dataG().returnEvolReguliereCorrelation(varX,varY,plageX,plageY), null, prog); + + + } + + } + + //-- mise en forme du resultata g\xE9n\xE9r\xE9 --// + createGraphImported(); } }.start(); } @@ -433,7 +678,7 @@ * Methode a surcharger. * Appel\xE9e a la toute fin, gere le resultat */ - public void createGraphImported(EGGraphe grapheGenere){ + public void createGraphImported(){ //placer le graphe ou vous voulez... } 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-02 16:17:18 UTC (rev 4024) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -2,6 +2,7 @@ import java.io.File; import java.io.IOException; +import java.util.ArrayList; import jxl.write.WriteException; @@ -65,8 +66,8 @@ EGCourbe[] listeChoixUser = data.getCourbes(); //-- on ajoute un pas de temps qui decrit le graphe --// - String keyPDt="contenu graphe"; - structure_.addPasDeTemps(keyPDt); + String keyPDt="X=contenu graphe"; + structure_.addSeparator(keyPDt); @@ -107,6 +108,8 @@ 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>()); } // --ajout des valeurs pour chaque X--/ @@ -129,10 +132,10 @@ // -- si le x existe dans la courbe alors on inscrit son y // correspondant pour la bonne variable--// if (xExistForCourbe) - structure_.addValueForVariableAtPdt(courbe.getModel().getY(emplacementYcorrespondant), structure_.getNbVariables()-1, keyPDt); + structure_.addValueForVariableAtSeparator(courbe.getModel().getY(emplacementYcorrespondant), structure_.getNbVariables()-1, keyPDt); else // -- on enregistre une valeure foireuse. - structure_.addValueForVariableAtPdt(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables()-1, keyPDt); + structure_.addValueForVariableAtSeparator(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables()-1, keyPDt); } } Added: 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 (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -0,0 +1,36 @@ +package org.fudaa.fudaa.tr.common; + +import java.awt.event.ActionEvent; + +import org.fudaa.ebli.commun.EbliActionSimple; +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.TrPostDialogCurrentLine; +import org.fudaa.fudaa.tr.post.TrPostProjet; +import org.fudaa.fudaa.tr.post.TrPostVisuPanel; + +public class TrPostActionLigneCourants extends EbliActionSimple { + + // final MvProfileTarget src_; + TrPostProjet projet_; + + + public TrPostActionLigneCourants(TrPostProjet projet) { + super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); + projet_=projet; + + } + + + + public void actionPerformed(final ActionEvent _e) { + // -- creation du wizard depusi le calque --// + + new TrPostDialogCurrentLine(projet_,projet_.getImpl()); + } + + + + } Added: 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 (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -0,0 +1,198 @@ +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; +} + + + +} Modified: 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/TrPostDialogCubature.java 2008-10-02 16:17:18 UTC (rev 4024) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -343,7 +343,7 @@ } public String getTitle() { - return TrResource.getS("Bilans"); + return TrResource.getS("Cubatures"); } Added: 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 (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java 2008-10-02 18:32:19 UTC (rev 4025) @@ -0,0 +1,392 @@ +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_.setStringVa... [truncated message content] |
From: <emm...@us...> - 2008-10-02 16:17:28
|
Revision: 4024 http://fudaa.svn.sourceforge.net/fudaa/?rev=4024&view=rev Author: emmanuel_martin Date: 2008-10-02 16:17:18 +0000 (Thu, 02 Oct 2008) Log Message: ----------- pr?\195?\169 commit sur l'ajout de l'etat des g?\195?\169om?\195?\169tries 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/GISAttributeString.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.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/MdlModel2dProfile.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java Added 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/gis/GISAttributeConstants.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2008-10-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -10,11 +10,12 @@ import java.util.ArrayList; import java.util.List; -import com.memoire.fu.FuLib; - import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.gui.CtuluValueEditorStringRestricted; +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 @@ -27,8 +28,6 @@ /** Etat geom modifi\xE9. */ public final static String ATT_VAL_ETAT_MODI="MODI"; - /** Etat geom cr\xE9\xE9 */ - public final static String ATT_VAL_ETAT_CREE="CREE"; /** Etat geom origine */ public final static String ATT_VAL_ETAT_ORIG="ORIG"; @@ -97,8 +96,8 @@ return res; } - public static List getDefaults() { - final ArrayList l = new ArrayList(2); + public static List<GISAttribute> getDefaults() { + final ArrayList<GISAttribute> l = new ArrayList<GISAttribute>(2); l.add(BATHY); l.add(TITRE); l.add(NATURE); @@ -154,17 +153,19 @@ /** * Un attribut etat, global a la g\xE9om\xE9trie. */ - public final static GISAttributeString ETAT_GEOM = new GISAttributeString(CtuluLib.getS("Etat"), false) { + 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 String getID() { return "ATTRIBUTE_ETAT_GEOM"; } public boolean isEditable() { - return false; + return true; } public Object getDefaultValue() { - return ATT_VAL_ETAT_CREE; + return ATT_VAL_ETAT_ORIG; } }; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeString.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeString.java 2008-10-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeString.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -33,6 +33,9 @@ public GISAttributeString(final CtuluValueEditorI _edit,final String _name) { super(_edit, _name); } + public GISAttributeString(final CtuluValueEditorI _edit, final String _name, final boolean _atomic) { + super(_edit, _name, _atomic); + } public final Class getDataClass(){ return String.class; Added: 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 (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorStringRestricted.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -0,0 +1,196 @@ +/* + * @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_); + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorStringRestricted.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java 2008-10-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -151,12 +151,13 @@ } } } + modelesNewValues_=null; } final CoordinateSequence newSeq = this.getNewCoordinateSequence(); if (newSeq != null) { zone_.setCoordinateSequence(idx_, newSeq, _cmp); } - + rowNewCoordinates_=null; } } @@ -169,6 +170,10 @@ GISZoneCollection zone_; EbliFormatterInterface xyFormatter_; + public boolean isModified(){ + return modelesNewValues_!=null||rowNewCoordinates_!=null; + } + public EbliAtomicCoordinatesTableModel(final EbliFormatterInterface _formatter, final GISZoneCollection _zone, final int[] _selectedAtomic) { zone_ = _zone; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-10-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -40,6 +40,7 @@ import org.fudaa.ctulu.CtuluListSelectionEvent; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluListSelectionListener; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeDouble; import org.fudaa.ctulu.gis.GISAttributeModel; import org.fudaa.ctulu.gis.GISCoordinateSequenceUnique; @@ -183,19 +184,39 @@ * Enregistre les modifications effectu\xE9es. */ public void apply() { + boolean modification=false; // true si une modification a \xE9t\xE9 faite // Cr\xE9ation d'une nouvelle commande final CtuluCommandComposite cmp=(cmd_==null ? null:new CtuluCommandComposite()); // Application des modifications des attributs globaux for (int i=globalAttr_.length-1; i>=0; i--) { final Object val=globalAttrEditor_[i].getValue(globalComp_[i]); + // Si une modificatin a \xE9t\xE9 faite, modification est mis \xE0 true, sauf si + // cette modification est faite sur ETAT_GEOM + modification = modification||(!val.equals(globalAttr_[i].getObjectValueAt(idx_))&&globalAttr_[i].getAttribute()!=GISAttributeConstants.ETAT_GEOM); globalAttr_[i].setObject(idx_, val, cmp); + } // Cas du tableau modifi\xE9 - if (isTableStat_) - model_.apply(cmp); + if (isTableStat_){ + if(model_.isModified()){ + modification = true; + model_.apply(cmp); + } + } // Cas du point unique modifi\xE9 - else if (zone_.isGeomModifiable()) + else if (zone_.isGeomModifiable()&&!zone_.getCoordinateSequence(idx_).equals(getNewCoordinate())){ + modification=true; zone_.setCoordinateSequence(idx_, getNewCoordinate(), cmp); + } + // Si une modification a \xE9t\xE9 faite, l'attribut 'Etat' de la g\xE9om\xE9trie passe \xE0 modifi\xE9 + if (modification) { + boolean found=false; + int i=-1; + while (!found&&++i<globalAttr_.length) + found=globalAttr_[i].getAttribute()==GISAttributeConstants.ETAT_GEOM; + if(found) + globalAttr_[i].setObject(idx_, GISAttributeConstants.ATT_VAL_ETAT_MODI, cmp); + } // Ajout de la nouvelle commande \xE0 cmd_ if (cmd_!=null) cmd_.addCmd(cmp.getSimplify()); 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-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -15,6 +15,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.ZCalqueLigneBrisee; import org.fudaa.ebli.calque.ZModeleLigneBrisee; import org.fudaa.ebli.calque.dessin.DeForme; @@ -52,7 +53,6 @@ private void addPoint(final int _ligneIdx, final int _idxBefore, final double _x, final double _y, final CtuluCommandContainer _cmd) { getModelePoly().addPoint(_ligneIdx, _idxBefore, _x, _y, _cmd); - } /** @@ -185,7 +185,15 @@ modele_.point(seg.e_, i, j); modele_.point(seg.o_, i, j-1); if (seg.distanceXY(ptToTest)<distanceReel) { - addPoint(i, j-1, ptToTest.x_, ptToTest.y_, _cmd); + // 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); return true; } } @@ -193,6 +201,14 @@ 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; } 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-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -31,6 +31,7 @@ super(_listener); GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.TITRE, + GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.NATURE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. 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-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -39,6 +39,7 @@ // GISAttribute attTry=new GISAttributeString("Nature",false); GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.BATHY, + GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE // attTry 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-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -30,6 +30,7 @@ super(_listener); GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.BATHY, + GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE }; 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-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -30,6 +30,7 @@ super(_listener); GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.TITRE, + GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.NATURE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. 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-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -32,6 +32,7 @@ super(_listener); GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.BATHY, + GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE }; 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-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -35,6 +35,7 @@ GISAttributeDouble zglob=new GISAttributeDouble(MdlResource.MDL.getString("Z"),false); GISAttribute[] attrs=new GISAttribute[]{ zglob, + GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE }; 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-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -31,6 +31,7 @@ super(_listener); GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.BATHY, + GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE }; 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-02 12:26:09 UTC (rev 4023) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java 2008-10-02 16:17:18 UTC (rev 4024) @@ -30,6 +30,7 @@ super(_listener); GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.TITRE, + GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.NATURE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-10-02 12:26:18
|
Revision: 4023 http://fudaa.svn.sourceforge.net/fudaa/?rev=4023&view=rev Author: emmanuel_martin Date: 2008-10-02 12:26:09 +0000 (Thu, 02 Oct 2008) Log Message: ----------- Modification du comportement de la fen?\195?\170tre d'edition de g?\195?\169ometry et correction d'un bug. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueEditionInteraction.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/commun/EbliActionPaletteAbstract.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2008-10-01 21:14:21 UTC (rev 4022) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2008-10-02 12:26:09 UTC (rev 4023) @@ -10,6 +10,8 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import javax.swing.event.InternalFrameEvent; +import javax.swing.event.InternalFrameListener; import javax.swing.event.TreeSelectionEvent; import javax.swing.tree.TreeSelectionModel; @@ -29,7 +31,7 @@ * @version $Id: CalqueGISEditionAction.java,v 1.6.6.2 2008-05-13 12:10:47 emartin Exp $ */ public class CalqueGISEditionAction extends EbliActionPaletteTreeModel implements PropertyChangeListener { - + private ZEditorDefault editor_; private ZScene scene_; private boolean hide_; // Vrai si le panel d'\xE9dition est ferm\xE9. @@ -103,6 +105,8 @@ hide_ = !hide_; if(hide_){ unactivePanel(); + if(editor_.getPanel().getController().getCqSelectionI()!=null) + editor_.getPanel().getController().getCqSelectionI().setGele(false); // Gele du calque d'edition if(calqueEdition_!=null) editor_.getPanel().unsetCalqueInteractionActif(calqueEdition_); @@ -134,6 +138,8 @@ */ public void valueChanged(final TreeSelectionEvent _e) { unactivePanel(); + if(editor_.getPanel().getController().getCqSelectionI()!=null) + editor_.getPanel().getController().getCqSelectionI().setGele(false); setTarget(getTarget((TreeSelectionModel) _e.getSource())); } @@ -148,4 +154,10 @@ unactivePanel(); } } + + public void internalFrameClosing(InternalFrameEvent e) { + unactivePanel(); + if(editor_.getPanel().getController().getCqSelectionI()!=null) + editor_.getPanel().getController().getCqSelectionI().setGele(false); + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueEditionInteraction.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueEditionInteraction.java 2008-10-01 21:14:21 UTC (rev 4022) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueEditionInteraction.java 2008-10-02 12:26:09 UTC (rev 4023) @@ -1432,20 +1432,23 @@ * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent) */ public void keyPressed(KeyEvent _e) { - getFormeEnCours().keyPressed(_e); + if(getFormeEnCours()!=null) + getFormeEnCours().keyPressed(_e); } /* (non-Javadoc) * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent) */ public void keyReleased(KeyEvent _e) { - getFormeEnCours().keyReleased(_e); + if(getFormeEnCours()!=null) + getFormeEnCours().keyReleased(_e); } /* (non-Javadoc) * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent) */ public void keyTyped(KeyEvent _e) { - getFormeEnCours().keyTyped(_e); + if(getFormeEnCours()!=null) + getFormeEnCours().keyTyped(_e); } } 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-01 21:14:21 UTC (rev 4022) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2008-10-02 12:26:09 UTC (rev 4023) @@ -15,7 +15,6 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluUI; -import org.fudaa.ctulu.gis.GISPolygone; import org.fudaa.ebli.calque.ZCalqueLigneBrisee; import org.fudaa.ebli.calque.ZModeleLigneBrisee; import org.fudaa.ebli.calque.dessin.DeForme; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/EbliActionPaletteAbstract.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/EbliActionPaletteAbstract.java 2008-10-01 21:14:21 UTC (rev 4022) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/EbliActionPaletteAbstract.java 2008-10-02 12:26:09 UTC (rev 4023) @@ -10,7 +10,6 @@ import java.awt.Dialog; import java.awt.Dimension; import java.awt.Point; -import java.awt.Window; import java.awt.event.MouseWheelListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -23,19 +22,20 @@ import javax.swing.JInternalFrame; import javax.swing.SwingUtilities; import javax.swing.event.InternalFrameEvent; +import javax.swing.event.InternalFrameListener; +import org.fudaa.ctulu.gui.CtuluLibSwing; + import com.memoire.bu.BuDesktop; import com.memoire.bu.BuLib; import com.memoire.bu.BuPalette; -import org.fudaa.ctulu.gui.CtuluLibSwing; - /** * Une action d\xE9clenchant l'affichage d'une palette. * @author deniger * @version $Id: EbliActionPaletteAbstract.java,v 1.21 2007-06-13 12:57:45 deniger Exp $ */ -public abstract class EbliActionPaletteAbstract extends EbliActionChangeState { +public abstract class EbliActionPaletteAbstract extends EbliActionChangeState implements InternalFrameListener { private static int nbr_ = -1; JDialog dial_; @@ -84,6 +84,7 @@ window_.setContent(buildContentPane); window_.getContentPane().setFocusable(true); window_.pack(); + window_.addInternalFrameListener(this); } } @@ -281,4 +282,38 @@ public void updateStateBeforeShow() {} + /* (non-Javadoc) + * @see javax.swing.event.InternalFrameListener#internalFrameActivated(javax.swing.event.InternalFrameEvent) + */ + public void internalFrameActivated(InternalFrameEvent e) {} + + /* (non-Javadoc) + * @see javax.swing.event.InternalFrameListener#internalFrameClosed(javax.swing.event.InternalFrameEvent) + */ + public void internalFrameClosed(InternalFrameEvent e) {} + + /* (non-Javadoc) + * @see javax.swing.event.InternalFrameListener#internalFrameClosing(javax.swing.event.InternalFrameEvent) + */ + public void internalFrameClosing(InternalFrameEvent e) {} + + /* (non-Javadoc) + * @see javax.swing.event.InternalFrameListener#internalFrameDeactivated(javax.swing.event.InternalFrameEvent) + */ + public void internalFrameDeactivated(InternalFrameEvent e) {} + + /* (non-Javadoc) + * @see javax.swing.event.InternalFrameListener#internalFrameDeiconified(javax.swing.event.InternalFrameEvent) + */ + public void internalFrameDeiconified(InternalFrameEvent e) {} + + /* (non-Javadoc) + * @see javax.swing.event.InternalFrameListener#internalFrameIconified(javax.swing.event.InternalFrameEvent) + */ + public void internalFrameIconified(InternalFrameEvent e) {} + + /* (non-Javadoc) + * @see javax.swing.event.InternalFrameListener#internalFrameOpened(javax.swing.event.InternalFrameEvent) + */ + public void internalFrameOpened(InternalFrameEvent e) {} } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-10-01 21:14:35
|
Revision: 4022 http://fudaa.svn.sourceforge.net/fudaa/?rev=4022&view=rev Author: deniger Date: 2008-10-01 21:14:21 +0000 (Wed, 01 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsMng.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/post/TrPostDialogBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsMng.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsMng.java 2008-10-01 21:04:27 UTC (rev 4021) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsMng.java 2008-10-01 21:14:21 UTC (rev 4022) @@ -84,23 +84,35 @@ public static final EfLineIntersection[] NO_DATA = new EfLineIntersection[0]; + protected static double[] computeDist(EfLineIntersectionsResultsI _res) { + final double[] dist = new double[_res.getNbIntersect()]; + for (int i = 1; i < dist.length; i++) { + EfLineIntersection i1 = _res.getIntersect(i - 1); + EfLineIntersection i2 = _res.getIntersect(i); + double distance = CtuluLibGeometrie.getDistance(i1.getX(), i1.getY(), i2.getX(), i2.getY()); + if (distance <= 0) { + System.err.println("erreur!"); + } + dist[i] = dist[i - 1] + distance; + } + return dist; + } + final EfLineIntersection[] datas_; + EfLineIntersectionsResultsI defaultRes_; double[] dist_; + final boolean forMesh_; - final EfGridDataInterpolator grid_; final LineString initLine_; + final boolean isInit_; final BitSet isOut_; + boolean isOutRemoved_; - final boolean isInit_; EfNeighborMesh neighbor_; - public EfLineIntersectionsResultsBuilder createBuilder(EfLineIntersectionsCorrectionTester _tester) { - return new EfLineIntersectionsResultsBuilder(getDefaultRes(), _tester); - } - EfLineIntersectionsResultsMng(final EfGridDataInterpolator _grid, final EfLineIntersection[] _dataPerSeg, final BitSet _isOut, final LineString _string, final boolean _forMesh) { super(); @@ -128,28 +140,34 @@ } - protected static double[] computeDist(EfLineIntersectionsResultsI _res) { - final double[] dist = new double[_res.getNbIntersect()]; - for (int i = 1; i < dist.length; i++) { - EfLineIntersection i1 = _res.getIntersect(i - 1); - EfLineIntersection i2 = _res.getIntersect(i); - double distance = CtuluLibGeometrie.getDistance(i1.getX(), i1.getY(), i2.getX(), i2.getY()); - if (distance <= 0) { - System.err.println("erreur!"); - } - dist[i] = dist[i - 1] + distance; - } - return dist; + public void buildNeighbor(final ProgressionInterface _prog) { + neighbor_ = EfNeighborMesh.compute(grid_.getGridData().getGrid(), _prog); } - private void initSeg() { - for (int i = datas_.length - 1; i >= 0; i--) { - datas_[i].setParent(this); + public EfLineIntersectionsResultsBuilder createBuilder(EfLineIntersectionsCorrectionTester _tester) { + return new EfLineIntersectionsResultsBuilder(getDefaultRes(), _tester); + } + + public EfLineIntersectionsResultsMng extract(final int _i1, final int _i2) { + final int nb = _i2 - _i1 + 1; + // on ne fait pas car c'est pas normal. + if (nb <= 1 || nb == datas_.length || datas_.length <= 2) { + return this; } + final EfLineIntersection[] newRes = new EfLineIntersection[nb]; + final BitSet out = new BitSet(nb - 1); + for (int i = _i1; i <= _i2; i++) { + final int j = i - _i1; + newRes[j] = datas_[i]; + out.set(j, isOut_.get(i)); + } + return new EfLineIntersectionsResultsMng(this, newRes, out, isOutRemoved_); + } - public void buildNeighbor(final ProgressionInterface _prog) { - neighbor_ = EfNeighborMesh.compute(grid_.getGridData().getGrid(), _prog); + public EfLineIntersectionsResultsI getDefaultRes() { + if (defaultRes_ == null) defaultRes_ = new EfLineIntersectionsResultsDefault(this); + return defaultRes_; } public double getFoundDistFromDeb(final int _idxInter) { @@ -159,10 +177,6 @@ return dist_[_idxInter]; } - public EfGridInterface getGrid() { - return grid_.getGridData().getGrid(); - } - public EfLineIntersection getFoundIntersect(final int _i) { return datas_[_i]; } @@ -171,10 +185,44 @@ return datas_ == null ? 0 : datas_.length; } + public EfGridInterface getGrid() { + return grid_.getGridData().getGrid(); + } + + public EfGridDataInterpolator getGridData() { + return grid_; + } + + /** + * @return the initLine la ligne utilisee pour construire les intersections. + */ + public LineString getInitLine() { + return initLine_; + } + public EfNeighborMesh getNeighbor() { return neighbor_; } + private void initSeg() { + for (int i = datas_.length - 1; i >= 0; i--) { + datas_[i].setParent(this); + } + } + + public EfLineIntersectionsResultsMng inversion() { + final EfLineIntersection[] newInter = new EfLineIntersection[datas_.length]; + int n = datas_.length - 1; + final BitSet newOut = new BitSet(n); + for (int i = n; i >= 0; i--) { + newInter[i] = datas_[n - i]; + newOut.set(i, isOut_.get(n - i)); + } + final EfLineIntersectionsResultsMng res = new EfLineIntersectionsResultsMng(this, newInter, newOut, true); + return res; + + } + public boolean isAllOut() { for (int i = getFoundNbIntersect() - 1; i >= 0; i--) { if (getFoundIntersect(i).isRealIntersection()) { @@ -188,13 +236,18 @@ return getFoundNbIntersect() == 0 || isAllOut(); } - EfLineIntersectionsResultsI defaultRes_; + public boolean isForMesh() { + return forMesh_; + } - public EfLineIntersectionsResultsI getDefaultRes() { - if (defaultRes_ == null) defaultRes_ = new EfLineIntersectionsResultsDefault(this); - return defaultRes_; + public boolean isInit() { + return isInit_; } + public boolean isOutRemoved() { + return isOutRemoved_; + } + public boolean isSegmentIn(final int _idxInters) { return !isSegmentOut(_idxInters); } @@ -203,43 +256,6 @@ return isOut_.get(_idxInters); } - public EfLineIntersectionsResultsMng restoreInit(final ProgressionInterface _prog) { - if (isInit_) { - return this; - } - return new EfLineIntersectorActivity(grid_).computeFor(initLine_, _prog, forMesh_); - } - - public EfLineIntersectionsResultsMng extract(final int _i1, final int _i2) { - final int nb = _i2 - _i1 + 1; - // on ne fait pas car c'est pas normal. - if (nb <= 1 || nb == datas_.length || datas_.length <= 2) { - return this; - } - final EfLineIntersection[] newRes = new EfLineIntersection[nb]; - final BitSet out = new BitSet(nb - 1); - for (int i = _i1; i <= _i2; i++) { - final int j = i - _i1; - newRes[j] = datas_[i]; - out.set(j, isOut_.get(i)); - } - return new EfLineIntersectionsResultsMng(this, newRes, out, isOutRemoved_); - - } - - public EfLineIntersectionsResultsMng inversion() { - final EfLineIntersection[] newInter = new EfLineIntersection[datas_.length]; - int n = datas_.length - 1; - final BitSet newOut = new BitSet(n); - for (int i = n; i >= 0; i--) { - newInter[i] = datas_[n - i]; - newOut.set(i, isOut_.get(n - i)); - } - final EfLineIntersectionsResultsMng res = new EfLineIntersectionsResultsMng(this, newInter, newOut, true); - return res; - - } - public EfLineIntersectionsResultsMng removeExt() { if (isOutRemoved_) { return this; @@ -264,20 +280,11 @@ } - public boolean isInit() { - return isInit_; + public EfLineIntersectionsResultsMng restoreInit(final ProgressionInterface _prog) { + if (isInit_) { + return this; + } + return new EfLineIntersectorActivity(grid_).computeFor(initLine_, _prog, forMesh_); } - public boolean isOutRemoved() { - return isOutRemoved_; - } - - public boolean isForMesh() { - return forMesh_; - } - - public EfGridDataInterpolator getGridData() { - return grid_; - } - } 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-01 21:04:27 UTC (rev 4021) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-01 21:14:21 UTC (rev 4022) @@ -91,6 +91,8 @@ //choix donnees S et T BuTextField plageDeb_=new BuTextField(5); BuTextField plageFin_=new BuTextField(5); + double xMin; + double xMax; JList listVariables_; @@ -145,13 +147,11 @@ @Override public int getStepCount() { - // TODO Auto-generated method stub return 2; } @Override public String getStepText() { - // TODO Auto-generated method stub return null; } @@ -292,7 +292,6 @@ * Construit le panel de choix des donn\xE9es a importer pour les formats s et t * @return */ - double Xmin,Xmax; JPanel buildPanelScopeSorT(){ JPanel content=new JPanel(new BorderLayout()); @@ -315,17 +314,17 @@ plageFin_.setValueValidator(BuValueValidator.FLOAT); //-- on init les plages --// - Xmin=dataST().getXMin(); - plageDeb_.setText(""+Xmin); - Xmax=dataST().getXMax(); - plageFin_.setText(""+Xmax); + xMin=dataST().getXMin(); + plageDeb_.setText(""+xMin); + xMax=dataST().getXMax(); + plageFin_.setText(""+xMax); JPanel plages=new JPanel(new FlowLayout(FlowLayout.CENTER)); plages.add(new JLabel(TrResource.getS("Choisir la plage des abscisses"))); plages.add(plageDeb_); plages.add(new JLabel("-")); plages.add(plageFin_); - plages.add(new JLabel("(Min: "+Xmin+", Max: "+Xmax+")")); + plages.add(new JLabel("(Min: "+xMin+", Max: "+xMax+")")); content.add(plages,BorderLayout.SOUTH); return content; @@ -381,7 +380,7 @@ //verifier que les plages ne sont pas depassees double valDeb=Double.parseDouble(plageDeb_.getText()); double valFin=Double.parseDouble(plageFin_.getText()); - if(valDeb<Xmin || Xmax<valFin) + if(valDeb<xMin || xMax<valFin) r |= BuButtonPanel.TERMINER; } Modified: 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/TrPostDialogBilan.java 2008-10-01 21:04:27 UTC (rev 4021) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java 2008-10-01 21:14:21 UTC (rev 4022) @@ -32,6 +32,7 @@ import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.ef.EfData; import org.fudaa.dodico.ef.EfDataIntegrale; +import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsBuilder; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsMng; import org.fudaa.dodico.ef.operation.EfLineIntersectorActivity; @@ -40,6 +41,7 @@ import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.fudaa.commun.FudaaLib; +import org.fudaa.fudaa.meshviewer.profile.MvProfileCoteTester; import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import org.fudaa.fudaa.tr.common.TrResource; @@ -54,35 +56,34 @@ * Wizard pour gerer les bilans des courbes. * * @author Adrien Hadoux - * */ public class TrPostDialogBilan { /** * booleen qui indique si le wizard a \xE9t\xE9t lanc\xE9 depuis un calque */ - + private boolean startWithCalque_ = true; TrPostSource source_; TrPostVisuPanel calque_; MvProfileTreeModel modelGraphe_; TrPostCommonImplementation impl_; EfDataIntegrale resCalcul_ = new EfDataIntegrale(); - + // donnees graphiques JDialog dialog_; - + // seuil private JPanel panelSeuil_; BuTextField seuil_ = new BuTextField(5); - + // variables et pdt private JPanel panelVariables_; ListModel modelVariables_; JList listVar_; ListModel modelPdt_; JList listPdt_; - + // isolignes private JPanel panelIsolignes_; JCheckBox boxSelectLineAuto_ = new JCheckBox(TrResource.getS("Choisir l'isoligne du calque")); @@ -91,13 +92,13 @@ BuTextField textX2 = new BuTextField(10); BuTextField textY1 = new BuTextField(10); BuTextField textY2 = new BuTextField(10); - + // results JPanel panelResults_; JLabel results_; JButton ajouter_ = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); DefaultTableModel modelResult_; - + /** * Constructeur reserv\xE9 au calques * @@ -115,7 +116,7 @@ modelVariables_ = source_.getNewVarListModel(); modelPdt_ = source_.getNewTimeListModel(); startWithCalque_ = true; - + // -- construction de la dialog --// buildDialog(); } @@ -140,21 +141,21 @@ // -- construction de la dialog --// buildDialog(); } - + /** * Construit le panel des variables * * @return */ private JPanel buildIsoLignes() { - JPanel content=new JPanel(new BorderLayout()); + JPanel content = new JPanel(new BorderLayout()); JPanel panelChek = new JPanel(new FlowLayout(FlowLayout.CENTER)); panelChek.add(new JLabel(TrResource.getS("Choisir l'isoligne du calque"))); panelChek.add(boxSelectLineAuto_); panelChek.add(new JLabel(TrResource.getS("Cr\xE9er manuellement l'isoligne"))); panelChek.add(boxSelectLineManu_); content.add(panelChek, BorderLayout.NORTH); - + JPanel center = new JPanel(new GridLayout(2, 1)); JPanel center1 = new JPanel(new FlowLayout(FlowLayout.CENTER)); center1.add(new JLabel("Point 1 X:")); @@ -170,7 +171,7 @@ center.add(center2); content.add(center, BorderLayout.CENTER); content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de l'isoligne"))); - + // -- init et gestion des evenements --// textX1.setCharValidator(BuCharValidator.FLOAT); textX1.setStringValidator(BuStringValidator.FLOAT); @@ -187,7 +188,7 @@ textY2.setCharValidator(BuCharValidator.FLOAT); textY2.setStringValidator(BuStringValidator.FLOAT); textY2.setValueValidator(BuValueValidator.FLOAT); - + boxSelectLineAuto_.setAction(new AbstractAction() { public void actionPerformed(ActionEvent _e) { boolean enabled = false; @@ -196,10 +197,8 @@ textY1.setEnabled(enabled); textY2.setEnabled(enabled); boxSelectLineManu_.setSelected(false); - if (boxSelectLineAuto_.isSelected()) - ajouter_.setEnabled(true); - else - ajouter_.setEnabled(false); + if (boxSelectLineAuto_.isSelected()) ajouter_.setEnabled(true); + else ajouter_.setEnabled(false); } }); @@ -211,14 +210,12 @@ textY1.setEnabled(enabled); textY2.setEnabled(enabled); boxSelectLineAuto_.setSelected(false); - if (boxSelectLineManu_.isSelected()) - ajouter_.setEnabled(true); - else - ajouter_.setEnabled(false); + if (boxSelectLineManu_.isSelected()) ajouter_.setEnabled(true); + else ajouter_.setEnabled(false); } }); - + // -- test si une ligne a ete au prealable selectionnee par l user sur le // calque --// if (calque_ != null && getSelectedLineOfCalque() != null) { @@ -229,14 +226,14 @@ textY1.setEnabled(enabled); textY2.setEnabled(enabled); boxSelectLineManu_.setSelected(false); - + } else { boxSelectLineAuto_.setSelected(false); boxSelectLineManu_.setSelected(true); // impossible de choisir cetet checkbox boxSelectLineAuto_.setEnabled(false); } - + return content; } @@ -250,29 +247,27 @@ double y1 = Double.parseDouble(textY1.getText()); double x2 = Double.parseDouble(textX2.getText()); double y2 = Double.parseDouble(textY2.getText()); - - + final Coordinate[] cs = new Coordinate[2]; cs[0] = new Coordinate(x1, y1); cs[1] = new Coordinate(x2, y2); - + return GISGeometryFactory.INSTANCE.createLineString(cs); } - - + 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(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() { @@ -283,32 +278,30 @@ } }); - + modelResult_ = new DefaultTableModel() { public int getColumnCount() { return 3; } + public String getColumnName(int _column) { - if (_column == 0) - return "Zone positive"; - else if (_column == 1) - return "Zone n\xE9gative"; - else - return "R\xE9sultat"; + if (_column == 0) return "Zone positive"; + else if (_column == 1) return "Zone n\xE9gative"; + else return "R\xE9sultat"; } + public int getRowCount() { return 1; } + public boolean isCellEditable(int _row, int _column) { return false; } + public Object getValueAt(int _row, int _column) { - if (_column == 1) - return resCalcul_.getZoneMoins(); - else if (_column == 0) - return resCalcul_.getZonePlus(); - else - return resCalcul_.getResultat(); + if (_column == 1) return resCalcul_.getZoneMoins(); + else if (_column == 0) return resCalcul_.getZonePlus(); + else return resCalcul_.getResultat(); } }; @@ -318,43 +311,42 @@ conteneur.add(content, BorderLayout.SOUTH); return conteneur; } - - + public boolean controleDataOk() { if (boxSelectLineManu_.isSelected()) { - if (textX1.getText().equals("")){ - impl_.error(TrResource.getS("Point non saisi correctement")); - return false; - + if (textX1.getText().equals("")) { + impl_.error(TrResource.getS("Point non saisi correctement")); + return false; + } - if (textX2.getText().equals("")){ - impl_.error(TrResource.getS("Point non saisi correctement")); - return false; - + if (textX2.getText().equals("")) { + impl_.error(TrResource.getS("Point non saisi correctement")); + return false; + } - if (textY1.getText().equals("")){ - impl_.error(TrResource.getS("Point non saisi correctement")); - return false; - + if (textY1.getText().equals("")) { + impl_.error(TrResource.getS("Point non saisi correctement")); + return false; + } - if (textY2.getText().equals("")){ - impl_.error(TrResource.getS("Point non saisi correctement")); - return false; - } + if (textY2.getText().equals("")) { + impl_.error(TrResource.getS("Point non saisi correctement")); + return false; + } } - - if(seuil_.getText().equals("")){ - impl_.error(TrResource.getS("Le seuil doit \xEAtre d\xE9fini par un r\xE9el (y=cste)")); - return false; - } - if(listVar_.getSelectedIndex()==-1){ - impl_.error(TrResource.getS("Il faut choisir une variable")); + + if (seuil_.getText().equals("")) { + impl_.error(TrResource.getS("Le seuil doit \xEAtre d\xE9fini par un r\xE9el (y=cste)")); return false; } - if(listPdt_.getSelectedIndex()==-1){ - impl_.error(TrResource.getS("Il faut choisir un pas de temps")); + 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; } @@ -365,12 +357,10 @@ */ protected LineString getSelectedLineOfCalque() { // pas de calque s\xE9lectionn\xE9 - if (!(calque_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { - return null; - } + if (!(calque_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { return null; } return ((ZCalqueAffichageDonneesInterface) calque_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); } - + /** * retourne la variable selectionnee * @@ -389,13 +379,11 @@ protected int getSelectedTimeStep() { return listPdt_.getSelectedIndex(); } - - + protected double getSeuil() { - return Double.parseDouble(seuil_.getText()); + return Double.parseDouble(seuil_.getText()); } - - + private JPanel buildVariables() { JPanel conteneur = new JPanel(new BorderLayout()); JPanel content = new JPanel(new GridLayout(1, 2)); @@ -409,22 +397,19 @@ 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); + conteneur.add(new JLabel(TrResource.getS("Veuillez s\xE9lectionner la variable et pas de temps")), BorderLayout.NORTH); return content; } - - - private JPanel buildSeuil(){ + + private JPanel buildSeuil() { seuil_.setCharValidator(BuCharValidator.FLOAT); seuil_.setStringValidator(BuStringValidator.FLOAT); seuil_.setValueValidator(BuValueValidator.FLOAT); - + JPanel conteneur = new JPanel(new FlowLayout(FlowLayout.CENTER)); conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix du seuil"))); - conteneur.add( seuil_); - + conteneur.add(seuil_); + return conteneur; } @@ -436,41 +421,32 @@ public Box buildContent() { Box content = Box.createVerticalBox(); - + // -- panel des isolignes --// - if (panelIsolignes_ == null) - panelIsolignes_ = buildIsoLignes(); + if (panelIsolignes_ == null) panelIsolignes_ = buildIsoLignes(); content.add(panelIsolignes_); - + // -- panel des variables --// - if (panelVariables_ == null) - panelVariables_ = buildVariables(); + if (panelVariables_ == null) panelVariables_ = buildVariables(); content.add(panelVariables_); - - + // -- panelSeuil - if (panelSeuil_ == null) - panelSeuil_ = buildSeuil(); + if (panelSeuil_ == null) panelSeuil_ = buildSeuil(); content.add(panelSeuil_); - + // -- panel des resultats --// - if (panelResults_ == null) - panelResults_ = buildresults(); + 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); @@ -503,52 +479,53 @@ return TrResource.getS("Bilans"); } - + /** * 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(); + new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan")) { + public void act() { + final ProgressionInterface prog = getMainStateReceiver(); // -- calcul de la EfLineIntersectionsResultsMng --// impl_.setMainMessage(FudaaLib.getS("Calcul des intersections")); impl_.setMainProgression(10); - EfLineIntersectionsResultsMng lineRes = null; - if (startWithCalque_) { - EfLineIntersectorActivity lineIntersect = new EfLineIntersectorActivity(calque_.getSource()); - if (boxSelectLineAuto_.isSelected()) - lineRes = lineIntersect.computeForMeshes(getSelectedLineOfCalque(), prog); - else - lineRes = lineIntersect.computeForMeshes(createLineString(), prog); - } else { - lineRes = modelGraphe_.getResMesh(); - } - EfLineIntersectionsResultsI interfaceRes = lineRes.getDefaultRes(); - + EfLineIntersectionsResultsI interfaceRes = null; + H2dVariableType selectedVariable = getSelectedVariable(); + if (startWithCalque_) { + EfLineIntersectorActivity lineIntersect = new EfLineIntersectorActivity(calque_.getSource()); + LineString lineString = boxSelectLineAuto_.isSelected() ? getSelectedLineOfCalque() : createLineString(); + + interfaceRes = (source_.isElementVar(selectedVariable) ? lineIntersect.computeForMeshes(lineString, prog) + : lineIntersect.computeForNodes(lineString, prog)).getDefaultRes(); + } else { + //TODO a continuer... + interfaceRes = modelGraphe_.getBuilderFor(selectedVariable).getInitRes(); + } + + // le builder permet de corriger les erreurs concernant les cote d'eau / bathymetrie + EfLineIntersectionsResultsBuilder builder = new EfLineIntersectionsResultsBuilder(interfaceRes, + new MvProfileCoteTester()); // -- calcul des efdata --// impl_.setMainProgression(30); impl_.setMainMessage(CtuluLib.getS("Calcul des donn\xE9es pour les pas de temps et variables r\xE9cup\xE9r\xE9s")); - EfData data = source_.getData(getSelectedVariable(), getSelectedTimeStep()); - - - + + EfData data = source_.getData(selectedVariable, getSelectedTimeStep()); + // -- calcul de l'int\xE9grale --// impl_.setMainProgression(70); impl_.setMainMessage(CtuluLib.getS("Calcul de l'int\xE9grale")); - - resCalcul_ = EfDataIntegrale.integrerMethodeTrapeze(interfaceRes, data, getSeuil()); - - // -- mise a jour du tableau de res --// - modelResult_.fireTableDataChanged(); - - - impl_.unsetMainMessage(); - impl_.unsetMainProgression(); - } - }.start(); - } - + resCalcul_ = EfDataIntegrale.integrerMethodeTrapeze(builder.createResults(getSelectedTimeStep(), prog), data, + getSeuil()); + + // -- mise a jour du tableau de res --// + modelResult_.fireTableDataChanged(); + + impl_.unsetMainMessage(); + impl_.unsetMainProgression(); + } + }.start(); + } } Modified: 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/TrPostDialogCubature.java 2008-10-01 21:04:27 UTC (rev 4021) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java 2008-10-01 21:14:21 UTC (rev 4022) @@ -40,7 +40,9 @@ import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.calque.ZCalqueLigneBrisee; +import org.fudaa.ebli.calque.ZCalqueSelectionInteractionAbstract.SelectionMode; import org.fudaa.ebli.calque.find.CalqueFindCourbeTreeModel; +import org.fudaa.ebli.commun.EbliSelectionMode; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.meshviewer.layer.MvElementLayer; @@ -77,12 +79,10 @@ ListModel modelPdt_; JList listPdt_; - - //seuil + // seuil private JPanel panelSeuil_; BuTextField seuil_ = new BuTextField(5); - - + // isolignes private JPanel panelIsolignes_; JTree treeLignes_; @@ -93,6 +93,7 @@ JLabel results_; JButton ajouter_ = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); DefaultTableModel modelResult_; + /** * Constructeur reserv\xE9 au calques * @@ -137,10 +138,10 @@ buildDialog(); } - protected JTree buildTree() { return CalqueFindCourbeTreeModel.createCalqueTree(lineTreeModel_, true); } + /** * Construit le panel des variables * @@ -153,101 +154,96 @@ content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de la ligne bris\xE9e du calque"))); return content; } - - private JPanel buildSeuil(){ - seuil_.setCharValidator(BuCharValidator.FLOAT); - seuil_.setStringValidator(BuStringValidator.FLOAT); - seuil_.setValueValidator(BuValueValidator.FLOAT); - - JPanel conteneur = new JPanel(new FlowLayout(FlowLayout.CENTER)); - conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix du seuil"))); - conteneur.add( seuil_); - - return conteneur; - } + private JPanel buildSeuil() { + seuil_.setCharValidator(BuCharValidator.FLOAT); + seuil_.setStringValidator(BuStringValidator.FLOAT); + seuil_.setValueValidator(BuValueValidator.FLOAT); + + JPanel conteneur = new JPanel(new FlowLayout(FlowLayout.CENTER)); + conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix du seuil"))); + conteneur.add(seuil_); + + return conteneur; + } + 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() { + JPanel conteneur = new JPanel(new BorderLayout()); - public void actionPerformed(ActionEvent _e) { - if (controleDataOk()) { - computeResults(); - } - } + JPanel content = new JPanel(new FlowLayout(FlowLayout.CENTER)); - }); - - modelResult_ = new DefaultTableModel() { - public int getColumnCount() { - return 3; - } - public String getColumnName(int _column) { - if (_column == 1) - return "Zone positive"; - else if (_column == 0) - return "Zone n\xE9gative"; - else - return "R\xE9sultat"; - } - public int getRowCount() { - return 1; - } - public boolean isCellEditable(int _row, int _column) { - return false; - } - public Object getValueAt(int _row, int _column) { - if (_column == 0) - return resCalcul_.getZoneMoins(); - else if (_column == 1) - return resCalcul_.getZonePlus(); - else - return resCalcul_.getResultat(); - } - }; + results_ = new JLabel(""); + content.add(ajouter_); + // content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); + content.add(results_); - JTable tableauRes = new JTable(modelResult_); - conteneur.add(tableauRes.getTableHeader(), BorderLayout.NORTH); - conteneur.add(tableauRes, BorderLayout.CENTER); - conteneur.add(content, BorderLayout.SOUTH); - return conteneur; - } + 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() { + public int getColumnCount() { + return 3; + } + + public String getColumnName(int _column) { + if (_column == 1) return "Zone positive"; + else if (_column == 0) return "Zone n\xE9gative"; + else return "R\xE9sultat"; + } + + public int getRowCount() { + return 1; + } + + public boolean isCellEditable(int _row, int _column) { + return false; + } + + public Object getValueAt(int _row, int _column) { + if (_column == 0) return resCalcul_.getZoneMoins(); + else if (_column == 1) return resCalcul_.getZonePlus(); + else return resCalcul_.getResultat(); + } + }; + + 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 (treeLignes_.getSelectionCount() == 0){ - impl_.error(TrResource.getS("Il faut choisir une ligne bris\xE9e")); - return false; - } - if(seuil_.getText().equals("")){ - impl_.error(TrResource.getS("Le seuil doit \xEAtre d\xE9fini par un r\xE9el (y=cste)")); - return false; - } - if(listVar_.getSelectedIndex()==-1){ - impl_.error(TrResource.getS("Il faut choisir une variable")); + + if (treeLignes_.getSelectionCount() == 0) { + impl_.error(TrResource.getS("Il faut choisir une ligne bris\xE9e")); return false; } - if(listPdt_.getSelectedIndex()==-1){ - impl_.error(TrResource.getS("Il faut choisir un pas de temps")); + if (seuil_.getText().equals("")) { + impl_.error(TrResource.getS("Le seuil doit \xEAtre d\xE9fini par un r\xE9el (y=cste)")); 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 * @@ -294,23 +290,19 @@ Box content = Box.createVerticalBox(); // -- panel des isolignes --// - if (panelIsolignes_ == null) - panelIsolignes_ = buildIsoLignes(); + if (panelIsolignes_ == null) panelIsolignes_ = buildIsoLignes(); content.add(panelIsolignes_); // -- panel des variables --// - if (panelVariables_ == null) - panelVariables_ = buildVariables(); + if (panelVariables_ == null) panelVariables_ = buildVariables(); content.add(panelVariables_); // -- panelSeuil - if (panelSeuil_ == null) - panelSeuil_ = buildSeuil(); + if (panelSeuil_ == null) panelSeuil_ = buildSeuil(); content.add(panelSeuil_); - + // -- panel des resultats --// - if (panelResults_ == null) - panelResults_ = buildresults(); + if (panelResults_ == null) panelResults_ = buildresults(); content.add(panelResults_); return content; @@ -357,24 +349,21 @@ /** * Recupere la ligne brisee du tree + * * @return */ public LinearRing getSelectedLineInTree() { - if (treeLignes_.isSelectionEmpty()) { - return null; - } - final CalqueFindCourbeTreeModel.LayerNode node = (CalqueFindCourbeTreeModel.LayerNode) treeLignes_.getSelectionPath() - .getLastPathComponent(); - final ZCalqueLigneBrisee cq = (ZCalqueLigneBrisee) node.getUserObject(); - return (LinearRing) cq.getModele().getGeomData().getGeometry(node.getIdxPoly()); - } - - + if (treeLignes_.isSelectionEmpty()) { return null; } + final CalqueFindCourbeTreeModel.LayerNode node = (CalqueFindCourbeTreeModel.LayerNode) treeLignes_ + .getSelectionPath().getLastPathComponent(); + final ZCalqueLigneBrisee cq = (ZCalqueLigneBrisee) node.getUserObject(); + return (LinearRing) cq.getModele().getGeomData().getGeometry(node.getIdxPoly()); + } + protected double getSeuil() { - return Double.parseDouble(seuil_.getText()); - } - - + return Double.parseDouble(seuil_.getText()); + } + /** * Methode qui realise les calculs d'int\xE9grale par rapport aux donn\xE9es */ @@ -383,37 +372,44 @@ new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan")) { public void act() { final ProgressionInterface prog = getMainStateReceiver(); - - //-- calcul du ef filter --// + + // -- calcul du ef filter --// impl_.setMainProgression(10); impl_.setMainMessage(CtuluLib.getS("R\xE9cup\xE9ration des lignes bris\xE9es")); EfFilter selectedElt; - MvElementLayer layer=calque_.getGridGroup().getPolygonLayer(); - CtuluListSelection listSelect=layer.selection(getSelectedLineInTree(), 0); - selectedElt=new EfFilterSelectedElement(listSelect,source_.getGrid()); - - + MvElementLayer layer = calque_.getGridGroup().getPolygonLayer(); + CtuluListSelection listSelect = layer.selection(getSelectedLineInTree(), EbliSelectionMode.MODE_ONE);// le mode + // ONE veut + // dire que + // si un + // point du + // polygone + // est + // selectionne, + // le poly + // l'est + selectedElt = new EfFilterSelectedElement(listSelect, source_.getGrid()); + // -- calcul des efdata --// impl_.setMainProgression(30); impl_.setMainMessage(CtuluLib.getS("Calcul des donn\xE9es pour les pas de temps et variables r\xE9cup\xE9r\xE9s")); EfData data = source_.getData(getSelectedVariable(), getSelectedTimeStep()); - // -- calcul de l'int\xE9grale --// + // -- calcul de l'int\xE9grale --// impl_.setMainProgression(70); impl_.setMainMessage(CtuluLib.getS("Calcul de l'int\xE9grale")); - - EfComputeVolumeSeuil compute= EfComputeVolumeSeuil.getVolumeComputer(selectedElt, prog, source_, getSelectedVariable(), getSelectedTimeStep(), getSeuil(), new CtuluAnalyze()); - - resCalcul_ =compute.getVolume(getSelectedTimeStep()); - - // -- mise a jour du tableau de res --// + + EfComputeVolumeSeuil compute = EfComputeVolumeSeuil.getVolumeComputer(selectedElt, prog, source_, + getSelectedVariable(), getSelectedTimeStep(), getSeuil(), new CtuluAnalyze()); + + resCalcul_ = compute.getVolume(getSelectedTimeStep()); + + // -- mise a jour du tableau de res --// modelResult_.fireTableDataChanged(); impl_.unsetMainMessage(); impl_.unsetMainProgression(); } }.start(); } - } - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-10-01 21:04:47
|
Revision: 4021 http://fudaa.svn.sourceforge.net/fudaa/?rev=4021&view=rev Author: deniger Date: 2008-10-01 21:04:27 +0000 (Wed, 01 Oct 2008) Log Message: ----------- Modified Paths: -------------- 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 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-01 17:49:28 UTC (rev 4020) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java 2008-10-01 21:04:27 UTC (rev 4021) @@ -19,183 +19,172 @@ /** * Calcul du volume par rapport a un seuil et non plus 0. + * * @author Adrien Hadoux - * */ public abstract class EfComputeVolumeSeuil implements CtuluActivity { - public static class ForMeshData extends EfComputeVolumeSeuil { + public static class ForMeshData extends EfComputeVolumeSeuil { - ForMeshData(final EfFilter _filter, final ProgressionInterface _prog, final EfGridData _data, - final CtuluVariable _hVar, final int timestep,final double seuil) { - super(_filter, _prog, _data, _hVar,timestep,seuil); - } + ForMeshData(final EfFilter _filter, final ProgressionInterface _prog, final EfGridData _data, + final CtuluVariable _hVar, final int timestep, final double seuil) { + super(_filter, _prog, _data, _hVar, timestep, seuil); + } - - EfDataIntegrale computeVolume(final EfGridInterface _grid, final EfData _h) { - EfDataIntegrale resi = new EfDataIntegrale(); - for (int ielt = 0; ielt < _grid.getEltNb(); ielt++) { - if (filter_.isActivatedElt(ielt, _grid, false)) { + EfDataIntegrale computeVolume(final EfGridInterface _grid, final EfData _h) { + EfDataIntegrale resi = new EfDataIntegrale(); + for (int ielt = 0; ielt < _grid.getEltNb(); ielt++) { + if (filter_.isActivatedElt(ielt, _grid, false)) { - if(_h.getValue(ielt)<=seuil_) - resi.zoneMoins_ += _grid.getAire(ielt) * _h.getValue(ielt); - else - resi.zonePlus_ += _grid.getAire(ielt) * _h.getValue(ielt); - } - } - return resi; - } - } + double value = _grid.getAire(ielt) * (_h.getValue(ielt) - seuil_);// Todo je pense que c'est la diff + if (value >= 0) resi.zonePlus_ += value; + else resi.zoneMoins_ -= value; + } + } + return resi; + } + } - public static class ForNodeData extends EfComputeVolumeSeuil { + public static class ForNodeData extends EfComputeVolumeSeuil { - ForNodeData(final EfFilter _filter, final ProgressionInterface _prog, final EfGridData _data, - final CtuluVariable _hVar, final int timestep,final double seuil) { - super(_filter, _prog, _data, _hVar,timestep,seuil); - } + ForNodeData(final EfFilter _filter, final ProgressionInterface _prog, final EfGridData _data, + final CtuluVariable _hVar, final int timestep, final double seuil) { + super(_filter, _prog, _data, _hVar, timestep, seuil); + } - EfDataIntegrale computeVolume(final EfGridInterface _grid, final EfData _h) { - EfDataIntegrale resi = new EfDataIntegrale(); - for (int ipt = 0; ipt < _grid.getPtsNb(); ipt++) { - // le calcul du volume se fait: - // Volume=(surface des elements adjacents)* hauteur au point /3 - if (filter_.isActivated(ipt)) { - // liste des elements adjacents. - final TIntArrayList list = (TIntArrayList) idxPtAdjMes_.get(ipt); - // la liste est nulle: ne devrait jamais arriv\xE9: un point isol\xE9 que faire ? - // pour l'instant on ignore. - if (list != null) { - // s est la surface des elements adjacents. - double s = 0D; - for (int k = 0; k < list.size(); k++) { - s += _grid.getAire(list.getQuick(k)); - } - // la formule qui tue - if(_h.getValue(ipt)<=seuil_) - resi.zoneMoins_ += s * _h.getValue(ipt) / 3D; - else - resi.zonePlus_ += s * _h.getValue(ipt) / 3D; - } - } - } - return resi; - } + EfDataIntegrale computeVolume(final EfGridInterface _grid, final EfData _h) { + EfDataIntegrale resi = new EfDataIntegrale(); + for (int ipt = 0; ipt < _grid.getPtsNb(); ipt++) { + // le calcul du volume se fait: + // Volume=(surface des elements adjacents)* hauteur au point /3 + if (filter_.isActivated(ipt)) { + // liste des elements adjacents. + final TIntArrayList list = (TIntArrayList) idxPtAdjMes_.get(ipt); + // la liste est nulle: ne devrait jamais arriv\xE9: un point isol\xE9 que faire ? + // pour l'instant on ignore. + if (list != null) { + // s est la surface des elements adjacents. + double s = 0D; + for (int k = 0; k < list.size(); k++) { + s += _grid.getAire(list.getQuick(k)); + } + double d = s * (_h.getValue(ipt) - seuil_) / 3D; + if (d >= 0) resi.zonePlus_ += d; + else resi.zoneMoins_ -= d; + } + } + } + return resi; + } - public EfDataIntegrale getVolume(int choosenTimestep) { - computeNeighborMeshes(); - return super.getVolume(choosenTimestep); - } - } + public EfDataIntegrale getVolume(int _choosenTimestep) { + computeNeighborMeshes(); + return super.getVolume(_choosenTimestep); + } + } - final EfGridData data_; - final EfFilter filter_; - final CtuluVariable h_; - protected final int timeStep_; - protected final double seuil_; + final EfGridData data_; + final EfFilter filter_; + final CtuluVariable h_; + protected final int timeStep_; + protected final double seuil_; - /** - * Stocke indice du noeuds -> list element adjacent. Pour les noeuds s\xE9lecionn\xE9s uniquement - */ - TIntObjectHashMap idxPtAdjMes_; - ProgressionInterface prog_; + /** + * Stocke indice du noeuds -> list element adjacent. Pour les noeuds s\xE9lecionn\xE9s uniquement + */ + TIntObjectHashMap idxPtAdjMes_; + ProgressionInterface prog_; - boolean stop_; + boolean stop_; - public static EfComputeVolumeSeuil getVolumeComputer(final EfFilter _filter, final ProgressionInterface _prog, - final EfGridData _data, final CtuluVariable _hVar, final int timestep,final double seuil, final CtuluAnalyze _analyze) { - if (!_data.isDefined(_hVar)) { - _analyze.addFatalError(DodicoLib.getS("La hauteur d'eau n'est pas d\xE9finie")); - return null; - } - if (_data.isElementVar(_hVar)) { - return new ForMeshData(_filter, _prog, _data, _hVar,timestep,seuil); - } - return new ForNodeData(_filter, _prog, _data, _hVar,timestep,seuil); + public static EfComputeVolumeSeuil getVolumeComputer(final EfFilter _filter, final ProgressionInterface _prog, + final EfGridData _data, final CtuluVariable _hVar, final int timestep, final double seuil, + final CtuluAnalyze _analyze) { + if (!_data.isDefined(_hVar)) { + _analyze.addFatalError(DodicoLib.getS("La variable n'est pas d\xE9finie")); + return null; + } + if (_data.isElementVar(_hVar)) { return new ForMeshData(_filter, _prog, _data, _hVar, timestep, seuil); } + return new ForNodeData(_filter, _prog, _data, _hVar, timestep, seuil); - } + } - EfComputeVolumeSeuil(final EfFilter _filter, final ProgressionInterface _prog, final EfGridData _data, - final CtuluVariable _hVar, final int timestep,final double seuil) { - super(); - prog_ = _prog; - data_ = _data; - h_ = _hVar; - timeStep_=timestep; - seuil_=seuil; - filter_ = _filter == null ? new EfFilterNone() : _filter; - } + EfComputeVolumeSeuil(final EfFilter _filter, final ProgressionInterface _prog, final EfGridData _data, + final CtuluVariable _hVar, final int timestep, final double seuil) { + super(); + prog_ = _prog; + data_ = _data; + h_ = _hVar; + timeStep_ = timestep; + seuil_ = seuil; + filter_ = _filter == null ? new EfFilterNone() : _filter; + } - abstract EfDataIntegrale computeVolume(final EfGridInterface _grid, EfData _h); + abstract EfDataIntegrale computeVolume(final EfGridInterface _grid, EfData _h); - protected void computeNeighborMeshes() { - if (idxPtAdjMes_ != null) { - return; - } - final ProgressionUpdater up = new ProgressionUpdater(prog_); - final EfGridInterface grid = data_.getGrid(); - up.setValue(10, grid.getEltNb()); - up.majProgessionStateOnly(DodicoLib.getS("Recherche des \xE9l\xE9ments voisins")); - idxPtAdjMes_ = new TIntObjectHashMap(grid.getPtsNb()); - for (int i = 0; i < grid.getEltNb(); i++) { - if (stop_) { - idxPtAdjMes_ = null; - return; - } - final EfElement elt = grid.getElement(i); - for (int j = 0; j < elt.getPtNb(); j++) { - final int ptIndex = elt.getPtIndex(j); - // si le noeud est s\xE9lectionne - if (filter_.isActivated(ptIndex)) { - TIntArrayList list = (TIntArrayList) idxPtAdjMes_.get(ptIndex); - // ce noeud n'a pas encore \xE9t\xE9 trait\xE9 - if (list == null) { - list = new TIntArrayList(10); - idxPtAdjMes_.put(ptIndex, list); - } - list.add(i); + protected void computeNeighborMeshes() { + if (idxPtAdjMes_ != null) { return; } + final ProgressionUpdater up = new ProgressionUpdater(prog_); + final EfGridInterface grid = data_.getGrid(); + up.setValue(10, grid.getEltNb()); + up.majProgessionStateOnly(DodicoLib.getS("Recherche des \xE9l\xE9ments voisins")); + idxPtAdjMes_ = new TIntObjectHashMap(grid.getPtsNb()); + for (int i = 0; i < grid.getEltNb(); i++) { + if (stop_) { + idxPtAdjMes_ = null; + return; + } + final EfElement elt = grid.getElement(i); + for (int j = 0; j < elt.getPtNb(); j++) { + final int ptIndex = elt.getPtIndex(j); + // si le noeud est s\xE9lectionne + if (filter_.isActivated(ptIndex)) { + TIntArrayList list = (TIntArrayList) idxPtAdjMes_.get(ptIndex); + // ce noeud n'a pas encore \xE9t\xE9 trait\xE9 + if (list == null) { + list = new TIntArrayList(10); + idxPtAdjMes_.put(ptIndex, list); + } + list.add(i); - } - } - up.majAvancement(); - } - } + } + } + up.majAvancement(); + } + } - public EfDataIntegrale getVolume(int choosenTimestep) { - final ProgressionUpdater up = new ProgressionUpdater(prog_); - final EfGridInterface grid = data_.getGrid(); - up.setValue(10, 100); - EfDataIntegrale res ; - up.majProgessionStateOnly(DodicoLib.getS("Calcul du volume")); - - if (stop_) { - return null; - } - EfData h = null; - try { - h = data_.getData(h_, timeStep_); - } catch (final IOException _evt) { - FuLog.error(_evt); + public EfDataIntegrale getVolume(int choosenTimestep) { + final ProgressionUpdater up = new ProgressionUpdater(prog_); + final EfGridInterface grid = data_.getGrid(); + up.setValue(10, 100); + EfDataIntegrale res; + up.majProgessionStateOnly(DodicoLib.getS("Calcul du volume")); - } - if (h == null) { - return null; - } - res = computeVolume(grid, h); - up.majAvancement(); - - return res; - } + if (stop_) { return null; } + EfData h = null; + try { + h = data_.getData(h_, timeStep_); + } catch (final IOException _evt) { + FuLog.error(_evt); - public ProgressionInterface getProg() { - return prog_; - } + } + if (h == null) { return null; } + res = computeVolume(grid, h); + up.majAvancement(); - public void setProg(final ProgressionInterface _prog) { - prog_ = _prog; - } + return res; + } - public void stop() { - stop_ = true; - } + public ProgressionInterface getProg() { + return prog_; + } + public void setProg(final ProgressionInterface _prog) { + prog_ = _prog; + } + + public void stop() { + stop_ = true; + } + } 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-01 17:49:28 UTC (rev 4020) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java 2008-10-01 21:04:27 UTC (rev 4021) @@ -143,17 +143,17 @@ } else { // cas particulier : intersection, on calcule l'intersection entre les // points - double yIntersect = 0; + final double yIntersect = seuil; double xIntersect = 0; // on prend la droite form\xE9e par les 2 points et on calcule son // intersection avec la droite affine if (x2 - x != 0) { - // droite non parrallele a l axe des abscisses + // droite non parrallele a l axe des ordonn\xE9e ! double coefDirecteur = (y2 - y) / (x2 - x); double ordoOrigine = y2 - coefDirecteur * x2; // intersection de droites avec le seuil - yIntersect = seuil; +// yIntersect = seuil; if(coefDirecteur!=0) @@ -168,7 +168,7 @@ // x2=x droite perpendiculaire au seuil, le point d'intersection est // donc (x,seuil) xIntersect = x; - yIntersect = seuil; +// yIntersect = seuil; } //maintenant que l on a le point d'intersection, on test si on ajoute en positif ou negatif @@ -194,7 +194,6 @@ * (x2,y4) */ public static double calculAireTrapeze(double x, double y, double x2, double y2, double y3, double y4) { - double aire = 0; // 1: calcul de la hauteur double h = Math.abs(x2 - x); // 2 base 1: coordonnees cartesiennes entre le point x,y et x,y3 @@ -202,8 +201,7 @@ // 3 base 2: coordonnees cartesiennes entre le point x2,y2 et x2,y4 double base2 = Math.abs(y4 - y2); // 4 calcul de l'aire - aire = h * (base1 + base2) / 2; - return aire; + return h * (base1 + base2) / 2; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-01 17:49:40
|
Revision: 4020 http://fudaa.svn.sourceforge.net/fudaa/?rev=4020&view=rev Author: hadouxad Date: 2008-10-01 17:49:28 +0000 (Wed, 01 Oct 2008) Log Message: ----------- commit partiel Modified Paths: -------------- 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/post/TrPostWizardImportScope.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaGrapheWizardImportScope.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-01 16:56:01 UTC (rev 4019) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-01 17:49:28 UTC (rev 4020) @@ -331,7 +331,14 @@ return content; } + + /** + * Creation du panel scopGene pour choisir ses parametres + * @return + */ JPanel buildPanelScopeGENE(){ + + return null; } Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaGrapheWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaGrapheWizardImportScope.java 2008-10-01 16:56:01 UTC (rev 4019) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaGrapheWizardImportScope.java 2008-10-01 17:49:28 UTC (rev 4020) @@ -1,434 +0,0 @@ -package org.fudaa.fudaa.commun.courbe; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; - -import javax.swing.AbstractAction; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JTextField; -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; -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.ctulu.fileformat.FileFormat; -import org.fudaa.ctulu.fileformat.FileFormatUnique; -import org.fudaa.ctulu.gui.CtuluFileChooser; -import org.fudaa.ctulu.gui.CtuluLibSwing; -import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; -import org.fudaa.dodico.mesure.EvolutionFileFormat; -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.tr.common.TrResource; - -import com.memoire.bu.BuButton; -import com.memoire.bu.BuButtonPanel; -import com.memoire.bu.BuCharValidator; -import com.memoire.bu.BuFileFilter; -import com.memoire.bu.BuResource; -import com.memoire.bu.BuStringValidator; -import com.memoire.bu.BuTextField; -import com.memoire.bu.BuValueValidator; -import com.memoire.bu.BuWizardDialog; -import com.memoire.bu.BuWizardTask; - -/** - * Wizard qui se charge d'importer des courbes au format scope dans le post. - * - * Pour personnaliser le format final du graphe et son affichage, il faut surcharger la methode - * createGraphImported() - * @author Adrien Hadoux - * - */ -public class FudaaGrapheWizardImportScope extends BuWizardTask { - - //donnees haut niveau - FudaaCommonImplementation impl_; - - /** - * type de fomat: - * 0 => scops - * 1 =>scopT - * 2=>scopgene - */ - int typeFormat_; - File fileChoosen_=null; - ScopeStructure data_; - EGGraphe result_; - - //choix du fichier - JPanel panelFichier_; - BuTextField filePath_; - - //choix parametres s t ou gene - JPanel panelParametres_; - - //choix donnees S et T - BuTextField plageDeb_=new BuTextField(5); - BuTextField plageFin_=new BuTextField(5); - JList listVariables_; - - - public static class ImportAction extends EbliActionSimple { - final FudaaCommonImplementation ui_; - public ImportAction(final FudaaCommonImplementation _ui) { - super(BuResource.BU.getString("Importer au format scope"), BuResource.BU.getIcon("IMPORTER"), "IMPORTER"); - ui_ = _ui; - } - public void actionPerformed(final ActionEvent _e) { - FudaaGrapheWizardImportScope wizard=new FudaaGrapheWizardImportScope(ui_); - BuWizardDialog DialogWizard = new BuWizardDialog(ui_.getFrame(), wizard); - // --affichage du wizard --// - DialogWizard.setSize(600, 500); - DialogWizard.setLocationRelativeTo(ui_.getFrame()); - DialogWizard.setVisible(true); - } - } - - - public FudaaGrapheWizardImportScope(FudaaCommonImplementation impl) { - super(); - - impl_=impl; - } - - - @Override - public JComponent getStepComponent() { - switch (current_) { - case 0: { - - if(panelFichier_==null) - panelFichier_=buildFilePanel(); - return panelFichier_; - } - case 1: { - - if(data_==null){ - return new JLabel(TrResource.getS("Erreur. Veuillez choisir un fichier valide")); - } - - if(panelParametres_==null) - panelParametres_=buildPanelParametresImportation(); - return panelParametres_; - } - - } - - return null; - } - - @Override - public int getStepCount() { - // TODO Auto-generated method stub - return 2; - } - - @Override - public String getStepText() { - // TODO Auto-generated method stub - return null; - } - - ScopeStructure.SorT dataST(){ - return (ScopeStructure.SorT)data_; - } - - ScopeStructure.Gene dataG(){ - return (ScopeStructure.Gene)data_; - } - - @Override - public String getStepTitle() { - String r = null; - - switch (current_) { - case 0: - r = TrResource.getS("Choisir le fichier"); - break; - case 1: - r = TrResource.getS("Param\xE8tres de cr\xE9ation"); - break; - - } - return r; - } - - /** - * construit le panel de selection du fichier - * @return - */ - JPanel buildFilePanel(){ - JPanel content=new JPanel(new FlowLayout(FlowLayout.CENTER)); - content.add(new JLabel(TrResource.getS("Choisir le fichier:"))); - filePath_=new BuTextField(20); - filePath_.setEnabled(false); - content.add(filePath_); - BuButton parcourir =new BuButton(TrResource.getS("Parcourir...")); - parcourir.addActionListener(new ActionListener(){ - public void actionPerformed(ActionEvent arg0) { - final FileFormat[] ft = getFileFormatForImport(); - Arrays.sort(ft); - final BuFileFilter[] filters = FileFormat.createFilters(ft); - final CtuluFileChooser fileChooser = FudaaGuiLib.getFileChooser(BuResource.BU.getString("Importer"), filters, - null); - fileChooser.setAcceptAllFileFilterUsed(false); - for (int i = filters.length - 1; i >= 0; i--) { - if (ft[i].getID() == EvolutionFileFormat.getInstance().getID()) { - fileChooser.setFileFilter(filters[i]); - break; - } - } - final File initFile = FudaaGuiLib.chooseFile(CtuluLibSwing.getFrameAncestor(impl_.getParentComponent()), true,fileChooser); - if (initFile == null) { - return; - } - filePath_.setText(initFile.getAbsolutePath()); - - final FileFilter filter = fileChooser.getFileFilter(); - final int i = CtuluLibArray.getIndex(filter, filters); - if (i < 0) { - return; - } - typeFormat_=i; - fileChoosen_=initFile; - importData(); - - - - } - - }); - content.add(parcourir); - return content; - } - - /** - * Retourne les formats de fichiers disponibles - * @return - */ - public static FileFormat[] getFileFormatForImport() { - final ArrayList<FileFormatUnique> r = new ArrayList<FileFormatUnique>(10); - r.add(ScopeSFileFormat.getInstance()); - r.add(ScopeTFileFormat.getInstance()); - r.add(ScopeGENEFileFormat.getInstance()); - final FileFormat[] rf = new FileFormat[r.size()]; - r.toArray(rf); - return rf; - } - - - /** - * Methode iumportante d'importation des datas en fonction du fichier choisi et du type. - * Remplit la structure scope - */ - private void importData(){ - new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Importation graphe")) { - public void act() { - final ProgressionInterface prog = getMainStateReceiver(); - - switch(typeFormat_){ - case 0: - //cas s - data_=lectureScopeS(fileChoosen_,prog); - break; - case 1: - //cas scopT - data_=lectureScopeT(fileChoosen_,prog); - break; - case 2: - //cas scopGENE - data_=lectureScopeGENE(fileChoosen_,prog); - break; - } - - }}.start(); - - } - - private ScopeStructure.SorT lectureScopeS(final File _f,ProgressionInterface prog) { - final CtuluIOOperationSynthese op = ScopeSFileFormat.getInstance().getLastVersionInstance(null).read(_f, prog); - final ScopeStructure.SorT struct = (ScopeStructure.SorT) op.getSource(); - return struct; - } - private ScopeStructure.SorT lectureScopeT(final File _f,ProgressionInterface prog) { - final CtuluIOOperationSynthese op = ScopeTFileFormat.getInstance().getLastVersionInstance(null).read(_f, prog); - final ScopeStructure.SorT struct = (ScopeStructure.SorT) op.getSource(); - return struct; - } - private ScopeStructure.Gene lectureScopeGENE(final File _f,ProgressionInterface prog) { - final CtuluIOOperationSynthese op = ScopeGENEFileFormat.getInstance().getLastVersionInstance(null).read(_f, prog); - final ScopeStructure.Gene struct = (ScopeStructure.Gene) op.getSource(); - return struct; - } - - - /** - * Construit le panel de choix des donn\xE9es a importer pour les formats s et t - * @return - */ - double Xmin,Xmax; - JPanel buildPanelScopeSorT(){ - JPanel content=new JPanel(new BorderLayout()); - - String[] listeVar=new String[dataST().getNbVariables()-1]; - - //on ne prends pas les x - for(int i=1;i<dataST().getNbVariables();i++) - listeVar[i-1]=dataST().getVariable(i); - - listVariables_=new JList(listeVar); - listVariables_.setSelectedIndex(0); - content.add(listVariables_,BorderLayout.CENTER); - listVariables_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); - - plageDeb_.setCharValidator(BuCharValidator.FLOAT); - plageDeb_.setStringValidator(BuStringValidator.FLOAT); - plageDeb_.setValueValidator(BuValueValidator.FLOAT); - plageFin_.setCharValidator(BuCharValidator.FLOAT); - plageFin_.setStringValidator(BuStringValidator.FLOAT); - plageFin_.setValueValidator(BuValueValidator.FLOAT); - - //-- on init les plages --// - Xmin=dataST().getXMin(); - plageDeb_.setText(""+Xmin); - Xmax=dataST().getXMax(); - plageFin_.setText(""+Xmax); - - JPanel plages=new JPanel(new FlowLayout(FlowLayout.CENTER)); - plages.add(new JLabel(TrResource.getS("Choisir la plage des abscisses"))); - plages.add(plageDeb_); - plages.add(new JLabel("-")); - plages.add(plageFin_); - plages.add(new JLabel("(Min: "+Xmin+", Max: "+Xmax+")")); - content.add(plages,BorderLayout.SOUTH); - - return content; - } - - JPanel buildPanelScopeGENE(){ - return null; - } - - JPanel buildPanelParametresImportation(){ - switch(typeFormat_){ - case 0: - //cas s - return buildPanelScopeSorT(); - case 1: - //cas scopT - return buildPanelScopeSorT(); - case 2: - //cas scopGENE - return buildPanelScopeGENE(); - } - - return null; - } - - public String getTaskTitle() { - // TODO Auto-generated method stub - return TrResource.getS("Importation depuis les formats Scop S, T et GENE"); - } - - /** - * MEthode utilisee pour disabler ou non les boutons suivants - */ - public int getStepDisabledButtons() { - int r = super.getStepDisabledButtons(); - if (current_ == 1) { - - //cas scope s ou t - if(typeFormat_==1 || typeFormat_==0){ - if(data_==null) - r |= BuButtonPanel.TERMINER; - else - if(plageDeb_.getText().equals("") || plageFin_.getText().equals("")) - r |= BuButtonPanel.TERMINER; - else{ - //verifier que les plages ne sont pas depassees - double valDeb=Double.parseDouble(plageDeb_.getText()); - double valFin=Double.parseDouble(plageFin_.getText()); - if(valDeb<Xmin || Xmax<valFin) - r |= BuButtonPanel.TERMINER; - } - - }else{ - //cas scope gene - } - - } - return r; - } - - - public void doTask() { - done_ = true; - new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Importation graphe")) { - public void act() { - final ProgressionInterface prog = getMainStateReceiver(); - //mise a jour de la structure - impl_.setMainProgression(10); - impl_.setMainMessage(CtuluLib.getS("Structure modification")); - prog.setProgression(10); - prog.setDesc(CtuluLib.getS("Structure modification")); - if(typeFormat_<=1) - dataST().restreindreStructure(listVariables_.getSelectedIndices(),Double.parseDouble(plageDeb_.getText()),Double.parseDouble(plageFin_.getText())); - - - impl_.setMainProgression(30); - impl_.setMainMessage(CtuluLib.getS("Cr\xE9ation du graphe")); - // creation du graphe - switch(typeFormat_){ - case 0: - //cas s - result_=FudaaCourbeImporterScope.createGrapheSpatialGraphe(dataST(),prog);break; - case 1: - //cas scopT - result_=FudaaCourbeImporterScope.createGrapheTemporel(dataST(),prog);break; - case 2: - //cas scopGENE - result_=FudaaCourbeImporterScope.createGrapheTemporelGENE(dataG(),prog);break; - } - - //-- mise en forme du resultata g\xE9n\xE9r\xE9 --// - createGraphImported(result_); - } - }.start(); - } - - - /** - * Methode a surcharger. - * Appel\xE9e a la toute fin, gere le resultat - */ - public void createGraphImported(EGGraphe grapheGenere){ - //placer le graphe ou vous voulez... - } - -} Modified: 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/TrPostWizardImportScope.java 2008-10-01 16:56:01 UTC (rev 4019) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardImportScope.java 2008-10-01 17:49:28 UTC (rev 4020) @@ -41,7 +41,7 @@ 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.courbe.FudaaGrapheWizardImportScope; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeWizardImportScope; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.impl.FudaaGuiLib; import org.fudaa.fudaa.tr.common.TrResource; @@ -62,7 +62,7 @@ * @author Adrien Hadoux * */ -public class TrPostWizardImportScope extends FudaaGrapheWizardImportScope { +public class TrPostWizardImportScope extends FudaaCourbeWizardImportScope { TrPostProjet projet_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-10-01 16:56:17
|
Revision: 4019 http://fudaa.svn.sourceforge.net/fudaa/?rev=4019&view=rev Author: deniger Date: 2008-10-01 16:56:01 +0000 (Wed, 01 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java Modified: 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/TrPostDialogCubature.java 2008-10-01 16:16:50 UTC (rev 4018) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java 2008-10-01 16:56:01 UTC (rev 4019) @@ -111,6 +111,7 @@ modelPdt_ = source_.getNewTimeListModel(); startWithCalque_ = true; lineTreeModel_ = new CalqueFindCourbeTreeModel(null, _calque.getDonneesCalque()); + lineTreeModel_.setOnlyLigneFerme(true); // -- construction de la dialog --// buildDialog(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-01 16:17:06
|
Revision: 4018 http://fudaa.svn.sourceforge.net/fudaa/?rev=4018&view=rev Author: hadouxad Date: 2008-10-01 16:16:50 +0000 (Wed, 01 Oct 2008) Log Message: ----------- commit partiel Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java (from rev 4017, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaGrapheWizardImportScope.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-01 16:16:50 UTC (rev 4018) @@ -0,0 +1,434 @@ +package org.fudaa.fudaa.commun.courbe; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; + +import javax.swing.AbstractAction; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JTextField; +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; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.fileformat.FileFormat; +import org.fudaa.ctulu.fileformat.FileFormatUnique; +import org.fudaa.ctulu.gui.CtuluFileChooser; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; +import org.fudaa.dodico.mesure.EvolutionFileFormat; +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.tr.common.TrResource; + +import com.memoire.bu.BuButton; +import com.memoire.bu.BuButtonPanel; +import com.memoire.bu.BuCharValidator; +import com.memoire.bu.BuFileFilter; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuStringValidator; +import com.memoire.bu.BuTextField; +import com.memoire.bu.BuValueValidator; +import com.memoire.bu.BuWizardDialog; +import com.memoire.bu.BuWizardTask; + +/** + * Wizard qui se charge d'importer des courbes au format scope dans le post. + * + * Pour personnaliser le format final du graphe et son affichage, il faut surcharger la methode + * createGraphImported() + * @author Adrien Hadoux + * + */ +public class FudaaCourbeWizardImportScope extends BuWizardTask { + + //donnees haut niveau + FudaaCommonImplementation impl_; + + /** + * type de fomat: + * 0 => scops + * 1 =>scopT + * 2=>scopgene + */ + int typeFormat_; + File fileChoosen_=null; + ScopeStructure data_; + EGGraphe result_; + + //choix du fichier + JPanel panelFichier_; + BuTextField filePath_; + + //choix parametres s t ou gene + JPanel panelParametres_; + + //choix donnees S et T + BuTextField plageDeb_=new BuTextField(5); + BuTextField plageFin_=new BuTextField(5); + JList listVariables_; + + + public static class ImportAction extends EbliActionSimple { + final FudaaCommonImplementation ui_; + public ImportAction(final FudaaCommonImplementation _ui) { + super(BuResource.BU.getString("Importer au format scope"), BuResource.BU.getIcon("IMPORTER"), "IMPORTER"); + ui_ = _ui; + } + public void actionPerformed(final ActionEvent _e) { + FudaaCourbeWizardImportScope wizard=new FudaaCourbeWizardImportScope(ui_); + BuWizardDialog DialogWizard = new BuWizardDialog(ui_.getFrame(), wizard); + // --affichage du wizard --// + DialogWizard.setSize(600, 500); + DialogWizard.setLocationRelativeTo(ui_.getFrame()); + DialogWizard.setVisible(true); + } + } + + + public FudaaCourbeWizardImportScope(FudaaCommonImplementation impl) { + super(); + + impl_=impl; + } + + + @Override + public JComponent getStepComponent() { + switch (current_) { + case 0: { + + if(panelFichier_==null) + panelFichier_=buildFilePanel(); + return panelFichier_; + } + case 1: { + + if(data_==null){ + return new JLabel(TrResource.getS("Erreur. Veuillez choisir un fichier valide")); + } + + if(panelParametres_==null) + panelParametres_=buildPanelParametresImportation(); + return panelParametres_; + } + + } + + return null; + } + + @Override + public int getStepCount() { + // TODO Auto-generated method stub + return 2; + } + + @Override + public String getStepText() { + // TODO Auto-generated method stub + return null; + } + + ScopeStructure.SorT dataST(){ + return (ScopeStructure.SorT)data_; + } + + ScopeStructure.Gene dataG(){ + return (ScopeStructure.Gene)data_; + } + + @Override + public String getStepTitle() { + String r = null; + + switch (current_) { + case 0: + r = TrResource.getS("Choisir le fichier"); + break; + case 1: + r = TrResource.getS("Param\xE8tres de cr\xE9ation"); + break; + + } + return r; + } + + /** + * construit le panel de selection du fichier + * @return + */ + JPanel buildFilePanel(){ + JPanel content=new JPanel(new FlowLayout(FlowLayout.CENTER)); + content.add(new JLabel(TrResource.getS("Choisir le fichier:"))); + filePath_=new BuTextField(20); + filePath_.setEnabled(false); + content.add(filePath_); + BuButton parcourir =new BuButton(TrResource.getS("Parcourir...")); + parcourir.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent arg0) { + final FileFormat[] ft = getFileFormatForImport(); + Arrays.sort(ft); + final BuFileFilter[] filters = FileFormat.createFilters(ft); + final CtuluFileChooser fileChooser = FudaaGuiLib.getFileChooser(BuResource.BU.getString("Importer"), filters, + null); + fileChooser.setAcceptAllFileFilterUsed(false); + for (int i = filters.length - 1; i >= 0; i--) { + if (ft[i].getID() == EvolutionFileFormat.getInstance().getID()) { + fileChooser.setFileFilter(filters[i]); + break; + } + } + final File initFile = FudaaGuiLib.chooseFile(CtuluLibSwing.getFrameAncestor(impl_.getParentComponent()), true,fileChooser); + if (initFile == null) { + return; + } + filePath_.setText(initFile.getAbsolutePath()); + + final FileFilter filter = fileChooser.getFileFilter(); + final int i = CtuluLibArray.getIndex(filter, filters); + if (i < 0) { + return; + } + typeFormat_=i; + fileChoosen_=initFile; + importData(); + + + + } + + }); + content.add(parcourir); + return content; + } + + /** + * Retourne les formats de fichiers disponibles + * @return + */ + public static FileFormat[] getFileFormatForImport() { + final ArrayList<FileFormatUnique> r = new ArrayList<FileFormatUnique>(10); + r.add(ScopeSFileFormat.getInstance()); + r.add(ScopeTFileFormat.getInstance()); + r.add(ScopeGENEFileFormat.getInstance()); + final FileFormat[] rf = new FileFormat[r.size()]; + r.toArray(rf); + return rf; + } + + + /** + * Methode iumportante d'importation des datas en fonction du fichier choisi et du type. + * Remplit la structure scope + */ + private void importData(){ + new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Importation graphe")) { + public void act() { + final ProgressionInterface prog = getMainStateReceiver(); + + switch(typeFormat_){ + case 0: + //cas s + data_=lectureScopeS(fileChoosen_,prog); + break; + case 1: + //cas scopT + data_=lectureScopeT(fileChoosen_,prog); + break; + case 2: + //cas scopGENE + data_=lectureScopeGENE(fileChoosen_,prog); + break; + } + + }}.start(); + + } + + private ScopeStructure.SorT lectureScopeS(final File _f,ProgressionInterface prog) { + final CtuluIOOperationSynthese op = ScopeSFileFormat.getInstance().getLastVersionInstance(null).read(_f, prog); + final ScopeStructure.SorT struct = (ScopeStructure.SorT) op.getSource(); + return struct; + } + private ScopeStructure.SorT lectureScopeT(final File _f,ProgressionInterface prog) { + final CtuluIOOperationSynthese op = ScopeTFileFormat.getInstance().getLastVersionInstance(null).read(_f, prog); + final ScopeStructure.SorT struct = (ScopeStructure.SorT) op.getSource(); + return struct; + } + private ScopeStructure.Gene lectureScopeGENE(final File _f,ProgressionInterface prog) { + final CtuluIOOperationSynthese op = ScopeGENEFileFormat.getInstance().getLastVersionInstance(null).read(_f, prog); + final ScopeStructure.Gene struct = (ScopeStructure.Gene) op.getSource(); + return struct; + } + + + /** + * Construit le panel de choix des donn\xE9es a importer pour les formats s et t + * @return + */ + double Xmin,Xmax; + JPanel buildPanelScopeSorT(){ + JPanel content=new JPanel(new BorderLayout()); + + String[] listeVar=new String[dataST().getNbVariables()-1]; + + //on ne prends pas les x + for(int i=1;i<dataST().getNbVariables();i++) + listeVar[i-1]=dataST().getVariable(i); + + listVariables_=new JList(listeVar); + listVariables_.setSelectedIndex(0); + content.add(listVariables_,BorderLayout.CENTER); + listVariables_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); + + plageDeb_.setCharValidator(BuCharValidator.FLOAT); + plageDeb_.setStringValidator(BuStringValidator.FLOAT); + plageDeb_.setValueValidator(BuValueValidator.FLOAT); + plageFin_.setCharValidator(BuCharValidator.FLOAT); + plageFin_.setStringValidator(BuStringValidator.FLOAT); + plageFin_.setValueValidator(BuValueValidator.FLOAT); + + //-- on init les plages --// + Xmin=dataST().getXMin(); + plageDeb_.setText(""+Xmin); + Xmax=dataST().getXMax(); + plageFin_.setText(""+Xmax); + + JPanel plages=new JPanel(new FlowLayout(FlowLayout.CENTER)); + plages.add(new JLabel(TrResource.getS("Choisir la plage des abscisses"))); + plages.add(plageDeb_); + plages.add(new JLabel("-")); + plages.add(plageFin_); + plages.add(new JLabel("(Min: "+Xmin+", Max: "+Xmax+")")); + content.add(plages,BorderLayout.SOUTH); + + return content; + } + + JPanel buildPanelScopeGENE(){ + return null; + } + + JPanel buildPanelParametresImportation(){ + switch(typeFormat_){ + case 0: + //cas s + return buildPanelScopeSorT(); + case 1: + //cas scopT + return buildPanelScopeSorT(); + case 2: + //cas scopGENE + return buildPanelScopeGENE(); + } + + return null; + } + + public String getTaskTitle() { + // TODO Auto-generated method stub + return TrResource.getS("Importation depuis les formats Scop S, T et GENE"); + } + + /** + * MEthode utilisee pour disabler ou non les boutons suivants + */ + public int getStepDisabledButtons() { + int r = super.getStepDisabledButtons(); + if (current_ == 1) { + + //cas scope s ou t + if(typeFormat_==1 || typeFormat_==0){ + if(data_==null) + r |= BuButtonPanel.TERMINER; + else + if(plageDeb_.getText().equals("") || plageFin_.getText().equals("")) + r |= BuButtonPanel.TERMINER; + else{ + //verifier que les plages ne sont pas depassees + double valDeb=Double.parseDouble(plageDeb_.getText()); + double valFin=Double.parseDouble(plageFin_.getText()); + if(valDeb<Xmin || Xmax<valFin) + r |= BuButtonPanel.TERMINER; + } + + }else{ + //cas scope gene + } + + } + return r; + } + + + public void doTask() { + done_ = true; + new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Importation graphe")) { + public void act() { + final ProgressionInterface prog = getMainStateReceiver(); + //mise a jour de la structure + impl_.setMainProgression(10); + impl_.setMainMessage(CtuluLib.getS("Structure modification")); + prog.setProgression(10); + prog.setDesc(CtuluLib.getS("Structure modification")); + if(typeFormat_<=1) + dataST().restreindreStructure(listVariables_.getSelectedIndices(),Double.parseDouble(plageDeb_.getText()),Double.parseDouble(plageFin_.getText())); + + + impl_.setMainProgression(30); + impl_.setMainMessage(CtuluLib.getS("Cr\xE9ation du graphe")); + // creation du graphe + switch(typeFormat_){ + case 0: + //cas s + result_=FudaaCourbeImporterScope.createGrapheSpatialGraphe(dataST(),prog);break; + case 1: + //cas scopT + result_=FudaaCourbeImporterScope.createGrapheTemporel(dataST(),prog);break; + case 2: + //cas scopGENE + result_=FudaaCourbeImporterScope.createGrapheTemporelGENE(dataG(),prog);break; + } + + //-- mise en forme du resultata g\xE9n\xE9r\xE9 --// + createGraphImported(result_); + } + }.start(); + } + + + /** + * Methode a surcharger. + * Appel\xE9e a la toute fin, gere le resultat + */ + public void createGraphImported(EGGraphe grapheGenere){ + //placer le graphe ou vous voulez... + } + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java ___________________________________________________________________ Added: svn:mergeinfo + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-01 16:07:45
|
Revision: 4017 http://fudaa.svn.sourceforge.net/fudaa/?rev=4017&view=rev Author: hadouxad Date: 2008-10-01 16:07:21 +0000 (Wed, 01 Oct 2008) Log Message: ----------- commit partiel Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.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/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/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardImportScope.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaGrapheWizardImportScope.java 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-01 11:00:40 UTC (rev 4016) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-10-01 16:07:21 UTC (rev 4017) @@ -99,6 +99,23 @@ private void insertX(double x) { getAllX().add(x); } + + public double getXMax(){ + double max=getX(0); + for(int i=1;i<getAllX().size();i++) + if(max<getX(i)) + max=getX(i); + return max; + } + + public double getXMin(){ + double min=getX(0); + for(int i=1;i<getAllX().size();i++) + if(min>getX(i)) + min=getX(i); + return min; + } + /** * Methode qui insert le x dans les variables que si il n'existe pas deja. * @@ -177,6 +194,51 @@ return evolReg; } + + /** + * Methode qui restreint lq structure en ne prenant que les variqbles choisies et la plage de x. + * @param selectedVariables + * @param xMin + * @param xMax + */ + public void restreindreStructure(int[] selectedVariables,double xMin,double xMax){ + + //--on retire toutes les variables qui ne sont pas voulues --// + Map<String, List<Double>> newdatas_ = new HashMap<String, List<Double>>(); + ArrayList<String> newVariables=new ArrayList<String>(); + + //ajout des x + newVariables.add(getVariable(0)); + newdatas_.put(getVariable(0), getAllX()); + + for(int i=0;i<selectedVariables.length;i++){ + //la bonne variable est selectedVariables[i]+1 car dans le choix on avait enlev\xE9 les X + newdatas_.put(getVariable(selectedVariables[i]+1), getListValueForVariable(selectedVariables[i]+1)); + newVariables.add(getVariable(selectedVariables[i]+1)); + } + + + //on retire les x qui ne sont pas les plages + for(int k=0;k<getNbValuePerVariables();k++){ + if(getX(k)>xMax || getX(k)<xMin){ + for(String var:newVariables){ + newdatas_.get(var).remove(k); + } + k--; + } + } + + //-- on remplace les nouvelles valeurs --// + data_=newdatas_; + listeVariales_=newVariables; + + //test + printResults(); + + + } + + @Override public void printResults() { Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java 2008-10-01 16:07:21 UTC (rev 4017) @@ -0,0 +1,93 @@ +package org.fudaa.fudaa.commun.courbe; + +import java.awt.event.ActionEvent; + +import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGCourbeModelDefault; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.courbe.EGModel; +import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; + +import com.memoire.bu.BuResource; +import com.memoire.bu.BuWizardDialog; + +/** + * Gere l'importation de donn\xE9es scope s ou t et cr\xE9e un graphe temporel ou spatial selon le format + * S'utilise avec le wizard FudaaCourbeWizardImportScope + * @author Adrien Hadoux + * + */ +public class FudaaCourbeImporterScope { + + /** + * Action qui genere un wizard pour le parametrage des structures import\xE9es. + * @author Adrien Hadoux + * + */ + + + public static EGGraphe createGrapheTemporel(ScopeStructure.SorT data_,ProgressionInterface prog){ + + + return createGrapheSpatialGraphe(data_, prog); + } + + /** + * genere un graphe spatial + * @param data_ + * @return + */ + public static EGGraphe createGrapheSpatialGraphe(ScopeStructure.SorT data_,ProgressionInterface prog){ + + EGGrapheTreeModel model=new EGGrapheTreeModel(); + double[] tabX=new double[data_.getAllX().size()]; + for(int i=0;i<data_.getAllX().size();i++) + tabX[i]=data_.getX(i); + + + for(int i=0;i<data_.getNbVariables();i++){ + + EGGroup varg=new EGGroup(); + varg.setTitle(data_.getVariable(i)); + model.add(varg); + + //--remplissage de valeurs --// + //tableau des y + double[] tabY=new double[tabX.length]; + + for(int j=0;j<tabX.length;j++) + tabY[j]=data_.getValueOfvariable(i, j); + EGCourbeModelDefault modelCourbe=new EGCourbeModelDefault(tabX,tabY); + EGCourbeChild courbe=new EGCourbeChild(varg,modelCourbe); + + varg.addEGComponent(courbe); + + } + + + EGGraphe graphe=new EGGraphe(model); + + + return graphe; + } + + +public static EGGraphe createGrapheSpatialGENE(ScopeStructure.Gene data_,ProgressionInterface prog){ + + + return null; + } + + +public static EGGraphe createGrapheTemporelGENE(ScopeStructure.Gene data_,ProgressionInterface prog){ + + + return null; +} +} Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaGrapheWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaGrapheWizardImportScope.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaGrapheWizardImportScope.java 2008-10-01 16:07:21 UTC (rev 4017) @@ -0,0 +1,434 @@ +package org.fudaa.fudaa.commun.courbe; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; + +import javax.swing.AbstractAction; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JTextField; +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; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.fileformat.FileFormat; +import org.fudaa.ctulu.fileformat.FileFormatUnique; +import org.fudaa.ctulu.gui.CtuluFileChooser; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; +import org.fudaa.dodico.mesure.EvolutionFileFormat; +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.tr.common.TrResource; + +import com.memoire.bu.BuButton; +import com.memoire.bu.BuButtonPanel; +import com.memoire.bu.BuCharValidator; +import com.memoire.bu.BuFileFilter; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuStringValidator; +import com.memoire.bu.BuTextField; +import com.memoire.bu.BuValueValidator; +import com.memoire.bu.BuWizardDialog; +import com.memoire.bu.BuWizardTask; + +/** + * Wizard qui se charge d'importer des courbes au format scope dans le post. + * + * Pour personnaliser le format final du graphe et son affichage, il faut surcharger la methode + * createGraphImported() + * @author Adrien Hadoux + * + */ +public class FudaaGrapheWizardImportScope extends BuWizardTask { + + //donnees haut niveau + FudaaCommonImplementation impl_; + + /** + * type de fomat: + * 0 => scops + * 1 =>scopT + * 2=>scopgene + */ + int typeFormat_; + File fileChoosen_=null; + ScopeStructure data_; + EGGraphe result_; + + //choix du fichier + JPanel panelFichier_; + BuTextField filePath_; + + //choix parametres s t ou gene + JPanel panelParametres_; + + //choix donnees S et T + BuTextField plageDeb_=new BuTextField(5); + BuTextField plageFin_=new BuTextField(5); + JList listVariables_; + + + public static class ImportAction extends EbliActionSimple { + final FudaaCommonImplementation ui_; + public ImportAction(final FudaaCommonImplementation _ui) { + super(BuResource.BU.getString("Importer au format scope"), BuResource.BU.getIcon("IMPORTER"), "IMPORTER"); + ui_ = _ui; + } + public void actionPerformed(final ActionEvent _e) { + FudaaGrapheWizardImportScope wizard=new FudaaGrapheWizardImportScope(ui_); + BuWizardDialog DialogWizard = new BuWizardDialog(ui_.getFrame(), wizard); + // --affichage du wizard --// + DialogWizard.setSize(600, 500); + DialogWizard.setLocationRelativeTo(ui_.getFrame()); + DialogWizard.setVisible(true); + } + } + + + public FudaaGrapheWizardImportScope(FudaaCommonImplementation impl) { + super(); + + impl_=impl; + } + + + @Override + public JComponent getStepComponent() { + switch (current_) { + case 0: { + + if(panelFichier_==null) + panelFichier_=buildFilePanel(); + return panelFichier_; + } + case 1: { + + if(data_==null){ + return new JLabel(TrResource.getS("Erreur. Veuillez choisir un fichier valide")); + } + + if(panelParametres_==null) + panelParametres_=buildPanelParametresImportation(); + return panelParametres_; + } + + } + + return null; + } + + @Override + public int getStepCount() { + // TODO Auto-generated method stub + return 2; + } + + @Override + public String getStepText() { + // TODO Auto-generated method stub + return null; + } + + ScopeStructure.SorT dataST(){ + return (ScopeStructure.SorT)data_; + } + + ScopeStructure.Gene dataG(){ + return (ScopeStructure.Gene)data_; + } + + @Override + public String getStepTitle() { + String r = null; + + switch (current_) { + case 0: + r = TrResource.getS("Choisir le fichier"); + break; + case 1: + r = TrResource.getS("Param\xE8tres de cr\xE9ation"); + break; + + } + return r; + } + + /** + * construit le panel de selection du fichier + * @return + */ + JPanel buildFilePanel(){ + JPanel content=new JPanel(new FlowLayout(FlowLayout.CENTER)); + content.add(new JLabel(TrResource.getS("Choisir le fichier:"))); + filePath_=new BuTextField(20); + filePath_.setEnabled(false); + content.add(filePath_); + BuButton parcourir =new BuButton(TrResource.getS("Parcourir...")); + parcourir.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent arg0) { + final FileFormat[] ft = getFileFormatForImport(); + Arrays.sort(ft); + final BuFileFilter[] filters = FileFormat.createFilters(ft); + final CtuluFileChooser fileChooser = FudaaGuiLib.getFileChooser(BuResource.BU.getString("Importer"), filters, + null); + fileChooser.setAcceptAllFileFilterUsed(false); + for (int i = filters.length - 1; i >= 0; i--) { + if (ft[i].getID() == EvolutionFileFormat.getInstance().getID()) { + fileChooser.setFileFilter(filters[i]); + break; + } + } + final File initFile = FudaaGuiLib.chooseFile(CtuluLibSwing.getFrameAncestor(impl_.getParentComponent()), true,fileChooser); + if (initFile == null) { + return; + } + filePath_.setText(initFile.getAbsolutePath()); + + final FileFilter filter = fileChooser.getFileFilter(); + final int i = CtuluLibArray.getIndex(filter, filters); + if (i < 0) { + return; + } + typeFormat_=i; + fileChoosen_=initFile; + importData(); + + + + } + + }); + content.add(parcourir); + return content; + } + + /** + * Retourne les formats de fichiers disponibles + * @return + */ + public static FileFormat[] getFileFormatForImport() { + final ArrayList<FileFormatUnique> r = new ArrayList<FileFormatUnique>(10); + r.add(ScopeSFileFormat.getInstance()); + r.add(ScopeTFileFormat.getInstance()); + r.add(ScopeGENEFileFormat.getInstance()); + final FileFormat[] rf = new FileFormat[r.size()]; + r.toArray(rf); + return rf; + } + + + /** + * Methode iumportante d'importation des datas en fonction du fichier choisi et du type. + * Remplit la structure scope + */ + private void importData(){ + new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Importation graphe")) { + public void act() { + final ProgressionInterface prog = getMainStateReceiver(); + + switch(typeFormat_){ + case 0: + //cas s + data_=lectureScopeS(fileChoosen_,prog); + break; + case 1: + //cas scopT + data_=lectureScopeT(fileChoosen_,prog); + break; + case 2: + //cas scopGENE + data_=lectureScopeGENE(fileChoosen_,prog); + break; + } + + }}.start(); + + } + + private ScopeStructure.SorT lectureScopeS(final File _f,ProgressionInterface prog) { + final CtuluIOOperationSynthese op = ScopeSFileFormat.getInstance().getLastVersionInstance(null).read(_f, prog); + final ScopeStructure.SorT struct = (ScopeStructure.SorT) op.getSource(); + return struct; + } + private ScopeStructure.SorT lectureScopeT(final File _f,ProgressionInterface prog) { + final CtuluIOOperationSynthese op = ScopeTFileFormat.getInstance().getLastVersionInstance(null).read(_f, prog); + final ScopeStructure.SorT struct = (ScopeStructure.SorT) op.getSource(); + return struct; + } + private ScopeStructure.Gene lectureScopeGENE(final File _f,ProgressionInterface prog) { + final CtuluIOOperationSynthese op = ScopeGENEFileFormat.getInstance().getLastVersionInstance(null).read(_f, prog); + final ScopeStructure.Gene struct = (ScopeStructure.Gene) op.getSource(); + return struct; + } + + + /** + * Construit le panel de choix des donn\xE9es a importer pour les formats s et t + * @return + */ + double Xmin,Xmax; + JPanel buildPanelScopeSorT(){ + JPanel content=new JPanel(new BorderLayout()); + + String[] listeVar=new String[dataST().getNbVariables()-1]; + + //on ne prends pas les x + for(int i=1;i<dataST().getNbVariables();i++) + listeVar[i-1]=dataST().getVariable(i); + + listVariables_=new JList(listeVar); + listVariables_.setSelectedIndex(0); + content.add(listVariables_,BorderLayout.CENTER); + listVariables_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); + + plageDeb_.setCharValidator(BuCharValidator.FLOAT); + plageDeb_.setStringValidator(BuStringValidator.FLOAT); + plageDeb_.setValueValidator(BuValueValidator.FLOAT); + plageFin_.setCharValidator(BuCharValidator.FLOAT); + plageFin_.setStringValidator(BuStringValidator.FLOAT); + plageFin_.setValueValidator(BuValueValidator.FLOAT); + + //-- on init les plages --// + Xmin=dataST().getXMin(); + plageDeb_.setText(""+Xmin); + Xmax=dataST().getXMax(); + plageFin_.setText(""+Xmax); + + JPanel plages=new JPanel(new FlowLayout(FlowLayout.CENTER)); + plages.add(new JLabel(TrResource.getS("Choisir la plage des abscisses"))); + plages.add(plageDeb_); + plages.add(new JLabel("-")); + plages.add(plageFin_); + plages.add(new JLabel("(Min: "+Xmin+", Max: "+Xmax+")")); + content.add(plages,BorderLayout.SOUTH); + + return content; + } + + JPanel buildPanelScopeGENE(){ + return null; + } + + JPanel buildPanelParametresImportation(){ + switch(typeFormat_){ + case 0: + //cas s + return buildPanelScopeSorT(); + case 1: + //cas scopT + return buildPanelScopeSorT(); + case 2: + //cas scopGENE + return buildPanelScopeGENE(); + } + + return null; + } + + public String getTaskTitle() { + // TODO Auto-generated method stub + return TrResource.getS("Importation depuis les formats Scop S, T et GENE"); + } + + /** + * MEthode utilisee pour disabler ou non les boutons suivants + */ + public int getStepDisabledButtons() { + int r = super.getStepDisabledButtons(); + if (current_ == 1) { + + //cas scope s ou t + if(typeFormat_==1 || typeFormat_==0){ + if(data_==null) + r |= BuButtonPanel.TERMINER; + else + if(plageDeb_.getText().equals("") || plageFin_.getText().equals("")) + r |= BuButtonPanel.TERMINER; + else{ + //verifier que les plages ne sont pas depassees + double valDeb=Double.parseDouble(plageDeb_.getText()); + double valFin=Double.parseDouble(plageFin_.getText()); + if(valDeb<Xmin || Xmax<valFin) + r |= BuButtonPanel.TERMINER; + } + + }else{ + //cas scope gene + } + + } + return r; + } + + + public void doTask() { + done_ = true; + new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Importation graphe")) { + public void act() { + final ProgressionInterface prog = getMainStateReceiver(); + //mise a jour de la structure + impl_.setMainProgression(10); + impl_.setMainMessage(CtuluLib.getS("Structure modification")); + prog.setProgression(10); + prog.setDesc(CtuluLib.getS("Structure modification")); + if(typeFormat_<=1) + dataST().restreindreStructure(listVariables_.getSelectedIndices(),Double.parseDouble(plageDeb_.getText()),Double.parseDouble(plageFin_.getText())); + + + impl_.setMainProgression(30); + impl_.setMainMessage(CtuluLib.getS("Cr\xE9ation du graphe")); + // creation du graphe + switch(typeFormat_){ + case 0: + //cas s + result_=FudaaCourbeImporterScope.createGrapheSpatialGraphe(dataST(),prog);break; + case 1: + //cas scopT + result_=FudaaCourbeImporterScope.createGrapheTemporel(dataST(),prog);break; + case 2: + //cas scopGENE + result_=FudaaCourbeImporterScope.createGrapheTemporelGENE(dataG(),prog);break; + } + + //-- mise en forme du resultata g\xE9n\xE9r\xE9 --// + createGraphImported(result_); + } + }.start(); + } + + + /** + * Methode a surcharger. + * Appel\xE9e a la toute fin, gere le resultat + */ + public void createGraphImported(EGGraphe grapheGenere){ + //placer le graphe ou vous voulez... + } + +} Modified: 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/TrPostDialogBilan.java 2008-10-01 11:00:40 UTC (rev 4016) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java 2008-10-01 16:07:21 UTC (rev 4017) @@ -509,8 +509,7 @@ */ private void computeResults() { - new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan") + CtuluLibString.ESPACE - + EvolutionFileFormat.getInstance().getName()) { + new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan") ) { public void act() { final ProgressionInterface prog = getMainStateReceiver(); // -- calcul de la EfLineIntersectionsResultsMng --// Modified: 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/TrPostDialogCubature.java 2008-10-01 11:00:40 UTC (rev 4016) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java 2008-10-01 16:07:21 UTC (rev 4017) @@ -379,8 +379,7 @@ */ private void computeResults() { - new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan") + CtuluLibString.ESPACE - + EvolutionFileFormat.getInstance().getName()) { + new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan")) { public void act() { final ProgressionInterface prog = getMainStateReceiver(); 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-01 11:00:40 UTC (rev 4016) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-10-01 16:07:21 UTC (rev 4017) @@ -496,6 +496,9 @@ init.add(null); init.add(new EbliWidgetAnimAdapter(getSceneCourante()).createAction()); + init.add(null); + init.add(new TrPostWizardImportScope.ImportAction(projet_)); + actions_ = Collections.unmodifiableList(init); } Modified: 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/TrPostWizardImportScope.java 2008-10-01 11:00:40 UTC (rev 4016) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardImportScope.java 2008-10-01 16:07:21 UTC (rev 4017) @@ -8,18 +8,23 @@ import java.util.Arrays; import javax.swing.AbstractAction; +import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JLabel; +import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.filechooser.FileFilter; +import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibArray; +import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.fileformat.FileFormat; import org.fudaa.ctulu.fileformat.FileFormatUnique; import org.fudaa.ctulu.gui.CtuluFileChooser; import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.dodico.reflux.io.CLTransitoireFileFormat; import org.fudaa.dodico.reflux.io.CrbFileFormat; @@ -27,179 +32,66 @@ 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.EGFillePanel; +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.courbe.FudaaGrapheWizardImportScope; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.impl.FudaaGuiLib; import org.fudaa.fudaa.tr.common.TrResource; import com.memoire.bu.BuButton; +import com.memoire.bu.BuButtonPanel; +import com.memoire.bu.BuCharValidator; import com.memoire.bu.BuFileFilter; import com.memoire.bu.BuResource; +import com.memoire.bu.BuStringValidator; +import com.memoire.bu.BuTextField; +import com.memoire.bu.BuValueValidator; +import com.memoire.bu.BuWizardDialog; import com.memoire.bu.BuWizardTask; /** - * Wizard qui se charge d'importer des courbes au format scope dans le post. + * Wizard qui surcharge le wizard de parametrage d'import des scope. * @author Adrien Hadoux * */ -public class TrPostWizardImportScope extends BuWizardTask { +public class TrPostWizardImportScope extends FudaaGrapheWizardImportScope { - //donnees haut niveau - FudaaCommonImplementation impl_; TrPostProjet projet_; - /** - * type de fomat: - * 0 => scops - * 1 =>scopet - * 2=>scopgene - */ - int typeFormat_; - File fileChoosen_=null; + - //choix du fichier - JPanel panelFichier_; - JTextField filePath_=new JTextField(20); + public static class ImportAction extends EbliActionSimple { + final FudaaCommonImplementation ui_; + TrPostProjet projet_; + public ImportAction( TrPostProjet projet) { + super(BuResource.BU.getString("Importer"), BuResource.BU.getIcon("IMPORTER"), "IMPORTER"); + ui_ = projet.impl_; + projet_=projet; + } + public void actionPerformed(final ActionEvent _e) { + TrPostWizardImportScope wizard=new TrPostWizardImportScope(projet_); + BuWizardDialog DialogWizard = new BuWizardDialog(ui_.getFrame(), wizard); + // --affichage du wizard --// + DialogWizard.setSize(600, 500); + DialogWizard.setLocationRelativeTo(ui_.getFrame()); + DialogWizard.setVisible(true); + } + } - public TrPostWizardImportScope(TrPostProjet projet_) { - super(); + super(projet_.impl_); this.projet_ = projet_; - impl_=projet_.impl_; } - - @Override - public JComponent getStepComponent() { - switch (current_) { - case 0: { - - if(panelFichier_==null) - panelFichier_=buildFilePanel(); - return panelFichier_; - } - case 1: { - - } - - } - - return null; - } - - @Override - public int getStepCount() { - // TODO Auto-generated method stub - return 2; - } - - @Override - public String getStepText() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getStepTitle() { - String r = null; - - switch (current_) { - case 0: - r = TrResource.getS("Choisir le fichier"); - break; - case 1: - r = TrResource.getS("S\xE9lectionner les variables"); - break; - case 2: - r = TrResource.getS("S\xE9lectionner les graphes"); - break; - } - return r; - } - - - JPanel buildFilePanel(){ - JPanel content=new JPanel(new FlowLayout(FlowLayout.CENTER)); - content.add(new JLabel(TrResource.getS("Choisir le fichier:"))); - content.add(filePath_); - BuButton parcourir =new BuButton(TrResource.getS("Parcourir...")); - parcourir.setAction(new AbstractAction(){ - public void actionPerformed(ActionEvent arg0) { - final FileFormat[] ft = getFileFormatForImport(); - Arrays.sort(ft); - final BuFileFilter[] filters = FileFormat.createFilters(ft); - final CtuluFileChooser fileChooser = FudaaGuiLib.getFileChooser(BuResource.BU.getString("Importer"), filters, - null); - fileChooser.setAcceptAllFileFilterUsed(false); - for (int i = filters.length - 1; i >= 0; i--) { - if (ft[i].getID() == EvolutionFileFormat.getInstance().getID()) { - fileChooser.setFileFilter(filters[i]); - break; - } - } - final File initFile = FudaaGuiLib.chooseFile(CtuluLibSwing.getFrameAncestor(impl_.getParentComponent()), true, - fileChooser); - if (initFile == null) { - return; - } - final FileFilter filter = fileChooser.getFileFilter(); - final int i = CtuluLibArray.getIndex(filter, filters); - if (i < 0) { - return; - } - typeFormat_=i; - fileChoosen_=initFile; - importData(); - - } - - }); - content.add(parcourir); - return content; - } - - /** - * Retourne les formats de fichiers disponibles - * @return - */ - public static FileFormat[] getFileFormatForImport() { - final ArrayList<FileFormatUnique> r = new ArrayList<FileFormatUnique>(10); - r.add(ScopeSFileFormat.getInstance()); - r.add(ScopeTFileFormat.getInstance()); - r.add(ScopeGENEFileFormat.getInstance()); - final FileFormat[] rf = new FileFormat[r.size()]; - r.toArray(rf); - return rf; + public void createGraphImported(EGGraphe grapheGenere){ + projet_.addGrapheNodeInCurrentScene(new EGFillePanel(grapheGenere), "Graphe import\xE9 (format scope)"); } - - - /** - * Methode iumportante d'importation des datas en fonction du fichier choisi et du type. - */ - private void importData(){ - - switch(typeFormat_){ - - case 0: - //cas s - break; - case 1: - //cas scopT - break; - case 2: - //cas scopGENE - break; - } - - } - - - public String getTaskTitle() { - // 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: <emm...@us...> - 2008-10-01 11:00:50
|
Revision: 4016 http://fudaa.svn.sourceforge.net/fudaa/?rev=4016&view=rev Author: emmanuel_martin Date: 2008-10-01 11:00:40 +0000 (Wed, 01 Oct 2008) Log Message: ----------- Utilisation de 'pointPlusProche' de GrSegement pour la projection au lieu d'un calcul dans addPoint. Modified Paths: -------------- 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 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-01 10:02:14 UTC (rev 4015) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2008-10-01 11:00:40 UTC (rev 4016) @@ -15,6 +15,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ctulu.gis.GISPolygone; import org.fudaa.ebli.calque.ZCalqueLigneBrisee; import org.fudaa.ebli.calque.ZModeleLigneBrisee; import org.fudaa.ebli.calque.dessin.DeForme; @@ -168,39 +169,36 @@ final GrBoite bClip = getDomaine(); bClip.autoApplique(versEcran); final int tolerance = 5; + // Point \xE0 projeter final GrPoint pt = new GrPoint(_xEcran, _yEcran, 0); if ((!bClip.contientXY(pt)) && (bClip.distanceXY(pt) > tolerance)) { return false; } final double distanceReel = GrMorphisme.convertDistanceXY(versReel, tolerance); - // bClip = getClipReel(getGraphics()); final GrPoint ptToTest = pt.applique(versReel); final GrSegment seg = new GrSegment(new GrPoint(), new GrPoint()); final GrBoite bPoly = new GrBoite(new GrPoint(), new GrPoint()); - + int i=selection_.getMinIndex(); - -// for (int i = modele_.getNbLigneBrisee() - 1; i >= 0; i--) { - modele_.getDomaineForGeometry(i, bPoly); - if (bPoly.contientXY(ptToTest) || bPoly.distanceXY(ptToTest) < distanceReel) { - for (int j = modele_.getNbPointForGeometry(i) - 1; j > 0; j--) { - modele_.point(seg.e_, i, j); - modele_.point(seg.o_, i, j - 1); - if (seg.distanceXY(ptToTest) < distanceReel) { - addPoint(i, j - 1, ptToTest.x_, ptToTest.y_, _cmd); - return true; - } + modele_.getDomaineForGeometry(i, bPoly); + if (bPoly.contientXY(ptToTest)||bPoly.distanceXY(ptToTest)<distanceReel) { + for (int j=modele_.getNbPointForGeometry(i)-1; j>0; j--) { + modele_.point(seg.e_, i, j); + modele_.point(seg.o_, i, j-1); + if (seg.distanceXY(ptToTest)<distanceReel) { + addPoint(i, j-1, ptToTest.x_, ptToTest.y_, _cmd); + return true; } - if (modele_.isGeometryFermee(i)) { - modele_.point(seg.e_, i, 0); - modele_.point(seg.o_, i, modele_.getNbPointForGeometry(i) - 1); - if (seg.distanceXY(ptToTest) < distanceReel) { - addPoint(i, modele_.getNbPointForGeometry(i) - 1, ptToTest.x_, ptToTest.y_, _cmd); - return true; - } + } + if (modele_.isGeometryFermee(i)) { + modele_.point(seg.e_, i, 0); + modele_.point(seg.o_, i, modele_.getNbPointForGeometry(i)-1); + if (seg.distanceXY(ptToTest)<distanceReel) { + addPoint(i, modele_.getNbPointForGeometry(i)-1, ptToTest.x_, ptToTest.y_, _cmd); + return true; } } -// } + } return false; } 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-01 10:02:14 UTC (rev 4015) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-01 11:00:40 UTC (rev 4016) @@ -26,8 +26,10 @@ import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.commun.EbliListeSelectionMultiInterface; +import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.geometrie.GrPolygone; import org.fudaa.ebli.geometrie.GrPolyligne; +import org.fudaa.ebli.geometrie.GrSegment; import com.memoire.fu.FuLog; import com.vividsolutions.jts.geom.Coordinate; @@ -257,21 +259,14 @@ if (geometries_ == null) { return; } - double x = _x; final CoordinateSequence g = ((LineString) geometries_.getGeometry(_ligneIdx)) .getCoordinateSequence(); - final double x1 = g.getX(_idxBefore); - final double y1 = g.getY(_idxBefore); - final double x2 = g.getX(_idxBefore + 1); - final double y2 = g.getY(_idxBefore + 1); - double y; - if(x2!=x1) // Cas g\xE9n\xE9ral - y = y2 + (x2 - x) * (y1 - y2) / (x2 - x1); - else{ // Cas d'un segment vertical - x = x1; - y = _y; - } - geometries_.addPoint(_ligneIdx, _idxBefore, x, y, _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), + 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); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-01 10:02:39
|
Revision: 4015 http://fudaa.svn.sourceforge.net/fudaa/?rev=4015&view=rev Author: hadouxad Date: 2008-10-01 10:02:14 +0000 (Wed, 01 Oct 2008) Log Message: ----------- creation des cubatures, bilan et wizard import scop s,t,gene Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.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/TrPostActionBilan.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/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/TrPostLayoutFille.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardImportScope.java Added: 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 (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java 2008-10-01 10:02:14 UTC (rev 4015) @@ -0,0 +1,201 @@ +package org.fudaa.dodico.ef; + +import gnu.trove.TIntArrayList; +import gnu.trove.TIntObjectHashMap; + +import java.io.IOException; + +import org.fudaa.ctulu.CtuluActivity; +import org.fudaa.ctulu.CtuluAnalyze; +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; + +/** + * Calcul du volume par rapport a un seuil et non plus 0. + * @author Adrien Hadoux + * + */ +public abstract class EfComputeVolumeSeuil implements CtuluActivity { + + public static class ForMeshData extends EfComputeVolumeSeuil { + + ForMeshData(final EfFilter _filter, final ProgressionInterface _prog, final EfGridData _data, + final CtuluVariable _hVar, final int timestep,final double seuil) { + super(_filter, _prog, _data, _hVar,timestep,seuil); + } + + + EfDataIntegrale computeVolume(final EfGridInterface _grid, final EfData _h) { + EfDataIntegrale resi = new EfDataIntegrale(); + for (int ielt = 0; ielt < _grid.getEltNb(); ielt++) { + if (filter_.isActivatedElt(ielt, _grid, false)) { + + if(_h.getValue(ielt)<=seuil_) + resi.zoneMoins_ += _grid.getAire(ielt) * _h.getValue(ielt); + else + resi.zonePlus_ += _grid.getAire(ielt) * _h.getValue(ielt); + } + } + return resi; + } + } + + public static class ForNodeData extends EfComputeVolumeSeuil { + + ForNodeData(final EfFilter _filter, final ProgressionInterface _prog, final EfGridData _data, + final CtuluVariable _hVar, final int timestep,final double seuil) { + super(_filter, _prog, _data, _hVar,timestep,seuil); + } + + EfDataIntegrale computeVolume(final EfGridInterface _grid, final EfData _h) { + EfDataIntegrale resi = new EfDataIntegrale(); + for (int ipt = 0; ipt < _grid.getPtsNb(); ipt++) { + // le calcul du volume se fait: + // Volume=(surface des elements adjacents)* hauteur au point /3 + if (filter_.isActivated(ipt)) { + // liste des elements adjacents. + final TIntArrayList list = (TIntArrayList) idxPtAdjMes_.get(ipt); + // la liste est nulle: ne devrait jamais arriv\xE9: un point isol\xE9 que faire ? + // pour l'instant on ignore. + if (list != null) { + // s est la surface des elements adjacents. + double s = 0D; + for (int k = 0; k < list.size(); k++) { + s += _grid.getAire(list.getQuick(k)); + } + // la formule qui tue + if(_h.getValue(ipt)<=seuil_) + resi.zoneMoins_ += s * _h.getValue(ipt) / 3D; + else + resi.zonePlus_ += s * _h.getValue(ipt) / 3D; + } + } + } + return resi; + } + + public EfDataIntegrale getVolume(int choosenTimestep) { + computeNeighborMeshes(); + return super.getVolume(choosenTimestep); + } + } + + final EfGridData data_; + final EfFilter filter_; + final CtuluVariable h_; + protected final int timeStep_; + protected final double seuil_; + + /** + * Stocke indice du noeuds -> list element adjacent. Pour les noeuds s\xE9lecionn\xE9s uniquement + */ + TIntObjectHashMap idxPtAdjMes_; + ProgressionInterface prog_; + + boolean stop_; + + public static EfComputeVolumeSeuil getVolumeComputer(final EfFilter _filter, final ProgressionInterface _prog, + final EfGridData _data, final CtuluVariable _hVar, final int timestep,final double seuil, final CtuluAnalyze _analyze) { + if (!_data.isDefined(_hVar)) { + _analyze.addFatalError(DodicoLib.getS("La hauteur d'eau n'est pas d\xE9finie")); + return null; + } + if (_data.isElementVar(_hVar)) { + return new ForMeshData(_filter, _prog, _data, _hVar,timestep,seuil); + } + return new ForNodeData(_filter, _prog, _data, _hVar,timestep,seuil); + + } + + EfComputeVolumeSeuil(final EfFilter _filter, final ProgressionInterface _prog, final EfGridData _data, + final CtuluVariable _hVar, final int timestep,final double seuil) { + super(); + prog_ = _prog; + data_ = _data; + h_ = _hVar; + timeStep_=timestep; + seuil_=seuil; + filter_ = _filter == null ? new EfFilterNone() : _filter; + } + + abstract EfDataIntegrale computeVolume(final EfGridInterface _grid, EfData _h); + + protected void computeNeighborMeshes() { + if (idxPtAdjMes_ != null) { + return; + } + final ProgressionUpdater up = new ProgressionUpdater(prog_); + final EfGridInterface grid = data_.getGrid(); + up.setValue(10, grid.getEltNb()); + up.majProgessionStateOnly(DodicoLib.getS("Recherche des \xE9l\xE9ments voisins")); + idxPtAdjMes_ = new TIntObjectHashMap(grid.getPtsNb()); + for (int i = 0; i < grid.getEltNb(); i++) { + if (stop_) { + idxPtAdjMes_ = null; + return; + } + final EfElement elt = grid.getElement(i); + for (int j = 0; j < elt.getPtNb(); j++) { + final int ptIndex = elt.getPtIndex(j); + // si le noeud est s\xE9lectionne + if (filter_.isActivated(ptIndex)) { + TIntArrayList list = (TIntArrayList) idxPtAdjMes_.get(ptIndex); + // ce noeud n'a pas encore \xE9t\xE9 trait\xE9 + if (list == null) { + list = new TIntArrayList(10); + idxPtAdjMes_.put(ptIndex, list); + } + list.add(i); + + } + } + up.majAvancement(); + } + } + + public EfDataIntegrale getVolume(int choosenTimestep) { + final ProgressionUpdater up = new ProgressionUpdater(prog_); + final EfGridInterface grid = data_.getGrid(); + up.setValue(10, 100); + EfDataIntegrale res ; + up.majProgessionStateOnly(DodicoLib.getS("Calcul du volume")); + + if (stop_) { + return null; + } + EfData h = null; + try { + h = data_.getData(h_, timeStep_); + } catch (final IOException _evt) { + FuLog.error(_evt); + + } + if (h == null) { + return null; + } + res = computeVolume(grid, h); + up.majAvancement(); + + return res; + } + + public ProgressionInterface getProg() { + return prog_; + } + + public void setProg(final ProgressionInterface _prog) { + prog_ = _prog; + } + + public void stop() { + stop_ = true; + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-10-01 09:20:04 UTC (rev 4014) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-10-01 10:02:14 UTC (rev 4015) @@ -61,7 +61,7 @@ * * @return */ - EvolutionReguliere[] readStructure() { + ScopeStructure.Gene readStructure() { if (super.in_ == null) { analyze_.addError(H2dResource.getS("Flux d'entr\xE9e non trouv\xE9"), 0); @@ -119,7 +119,7 @@ } } catch (EOFException Exc) { - return structure.returnEvolReguliere(); + return structure; } } catch (IOException e) { Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-10-01 09:20:04 UTC (rev 4014) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-10-01 10:02:14 UTC (rev 4015) @@ -60,7 +60,7 @@ * * @return */ - EvolutionReguliere[] readStructure() { + ScopeStructure.SorT readStructure() { if (super.in_ == null) { @@ -94,7 +94,7 @@ }catch(EOFException Exc){ - return structure.returnEvolReguliere(); + return structure; } Modified: 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/TrPostActionBilan.java 2008-10-01 09:20:04 UTC (rev 4014) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionBilan.java 2008-10-01 10:02:14 UTC (rev 4015) @@ -50,12 +50,6 @@ } - protected LineString getSelectedLine() { - // pas de calque s\xE9lectionn\xE9 - if (!(panel_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { - return null; - } - return ((ZCalqueAffichageDonneesInterface) panel_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); - } + } Modified: 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/TrPostActionCubature.java 2008-10-01 09:20:04 UTC (rev 4014) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionCubature.java 2008-10-01 10:02:14 UTC (rev 4015) @@ -49,11 +49,5 @@ } - protected LineString getSelectedLine() { - // pas de calque s\xE9lectionn\xE9 - if (!(panel_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { - return null; - } - return ((ZCalqueAffichageDonneesInterface) panel_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); - } + } Modified: 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/TrPostDialogBilan.java 2008-10-01 09:20:04 UTC (rev 4014) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java 2008-10-01 10:02:14 UTC (rev 4015) @@ -303,7 +303,7 @@ return false; } public Object getValueAt(int _row, int _column) { - if (_column == 0) + if (_column == 1) return resCalcul_.getZoneMoins(); else if (_column == 0) return resCalcul_.getZonePlus(); @@ -322,22 +322,39 @@ public boolean controleDataOk() { if (boxSelectLineManu_.isSelected()) { - if (textX1.getText().equals("")) - return false; - if (textX2.getText().equals("")) - return false; - if (textY1.getText().equals("")) - return false; - if (textY2.getText().equals("")) - return false; + if (textX1.getText().equals("")){ + impl_.error(TrResource.getS("Point non saisi correctement")); + return false; + } + if (textX2.getText().equals("")){ + impl_.error(TrResource.getS("Point non saisi correctement")); + return false; + + } + if (textY1.getText().equals("")){ + impl_.error(TrResource.getS("Point non saisi correctement")); + return false; + + } + if (textY2.getText().equals("")){ + impl_.error(TrResource.getS("Point non saisi correctement")); + return false; + } } - if(seuil_.getText().equals("")) + if(seuil_.getText().equals("")){ + impl_.error(TrResource.getS("Le seuil doit \xEAtre d\xE9fini par un r\xE9el (y=cste)")); + return false; + } + if(listVar_.getSelectedIndex()==-1){ + impl_.error(TrResource.getS("Il faut choisir une variable")); return false; - if(listVar_.getSelectedIndex()==-1) + } + if(listPdt_.getSelectedIndex()==-1){ + impl_.error(TrResource.getS("Il faut choisir un pas de temps")); return false; - + } return true; } @@ -384,6 +401,8 @@ JPanel content = new JPanel(new GridLayout(1, 2)); listVar_ = new JList(modelVariables_); listPdt_ = new JList(modelPdt_); + listVar_.setSelectedIndex(0); + listPdt_.setSelectedIndex(0); listVar_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listPdt_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); content.add(new JScrollPane(listVar_)); @@ -523,7 +542,7 @@ resCalcul_ = EfDataIntegrale.integrerMethodeTrapeze(interfaceRes, data, getSeuil()); // -- mise a jour du tableau de res --// - modelGraphe_.fireStructureChanged(); + modelResult_.fireTableDataChanged(); impl_.unsetMainMessage(); Modified: 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/TrPostDialogCubature.java 2008-10-01 09:20:04 UTC (rev 4014) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java 2008-10-01 10:02:14 UTC (rev 4015) @@ -5,6 +5,7 @@ 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; @@ -17,23 +18,42 @@ 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.table.DefaultTableModel; +import org.fudaa.ctulu.CtuluAnalyze; +import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; +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.dodico.mesure.EvolutionFileFormat; +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.calque.ZCalqueLigneBrisee; import org.fudaa.ebli.calque.find.CalqueFindCourbeTreeModel; 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.LineString; +import com.vividsolutions.jts.geom.LinearRing; + public class TrPostDialogCubature { /** @@ -57,6 +77,12 @@ ListModel modelPdt_; JList listPdt_; + + //seuil + private JPanel panelSeuil_; + BuTextField seuil_ = new BuTextField(5); + + // isolignes private JPanel panelIsolignes_; JTree treeLignes_; @@ -66,7 +92,7 @@ JPanel panelResults_; JLabel results_; JButton ajouter_ = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); - + DefaultTableModel modelResult_; /** * Constructeur reserv\xE9 au calques * @@ -122,42 +148,100 @@ private JPanel buildIsoLignes() { JPanel content = new JPanel(new BorderLayout()); treeLignes_ = buildTree(); - content.add(treeLignes_, BorderLayout.CENTER); + content.add(new JScrollPane(treeLignes_), BorderLayout.CENTER); content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de la ligne bris\xE9e du calque"))); return content; } + + private JPanel buildSeuil(){ + seuil_.setCharValidator(BuCharValidator.FLOAT); + seuil_.setStringValidator(BuStringValidator.FLOAT); + seuil_.setValueValidator(BuValueValidator.FLOAT); + + JPanel conteneur = new JPanel(new FlowLayout(FlowLayout.CENTER)); + conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix du seuil"))); + conteneur.add( seuil_); + + return conteneur; + } - private JPanel buildresults() { - JPanel content = new JPanel(new FlowLayout(FlowLayout.LEFT)); + 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() { - results_ = new JLabel(""); - content.add(ajouter_); - content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); - content.add(results_); + public void actionPerformed(ActionEvent _e) { + if (controleDataOk()) { + computeResults(); + } + } - content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("R\xE9sultats"))); + }); + + modelResult_ = new DefaultTableModel() { + public int getColumnCount() { + return 3; + } + public String getColumnName(int _column) { + if (_column == 1) + return "Zone positive"; + else if (_column == 0) + return "Zone n\xE9gative"; + else + return "R\xE9sultat"; + } + public int getRowCount() { + return 1; + } + public boolean isCellEditable(int _row, int _column) { + return false; + } + public Object getValueAt(int _row, int _column) { + if (_column == 0) + return resCalcul_.getZoneMoins(); + else if (_column == 1) + return resCalcul_.getZonePlus(); + else + return resCalcul_.getResultat(); + } + }; - // -- action relatives aux resultats --// - ajouter_.setAction(new AbstractAction() { + JTable tableauRes = new JTable(modelResult_); + conteneur.add(tableauRes.getTableHeader(), BorderLayout.NORTH); + conteneur.add(tableauRes, BorderLayout.CENTER); + conteneur.add(content, BorderLayout.SOUTH); + return conteneur; + } - public void actionPerformed(ActionEvent _e) { - if (controleDataOk()) { - computeResults(); - } - } - - }); - - return content; - } - public boolean controleDataOk() { - if (listVar_.getSelectedIndex() == -1) + + if (treeLignes_.getSelectionCount() == 0){ + impl_.error(TrResource.getS("Il faut choisir une ligne bris\xE9e")); + return false; + } + if(seuil_.getText().equals("")){ + impl_.error(TrResource.getS("Le seuil doit \xEAtre d\xE9fini par un r\xE9el (y=cste)")); + return false; + } + if(listVar_.getSelectedIndex()==-1){ + impl_.error(TrResource.getS("Il faut choisir une variable")); return false; - if (treeLignes_.getSelectionCount() == 0) + } + if(listPdt_.getSelectedIndex()==-1){ + impl_.error(TrResource.getS("Il faut choisir un pas de temps")); return false; + } return true; } @@ -186,7 +270,9 @@ 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_)); @@ -216,6 +302,11 @@ panelVariables_ = buildVariables(); content.add(panelVariables_); + // -- panelSeuil + if (panelSeuil_ == null) + panelSeuil_ = buildSeuil(); + content.add(panelSeuil_); + // -- panel des resultats --// if (panelResults_ == null) panelResults_ = buildresults(); @@ -264,6 +355,26 @@ } /** + * Recupere la ligne brisee du tree + * @return + */ + public LinearRing getSelectedLineInTree() { + if (treeLignes_.isSelectionEmpty()) { + return null; + } + final CalqueFindCourbeTreeModel.LayerNode node = (CalqueFindCourbeTreeModel.LayerNode) treeLignes_.getSelectionPath() + .getLastPathComponent(); + final ZCalqueLigneBrisee cq = (ZCalqueLigneBrisee) node.getUserObject(); + return (LinearRing) cq.getModele().getGeomData().getGeometry(node.getIdxPoly()); + } + + + protected double getSeuil() { + return Double.parseDouble(seuil_.getText()); + } + + + /** * Methode qui realise les calculs d'int\xE9grale par rapport aux donn\xE9es */ private void computeResults() { @@ -273,10 +384,30 @@ public void act() { final ProgressionInterface prog = getMainStateReceiver(); + //-- calcul du ef filter --// + impl_.setMainProgression(10); + impl_.setMainMessage(CtuluLib.getS("R\xE9cup\xE9ration des lignes bris\xE9es")); + EfFilter selectedElt; + MvElementLayer layer=calque_.getGridGroup().getPolygonLayer(); + CtuluListSelection listSelect=layer.selection(getSelectedLineInTree(), 0); + selectedElt=new EfFilterSelectedElement(listSelect,source_.getGrid()); - // a faire + // -- calcul des efdata --// + impl_.setMainProgression(30); + impl_.setMainMessage(CtuluLib.getS("Calcul des donn\xE9es pour les pas de temps et variables r\xE9cup\xE9r\xE9s")); + EfData data = source_.getData(getSelectedVariable(), getSelectedTimeStep()); + // -- calcul de l'int\xE9grale --// + impl_.setMainProgression(70); + impl_.setMainMessage(CtuluLib.getS("Calcul de l'int\xE9grale")); + + EfComputeVolumeSeuil compute= EfComputeVolumeSeuil.getVolumeComputer(selectedElt, prog, source_, getSelectedVariable(), getSelectedTimeStep(), getSeuil(), new CtuluAnalyze()); + + resCalcul_ =compute.getVolume(getSelectedTimeStep()); + + // -- mise a jour du tableau de res --// + modelResult_.fireTableDataChanged(); impl_.unsetMainMessage(); impl_.unsetMainProgression(); } 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-01 09:20:04 UTC (rev 4014) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-10-01 10:02:14 UTC (rev 4015) @@ -571,8 +571,8 @@ if (_graphe.getGraphe().getModel() instanceof MvProfileTreeModel) { listeActions .add(new TrPostActionBilan(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_.getImpl())); - listeActions.add(new TrPostActionCubature(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_ - .getImpl())); +// listeActions.add(new TrPostActionCubature(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_ +// .getImpl())); } //--ajout des actions import export format scope --// @@ -604,7 +604,6 @@ final ArrayList<EbliActionSimple> listeActions = new ArrayList<EbliActionSimple>(); listeActions.add(new TrPostActionBilan((TrPostVisuPanel) creator.getCalque(), projet_.getImpl())); - _controller.addFonctionsSpecific(listeActions); listeActions.add(new TrPostActionCubature((TrPostVisuPanel) creator.getCalque(), projet_.getImpl())); _controller.addFonctionsSpecific(listeActions); Added: 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/TrPostWizardImportScope.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardImportScope.java 2008-10-01 10:02:14 UTC (rev 4015) @@ -0,0 +1,205 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; + +import javax.swing.AbstractAction; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.filechooser.FileFilter; + +import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.CtuluLibArray; +import org.fudaa.ctulu.fileformat.FileFormat; +import org.fudaa.ctulu.fileformat.FileFormatUnique; +import org.fudaa.ctulu.gui.CtuluFileChooser; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.dodico.mesure.EvolutionFileFormat; +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.ScopeTFileFormat; +import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; +import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; +import org.fudaa.fudaa.commun.impl.FudaaGuiLib; +import org.fudaa.fudaa.tr.common.TrResource; + +import com.memoire.bu.BuButton; +import com.memoire.bu.BuFileFilter; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuWizardTask; + +/** + * Wizard qui se charge d'importer des courbes au format scope dans le post. + * @author Adrien Hadoux + * + */ +public class TrPostWizardImportScope extends BuWizardTask { + + //donnees haut niveau + FudaaCommonImplementation impl_; + TrPostProjet projet_; + /** + * type de fomat: + * 0 => scops + * 1 =>scopet + * 2=>scopgene + */ + int typeFormat_; + File fileChoosen_=null; + + //choix du fichier + JPanel panelFichier_; + JTextField filePath_=new JTextField(20); + + + public TrPostWizardImportScope(TrPostProjet projet_) { + super(); + this.projet_ = projet_; + impl_=projet_.impl_; + } + + + @Override + public JComponent getStepComponent() { + switch (current_) { + case 0: { + + if(panelFichier_==null) + panelFichier_=buildFilePanel(); + return panelFichier_; + } + case 1: { + + } + + } + + return null; + } + + @Override + public int getStepCount() { + // TODO Auto-generated method stub + return 2; + } + + @Override + public String getStepText() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getStepTitle() { + String r = null; + + switch (current_) { + case 0: + r = TrResource.getS("Choisir le fichier"); + break; + case 1: + r = TrResource.getS("S\xE9lectionner les variables"); + break; + case 2: + r = TrResource.getS("S\xE9lectionner les graphes"); + break; + } + return r; + } + + + JPanel buildFilePanel(){ + JPanel content=new JPanel(new FlowLayout(FlowLayout.CENTER)); + content.add(new JLabel(TrResource.getS("Choisir le fichier:"))); + content.add(filePath_); + BuButton parcourir =new BuButton(TrResource.getS("Parcourir...")); + parcourir.setAction(new AbstractAction(){ + public void actionPerformed(ActionEvent arg0) { + final FileFormat[] ft = getFileFormatForImport(); + Arrays.sort(ft); + final BuFileFilter[] filters = FileFormat.createFilters(ft); + final CtuluFileChooser fileChooser = FudaaGuiLib.getFileChooser(BuResource.BU.getString("Importer"), filters, + null); + fileChooser.setAcceptAllFileFilterUsed(false); + for (int i = filters.length - 1; i >= 0; i--) { + if (ft[i].getID() == EvolutionFileFormat.getInstance().getID()) { + fileChooser.setFileFilter(filters[i]); + break; + } + } + final File initFile = FudaaGuiLib.chooseFile(CtuluLibSwing.getFrameAncestor(impl_.getParentComponent()), true, + fileChooser); + if (initFile == null) { + return; + } + final FileFilter filter = fileChooser.getFileFilter(); + final int i = CtuluLibArray.getIndex(filter, filters); + if (i < 0) { + return; + } + typeFormat_=i; + fileChoosen_=initFile; + importData(); + + } + + }); + content.add(parcourir); + return content; + } + + /** + * Retourne les formats de fichiers disponibles + * @return + */ + public static FileFormat[] getFileFormatForImport() { + final ArrayList<FileFormatUnique> r = new ArrayList<FileFormatUnique>(10); + r.add(ScopeSFileFormat.getInstance()); + r.add(ScopeTFileFormat.getInstance()); + r.add(ScopeGENEFileFormat.getInstance()); + final FileFormat[] rf = new FileFormat[r.size()]; + r.toArray(rf); + return rf; + } + + + /** + * Methode iumportante d'importation des datas en fonction du fichier choisi et du type. + */ + private void importData(){ + + switch(typeFormat_){ + + case 0: + //cas s + break; + case 1: + //cas scopT + break; + case 2: + //cas scopGENE + break; + } + + } + + + public String getTaskTitle() { + // 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: <emm...@us...> - 2008-10-01 09:20:21
|
Revision: 4014 http://fudaa.svn.sourceforge.net/fudaa/?rev=4014&view=rev Author: emmanuel_martin Date: 2008-10-01 09:20:04 +0000 (Wed, 01 Oct 2008) Log Message: ----------- Correction d'un bug dans l'ajout de point dans un segment vertical qui entrainait un r?\195?\169sultat incoh?\195?\169rent. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 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-09-30 19:07:57 UTC (rev 4013) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-01 09:20:04 UTC (rev 4014) @@ -257,14 +257,20 @@ if (geometries_ == null) { return; } - final double x = _x; + double x = _x; final CoordinateSequence g = ((LineString) geometries_.getGeometry(_ligneIdx)) .getCoordinateSequence(); final double x1 = g.getX(_idxBefore); final double y1 = g.getY(_idxBefore); final double x2 = g.getX(_idxBefore + 1); final double y2 = g.getY(_idxBefore + 1); - final double y = y2 + (x2 - x) * (y1 - y2) / (x2 - x1); + double y; + if(x2!=x1) // Cas g\xE9n\xE9ral + y = y2 + (x2 - x) * (y1 - y2) / (x2 - x1); + else{ // Cas d'un segment vertical + x = x1; + y = _y; + } geometries_.addPoint(_ligneIdx, _idxBefore, x, y, _cmd); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-30 19:08:18
|
Revision: 4013 http://fudaa.svn.sourceforge.net/fudaa/?rev=4013&view=rev Author: hadouxad Date: 2008-09-30 19:07:57 +0000 (Tue, 30 Sep 2008) Log Message: ----------- - IHM calculs de cubature - IHM de bilan. Modified Paths: -------------- 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/tr_en.fr_txt 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/TrPostLayoutFille.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.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/TrPostActionCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java Added: 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 (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java 2008-09-30 19:07:57 UTC (rev 4013) @@ -0,0 +1,215 @@ +package org.fudaa.dodico.ef; + +import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; + +/** + * Classe qui gere les bilans ainsi que les cubatures. + * + * @author Adrien Hadoux + * + */ +public class EfDataIntegrale { + + /** + * Valeur pour la zone plus + */ + double zonePlus_ = 0; + + /** + * Valeur int\xE9grale pour la zone moins + */ + double zoneMoins_ = 0; + + + + + public double getZonePlus() { + return zonePlus_; + } + + public double getZoneMoins() { + return zoneMoins_; + } + + /** + * Integration des donnees par la methode des trapezes entre la courbe + * representee par les x et y et la droite d\xE9finie par la fonction affine de + * coeff a et d'ordonn\xE9\xE9e a l origine b y=a*x+b + * + * @param lx + * @param ly + * @return + */ + public static EfDataIntegrale integrerMethodeTrapeze(double[] lx, double[] ly, double a, double b) { + + EfDataIntegrale data = new EfDataIntegrale(); + + for (int i = 0; i < Math.min(lx.length, ly.length)-1; i++) { + double x = lx[i]; + double x2=lx[i+1]; + double y = ly[i]; + double y2 = ly[i+1]; + + double ySeuil1=a*x+b; + double ySeuil2=a*x2+b; + if (y > ySeuil1 && y2 > ySeuil2) { + // courbe au dessus de la ligne + data.zonePlus_ += calculAireTrapeze(x, y, x2, y2, ySeuil1, ySeuil2); + + } else if (y < ySeuil1 && y2 < ySeuil2) { + // courbe en dessous de la ligne + data.zoneMoins_ += calculAireTrapeze(x, y, x2, y2, ySeuil1, ySeuil2); + + } else { + // cas particulier : intersection, on calcule l'intersection entre les + // points + // cas particulier : intersection, on calcule l'intersection entre les + // points + double yIntersect = 0; + double xIntersect = 0; + // on prend la droite form\xE9e par les 2 points et on calcule son + // intersection avec la droite affine + if (x2 - x != 0) { + // droite non parrallele a l axe des abscisses + double coefDirecteur = (y2 - y) / (x2 - x); + double ordoOrigine = y2 - coefDirecteur * x2; + + // intersection de droites avec le seuil + + + if(coefDirecteur - a!=0){ + //droie non paralleles + xIntersect = (ordoOrigine-b) / (coefDirecteur-a); + yIntersect=coefDirecteur*xIntersect+ordoOrigine; + } + else + { + // droite parrallele confondue au seuil, on ne fais rien... + } + + } else { + // x2=x droite d equation x=Cste + + xIntersect = x; + yIntersect = a*x+b; + } + + //maintenant que l on a le point d'intersection, on test si on ajoute en positif ou negatif + if (y >= ySeuil1 && y2 <= ySeuil2) { + data.zonePlus_ += calculAireTrapeze(x, y, xIntersect, yIntersect, ySeuil1, ySeuil2); + data.zoneMoins_ += calculAireTrapeze(xIntersect, yIntersect, x2, y2, ySeuil1, ySeuil2); + + } else { + data.zoneMoins_ += calculAireTrapeze(x, y, xIntersect, yIntersect, ySeuil1, ySeuil2); + data.zonePlus_ += calculAireTrapeze(xIntersect, yIntersect, x2, y2, ySeuil1, ySeuil2); + } + + } + + + } + + + return data; + } + + + + /** + * Calcule l'aire du trapeze en utilisant un objet + * EfLineIntersectionsResultsI. EfLineIntersectionsResultsI fonctionne de la + * maniere suivante: getNbIntersect():donne le nombre de points + * getDistFromDeb(i) donne le Xi: distance entre le debut et le point + * getIntersect(i) getValueBadInterpolation(EfData _d) donne le y associ\xE9 au x + */ + public static EfDataIntegrale integrerMethodeTrapeze(EfLineIntersectionsResultsI interfaceResults, EfData crbdata, + double seuil) { + + EfDataIntegrale data = new EfDataIntegrale(); + + for (int i = 0; i < interfaceResults.getNbIntersect() - 1; i++) { + double x = interfaceResults.getDistFromDeb(i); + double x2 = interfaceResults.getDistFromDeb(i + 1); + double y = interfaceResults.getIntersect(i).getValueBadInterpolation(crbdata); + double y2 = interfaceResults.getIntersect(i + 1).getValueBadInterpolation(crbdata); + + + if (y >= seuil && y2 >= seuil) { + // courbe au dessus de la ligne + data.zonePlus_ += calculAireTrapeze(x, y, x2, y2, seuil, seuil); + } else if (y <= seuil && y2 <= seuil) { + // courbe en dessous de la ligne + data.zoneMoins_ += calculAireTrapeze(x, y, x2, y2, seuil, seuil); + } else { + // cas particulier : intersection, on calcule l'intersection entre les + // points + double yIntersect = 0; + double xIntersect = 0; + // on prend la droite form\xE9e par les 2 points et on calcule son + // intersection avec la droite affine + if (x2 - x != 0) { + // droite non parrallele a l axe des abscisses + double coefDirecteur = (y2 - y) / (x2 - x); + double ordoOrigine = y2 - coefDirecteur * x2; + + // intersection de droites avec le seuil + yIntersect = seuil; + + + if(coefDirecteur!=0) + //droie non parallele au seuil + xIntersect = (yIntersect - ordoOrigine) / coefDirecteur; + else + { + // droite parrallele confondue au seuil, on ne fais rien... + } + + } else { + // x2=x droite perpendiculaire au seuil, le point d'intersection est + // donc (x,seuil) + xIntersect = x; + yIntersect = seuil; + } + + //maintenant que l on a le point d'intersection, on test si on ajoute en positif ou negatif + if (y >= seuil && y2 <= seuil) { + data.zonePlus_ += calculAireTrapeze(x, y, xIntersect, yIntersect, seuil, seuil); + data.zoneMoins_ += calculAireTrapeze(xIntersect, yIntersect, x2, y2, seuil, seuil); + + } else { + data.zoneMoins_ += calculAireTrapeze(x, y, xIntersect, yIntersect, seuil, seuil); + data.zonePlus_ += calculAireTrapeze(xIntersect, yIntersect, x2, y2, seuil, seuil); + } + + } + + } + + return data; + } + + + /** + * calcul de l'aire du trapeze form\xE9 par les 4 points (x,y) (x2,y2) (x,y3) + * (x2,y4) + */ + public static double calculAireTrapeze(double x, double y, double x2, double y2, double y3, double y4) { + double aire = 0; + // 1: calcul de la hauteur + double h = Math.abs(x2 - x); + // 2 base 1: coordonnees cartesiennes entre le point x,y et x,y3 + double base1 = Math.abs(y3 - y); + // 3 base 2: coordonnees cartesiennes entre le point x2,y2 et x2,y4 + double base2 = Math.abs(y4 - y2); + // 4 calcul de l'aire + aire = h * (base1 + base2) / 2; + return aire; +} + + + public double getResultat() { + return zonePlus_ - zoneMoins_; + } + + +} 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-09-30 18:10:23 UTC (rev 4012) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-09-30 19:07:57 UTC (rev 4013) @@ -64,6 +64,8 @@ EfLineIntersectionsResultsBuilder builderNode_; EfLineIntersectionsResultsBuilder builderMesh_; EfLineIntersectionsResultsMng resMesh_; + + final EfLineIntersectionsCorrectionTester tester_; public final MvProfileTarget target_; @@ -98,8 +100,10 @@ } + public EfLineIntersectionsResultsMng getResMesh() { + return resMesh_; + } - public H2dVariableType[] getVariables() { List values = getShownVar(); Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionBilan.java (from rev 4009, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionBilan.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionBilan.java 2008-09-30 19:07:57 UTC (rev 4013) @@ -0,0 +1,61 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.event.ActionEvent; + +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.fudaa.meshviewer.MvResource; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; + +import com.vividsolutions.jts.geom.LineString; + +/** + * Action pour le calcul des bilans. Cette action peut etre executee depuis le + * mode edition du calque pu le mode edition d'un profil spoatial. + * + * @author Adrien Hadoux + * + */ +public class TrPostActionBilan extends EbliActionSimple { + + // final MvProfileTarget src_; + final TrPostVisuPanel panel_; + final MvProfileTreeModel modelGraphe_; + final boolean startWithCalque; + TrPostCommonImplementation impl_; + + public TrPostActionBilan(final TrPostVisuPanel _visu, TrPostCommonImplementation impl) { + super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); + panel_ = _visu; + modelGraphe_ = null; + startWithCalque = true; + impl_ = impl; + } + + public TrPostActionBilan(final MvProfileTreeModel _model, TrPostCommonImplementation impl) { + super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); + modelGraphe_ = _model; + panel_ = null; + startWithCalque = false; + impl_ = impl; + } + + public void actionPerformed(final ActionEvent _e) { + // -- creation du wizard depusi le calque --// + if (startWithCalque) { + new TrPostDialogBilan(panel_, impl_); + } else { + new TrPostDialogBilan(modelGraphe_, impl_); + } + } + + + protected LineString getSelectedLine() { + // pas de calque s\xE9lectionn\xE9 + if (!(panel_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { + return null; + } + return ((ZCalqueAffichageDonneesInterface) panel_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); + } +} + Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionBilan.java ___________________________________________________________________ Added: svn:mergeinfo + Added: 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/TrPostActionCubature.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionCubature.java 2008-09-30 19:07:57 UTC (rev 4013) @@ -0,0 +1,59 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.event.ActionEvent; + +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.fudaa.meshviewer.MvResource; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; + +import com.vividsolutions.jts.geom.LineString; + +/** + * Action de gestion des cubatures + * + * @author Adrien Hadoux + * + */ +public class TrPostActionCubature extends EbliActionSimple { + + // final MvProfileTarget src_; + final TrPostVisuPanel panel_; + final MvProfileTreeModel modelGraphe_; + final boolean startWithCalque; + TrPostCommonImplementation impl_; + + public TrPostActionCubature(final TrPostVisuPanel _visu, TrPostCommonImplementation impl) { + super(MvResource.getS("Calcul des cubatures"), MvResource.MV.getIcon("profile"), "CUBATURE"); + panel_ = _visu; + modelGraphe_ = null; + startWithCalque = true; + impl_ = impl; + } + + public TrPostActionCubature(final MvProfileTreeModel _model, TrPostCommonImplementation impl) { + super(MvResource.getS("Calcul des cubatures"), MvResource.MV.getIcon("profile"), "CUBATURE"); + modelGraphe_ = _model; + panel_ = null; + startWithCalque = false; + impl_ = impl; + } + + public void actionPerformed(final ActionEvent _e) { + // -- creation du wizard depusi le calque --// + if (startWithCalque) { + new TrPostDialogCubature(panel_, impl_); + } else { + new TrPostDialogCubature(modelGraphe_, impl_); + } + } + + + protected LineString getSelectedLine() { + // pas de calque s\xE9lectionn\xE9 + if (!(panel_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { + return null; + } + return ((ZCalqueAffichageDonneesInterface) panel_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); + } +} Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java 2008-09-30 18:10:23 UTC (rev 4012) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java 2008-09-30 19:07:57 UTC (rev 4013) @@ -1,61 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import java.awt.event.ActionEvent; - -import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; -import org.fudaa.ebli.commun.EbliActionSimple; -import org.fudaa.fudaa.meshviewer.MvResource; -import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; - -import com.vividsolutions.jts.geom.LineString; - -/** - * Action pour le calcul des bilans. Cette action peut etre executee depuis le - * mode edition du calque pu le mode edition d'un profil spoatial. - * - * @author Adrien Hadoux - * - */ -public class TrPostBilanAction extends EbliActionSimple { - - // final MvProfileTarget src_; - final TrPostVisuPanel panel_; - final MvProfileTreeModel modelGraphe_; - final boolean startWithCalque; - TrPostCommonImplementation impl_; - - public TrPostBilanAction(final TrPostVisuPanel _visu, TrPostCommonImplementation impl) { - super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); - panel_ = _visu; - modelGraphe_ = null; - startWithCalque = true; - impl_ = impl; - } - - public TrPostBilanAction(final MvProfileTreeModel _model, TrPostCommonImplementation impl) { - super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); - modelGraphe_ = _model; - panel_ = null; - startWithCalque = false; - impl_ = impl; - } - - public void actionPerformed(final ActionEvent _e) { - // -- creation du wizard depusi le calque --// - if (startWithCalque) { - new TrPostDialogBilan(panel_, impl_); - } else { - new TrPostDialogBilan(modelGraphe_, impl_); - } - } - - - protected LineString getSelectedLine() { - // pas de calque s\xE9lectionn\xE9 - if (!(panel_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { - return null; - } - return ((ZCalqueAffichageDonneesInterface) panel_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); - } -} - Modified: 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/TrPostDialogBilan.java 2008-09-30 18:10:23 UTC (rev 4012) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java 2008-09-30 19:07:57 UTC (rev 4013) @@ -5,6 +5,7 @@ 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; @@ -18,12 +19,27 @@ import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.JTable; import javax.swing.ListModel; import javax.swing.ListSelectionModel; +import javax.swing.table.DefaultTableModel; +import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gis.GISGeometryFactory; import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; +import org.fudaa.dodico.ef.EfData; +import org.fudaa.dodico.ef.EfDataIntegrale; +import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; +import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsMng; +import org.fudaa.dodico.ef.operation.EfLineIntersectorActivity; +import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import org.fudaa.fudaa.tr.common.TrResource; @@ -31,6 +47,7 @@ import com.memoire.bu.BuStringValidator; import com.memoire.bu.BuTextField; import com.memoire.bu.BuValueValidator; +import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.LineString; /** @@ -50,14 +67,21 @@ TrPostVisuPanel calque_; MvProfileTreeModel modelGraphe_; TrPostCommonImplementation impl_; + EfDataIntegrale resCalcul_ = new EfDataIntegrale(); // donnees graphiques JDialog dialog_; - // variables + // seuil + private JPanel panelSeuil_; + BuTextField seuil_ = new BuTextField(5); + + // variables et pdt private JPanel panelVariables_; ListModel modelVariables_; JList listVar_; + ListModel modelPdt_; + JList listPdt_; // isolignes private JPanel panelIsolignes_; @@ -71,7 +95,9 @@ // results JPanel panelResults_; JLabel results_; - JButton ajouter = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); + JButton ajouter_ = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); + DefaultTableModel modelResult_; + /** * Constructeur reserv\xE9 au calques * @@ -87,6 +113,7 @@ modelGraphe_ = null; source_ = calque_.getSource(); modelVariables_ = source_.getNewVarListModel(); + modelPdt_ = source_.getNewTimeListModel(); startWithCalque_ = true; // -- construction de la dialog --// @@ -109,7 +136,7 @@ source_ = (TrPostSource) _modelGraphe.target_.getData(); startWithCalque_ = false; modelVariables_ = source_.getNewVarListModel(); - + modelPdt_ = source_.getNewTimeListModel(); // -- construction de la dialog --// buildDialog(); } @@ -170,9 +197,9 @@ textY2.setEnabled(enabled); boxSelectLineManu_.setSelected(false); if (boxSelectLineAuto_.isSelected()) - ajouter.setEnabled(true); + ajouter_.setEnabled(true); else - ajouter.setEnabled(false); + ajouter_.setEnabled(false); } }); @@ -185,9 +212,9 @@ textY2.setEnabled(enabled); boxSelectLineAuto_.setSelected(false); if (boxSelectLineManu_.isSelected()) - ajouter.setEnabled(true); + ajouter_.setEnabled(true); else - ajouter.setEnabled(false); + ajouter_.setEnabled(false); } }); @@ -213,19 +240,112 @@ return content; } + /** + * Methode qui genere une lineString en entrant 2 points. + * + * @return + */ + LineString createLineString() { + double x1 = Double.parseDouble(textX1.getText()); + double y1 = Double.parseDouble(textY1.getText()); + double x2 = Double.parseDouble(textX2.getText()); + double y2 = Double.parseDouble(textY2.getText()); + + + final Coordinate[] cs = new Coordinate[2]; + cs[0] = new Coordinate(x1, y1); + cs[1] = new Coordinate(x2, y2); + + return GISGeometryFactory.INSTANCE.createLineString(cs); + + } + private JPanel buildresults() { - JPanel content = new JPanel(new FlowLayout(FlowLayout.LEFT)); + 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(ajouter_); + // content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); content.add(results_); - content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("R\xE9sultats"))); - return content; + 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() { + public int getColumnCount() { + return 3; + } + public String getColumnName(int _column) { + if (_column == 0) + return "Zone positive"; + else if (_column == 1) + return "Zone n\xE9gative"; + else + return "R\xE9sultat"; + } + public int getRowCount() { + return 1; + } + public boolean isCellEditable(int _row, int _column) { + return false; + } + public Object getValueAt(int _row, int _column) { + if (_column == 0) + return resCalcul_.getZoneMoins(); + else if (_column == 0) + return resCalcul_.getZonePlus(); + else + return resCalcul_.getResultat(); + } + }; + + 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 (boxSelectLineManu_.isSelected()) { + if (textX1.getText().equals("")) + return false; + if (textX2.getText().equals("")) + return false; + if (textY1.getText().equals("")) + return false; + if (textY2.getText().equals("")) + return false; + + } + + if(seuil_.getText().equals("")) + return false; + if(listVar_.getSelectedIndex()==-1) + return false; + + return true; + } + + /** + * Retourne la ligne selectionnee dans le calque. + * + * @return + */ protected LineString getSelectedLineOfCalque() { // pas de calque s\xE9lectionn\xE9 if (!(calque_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { @@ -234,17 +354,60 @@ return ((ZCalqueAffichageDonneesInterface) calque_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); } + /** + * 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(); + } + + + protected double getSeuil() { + return Double.parseDouble(seuil_.getText()); + } + + private JPanel buildVariables() { - JPanel content = new JPanel(new BorderLayout()); + JPanel conteneur = new JPanel(new BorderLayout()); + JPanel content = new JPanel(new GridLayout(1, 2)); listVar_ = new JList(modelVariables_); + listPdt_ = new JList(modelPdt_); listVar_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - content.add(new JScrollPane(listVar_), BorderLayout.CENTER); - content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de la variable"))); - content.add(new JLabel(TrResource.getS("Veuillez s\xE9lectionner la variable sur laquelle appliquer le calcul")), + 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 buildSeuil(){ + seuil_.setCharValidator(BuCharValidator.FLOAT); + seuil_.setStringValidator(BuStringValidator.FLOAT); + seuil_.setValueValidator(BuValueValidator.FLOAT); + + JPanel conteneur = new JPanel(new FlowLayout(FlowLayout.CENTER)); + conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix du seuil"))); + conteneur.add( seuil_); + + return conteneur; + } /** * Creation du panel graphique. @@ -265,6 +428,12 @@ panelVariables_ = buildVariables(); content.add(panelVariables_); + + // -- panelSeuil + if (panelSeuil_ == null) + panelSeuil_ = buildSeuil(); + content.add(panelSeuil_); + // -- panel des resultats --// if (panelResults_ == null) panelResults_ = buildresults(); @@ -315,5 +484,53 @@ return TrResource.getS("Bilans"); } + + /** + * Methode qui realise les calculs d'int\xE9grale par rapport aux donn\xE9es + */ + private void computeResults() { + new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan") + CtuluLibString.ESPACE + + EvolutionFileFormat.getInstance().getName()) { + public void act() { + final ProgressionInterface prog = getMainStateReceiver(); + // -- calcul de la EfLineIntersectionsResultsMng --// + impl_.setMainMessage(FudaaLib.getS("Calcul des intersections")); + impl_.setMainProgression(10); + EfLineIntersectionsResultsMng lineRes = null; + if (startWithCalque_) { + EfLineIntersectorActivity lineIntersect = new EfLineIntersectorActivity(calque_.getSource()); + if (boxSelectLineAuto_.isSelected()) + lineRes = lineIntersect.computeForMeshes(getSelectedLineOfCalque(), prog); + else + lineRes = lineIntersect.computeForMeshes(createLineString(), prog); + } else { + lineRes = modelGraphe_.getResMesh(); + } + EfLineIntersectionsResultsI interfaceRes = lineRes.getDefaultRes(); + + // -- calcul des efdata --// + impl_.setMainProgression(30); + impl_.setMainMessage(CtuluLib.getS("Calcul des donn\xE9es pour les pas de temps et variables r\xE9cup\xE9r\xE9s")); + EfData data = source_.getData(getSelectedVariable(), getSelectedTimeStep()); + + + + // -- calcul de l'int\xE9grale --// + impl_.setMainProgression(70); + impl_.setMainMessage(CtuluLib.getS("Calcul de l'int\xE9grale")); + + resCalcul_ = EfDataIntegrale.integrerMethodeTrapeze(interfaceRes, data, getSeuil()); + + // -- mise a jour du tableau de res --// + modelGraphe_.fireStructureChanged(); + + + impl_.unsetMainMessage(); + impl_.unsetMainProgression(); + } + }.start(); + } + + } Added: 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/TrPostDialogCubature.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java 2008-09-30 19:07:57 UTC (rev 4013) @@ -0,0 +1,288 @@ +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.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.AbstractAction; +import javax.swing.BorderFactory; +import javax.swing.Box; +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.JTree; +import javax.swing.ListModel; +import javax.swing.ListSelectionModel; + +import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; +import org.fudaa.dodico.ef.EfDataIntegrale; +import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.dodico.mesure.EvolutionFileFormat; +import org.fudaa.ebli.calque.find.CalqueFindCourbeTreeModel; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.fudaa.commun.FudaaLib; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; +import org.fudaa.fudaa.tr.common.TrResource; + +public class TrPostDialogCubature { + + /** + * booleen qui indique si le wizard a \xE9t\xE9t lanc\xE9 depuis un calque + */ + + private boolean startWithCalque_ = true; + TrPostSource source_; + TrPostVisuPanel calque_; + MvProfileTreeModel modelGraphe_; + TrPostCommonImplementation impl_; + EfDataIntegrale resCalcul_ = new EfDataIntegrale(); + + // donnees graphiques + JDialog dialog_; + + // variables et pdt + private JPanel panelVariables_; + ListModel modelVariables_; + JList listVar_; + ListModel modelPdt_; + JList listPdt_; + + // isolignes + private JPanel panelIsolignes_; + JTree treeLignes_; + CalqueFindCourbeTreeModel lineTreeModel_; + + // results + JPanel panelResults_; + JLabel results_; + JButton ajouter_ = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); + + /** + * Constructeur reserv\xE9 au calques + * + * @param _builderParams + * @param _calque + * @param _modelGraphe + * @param _panelVariables + * @param _source + */ + public TrPostDialogCubature(TrPostVisuPanel _calque, TrPostCommonImplementation impl) { + impl_ = impl; + calque_ = _calque; + modelGraphe_ = null; + source_ = calque_.getSource(); + modelVariables_ = source_.getNewVarListModel(); + modelPdt_ = source_.getNewTimeListModel(); + startWithCalque_ = true; + lineTreeModel_ = new CalqueFindCourbeTreeModel(null, _calque.getDonneesCalque()); + // -- construction de la dialog --// + buildDialog(); + } + + /** + * constructeur reserv\xE9 aux graphes spatiaux + * + * @param _builderParams + * @param _calque + * @param _modelGraphe + * @param _panelVariables + * @param _source + */ + public TrPostDialogCubature(MvProfileTreeModel _modelGraphe, TrPostCommonImplementation impl) { + calque_ = null; + impl_ = impl; + modelGraphe_ = _modelGraphe; + source_ = (TrPostSource) _modelGraphe.target_.getData(); + startWithCalque_ = false; + modelVariables_ = source_.getNewVarListModel(); + modelPdt_ = source_.getNewTimeListModel(); + // -- construction de la dialog --// + buildDialog(); + } + + + protected JTree buildTree() { + return CalqueFindCourbeTreeModel.createCalqueTree(lineTreeModel_, true); + } + /** + * Construit le panel des variables + * + * @return + */ + private JPanel buildIsoLignes() { + JPanel content = new JPanel(new BorderLayout()); + treeLignes_ = buildTree(); + content.add(treeLignes_, BorderLayout.CENTER); + content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de la ligne bris\xE9e du calque"))); + return content; + } + + + private JPanel buildresults() { + JPanel content = new JPanel(new FlowLayout(FlowLayout.LEFT)); + + results_ = new JLabel(""); + content.add(ajouter_); + content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); + content.add(results_); + + content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("R\xE9sultats"))); + + // -- action relatives aux resultats --// + ajouter_.setAction(new AbstractAction() { + + public void actionPerformed(ActionEvent _e) { + if (controleDataOk()) { + computeResults(); + } + } + + }); + + return content; + } + + public boolean controleDataOk() { + + if (listVar_.getSelectedIndex() == -1) + return false; + if (treeLignes_.getSelectionCount() == 0) + 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(); + } + + private JPanel buildVariables() { + JPanel conteneur = new JPanel(new BorderLayout()); + JPanel content = new JPanel(new GridLayout(1, 2)); + listVar_ = new JList(modelVariables_); + listPdt_ = new JList(modelPdt_); + 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; + } + + /** + * Creation du panel graphique. + * + * @return + */ + public Box buildContent() { + + Box content = Box.createVerticalBox(); + + // -- panel des isolignes --// + if (panelIsolignes_ == null) + panelIsolignes_ = buildIsoLignes(); + content.add(panelIsolignes_); + + // -- panel des variables --// + if (panelVariables_ == null) + panelVariables_ = buildVariables(); + content.add(panelVariables_); + + // -- 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("Bilans"); + + } + + /** + * Methode qui realise les calculs d'int\xE9grale par rapport aux donn\xE9es + */ + private void computeResults() { + + new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan") + CtuluLibString.ESPACE + + EvolutionFileFormat.getInstance().getName()) { + public void act() { + final ProgressionInterface prog = getMainStateReceiver(); + + + // a faire + + + impl_.unsetMainMessage(); + impl_.unsetMainProgression(); + } + }.start(); + } + + +} + 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-09-30 18:10:23 UTC (rev 4012) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-30 19:07:57 UTC (rev 4013) @@ -570,7 +570,9 @@ if (_graphe.getGraphe().getModel() instanceof MvProfileTreeModel) { listeActions - .add(new TrPostBilanAction(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_.getImpl())); + .add(new TrPostActionBilan(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_.getImpl())); + listeActions.add(new TrPostActionCubature(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_ + .getImpl())); } //--ajout des actions import export format scope --// @@ -601,8 +603,10 @@ // -- ajout des actions tr --// final ArrayList<EbliActionSimple> listeActions = new ArrayList<EbliActionSimple>(); - listeActions.add(new TrPostBilanAction((TrPostVisuPanel) creator.getCalque(), projet_.getImpl())); + listeActions.add(new TrPostActionBilan((TrPostVisuPanel) creator.getCalque(), projet_.getImpl())); _controller.addFonctionsSpecific(listeActions); + listeActions.add(new TrPostActionCubature((TrPostVisuPanel) creator.getCalque(), projet_.getImpl())); + _controller.addFonctionsSpecific(listeActions); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-30 18:10:48
|
Revision: 4012 http://fudaa.svn.sourceforge.net/fudaa/?rev=4012&view=rev Author: hadouxad Date: 2008-09-30 18:10:23 +0000 (Tue, 30 Sep 2008) Log Message: ----------- test Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionGraphes.java Modified: 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/TrPostActionFusionGraphes.java 2008-09-30 16:14:11 UTC (rev 4011) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionGraphes.java 2008-09-30 18:10:23 UTC (rev 4012) @@ -47,9 +47,7 @@ import com.memoire.bu.BuScrollPane; /** - * Classe Fusion Widgets des graphes entre eux pour qu'ils se transforment en - * super sayan Niveau 16... - * + * Classe Fusion Widgets des graphes entre eux * @author Adrien Hadoux * */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-09-30 16:14:33
|
Revision: 4011 http://fudaa.svn.sourceforge.net/fudaa/?rev=4011&view=rev Author: emmanuel_martin Date: 2008-09-30 16:14:11 +0000 (Tue, 30 Sep 2008) Log Message: ----------- Commit de test sur le comportement de la boite d'edition. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-09-30 14:22:41 UTC (rev 4010) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-09-30 16:14:11 UTC (rev 4011) @@ -14,27 +14,22 @@ import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map.Entry; import javax.swing.Action; import javax.swing.JComponent; import javax.swing.JMenu; import javax.swing.JPopupMenu; import javax.swing.KeyStroke; -import javax.swing.event.TreeModelEvent; -import javax.swing.event.TreeModelListener; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; -import com.memoire.bu.BuSeparator; -import com.memoire.fu.Fu; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluLibMessage; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluUI; - import org.fudaa.ebli.calque.action.CalqueActionInteraction; import org.fudaa.ebli.calque.action.CalqueActionTable; import org.fudaa.ebli.calque.action.CalqueSelectionAction; @@ -54,6 +49,10 @@ import org.fudaa.ebli.repere.ZTransformationDomaine; import org.fudaa.ebli.ressource.EbliResource; +import com.memoire.bu.BuSeparator; +import com.memoire.fu.Fu; +import com.memoire.fu.FuLog; + /** * Un controleur des actions du panneau d'affichage 2D des calques. Il gere en particulier * les actions de navigation, de selection. Il g\xE8re \xE9galement les actions exclusives. Une action @@ -68,6 +67,12 @@ class CalqueInteractionListener implements PropertyChangeListener { + private HashMap<String, List<PropertyChangeListener>> listeners_; + + public CalqueInteractionListener(){ + listeners_=new HashMap<String, List<PropertyChangeListener>>(); + } + public void propertyChange(final PropertyChangeEvent _evt) { final BCalqueInteraction c = (BCalqueInteraction) _evt.getSource(); if (c.isGele()) { @@ -75,7 +80,49 @@ } else { setCalqueInteractionActif(c); } + firePropertyChange(_evt.getSource(), _evt.getPropertyName(), _evt.getOldValue(), _evt.getNewValue()); } + + // Gestion des properties listeners + + public void addPropertyChangeListener(PropertyChangeListener listener) { + if (listener!=null) { + if (!listeners_.containsKey("all")) + listeners_.put("all", new ArrayList<PropertyChangeListener>()); + listeners_.get("all").add(listener); + } + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + if (listener!=null) + for (Entry<String, List<PropertyChangeListener>> element : listeners_.entrySet()){ + listeners_.get(element.getKey()).remove(listener); + if (listeners_.get(element.getKey()).size()==0) + listeners_.remove(element.getKey()); + } + } + + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + if (listener!=null) + if (!listeners_.containsKey(propertyName)) + listeners_.put(propertyName, new ArrayList<PropertyChangeListener>()); + listeners_.get(propertyName).add(listener); + + } + + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + if (listener!=null&&listeners_.containsKey(propertyName)) { + listeners_.get(propertyName).remove(listener); + if (listeners_.get(propertyName).size()==0) + listeners_.remove(propertyName); + } + } + + protected void firePropertyChange(Object _source, String _propertyName, Object _oldValue, Object _newValue) { + PropertyChangeEvent event=new PropertyChangeEvent(_source, _propertyName, _oldValue, _newValue); + for (int i=0; i<listeners_.get(_propertyName).size(); i++) + listeners_.get(_propertyName).get(i).propertyChange(event); + } } /** @@ -423,6 +470,10 @@ _b.addPropertyChangeListener("gele", interactionListener_); } + public BCalqueInteraction getCalqueInteraction(String name){ + return (BCalqueInteraction) cqAdmin_.getCalqueParNom(name); + } + public ZCalqueSondeInteraction addCalqueSondeInteraction() { ZCalqueSondeInteraction r = getCalqueSondeInteraction(); if (r == null) { @@ -713,4 +764,25 @@ public ZEbliCalquesPanel getPn() { return pn_; } + + // Gestion des properties listeners + public void addPropertyChangeListener(PropertyChangeListener listener) { + interactionListener_.addPropertyChangeListener(listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + interactionListener_.removePropertyChangeListener(listener); + } + + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + interactionListener_.addPropertyChangeListener(propertyName, listener); + } + + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + interactionListener_.removePropertyChangeListener(propertyName, listener); + } + + protected void firePropertyChange(Object _source, String _propertyName, Object _oldValue, Object _newValue) { + interactionListener_.firePropertyChange(_source,_propertyName, _oldValue, _newValue); + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2008-09-30 14:22:41 UTC (rev 4010) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2008-09-30 16:14:11 UTC (rev 4011) @@ -7,12 +7,18 @@ */ package org.fudaa.ebli.calque.action; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +import javax.swing.event.TreeSelectionEvent; import javax.swing.tree.TreeSelectionModel; +import org.fudaa.ebli.calque.BCalqueInteraction; import org.fudaa.ebli.calque.ZScene; import org.fudaa.ebli.calque.edition.BPaletteEdition; import org.fudaa.ebli.calque.edition.ZCalqueEditable; -import org.fudaa.ebli.calque.edition.ZEditorInterface; +import org.fudaa.ebli.calque.edition.ZCalqueEditionInteraction; +import org.fudaa.ebli.calque.edition.ZEditorDefault; import org.fudaa.ebli.commun.BPalettePanelInterface; import org.fudaa.ebli.commun.EbliActionPaletteTreeModel; import org.fudaa.ebli.ressource.EbliResource; @@ -20,50 +26,60 @@ /** * Une action pour afficher une palette d'outils GIS, reagissant au changement de calque selectionn\xE9. * @author Fred Deniger - * @version $Id: CalqueGISEditionAction.java,v 1.6.6.2 2008-05-13 12:10:47 bmarchan Exp $ + * @version $Id: CalqueGISEditionAction.java,v 1.6.6.2 2008-05-13 12:10:47 emartin Exp $ */ -public class CalqueGISEditionAction extends EbliActionPaletteTreeModel { +public class CalqueGISEditionAction extends EbliActionPaletteTreeModel implements PropertyChangeListener { - ZEditorInterface editor_; - ZScene scene_; + private ZEditorDefault editor_; + private ZScene scene_; + private boolean hide_; // Vrai si le panel d'\xE9dition est ferm\xE9. + // Calques utilis\xE9 dans cette action + private BCalqueInteraction calqueZoom_; // Calque ne fermant pas l'edition + private BCalqueInteraction calqueDeplacementVue_; // Calque ne fermant pas l'edition + private ZCalqueEditionInteraction calqueEdition_; // Le calque d'\xE9dition -// public final ZEditorInterface getEditor() { -// return editor_; -// } - /** * @param _editor l'editeur */ public final void setScene(final ZScene _scene) { scene_ = _scene; -// if (editor_ != null) { -// editor_.setDesktop(desktop_); -// } } /** * @param _m l'arbre des calques */ - public CalqueGISEditionAction(final TreeSelectionModel _m, final ZEditorInterface _editor, ZScene _scene) { + public CalqueGISEditionAction(final TreeSelectionModel _m, final ZEditorDefault _editor, ZScene _scene) { super(EbliResource.EBLI.getString("Edition dessin"), EbliResource.EBLI.getToolIcon("draw-palette"), "PALETTE_EDTION", _m); + hide_ = true; editor_=_editor; + calqueZoom_ = editor_.getPanel().getController().getCalqueInteraction("cqAGRANDIR"); + calqueDeplacementVue_ = editor_.getPanel().getController().getCalqueInteraction("cqDEPLACEMENT_VUE-I"); + editor_.getPanel().getController().addPropertyChangeListener("gele", this); setScene(_scene); setEnabled(isTargetValid(null)); setResizable(true); -// setEnabled(editor_ != null && editor_.isEditable(target_)); + target_ = (target_ instanceof ZCalqueEditable)?target_:null; } protected boolean isTargetValid(final Object _o) { return (scene_!=null && (!scene_.isRestrictedToCalqueActif() || scene_.isCalqueActifEditable())); -// return editor_ != null && editor_.isEditable(_o); } /** + * D\xE9active le panel. + */ + private void unactivePanel() { + if(calqueEdition_!=null) + calqueEdition_.cancelEdition(); + if(palette_!=null) + ((BPaletteEdition)palette_).resetPalette(); + } + + /** * Le calque target, c'est \xE0 dire le calque actif. */ protected void setTarget(final Object _o) { final Object newTarget=(_o instanceof ZCalqueEditable)?_o:null; -// final Object newTarget = isTargetValid(_o) ? _o : null; if (target_ != newTarget) { target_ = newTarget; if (isSelected()) { @@ -78,6 +94,25 @@ } } + /* (non-Javadoc) + * @see org.fudaa.ebli.commun.EbliActionPaletteAbstract#changeAction() + */ + @Override + public void changeAction() { + super.changeAction(); + hide_ = !hide_; + if(hide_){ + unactivePanel(); + // Gele du calque d'edition + if(calqueEdition_!=null) + editor_.getPanel().unsetCalqueInteractionActif(calqueEdition_); + } + else + // R\xE9cup\xE9ration du calque d'edition + if(calqueEdition_==null) + calqueEdition_ = editor_.buildCalqueDessin(""); + } + public void updateBeforeShow() { if (palette_ != null) { if (editor_ == null) { @@ -93,4 +128,24 @@ protected BPalettePanelInterface buildPaletteContent() { return new BPaletteEdition(); } + + /** + * Appel\xE9e quand il y a un changement de selection dans l'arbre des calques. + */ + public void valueChanged(final TreeSelectionEvent _e) { + unactivePanel(); + setTarget(getTarget((TreeSelectionModel) _e.getSource())); + } + + /* (non-Javadoc) + * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent) + */ + public void propertyChange(PropertyChangeEvent _evt) { + // Cas un autre calque que celui du zoom, du deplacement de vue et d'edition + // est d\xE9gel\xE9 donc on ferme le pannel d'edition si il \xE9tait ouvert. + if (_evt.getSource()!=calqueZoom_&&_evt.getSource()!=calqueDeplacementVue_&&_evt.getSource()!=calqueEdition_ + &&!((Boolean)_evt.getNewValue()).booleanValue()&&palette_!=null&&((BPaletteEdition)palette_).isEditionOnGoing()) { + unactivePanel(); + } + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java 2008-09-30 14:22:41 UTC (rev 4010) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java 2008-09-30 16:14:11 UTC (rev 4011) @@ -311,14 +311,54 @@ final static String ATOM_ACTION = "MODE_ATOME"; /** + * Envoie les commandes au receveur suite \xE0 un click sur un bouton. + */ + public void actionPerformed(final ActionEvent _e) { + sendCommand(_e.getActionCommand()); + } + + /** + * Reset la palette : ferme le panel de construction de forme en cours. + */ + public void resetPalette(){ + for(int i=0;i<globalButtons_.size();i++){ + if(globalButtons_.get(i)!=null){ + AbstractButton button = (AbstractButton)globalButtons_.get(i); + if(button.isSelected()){ + button.setSelected(false); + sendCommand(button.getActionCommand()); + } + } + } + } + + /** + * Retourne vrai si un des boutons de cr\xE9ation de forme est actif. + */ + public boolean isEditionOnGoing(){ + boolean actif = false; + int i=0; + while(!actif&&i<globalButtons_.size()){ + if(globalButtons_.get(i)!=null){ + AbstractButton button = (AbstractButton)globalButtons_.get(i); + if(button.isSelected()&&button.getActionCommand().matches("GLOBAL_ADD_[a-zA-Z0-9]*")){ + actif = true; + } + } + i++; + } + return actif; + } + + /** * Envoie les commandes au receveur. */ - public void actionPerformed(final ActionEvent _e) { + private void sendCommand(String _command){ if (target_ != null) { - target_.doAction(_e.getActionCommand(), this); + target_.doAction(_command, this); } } - + /** * Verifie que les boutons coch\xE9s soient activ\xE9s. */ 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-09-30 14:22:41 UTC (rev 4010) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2008-09-30 16:14:11 UTC (rev 4011) @@ -96,7 +96,7 @@ ZCalqueEditionInteraction dessin_; protected ZEditorPanelInterface editorPanel_; - + CtuluCommandManager mng_; protected ZSceneEditor sceneEditor_=null; @@ -226,6 +226,10 @@ } } + public ZCalqueEditionInteraction getCalqueDessin(){ + return dessin_; + } + private boolean isStateGlobalMove() { return "GLOBAL_MOVE".equals(state_); } @@ -385,20 +389,18 @@ * @param _com la commande * @return le calque de dessin */ - protected final ZCalqueEditionInteraction buildCalqueDessin(final String _com) { + public final ZCalqueEditionInteraction buildCalqueDessin(final String _com) { int forme=getForme(); - if (forme >= 0) { - if (dessin_ == null) { - dessin_ = new ZCalqueEditionInteraction(this); - panel_.getVueCalque().addKeyListener(dessin_); - dessin_.setName("cqInteractifDessin"); - panel_.addCalqueInteraction(dessin_); - dessin_.addPropertyChangeListener("gele", this); - } - dessin_.setTypeForme(forme); - return dessin_; + if (dessin_==null) { + dessin_=new ZCalqueEditionInteraction(this); + panel_.getVueCalque().addKeyListener(dessin_); + dessin_.setName("cqInteractifDessin"); + panel_.addCalqueInteraction(dessin_); + dessin_.setGele(true); + dessin_.addPropertyChangeListener("gele", this); } - return null; + dessin_.setTypeForme(forme); + return dessin_; } /** @@ -470,7 +472,7 @@ } public boolean cancelEdition() { - if (dessin_ != null && !dessin_.isGele() && dessin_.isEnCours()) { + if (dessin_ != null && dessin_.isEnCours()) { dessin_.cancelEdition(); return true; } @@ -494,7 +496,6 @@ changeState(_com); } } - } public ZScene getSupport() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fa...@us...> - 2008-09-30 14:22:56
|
Revision: 4010 http://fudaa.svn.sourceforge.net/fudaa/?rev=4010&view=rev Author: fargeix Date: 2008-09-30 14:22:41 +0000 (Tue, 30 Sep 2008) Log Message: ----------- Modifications importantes sur les graphes et histogrammes, dont les ?\195?\169chelles ?\195?\169taient fausses Modified Paths: -------------- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3DessinerPortFrame.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonAttenteElement.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonAttentetrajet.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonDureeParcours.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonGenerationBateaux.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatGenerationBateaux.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/Sinavi3ResultatsDureesParcours.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3TraduitHoraires.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-09-29 21:38:52 UTC (rev 4009) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3DessinerPortFrame.java 2008-09-30 14:22:41 UTC (rev 4010) @@ -36,6 +36,8 @@ import org.fudaa.fudaa.ressource.FudaaResource; import org.jdesktop.swingx.ScrollPaneSelector; +import sun.text.Normalizer.QuickCheckResult; + import com.memoire.bu.BuButton; import com.memoire.bu.BuDialogMessage; import com.memoire.bu.BuToolBar; @@ -59,8 +61,10 @@ JLabel labelMessage1_=new JLabel(); JLabel labelMessage2_=new JLabel(); JLabel labelMessage3_=new JLabel(); + //BuPanel panelBoutons_=new BuPanel(); JMenuItem menuaffichageNoms_; + private final BuButton quitter_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "Quitter"); final BuButton rafraichir_ = new BuButton(FudaaResource.FUDAA.getIcon("rafraichir_18"), "rafraichir"); final BuButton validation_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "exporter Ps"); final BuButton validation2_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "exporter"); @@ -109,25 +113,28 @@ donnees_ = _donnees; this.getContentPane().setLayout(new BorderLayout()); - this.setTitle("Sch\xE9ma du r\xE9seau"); - this.setSize(800, 640); + this.setTitle("Mod\xE9lisation du r\xE9seau"); + this.setSize(820, 640); this.setBorder(Sinavi3Bordures.compound_); // insertion des composants dans la frame - final JPanel controlPanel = new JPanel(new GridLayout(2,1)); - controlPanel.setBorder(Sinavi3Bordures.compound_); + final JPanel controlPanel = new JPanel(new GridLayout(1,2)); + //controlPanel.setBorder(Sinavi3Bordures.compound_); // controlPanel.add(new JLabel("Nombre de gares \xE0 ins\xE9rer: ")); labelCompteur_ = new JLabel(""); - labelCompteur_.setBorder(Sinavi3Bordures.bordnormal_); + //labelCompteur_.setBorder(Sinavi3Bordures.bordnormal_); JPanel panelLabel=new JPanel(new FlowLayout(FlowLayout.LEFT)); panelLabel.add(labelCompteur_); panelLabel.add(labelMessage1_); - labelMessage1_.setBorder(Sinavi3Bordures.bordnormal_); - labelMessage2_.setBorder(Sinavi3Bordures.bordnormal_); - labelMessage3_.setBorder(Sinavi3Bordures.bordnormal_); + //labelMessage1_.setBorder(Sinavi3Bordures.bordnormal_); + //labelMessage2_.setBorder(Sinavi3Bordures.bordnormal_); + //labelMessage3_.setBorder(Sinavi3Bordures.bordnormal_); + JPanel panelBoutons=new JPanel(new FlowLayout(FlowLayout.LEFT)); + panelBoutons.add(quitter_); + controlPanel.add(panelBoutons); controlPanel.add(panelLabel); - JPanel panelLabel2=new JPanel(new FlowLayout(FlowLayout.LEFT)); - panelLabel2.add(labelMessage2_); - controlPanel.add(panelLabel2); + //JPanel panelLabel2=new JPanel(new FlowLayout(FlowLayout.LEFT)); + panelLabel.add(labelMessage2_); + //controlPanel.add(panelLabel2); //controlPanel.add(this.rafraichir_); //controlPanel.add(validation_); //controlPanel.add(validation2_); @@ -190,6 +197,15 @@ initialisation_.setToolTipText("R\xE9initialiser la mod\xE9lisation du r\xE9seau"); initialisation_.addActionListener(listenerInit_); + + /** listener des boutons quitter */ + this.quitter_.setToolTipText("Ferme la sous-fen\xEAtre"); + final ActionListener actionQuitter = new ActionListener() { + public void actionPerformed(ActionEvent e) { + Sinavi3DessinerPortFrame.this.windowClosed(); + } + }; + this.quitter_.addActionListener(actionQuitter); validation_.setToolTipText("Permet de generer un fichier PostScript a partir de la modelisation du port"); validation_.addActionListener(new ActionListener() { @@ -238,7 +254,7 @@ panelDessin_.tableauGare_ = new ArrayList(); panelDessin_.nbGares_ = donnees_.listeGare_.listeGares_.size();; System.out.println("REINITIAlISATION***********"); - labelMessage1_.setText("Cliquez sur le dessin pour positionner les gares"); + labelMessage1_.setText("Cliquer sur le dessin pour positionner les gares."); labelMessage2_.setText(""); panelDessin_.repaint(); } Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonAttenteElement.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonAttenteElement.java 2008-09-29 21:38:52 UTC (rev 4009) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonAttenteElement.java 2008-09-30 14:22:41 UTC (rev 4010) @@ -163,7 +163,7 @@ JComboBox ListeNavires_ = new JComboBox(); - String[] listeaction = {"Attente de s\xE9curit\xE9", "Attente d'acc\xE8s", "Attente d'occupation","Attente d'indisponibilit\xE9", "Attente totale" }; + String[] listeaction = {"Attentes de s\xE9curit\xE9", "Attentes d'acc\xE8s", "Attentes d'occupation","Attentes d'indisponibilit\xE9", "Attentes totales" }; /** * liste des actions a realiser */ @@ -193,14 +193,14 @@ boolean seuil_ = false; JTextField valSeuil_ = new JTextField(6); - JCheckBox valideSeuil_ = new JCheckBox("seuil", false); + JCheckBox valideSeuil_ = new JCheckBox("Afficher", false); float valeurSeuil = 0; /** * constructeur de la sous fenetre de gestion des resultats: */ Sinavi3ResultatComparaisonAttenteElement(final Sinavi3DataSimulation _donnees) { - super("Comparaison Attentes par \xE9l\xE9ment", true, true, true, true); + super("Comparaison des attentes par \xE9l\xE9ment", true, true, true, true); // recuperation des donn\xE9es de la simulation donnees_ = _donnees; @@ -270,7 +270,7 @@ } this.tableauChoixSimulations_[nbProjets] = new JCheckBox(this.listeProjet_[nbProjets].getFichier().substring( - debut, this.listeProjet_[nbProjets].getFichier().lastIndexOf(".sipor")), true); + debut, this.listeProjet_[nbProjets].getFichier().lastIndexOf(".sinavi")), true); this.tableauChoixSimulations_[nbProjets].addActionListener(this); nombreSimulationsComparees_++; nbProjets++; @@ -283,7 +283,7 @@ comparePossible2_ = VerificationComparaisonSimulationsPossibleEntreNavires(); - setSize(700, 500); + setSize(820, 600); setBorder(Sinavi3Bordures.compound_); this.getContentPane().setLayout(new BorderLayout()); @@ -295,9 +295,9 @@ // ajout des courbes dans le panel de la sous fenetre + panelPrincipal_.addTab("Graphe", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelCourbe_); panelPrincipal_.addTab("Histogramme", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelHisto_); - panelPrincipal_.addTab("Graphe", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelCourbe_); - + /******************************************************************************************************************* * gestion du panel du haut ******************************************************************************************************************/ @@ -314,11 +314,12 @@ panel2.add(new JLabel("Cat\xE9gorie de bateaux:")); panel2.add(this.ListeNavires_); - panel2.add(new JLabel(" Type d'attente:")); + panel2.add(new JLabel(" Type d'attentes:")); panel2.add(this.ListeActions_); panel2.add(validation_); this.controlPanel_.add(panel1); this.controlPanel_.add(panel2); + this.ListeActions_.setSelectedIndex(4); final TitledBorder bordurea = BorderFactory.createTitledBorder(BorderFactory .createEtchedBorder(EtchedBorder.LOWERED), "D\xE9finition de la recherche"); @@ -378,18 +379,30 @@ // panoption.setLayout(new GridLayout(2,1)); // JScrollPane pcnasc=new JScrollPane(panoption); - final Box bVert2 = Box.createVerticalBox(); + final Box panoption = Box.createVerticalBox(); + this.optionPanel_.add(panoption); + + final Box bVert2 = Box.createVerticalBox(); // bVert2.add(new JLabel("Affichage navires:")); // bVert2.setBorder(this.bordnormal_); for (int i = 0; i < nombreSimulationsComparees_; i++) { bVert2.add(this.tableauChoixSimulations_[i]); } final TitledBorder bordure1 = BorderFactory.createTitledBorder(BorderFactory - .createEtchedBorder(EtchedBorder.LOWERED), "simu"); + .createEtchedBorder(EtchedBorder.LOWERED), "Simulations"); bVert2.setBorder(bordure1); - final JScrollPane pcnasc = new JScrollPane(bVert2); - this.optionPanel_.add(pcnasc); + //final JScrollPane pcnasc = new JScrollPane(bVert2); + panoption.add(bVert2); this.optionPanel_.setBorder(this.compound_); + + final Box bVert3 = Box.createVerticalBox(); + final TitledBorder bordure2 = BorderFactory.createTitledBorder(BorderFactory + .createEtchedBorder(EtchedBorder.LOWERED), "Seuil"); + bVert3.setBorder(bordure2); + bVert3.add(new JLabel("Valeur (h.min):")); + bVert3.add(valSeuil_); + bVert3.add(valideSeuil_); + panoption.add(bVert3); /******************************************************************************************************************* * gestion du panel courbes panelCourbe_ @@ -408,7 +421,7 @@ this.panelCourbe_.add(this.graphe_, BorderLayout.CENTER); // etape 5: bouton de generation du fichier image - exportationgraphe_.setToolTipText("permet de g\xE9n\xE9rer un fichier image \xE0 partir du graphe"); + exportationgraphe_.setToolTipText("Exporte le graphe au format image"); exportationgraphe_.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { @@ -437,7 +450,7 @@ this.panelHisto_.add(this.histo_, BorderLayout.CENTER); // etape 5: bouton de generation du fichier image - exportationHisto_.setToolTipText("permet de g\xE9n\xE9rer un fichier image \xE0 partir de l'histogramme"); + exportationHisto_.setToolTipText("Exporte l'histogramme au format image"); exportationHisto_.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { @@ -474,14 +487,14 @@ }); valideSeuil_.addActionListener(this); - this.controlPanelHisto_.add(new JLabel(" seuil:")); - this.controlPanelHisto_.add(valSeuil_); - this.controlPanelHisto_.add(valideSeuil_); + //this.controlPanelHisto_.add(new JLabel(" Seuil (h.min):")); + //this.controlPanelHisto_.add(valSeuil_); + //this.controlPanelHisto_.add(valideSeuil_); /** listener des boutons quitter */ - this.quitter_.setToolTipText("cliquez sur ce bouton pour fermer la sous fen\xEAtre"); - this.quitter2_.setToolTipText("cliquez sur ce bouton pour fermer la sous fen\xEAtre"); - this.quitter3_.setToolTipText("cliquez sur ce bouton pour fermer la sous fen\xEAtre"); + this.quitter_.setToolTipText("Ferme la sous-fen\xEAtre"); + this.quitter2_.setToolTipText("Ferme la sous-fen\xEAtre"); + this.quitter3_.setToolTipText("Ferme la sous-fen\xEAtre"); final ActionListener actionQuitter = new ActionListener() { public void actionPerformed(ActionEvent e) { Sinavi3ResultatComparaisonAttenteElement.this.windowClosed(); @@ -493,7 +506,7 @@ // ajout d'un menuBar // petite barre de menu agreable - final JMenuBar menuBar = new JMenuBar(); +/* final JMenuBar menuBar = new JMenuBar(); final JMenu menuFile = new JMenu("Fichier"); final JMenuItem menuFileExit = new JMenuItem("Quitter"); final JMenu menuOption = new JMenu("Options"); @@ -514,7 +527,7 @@ menuBar.add(menuOption); menuBar.add(menuInfo); setJMenuBar(menuBar); - +*/ } /** @@ -530,6 +543,9 @@ * @return chaine: chaine qui contient la des cription de la chaine de caracteres. */ String affichageGraphe() { + + boolean echelleHeures_=false; + if (Sinavi3AlgorithmesComparaisonSimulation.determinerMaxAttente(this.listeParamsSimu_, this.nombreSimulationsComparees_) >= 240) echelleHeures_=true; String g = ""; @@ -539,16 +555,19 @@ int indiceElement = 0; g += "graphe\n{\n"; - g += " titre \" Comparaison de simulation \"\n"; - g += " sous-titre \"" + (String) this.ListeActions_.getSelectedItem() + " Element: " - + (String) this.ListetypeElem1_.getSelectedItem()+ (String) this.ListeElement_.getSelectedItem() + ", cat\xE9gorie: " + (String) this.ListeNavires_.getSelectedItem() + g += " titre \"Comparaison de simulations\"\n"; + g += " sous-titre \"" + (String) this.ListeActions_.getSelectedItem() + " : \xE9l\xE9ment " + + (String) this.ListeElement_.getSelectedItem() + " (" + (String) this.ListetypeElem1_.getSelectedItem()+ " " + "), cat\xE9gorie " + (String) this.ListeNavires_.getSelectedItem() + " \"\n"; g += " animation non\n"; g += " legende " + "oui" + "\n"; + + g += " marges\n {\n"; + g += " gauche 100\n"; g += " droite 100\n"; g += " haut 50\n"; g += " bas 30\n }\n"; g += " axe\n {\n"; // abscisses - g += " titre \" " + "\"\n"; - g += " unite \" simu \"\n"; + g += " titre \"Simulation" + "\"\n"; + g += " unite \"num\xE9ro\"\n"; g += " orientation " + "horizontal" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -560,16 +579,21 @@ g += " axe\n {\n"; // Ordonn\xE9es - g += " titre \" " + "\"\n"; - g += " unite \"" + " H.MIN" + "\"\n"; + g += " titre \"Dur\xE9e" + "\"\n"; + g += " unite \""; + if (echelleHeures_==true) g += "heures"; else g += "minutes"; + g += "\"\n"; g += " orientation " + "vertical" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; - g += " maximum " - + Sinavi3TraduitHoraires + g += " maximum "; + if (echelleHeures_==true) g+= (Sinavi3AlgorithmesComparaisonSimulation.determinerMaxAttente(this.listeParamsSimu_, this.nombreSimulationsComparees_))/60; + else g+= (Sinavi3AlgorithmesComparaisonSimulation.determinerMaxAttente(this.listeParamsSimu_, this.nombreSimulationsComparees_)); + /*+ Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float)Sinavi3AlgorithmesComparaisonSimulation.determinerMaxAttente(this.listeParamsSimu_, - this.nombreSimulationsComparees_)) + "\n"; + this.nombreSimulationsComparees_)) + "\n";*/ //} + g += "\n"; g += " }\n"; @@ -581,7 +605,7 @@ g += " courbe\n {\n"; g += " titre \""; - g += "" + (String) this.ListeActions_.getSelectedItem()+" maxi"; + g += "" + (String) this.ListeActions_.getSelectedItem()+" maximales"; g += "\"\n"; @@ -602,20 +626,20 @@ g += (indiceElement + 1)// numero de la cat\xE9gorie + " "; if (this.ListeActions_.getSelectedIndex() == 0) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMaxi); + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMaxi); } else if (this.ListeActions_.getSelectedIndex() == 1) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMaxi); + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMaxi); } else if (this.ListeActions_.getSelectedIndex() == 2) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMaxi); + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMaxi); } else if (this.ListeActions_.getSelectedIndex() == 3) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMaxi); + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMaxi); } else if (this.ListeActions_.getSelectedIndex() == 4) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMaxi); + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMaxi); } final String os = System.getProperty("os.name"); @@ -628,7 +652,7 @@ g += "\n etiquette \n \"" + this.listeProjet_[n].getFichier().substring(debut, - this.listeProjet_[n].getFichier().lastIndexOf(".sipor")) + "\" \n" + "\n"; + this.listeProjet_[n].getFichier().lastIndexOf(".sinavi")) + "\" \n" + "\n"; indiceElement++; } }// din du pour remplissage des coordonn\xE9es @@ -645,7 +669,7 @@ g += " courbe\n {\n"; g += " titre \""; - g += "" + (String) this.ListeActions_.getSelectedItem()+" moyen"; + g += "" + (String) this.ListeActions_.getSelectedItem()+" moyennes"; g += "\"\n"; g += " type " + "courbe" + "\n"; @@ -667,29 +691,49 @@ + " "; if (this.ListeActions_.getSelectedIndex() == 0) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuTotale - /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteSecu)); - }else + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuTotale == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteSecu))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteSecu));; + } + } else if (this.ListeActions_.getSelectedIndex() == 1) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesTotale - /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteAcces)); + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteAcces == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteAcces))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteAcces)); + } }else if (this.ListeActions_.getSelectedIndex() == 2) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupTotale - /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAtenteOccup)); + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAtenteOccup == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAtenteOccup))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAtenteOccup)); + } }else if (this.ListeActions_.getSelectedIndex() == 3) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneTotale + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttentePanne == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttentePanne))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneTotale /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttentePanne)); + } }else if (this.ListeActions_.getSelectedIndex() == 4) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteMegaTotale - /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteTotale)); + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteTotale == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteMegaTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteTotale))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteMegaTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteTotale)); + } } @@ -711,7 +755,7 @@ g += " courbe\n {\n"; g += " titre \""; - g += "" + (String) this.ListeActions_.getSelectedItem()+" mini"; + g += "" + (String) this.ListeActions_.getSelectedItem()+" minimales"; g += "\"\n"; g += " type " + "courbe" + "\n"; @@ -732,21 +776,21 @@ + " "; if (this.ListeActions_.getSelectedIndex() == 0) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMini); - } else if (this.ListeActions_.getSelectedIndex() == 1) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMini); - } else if (this.ListeActions_.getSelectedIndex() == 2) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMini); - } else if (this.ListeActions_.getSelectedIndex() == 3) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMini); - } else if (this.ListeActions_.getSelectedIndex() == 4) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMini); - } + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMini); + } else if (this.ListeActions_.getSelectedIndex() == 1) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMini); + } else if (this.ListeActions_.getSelectedIndex() == 2) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMini); + } else if (this.ListeActions_.getSelectedIndex() == 3) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMini); + } else if (this.ListeActions_.getSelectedIndex() == 4) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMini); + } g += "\n"; indiceElement++; @@ -774,7 +818,9 @@ g += "titre \"seuil \"\n"; // str+="orientation horizontal \n"; g += " type max\n"; - g += " valeur " + valeurSeuil + CtuluLibString.LINE_SEP_SIMPLE;// /la valeur ordonn\xE9e du seuil + //g += " valeur " + valeurSeuil + CtuluLibString.LINE_SEP_SIMPLE;// /la valeur ordonn\xE9e du seuil + if(echelleHeures_==true) g += " valeur " + Sinavi3TraduitHoraires.traduitHeuresMinutesEnHeures(valeurSeuil) + CtuluLibString.LINE_SEP_SIMPLE;// /la valeur ordonn\xE9e du seuil + else g += " valeur " + Sinavi3TraduitHoraires.traduitHeuresMinutesEnMinutes(valeurSeuil) + CtuluLibString.LINE_SEP_SIMPLE; g += " \n }\n"; // }//fin du for @@ -789,6 +835,9 @@ * @return */ String affichageHistogramme() { + + boolean echelleHeures_=false; + if (Sinavi3AlgorithmesComparaisonSimulation.determinerMaxAttente(this.listeParamsSimu_, this.nombreSimulationsComparees_) >= 240) echelleHeures_=true; String g = ""; @@ -798,16 +847,19 @@ int indiceElement = 0; g += "graphe\n{\n"; - g += " titre \" Comparaison de simulation \"\n"; - g += " sous-titre \"" + (String) this.ListeActions_.getSelectedItem() + " Element: " - + (String) this.ListetypeElem1_.getSelectedItem()+ (String) this.ListeElement_.getSelectedItem() + ", cat\xE9gorie: " + (String) this.ListeNavires_.getSelectedItem() + g += " titre \"Comparaison de simulations\"\n"; + g += " sous-titre \"" + (String) this.ListeActions_.getSelectedItem() + " : \xE9l\xE9ment " + + (String) this.ListeElement_.getSelectedItem() + " (" + (String) this.ListetypeElem1_.getSelectedItem()+ " " + "), cat\xE9gorie " + (String) this.ListeNavires_.getSelectedItem() + " \"\n"; g += " animation non\n"; g += " legende " + "oui" + "\n"; + + g += " marges\n {\n"; + g += " gauche 100\n"; g += " droite 100\n"; g += " haut 50\n"; g += " bas 30\n }\n"; g += " axe\n {\n"; // abscisses - g += " titre \" " + "\"\n"; - g += " unite \" simu \"\n"; + g += " titre \"Simulation" + "\"\n"; + g += " unite \"num\xE9ro\"\n"; g += " orientation " + "horizontal" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -819,16 +871,21 @@ g += " axe\n {\n"; // Ordonn\xE9es - g += " titre \" " + "\"\n"; - g += " unite \"" + " H.MIN" + "\"\n"; + g += " titre \"Dur\xE9e" + "\"\n"; + g += " unite \""; + if (echelleHeures_==true) g += "heures"; else g += "minutes"; + g += "\"\n"; g += " orientation " + "vertical" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; - g += " maximum " - + Sinavi3TraduitHoraires + g += " maximum "; + if (echelleHeures_==true) g+= (Sinavi3AlgorithmesComparaisonSimulation.determinerMaxAttente(this.listeParamsSimu_, this.nombreSimulationsComparees_))/60; + else g+= (Sinavi3AlgorithmesComparaisonSimulation.determinerMaxAttente(this.listeParamsSimu_, this.nombreSimulationsComparees_)); + /*+ Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float)Sinavi3AlgorithmesComparaisonSimulation.determinerMaxAttente(this.listeParamsSimu_, - this.nombreSimulationsComparees_)) + "\n"; + this.nombreSimulationsComparees_)) + "\n";*/ //} + g += "\n"; g += " }\n"; @@ -840,7 +897,7 @@ g += " courbe\n {\n"; g += " titre \""; - g += "" + (String) this.ListeActions_.getSelectedItem()+" maxi"; + g += "" + (String) this.ListeActions_.getSelectedItem()+" maximales"; g += "\"\n"; @@ -861,21 +918,21 @@ g += (indiceElement + 1)// numero de la cat\xE9gorie + " "; if (this.ListeActions_.getSelectedIndex() == 0) { - g +=Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float) this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMaxi); - } else if (this.ListeActions_.getSelectedIndex() == 1) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMaxi); - } else if (this.ListeActions_.getSelectedIndex() == 2) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMaxi); - } else if (this.ListeActions_.getSelectedIndex() == 3) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMaxi); - } else if (this.ListeActions_.getSelectedIndex() == 4) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMaxi); - } + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMaxi); + } else if (this.ListeActions_.getSelectedIndex() == 1) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMaxi); + } else if (this.ListeActions_.getSelectedIndex() == 2) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMaxi); + } else if (this.ListeActions_.getSelectedIndex() == 3) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMaxi); + } else if (this.ListeActions_.getSelectedIndex() == 4) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMaxi)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMaxi); + } final String os = System.getProperty("os.name"); int debut = 0; @@ -887,7 +944,7 @@ g += "\n etiquette \n \"" + this.listeProjet_[n].getFichier().substring(debut, - this.listeProjet_[n].getFichier().lastIndexOf(".sipor")) + "\" \n" + "\n"; + this.listeProjet_[n].getFichier().lastIndexOf(".sinavi")) + "\" \n" + "\n"; indiceElement++; } }// din du pour remplissage des coordonn\xE9es @@ -904,7 +961,7 @@ g += " courbe\n {\n"; g += " titre \""; - g += "" + (String) this.ListeActions_.getSelectedItem()+" moyen"; + g += "" + (String) this.ListeActions_.getSelectedItem()+" moyennes"; g += "\"\n"; g += " type " + "histogramme" + "\n"; @@ -925,30 +982,50 @@ g += (indiceElement + 1)// numero de la cat\xE9gorie + " "; - if (this.ListeActions_.getSelectedIndex() == 0) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuTotale - /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteSecu)); - }else + if (this.ListeActions_.getSelectedIndex() == 0) { + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuTotale == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteSecu))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteSecu));; + } + } else if (this.ListeActions_.getSelectedIndex() == 1) { - g +=Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float) (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesTotale - /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteAcces)); + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteAcces == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteAcces))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteAcces)); + } }else if (this.ListeActions_.getSelectedIndex() == 2) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupTotale - /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAtenteOccup)); + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAtenteOccup == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAtenteOccup))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAtenteOccup)); + } }else if (this.ListeActions_.getSelectedIndex() == 3) { - g +=Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float) (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneTotale + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttentePanne == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttentePanne))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneTotale /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttentePanne)); + } }else if (this.ListeActions_.getSelectedIndex() == 4) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteMegaTotale - /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteTotale)); + if (this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteTotale == 0) g+=0; + else { + if (echelleHeures_) g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteMegaTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteTotale))/60; + else g += ((float)(this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteMegaTotale + /this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].nbNaviresAttenteTotale)); + } } @@ -970,7 +1047,7 @@ g += " courbe\n {\n"; g += " titre \""; - g += "" + (String) this.ListeActions_.getSelectedItem()+" mini"; + g += "" + (String) this.ListeActions_.getSelectedItem()+" minimales"; g += "\"\n"; g += " type " + "histogramme" + "\n"; @@ -991,21 +1068,21 @@ + " "; if (this.ListeActions_.getSelectedIndex() == 0) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMini); - } else if (this.ListeActions_.getSelectedIndex() == 1) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMini); - } else if (this.ListeActions_.getSelectedIndex() == 2) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMini); - } else if (this.ListeActions_.getSelectedIndex() == 3) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMini); - } else if (this.ListeActions_.getSelectedIndex() == 4) { - g += Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMini); - } + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteSecuMini); + } else if (this.ListeActions_.getSelectedIndex() == 1) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteAccesMini); + } else if (this.ListeActions_.getSelectedIndex() == 2) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteOccupMini); + } else if (this.ListeActions_.getSelectedIndex() == 3) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attentePanneMini); + } else if (this.ListeActions_.getSelectedIndex() == 4) { + if (echelleHeures_) g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMini)/60; + else g += ((float)this.listeParamsSimu_[n].ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[this.comparePossible_[n]].tableauAttenteCategories[this.comparePossible2_[n]].attenteTotaleMini); + } g += "\n"; indiceElement++; @@ -1026,7 +1103,9 @@ g += "titre \"seuil \"\n"; // str+="orientation horizontal \n"; g += " type max\n"; - g += " valeur " + valeurSeuil + CtuluLibString.LINE_SEP_SIMPLE;// /la valeur ordonn\xE9e du seuil + //g += " valeur " + valeurSeuil + CtuluLibString.LINE_SEP_SIMPLE;// /la valeur ordonn\xE9e du seuil + if(echelleHeures_==true) g += " valeur " + Sinavi3TraduitHoraires.traduitHeuresMinutesEnHeures(valeurSeuil) + CtuluLibString.LINE_SEP_SIMPLE;// /la valeur ordonn\xE9e du seuil + else g += " valeur " + Sinavi3TraduitHoraires.traduitHeuresMinutesEnMinutes(valeurSeuil) + CtuluLibString.LINE_SEP_SIMPLE; g += " \n }\n"; // }//fin du for @@ -1079,13 +1158,17 @@ // on recupere al valeure du seuil choisie par l utilisateur valeurSeuil = Float.parseFloat(this.valSeuil_.getText()); // on redesssinne l histogramme en tenant compte du seuil de l utilisateur + final String descriptionGraphe = this.affichageGraphe(); final String descriptionHisto = this.affichageHistogramme(); + this.graphe_.setFluxDonnees(new ByteArrayInputStream(descriptionGraphe.getBytes())); this.histo_.setFluxDonnees(new ByteArrayInputStream(descriptionHisto.getBytes())); } else { // booleen passe a false this.seuil_ = false; // on redesssinne l histogramme en tenant compte du seuil de l utilisateur + final String descriptionGraphe = this.affichageGraphe(); final String descriptionHisto = this.affichageHistogramme(); + this.graphe_.setFluxDonnees(new ByteArrayInputStream(descriptionGraphe.getBytes())); this.histo_.setFluxDonnees(new ByteArrayInputStream(descriptionHisto.getBytes())); } } Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonAttentetrajet.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonAttentetrajet.java 2008-09-29 21:38:52 UTC (rev 4009) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatComparaisonAttentetrajet.java 2008-09-30 14:22:41 UTC (rev 4010) @@ -166,7 +166,7 @@ JComboBox ListeNavires_ = new JComboBox(); - String[] listeaction = { "Attente s\xE9curit\xE9", "Attente acc\xE8s", "Attente occupation","Attente Indisponibilit\xE9","Attente totale" }; + String[] listeaction = { "Attentes de s\xE9curit\xE9", "Attentes d'acc\xE8s", "Attentes d'occupation","Attentes d'indisponibilit\xE9","Attentes totales" }; /** * liste des actions a realiser */ @@ -175,15 +175,15 @@ /** * bouton de generation des resultats */ - private final BuButton exportationExcel_ = new BuBu... [truncated message content] |
From: <de...@us...> - 2008-09-29 21:39:17
|
Revision: 4009 http://fudaa.svn.sourceforge.net/fudaa/?rev=4009&view=rev Author: deniger Date: 2008-09-29 21:38:52 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java 2008-09-29 21:35:47 UTC (rev 4008) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java 2008-09-29 21:38:52 UTC (rev 4009) @@ -35,10 +35,13 @@ return getBorder(_state, true); } + public static int getBorderThickness() { + return MINI_THICKNESS; + } + public Border getBorderInGroup(ObjectState _state) { - return DEFAULT_BORDER; -// if (_state.isHovered()) { return ROUNDED_BORDER; } -// return EMPTY_BORDER; + return getBorder(_state, false); + // return EMPTY_BORDER; } public Border getBorder(ObjectState _state, boolean resizable) { Modified: 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/TrPostActionFusionCalques.java 2008-09-29 21:35:47 UTC (rev 4008) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java 2008-09-29 21:38:52 UTC (rev 4009) @@ -35,6 +35,7 @@ import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliLookFeel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliWidget; @@ -249,7 +250,8 @@ // Insets insetLayout = new Insets(30, 30, 30, 30); // parent.setLayout(new OverlayLayout()); - parent.setLayout(new OverlayLayoutGap(new Insets(0, 0, 0, 0))); + parent.setLayout(new OverlayLayoutGap(new Insets(-EbliLookFeel.getBorderThickness(), -EbliLookFeel + .getBorderThickness(), -EbliLookFeel.getBorderThickness(), -EbliLookFeel.getBorderThickness()))); Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); Point max = new Point(-Integer.MAX_VALUE, -Integer.MAX_VALUE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-29 21:36:10
|
Revision: 4008 http://fudaa.svn.sourceforge.net/fudaa/?rev=4008&view=rev Author: deniger Date: 2008-09-29 21:35:47 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 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-09-29 21:20:15 UTC (rev 4007) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-29 21:35:47 UTC (rev 4008) @@ -25,6 +25,7 @@ import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; +import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliComponentFactory; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BSelecteurListComboBox; @@ -71,6 +72,8 @@ EbliWidgetWithBordure widgetParent_; EbliActionEditorOneClick<BuPanel> editorAction_; + private boolean alreadyCreate_; + public EbliWidgetControllerCalque(final EbliWidgetVueCalque _widget, final EbliWidgetWithBordure _parent) { super(_parent); widgetCalque_ = _widget; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-29 21:21:02
|
Revision: 4007 http://fudaa.svn.sourceforge.net/fudaa/?rev=4007&view=rev Author: deniger Date: 2008-09-29 21:20:15 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.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/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerInterface.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/EbliWidgetTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextLabel.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/actions/EbliWidgetUngroupAction.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/EbliWidgetControllerLegendeCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCursorProvider.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliAlignWithMoveStrategyProvider.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -11,16 +11,23 @@ private static final Color COLOR_HOVERED = new Color(0x447BCD); private static final Color COLOR_SELECTED = COLOR_HOVERED.brighter(); + /** + * + */ + private static final Border ROUNDED_BORDER = BorderFactory.createRoundedBorder(0, 0, 0, 0, COLOR_SELECTED, + COLOR_HOVERED); + + private static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(); private static final int MINI_THICKNESS = 8; private static final Border MINI_BORDER_SELECTED = BorderFactory.createRoundedBorder(MINI_THICKNESS, MINI_THICKNESS, MINI_THICKNESS, MINI_THICKNESS, COLOR_SELECTED, COLOR_SELECTED.darker()); private static final Border RESIZE_BORDER = BorderFactory.createResizeBorder(MINI_THICKNESS, COLOR_HOVERED, true); - private static final Border RESIZE_BORDER_SELECTED = BorderFactory.createCompositeBorder(BorderFactory - .createRoundedBorder(0, 0, 0, 0, COLOR_SELECTED, COLOR_HOVERED), RESIZE_BORDER); + private static final Border RESIZE_BORDER_SELECTED = BorderFactory.createCompositeBorder(ROUNDED_BORDER, + RESIZE_BORDER); private static final Border DEFAULT_BORDER = BorderFactory.createEmptyBorder(MINI_THICKNESS); - private static final Border NON_RESIZE_BORDER_SELECTED = BorderFactory.createCompositeBorder(BorderFactory - .createRoundedBorder(0, 0, 0, 0, COLOR_SELECTED, COLOR_HOVERED), DEFAULT_BORDER); + private static final Border NON_RESIZE_BORDER_SELECTED = BorderFactory.createCompositeBorder(ROUNDED_BORDER, + DEFAULT_BORDER); private static final Border NON_RESIZE_BORDER = BorderFactory.createRoundedBorder(MINI_THICKNESS, MINI_THICKNESS, MINI_THICKNESS, MINI_THICKNESS, null, COLOR_SELECTED.darker()); @@ -28,6 +35,12 @@ return getBorder(_state, true); } + public Border getBorderInGroup(ObjectState _state) { + return DEFAULT_BORDER; +// if (_state.isHovered()) { return ROUNDED_BORDER; } +// return EMPTY_BORDER; + } + public Border getBorder(ObjectState _state, boolean resizable) { if (resizable) { if (_state.isHovered()) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -7,6 +7,7 @@ import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; +import org.fudaa.ebli.visuallibrary.actions.EbliAlignWithMoveStrategyProvider; import org.fudaa.ebli.visuallibrary.tree.EbliJXTreeTableCellRenderer; import org.jdesktop.swingx.JXTreeTable; import org.jdesktop.swingx.decorator.HighlighterFactory; @@ -14,6 +15,8 @@ import org.netbeans.api.visual.action.WidgetAction; import org.netbeans.api.visual.model.ObjectSceneEventType; import org.netbeans.api.visual.widget.Widget; +import org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider; +import org.netbeans.modules.visual.action.SingleLayerAlignWithWidgetCollector; import com.memoire.bu.BuMenuBar; import com.memoire.bu.BuToolBar; @@ -41,10 +44,12 @@ public EbliSceneController(EbliScene _scene) { scene_ = _scene; + SingleLayerAlignWithWidgetCollector widgetCollector = new SingleLayerAlignWithWidgetCollector(scene_.getVisu(), + false); + EbliAlignWithMoveStrategyProvider sp = new EbliAlignWithMoveStrategyProvider(widgetCollector, scene_ + .getInteractionLayer(), ActionFactory.createDefaultAlignWithMoveDecorator(), false); + alignWithMoveAction = ActionFactory.createMoveAction(sp, sp); - alignWithMoveAction = ActionFactory.createAlignWithMoveAction(scene_.getVisu(), scene_.getInteractionLayer(), - ActionFactory.createDefaultAlignWithMoveDecorator(), false); - alignWithResizeAction = ActionFactory.createAlignWithResizeAction(scene_.getVisu(), scene_.getInteractionLayer(), ActionFactory.createDefaultAlignWithMoveDecorator(), false); @@ -58,6 +63,10 @@ } + public boolean isEditable() { + return false; + } + public void addEditListener(EbliWidgetEditModeListener _l) { listeners_.add(_l); } 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-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -1,6 +1,7 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Color; +import java.awt.Cursor; import java.awt.Font; import java.awt.Point; import java.beans.PropertyChangeListener; @@ -22,6 +23,7 @@ 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; @@ -101,7 +103,11 @@ // -- creation du controller par defaut --// if (controllerDefaut) controller_ = new EbliWidgetController(this); + } + @Override + protected Cursor getCursorAt(Point _localLocation) { + return EbliWidgetCursorProvider.getCursor(this, _localLocation); } public void addPropertyChangeListener(final String _key, final PropertyChangeListener _l) { @@ -205,13 +211,12 @@ public List<EbliWidgetAnimatedItem> getAnimatedItems() { return null; } - - public EbliWidget getIntern(){ + + public EbliWidget getIntern() { return this; } - - - public boolean isAnimatedItemAlive(String _id){ + + public boolean isAnimatedItemAlive(String _id) { return false; } @@ -252,7 +257,7 @@ } - protected EbliWidget getGroup() { + public EbliWidget getGroup() { Widget parent = getParentWidget(); while (parent != getScene() && parent != null) { if (parent instanceof EbliWidget && ((EbliWidget) parent).isGroup) { return ((EbliWidget) parent); } @@ -360,12 +365,17 @@ } @Override - public void notifyStateChanged(final ObjectState previousState, final ObjectState newState) { + public void notifyStateChanged(final ObjectState _previousState, final ObjectState _newState) { if (!useBorder_) { return; } - setBorder(((EbliLookFeel) getScene().getLookFeel()).getBorder(newState, getController().canResize_)); + EbliLookFeel lookFeel = (EbliLookFeel) getScene().getLookFeel(); + final EbliWidget parent = getGroup(); - if (newState.isHovered() && parent != null) { - parent.setBorder(getBorder()); + if (parent != null) { +// System.err.println("parent not null"+ toString()); + setBorder(lookFeel.getBorderInGroup(_newState)); + parent.setBorder(lookFeel.getBorder(_newState, parent.getController().canResize_)); + } else { + setBorder(lookFeel.getBorder(_newState, getController().canResize_)); } } @@ -390,7 +400,15 @@ public void setController(final EbliWidgetController controller_) { this.controller_ = controller_; + } + /** + * @return le parent direct si de type bordure, sinon this. + */ + public EbliWidget getParentBordure() { + Widget parent = getParentWidget(); + if (parent instanceof EbliWidgetBordureSingle) return (EbliWidget) parent; + return this; } public void setFormeFont(final Font newFont) { 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-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -34,6 +34,11 @@ public EbliAnimatedInterface getAnimatedInterface() { return getIntern().getAnimatedInterface(); } + + + public EbliWidget getParentBordure(){ + return this; + } @Override public List<EbliWidgetAnimatedItem> getAnimatedItems() { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -40,6 +40,13 @@ public class EbliWidgetController implements EbliWidgetControllerInterface { /** + * @param _isEditable the isEditable to set + */ + public void setEditable(boolean _isEditable) { + isEditable = _isEditable; + } + + /** * action de la widget recuperable et eventuellement supprimable */ WidgetAction actionMove_; @@ -55,15 +62,22 @@ protected PopupMenuProvider providerPopup_ = null; protected EbliWidget widget_; + + boolean isEditable; public EbliWidgetController(EbliWidget widget_) { this(widget_, true, true, true); - } + + public EbliWidgetController(EbliWidget _widget, boolean _canMove, boolean _canResize) { this(_widget, _canMove, _canResize, true); } + + public boolean isEditable() { + return isEditable; + } public EbliWidgetController(EbliWidget widget_, boolean canMove, boolean canResize, boolean canDuplicate) { @@ -139,14 +153,15 @@ // -- si la widget a une bordure c'est la bordure que l on masque --// - EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); - if (n.getCreator().getBordure() != null) { - n.getCreator().getBordure().setVisible(false); - cmd_.addCmd(new CommandMasquer(n.getCreator().getBordure())); - } else { - widget_.setVisible(false); - cmd_.addCmd(new CommandMasquer(widget_)); - } + // EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); + // if (n.getCreator().getBordure() != null) { + // n.getCreator().getBordure().setVisible(false); + // cmd_.addCmd(new CommandMasquer(n.getCreator().getBordure())); + // } else { + EbliWidget toHide = widget_.getParentBordure(); + toHide.setVisible(false); + cmd_.addCmd(new CommandMasquer(toHide)); + // } widget_.getEbliScene().refresh(); } @@ -394,6 +409,17 @@ } + public void removeActionResize() { + widget_.getActions().removeAction(actionMove_); + canResize_ = false; + } + + public void replaceActionResize() { + if (actionResize_ != null) widget_.getActions().addAction(actionResize_); + canResize_ = true; + + } + public WidgetAction getActionMove() { return actionMove_; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerInterface.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerInterface.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerInterface.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -11,16 +11,17 @@ /** * @author deniger - * */ public interface EbliWidgetControllerInterface { - public abstract BuMenuBar getMenubarComponent(); + BuMenuBar getMenubarComponent(); - public abstract JComponent getOverviewComponent(); + JComponent getOverviewComponent(); - public abstract BuToolBar getToolbarComponent(); + BuToolBar getToolbarComponent(); - public abstract JComponent getTracableComponent(); + JComponent getTracableComponent(); + boolean isEditable(); + } \ No newline at end of file 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-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -15,6 +15,7 @@ */ EbliNode duplicate(EbliNode _nodeAdupliquer); - EbliWidgetWithBordure getBordure(); + //FIXME pas de reference vers la widget creer: un creator peut etre utiliser pour plusieurs widget ! +// EbliWidgetWithBordure getBordure(); } Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCursorProvider.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCursorProvider.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCursorProvider.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -0,0 +1,51 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ebli.visuallibrary; + +import java.awt.Cursor; +import java.awt.Point; + +import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.action.ResizeControlPointResolver; +import org.netbeans.api.visual.action.ResizeProvider.ControlPoint; +import org.netbeans.api.visual.widget.Widget; + +/** + * @author deniger + */ +public class EbliWidgetCursorProvider { + + private final static ResizeControlPointResolver controlPointResolver = ActionFactory + .createDefaultResizeControlPointResolver(); + + private static ControlPoint getControlPoint(Widget _widget, Point _localLocation) { + return controlPointResolver.resolveControlPoint(_widget, _localLocation); + } + + public static Cursor getCursor(EbliWidget _widget, Point _localLocation) { + if (!_widget.isEnabled() || _widget.getController() == null) + return Cursor.getDefaultCursor(); + if (_widget.getController().canResize_) { + ControlPoint controlPoint = getControlPoint(_widget, _localLocation); + if (controlPoint != null) { + int type = Cursor.SE_RESIZE_CURSOR; + if (controlPoint == ControlPoint.TOP_CENTER) type = Cursor.N_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.TOP_LEFT) type = Cursor.NW_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.TOP_RIGHT) type = Cursor.NE_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.CENTER_LEFT) type = Cursor.W_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.CENTER_RIGHT) type = Cursor.E_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.BOTTOM_CENTER) type = Cursor.S_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.BOTTOM_LEFT) type = Cursor.SW_RESIZE_CURSOR; + return Cursor.getPredefinedCursor(type); + } + } + if (_widget.getController().isEditable() && _widget.getClientArea().contains(_localLocation)) { return Cursor + .getPredefinedCursor(Cursor.TEXT_CURSOR); } + if (_widget.getController().canMove_) return Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR); + return Cursor.getDefaultCursor(); + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -18,35 +18,35 @@ public class EbliWidgetTextEditor extends EbliWidget implements InplaceEditorProvider<BuPanel> { - - // editeur de texte CtuluHtmlEditorPanel editorPane_ = new CtuluHtmlEditorPanel(); - // ComponentWidget widget; + // ComponentWidget widget; BuPanel conteneur = null; // LabelWidget intern_; ComponentWidget intern_; - + JLabel contenuHTML_ = new JLabel(); - + public EbliWidgetTextEditor(EbliScene scene, CtuluHtmlEditorPanel content) { super(scene, false); editorPane_ = content; intern_ = new ComponentWidget(scene, contenuHTML_); - + contenuHTML_.setText(content.getDocumentText()); // -- ajout en interne du label d affichage --// this.addChild(intern_); - + // -- creation de l action pour editor --// WidgetAction editorAction = ActionFactory.createInplaceEditorAction(this); // -- ajout de l action au widget correspondant --// this.getActions().addAction(editorAction); - - setController(new EbliWidgetControllerMenuOnly(this)); + EbliWidgetControllerMenuOnly controller = new EbliWidgetControllerMenuOnly(this); + controller.setEditable(true); + setController(controller); + } // protected void paintWidget() { @@ -60,54 +60,51 @@ /** * Methode qui redessine l edition de texte proprement. * - * @param text - * de l editeur html + * @param text de l editeur html * @param g */ -// public void decoupeEcriture(String text, Graphics2D g) { -// -// int espaceLignes = 10; -// -// if(text==null || text.length()==0) -// return; -// -// Rectangle rec = getClientArea(); -// int indiceDep=0; -// int espaceAffichable = Math.min((int) (rec.width / 5), text.length()); -// -// for (int i = 0; indiceDep + espaceAffichable < text.length(); i++) { -// g.drawString(text.substring(indiceDep, indiceDep + espaceAffichable), rec.x, rec.y + i * espaceLignes); -// indiceDep = indiceDep + espaceAffichable; -// -// } -// -// -// } - - + // public void decoupeEcriture(String text, Graphics2D g) { + // + // int espaceLignes = 10; + // + // if(text==null || text.length()==0) + // return; + // + // Rectangle rec = getClientArea(); + // int indiceDep=0; + // int espaceAffichable = Math.min((int) (rec.width / 5), text.length()); + // + // for (int i = 0; indiceDep + espaceAffichable < text.length(); i++) { + // g.drawString(text.substring(indiceDep, indiceDep + espaceAffichable), rec.x, rec.y + i * espaceLignes); + // indiceDep = indiceDep + espaceAffichable; + // + // } + // + // + // } + public BuPanel createEditorComponent( org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget) { - //--creation du panel ekitcore - if(conteneur==null){ - conteneur=new BuPanel(new BuBorderLayout()); + // --creation du panel ekitcore + if (conteneur == null) { + conteneur = new BuPanel(new BuBorderLayout()); Rectangle rec = getClientArea(); editorPane_.setSize(rec.width, rec.height); - editorPane_.setPreferredSize(new Dimension(rec.width, rec.height)); + editorPane_.setPreferredSize(new Dimension(rec.width, rec.height)); conteneur.setPreferredSize(new Dimension(rec.width, rec.height)); conteneur.setMaximumSize(new Dimension(rec.width, rec.height)); conteneur.setMinimumSize(new Dimension(rec.width, rec.height)); conteneur.add(editorPane_, BuBorderLayout.CENTER); conteneur.add(editorPane_.getToolBar(true), BuBorderLayout.NORTH); conteneur.add(editorPane_.getMenuBar()); - + } // -- on masque l affichage du widgetcomponent --// contenuHTML_.setText(""); return conteneur; - } public EnumSet<org.netbeans.api.visual.action.InplaceEditorProvider.ExpansionDirection> getExpansionDirections( @@ -123,20 +120,19 @@ public void notifyClosing(org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget, BuPanel editor, boolean commit) { - + // -- mise a jour de intern avec le contenu du ekitcore --// - + contenuHTML_.setText(editorPane_.getDocumentText()); intern_.repaint(); intern_.revalidate(); this.repaint(); getEbliScene().refresh(); // intern_.setLabel(label.getText()); - + } public void notifyOpened(org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - Widget widget, BuPanel editor) { - } + Widget widget, BuPanel editor) {} } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextLabel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextLabel.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextLabel.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -14,67 +14,64 @@ /** * Legende Widget qui permet de construire des rectangles avec du texte * - * @author Adrien Hadoux - * TODO a generaliser avec autre chose qu'un LabelWidget + * @author Adrien Hadoux TODO a generaliser avec autre chose qu'un LabelWidget */ -public class EbliWidgetTextLabel extends EbliWidget implements - TextFieldInplaceEditor { +public class EbliWidgetTextLabel extends EbliWidget implements TextFieldInplaceEditor { - LabelWidget intern; - Insets inGaps_; - int largeurBorder = 15; - int espaceInterieur = 5; + LabelWidget intern; + Insets inGaps_; + int largeurBorder = 15; + int espaceInterieur = 5; - - public Font fontForme; - - /** - * @param _scene - */ - public EbliWidgetTextLabel(EbliScene _scene, String label) { - super(_scene, false); + public Font fontForme; + + /** + * @param _scene + */ + public EbliWidgetTextLabel(EbliScene _scene, String label) { + super(_scene, false); // inGaps_ = new Insets(largeurBorder + espaceInterieur, largeurBorder // + espaceInterieur, largeurBorder + espaceInterieur, // largeurBorder + espaceInterieur); - // Ce layout permet de placer le texte - - // setLayout(new OverlayLayoutGap(inGaps_)); - - intern = new LabelWidget(_scene); - intern.setVerticalAlignment(VerticalAlignment.CENTER); - intern.setAlignment(Alignment.CENTER); - intern.setFont(getFormeFont()); - - intern.setLabel(label); - - //-- layout du texte --// - addChild(intern); + // Ce layout permet de placer le texte - // -- ajouter l option de remplacer le text dans le label --// + // setLayout(new OverlayLayoutGap(inGaps_)); - // -- creation de l action --// - WidgetAction editorAction = ActionFactory - .createInplaceEditorAction(this); + intern = new LabelWidget(_scene); + intern.setVerticalAlignment(VerticalAlignment.CENTER); + intern.setAlignment(Alignment.CENTER); + intern.setFont(getFormeFont()); - - - // -- ajout de l action au label correspondant --// + intern.setLabel(label); + + // -- layout du texte --// + addChild(intern); + + // -- ajouter l option de remplacer le text dans le label --// + + // -- creation de l action --// + WidgetAction editorAction = ActionFactory.createInplaceEditorAction(this); + + // -- ajout de l action au label correspondant --// this.getActions().addAction(editorAction); - // intern.getActions().addAction(ActionFactory.createResizeAction()); + // intern.getActions().addAction(ActionFactory.createResizeAction()); - // setEnabled(false); + // setEnabled(false); // -- ajout du controller special sans actions, juste le menu --/ - setController(new EbliWidgetControllerMenuOnly(this)); - } + EbliWidgetControllerMenuOnly controller = new EbliWidgetControllerMenuOnly(this); + controller.setEditable(true); + setController(controller); - public void majLabel(String label) { - // intern.setForeground(); - intern.setLabel(label); - revalidate(); - } + } + public void majLabel(String label) { + // intern.setForeground(); + intern.setLabel(label); + revalidate(); + } + // @Override // protected Rectangle calculateClientArea() { // // Rectangle res = intern.getPreferredBounds(); @@ -83,42 +80,33 @@ // // + res.width, 2 * (largeurBorder + espaceInterieur) + res.height); // } - protected void paintWidget() { - - // -- mise a jour de la fonte que si il y a eu une modification --// - if (intern.getFont() != getFormeFont()) - intern.setFont(getFormeFont()); + protected void paintWidget() { - if (intern.getForeground() != getColorContour()) - intern.setForeground(getColorContour()); + // -- mise a jour de la fonte que si il y a eu une modification --// + if (intern.getFont() != getFormeFont()) intern.setFont(getFormeFont()); - - - - - - } + if (intern.getForeground() != getColorContour()) intern.setForeground(getColorContour()); - public String getText(Widget widget) { - - + } + + public String getText(Widget widget) { + return this.intern.getLabel(); - } + } - public boolean isEnabled(Widget widget) { - // TODO Auto-generated method stub - return true; - } + public boolean isEnabled(Widget widget) { + // TODO Auto-generated method stub + return true; + } - public void setText(Widget widget, String text) { - + public void setText(Widget widget, String text) { + this.intern.setLabel(text); revalidate(); - } - - - public boolean canRotate() { + } + + public boolean canRotate() { return false; } @@ -137,12 +125,5 @@ public boolean canFont() { return true; } - - - - - - - } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliAlignWithMoveStrategyProvider.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliAlignWithMoveStrategyProvider.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliAlignWithMoveStrategyProvider.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -0,0 +1,101 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ebli.visuallibrary.actions; + +import java.awt.Point; + +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.netbeans.api.visual.action.AlignWithMoveDecorator; +import org.netbeans.api.visual.action.AlignWithWidgetCollector; +import org.netbeans.api.visual.action.MoveProvider; +import org.netbeans.api.visual.action.MoveStrategy; +import org.netbeans.api.visual.widget.LayerWidget; +import org.netbeans.api.visual.widget.Widget; +import org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider; + +/** + * @author deniger + */ +public class EbliAlignWithMoveStrategyProvider implements MoveStrategy, MoveProvider { + + final AlignWithMoveStrategyProvider alignProvider_; + + public EbliAlignWithMoveStrategyProvider(AlignWithWidgetCollector collector, LayerWidget interractionLayer, + AlignWithMoveDecorator decorator, boolean outerBounds) { + alignProvider_ = new AlignWithMoveStrategyProvider(collector, interractionLayer, decorator, outerBounds); + } + + /** + * @param _widget + * @return + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#getOriginalLocation(org.netbeans.api.visual.widget.Widget) + */ + public Point getOriginalLocation(Widget _widget) { + return getWidgetToMove(_widget).getPreferredLocation(); + } + + /** + * @see org.netbeans.modules.visual.action.AlignWithSupport#hide() + */ + public void hide() { + alignProvider_.hide(); + } + + /** + * @param _widget + * @param _originalLocation + * @param _suggestedLocation + * @return + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#locationSuggested(org.netbeans.api.visual.widget.Widget, + * java.awt.Point, java.awt.Point) + */ + public Point locationSuggested(Widget _widget, Point _originalLocation, Point _suggestedLocation) { + return alignProvider_.locationSuggested(getWidgetToMove(_widget), _originalLocation, _suggestedLocation); + } + + /** + * @param _widget + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#movementFinished(org.netbeans.api.visual.widget.Widget) + */ + public void movementFinished(Widget _widget) { + alignProvider_.movementFinished(getWidgetToMove(_widget)); + } + + /** + * @param _widget + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#movementStarted(org.netbeans.api.visual.widget.Widget) + */ + public void movementStarted(Widget _widget) { + alignProvider_.movementStarted(getWidgetToMove(_widget)); + } + + /** + * @param _widget + * @param _location + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#setNewLocation(org.netbeans.api.visual.widget.Widget, + * java.awt.Point) + */ + public void setNewLocation(Widget _widget, Point _location) { + getWidgetToMove(_widget).setPreferredLocation(_location); + } + + /** + * @see org.netbeans.modules.visual.action.AlignWithSupport#show() + */ + public void show() { + alignProvider_.show(); + } + + /** + * @param widget + */ + public static EbliWidget getWidgetToMove(Widget widget) { + EbliWidget w = (EbliWidget) widget; + EbliWidget group = w.getGroup(); + if (group != null) { return group; } + return w; + } + +} 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-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -27,6 +27,8 @@ import org.fudaa.ebli.visuallibrary.layout.GroupLayout; import org.netbeans.api.visual.widget.Widget; +import com.memoire.bu.BuInsets; + /** * @author deniger */ @@ -73,7 +75,7 @@ } int w = max.x - min.x; int h = max.y - min.y; - Insets b = parent.getBorder().getInsets(); + Insets b = BuInsets.INSETS0000;//parent.getBorder().getInsets(); // System.err.println(b); Rectangle bounds = new Rectangle(-b.left, -b.top, w + b.left + b.right, h + b.top + b.bottom); @@ -86,7 +88,7 @@ Rectangle widgetBounds = findWidget.getBounds(); Rectangle rec = findWidget.convertLocalToScene(widgetBounds); EbliWidget ew = (EbliWidget) findWidget; - ew.getController().removeActionResizeAndMove(); + ew.getController().removeActionResize(); // scene_.removeNode((EbliNode) object); findWidget.removeFromParent(); int dx = rec.x - min.x; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -44,7 +44,7 @@ // Set cs = new HashSet(); // for (final Iterator iterator = selectedObjects.iterator(); iterator.hasNext();) { EbliWidget w = (EbliWidget) _scene.findWidget(_n); - if (!w.isGroup()) return; + if (w==null || !w.isGroup()) return; List<Widget> children = new ArrayList<Widget>(w.getChildren()); for (Widget widget : children) { Point p = widget.getLocation(); @@ -59,7 +59,7 @@ _n.setPreferedSize(widget.getPreferredSize()); // widget.setPreferredLocation(toScene); _scene.addNode(n).setPreferredLocation(toScene); - n.getWidget().getController().replaceActionResizeAndMove(); + n.getWidget().getController().replaceActionResize(); } _scene.removeNode(_n); // } 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-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -25,7 +25,6 @@ import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; -import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliComponentFactory; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BSelecteurListComboBox; @@ -65,7 +64,7 @@ BuMenuBar menuCalque_; JComponent panelTreeCalque_; - public boolean alreadyCreate_; + BuToolBar toolbarCalque_; EbliWidgetVueCalque widgetCalque_; @@ -80,6 +79,14 @@ } + /** + * + */ + public boolean isEditable() { + return true; + + } + public void addActionSpecifiques() { editorAction_ = new EbliActionEditorOneClick<BuPanel>(widgetCalque_); @@ -113,8 +120,6 @@ @Override public void postActionDuplication(final EbliNode node, final EbliNode duplique) { - - // -- il faut verifier que les le node a bien une legende sinon on n ajoute // pas de legende pour le dupliqu\xE9 --// EbliWidgetControllerCalque controllerDuDuplique = null; @@ -127,11 +132,11 @@ controllerDuDuplique.setDescription(getDescription()); - // -- construction des actions sans passer par la frame fille --// + // -- construction des actions sans passer par la frame fille --// controllerDuDuplique.widgetCalque_.calquePanel_.getController().buildActions(); - + } - + public boolean hasLegende() { return widget_.getEbliScene().isObject(getNodeLegende()); } @@ -207,30 +212,31 @@ public void actionPerformed(final ActionEvent e) { // -- si la widget a une bordure c'est la bordure que l on masque --// - EbliWidget widgetUndo1 = null; - EbliWidget widgetUndo2 = null; + EbliWidget widgetUndo1 = widget_.getParentBordure(); + EbliWidget widgetUndo2 = widgetCalque_.nodeLegende.getWidget().getParentBordure(); - final EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); - if (n.getCreator().getBordure() != null) { - // -- on masque le calque --// - n.getCreator().getBordure().setVisible(false); + // final EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); + // if (n.getCreator().getBordure() != null) { + // // -- on masque le calque --// + // n.getCreator().getBordure().setVisible(false); + // + // widgetUndo1 = n.getCreator().getBordure(); + // + // } else { + // + widgetUndo1.setVisible(false); + // widgetUndo1 = widget_; - widgetUndo1 = n.getCreator().getBordure(); + // } - } else { - widget_.setVisible(false); - widgetUndo1 = widget_; - - } - // -- on masque sa legende associee --// - if (widgetCalque_.nodeLegende.getCreator().getBordure() != null) { - widgetCalque_.nodeLegende.getCreator().getBordure().setVisible(false); - widgetUndo2 = widgetCalque_.nodeLegende.getCreator().getBordure(); - } else { - widgetCalque_.nodeLegende.getWidget().setVisible(false); - widgetUndo2 = widgetCalque_.nodeLegende.getWidget(); - } + // if (widgetCalque_.nodeLegende.getCreator().getBordure() != null) { + // widgetCalque_.nodeLegende.getCreator().getBordure().setVisible(false); + // widgetUndo2 = widgetCalque_.nodeLegende.getCreator().getBordure(); + // } else { + // widgetCalque_.nodeLegende.getWidget().setVisible(false); + widgetUndo2.setVisible(false); + // } // -- creation des comamndes undo/redo pour le masquage --// final ArrayList<EbliWidget> listeWidget = new ArrayList<EbliWidget>(); @@ -282,7 +288,7 @@ editorAction_.openEditor(widgetCalque_); } - + public void ouvrirEditeur() { editorAction_.openEditor(widgetCalque_); } @@ -290,7 +296,6 @@ public void fermerEditeur() { editorAction_.closeEditor(true); } - public ZEbliCalquesPanel getVisuPanel() { return widgetCalque_.calquePanel_; @@ -340,7 +345,7 @@ // info.setAvailable(true); // JComponent jc = info; final Collection<EbliActionPaletteAbstract> acts = getVisuPanel().getController().getTabPaletteAction(); - + if (!CtuluLibArray.isEmpty(acts)) { final BuTabbedPane tb = new BuTabbedPane(); for (final EbliActionPaletteAbstract pals : acts) { @@ -367,8 +372,6 @@ return panelTreeCalque_; } - - /** * Obtient la toolbar specifique au calque * Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -15,27 +15,28 @@ * controller specifique aux legendes. gere * * @author genesis - * */ public class EbliWidgetControllerLegendeCalque extends EbliWidgetControllerMenuOnly { - public EbliWidgetControllerLegendeCalque(EbliWidget widget_) { + public EbliWidgetControllerLegendeCalque(final EbliWidget widget_) { super(widget_); } - protected void buildPopupMenu(JPopupMenu _menu) { + @Override + protected void buildPopupMenu(final JPopupMenu _menu) { constructPopupMenuSpecifique(_menu); // -- creation du menu commun a tous les widgets constructPopupMenuBase(_menu); } - private void constructPopupMenuSpecifique(JPopupMenu _popup) { - JMenuItem menuItem = new JMenuItem(EbliResource.EBLI.getString("Editer la l\xE9gende")); + private void constructPopupMenuSpecifique(final JPopupMenu _popup) { + + final JMenuItem menuItem = new JMenuItem(EbliResource.EBLI.getString("Editer la l\xE9gende")); _popup.add(menuItem, 0); menuItem.setIcon(CtuluResource.CTULU.getIcon("crystal_editer")); menuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { MenuEditer(); @@ -43,16 +44,18 @@ }); } + @Override + public boolean isEditable() { + return true; + } - - /** * Mise au premier plan de la widget et edition. Sert beaucoup pour la fusion */ public void MenuEditer() { - // -- executer l action d edition --// + // -- executer l action d edition --// ((EbliWidgetCalqueLegende) getWidget()).editorAction_.openEditor(getWidget()); } - + } 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-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -75,7 +75,12 @@ addActionSpecifiques(); } + + public boolean isEditable() { + return true; + } + public void addActionSpecifiques() { editorAction_ = new EbliActionEditorOneClick<BuPanel>((EbliWidgetGraphe) widget_); // -- ajout de l action au widget correspondant --// @@ -159,30 +164,31 @@ public void actionPerformed(ActionEvent e) { // -- si la widget a une bordure c'est la bordure que l on masque --// - EbliWidget widgetUndo1 = null; - EbliWidget widgetUndo2 = null; + EbliWidget widgetUndo1 = widget_.getParentBordure(); + EbliWidget widgetUndo2 = widgetGraphe_.getNodeLegende().getWidget().getParentBordure(); - EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); - if (n.getCreator().getBordure() != null) { - // -- on masque le calque --// - n.getCreator().getBordure().setVisible(false); + // EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); + // if (n.getCreator().getBordure() != null) { + // // -- on masque le calque --// + // n.getCreator().getBordure().setVisible(false); + // + // widgetUndo1 = n.getCreator().getBordure(); + // + // } else { + widgetUndo1.setVisible(false); + // widgetUndo1 = widget_; - widgetUndo1 = n.getCreator().getBordure(); + // } - } else { - widget_.setVisible(false); - widgetUndo1 = widget_; - - } - // -- on masque sa legende associee --// - if (widgetGraphe_.getNodeLegende().getCreator().getBordure() != null) { - widgetGraphe_.getNodeLegende().getCreator().getBordure().setVisible(false); - widgetUndo2 = widgetGraphe_.getNodeLegende().getCreator().getBordure(); - } else { - widgetGraphe_.getNodeLegende().getWidget().setVisible(false); - widgetUndo2 = widgetGraphe_.getNodeLegende().getWidget(); - } + // if (widgetGraphe_.getNodeLegende().getCreator().getBordure() != null) { + // widgetGraphe_.getNodeLegende().getCreator().getBordure().setVisible(false); + // widgetUndo2 = widgetGraphe_.getNodeLegende().getCreator().getBordure(); + // } else { + // widgetGraphe_.getNodeLegende().getWidget().setVisible(false); + // + widgetUndo2.setVisible(false); + // } // -- creation des comamndes undo/redo pour le masquage --// ArrayList<EbliWidget> listeWidget = new ArrayList<EbliWidget>(); @@ -345,8 +351,7 @@ // paneGlobal.setTopComponent(getGraphePanel().getInfoPanel()); // paneGlobal.setBottomComponent(new JScrollPane(tree)); - panelTreeGraphe_ = new JScrollPane(tree); - ;// paneGlobal; + panelTreeGraphe_ = new JScrollPane(tree);;// paneGlobal; } return panelTreeGraphe_; Modified: 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/TrPostActionFusionCalques.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -222,7 +222,7 @@ getScene().getCmdMng().addCmd(new CtuluCommand() { public void undo() { - + // -- degroupe et desynchronise le tout --// EbliWidgetUngroupAction.degroupObjectsFromFusion(getScene(), fusion); } @@ -246,10 +246,10 @@ // -- il faut des gaps suffisants pour deplacer la widget et avoir le menu // du groupe --// - Insets insetLayout = new Insets(30, 30, 30, 30); + // Insets insetLayout = new Insets(30, 30, 30, 30); // parent.setLayout(new OverlayLayout()); - parent.setLayout(new OverlayLayoutGap(insetLayout)); + parent.setLayout(new OverlayLayoutGap(new Insets(0, 0, 0, 0))); Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); Point max = new Point(-Integer.MAX_VALUE, -Integer.MAX_VALUE); @@ -271,8 +271,8 @@ // int h = max.y - min.y; // Insets b = parent.getBorder().getInsets(); - sizeMax.width += 2 * insetLayout.left; - sizeMax.height += 2 * insetLayout.bottom; + // sizeMax.width += 2 * insetLayout.left; + // sizeMax.height += 2 * insetLayout.bottom; parent.setPreferredBounds(sizeMax); parent.setPreferredSize(new Dimension(sizeMax.width, sizeMax.height)); @@ -290,7 +290,7 @@ } else if (vue.getViewBoite() != null) { boite.ajuste(vue.getViewBoite()); } - ew.getController().removeActionResizeAndMove(); + ew.getController().removeActionResize(); findWidget.removeFromParent(); // int dx = rec.x - min.x; @@ -316,11 +316,10 @@ node.setTitle(EbliLib.getS("Fusion calquess")); node.setCreator(creator); parent.setController(new EbliWidgetControllerForGroup(parent, true)); - - //-- synchronisation des sondes des fusions --// + + // -- synchronisation des sondes des fusions --// parent.synchroniseSondeFusion(); - - + scene_.addNode(node); if (pn != null && boite != null) { pn.getVueCalque().changeRepere(pn, boite, 0, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-29 15:44:18
|
Revision: 4006 http://fudaa.svn.sourceforge.net/fudaa/?rev=4006&view=rev Author: hadouxad Date: 2008-09-29 15:43:55 +0000 (Mon, 29 Sep 2008) Log Message: ----------- - correction bug legende - convertisseur structure scope en evolutionReguliere - Creation de l action et de l'interface des bilans - Correction des appelation multi fichier Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java 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/ScopeTFileFormat.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.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/EbliWidgetCreatorVueCalque.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/FudaaWriterScopeS.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/TrImportCourbeScopeManager.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/TrPostActionController.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/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -1,6 +1,7 @@ package org.fudaa.dodico.telemac.io; import java.io.File; +import java.util.Map; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.ProgressionInterface; @@ -9,6 +10,7 @@ import org.fudaa.ctulu.fileformat.FileWriteOperationAbstract; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; +import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; /** * Manager de fichiers au format scope. Utilis\xE9 pour la cr\xE9ation des graphes. au @@ -17,7 +19,7 @@ * @author Adrien Hadoux * */ -public class ScopeGENEFileFormat extends FileFormatUnique { +public class ScopeGENEFileFormat extends FileFormatUnique implements EvolutionFileFormatVersion { static final ScopeGENEFileFormat INSTANCE = new ScopeGENEFileFormat(); @@ -48,5 +50,9 @@ public FileWriteOperationAbstract createWriter() { return new ScopeWriterGENE(this); } + + public CtuluIOOperationSynthese readEvolutions(File _f, ProgressionInterface _prog, Map _options) { + return super.read(_f, _prog); + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -9,6 +9,7 @@ import org.fudaa.ctulu.fileformat.FileFormatVersionInterface; import org.fudaa.dodico.fortran.FileOpReadCharSimpleAbstract; import org.fudaa.dodico.h2d.resource.H2dResource; +import org.fudaa.dodico.mesure.EvolutionReguliere; /** * Classe reader de fichier au format scope Gene, evolu\xE9 par rapport a s ou t. @@ -60,7 +61,7 @@ * * @return */ - ScopeStructure readStructure() { + EvolutionReguliere[] readStructure() { if (super.in_ == null) { analyze_.addError(H2dResource.getS("Flux d'entr\xE9e non trouv\xE9"), 0); @@ -118,7 +119,7 @@ } } catch (EOFException Exc) { - return structure; + return structure.returnEvolReguliere(); } } catch (IOException e) { Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -9,6 +9,7 @@ import org.fudaa.ctulu.fileformat.FileFormatVersionInterface; import org.fudaa.dodico.fortran.FileOpReadCharSimpleAbstract; import org.fudaa.dodico.h2d.resource.H2dResource; +import org.fudaa.dodico.mesure.EvolutionReguliere; /** * Classe reader de fichier au format scope. Utilise fortranReader @@ -59,7 +60,7 @@ * * @return */ - ScopeStructure readStructure() { + EvolutionReguliere[] readStructure() { if (super.in_ == null) { @@ -93,7 +94,7 @@ }catch(EOFException Exc){ - return structure; + return structure.returnEvolReguliere(); } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -1,6 +1,7 @@ package org.fudaa.dodico.telemac.io; import java.io.File; +import java.util.Map; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.ProgressionInterface; @@ -9,6 +10,7 @@ import org.fudaa.ctulu.fileformat.FileWriteOperationAbstract; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; +import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; /** * Manager de fichiers au format scope. Utilis\xE9 pour la cr\xE9ation des graphes. au @@ -17,7 +19,7 @@ * @author Adrien Hadoux * */ -public class ScopeSFileFormat extends FileFormatUnique { +public class ScopeSFileFormat extends FileFormatUnique implements EvolutionFileFormatVersion { static final ScopeSFileFormat INSTANCE = new ScopeSFileFormat(); @@ -48,5 +50,9 @@ public FileWriteOperationAbstract createWriter() { return new ScopeWriterSorT(this); } + + public CtuluIOOperationSynthese readEvolutions(File _f, ProgressionInterface _prog, Map _options) { + return super.read(_f, _prog); + } } 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-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -5,6 +5,8 @@ import java.util.List; import java.util.Map; +import org.fudaa.dodico.mesure.EvolutionReguliere; + /** * Structure de donn\xE9es utilis\xE9e pour la lecture des fichiers scope. * @@ -145,6 +147,37 @@ return brochetteVal; } + /** + * Transforme la structure en evol regulieres. + * + * @return + */ + public EvolutionReguliere[] returnEvolReguliere() { + EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbVariables()]; + + // -- on parcours toutes les variables --// + for (int i = 0; i < getNbVariables(); i++) { + String nomVar = getVariable(i); + + List<Double> listeX = getAllX(); + List<Double> listeY = getListValueForVariable(i); + + double[] tabX = new double[listeX.size()]; + double[] tabY = new double[listeY.size()]; + + for (int j = 0; j < listeX.size(); j++) { + tabX[i] = listeX.get(i); + tabY[i] = listeY.get(i); + + } + + evolReg[i] = new EvolutionReguliere(tabX, tabY, false); + evolReg[i].setNom("courbe de " + nomVar); + } + return evolReg; + } + + @Override public void printResults() { System.err.print("\n Contenu du fichier scope"); @@ -344,7 +377,39 @@ return titles_.get(i); } + + public EvolutionReguliere[] returnEvolReguliere() { + EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbPasDeTemps() * getNbVariables()]; + // -- on parcours tous les pas de temps --// + for (int h = 0; h < getNbPasDeTemps(); h++) { + + String pdt = getPasDeTemps(h); + + // -- on parcours toutes les variables --// + for (int i = 0; i < getNbVariables(); i++) { + String nomVar = getVariable(i); + + List<Double> listeX = getAllX(pdt); + List<Double> listeY = getListValueForVariableForPDT(pdt, i); + + double[] tabX = new double[listeX.size()]; + double[] tabY = new double[listeY.size()]; + + for (int j = 0; j < listeX.size(); j++) { + tabX[i] = listeX.get(i); + tabY[i] = listeY.get(i); + + } + + evolReg[i] = new EvolutionReguliere(tabX, tabY, false); + evolReg[i].setNom("courbe de " + nomVar); + } + + } + return evolReg; + } + @Override public void printResults() { // titres Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -1,6 +1,7 @@ package org.fudaa.dodico.telemac.io; import java.io.File; +import java.util.Map; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.ProgressionInterface; @@ -9,6 +10,7 @@ import org.fudaa.ctulu.fileformat.FileWriteOperationAbstract; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; +import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; /** * Manager de fichiers au format scope. Utilis\xE9 pour la cr\xE9ation des graphes. au @@ -17,7 +19,7 @@ * @author Adrien Hadoux * */ -public class ScopeTFileFormat extends FileFormatUnique { +public class ScopeTFileFormat extends FileFormatUnique implements EvolutionFileFormatVersion { static final ScopeTFileFormat INSTANCE = new ScopeTFileFormat(); @@ -48,5 +50,9 @@ public FileWriteOperationAbstract createWriter() { return new ScopeWriterSorT(this); } + + public CtuluIOOperationSynthese readEvolutions(File _f, ProgressionInterface _prog, Map _options) { + return super.read(_f, _prog); + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -153,6 +153,11 @@ if (standardActionGroup_ == null) { buildButtonGroupStandard(); } + if (standardActionGroup_ == null) { + buildButtonGroupSpecifique(); + } + + } protected EbliActionInterface createRepereAction() { @@ -318,6 +323,11 @@ // this.updateMapKeyStroke(standardActionGroup_); } + + public EbliActionInterface[] buildButtonGroupSpecifique() { + return null; + } + protected final EbliActionInterface[] getSpecificActionGroup() { return specificActionGroup_; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -52,6 +52,9 @@ */ boolean isStructureModifiable(); + + + /** * @return true si le contenu de courbe peut etre modifie */ 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-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -20,7 +20,6 @@ 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.EbliWidgetWithBordure; import org.netbeans.api.visual.border.BorderFactory; import org.netbeans.api.visual.layout.LayoutFactory.SerialAlignment; @@ -187,6 +186,14 @@ EbliScene scene_; + public EbliScene getScene() { + return scene_; + } + + public void setScene(EbliScene _scene) { + scene_ = _scene; + } + public CalqueLegendeWidgetAdapter(EbliScene _scene, BArbreCalqueModel model) { super(); scene_ = _scene; @@ -210,16 +217,16 @@ * * @return EbliNode cree ajoute a la scene. */ - public EbliNode createLegende(Point _location) { - + public EbliNode createLegende(Point _location, EbliScene _scene) { + setScene(_scene); EbliNodeDefault def = new EbliNodeDefault(); def.setPreferedLocation(_location); // def.setPreferedSize(new Dimension(150, 250)); def.setCreator(new EbliWidgetCreatorLegende(legendePanel_)); def.setTitle("L\xE9gende calque"); // TODO non stable - scene_.addNode(def); - scene_.refresh(); + _scene.addNode(def); + _scene.refresh(); return 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-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -25,6 +25,7 @@ import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; +import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliComponentFactory; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BSelecteurListComboBox; @@ -64,7 +65,7 @@ BuMenuBar menuCalque_; JComponent panelTreeCalque_; - + public boolean alreadyCreate_; BuToolBar toolbarCalque_; EbliWidgetVueCalque widgetCalque_; @@ -87,7 +88,26 @@ } + /** + * ajoute des toolsbuton specifiques si pas deja ajoutes. + */ + public void addFonctionsSpecific(ArrayList<EbliActionSimple> _listeActions) { + + if (!fonctionsAlreadySpecified()) { + alreadyCreate_ = true; + + for (Iterator<EbliActionSimple> it = _listeActions.iterator(); it.hasNext();) { + EbliActionSimple action = it.next(); + toolbarCalque_.add(action.buildToolButton(EbliComponentFactory.INSTANCE)); + menuCalque_.getMenu(0).add(new JMenuItem(action)); + } + + } + + } + + /** * Methode a surcharger si on veut effectuer un traitement particulier apres duplication du widget. */ @Override @@ -134,7 +154,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)); + setNodeLegende(legendeWidget_.createLegende(positionLegende, widget_.getEbliScene())); } widget_.getEbliScene().refresh(); } else if (getNodeLegende().hasWidget()) @@ -427,5 +447,7 @@ public void setNodeLegende(final EbliNode node) { widgetCalque_.nodeLegende = node; } - + public boolean fonctionsAlreadySpecified() { + return alreadyCreate_; + } } 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-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -45,7 +45,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); + vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene()); ((EbliWidgetControllerCalque) vue.getController()).setLegendeWidget(_legende); } 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-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -103,8 +103,9 @@ } else { if (op.getSource() instanceof EvolutionReguliereInterface[]) _target.importCourbes((EvolutionReguliereInterface[]) op.getSource(), _mng, prog); - else - _target.importCourbes((ScopeStructure) op.getSource(), _mng, prog); + // else + // _target.importCourbes((ScopeStructure) op.getSource(), _mng, + // prog); } } _ui.unsetMainMessage(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -75,7 +75,10 @@ // -- data qui contient les courbes choisies --// EGExportData data = (EGExportData) _model; EGGraphe graphe_ = data.getGraphe(); - EGCourbe[] listeChoixUser = data.getCourbes(); + + // -- on prends UNIQUEMENT la premiere courbe choisie --// + EGCourbe[] listeChoixUser = new EGCourbe[1]; + listeChoixUser[0] = data.getCourbes()[0]; // -- on ajoute la var des x, debut de chaque ligne de valeurs --// structure_.addVariable("X"); 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-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -98,6 +98,15 @@ } + + + public H2dVariableType[] getVariables() { + + List values = getShownVar(); + + return null; + } + public boolean isStructureModifiable() { return true; } @@ -212,7 +221,12 @@ return true; } - List getShownVar() { + /** + * retourne la liste des variables du graphe. + * + * @return + */ + public List getShownVar() { final List res = new ArrayList(getNbEGObject() - 1); for (int i = getNbEGObject() - 1; i >= 0; i--) { final EGGroup g = getGroup(i); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -1,7 +1,10 @@ package org.fudaa.fudaa.tr.common; +import java.util.List; + import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.dodico.telemac.io.ScopeStructure.Gene; @@ -19,7 +22,7 @@ public class TrImportCourbeScopeManager implements FudaaCourbeImporter.Target { EGGraphe graphe_; - MvProfileTreeModel modelGraphe_; + /** * indique si la courbe a importer est correcte */ @@ -31,10 +34,7 @@ super(); graphe_ = _graphe; impl_ = _impl; - // if (_graphe.getModel() instanceof MvProfileTreeModel) - modelGraphe_ = (MvProfileTreeModel) _graphe.getModel(); - // else - // enabled = false; + } public void importCourbes(EvolutionReguliereInterface[] _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { @@ -69,15 +69,31 @@ */ public void importCourbesSorT(ScopeStructure.SorT s, CtuluCommandManager _mng, ProgressionInterface _prog) { + EvolutionReguliere[] evolReg=new EvolutionReguliere[s.getNbVariables()]; + // -- on parcours toutes les variables --// for (int i = 0; i < s.getNbVariables(); i++) { - - // --on recherche si cette variable n'existe pas deja dans le graphe --// - // graphe_.getModel().get + String nomVar = s.getVariable(i); - } + List<Double> listeX=s.getAllX(); + List<Double> listeY=s.getListValueForVariable(i); + + double[] tabX=new double[listeX.size()]; + double[] tabY=new double[listeY.size()]; + + for(int j=0;j<listeX.size();j++){ + tabX[i]=listeX.get(i); + tabY[i]=listeY.get(i); + + } + + evolReg[i]=new EvolutionReguliere(tabX,tabY,false); - + + + + } + } Modified: 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/TrPostActionController.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -45,6 +45,8 @@ super(_ui); } + + @Override protected void buildButtonGroupNavigation() { if (navigationActionGroup_ != null) { return; } @@ -66,6 +68,24 @@ standardActionGroup_ = removePalettes(standardActionGroup_); } + + protected void buildButtonGroupSpecifiques() { + if (standardActionGroup_ != null) + return; + super.buildButtonGroupStandard(); + standardActionGroup_ = removePalettes(standardActionGroup_); + + + + + + + + + + + } + /** * recupere les palettes et initialise les actions */ Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -0,0 +1,61 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.event.ActionEvent; + +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.fudaa.meshviewer.MvResource; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; + +import com.vividsolutions.jts.geom.LineString; + +/** + * Action pour le calcul des bilans. Cette action peut etre executee depuis le + * mode edition du calque pu le mode edition d'un profil spoatial. + * + * @author Adrien Hadoux + * + */ +public class TrPostBilanAction extends EbliActionSimple { + + // final MvProfileTarget src_; + final TrPostVisuPanel panel_; + final MvProfileTreeModel modelGraphe_; + final boolean startWithCalque; + TrPostCommonImplementation impl_; + + public TrPostBilanAction(final TrPostVisuPanel _visu, TrPostCommonImplementation impl) { + super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); + panel_ = _visu; + modelGraphe_ = null; + startWithCalque = true; + impl_ = impl; + } + + public TrPostBilanAction(final MvProfileTreeModel _model, TrPostCommonImplementation impl) { + super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); + modelGraphe_ = _model; + panel_ = null; + startWithCalque = false; + impl_ = impl; + } + + public void actionPerformed(final ActionEvent _e) { + // -- creation du wizard depusi le calque --// + if (startWithCalque) { + new TrPostDialogBilan(panel_, impl_); + } else { + new TrPostDialogBilan(modelGraphe_, impl_); + } + } + + + protected LineString getSelectedLine() { + // pas de calque s\xE9lectionn\xE9 + if (!(panel_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { + return null; + } + return ((ZCalqueAffichageDonneesInterface) panel_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); + } +} + Added: 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/TrPostDialogBilan.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -0,0 +1,319 @@ +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.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.AbstractAction; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.ListModel; +import javax.swing.ListSelectionModel; + +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.ressource.EbliResource; +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.LineString; + +/** + * Wizard pour gerer les bilans des courbes. + * + * @author Adrien Hadoux + * + */ +public class TrPostDialogBilan { + + /** + * booleen qui indique si le wizard a \xE9t\xE9t lanc\xE9 depuis un calque + */ + + private boolean startWithCalque_ = true; + TrPostSource source_; + TrPostVisuPanel calque_; + MvProfileTreeModel modelGraphe_; + TrPostCommonImplementation impl_; + + // donnees graphiques + JDialog dialog_; + + // variables + private JPanel panelVariables_; + ListModel modelVariables_; + JList listVar_; + + // isolignes + private JPanel panelIsolignes_; + JCheckBox boxSelectLineAuto_ = new JCheckBox(TrResource.getS("Choisir l'isoligne du calque")); + JCheckBox boxSelectLineManu_ = new JCheckBox(TrResource.getS("Cr\xE9er manuellement lisoligne")); + BuTextField textX1 = new BuTextField(10); + BuTextField textX2 = new BuTextField(10); + BuTextField textY1 = new BuTextField(10); + BuTextField textY2 = new BuTextField(10); + + // results + JPanel panelResults_; + JLabel results_; + JButton ajouter = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); + /** + * Constructeur reserv\xE9 au calques + * + * @param _builderParams + * @param _calque + * @param _modelGraphe + * @param _panelVariables + * @param _source + */ + public TrPostDialogBilan(TrPostVisuPanel _calque, TrPostCommonImplementation impl) { + impl_ = impl; + calque_ = _calque; + modelGraphe_ = null; + source_ = calque_.getSource(); + modelVariables_ = source_.getNewVarListModel(); + startWithCalque_ = true; + + // -- construction de la dialog --// + buildDialog(); + } + + /** + * constructeur reserv\xE9 aux graphes spatiaux + * + * @param _builderParams + * @param _calque + * @param _modelGraphe + * @param _panelVariables + * @param _source + */ + public TrPostDialogBilan(MvProfileTreeModel _modelGraphe, TrPostCommonImplementation impl) { + calque_ = null; + impl_ = impl; + modelGraphe_ = _modelGraphe; + source_ = (TrPostSource) _modelGraphe.target_.getData(); + startWithCalque_ = false; + modelVariables_ = source_.getNewVarListModel(); + + // -- construction de la dialog --// + buildDialog(); + } + + /** + * Construit le panel des variables + * + * @return + */ + private JPanel buildIsoLignes() { + JPanel content=new JPanel(new BorderLayout()); + JPanel panelChek = new JPanel(new FlowLayout(FlowLayout.CENTER)); + panelChek.add(new JLabel(TrResource.getS("Choisir l'isoligne du calque"))); + panelChek.add(boxSelectLineAuto_); + panelChek.add(new JLabel(TrResource.getS("Cr\xE9er manuellement l'isoligne"))); + panelChek.add(boxSelectLineManu_); + content.add(panelChek, BorderLayout.NORTH); + + JPanel center = new JPanel(new GridLayout(2, 1)); + JPanel center1 = new JPanel(new FlowLayout(FlowLayout.CENTER)); + center1.add(new JLabel("Point 1 X:")); + center1.add(textX1); + center1.add(new JLabel("Y:")); + center1.add(textY1); + JPanel center2 = new JPanel(new FlowLayout(FlowLayout.CENTER)); + center2.add(new JLabel("Point 2 X:")); + center2.add(textX2); + center2.add(new JLabel("Y:")); + center2.add(textY2); + center.add(center1); + center.add(center2); + content.add(center, BorderLayout.CENTER); + content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de l'isoligne"))); + + // -- init et gestion des evenements --// + textX1.setCharValidator(BuCharValidator.FLOAT); + textX1.setStringValidator(BuStringValidator.FLOAT); + textX1.setValueValidator(BuValueValidator.FLOAT); + + textX2.setCharValidator(BuCharValidator.FLOAT); + textX2.setStringValidator(BuStringValidator.FLOAT); + textX2.setValueValidator(BuValueValidator.FLOAT); + + textY1.setCharValidator(BuCharValidator.FLOAT); + textY1.setStringValidator(BuStringValidator.FLOAT); + textY1.setValueValidator(BuValueValidator.FLOAT); + + textY2.setCharValidator(BuCharValidator.FLOAT); + textY2.setStringValidator(BuStringValidator.FLOAT); + textY2.setValueValidator(BuValueValidator.FLOAT); + + boxSelectLineAuto_.setAction(new AbstractAction() { + public void actionPerformed(ActionEvent _e) { + boolean enabled = false; + textX1.setEnabled(enabled); + textX2.setEnabled(enabled); + textY1.setEnabled(enabled); + textY2.setEnabled(enabled); + boxSelectLineManu_.setSelected(false); + if (boxSelectLineAuto_.isSelected()) + ajouter.setEnabled(true); + else + ajouter.setEnabled(false); + } + + }); + boxSelectLineManu_.setAction(new AbstractAction() { + public void actionPerformed(ActionEvent _e) { + boolean enabled = true; + textX1.setEnabled(enabled); + textX2.setEnabled(enabled); + textY1.setEnabled(enabled); + textY2.setEnabled(enabled); + boxSelectLineAuto_.setSelected(false); + if (boxSelectLineManu_.isSelected()) + ajouter.setEnabled(true); + else + ajouter.setEnabled(false); + } + + }); + + // -- test si une ligne a ete au prealable selectionnee par l user sur le + // calque --// + if (calque_ != null && getSelectedLineOfCalque() != null) { + boxSelectLineAuto_.setSelected(true); + boolean enabled = false; + textX1.setEnabled(enabled); + textX2.setEnabled(enabled); + textY1.setEnabled(enabled); + textY2.setEnabled(enabled); + boxSelectLineManu_.setSelected(false); + + } else { + boxSelectLineAuto_.setSelected(false); + boxSelectLineManu_.setSelected(true); + // impossible de choisir cetet checkbox + boxSelectLineAuto_.setEnabled(false); + } + + return content; + } + + + private JPanel buildresults() { + JPanel content = new JPanel(new FlowLayout(FlowLayout.LEFT)); + + results_ = new JLabel(""); + content.add(ajouter); + content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); + content.add(results_); + + content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("R\xE9sultats"))); + return content; + } + + protected LineString getSelectedLineOfCalque() { + // pas de calque s\xE9lectionn\xE9 + if (!(calque_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { + return null; + } + return ((ZCalqueAffichageDonneesInterface) calque_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); + } + + private JPanel buildVariables() { + JPanel content = new JPanel(new BorderLayout()); + listVar_ = new JList(modelVariables_); + listVar_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + content.add(new JScrollPane(listVar_), BorderLayout.CENTER); + content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de la variable"))); + content.add(new JLabel(TrResource.getS("Veuillez s\xE9lectionner la variable sur laquelle appliquer le calcul")), + BorderLayout.NORTH); + return content; + } + + + /** + * Creation du panel graphique. + * + * @return + */ + public Box buildContent() { + + Box content = Box.createVerticalBox(); + + // -- panel des isolignes --// + if (panelIsolignes_ == null) + panelIsolignes_ = buildIsoLignes(); + content.add(panelIsolignes_); + + // -- panel des variables --// + if (panelVariables_ == null) + panelVariables_ = buildVariables(); + content.add(panelVariables_); + + // -- 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("Bilans"); + + } + +} 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-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -17,7 +17,6 @@ import javax.swing.JPanel; import org.fudaa.ctulu.CtuluCommandManager; -import org.fudaa.ctulu.CtuluResource; import org.fudaa.ctulu.CtuluUndoRedoInterface; import org.fudaa.ctulu.gui.CtuluFilleWithComponent; import org.fudaa.ctulu.image.CtuluImageProducer; @@ -39,7 +38,7 @@ import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; -import org.fudaa.fudaa.tr.common.TrImportCourbeScopeManager; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.netbeans.api.visual.widget.Widget; @@ -447,6 +446,7 @@ // -- etape 2: rechargement de la toolbar specifique dans this --// changeToolbar(node.getWidget().getController()); + changeToolbarSpecifiqueCalque(node.getWidget().getController(), (EbliWidgetCreatorVueCalque) node.getCreator()); setTitle(previousTitleFrame + " " + node.getWidget().getController().getDescription(), false); } else if (node.getCreator() instanceof EbliWidgetCreatorGraphe) { FuLog.debug("change tree GRAPHE"); @@ -565,11 +565,21 @@ // TrPostVisuPanel _calque = (TrPostVisuPanel) creator.getCalquepanelProvenance(); // TODO trop dangereux... // listeActions.add(new TrPostCourbeAddPointsAction(projet_.impl_, _graphe.getGraphe(), _calque)); + if (!(_graphe.getGraphe().getModel() instanceof MvProfileTreeModel)) listeActions.add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); + if (_graphe.getGraphe().getModel() instanceof MvProfileTreeModel) { + listeActions + .add(new TrPostBilanAction(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_.getImpl())); + } + //--ajout des actions import export format scope --// - listeActions.add(new FudaaCourbeImporter.ImportAction(new TrImportCourbeScopeManager(_graphe.getGraphe(), - projet_.impl_), projet_.impl_, creator.getGraphe().getCmd())); + + // FIXME comment recuperer les parametres H2DParameter + // TrCourbeTemporelleManager manager = new + // TrCourbeTemporelleManager(null); + // listeActions.add(new FudaaCourbeImporter.ImportAction(manager, + // projet_.impl_, creator.getGraphe().getCmd())); listeActions.add( new FudaaCourbeImporter.ExportAction(creator.getGraphe(), projet_.impl_)); _controller.addFonctionsSpecific(listeActions); @@ -579,7 +589,28 @@ // mise a jour des params this.revalidate(); } + + + private void changeToolbarSpecifiqueCalque(final EbliWidgetController _controller, + final EbliWidgetCreatorVueCalque creator) { + // -- change la toolbar avec els actions generiques du controller --// + changeToolbar(_controller); + + if (!_controller.fonctionsAlreadySpecified()) { + // -- ajout des actions tr --// + final ArrayList<EbliActionSimple> listeActions = new ArrayList<EbliActionSimple>(); + + listeActions.add(new TrPostBilanAction((TrPostVisuPanel) creator.getCalque(), projet_.getImpl())); + _controller.addFonctionsSpecific(listeActions); + + } + + // mise a jour des params + this.revalidate(); + } + + public void changeToolbarScene() { // nettoyage de la toolbar this.remove(toolBarModifiable_); 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-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -77,7 +77,6 @@ import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuTable; import com.memoire.bu.BuVerticalLayout; -import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; /** @@ -597,8 +596,25 @@ menubar.add(menuPost_, 2); + + + + menuPost_.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 + .getIcon("crystal_ajouter"), new ActionListener() { + + public void actionPerformed(final ActionEvent _e) { + createNewLayoutFrame(); + + } + }); + + menuPost_.addSeparator(TrResource.getS("Gestion")); // -- ajout de l action de gestion des simus dans post --// - final BuMenuItem item = new BuMenuItem("Gestion Multi-projets"); + final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); item.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { @@ -614,22 +630,8 @@ } }); - menuPost_.add(item); - menuPost_.addSeparator(TrResource.getS("Vue 2D")); - // -- 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 - .getIcon("crystal_ajouter"), new ActionListener() { - - public void actionPerformed(final ActionEvent _e) { - createNewLayoutFrame(); - - } - }); - - menuPost_.addSeparator("Liste des projets"); + menuPost_.addSeparator("Liste des Fichiers r\xE9sultats"); // -- init de la liste des menus --// listeMenuProjets_ = new ArrayList<BuMenu>(); @@ -839,7 +841,10 @@ * @param calque */ private void addEbliNode(final EGFillePanel pn, final TrPostVisuPanel calque) { + if (calque != null) addGrapheNodeInCurrentScene(pn, formatInfoSource(calque.getSource())); + else + addGrapheNodeInCurrentScene(pn, "profil spatial"); } public void addGrapheNodeInCurrentScene(final EGFillePanel _pn, final String _desc) { Modified: 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/TrPostProjetsManagerFille.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -173,7 +173,7 @@ // --creation graphique --// // setSize(500, 250); // setPreferredSize(new Dimension(500, 250)); - setTitle(TrResource.getS("Gestion multi-projets")); + setTitle(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); setLayout(new BorderLayout()); // Box centrePanel = Box.createHorizontalBox(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-09-29 10:28:03
|
Revision: 4005 http://fudaa.svn.sourceforge.net/fudaa/?rev=4005&view=rev Author: bmarchan Date: 2008-09-29 10:28:00 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Modif doc. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeModel.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeModel.java 2008-09-29 10:26:02 UTC (rev 4004) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeModel.java 2008-09-29 10:28:00 UTC (rev 4005) @@ -41,11 +41,11 @@ GISAttributeModel createSubModel(int[] _idxToRemove); /** - * Envoie une exception si le nombre d'objet nouveau est strictement inf\xE9rieur. - * @param _numObject le nombre d'objet a rajouter + * Cr\xE9e un modele augment\xE9. Les anciennes valeurs sont conserv\xE9es, les nouvelles sont par d\xE9faut. + * @param _numObject le nombre d'objets du nouveau modele. * @param _newIdxOldIdx le tableau indice nouveau->indice ancien - * @return le model cre\xE9e - * + * @return le modele augment\xE9. + * @exception IllegalArgumentException Si le nombre d'objet du nouveau modele est inf\xE9rieur \xE0 l'ancien. */ GISAttributeModel createUpperModel(int _numObject,TIntIntHashMap _newIdxOldIdx); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-09-29 10:26:10
|
Revision: 4004 http://fudaa.svn.sourceforge.net/fudaa/?rev=4004&view=rev Author: bmarchan Date: 2008-09-29 10:26:02 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Chgt version Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlImplementation.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlImplementation.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlImplementation.java 2008-09-29 10:25:19 UTC (rev 4003) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlImplementation.java 2008-09-29 10:26:02 UTC (rev 4004) @@ -86,8 +86,8 @@ protected static BuInformationsSoftware isMdl_ = new BuInformationsSoftware(); static { isMdl_.name = "Modeleur"; - isMdl_.version = "0.05"; - isMdl_.date = "2008-07-17"; + isMdl_.version = "0.06"; + isMdl_.date = "2008-09-29"; isMdl_.rights = "Tous droits r\xE9serv\xE9s. CETMEF (c)1999-2008"; isMdl_.license = "GPL2"; isMdl_.languages = "fr,en"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-09-29 10:25:26
|
Revision: 4003 http://fudaa.svn.sourceforge.net/fudaa/?rev=4003&view=rev Author: bmarchan Date: 2008-09-29 10:25:19 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Suppression/ajout d'un point sur gros multipoint r?\195?\169vis?\195?\169. Modified Paths: -------------- 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/ZCalqueMultiPointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 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-09-29 08:47:46 UTC (rev 4002) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java 2008-09-29 10:25:19 UTC (rev 4003) @@ -8,6 +8,7 @@ package org.fudaa.ctulu.gis; import gnu.trove.TIntArrayList; +import gnu.trove.TIntIntHashMap; import java.util.Arrays; @@ -191,25 +192,46 @@ return true; } - 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; + TIntIntHashMap newIdxOldIdx=new TIntIntHashMap(initSize); + final Coordinate[] cs = new Coordinate[initSize + 1]; int idx = 0; for (int i = 0; i < initSize; i++) { + newIdxOldIdx.put(idx,i); // Pour les attributs cs[idx++] = (Coordinate)oldcs[i].clone(); if (i == _idxBefore) { cs[idx++] = new Coordinate(_x, _y, oldcs[i].z); } } + // setGeometry(_ligneIdx,geom, _cmd); + CtuluCommandComposite cmp=new CtuluCommandComposite(); geom = GISGeometryFactory.INSTANCE.createMultiPoint(cs); - setGeometry(_ligneIdx,geom, _cmd); + super.geometry_.setObject(_idxGeom, geom, cmp); + + 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.createUpperModel(initSize+1, newIdxOldIdx), cmp); + } + } + + if (_cmd!=null) { + _cmd.addCmd(cmp.getSimplify()); + } } /** @@ -446,7 +468,8 @@ } if (r) { - super.geometry_.setObject(_idxGeom, newGeom, _cmd); + 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(); @@ -459,10 +482,13 @@ // 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/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java 2008-09-29 08:47:46 UTC (rev 4002) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java 2008-09-29 10:25:19 UTC (rev 4003) @@ -53,11 +53,11 @@ return editor_ == null ? EbliLib.getS("Edition impossible") : editor_.edit(this); } - /** - * Scinde en 2 une polyligne de sommet s\xE9lectionn\xE9. Les attributs sont copi\xE9s. - * @param _cmd La pile de commandes. - * @return true si le la polyligne a \xE9t\xE9 scind\xE9e. - */ +// /** +// * Scinde en 2 une polyligne de sommet s\xE9lectionn\xE9. Les attributs sont copi\xE9s. +// * @param _cmd La pile de commandes. +// * @return true si le la polyligne a \xE9t\xE9 scind\xE9e. +// */ // public boolean splitGeometry(final CtuluCommandContainer _cmd) { // if (isSelectionEmpty() || !isAtomicMode()) return false; // @@ -67,12 +67,12 @@ // return getModelePoly().splitGeometry(idxLine, idxSel, _cmd); // } - /** - * Joint 2 polylignes par leurs sommets d\xE9sign\xE9s. - * - * @param _cmd La pile de commandes. - * @return true si les polylignes ont \xE9t\xE9 jointes. - */ +// /** +// * Joint 2 polylignes par leurs sommets d\xE9sign\xE9s. +// * +// * @param _cmd La pile de commandes. +// * @return true si les polylignes ont \xE9t\xE9 jointes. +// */ // public boolean joinGeometries(final CtuluCommandContainer _cmd) { // if (isSelectionEmpty() || !isAtomicMode()) return false; // 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-09-29 08:47:46 UTC (rev 4002) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2008-09-29 10:25:19 UTC (rev 4003) @@ -403,7 +403,8 @@ } /** - * Ajoute un sommet X,Y \xE0 la g\xE9om\xE9trie donn\xE9e. Les valeurs des attributs sont interpol\xE9es \xE9ventuellement. + * Ajoute un sommet X,Y \xE0 la g\xE9om\xE9trie donn\xE9e.<p> + * <b>ATTENTION</b> : Les valeurs des attributs pour ce sommet sont d\xE9finies par d\xE9faut. * @param _idxGeom La g\xE9om\xE9trie modifi\xE9e. * @param _idxBefore Le sommet qui sera le pr\xE9cedent de celui ajout\xE9. * @param _x La coordonn\xE9e X du point. @@ -851,4 +852,8 @@ public boolean isGeometryReliee(int _idxGeom) { return false; } + + public final boolean isGeometryVisible(final int _idxLigne) { + return true; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |