|
From: <de...@us...> - 2003-08-18 11:21:41
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers
In directory sc8-pr-cvs1:/tmp/cvs-serv3430/fichiers
Modified Files:
FileFormat.java FileOperationInterface.java
FileOperationSynthese.java
Log Message:
Maj des projets hydraulique 2d
Index: FileFormat.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileFormat.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileFormat.java 4 Jul 2003 12:41:19 -0000 1.1
--- FileFormat.java 18 Aug 2003 11:05:19 -0000 1.2
***************
*** 14,18 ****
import org.fudaa.dodico.commun.DodicoLib;
- import org.fudaa.dodico.commun.ProgressionInterface;
/**
--- 14,17 ----
***************
*** 21,29 ****
* @version $Id$
*/
! public abstract class FileFormat
! {
!
! public static final int MODE_ASCII = 0;
! public static final int MODE_BINAIRE = 1;
//Le nombre de fichiers demandé par ce format.
private int nbFile_;
--- 20,26 ----
* @version $Id$
*/
! public abstract class FileFormat {
! public static final int MODE_ASCII= 0;
! public static final int MODE_BINAIRE= 1;
//Le nombre de fichiers demandé par ce format.
private int nbFile_;
***************
*** 31,57 ****
protected String nom_;
protected String ID_;
- protected String version_;
protected String description_;
protected int mode_;
protected BuInformationsSoftware software_;
! public FileFormat(int _nbFile)
! {
if (_nbFile < 1)
throw new IllegalArgumentException("Nombre de fichier strictement positif");
! nbFile_ = _nbFile;
}
/**
* Returns the description.
* @return String
*/
! public String getDescription()
! {
return description_;
}
! public String getID()
! {
return ID_;
}
--- 28,62 ----
protected String nom_;
protected String ID_;
protected String description_;
protected int mode_;
+ //le type du fichier projet,maillage,autre,...
+ protected int type_;
protected BuInformationsSoftware software_;
! public FileFormat(int _nbFile) {
if (_nbFile < 1)
throw new IllegalArgumentException("Nombre de fichier strictement positif");
! nbFile_= _nbFile;
! }
!
! public int getVersionNb(){
! return 1;
! }
!
! public String[] getVersions() {
! return new String[]{getLastVersion()};
}
+ public abstract String getLastVersion();
+
/**
* Returns the description.
* @return String
*/
! public String getDescription() {
return description_;
}
! public String getID() {
return ID_;
}
***************
*** 61,66 ****
* @return String[]
*/
! public String[] getExtensions()
! {
return extensions_;
}
--- 66,70 ----
* @return String[]
*/
! public String[] getExtensions() {
return extensions_;
}
***************
*** 70,84 ****
* @return int
*/
! public int getMode()
! {
return mode_;
}
/**
* Returns the nbFile.
* @return int
*/
! public final int getNbFile()
! {
return nbFile_;
}
--- 74,90 ----
* @return int
*/
! public int getMode() {
return mode_;
}
+ public int getType() {
+ return type_;
+ }
+
/**
* Returns the nbFile.
* @return int
*/
! public final int getNbFile() {
return nbFile_;
}
***************
*** 88,93 ****
* @return String
*/
! public String getName()
! {
return nom_;
}
--- 94,98 ----
* @return String
*/
! public String getName() {
return nom_;
}
***************
*** 97,102 ****
* @return BuInformationsSoftware
*/
! public BuInformationsSoftware getSoftware()
! {
return software_;
}
--- 102,106 ----
* @return BuInformationsSoftware
*/
! public BuInformationsSoftware getSoftware() {
return software_;
}
***************
*** 109,253 ****
* et correspondant aux extensions.
*/
! public final File[] getFile(File _fInit)
! {
! File[] r = new File[nbFile_];
if (_fInit == null)
return r;
if (nbFile_ == 1)
return new File[] { _fInit };
! String base = DodicoLib.getSansExtension(_fInit.getAbsolutePath());
! for (int i = 0; i < nbFile_; i++)
! {
! r[i] = new File(base + "." + extensions_[i]);
}
return r;
}
-
- public static void initOperation(
- FileOperationSynthese _synt,
- FileOperationInterface _op,
- ProgressionInterface _progress,
- File _f)
- {
- _op.setProgressReceiver(_progress);
- _op.setFile(_f);
- _synt.setMainFile(_f);
- }
-
- public static FileOperationSynthese initOperation(
- FileOperationInterface _op,
- ProgressionInterface _progress,
- File _f)
- {
- FileOperationSynthese r = new FileOperationSynthese();
- initOperation(r,_op,_progress,_f);
- return r;
- }
-
- /**
- * Methode generale permettant de lire le fichier _f et renvoie une structure
- * donnant la synthese (resultat, erreur) de la lecture.
- * @param _progress l'etat d'avancement de la lecture.
- */
- // public final FileOperationSynthese read(File _f, ProgressionInterface _progress)
- // {
- // FileReaderInterface r = createReader();
- // IOException[] exs = read(_f, r, _progress);
- // return new FileOperationSynthese(_f, r, exs);
- // }
-
- /**
- * Permet de le lire le fichier <code>_f</code>.
- * @return les exceptions levees lors de la fermeture du flux.
- */
- // public final IOException[] read(File _f, FileReaderInterface _r, ProgressionInterface _progress)
- // {
- // if (getNbFile() == 1)
- // {
- // _r.setFile(_f);
- // _r.setProgressReceiver(_progress);
- // _r.read();
- // return _r.close();
- // }
- // else
- // return read(getFile(_f), _r, _progress);
- // }
- //
- // public static final IOException[] readFile(File _f, FileReaderInterface _reader, ProgressionInterface _progress)
- // {
- // _reader.setFile(_f);
- // _reader.setProgressReceiver(_progress);
- // _reader.read();
- // return _reader.close();
- // }
- //
- // public static final IOException[] readFile(File[] _f, FileReaderInterface _reader, ProgressionInterface _progress)
- // {
- // _reader.setFile(_f);
- // _reader.setProgressReceiver(_progress);
- // _reader.read();
- // return _reader.close();
- // }
- //
- // public final FileOperationSynthese read(File[] _f)
- // {
- // return read(_f, null);
- // }
- //
- // public final IOException[] read(File[] _f, FileReaderInterface _r, ProgressionInterface _progress)
- // {
- // int l = _f.length;
- // if (l != getNbFile())
- // throw new IllegalArgumentException("Le nombre de fichier donne " + l + DodicoLib.LINE_SEP + "Nb Fichier attendu " + getNbFile());
- // _r.setFile(_f);
- // _r.setProgressReceiver(_progress);
- // _r.read();
- // return _r.close();
- //
- // }
- //
- //
- // public final FileOperationSynthese read(File[] _f, ProgressionInterface _progress)
- // {
- // FileReaderInterface r = createReader();
- // IOException[] exs = read(_f, r, _progress);
- // return new FileOperationSynthese(_f, r, exs);
- // }
- //
- // public final FileOperationSynthese write(File _f, Object _interface, ProgressionInterface _progress)
- // {
- // if (getNbFile() == 1)
- // {
- // FileWriterInterface r = createWriter();
- // r.setFile(_f);
- // r.setInterface(_interface);
- // r.setProgressReceiver(_progress);
- // r.write();
- // IOException[] exs = r.close();
- // return new FileOperationSynthese(_f, r, exs);
- // }
- // else
- // return write(getFile(_f), _interface, _progress);
- // }
- //
- // public final FileOperationSynthese write(File[] _f, Object _interface)
- // {
- // return write(_f, _interface, null);
- // }
- //
- // public final FileOperationSynthese write(File[] _f, Object _interface, ProgressionInterface _progress)
- // {
- // int l = _f.length;
- // if (l != getNbFile())
- // throw new IllegalArgumentException("Le nombre de fichier donne " + l + DodicoLib.LINE_SEP + "Nb Fichier attendu " + getNbFile());
- // FileWriterInterface r = createWriter();
- // r.setFile(_f);
- // r.setProgressReceiver(_progress);
- // r.setInterface(_interface);
- // r.write();
- // IOException[] exs = r.close();
- // return new FileOperationSynthese(_f, r, exs);
- // }
- //
}
--- 113,128 ----
* et correspondant aux extensions.
*/
! public final File[] getFile(File _fInit) {
! File[] r= new File[nbFile_];
if (_fInit == null)
return r;
if (nbFile_ == 1)
return new File[] { _fInit };
! String base= DodicoLib.getSansExtension(_fInit.getAbsolutePath());
! for (int i= 0; i < nbFile_; i++) {
! r[i]= new File(base + "." + extensions_[i]);
}
return r;
}
}
Index: FileOperationInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileOperationInterface.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileOperationInterface.java 4 Jul 2003 12:41:19 -0000 1.1
--- FileOperationInterface.java 18 Aug 2003 11:05:19 -0000 1.2
***************
*** 23,27 ****
public void setProgressReceiver(ProgressionInterface progressReceiver);
public void setFile(File _f);
! public FileFormat getFileFormat();
}
--- 23,27 ----
public void setProgressReceiver(ProgressionInterface progressReceiver);
public void setFile(File _f);
! //public FileFormat getFileFormat();
}
Index: FileOperationSynthese.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileOperationSynthese.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FileOperationSynthese.java 4 Jul 2003 12:41:19 -0000 1.1
--- FileOperationSynthese.java 18 Aug 2003 11:05:19 -0000 1.2
***************
*** 30,33 ****
--- 30,38 ----
+ public void printAnalyze(){
+ if(analyze_!=null) analyze_.printResume();
+ else System.out.println("Pas d'erreur");
+ }
+
/**
*
|