|
From: <de...@us...> - 2003-08-18 11:21:41
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv3430/telemac
Modified Files:
TelemacDicoManager.java
Log Message:
Maj des projets hydraulique 2d
Index: TelemacDicoManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TelemacDicoManager.java 6 Aug 2003 15:55:51 -0000 1.5
--- TelemacDicoManager.java 18 Aug 2003 11:05:20 -0000 1.6
***************
*** 9,15 ****
--- 9,22 ----
package org.fudaa.dodico.telemac;
+ import java.util.HashMap;
+
+ import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.dico.DicoCasFileFormat;
+ import org.fudaa.dodico.dico.DicoCasFileFormatVersion;
import org.fudaa.dodico.dico.DicoLanguage;
import org.fudaa.dodico.dico.DicoManager;
import org.fudaa.dodico.dico.DicoModelAbstract;
+ import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
+ import org.fudaa.dodico.telemac.io.TelemacDicoFileFormat;
/**
***************
*** 17,71 ****
* @version $Id$
*/
! public class TelemacDicoManager extends DicoManager
! {
!
! private final static TelemacDicoManager INSTANCE = new TelemacDicoManager();
! // private final static DicoModelAbstract Telemac2dv5p3=new DicoTelemac2dv5p3();
! public final static TelemacDicoManager getINSTANCE()
! {
! return INSTANCE;
! }
!
!
- protected TelemacDicoManager()
- {
- super(
- new DicoManager.DicoDescription[] {
- new DicoManager.DicoDescription("artemis","v5p3"),
- new DicoManager.DicoDescription("estel","2dv5p3"),
- new DicoManager.DicoDescription("estel","3dv5p3"),
- new DicoManager.DicoDescription("postel3d","v5p3"),
- new DicoManager.DicoDescription("sisyphe","v5p3"),
- new DicoManager.DicoDescription("stbtel","v5p3"),
- new DicoManager.DicoDescription("subief2d","v5p3"),
- new DicoManager.DicoDescription("telemac2d","v5p3"),
- new DicoManager.DicoDescription("telemac3d","v5p3"),
- new DicoManager.DicoDescription("tomawac","v5p3"),
- },
- "org.fudaa.dodico.telemac.dico.");
}
! public static void main(String[] args)
! {
! System.out.println(TelemacDicoManager.INSTANCE.getLastVersion("telemac2d"));
! System.out.println(TelemacDicoManager.INSTANCE.getLastVersion("telemac2d",DicoLanguage.ENGLISH_ID));
}
! /**
! *
! */
! public DicoModelAbstract createDico(DicoDescription _desc, int _language)
! {
! // if( (_desc.getName().equals(Telemac2dv5p3.getCodeName()))
! // && (_desc.getVersion().equals(Telemac2dv5p3.getVersion()))
! // && (_language==Telemac2dv5p3.getLanguageIndex()))
! // {
! // return Telemac2dv5p3;
! // }
! //
! return super.createDico(_desc, _language);
}
--- 24,55 ----
* @version $Id$
*/
! public class TelemacDicoManager extends DicoManager {
! public final static TelemacDicoManager INSTANCE= new TelemacDicoManager();
! static {
! HashMap map= new HashMap(11);
! map.put(new TelemacDicoFileFormat("artemis"), new String[] { "v5p3" });
! map.put(new TelemacDicoFileFormat("estel2d"), new String[] { "v5p3" });
! map.put(new TelemacDicoFileFormat("estel3d"), new String[] { "v5p3" });
! map.put(new TelemacDicoFileFormat("postel3d"), new String[] { "v5p3" });
! map.put(new TelemacDicoFileFormat("sisyphe"), new String[] { "v5p3" });
! map.put(new TelemacDicoFileFormat("stbtel"), new String[] { "v5p3" });
! map.put(new TelemacDicoFileFormat("subief2d"), new String[] { "v5p3" });
! map.put(Telemac2dFileFormat.getInstance(), new String[] { "v5p3" });
! map.put(new TelemacDicoFileFormat("telemac3d"), new String[] { "v5p3" });
! map.put(new TelemacDicoFileFormat("tomawac"), new String[] { "v5p3" });
! INSTANCE.init(map);
}
+ //pour eviter d'instancier ce format a chaque fois.
+ private DicoCasFileFormatVersion telemac2dv5p3_;
! public final static TelemacDicoManager getINSTANCE() {
! return INSTANCE;
}
! protected TelemacDicoManager() {
! super("org.fudaa.dodico.telemac.dico.");
}
***************
*** 73,87 ****
*
*/
! public DicoModelAbstract createDico(DicoDescription _desc)
! {
! // if( (_desc.getName().equals(Telemac2dv5p3.getCodeName()))
! // && (_desc.getVersion().equals(Telemac2dv5p3.getVersion()))
! // && (DicoLanguage.getCurrentID()==Telemac2dv5p3.getLanguageIndex()))
! // {
! // return Telemac2dv5p3;
! // }
!
! return super.createDico(_desc);
}
}
--- 57,80 ----
*
*/
! public DicoCasFileFormat createFormat(String _s) {
! return new TelemacDicoFileFormat(_s);
}
+ public DicoCasFileFormatVersion createVersionImpl(
+ DicoCasFileFormat _ft,
+ String _v,
+ int _language) {
+ if (("telemac2d".equals(_ft.getName()))
+ && ("v5p3".equals(_v))
+ && (DicoLanguage.getCurrentID() == _language)) {
+ if (DodicoLib.DEBUG)
+ System.out.println("recupere instance telemac 2d");
+ if (telemac2dv5p3_ == null)
+ telemac2dv5p3_=
+ createVersionImpl(getFileFormat("telemac2d"), "v5p3", _language);
+ return telemac2dv5p3_;
+ }
+ return super.createVersionImpl(_ft, _v, _language);
+
+ }
}
|