Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1333/src/org/fudaa/dodico/telemac Modified Files: TelemacDicoFileFormat.java TelemacDicoFileFormatVersion.java TelemacDicoManager.java Added Files: TelemacSubief2dFileFormatVersion.java Log Message: Maj --- NEW FILE: TelemacSubief2dFileFormatVersion.java --- /** * @creation 1 juin 2004 * @modification $Date: 2004/06/11 16:34:22 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.telemac; import org.fudaa.dodico.dico.DicoCasFileFormat; import org.fudaa.dodico.dico.DicoEntite; import org.fudaa.dodico.dico.DicoModelAbstract; /** * @author Fred Deniger * @version $Id: TelemacSubief2dFileFormatVersion.java,v 1.1 2004/06/11 16:34:22 deniger Exp $ */ public class TelemacSubief2dFileFormatVersion extends TelemacDicoFileFormatVersion { /** * @param _ft * @param _dico */ public TelemacSubief2dFileFormatVersion(DicoCasFileFormat _ft, DicoModelAbstract _dico) { super(_ft, _dico); DicoEntite e=getEntiteFor( new String[]{"FICHIER FORTRAN DE LECTURE DES DONNEES","FORTRAN FILE FOR READING DATA"}); e.setRequired(true); e=getEntiteFor( new String[]{"FICHIER FORTRAN DE CHIMIE","CHIMIE FORTRAN FILE"}); e.setRequired(true); e=getEntiteFor( new String[]{"DICTIONNAIRE DES PARAMETRES DE QE","QE PARAMETERS DICTIONARY"}); e.setRequired(true); e=getEntiteFor( new String[]{"FICHIER DES PARAMETRES DE QE","WQ STEERING FILE"}); e.setRequired(true); e=getEntiteFor( new String[]{"FICHIER FORTRAN","FORTRAN FILE"}); e.setRequired(true); e=getEntiteFor( new String[]{"FICHIER DES RESULTATS","RESULTS FILE"}); e.setRequired(true); e=getEntiteFor( new String[]{"FICHIER HYDRODYNAMIQUE","HYDRODYNAMIC FILE"}); e.setRequired(true); } } Index: TelemacDicoFileFormatVersion.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/TelemacDicoFileFormatVersion.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TelemacDicoFileFormatVersion.java 5 May 2004 12:38:17 -0000 1.1 --- TelemacDicoFileFormatVersion.java 11 Jun 2004 16:34:22 -0000 1.2 *************** *** 22,28 **** import org.fudaa.dodico.telemac.io.SerafinFileFormat; import org.fudaa.dodico.telemac.io.TelemacCLFileFormat; import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; import org.fudaa.dodico.telemac.io.SerafinFileFormat.SerafinVersion; - import org.fudaa.dodico.telemac.io.TelemacCLFileFormat.TelemacCLVersion; import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat.TelemacLiquideVersion; /** --- 22,28 ---- import org.fudaa.dodico.telemac.io.SerafinFileFormat; import org.fudaa.dodico.telemac.io.TelemacCLFileFormat; + import org.fudaa.dodico.telemac.io.TelemacCLVersion; import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; import org.fudaa.dodico.telemac.io.SerafinFileFormat.SerafinVersion; import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat.TelemacLiquideVersion; /** *************** *** 85,91 **** new String[] { "FICHIER DES FONDS", "BOTTOM TOPOGRAPHY FILE" }); } ! public boolean isEntiteFileRequired(DicoEntite _e) { ! return (_e == getMaillageEntiteFile() || (_e == getCLEntiteFile())); ! } public SerafinFileFormat.SerafinVersion getDefaultSerafinFormat() { return (SerafinFileFormat.SerafinVersion)SerafinFileFormat --- 85,91 ---- new String[] { "FICHIER DES FONDS", "BOTTOM TOPOGRAPHY FILE" }); } ! // public boolean isEntiteFileRequired(DicoEntite _e) { ! // return (_e == getMaillageEntiteFile() || (_e == getCLEntiteFile())); ! // } public SerafinFileFormat.SerafinVersion getDefaultSerafinFormat() { return (SerafinFileFormat.SerafinVersion)SerafinFileFormat *************** *** 93,100 **** .getLastVersionImpl(); } ! public TelemacCLFileFormat.TelemacCLVersion getDefaultTelemacCLFormat() { ! return (TelemacCLFileFormat.TelemacCLVersion)TelemacCLFileFormat .getInstance() ! .getLastVersionImpl(); } public TelemacLiquideFileFormat --- 93,100 ---- .getLastVersionImpl(); } ! public TelemacCLVersion getDefaultTelemacCLFormat(String _s) { ! return (TelemacCLVersion)TelemacCLFileFormat .getInstance() ! .getLastVersionInstance(_s); } public TelemacLiquideFileFormat Index: TelemacDicoManager.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TelemacDicoManager.java 1 Jun 2004 11:23:27 -0000 1.19 --- TelemacDicoManager.java 11 Jun 2004 16:34:22 -0000 1.20 *************** *** 8,11 **** --- 8,12 ---- */ package org.fudaa.dodico.telemac; + import java.util.HashMap; *************** *** 16,19 **** --- 17,21 ---- import org.fudaa.dodico.dico.DicoManager; import org.fudaa.dodico.dico.DicoModelAbstract; + import org.fudaa.dodico.h2d.telemac.H2dTelemacDicoParams; /** * @author deniger *************** *** 21,102 **** */ public class TelemacDicoManager extends DicoManager { ! public final static TelemacDicoManager INSTANCE= new TelemacDicoManager(); ! private final static String LAST_VERSION="v5p4"; static { ! HashMap map= new HashMap(11); ! map.put(new TelemacDicoFileFormat("artemis"), new String[] { LAST_VERSION }); ! map.put(new TelemacDicoFileFormat("estel2d"), new String[] { LAST_VERSION }); ! map.put(new TelemacDicoFileFormat("estel3d"), new String[] { LAST_VERSION }); ! map.put(new TelemacDicoFileFormat("postel3d"), new String[] { LAST_VERSION }); ! map.put(new TelemacDicoFileFormat("sisyphe"), new String[] { LAST_VERSION }); ! map.put(new TelemacDicoFileFormat("stbtel"), new String[] { LAST_VERSION }); ! map.put(new TelemacDicoFileFormat("subief2d"), new String[] { LAST_VERSION }); ! map.put(Telemac2dFileFormat.getInstance(), new String[] { LAST_VERSION }); ! map.put(new TelemacDicoFileFormat("telemac3d"), new String[] { LAST_VERSION }); ! map.put(new TelemacDicoFileFormat("tomawac"), new String[] { LAST_VERSION }); INSTANCE.init(map); INSTANCE.load(); } //pour eviter d'instancier ce format a chaque fois. private Telemac2dFileFormat.TelemacVersion telemac2dv5p4_; public final static TelemacDicoManager getINSTANCE() { return INSTANCE; } protected TelemacDicoManager() { super("org.fudaa.dodico.telemac.dico."); } protected DicoCasFileFormat createFormat(String _s) { if (_s.equals(Telemac2dFileFormat.getInstance().getID())) ! return Telemac2dFileFormat.getInstance(); return new TelemacDicoFileFormat(_s); } public static boolean isTelemac2d(DicoCasFileFormat _f) { return _f == Telemac2dFileFormat.getInstance(); } ! public DicoCasFileFormatVersion createVersionImpl( ! Telemac2dFileFormat _ft, ! String _v, ! int _language) { return createTelemacVersionImpl(_ft, _v, _language); } ! public DicoCasFileFormatVersion createVersionImpl( ! DicoCasFileFormat _ft, ! String _v, ! int _language) { return createTelemacVersionImpl(_ft, _v, _language); } ! public Telemac2dFileFormat.TelemacVersion createTelemac2dVersionImpl( ! Telemac2dFileFormat _ft, ! String _v, ! int _language) { ! String name= Telemac2dFileFormat.getInstance().getName(); ! String lastVersion= LAST_VERSION; ! if ((lastVersion.equals(_v)) ! && (DicoLanguage.getCurrentID() == _language)) { ! if (CtuluLib.DEBUG) ! CtuluLib.debug("new instance for telemac 2d"); if (telemac2dv5p4_ == null) ! telemac2dv5p4_= _ft.createVersion(createDico(name, _v, _language)); return telemac2dv5p4_; } return _ft.createVersion(createDico(name, _v, _language)); } ! public TelemacDicoFileFormatVersion createTelemacVersionImpl( ! Telemac2dFileFormat _ft, ! String _v, ! int _language) { return createTelemac2dVersionImpl(_ft, _v, _language); } ! public TelemacDicoFileFormatVersion createTelemacVersionImpl( ! DicoCasFileFormat _ft, ! String _v, ! int _language) { if (Telemac2dFileFormat.getInstance() == _ft) ! return createTelemac2dVersionImpl( ! (Telemac2dFileFormat)_ft, ! _v, ! _language); ! DicoModelAbstract model= createDico(_ft.getName(), _v, _language); ! return model == null ? null : new TelemacDicoFileFormatVersion(_ft, model); } ! } --- 23,111 ---- */ public class TelemacDicoManager extends DicoManager { ! ! public final static TelemacDicoManager INSTANCE = new TelemacDicoManager(); ! private final static String LAST_VERSION = "v5p4"; static { ! HashMap map = new HashMap(11); ! map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.ARTEMIS_ID()), ! new String[] { LAST_VERSION}); ! map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.ESTEL2D_ID()), ! new String[] { LAST_VERSION}); ! map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.ESTEL3D_ID()), ! new String[] { LAST_VERSION}); ! map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.POSTEL3D_ID()), ! new String[] { LAST_VERSION}); ! map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.SISYPHE_ID()), ! new String[] { LAST_VERSION}); ! map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.STBTEL_ID()), ! new String[] { LAST_VERSION}); ! map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.SUBIEF2D_ID()), ! new String[] { LAST_VERSION}); ! map.put(Telemac2dFileFormat.getInstance(), new String[] { LAST_VERSION}); ! map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.TELEMAC3D_ID()), ! new String[] { LAST_VERSION}); ! map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.TOMAWAC_ID()), ! new String[] { LAST_VERSION}); INSTANCE.init(map); INSTANCE.load(); } + //pour eviter d'instancier ce format a chaque fois. private Telemac2dFileFormat.TelemacVersion telemac2dv5p4_; + public final static TelemacDicoManager getINSTANCE() { return INSTANCE; } + protected TelemacDicoManager() { super("org.fudaa.dodico.telemac.dico."); } + protected DicoCasFileFormat createFormat(String _s) { if (_s.equals(Telemac2dFileFormat.getInstance().getID())) ! return Telemac2dFileFormat.getInstance(); return new TelemacDicoFileFormat(_s); } + public static boolean isTelemac2d(DicoCasFileFormat _f) { return _f == Telemac2dFileFormat.getInstance(); } ! ! public DicoCasFileFormatVersion createVersionImpl(Telemac2dFileFormat _ft, String _v, ! int _language) { return createTelemacVersionImpl(_ft, _v, _language); } ! ! public DicoCasFileFormatVersion createVersionImpl(DicoCasFileFormat _ft, String _v, int _language) { return createTelemacVersionImpl(_ft, _v, _language); } ! ! public Telemac2dFileFormat.TelemacVersion createTelemac2dVersionImpl(Telemac2dFileFormat _ft, ! String _v, int _language) { ! String name = Telemac2dFileFormat.getInstance().getName(); ! String lastVersion = LAST_VERSION; ! if ((lastVersion.equals(_v)) && (DicoLanguage.getCurrentID() == _language)) { ! if (CtuluLib.DEBUG) CtuluLib.debug("new instance for telemac 2d"); if (telemac2dv5p4_ == null) ! telemac2dv5p4_ = _ft.createVersion(createDico(name, _v, _language)); return telemac2dv5p4_; } return _ft.createVersion(createDico(name, _v, _language)); } ! ! public TelemacDicoFileFormatVersion createTelemacVersionImpl(Telemac2dFileFormat _ft, String _v, ! int _language) { return createTelemac2dVersionImpl(_ft, _v, _language); } ! ! public TelemacDicoFileFormatVersion createTelemacVersionImpl(DicoCasFileFormat _ft, String _v, ! int _language) { if (Telemac2dFileFormat.getInstance() == _ft) ! return createTelemac2dVersionImpl((Telemac2dFileFormat) _ft, _v, _language); ! DicoModelAbstract model = createDico(_ft.getName(), _v, _language); ! if (model == null) return null; ! if (_ft.getName().equals(H2dTelemacDicoParams.SUBIEF2D_ID())) ! return new TelemacSubief2dFileFormatVersion(_ft, model); ! return new TelemacDicoFileFormatVersion(_ft, model); } ! } \ No newline at end of file Index: TelemacDicoFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/TelemacDicoFileFormat.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TelemacDicoFileFormat.java 5 May 2004 12:38:17 -0000 1.1 --- TelemacDicoFileFormat.java 11 Jun 2004 16:34:22 -0000 1.2 *************** *** 1,3 **** ! /* * @file TelemacDicoFileFormat.java * @creation 14 août 2003 --- 1,3 ---- ! /** * @file TelemacDicoFileFormat.java * @creation 14 août 2003 |