|
From: <had...@us...> - 2009-01-22 22:22:01
|
Revision: 4394
http://fudaa.svn.sourceforge.net/fudaa/?rev=4394&view=rev
Author: hadouxad
Date: 2009-01-22 21:40:12 +0000 (Thu, 22 Jan 2009)
Log Message:
-----------
LOT 3: 3 fois plus fort!!
Modified Paths:
--------------
branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/mesure/EvolutionReguliere.java
branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.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/EGGrapheTreeModel.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/ScopeCourbeModel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardImportScope.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java
Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/mesure/EvolutionReguliere.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/mesure/EvolutionReguliere.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/mesure/EvolutionReguliere.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -38,6 +38,11 @@
private boolean nuagePoints_=false;
/**
+ * Indique si il faut transformer l'\xE9volution r\xE9guli\xE8re au format scope.
+ */
+ public boolean isScope_=false;
+
+ /**
* Infos supplementaires ajoutees aux courbes afin de transferer des infos specifiques.
*/
public Map infos_=new HashMap();
Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -199,7 +199,7 @@
evolReg[i] = new EvolutionReguliere(tabX, tabY, false);
evolReg[i].setNom("courbe de " + nomVar.replace(" ", ""));
-
+ evolReg[i].isScope_=true;
//-- ajout des infos specifiques --//
Map infos= evolReg[i].infos_;
infos.put("Type", "Profil scop");
@@ -535,7 +535,7 @@
evolReg[i] = new EvolutionReguliere(tabX, tabY, false);
evolReg[i].setNom("courbe de " + nomVar.replace(" ", ""));
evolReg[i].setUnite(nomVar);
-
+ evolReg[i].isScope_=true;
//-- ajout des infos specifiques --//
// Map infos= evolReg[i].infos_;
// infos.put("Type", "Profil spatial scopGene");
@@ -635,8 +635,8 @@
evolReg[i] = new EvolutionReguliere(tabX, tabY, false);
evolReg[i].setNom(nomVar.replace(" ", "")+" sur ["+getSeparator(0).replace(" ", "")+";"+getSeparator(getNbSeparator()-1).replace(" ", "")+"] pour X choisi="+xVoulu);
evolReg[i].setUnite(nomVar);
+ evolReg[i].isScope_=true;
-
//-- ajout des infos specifiques --//
Map infos= evolReg[i].infos_;
infos.put("Type", "Profil temporel scopGene");
@@ -674,7 +674,7 @@
evolReg[0] = new EvolutionReguliere(tabX, tabY, false);
evolReg[0].setNom("Correlation:(X="+getVariable(varX+1).replace(" ", "")+"//Y="+getVariable(varY+1).replace(" ", "")+")");
evolReg[0].setUnite(getVariable(varX+1));
-
+ evolReg[0].isScope_=true;
//-- ajout des infos specifiques --//
Map infos= evolReg[0].infos_;
infos.put("Type", "Correlation scopGene");
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -1,21 +1,29 @@
package org.fudaa.ebli.calque;
import java.awt.BorderLayout;
+import java.awt.Dimension;
import java.awt.Frame;
+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 java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
+import javax.swing.ButtonGroup;
import javax.swing.Icon;
import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
+import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import org.fudaa.ctulu.gui.CtuluLibSwing;
@@ -30,6 +38,7 @@
import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode;
import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
+import com.memoire.bu.BuComboBox;
import com.memoire.fu.FuLog;
/**
@@ -77,7 +86,9 @@
// getController().getPaletteInfo().getTableModel());
//-- init des datas --//
- listInfoData_.add(new DataSonde());
+ DataSonde data=new DataSonde();
+ si.fillWithInfo(data);
+ listInfoData_.add(data);
// -- enregistrement aupres de la sonde du manager comme listener --//
si.addZCalqueSondeListener(this);
@@ -99,8 +110,8 @@
*/
public void notifySondeMoved(ZCalqueSondeInteraction _activator, GrPoint _e) {
- if (structureModel_ == null)
- structureModel_ = constructStructureModel();
+// if (structureModel_ == null)
+// structureModel_ = constructStructureModel();
for (int i=0;i<listeSondeInteractions_.size();i++) {
@@ -115,8 +126,9 @@
// -- on replace la sonde des autres calques --//
ZCalqueSondeInterface objet = sondeInteraction.getTarget();
objet.setSondeEnable(true);
+
objet.changeSonde(pt);
-
+
//--remplissage des infos specifiques a la sonde --//
ZCalquePoint isoLayer = listeWidgetCalque_.get(i).getCalqueController().getVisuPanel().getIsoLayer();
isoLayer.fillWithInterpolateInfo(listInfoData_.get(i));
@@ -126,13 +138,36 @@
}
}
+
+ fillAllVariables();
+
buildDialog();
- // structureModel_ = constructStructureModel();
- // treeTableNodes_.setTreeTableModel(structureModel_);
- // treeTableNodes_.expandAll();
+ structureModel_ = constructStructureModel();
+ treeTableNodes_.setTreeTableModel(structureModel_);
+ treeTableNodes_.expandAll();
structureModel_.reload();
}
+
+BuComboBox comboChoixVar_=new BuComboBox();
+ArrayList<String> listeVar_=new ArrayList<String>();
+final static String ALLVAR=EbliResource.EBLI.getString("tout");
+/**
+ * Remplit la combo avec toutes les variables.
+ */
+private void fillAllVariables(){
+ HashSet<String> listeVar=new HashSet<String>();
+ for(DataSonde sonde:listInfoData_)
+ for(String key:sonde.mapValueSonde.keySet())
+ if(!key.equals("X") && !key.equals("Y") && !key.equals("El\xE9ment englobant") )
+ listeVar.add(key);
+ listeVar_=new ArrayList<String>();
+ listeVar_.add(ALLVAR);
+ listeVar_.addAll(listeVar);
+
+}
+
+
JDialog dialog_;
public void buildDialog() {
if (dialog_ != null) {
@@ -164,10 +199,28 @@
dialog_.setTitle(getTitle());
JPanel container=new JPanel(new BorderLayout());
container.add(buildComponent(), BorderLayout.CENTER);
- container
- .add(new JLabel("<html> <body><b><center>" + getTitle() + "</center></b> </body></html>"),
- BorderLayout.NORTH);
- dialog_.setContentPane(container);
+
+ comboChoixVar_=new BuComboBox(listeVar_.toArray(new String[listeVar_.size()]));
+ comboChoixVar_.setMinimumSize(new Dimension(150,(int) comboChoixVar_.getSize().getHeight()));
+ comboChoixVar_.addActionListener(new ActionListener(){
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ filtreVariables();
+
+ }
+
+ });
+ JPanel panelRadio=new JPanel();
+ panelRadio.add(new JLabel("Variable:"));
+ panelRadio.add(comboChoixVar_);
+
+ container.add(panelRadio,BorderLayout.NORTH);
+
+ JPanel content=new JPanel(new BorderLayout());
+ content.add(container,BorderLayout.CENTER);
+ //content.add(new JLabel("<html> <body><b><center>" + getTitle() + "</center></b> </body></html>"),BorderLayout.NORTH);
+ dialog_.setContentPane(content);
dialog_.setSize(400, 250);
dialog_.setLocationRelativeTo(CtuluLibSwing.getFrameAncestor(ui.getParentComponent()));
dialog_.setVisible(true);
@@ -244,13 +297,13 @@
listOrdonneetitres_.add("X");
listOrdonneetitres_.add("Y");
listOrdonneetitres_.add("El\xE9ment englobant");
- listOrdonneetitres_.add("Bathym\xE9trie");
- listOrdonneetitres_.add("Cote eau");
- listOrdonneetitres_.add("Hauteur d'eau");
- listOrdonneetitres_.add("Nombre de Froude");
- listOrdonneetitres_.add("Vitesse");
- listOrdonneetitres_.add("Vitesse u");
- listOrdonneetitres_.add("Vitesse v");
+// listOrdonneetitres_.add("Bathym\xE9trie");
+// listOrdonneetitres_.add("Cote eau");
+// listOrdonneetitres_.add("Hauteur d'eau");
+// listOrdonneetitres_.add("Nombre de Froude");
+// listOrdonneetitres_.add("Vitesse");
+// listOrdonneetitres_.add("Vitesse u");
+// listOrdonneetitres_.add("Vitesse v");
for (String key : listOrdonneetitres_) {
mapValueSonde.put(key, valueEmpty);
@@ -268,8 +321,8 @@
public void put(String _key, String _value) {
mapValueSonde.put(_key, _value);
- if (!listOrdonneetitres_.contains(_key))
- listOrdonneetitres_.add(_key);
+// if (!listOrdonneetitres_.contains(_key))
+// listOrdonneetitres_.add(_key);
}
public void setTitle(String _title) {
@@ -373,31 +426,47 @@
}
+
+ /**
+ * Remplit les infos de la structure avec les infos des sondes.
+ * @param indice
+ * @param treenode
+ * @param data_
+ */
public void fillWithInfos(int indice, DefaultMutableTreeTableNode treenode, DataSonde data_) {
-
- // on enleve les children
- // Enumeration<? extends MutableTreeTableNode> children =
- // treenode.children();
- // ArrayList<MutableTreeTableNode> listChildren = new
- // ArrayList<MutableTreeTableNode>();
- // while (children.hasMoreElements()) {
- // MutableTreeTableNode node = children.nextElement();
- // listChildren.add(node);
- //
- // }
- // for (MutableTreeTableNode node : listChildren) {
- // node.removeFromParent();
- // }
- // -- on ajoute les nouveaux
- for (Iterator<String> it = data_.listOrdonneetitres_.iterator(); it.hasNext();) {
+ treenode.add(new DefaultMutableTreeTableNode(new SondeCouple("X", indice)));
+ treenode.add(new DefaultMutableTreeTableNode(new SondeCouple("Y", indice)));
+ treenode.add(new DefaultMutableTreeTableNode(new SondeCouple("El\xE9ment englobant", indice)));
+
+ if(comboChoixVar_!=null && comboChoixVar_.getSelectedIndex()==0){
+ for (Iterator<String> it = data_.mapValueSonde.keySet().iterator(); it.hasNext();) {
String key = it.next();
- Object value = data_.mapValueSonde.get(key);
- DefaultMutableTreeTableNode node = new DefaultMutableTreeTableNode(
- new SondeCouple(key, indice));
+ // Object value = data_.mapValueSonde.get(key);
+ if(!key.equals("X") && !key.equals("Y") && !key.equals("El\xE9ment englobant") ){
+ DefaultMutableTreeTableNode node = new DefaultMutableTreeTableNode(new SondeCouple(key, indice));
treenode.add(node);
+ }
}
+ }else{
+ //-- ajout juste du noeud correspondant au sorter --//
+ String value=(String) comboChoixVar_.getSelectedItem();
+ treenode.add(new DefaultMutableTreeTableNode(new SondeCouple(value, indice)));
+ }
+
}
+
+ /**
+ * Est appel\xE9 lors d'un choix de la combo.
+ * Affiche uniquement les variables voulues.
+ * C'est dans la methode fillWithInfos que l'on va prendre en compte le filtre de la variable.
+ */
+ public void filtreVariables(){
+ structureModel_ = constructStructureModel();
+ treeTableNodes_.setTreeTableModel(structureModel_);
+ treeTableNodes_.expandAll();
+ structureModel_.reload();
+ }
}
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 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -9,6 +9,7 @@
import java.awt.Cursor;
import java.awt.event.ActionEvent;
+import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -209,7 +210,7 @@
}
};
restore.putValue(Action.SHORT_DESCRIPTION, EbliResource.EBLI.getString("Restaurer la vue globale"));
- restore.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke('r'));
+ restore.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke('V',InputEvent.CTRL_DOWN_MASK));
restore.putValue(EbliActionInterface.SECOND_KEYSTROKE, KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0));
int i = 0;
navigationActionGroup_[i++] = restore;
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -320,6 +320,18 @@
}
+ public List<EGCourbeChild> getAllCourbesChild() {
+ final List r = new ArrayList();
+ final int nb = components_.size();
+ for (int i = 0; i < nb; i++) {
+ getGroup(i).fillWithCurves(r);
+ }
+
+ return r;
+
+ }
+
+
public int getIconHeight() {
return 24;
}
@@ -882,6 +894,10 @@
public EGCourbe[] getCourbes() {
return getGrapheTreeNode().getCourbes();
}
+
+ public List<EGCourbeChild> getAllCourbesChild() {
+ return getGrapheTreeNode().getAllCourbesChild();
+ }
public EGObject getEGObject(final int _i) {
return (EGObject) root.getChildAt(_i);
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -24,6 +24,7 @@
import javax.swing.ListSelectionModel;
import javax.swing.filechooser.FileFilter;
+import org.fudaa.ctulu.CtuluCommandManager;
import org.fudaa.ctulu.CtuluIOOperationSynthese;
import org.fudaa.ctulu.CtuluLib;
import org.fudaa.ctulu.CtuluLibArray;
@@ -40,7 +41,9 @@
import org.fudaa.dodico.telemac.io.ScopeStructure;
import org.fudaa.dodico.telemac.io.ScopeTFileFormat;
import org.fudaa.ebli.commun.EbliActionSimple;
+import org.fudaa.ebli.courbe.EGCourbeChild;
import org.fudaa.ebli.courbe.EGGraphe;
+import org.fudaa.ebli.courbe.EGGrapheTreeModel;
import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation;
@@ -58,6 +61,7 @@
import com.memoire.bu.BuValueValidator;
import com.memoire.bu.BuWizardDialog;
import com.memoire.bu.BuWizardTask;
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.List;
/**
* Wizard qui se charge d'importer des courbes au format scope dans le post.
@@ -116,14 +120,54 @@
}
}
+ /**
+ * Boolean qui implique si on rejoue et dans ce cas si on ecrase les datas.
+ */
+ boolean replayData_=false;
public FudaaCourbeWizardImportScope(FudaaCommonImplementation impl,FudaaCourbeImporter.Target target) {
+ this(impl,target,false,null);
+
+
+ }
+
+ public FudaaCourbeWizardImportScope(FudaaCommonImplementation impl,FudaaCourbeImporter.Target target,boolean replayData,File fileToReload) {
super();
target_=target;
impl_=impl;
+ replayData_=replayData;
+ fileChoosen_=fileToReload;
+
+ //-- on avance \xE0 l'\xE9tape 2 directement --//
+ if(replayData_ && fileChoosen_!=null){
+ panelFichier_=buildFilePanel();
+ this.filePath_.setText(""+fileChoosen_.getAbsolutePath());
+ typeFormat_=devineTypeWithExtension(fileChoosen_.getName());
+ computeData(impl.getMainProgression());
+ current_=1;
+ }
+
}
+ public int devineTypeWithExtension(String name){
+
+ for(int i=0;i<ScopeSFileFormat.getInstance().getExtensions().length;i++)
+ if(name.contains(ScopeSFileFormat.getInstance().getExtensions()[i]) || name.contains(ScopeSFileFormat.getInstance().getExtensions()[i].toLowerCase()))
+ return 0;
+ for(int i=0;i<ScopeTFileFormat.getInstance().getExtensions().length;i++)
+ if(name.contains(ScopeSFileFormat.getInstance().getExtensions()[i])|| name.contains(ScopeSFileFormat.getInstance().getExtensions()[i].toLowerCase()))
+ return 1;
+ for(int i=0;i<ScopeGENEFileFormat.getInstance().getExtensions().length;i++){
+ String ext=ScopeGENEFileFormat.getInstance().getExtensions()[i];
+ if(name.contains(ScopeGENEFileFormat.getInstance().getExtensions()[i])|| name.contains(ScopeGENEFileFormat.getInstance().getExtensions()[i].toLowerCase()))
+ return 2;
+ }
+ return -1;
+
+
+ }
+
@Override
public JComponent getStepComponent() {
switch (current_) {
@@ -265,8 +309,20 @@
private void importData(){
new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Importation graphe")) {
public void act() {
- final ProgressionInterface prog = getMainStateReceiver();
-
+
+ computeData(getMainStateReceiver());
+
+
+ }}.start();
+
+ }
+
+ /**
+ * Methode qui realise le calcul de la structure.
+ * @param prog
+ */
+ private void computeData(ProgressionInterface prog){
+
switch(typeFormat_){
case 0:
//cas s
@@ -281,9 +337,6 @@
data_=lectureScopeGENE(fileChoosen_,prog);
break;
}
-
- }}.start();
-
}
private ScopeStructure.SorT lectureScopeS(final File _f,ProgressionInterface prog) {
@@ -384,7 +437,7 @@
}
EvolutionReguliere evol=new EvolutionReguliere(tabX, tabY,_time);
evol.setNom(nomVar+" "+nomSeparator);
-
+ evol.isScope_=true;
//-- ajout des infos specifiques --//
Map infos= evol.infos_;
infos.put("Type", "Profil spatial scopGene");
@@ -663,6 +716,20 @@
done_ = true;
new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Importation graphe")) {
public void act() {
+
+ /**
+ * Cas de rejoue des donn\xE9es, on supprime le contenu du graphe
+ */
+ if(replayData_){
+ if(target_ instanceof EGGrapheTreeModel){
+ java.util.List<EGCourbeChild> listecb=((EGGrapheTreeModel)target_).getAllCourbesChild();
+
+ ((EGGrapheTreeModel)target_).removeCurves( listecb.toArray(new EGCourbeChild[listecb.size()]), new CtuluCommandManager());
+
+ }
+ }
+
+
final ProgressionInterface prog = getMainStateReceiver();
//mise a jour de la structure
impl_.setMainProgression(10);
@@ -682,7 +749,7 @@
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,false);
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -12,7 +12,11 @@
import org.fudaa.ebli.palette.BPaletteInfo.InfoData;
import org.fudaa.ebli.visuallibrary.EbliWidget;
import org.fudaa.fudaa.tr.common.TrResource;
+import org.fudaa.fudaa.tr.post.ScopCourbeTreeModel;
+import org.fudaa.fudaa.tr.post.TrPostCommonImplementation;
+import org.fudaa.fudaa.tr.post.TrPostCourbeTreeModel;
import org.fudaa.fudaa.tr.post.TrPostSource;
+import org.fudaa.fudaa.tr.post.TrReplayCurvesData;
import com.vividsolutions.jts.geom.LineString;
@@ -106,4 +110,19 @@
impl.message("Origine de la courbe scop", "Impossible de trouver", false);
}
}
+
+
+ public void replayData(org.fudaa.ebli.courbe.EGGrapheTreeModel model,Map infos, CtuluUI impl) {
+ if(!(impl instanceof TrPostCommonImplementation)){
+ impl.error(TrResource.getS("Impossible de r\xE9cup\xE9rer la bonne interface fudaa"));
+ return;
+ }
+ TrPostCommonImplementation implementation=(TrPostCommonImplementation)impl;
+
+ //-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --//
+ TrReplayCurvesData.getInstance().getScopGeneReplayData(model, this, implementation);
+
+
+ }
+
}
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -432,9 +432,12 @@
return;
}
TrPostCommonImplementation implementation=(TrPostCommonImplementation)impl;
-
+ if(!(this.getData() instanceof TrPostSource)){
+ implementation.error("Impossible de r\xE9cup\xE9rer le fichier r\xE9sulat depuis ce type de profil spatial.");
+ return;
+ }
//-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --//
- TrReplayCurvesData.getInstance().getProfilSpatialReplayData((MvProfileTreeModel)model, this, implementation);
+ TrReplayCurvesData.getInstance().getProfilSpatialReplayData((TrPostSource) this.getData(),(MvProfileTreeModel)model, this, implementation);
}
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -14,6 +14,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -55,6 +56,7 @@
import org.fudaa.ebli.courbe.EGGrapheModel;
import org.fudaa.ebli.courbe.EGGrapheTreeModel;
import org.fudaa.ebli.courbe.EGGroup;
+import org.fudaa.ebli.courbe.EGModel;
import org.fudaa.ebli.courbe.EGObject;
import org.fudaa.ebli.visuallibrary.EbliWidget;
import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel;
@@ -804,7 +806,15 @@
final EGGroup gr = getGroup(H2dVariableType.SANS, true);
final List<EGCourbeChild> childs = new ArrayList<EGCourbeChild>(_crb.length);
for (int i = 0; i < _crb.length; i++) {
- final EGCourbeChild child = new EGCourbeChild(gr, new FudaaCourbeModel(new EvolutionReguliere(_crb[i])));
+
+ EGModel modelCourbe=null;
+ if((_crb[i] instanceof EvolutionReguliere) && ((EvolutionReguliere)_crb[i]).isScope_){
+ modelCourbe=new ScopeCourbeModel((EvolutionReguliere) _crb[i]);
+ }else
+ modelCourbe=new FudaaCourbeModel(new EvolutionReguliere(_crb[i]));
+
+ final EGCourbeChild child = new EGCourbeChild(gr, modelCourbe);
+
//-- on met a jour si la courbe est un nuage de points ou non --//
child.setNuagePoints_(_crb[i].isNuagePoints());
@@ -824,7 +834,7 @@
public void finalizePersistance(){
//-- recupere les groupes de la persistance qui doivent etre supprim\xE9 car ne sont pas des liens directs avec les variables H2dVariableType du projet--//
- ArrayList<EGGroup> listeGroupeAsupprimer=new ArrayList<EGGroup>();
+ Set<EGGroup> listeGroupeAsupprimer=new HashSet<EGGroup>();
for(int i=0;i<this.getNbEGObject();i++){
@@ -847,13 +857,18 @@
listeCourbeToAdd.add(courbe);
+ //-- ajout du groupe dans la liste a supprimer --//
+ listeGroupeAsupprimer.add(groupe);
- }else{
+ }else if(courbe.getModel()!=null && (courbe.getModel() instanceof ScopeCourbeModel)){
//-- on cree le groupe sans car la courbe n'est pas profil spatioal, elel peut etre socpgen--//
nvGroupe=getGroup(H2dVariableType.SANS,true);
//nvGroupe.addEGComponent(courbe);
//listeVar.put(groupe, MvProfileFillePanel.createGroupFor(H2dVariableType.SANS));
listeCourbeToAdd.add(courbe);
+
+ //-- ajout du groupe dans la liste a supprimer --//
+ listeGroupeAsupprimer.add(groupe);
}
}
@@ -864,8 +879,7 @@
if(nvGroupe!=null)
nvGroupe.addEGComponent(listeCourbeToAdd);
- //-- ajout du groupe dans la liste a supprimer --//
- listeGroupeAsupprimer.add(groupe);
+
}
}
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -105,11 +105,28 @@
}
+ public void finalizePersistance(){
+ for(int i=0;i<this.getNbEGObject();i++){
+
+ if(this.getEGObject(i) instanceof EGGroup){
+
+ EGGroup groupe=(EGGroup) this.getEGObject(i);
+ for(int k=0;k<groupe.getChildCount();k++){
+ if(groupe.getCourbeAt(k)!=null){
+ EGCourbeChild courbe=groupe.getCourbeAt(k);
+ if(courbe.getModel()!=null && (courbe.getModel() instanceof ScopeCourbeModel)){
+
+ varGroup_.put(H2dVariableType.SANS, groupe);
+ }
+ }
+ }
+ }
+ }
+ }
+
// public EGCourbe[] getCourbes() {
-//
// List<EGCourbe> liste=new ArrayList<EGCourbe>();
-//
// for(int i=0;i<this.getNbEGObject();i++){
// if(this.getEGObject(i) instanceof EGCourbe){
// liste.add((EGCourbe) this.getEGObject(i));
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -534,7 +534,7 @@
TrPostCommonImplementation implementation=(TrPostCommonImplementation)impl;
//-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --//
- TrReplayCurvesData.getInstance().getEvolTemporelleReplayData((TrPostCourbeTreeModel)model, this, implementation);
+ TrReplayCurvesData.getInstance().getEvolTemporelleReplayData(this.source_,(TrPostCourbeTreeModel)model, this, implementation);
}
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -836,7 +836,14 @@
final EGGroup gr = getGroupFor(H2dVariableType.SANS);
final List<EGCourbeChild> childs = new ArrayList<EGCourbeChild>(_crb.length);
for (int i = 0; i < _crb.length; i++) {
- final EGCourbeChild child = new EGCourbeChild(gr, new FudaaCourbeModel(new EvolutionReguliere(_crb[i])));
+
+ EGModel modelCourbe=null;
+ if((_crb[i] instanceof EvolutionReguliere) && ((EvolutionReguliere)_crb[i]).isScope_){
+ modelCourbe=new ScopeCourbeModel((EvolutionReguliere) _crb[i]);
+ }else
+ modelCourbe=new FudaaCourbeModel(new EvolutionReguliere(_crb[i]));
+
+ final EGCourbeChild child = new EGCourbeChild(gr, modelCourbe);
childs.add(child);
//-- on met a jour si la courbe est un nuage de points ou non --//
@@ -1140,6 +1147,8 @@
if(courbe.getModel()!=null && (courbe.getModel() instanceof TrPostCourbeModel)){
TrPostCourbeModel model=(TrPostCourbeModel) courbe.getModel();
varGroup_.put(model.var_, groupe);
+ }else if(courbe.getModel()!=null ){
+ varGroup_.put(H2dVariableType.SANS, groupe);
}
}
}
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -44,6 +44,7 @@
import org.fudaa.ebli.commun.EbliActionPaletteAbstract;
import org.fudaa.ebli.commun.EbliActionSimple;
import org.fudaa.ebli.commun.EbliLib;
+import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.ebli.visuallibrary.EbliScene;
import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter;
import org.fudaa.fudaa.meshviewer.MvSelectionNodeOrEltData;
@@ -80,7 +81,7 @@
boolean rubar_;
protected EvolutionAction(final boolean _rubar) {
- super(TrResource.getS("Afficher les \xE9volutions"), null, "DISPLAY_EVOLS");
+ super(TrResource.getS("Afficher les \xE9volutions"), EbliResource.EBLI.getIcon("curves"), "DISPLAY_EVOLS");
rubar_ = _rubar;
if (rubar_) {
setDefaultToolTip(TrResource.getS("Affiche les \xE9volutions temporelles sur l'\xE9l\xE9ment s\xE9lectionn\xE9"));
@@ -174,7 +175,7 @@
final boolean _simplified, final BCalqueLegende _leg, final TrPostSource _src) {
super(new TrPostActionController(_impl), _impl);
- // -- mise a jour de l indice de ls source courante --//
+ // -- mise a jour de l indice de la source courante --//
source_ = _src;
projet_ = _controller;
info_ = new TrPostInfoDelegate(source_, getEbliFormatter());
@@ -470,7 +471,7 @@
// _l.add(new MvProfileAction(getProjet(), getImpl(), this));
_l.add(new TrPostProfileAction(this));
-
+ _l.add(new EvolutionAction(getSource().isRubar()));
_l.add(new TrPostVolumeAction(source_, this));
createAnimAction();
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -4,10 +4,16 @@
import java.awt.Checkbox;
import java.awt.Color;
import java.awt.Component;
+import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
+import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeListener;
+import java.io.File;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.Collection;
@@ -17,7 +23,9 @@
import java.util.Set;
import java.util.Vector;
+import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
+import javax.swing.Action;
import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JLabel;
@@ -43,34 +51,44 @@
import org.fudaa.ebli.calque.ZCalqueSondeInteraction;
import org.fudaa.ebli.calque.action.CalqueActionSonde;
import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser;
+import org.fudaa.ebli.calque.edition.BPaletteEdition;
+import org.fudaa.ebli.calque.edition.ZCalqueLigneBriseeEditable;
+import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable;
import org.fudaa.ebli.calque.edition.ZModelePointEditable;
import org.fudaa.ebli.commun.EbliActionInterface;
import org.fudaa.ebli.commun.EbliActionPaletteAbstract;
import org.fudaa.ebli.commun.EbliComponentFactory;
import org.fudaa.ebli.controle.BSelecteurListComboBox;
+import org.fudaa.ebli.courbe.EGGrapheTreeModel;
import org.fudaa.ebli.courbe.EGModel;
import org.fudaa.ebli.palette.BPaletteInfo;
import org.fudaa.ebli.trace.TraceIcon;
import org.fudaa.ebli.trace.TraceIconModel;
import org.fudaa.ebli.trace.TraceLigneModel;
import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter;
+import org.fudaa.fudaa.commun.courbe.ScopeCourbeModel;
+import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target;
import org.fudaa.fudaa.meshviewer.profile.MVProfileCourbeModel;
import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel;
import org.fudaa.fudaa.sig.layer.FSigEditor;
import org.fudaa.fudaa.sig.layer.FSigLayerGroup;
+import org.fudaa.fudaa.sig.layer.FSigLayerLineEditable;
import org.fudaa.fudaa.sig.layer.FSigLayerPointEditable;
import org.fudaa.fudaa.tr.common.TrResource;
import org.fudaa.fudaa.tr.data.TrGisProjectEditor;
+import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardImportScope;
import org.openide.util.actions.Presenter.Toolbar;
import com.memoire.bu.BuBorderLayout;
import com.memoire.bu.BuBorders;
+import com.memoire.bu.BuButton;
import com.memoire.bu.BuLabel;
import com.memoire.bu.BuList;
import com.memoire.bu.BuPanel;
import com.memoire.bu.BuRadioButton;
import com.memoire.bu.BuScrollPane;
import com.memoire.bu.BuToolBar;
+import com.memoire.bu.BuWizardDialog;
import com.memoire.fu.FuComparator;
import com.sun.corba.se.impl.ior.NewObjectKeyTemplateBase;
import com.vividsolutions.jts.geom.Coordinate;
@@ -92,6 +110,9 @@
*/
private static TrReplayCurvesData instance_;
+
+ private BuButton rejouerSrc_=null;
+
/**
* Vue 2d gardee en memoire si on fait plusieurs appels cons\xE9cutifs \xE0 des courbes qui ont le meme fichier source.
*/
@@ -239,9 +260,10 @@
pn.add(composantAdditionnel,BuBorderLayout.EAST);
JPanel panelSouth=new JPanel(new FlowLayout(FlowLayout.LEFT));
+ JPanel panelSouth2=new JPanel(new FlowLayout(FlowLayout.LEFT));
panelSouth.add(vue2d.getLabelSuiviSouris());
- JPanel panelTotalSouth=new JPanel(new GridLayout(2,1));
+ JPanel panelTotalSouth=new JPanel(new GridLayout(3,1));
if(title!=null){
panelTotalSouth.add(new JLabel(title));
@@ -249,7 +271,7 @@
panelTotalSouth.add(new JLabel(""));
panelTotalSouth.add(panelSouth);
-
+ panelTotalSouth.add(panelSouth2);
pn.add(panelTotalSouth,BuBorderLayout.SOUTH);
@@ -261,6 +283,8 @@
//-- ajout de la palette d'infos --//
final Collection<EbliActionPaletteAbstract> acts =vue2d.getController().getTabPaletteAction();
BPaletteInfo comp=null;
+ vue2d.getController().buildActions();
+ JPanel compEast=new JPanel(new BorderLayout());
for (final EbliActionPaletteAbstract pals : acts) {
final JComponent component = pals.buildContentPane();
if (component instanceof BCalquePaletteInfo) {
@@ -271,19 +295,26 @@
pals.updateBeforeShow();
// comp.setMaximumSize(new Dimension(180,300));
// comp.setPreferredSize(new Dimension(180,300));
- pn.add(comp,BuBorderLayout.EAST);
-
+ compEast.add(comp,BuBorderLayout.CENTER);
+
+ }else if((modele instanceof MVProfileCourbeModel) && (component instanceof BPaletteEdition)){
+ compEast.add(comp,BuBorderLayout.SOUTH);
}
}
+ pn.add(compEast,BuBorderLayout.EAST);
panelSouth.add(this.ecraser_);
panelSouth.add(this.ajouter_);
//final JScrollPane arbreVue2d = new JScrollPane(new BArbreCalque(vue2d.getArbreCalqueModel()));
//arbreVue2d.setPreferredSize(new Dimension(200,300));
//arbreVue2d.setMaximumSize(new Dimension(200,300));
//pn.add(arbreVue2d,BuBorderLayout.WEST);
+ if(this.rejouerSrc_!=null){
+
+ panelSouth2.add(new JLabel("Relancer pour un autre fichier r\xE9sultat"));
+ panelSouth2.add(rejouerSrc_);
+ }
-
}
@@ -330,7 +361,7 @@
//calqueZ.setVisible(true);
//calqueZ.setLineModel(0, new TraceLigneModel(1,2,Color.BLACK));
if(isInterpolated)
- calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.CROIX,3,Color.blue));
+ calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.PLUS,4,Color.blue));
else
calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.CARRE_SELECTION,3,Color.blue));
vue2d.addCalque(calqueZ, true);
@@ -352,7 +383,7 @@
* @param modele
* @param implementation
*/
- public void getProfilSpatialOrigine(MVProfileCourbeModel modele,TrPostCommonImplementation implementation){
+ public void getProfilSpatialOrigine( MVProfileCourbeModel modele, TrPostCommonImplementation implementation){
if(modele.getData() instanceof TrPostSource){}
else{
@@ -404,6 +435,9 @@
//pane.setMaximumSize(new Dimension(200,300));
pane.setPreferredSize(new Dimension(200,300));
+
+
+
CtuluDialogPanel panel=constructDialog(vue2d, implementation, modele,pane,false,"<html><body>"+TrResource.getS("Origine ")+" "+modele.getTitle()+".<br />Les points de la polyligne sont encadr\xE9s en bleu </body></html>");
//-- on positionne la bonne variable et le bon pas de temps --//
comboVar_.getCb().setSelectedItem(modele.getVariable());
@@ -411,19 +445,19 @@
}
-
+ CtuluDialogPanel dialog_=null;
/**
* Constructeur d'une dialog qui affiche la vue 2d avec le point initial qui a servi a la creation du modele.
* Ajoute \xE9galement la liste des variables \xE0 choisir. Il est possible dans la vue de s\xE9lectionner un autre point ou plusieurs.
* LA validation de la frame permettra de r\xE9cup\xE9rer les nouveaux point ainsi que les variables qui seront utilis\xE9es pour refaire le calcul.
* @param modele
*/
- public void getEvolTemporelleReplayData(TrPostCourbeTreeModel treeModel,TrPostCourbeModel modele,TrPostCommonImplementation implementation){
+ public void getEvolTemporelleReplayData(TrPostSource srcChoisie,final TrPostCourbeTreeModel treeModel,final TrPostCourbeModel modele,final TrPostCommonImplementation implementation){
boolean isInterpolated=(modele instanceof TrPostCourbeModel.Interpolated);
//-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --//
- TrPostVisuPanel vue2d=constructVue2d(implementation,modele.source_);
+ TrPostVisuPanel vue2d=constructVue2d(implementation,srcChoisie);
//-- on affiche sur la vue 2d les points initialement choisis --//
GISZoneCollectionPoint collectionPoint=new GISZoneCollectionPoint();
@@ -433,7 +467,7 @@
//point reel
int indiceNoeud=((Integer) point).intValue();
// recherche du point cot\xE9 grille
- coordonneesPoint=modele.source_.getGrid().getCoor(indiceNoeud);
+ coordonneesPoint=srcChoisie.getGrid().getCoor(indiceNoeud);
}else{
TrPostInterpolatePoint pt=(TrPostInterpolatePoint) point;
@@ -449,7 +483,7 @@
FSigLayerPointEditable layer2=new FSigLayerPointEditable(modelePointEdit,vue2d.getGisEditor());
layer2.setVisible(true);
if(isInterpolated)
- layer2.setIconModel(0, new TraceIconModel(TraceIcon.CROIX,5,Color.RED));
+ layer2.setIconModel(0, new TraceIconModel(TraceIcon.PLUS,4,Color.RED));
else
layer2.setIconModel(0, new TraceIconModel(TraceIcon.CARRE_SELECTION,5,Color.RED));
layer2.setEnabled(true);
@@ -461,22 +495,41 @@
vue2d.setCalqueActif(resultatsCalque);
//vue2d.addCalque(layer2, true);
- // ZCalquePoint calqueZ=new ZCalquePoint(modelePointEdit);
- // //calqueZ.setVisible(true);
- // //calqueZ.setLineModel(0, new TraceLigneModel(1,2,Color.BLACK));
- // calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.CARRE_SELECTION,3,Color.blue));
- // vue2d.addCalque(calqueZ, true);
- // calqueZ.setVisible(true);
+
//-- creation du panel de choix des variables a selectionner --//
-
+ rejouerSrc_=new BuButton();
+ rejouerSrc_.setAction(new AbstractAction("Fichier r\xE9sultat"){
+ public void actionPerformed(ActionEvent e) {
+ final String[] values = implementation.getCurrentProject().formattageDonnees(false);
+ final int selectedSource = selectSource(values, (String) getValue(Action.NAME), implementation.getFrame());
+ if(selectedSource !=-1){
+ //-- on choisie le nouveau source --//
+ TrPostSource newSrc= implementation.getCurrentProject().getSource(selectedSource);
+
+ //-- on ferme l'interface courante --//
+
+ if(dialog_!=null )
+
+ dialog_.cancel();
+ //-- on rappelle l'interface --//
+ getEvolTemporelleReplayData(newSrc, treeModel, modele, implementation);
+
+ }
+ else return;
+
+ }
+
+ });
+
+
//-- on affiche le contenu dans une dialog--//
//final Set var = new HashSet(Arrays.asList(modele.source_.getAllVariablesNonVec()));
//final H2dVariableType[] vars = (H2dVariableType[]) var.toArray(new H2dVariableType[var.size()]);
String title=TrResource.getS("<html><body>Choisir le point et la variable qui seront utilis\xE9s pour refaire le calcul(interpolation possible).<br /> Le point rouge d\xE9signe le point d'origine.</body></html>");
- CtuluDialogPanel dialog=constructDialog(vue2d, implementation, modele,/*constructSelectorVariable(vars)*/null,true,title);
- dialog.setPreferredSize(new Dimension(600,400));
+ dialog_=constructDialog(vue2d, implementation, modele,/*constructSelectorVariable(vars)*/null,true,title);
+ dialog_.setPreferredSize(new Dimension(600,400));
//-- on restaure la vue --//
vue2d.setSize(300, 300);
@@ -486,19 +539,64 @@
comboVar_.getCb().setSelectedItem(modele.var_);
+ //-- on cr\xE9e le bouton de rejoue de donn\xE9es pour un autre fichier r\xE9sultat --//
+
+
//-- on affiche tant que l'utilisateur valide des r\xE9sultats faux --//
- while(CtuluDialogPanel.isOkResponse(dialog.afficheModale(implementation.getParentComponent(), TrResource.getS("Rejouer ")+" "+modele.getTitle())) && !replayEvolutionFor(vue2d,treeModel,modele,implementation)){
+ while(CtuluDialogPanel.isOkResponse(dialog_.afficheModale(implementation.getParentComponent(), TrResource.getS("Rejouer ")+" "+modele.getTitle())) && !replayEvolutionFor(srcChoisie,vue2d,treeModel,modele,implementation)){
}
}
+
/**
+ * Constructeur d'une dialog qui affiche la vue 2d avec le point initial qui a servi a la creation du modele.
+ * Ajoute \xE9galement la liste des variables \xE0 choisir. Il est possible dans la vue de s\xE9lectionner un autre point ou plusieurs.
+ * LA validation de la frame permettra de r\xE9cup\xE9rer les nouveaux point ainsi que les variables qui seront utilis\xE9es pour refaire le calcul.
+ * @param modele
+ *
+ * WARNING: le treemodele pour un courbe scopegene peut etre a la fois:
+ * - un ScopGeneTeeModel
+ * - un trpostcourbeTreeModel (ajout de courbe scop dans une evol temporelle)
+ * - un MvTreeModel (ajout idem)
+ * Il faut donc traiter avec un EgGrapheTreeModel g\xE9n\xE9rique pour eviter les problemes de cast.
+ */
+ public void getScopGeneReplayData(EGGrapheTreeModel treeModel,ScopeCourbeModel modele,TrPostCommonImplementation implementation){
+
+
+ File fichierScop=modele.getFichierGenerateur();
+ if(fichierScop==null || !fichierScop.canRead()){
+ if(fichierScop!=null)
+ implementation.error("Impossible de r\xE9cup\xE9rer le fichier scop au cehmin suivant: \n "+fichierScop.getAbsolutePath());
+ else
+ implementation.error("Impossible de r\xE9cup\xE9rer le fichier scop");
+
+ return;
+ }
+
+ //-- pr\xE9chargement de l'interface avec les infos du fichier --//
+
+
+
+ final TrPostWizardImportScope wizard = new TrPostWizardImportScope(implementation.getCurrentProject(), (Target) treeModel,true,fichierScop);
+ final BuWizardDialog DialogWizard = new BuWizardDialog(implementation.getFrame(), wizard);
+ // --affichage du wizard --//
+ DialogWizard.setSize(600, 600);
+ DialogWizard.setLocationRelativeTo(implementation.getFrame());
+ DialogWizard.setVisible(true);
+
+
+ }
+
+
+
+ /**
* Methode qui v\xE9rifie les saisies sur la vue 2d et r\xE9alise les cr\xE9ations/ecrasements avec les nouveaut\xE9s
* des profils temporels.
*/
- public boolean replayEvolutionFor(TrPostVisuPanel vue2d,TrPostCourbeTreeModel tree,TrPostCourbeModel modele,TrPostCommonImplementation implementation){
+ public boolean replayEvolutionFor(TrPostSource srcChoisie,TrPostVisuPanel vue2d,TrPostCourbeTreeModel tree,TrPostCourbeModel modele,TrPostCommonImplementation implementation){
H2dVariableType newVariable=null;
int newPointReel=-1;
TrPostInterpolatePoint newPointInterpole=null;
@@ -533,7 +631,7 @@
//-- on rejoue les donn\xE9es avec ou sans ecrasement --//
- tree.replayPoints(modele,modele.source_,newPointReel, vue2d.getCmdMng(), implementation.getMainProgression(),newVariable ,this.ecraser_.isSelected());
+ tree.replayPoints(modele,srcChoisie,newPointReel, vue2d.getCmdMng(), implementation.getMainProgression(),newVariable ,this.ecraser_.isSelected());
return true;
@@ -550,7 +648,7 @@
implementation.message("Une nouvelle courbe \xE9volution temporelle va \xEAtre calcul\xE9e pour la variable: "+newVariable.getName()+", point interpol\xE9 ("+newPointInterpole.x_+";"+newPointInterpole.y_+")\n"+
"La courbe actuelle ne sera pas supprim\xE9e.");
//-- on rejoue les donn\xE9es avec ou sans ecrasement --//
- tree.replayPoints(modele,modele.source_,newPointInterpole, vue2d.getCmdMng(), implementation.getMainProgression(),newVariable ,this.ecraser_.isSelected());
+ tree.replayPoints(modele,srcChoisie,newPointInterpole, vue2d.getCmdMng(), implementation.getMainProgression(),newVariable ,this.ecraser_.isSelected());
return true;
@@ -569,13 +667,10 @@
* LA validation de la frame permettra de r\xE9cup\xE9rer les nouveaux point ainsi que les variables qui seront utilis\xE9es pour refaire le calcul.
* @param modele
*/
- public void getProfilSpatialReplayData( MvProfileTreeModel treeModel,MVProfileCourbeModel modele,TrPostCommonImplementation implementation){
- if(!(modele.getData() instanceof TrPostSource)){
- implementation.error("Impossible de r\xE9cup\xE9rer le fichier r\xE9sulat depuis ce type de profil spatial.");
- return;
- }
+ public void getProfilSpatialReplayData( TrPostSource srcChoisie,final MvProfileTreeModel treeModel,final MVProfileCourbeModel modele,final TrPostCommonImplementation implementation){
+
//-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --//
- TrPostVisuPanel vue2d=constructVue2d(implementation,(TrPostSource) modele.getData());
+ TrPostVisuPanel vue2d=constructVue2d(implementation,srcChoisie);
//-- on affiche sur la vue 2d les points initialement choisis --//
GISZoneCollectionPoint collectionPoint=new GISZoneCollectionPoint();
@@ -605,19 +700,51 @@
//-- creation du panel de choix des variables a selectionner --//
String title=TrResource.getS("<html><body>Choisir les points, la variable et le pas de temps qui seront utilis\xE9s pour refaire le calcul(polyligne possible).<br /> Les points rouge d\xE9signent l'origine.</body></html>");
- CtuluDialogPanel dialog=constructDialog(vue2d, implementation, modele,/*constructSelectorVariable(vars)*/null,true,title);
- dialog.setPreferredSize(new Dimension(600,400));
+ //-- creation du panel de choix des variables a selectionner --//
+ rejouerSrc_=new BuButton();
+ rejouerSrc_.setAction(new AbstractAction("Fichier r\xE9sultat"){
+ public void actionPerformed(ActionEvent e) {
+ final String[] values = implementation.getCurrentProject().formattageDonnees(false);
+ final int selectedSource = selectSource(values, (String) getValue(Action.NAME), implementation.getFrame());
+ if(selectedSource !=-1){
+ //-- on choisie le nouveau source --//
+ TrPostSource newSrc= implementation.getCurrentProject().getSource(selectedSource);
+
+ //-- on ferme l'interface courante --//
+ if(dialog_!=null )
+ dialog_.cancel();
+
+ //-- on rappelle l'interface --//
+ getProfilSpatialReplayData(newSrc, treeModel, modele, implementation);
+
+ }
+ else return;
+
+ }
+
+ });
+
+ dialog_=constructDialog(vue2d, implementation, modele,/*constructSelectorVariable(vars)*/null,true,title);
+ dialog_.setPreferredSize(new Dimension(600,400));
+
//-- on restaure la vue --//
vue2d.setSize(300, 300);
vue2d.restaurer();
+
+
+
//-- on positionne la bonne variable et le bon pas de temps --//
comboVar_.getCb().setSelectedItem(modele.getVariable());
-
+ //-- ajout du calque ligne bris\xE9e pour r\xE9aliser une polyligne --//
+ //final FSigLayerLineEditable cq4 = new FSigLayerLineEditable(new ZModeleLigneBriseeEditable(), vue2d.getGisEditor());
+ // cq4.setTitle("toto");
+ //vue2d.addCalque(cq4, true);
+
//-- on affiche tant que l'utilisateur valide des r\xE9sultats faux --//
- while(CtuluDialogPanel.isOkResponse(dialog.afficheModale(implementation.getParentComponent(), TrResource.getS("Rejouer ")+" "+modele.getTitle())) && !replayProfilSpatialFor(vue2d,treeModel,modele,implementation)){
+ while(CtuluDialogPanel.isOkResponse(dialog_.afficheModale(implementation.getParentComponent(), TrResource.getS("Rejouer ")+" "+modele.getTitle())) && !replayProfilSpatialFor(srcChoisie,vue2d,treeModel,modele,implementation)){
}
@@ -630,7 +757,7 @@
* Methode qui v\xE9rifie les saisies sur la vue 2d et r\xE9alise les cr\xE9ations/ecrasements avec les nouveaut\xE9s
* des profils temporels.
*/
- public boolean replayProfilSpatialFor(TrPostVisuPanel vue2d,MvProfileTreeModel tree,MVProfileCourbeModel modele,TrPostCommonImplementation implementation){
+ public boolean replayProfilSpatialFor( TrPostSource srcChoisie,TrPostVisuPanel vue2d,MvProfileTreeModel tree,MVProfileCourbeModel modele,TrPostCommonImplementation implementation){
H2dVariableType newVariable=null;
int newTimeStep_=-1;
int[] newPoints=null;
@@ -655,15 +782,15 @@
String title=" [P1("+format(modele.getBuilder().getInitLine_().getCoordinateN(0).x,2)+";"+format(modele.getBuilder().getInitLine_().getCoordinateN(0).y,2)+")"+";"+
"P"+modele.getBuilder().getInitLine_().getNumPoints()+"("+format(modele.getBuilder().getInitLine_().getCoordinateN(modele.getBuilder().getInitLine_().getNumPoints()-1).x,2)+";"+format(modele.getBuilder().getInitLine_().getCoordinateN(modele.getBuilder().getInitLine_().getNumPoints()-1).y,2)+")]";
- String title2=" [P1("+format(((TrPostSource)modele.getData()).getGrid().getPtX(idx[0]),2)+";"+format(((TrPostSource)modele.getData()).getGrid().getPtX(idx[0]),2)+")"+";"+
- "P"+modele.getBuilder().getInitLine_().getNumPoints()+"("+format(((TrPostSource)modele.getData()).getGrid().getPtX(idx[idx.length-1]),2)+";"+format(((TrPostSource)modele.getData()).getGrid().getPtX(idx[idx.length-1]),2)+")]";
+ String title2=" [P1("+format(srcChoisie.getGrid().getPtX(idx[0]),2)+";"+format(srcChoisie.getGrid().getPtX(idx[0]),2)+")"+";"+
+ "P"+modele.getBuilder().getInitLine_().getNumPoints()+"("+format(srcChoisie.getGrid().getPtX(idx[idx.length-1]),2)+";"+format(srcChoisie.getGrid().getPtX(idx[idx.length-1]),2)+")]";
//-- on rejoue les donn\xE9es avec les nouvelles valeurs --//
if(this.ecraser_.isSelected()){
- implementation.message("La courbe actuelle de mod\xE8le: variable:"+modele.getVariable()+", de pas de temps "+((TrPostSource)modele.getData()).getTimeStep(modele.getActiveTimeIdx())+" et de polyligne d'extr\xE9mit\xE9s "+title+"\n" +
+ implementation.message("La courbe actuelle de mod\xE8le: variable:"+modele.getVariable()+", de pas de temps "+srcChoisie.getTimeStep(modele.getActiveTimeIdx())+" et de polyligne d'extr\xE9mit\xE9s "+title+"\n" +
" va \xEAtre recalcul\xE9e pour les donn\xE9es suivantes:\n"
- +"Variable: "+newVariable.getName()+", de pas de temps "+((TrPostSource)modele.getData()).getTimeStep(vue2d.getSelectedTimeInCalqueActif())+" et de polyligne d'extr\xE9mit\xE9s "+title2);
+ +"Variable: "+newVariable.getName()+", de pas de temps "+srcChoisie.getTimeStep(vue2d.getSelectedTimeInCalqueActif())+" et de polyligne d'extr\xE9mit\xE9s "+title2);
}
else{
@@ -671,7 +798,7 @@
}
//-- on rejoue les donn\xE9es avec ou sans ecrasement --//
- tree.replayPoints(implementation,vue2d,modele,(TrPostSource)modele.getData(),newPoints, vue2d.getCmdMng(), implementation.getMainProgression(),newVariable ,newTimeStep_,this.ecraser_.isSelected());
+ tree.replayPoints(implementation,vue2d,modele,srcChoisie,newPoints, vue2d.getCmdMng(), implementation.getMainProgression(),newVariable ,newTimeStep_,this.ecraser_.isSelected());
return true;
@@ -683,10 +810,27 @@
}
}
+ /**
+ * Genere une interface qui liste les fichiers disponibles et retourne l'entier correspondant au choix de l'utilisateur.
+ * Cet entier correspond a l'indice du fichier dans l'arrayliste des src du trpostprojet.
+ * @param _init
+ * @param _title
+ * @param _parent
+ * @return
+ */
+ public static int selectSource(final Object[] _init, final String _title, final Component _parent) {
+ Arrays.sort(_init, FuComparator.STRING_COMPARATOR);
+ final BuList l = CtuluLibSwing.createBuList(_init);
+ final CtuluDialogPanel pn = new CtuluDialogPanel(false);
+ pn.setLayout(new BuBorderLayout());
+ pn.setBorder(BuBorders.EMPTY3333);
+ pn.add(new BuLabel(CtuluLib.getS("S\xE9lectionner le fichier r\xE9sultat")), BuBorderLayout.NORTH);
+ pn.add(new BuScrollPane(l));
+ if (CtuluDialogPanel.isOkResponse(pn.afficheModale(_parent, _title))) { return l.getSelectedIndex(); }
+ return -1;
+ }
-
-
public String format(double value,int nbChiffresSignificatifs){
String forme="#.";
for(int i=0;i<nbChiffresSignificatifs;i++)
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardImportScope.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardImportScope.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardImportScope.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -1,6 +1,7 @@
package org.fudaa.fudaa.tr.post.dialogSpec;
import java.awt.event.ActionEvent;
+import java.io.File;
import org.fudaa.ebli.commun.EbliActionSimple;
import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter;
@@ -33,6 +34,13 @@
target_ = target;
}
+ public ImportAction(final TrPostProjet projet, final FudaaCourbeImporter.Target target,boolean replayData) {
+ super(BuResource.BU.getString("Importer dans le graphe"), BuResource.BU.getIcon("IMPORTER"), "IMPORTER");
+ ui_ = projet.impl_;
+ projet_ = projet;
+ target_ = target;
+ }
+
@Override
public void actionPerformed(final ActionEvent _e) {
final TrPostWizardImportScope wizard = new TrPostWizardImportScope(projet_, target_);
@@ -44,6 +52,12 @@
}
}
+ public TrPostWizardImportScope(final TrPostProjet projet_, final FudaaCourbeImporter.Target target,boolean replayData,File fileToReload) {
+ super(projet_.impl_, target,replayData,fileToReload);
+ this.projet_ = projet_;
+ }
+
+
public TrPostWizardImportScope(final TrPostProjet projet_, final FudaaCourbeImporter.Target target) {
super(projet_.impl_, target);
this.projet_ = projet_;
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2009-01-22 15:22:26 UTC (rev 4393)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2009-01-22 21:40:12 UTC (rev 4394)
@@ -161,7 +161,27 @@
fileChooser.setDialogTitle(EbliResource.EBLI.getString("S\xE9lectionnez l'emplacement de votre projet"));
fileChooser.setAcceptAllFileFilterUsed(false);
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- fileChooser.addChoosableFileFilter(new TrPostFileFilter.DirectoryPOSTFilter());
+ fileChooser.addChoosableFileFilter(new TrPostFileFilter.DirectoryPOSTFilter());
+
+ //-- par defaut on choisis le nom du fichier resultat + .POST --//
+ File fileDefaut=null;
+ boolean constrcutFileDefaut=false;
+ if(trprojet_.listeSrc_!=null && trprojet_.listeSrc_.size()>=1){
+ String indice="";
+ int i=1;
+ do{
+ String path=fileChooser.getCurrentDirectory().getAbsolutePath()+File.separator+trprojet_.getSource(0).getFile().getName()+indice+EXTENSION;
+ fileDefaut=new File(path);
+ indice="_"+(i++);
+ }while(fileDefaut.exists());
+
+
+ if(! fileDefaut.exists()){
+ constrcutFileDefaut= fileDefaut.mkdir();
+ }
+ fileChooser.setSelectedFile(fileDefaut);
+
+ }
if (projet_ != null){ // initialiser le saveas dans le meme rep
// fileChooser.setSelectedFile(projet_);
}
@@ -169,6 +189,11 @@
if (reponse == JFileChooser.APPROVE_OPTION) {
final File conteneurProjet = fileChooser.getSelectedFile();
+ //-- si le fichier choisit en d\xE9finitif est diff\xE9rent du fichier d\xE9faut et qu'il a \xE9t\xE9t cr\xE9r pour rien, on le supprime --//
+ if(constrcutFileDefaut && fileDefaut!=null && !fileDefaut.getAbsolutePath().equals(conteneurProjet.getAbsolutePath())){
+ fileDefaut.delete();
+ ...
[truncated message content] |