Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv12749/telemac
Modified Files:
TrTelemacImplHelper.java TrTelemacParametres.java
TrTelemacProjet.java
Removed Files:
TrTelemacCasProcess.java TrTelemacFilleEntite.java
Log Message:
Diverses refactorisation
Index: TrTelemacImplHelper.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacImplHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrTelemacImplHelper.java 19 May 2003 14:31:49 -0000 1.1
--- TrTelemacImplHelper.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 9,21 ****
package org.fudaa.fudaa.tr.telemac;
import java.io.File;
! import com.memoire.bu.BuTask;
import com.memoire.bu.BuTaskOperation;
import org.fudaa.dodico.commun.ProgressionBuAdapter;
import org.fudaa.dodico.telemac.io.TelemacCasFileFormat;
import org.fudaa.fudaa.tr.TrImplHelper;
import org.fudaa.fudaa.tr.TrImplementation;
/**
--- 9,43 ----
package org.fudaa.fudaa.tr.telemac;
+ import java.awt.event.ActionEvent;
import java.io.File;
! import javax.swing.ComboBoxModel;
! import javax.swing.DefaultComboBoxModel;
! import javax.swing.JComboBox;
!
! import com.memoire.bu.BuBorderLayout;
! import com.memoire.bu.BuComboBox;
! import com.memoire.bu.BuDialogChoice;
! import com.memoire.bu.BuGridLayout;
! import com.memoire.bu.BuLabel;
! import com.memoire.bu.BuMenuItem;
import com.memoire.bu.BuTaskOperation;
+ import org.fudaa.dodico.commun.DodicoPreferences;
import org.fudaa.dodico.commun.ProgressionBuAdapter;
+ import org.fudaa.dodico.dico.DicoCasFileFormat;
+ import org.fudaa.dodico.dico.DicoLanguage;
+ import org.fudaa.dodico.dico.DicoManager;
+ import org.fudaa.dodico.dico.DicoModelAbstract;
+ import org.fudaa.dodico.telemac.TelemacDicoManager;
import org.fudaa.dodico.telemac.io.TelemacCasFileFormat;
+ import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
+ import org.fudaa.fudaa.commun.FudaaLib;
+ import org.fudaa.fudaa.commun.exec.FudaaExecServerManager;
+ import org.fudaa.fudaa.ressource.FudaaResource;
import org.fudaa.fudaa.tr.TrImplHelper;
import org.fudaa.fudaa.tr.TrImplementation;
+ import org.fudaa.fudaa.tr.TrPreferences;
+ import org.fudaa.fudaa.tr.TrProjet;
/**
***************
*** 25,46 ****
public class TrTelemacImplHelper extends TrImplHelper
{
! TrImplementation impl_;
!
public TrTelemacImplHelper(TrImplementation _impl)
{
! impl_=_impl;
}
public void ouvrir()
{
! final File fic = impl_.ouvrirFileChooser(TelemacCasFileFormat.getInstance().getExtensions(), "Télémac Fichier cas");
if (fic != null)
{
! impl_.setLastDir(fic);
new BuTaskOperation(impl_, "import fichier cas")
{
public void act()
{
! ouvrirOpr(fic, this);
}
}
--- 47,90 ----
public class TrTelemacImplHelper extends TrImplHelper
{
!
public TrTelemacImplHelper(TrImplementation _impl)
{
! super(_impl);
! }
!
! public void ouvrir(File _f)
! {
! _ouvrir(_f);
!
}
public void ouvrir()
{
! final File fic = impl_.ouvrirFileChooser(null, "Télémac Fichier cas");
if (fic != null)
{
! _ouvrir(fic);
! }
! }
!
! private void _ouvrir(final File _fic)
! {
! if (_fic != null)
! {
new BuTaskOperation(impl_, "import fichier cas")
{
public void act()
{
! TrTelemacProjet projet =
! TrTelemacProjet.init(
! _fic,
! TelemacCasFileFormat.getInstance(),
! new ProgressionBuAdapter(this),
! getImpl());
! setProgression(90);
! if (projet != null)
! {
! getImpl().addProjet(projet);
! }
}
}
***************
*** 49,61 ****
}
! public void ouvrirOpr(File _f, BuTask _t)
{
! TrTelemacCasProcess process = new TrTelemacCasProcess(new ProgressionBuAdapter(_t), impl_);
! TrTelemacParametres param = process.createProjet(_f, TelemacCasFileFormat.getInstance());
! if (param != null)
{
! TrTelemacProjet proj = new TrTelemacProjet(param);
! impl_.addProjet(proj);
}
}
--- 93,182 ----
}
! public void ouvrirDico()
{
! EbliSimpleDialogPanel s = new EbliSimpleDialogPanel();
! s.setLayout(new BuGridLayout(2, 5, 5, false, false, false, false));
! s.add(new BuLabel("dico :"));
! BuComboBox cb = new BuComboBox();
! ComboBoxModel descModel =
! TelemacDicoManager.getINSTANCE().createDicoDescComboBoxModel();
! cb.setModel(descModel);
! cb.setRenderer(TelemacDicoManager.getINSTANCE().getDicoDescCellRenderer());
! s.add(cb);
! s.add(new BuLabel("Langage :"));
! cb = new BuComboBox();
! DicoLanguage.LanguageComboBoxModel langModel =
! new DicoLanguage.LanguageComboBoxModel();
! cb.setModel(langModel);
! s.add(cb);
! int r = s.afficheModale(impl_.getFrame(), "Choix fichier dico");
! if (EbliSimpleDialogPanel.isOkResponse(r))
{
! final File fic = impl_.ouvrirFileChooser(null, "Fichier cas");
! if (fic != null)
! {
! _ouvrir(
! fic,
! (DicoManager.DicoDescription) descModel.getSelectedItem(),
! langModel.getSelectedLanguage());
! }
!
}
+
+ }
+
+ private void _ouvrir(
+ final File _fic,
+ final DicoManager.DicoDescription _des,
+ final int _language)
+ {
+ if (_fic != null)
+ {
+ new BuTaskOperation(impl_, "import fichier cas pour " + _des.getName())
+ {
+ public void act()
+ {
+
+ DicoModelAbstract m =
+ TelemacDicoManager.getINSTANCE().createDico(_des, _language);
+ if (m == null)
+ getImpl().error(
+ "INTERNE Impossible de créer le modele du dictionnaire");
+ else
+ {
+ TrDicoProjet projet = TrDicoProjet.init(_fic,new DicoCasFileFormat(m),new ProgressionBuAdapter(this), getImpl());
+ setProgression(90);
+ if (projet != null)
+ {
+ getImpl().addProjet(projet);
+ }
+ }
+ }
+ }
+ .start();
+ }
+ }
+
+ /**
+ *
+ */
+ public String getID()
+ {
+ return TrProjet.TELEMAC_ID;
+ }
+
+ /**
+ *
+ */
+ public BuMenuItem[] getMenuItemsOuvrir()
+ {
+ BuMenuItem r0 = new BuMenuItem("Projet dico");
+ r0.setActionCommand(impl_.PREF_OUVRIR + TrProjet.TELEMAC_DICO_ID);
+ BuMenuItem r =
+ new BuMenuItem(
+ FudaaResource.FUDAA.getToolIcon("appli/reflux"),
+ "Projet Reflux");
+ r.setActionCommand(impl_.PREF_OUVRIR + TrProjet.REFLUX_ID);
+ return new BuMenuItem[] { r0, r };
}
Index: TrTelemacParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacParametres.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrTelemacParametres.java 19 May 2003 14:31:49 -0000 1.1
--- TrTelemacParametres.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 10,31 ****
import java.io.File;
- import java.util.ArrayList;
- import java.util.Collections;
- import java.util.HashSet;
- import java.util.Hashtable;
- import java.util.Iterator;
import java.util.Map;
- import java.util.Set;
-
- import javax.swing.table.AbstractTableModel;
-
- import com.memoire.bu.BuInformationsDocument;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.corba.tr.LTrCodeCalcul;
import org.fudaa.dodico.corba.tr.STrProjetH2d;
! import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.dico.DicoModelAbstract;
! import org.fudaa.dodico.h2d.H2dFileFormat;
import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.H2dParametres;
--- 10,23 ----
import java.io.File;
import java.util.Map;
import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.corba.tr.LTrCodeCalcul;
import org.fudaa.dodico.corba.tr.STrProjetH2d;
! import org.fudaa.dodico.dico.DicoCasFileFormat;
import org.fudaa.dodico.dico.DicoModelAbstract;
! import org.fudaa.dodico.dico.DicoParamsListener;
! import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.H2dParametres;
***************
*** 33,42 ****
import org.fudaa.dodico.telemac.io.TelemacCLInterface;
import org.fudaa.dodico.telemac.io.TelemacCasFileFormat;
- import org.fudaa.dodico.telemac.io.TelemacCasInterface;
import org.fudaa.dodico.telemac.io.TelemacLiquideInterface;
- import org.fudaa.fudaa.tr.TrEditor;
import org.fudaa.fudaa.tr.TrLib;
! import org.fudaa.fudaa.tr.dico.TrDicoEntiteFile;
! import org.fudaa.fudaa.tr.dico.TrDicoEntiteTableModel;
/**
--- 25,34 ----
import org.fudaa.dodico.telemac.io.TelemacCLInterface;
import org.fudaa.dodico.telemac.io.TelemacCasFileFormat;
import org.fudaa.dodico.telemac.io.TelemacLiquideInterface;
import org.fudaa.fudaa.tr.TrLib;
! import org.fudaa.fudaa.commun.FudaaUI;
! import org.fudaa.fudaa.dico.FDicoEntiteFile;
! import org.fudaa.fudaa.dico.FDicoMultiEntiteViewer;
! import org.fudaa.fudaa.dico.FDicoParams;
/**
***************
*** 44,241 ****
* @version $Id$
*/
! public class TrTelemacParametres extends H2dParametres
{
! public final class BaseFileEntiteTableModel extends AbstractTableModel
! {
! public int getRowCount()
! {
! return entiteFiles_.size();
! }
! public int getColumnCount()
! {
! return 2;
! }
!
!
!
! public Object getValueAt(int _r, int _c)
! {
! TrDicoEntiteFile ent = (TrDicoEntiteFile) entiteFiles_.get(_r);
! if (_c == 0)
! return ent;
! else if (_c == 1)
! {
! return ent.getValue();
! }
! return null;
! }
!
! public String getColumnName(int _c)
! {
! if (_c == 0)
! return "Description";
! else
! return "Fichier";
! }
!
! public void editer(int _r)
! {
! TrDicoEntiteFile entFile = (TrDicoEntiteFile) entiteFiles_.get(_r);
! TrEditor.getInstance().edit(entFile, DodicoLib.getAbsolutePath(dirBase_, entFile.getValue()));
! }
! }
!
!
! STrProjetH2d projet_;
!
! private String dirBase_;
! private TelemacCasFileFormat ft_;
! private BuInformationsDocument infosDoc_;
!
! /**
! * Entites-valeurs de ce projet.
! */
! private Hashtable entitesValeurs_;
!
! /**
! * contient l'id et la description des fichiers speciaux de ce projet
! */
! private ArrayList entiteFiles_;
!
! private TrDicoEntiteFile principal_;
!
! public TrTelemacParametres()
! {
! }
!
! private void initProjet(TelemacCasFileFormat _ft)
{
! projet_ = new STrProjetH2d();
! projet_.codeCalcul = LTrCodeCalcul.TELEMAC;
! projet_.version = _ft.getVersion();
! ft_ = _ft;
}
!
! public void updateKey(DicoEntite _ent, String _newValue)
{
! if (entitesValeurs_.containsKey(_ent))
! {
! entitesValeurs_.put(_ent, _newValue);
! }
! else
{
! System.out.println("Entite non trouve");
}
}
!
! public String getTitre()
! {
! return getEntiteValue(ft_.getTitreEntite());
! }
!
! public TrDicoEntiteFile getMainEntityFile()
! {
! return principal_;
! }
!
! public void setCas(TelemacCasFileFormat _ft, File _fichierCas, TrTelemacCasProcess _p)
{
! initProjet(_ft);
! dirBase_ = DodicoLib.getConanicalPath(_fichierCas.getParentFile());
! DicoEntite fichierPrincEntite = ft_.getFichierPrincipalEntite();
! if (fichierPrincEntite == null)
! {
! _p.error("La definition du fichier principal n'a pas été trouvée");
! return;
! }
!
! principal_ = new TrDicoEntiteFile(FICHIER_PRINCIPAL, fichierPrincEntite, _fichierCas.getName());
! TelemacCasInterface inter = (TelemacCasInterface) _p.read(_fichierCas, _ft, principal_);
! if ((principal_.containsErrors()))
! {
! _p.error("Le fichier cas est invalide");
! }
! else
! {
! entitesValeurs_ = inter.getInputs();
! //suppression de l'entite correspondante au fichier cas
! entitesValeurs_.remove(fichierPrincEntite);
! //Les entites representant des fichiers du fichier cas
! DicoEntite[] entFichiers = ft_.getDico().getFichierEntitesFor(entitesValeurs_);
! entiteFiles_ = new ArrayList(entFichiers.length + 3);
! synchronized (entiteFiles_)
! {
! entiteFiles_.add(principal_);
! int n = entFichiers.length - 1;
! DicoEntite e;
! String specialType;
! for (int i = n; i >= 0; i--)
! {
! e = entFichiers[i];
! specialType = ft_.getSpecialType(e);
! //si fichier special
! if (specialType != null)
! {
! //si ce n'est pas le principal, on l'ajoute
! if (!FICHIER_PRINCIPAL.equals(specialType))
! {
! entiteFiles_.add(new TrDicoEntiteFile(specialType, e, (String) entitesValeurs_.remove(e)));
! }
! }
! else
! {
! entiteFiles_.add(new TrDicoEntiteFile(null, e, (String) entitesValeurs_.remove(e)));
! }
! }
! }
! }
}
! public DicoModelAbstract getDico()
{
! return ft_.getDico();
}
! public boolean loadAll(TrTelemacCasProcess _p)
{
! return loadGeometrie(_p) && loadConditionsLimite(_p) && loadConditionsLimiteLiquide(_p);
}
- protected synchronized TrDicoEntiteFile getSpecialFileEntite(String _ID)
- {
- TrDicoEntiteFile ent;
- for (Iterator it = entiteFiles_.iterator(); it.hasNext();)
- {
- ent = (TrDicoEntiteFile) it.next();
- if (_ID.equals(ent.getId()))
- return ent;
-
- }
- return null;
- }
! protected String getEntiteValue(DicoEntite _e)
{
! return (String) entitesValeurs_.get(_e);
}
! public boolean loadGeometrie(TrTelemacCasProcess _p)
{
! TrDicoEntiteFile entFile = getSpecialFileEntite(H2dParametres.FICHIER_GEOMETRIE);
if (entFile == null)
{
! _p.error(TrLib.geti18n("Définition du fichier géométrie non trouvée."));
return false;
}
! SerafinInterface sInter = (SerafinInterface) read(_p, entFile, ft_.getDefaultSerafinFormat(), true);
if (sInter == null)
return false;
! String fond = ft_.getDefaultSerafinFormat().getVariableFond();
int numVariable = DodicoLib.findObject(sInter.getVariables(), fond);
if (numVariable < 0)
{
//pour l'instant
! _p.error("bathymétrie non trouvée variable FOND ou es-tu ?");
return false;
}
--- 36,118 ----
* @version $Id$
*/
! public class TrTelemacParametres
{
+ FDicoParams dicoParams_;
+ FudaaUI ui_;
! protected TrTelemacParametres(FDicoParams _dicoParams,FudaaUI _ui)
{
! dicoParams_=_dicoParams;
! ui_=_ui;
}
!
! public static TrTelemacParametres init(
! File _file,
! TelemacCasFileFormat _ft,
! ProgressionInterface _progress,
! FudaaUI _ui)
{
! FDicoParams dicoParams_=FDicoParams.init(_file, _ft, _progress, _ui);
! if(dicoParams_!=null)
{
! return new TrTelemacParametres(dicoParams_,_ui);
}
+ return null;
}
!
! public boolean isValide()
{
! return dicoParams_.isValide();
}
+
+
! public FDicoParams getDicoParams()
{
! return dicoParams_;
}
! public TelemacCasFileFormat getTelemacFileFormat()
{
! return (TelemacCasFileFormat)( dicoParams_.getFileFormat());
}
+
+
! public boolean loadAll(ProgressionInterface _prg)
{
! return loadGeometrie(_prg)
! && loadConditionsLimite(_prg)
! && loadConditionsLimiteLiquide(_prg);
}
! public boolean loadGeometrie(ProgressionInterface _prg)
{
! FDicoEntiteFile entFile =
! dicoParams_.getSpecialFileEntite(TelemacCasFileFormat.FICHIER_GEOMETRIE);
if (entFile == null)
{
! ui_.error(
! "Fichier de maillage",
! TrLib.geti18n("Définition du fichier géométrie non trouvée."));
return false;
}
! FileOperationSynthese op = new FileOperationSynthese();
! SerafinInterface sInter =
! getTelemacFileFormat().getDefaultSerafinFormat().read(
! dicoParams_.getFile(entFile),
! op,
! _prg);
! ui_.manageErrorOperation(op);
if (sInter == null)
return false;
! String fond =
! getTelemacFileFormat().getDefaultSerafinFormat().getVariableFond();
int numVariable = DodicoLib.findObject(sInter.getVariables(), fond);
if (numVariable < 0)
{
//pour l'instant
! ui_.error("Maillage", "bathymétrie non trouvée variable FOND ou es-tu ?");
return false;
}
***************
*** 246,379 ****
}
double[] fondValues = sInter.getDonnees(0, numVariable);
! projet_.maillage = sInter.getMaillage();
! return H2dLib.setBathymetrie(projet_.maillage, fondValues);
! }
!
! public boolean loadConditionsLimite(TrTelemacCasProcess _p)
! {
! TrDicoEntiteFile entFile = getSpecialFileEntite(H2dParametres.FICHIER_CL);
! if (entFile == null)
! {
! _p.error(TrLib.geti18n("Définition du fichier de conditions limites non trouvée."));
! return false;
! }
! TelemacCLInterface inter = (TelemacCLInterface) read(_p, entFile, ft_.getDefaultTelemacCLFormat(), true);
! if (inter == null)
! return false;
! projet_.conditionsLimites = inter.getLines();
! return true;
}
! public boolean loadConditionsLimiteLiquide(TrTelemacCasProcess _p)
{
! TrDicoEntiteFile entFile = getSpecialFileEntite(H2dParametres.FICHIER_CL_LIQUIDE);
if (entFile == null)
{
! _p.error(TrLib.geti18n("Définition du fichier de conditions limites liquides non trouvée."));
return false;
}
! TelemacLiquideInterface inter = (TelemacLiquideInterface) read(_p, entFile, ft_.getDefaultTelemacLiquideFormat(), false);
if (inter == null)
return false;
! projet_.evolutionFrontieresLiquides = inter.getEvolutionsFrontieresLiquides();
return true;
}
! public boolean loadFond(TrTelemacCasProcess _p)
! {
! _p.error("non supporté pour l'instant");
! return false;
! }
!
! private Object read(TrTelemacCasProcess _p, TrDicoEntiteFile _entiteFile, H2dFileFormat _fileFormat, boolean _isVideError)
{
! DicoEntite ent = _entiteFile.getEntite();
! if (ent == null)
! {
! if (_isVideError)
! {
! _p.error("ce n'est pas une entree valide du fichier dico !");
! }
! return null;
! }
! String value = getEntiteValue(ent);
! //ne devrait jamais arriver
! if (value == null)
! {
! if (_isVideError)
! {
! _p.error(ent.getNom() + " spécifié mais vide !!!");
! }
! return null;
! }
! Object r = _p.read(dirBase_, value, _fileFormat, _entiteFile);
! if (_entiteFile.containsErrors())
! {
! _p.error(ent.getNom() + " fichier invalide");
! _p.maj(_entiteFile);
! return null;
! }
! return r;
}
! /**
! * @return
! */
! public String getDirBase()
{
! return dirBase_;
}
! /**
! * @param _string
! */
! public void setDirBase(String _string)
{
! dirBase_ = _string;
}
! /**
! * @see org.fudaa.dodico.tr.TrProjetH2d#getInformationsDocument()
! */
! public BuInformationsDocument getInformationsDocument()
{
! if (infosDoc_ != null)
{
! infosDoc_ = new BuInformationsDocument();
}
! return infosDoc_;
}
! public BaseFileEntiteTableModel getBaseFileEntiteTableModel()
{
! return new BaseFileEntiteTableModel();
}
- public TrDicoEntiteTableModel getEntiteTableModel()
- {
- return new TrDicoEntiteTableModel(new HashSet(entitesValeurs_.keySet()))
- {
- public final Set getAllEntiteSet()
- {
- return new HashSet(entitesValeurs_.keySet());
- }
- public final void setValue(DicoEntite _ent, String _value)
- {
- TrTelemacParametres.this.updateKey(_ent, _value);
- }
-
- public Map getUnModifiableEntiteValue()
- {
- return Collections.unmodifiableMap(entitesValeurs_);
- }
-
- public final String getValue(DicoEntite _ent)
- {
- return (String) entitesValeurs_.get(_ent);
- }
! };
}
// public TableModel getEntiteTableModel()
// {
--- 123,210 ----
}
double[] fondValues = sInter.getDonnees(0, numVariable);
! // projet_.maillage = sInter.getMaillage();
! // return H2dLib.setBathymetrie(projet_.maillage, fondValues);
! return true;
}
! public boolean loadConditionsLimite(ProgressionInterface _prg)
{
! FDicoEntiteFile entFile =
! dicoParams_.getSpecialFileEntite(TelemacCasFileFormat.FICHIER_CL);
if (entFile == null)
{
! ui_.error(
! "Conditions limites",
! TrLib.geti18n(
! "Définition du fichier de conditions limites non trouvée."));
return false;
}
! FileOperationSynthese op = new FileOperationSynthese();
! TelemacCLInterface inter =
! getTelemacFileFormat().getDefaultTelemacCLFormat().read(
! dicoParams_.getFile(entFile),
! op,
! _prg);
! ui_.manageErrorOperation(op);
if (inter == null)
return false;
! // projet_.conditionsLimites = inter.getLines();
return true;
}
! public void saveCas(ProgressionInterface _progress)
{
! dicoParams_.saveCas(_progress);
}
! public void saveAs(File _f, ProgressionInterface _prg)
{
! dicoParams_.saveAs(_f, _prg);
}
! public void saveCopy(File _f, ProgressionInterface _prg)
{
! dicoParams_.saveCopy(_f, _prg);
}
! public boolean loadConditionsLimiteLiquide(ProgressionInterface _prg)
{
! FDicoEntiteFile entFile =
! dicoParams_.getSpecialFileEntite(TelemacCasFileFormat.FICHIER_CL_LIQUIDE);
! if (entFile == null)
{
! ui_.error(
! "Frontières Liquides",
! TrLib.geti18n(
! "Définition du fichier de conditions limites liquides non trouvée."));
! return false;
}
! FileOperationSynthese op = new FileOperationSynthese();
! TelemacLiquideInterface inter =
! getTelemacFileFormat().getDefaultTelemacLiquideFormat().read(
! dicoParams_.getFile(entFile),
! op,
! _prg);
! ui_.manageErrorOperation(op);
! if (inter == null)
! return false;
! //projet_.evolutionFrontieresLiquides =
! //inter.getEvolutionsFrontieresLiquides();
! return true;
}
! public boolean loadFond(ProgressionInterface _prg)
{
! ui_.error("Programme", "non supporté pour l'instant");
! return false;
}
! public File getFileCas()
! {
! return dicoParams_.getMainFile();
}
+
// public TableModel getEntiteTableModel()
// {
***************
*** 398,401 ****
--- 229,267 ----
//
// }
+
+ // /**
+ // *
+ // */
+ // public void init(
+ // File _fichierPrinc,
+ // DicoCasFileFormat _ft,
+ // Map _initialSetValues,
+ // long _timeloaded,
+ // boolean _launchEvent)
+ // {
+ // if(_ft instanceof TelemacCasFileFormat)
+ // {
+ // init(_fichierPrinc, (TelemacCasFileFormat)_ft, _initialSetValues, _timeloaded, _launchEvent);
+ // }
+ // else
+ //
+ // ui_.error("Format telemac 2d uniquement");
+ // }
+ //
+ // public void init(
+ // File _fichierPrinc,
+ // TelemacCasFileFormat _ft,
+ // Map _initialSetValues,
+ // long _timeloaded,
+ // boolean _launchEvent)
+ // {
+ // super.init(
+ // _fichierPrinc,
+ // _ft,
+ // _initialSetValues,
+ // _timeloaded,
+ // _launchEvent);
+ // }
+
}
Index: TrTelemacProjet.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacProjet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrTelemacProjet.java 19 May 2003 14:31:49 -0000 1.1
--- TrTelemacProjet.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 10,17 ****
import java.awt.Dimension;
! import com.memoire.bu.BuCommonImplementation;
import org.fudaa.dodico.h2d.H2dParametres;
import org.fudaa.fudaa.tr.TrProjet;
--- 10,52 ----
import java.awt.Dimension;
+ import java.awt.event.ActionEvent;
+ import java.awt.event.ActionListener;
+ import java.io.File;
! import javax.swing.BorderFactory;
! import javax.swing.JButton;
! import javax.swing.JMenuBar;
!
! import com.memoire.bu.BuBorderLayout;
! import com.memoire.bu.BuButton;
! import com.memoire.bu.BuInformationsDocument;
! import com.memoire.bu.BuInternalFrame;
! import com.memoire.bu.BuMainPanel;
! import com.memoire.bu.BuPanel;
! import com.memoire.bu.BuResource;
! import com.memoire.bu.BuScrollPane;
! import com.memoire.bu.BuTable;
! import com.memoire.bu.BuTaskOperation;
+ import org.fudaa.dodico.calcul.CalculLauncher;
+ import org.fudaa.dodico.commun.ProgressionBuAdapter;
+ import org.fudaa.dodico.commun.ProgressionInterface;
+ import org.fudaa.dodico.dico.DicoCasFileFormat;
+ import org.fudaa.dodico.dico.DicoCasInterface;
+ import org.fudaa.dodico.dico.DicoParamsListener;
+ import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dParametres;
+ import org.fudaa.dodico.telemac.io.TelemacCasFileFormat;
+ import org.fudaa.fudaa.commun.FudaaUI;
+ import org.fudaa.fudaa.commun.FudaaLib;
+ import org.fudaa.fudaa.commun.calcul.FudaaCalculAction;
+ import org.fudaa.fudaa.dico.FDicoCalculLocal;
+ import org.fudaa.fudaa.dico.FDicoComparator;
+ import org.fudaa.fudaa.dico.FDicoFilleProjet;
+ import org.fudaa.fudaa.dico.FDicoParams;
+ import org.fudaa.fudaa.dico.FDicoProjet;
+ import org.fudaa.fudaa.dico.FDicoProjetAbstract;
+ import org.fudaa.fudaa.dico.FDicoProjetInterface;
+ import org.fudaa.fudaa.tr.TrImplementation;
import org.fudaa.fudaa.tr.TrProjet;
***************
*** 20,62 ****
* @version $Id$
*/
! public class TrTelemacProjet extends TrProjet
{
TrTelemacParametres params_;
! TrTelemacFilleEntite entiteFille_;
!
!
! public TrTelemacProjet(TrTelemacParametres _p)
{
! params_=_p;
}
! public void active(BuCommonImplementation _impl)
{
! if(entiteFille_==null)
! {
! entiteFille_=new TrTelemacFilleEntite(this,params_.getBaseFileEntiteTableModel());
! Dimension dim=_impl.getMainPanel().getDesktop().getSize();
! entiteFille_.setSize((int)(dim.getWidth()*0.8),(int)(dim.getHeight()*0.8));
! entiteFille_.setLocation(0,0);
! _impl.addInternalFrame(entiteFille_);
! }
! entiteFille_.pack();
! entiteFille_.setVisible(true);
}
!
!
! public H2dParametres getParamatres()
{
! return getTelemacParamatres();
}
!
! public TrTelemacParametres getTelemacParamatres()
{
! return params_;
}
-
! }
--- 55,109 ----
* @version $Id$
*/
! public class TrTelemacProjet
! extends FDicoProjetAbstract implements TrProjet
!
{
TrTelemacParametres params_;
!
! public TrTelemacProjet(TrTelemacParametres _params,TrImplementation _impl)
{
! super( _impl);
! params_=_params;
! if(isValide()) actions_.setEnableCalcul(true);
}
! public final boolean isValide()
{
! return params_.isValide();
! }
!
! public FudaaUI getUI()
! {
! return impl_;
}
+ public static TrTelemacProjet init(
+ File _file,
+ TelemacCasFileFormat _fileFormat,
+ ProgressionInterface _progress,TrImplementation _ui)
+ {
+ //TODO: gerer si param deja present
+ TrTelemacParametres params_=TrTelemacParametres.init(_file, _fileFormat, _progress, _ui);
+ if(params_!=null) return new TrTelemacProjet(params_,_ui);
+ else return null;
+ }
+
! /**
! *
! */
! public String getID()
{
! return TrProjet.TELEMAC_ID;
}
!
! /**
! *
! */
! public FDicoParams getKeys()
{
! return params_.getDicoParams();
}
! }
\ No newline at end of file
--- TrTelemacCasProcess.java DELETED ---
--- TrTelemacFilleEntite.java DELETED ---
|