You can subscribe to this list here.
2003 |
Jan
|
Feb
(89) |
Mar
(219) |
Apr
(82) |
May
(33) |
Jun
(11) |
Jul
(129) |
Aug
(357) |
Sep
(34) |
Oct
(37) |
Nov
(42) |
Dec
(182) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(74) |
Mar
(196) |
Apr
(205) |
May
(109) |
Jun
(268) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <de...@us...> - 2004-03-12 10:35:40
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9059/src/org/fudaa/dodico/commun Modified Files: dodico_en.fr_txt DodicoLib.java Log Message: Correction bufg EbliFlles... Ajout commentaire tr Finalisation superviseur Index: dodico_en.fr_txt =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/dodico_en.fr_txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dodico_en.fr_txt 12 Feb 2004 15:32:43 -0000 1.8 --- dodico_en.fr_txt 12 Mar 2004 10:16:11 -0000 1.9 *************** *** 108,110 **** Comporte les définitions de points,polylignes et polygones=Contains nodes,polygons and polylines Ligne ignorée :Skipped line ! Nombre d'éléments/noeuds détectés=Number of elements/nodes detected \ No newline at end of file --- 108,112 ---- Comporte les définitions de points,polylignes et polygones=Contains nodes,polygons and polylines Ligne ignorée :Skipped line ! Nombre d'éléments/noeuds détectés=Number of elements/nodes detected ! Exécutable=Executable ! Exécuter=Executer Index: DodicoLib.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoLib.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** DodicoLib.java 12 Feb 2004 15:32:43 -0000 1.22 --- DodicoLib.java 12 Mar 2004 10:16:12 -0000 1.23 *************** *** 396,458 **** return r; } public static boolean replaceAndCopyFile( ! File _fileFrom, ! File _fileTo, ! String _oldToken, ! String _newToken) { ! return replaceAndCopyFile(_fileFrom, _fileTo, _oldToken, _newToken, null); } public static boolean replaceAndCopyFile( ! File _fileFrom, ! File _fileTo, ! String _oldToken, ! String _newToken, ! String _encoding) { ! boolean r= true; ! BufferedReader reader= null; ! Writer writer= null; ! try { ! reader= ! new BufferedReader( ! (_encoding == null ! ? new FileReader(_fileFrom) ! : new InputStreamReader(new FileInputStream(_fileFrom), _encoding))); ! writer= ! new BufferedWriter( ! (_encoding == null ! ? new FileWriter(_fileTo) ! : new OutputStreamWriter(new FileOutputStream(_fileTo), _encoding))); ! StringBuffer b= new StringBuffer((int)_fileFrom.length()); ! int lu; ! while ((lu= reader.read()) != -1) { ! b.append((char)lu); ! } ! String n= FuLib.replace(b.toString(), _oldToken, _newToken); ! writer.write(n); ! // String line; ! // while ((line = reader.readLine()) != null) ! // { ! // writer.write(FuLib.replace(line, _oldToken, _newToken)); ! // } ! writer.flush(); ! } catch (FileNotFoundException io) { ! System.out.println("file not found " + io.getMessage()); ! r= false; ! } catch (UnsupportedEncodingException io) { ! System.out.println("encode not supported " + io.getMessage()); ! r= false; ! } catch (IOException io) { ! System.out.println("i/o error " + io.getMessage()); ! r= false; ! } finally { try { ! if (reader != null) ! reader.close(); ! if (writer != null) ! writer.close(); ! } catch (IOException _io) {} } ! return r; ! } public static String capitalyze(String s) { if ((s == null) || (s.length() == 0)) { --- 396,482 ---- return r; } + public static boolean replaceAndCopyFile( ! File _fileFrom, ! File _fileTo, ! String _oldToken, ! String _newToken,String _encoding) { ! return replaceAndCopyFile(_fileFrom,_fileTo,_oldToken,_newToken,null,null,_encoding); } + public static boolean replaceAndCopyFile( ! File _fileFrom, ! File _fileTo, ! String _oldToken, ! String _newToken) { ! return replaceAndCopyFile(_fileFrom,_fileTo,_oldToken,_newToken,null,null,null); ! } ! ! ! public static boolean replaceAndCopyFile( ! File _fileFrom, ! File _fileTo, ! String _oldToken, ! String _newToken,String _oldToken1,String _newToken1) { ! return replaceAndCopyFile(_fileFrom,_fileTo,_oldToken,_newToken,_oldToken1,_newToken1,null); ! } ! ! public static boolean replaceAndCopyFile( ! File _fileFrom, ! File _fileTo, ! String _oldToken, ! String _newToken,String _oldToken1,String _newToken1, ! String _encoding) { ! boolean r= true; ! BufferedReader reader= null; ! Writer writer= null; try { ! reader= ! new BufferedReader( ! (_encoding == null ! ? new FileReader(_fileFrom) ! : new InputStreamReader(new FileInputStream(_fileFrom), _encoding))); ! writer= ! new BufferedWriter( ! (_encoding == null ! ? new FileWriter(_fileTo) ! : new OutputStreamWriter(new FileOutputStream(_fileTo), _encoding))); ! StringBuffer b= new StringBuffer((int)_fileFrom.length()); ! int lu; ! while ((lu= reader.read()) != -1) { ! b.append((char)lu); ! } ! String n= FuLib.replace(b.toString(), _oldToken, _newToken); ! if((_oldToken1!=null) && (_newToken1!=null)) ! n= FuLib.replace(n, _oldToken1, _newToken1); ! ! writer.write(n); ! // String line; ! // while ((line = reader.readLine()) != null) ! // { ! // writer.write(FuLib.replace(line, _oldToken, _newToken)); ! // } ! writer.flush(); ! } catch (FileNotFoundException io) { ! System.out.println("file not found " + io.getMessage()); ! r= false; ! } catch (UnsupportedEncodingException io) { ! System.out.println("encode not supported " + io.getMessage()); ! r= false; ! } catch (IOException io) { ! System.out.println("i/o error " + io.getMessage()); ! r= false; ! } finally { ! try { ! if (reader != null) ! reader.close(); ! if (writer != null) ! writer.close(); ! } catch (IOException _io) {} ! } ! return r; } ! ! public static String capitalyze(String s) { if ((s == null) || (s.length() == 0)) { |
From: <de...@us...> - 2004-03-12 10:35:39
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9059/src/org/fudaa/dodico/reflux/io Modified Files: CorEleBthInterface.java Log Message: Correction bufg EbliFlles... Ajout commentaire tr Finalisation superviseur Index: CorEleBthInterface.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/CorEleBthInterface.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CorEleBthInterface.java 12 Feb 2004 15:32:46 -0000 1.6 --- CorEleBthInterface.java 12 Mar 2004 10:16:13 -0000 1.7 *************** *** 8,13 **** */ package org.fudaa.dodico.reflux.io; - import org.fudaa.dodico.corba.geometrie.SMaillageIndex; - import org.fudaa.dodico.ef.EfGrid; import org.fudaa.dodico.ef.EfGridSource; --- 8,11 ---- |
From: <de...@us...> - 2004-03-10 09:43:44
|
Update of /cvsroot/fudaa/fudaa_devel/ctulu/src/org/fudaa/ctulu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11773/src/org/fudaa/ctulu Modified Files: CtuluLib.java Log Message: Maj Index: CtuluLib.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/ctulu/src/org/fudaa/ctulu/CtuluLib.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CtuluLib.java 19 Dec 2003 12:00:41 -0000 1.2 --- CtuluLib.java 10 Mar 2004 09:25:54 -0000 1.3 *************** *** 11,14 **** --- 11,16 ---- import java.io.File; import java.io.IOException; + import java.util.Locale; + /** *************** *** 18,115 **** public class CtuluLib { ! public final static boolean DEBUG= "TRUE".equals(System.getProperty("DEBUG")); ! public final static String[] EMPTY_STRING_ARRAY= new String[0]; ! public final static String EMPTY_STRING= ""; ! public final static String ZERO= "0"; ! public final static String UN= "1"; ! public final static String DEUX= "2"; ! public final static String TROIS= "3"; ! public final static String QUATRE= "4"; ! public final static String CINQ= "5"; ! public final static String SIX= "6"; ! public final static String SEPT= "7"; ! public final static String HUIT= "8"; ! public final static String NEUF= "9"; ! public final static String DIX= "10"; ! public final static String SEP_LINE= "\n"; ! public final static String ESPACE= " "; ! /** */ ! public final static String LINE_SEP= System.getProperty("line.separator"); public static void debug(String _s) { System.out.println("DEBUG: " + _s); } public static void error(String _s) { ! System.out.println("ERROR: " + _s); } public static long getDuration( ! int _y, ! int _m, ! int _d, ! int _h, ! int _min, ! int _s) { ! return (long)_s ! + (long)_min * 60l ! + (long)_h * 3600l ! + (long)_d * 86400 ! + (long)_m * 86400l * 30l ! + (long)_y * 365l * 86400l; } /** ! * initialise <code>_containter</code> avec [year,month,day,hour,minut,sec]: ! * le tableau DOIT contenir au moins 6 rangs. */ public static void getYearMonthDayTime(int[] _container, long _s) { ! long d= 365 * 86400; ! long timeRest= _s; ! long value= timeRest / d; ! _container[0]= (int)value; if (value > 0) { ! timeRest= timeRest - value * d; } ! d= 30 * 86400; ! value= timeRest / d; ! _container[1]= (int)value; if (value > 0) { ! timeRest= timeRest - value * d; } ! d= 86400; ! value= timeRest / d; ! _container[2]= (int)value; if (value > 0) { ! timeRest= timeRest - value * d; } ! d= 3600; ! value= timeRest / d; ! _container[3]= (int)value; if (value > 0) { ! timeRest= timeRest - value * d; } ! d= 60; ! value= timeRest / d; ! _container[4]= (int)value; if (value > 0) { ! timeRest= timeRest - value * d; } ! _container[5]= (int)timeRest; } /** ! * @return un tableau a 6 rangee [year,month,day,hour,minut,sec] calcule a partir ! * du temps _s */ public static int[] getYearMonthDayTime(long _s) { ! int[] r= new int[6]; getYearMonthDayTime(r, _s); return r; } - /** - * - */ private CtuluLib() { super(); --- 20,190 ---- public class CtuluLib { ! /** ! * Variable de déboguage. Activée avec la variable globale DEBUG "java -DDEBUG=TRUE" ! */ ! public final static boolean DEBUG = "TRUE".equals(System.getProperty("DEBUG")); ! /** ! * Tableau vide ! */ ! public final static String[] EMPTY_STRING_ARRAY = new String[0]; ! ! /** ! * Chaine vide ! */ ! public final static String EMPTY_STRING = ""; ! /** ! * Chaine "0". Utile pour la conversion. ! */ ! public final static String ZERO = "0"; ! /** ! * Chaine "1". Utile pour la conversion. ! */ ! public final static String UN = "1"; ! /** ! * Chaine "2". Utile pour la conversion. ! */ ! public final static String DEUX = "2"; ! /** ! * Chaine "3". Utile pour la conversion. ! */ ! public final static String TROIS = "3"; ! /** ! * Chaine "4". Utile pour la conversion. ! */ ! public final static String QUATRE = "4"; ! /** ! * Chaine "5". Utile pour la conversion. ! */ ! public final static String CINQ = "5"; ! /** ! * Chaine "6". Utile pour la conversion. ! */ ! public final static String SIX = "6"; ! /** ! * Chaine "7". Utile pour la conversion. ! */ ! public final static String SEPT = "7"; ! /** ! * Chaine "8". Utile pour la conversion. ! */ ! public final static String HUIT = "8"; ! /** ! * Chaine "9". Utile pour la conversion. ! */ ! public final static String NEUF = "9"; ! /** ! * Chaine "10". Utile pour la conversion. ! */ ! public final static String DIX = "10"; ! ! /** ! * Chaine " " ! */ ! public final static String ESPACE = " "; ! ! /** ! * Chaine separatrice de ligne ! */ ! public final static String LINE_SEP = System.getProperty("line.separator"); ! ! /** ! * Ecrit sur la sortie standart DEBUG+_s ! * ! * @param _s la chaine a ecrire ! */ public static void debug(String _s) { System.out.println("DEBUG: " + _s); } + /** + * Ecrit sur la sortie d'erreur ERROR+_s + * + * @param _s la chaine a ecrire + */ public static void error(String _s) { ! System.err.println("ERROR: " + _s); } + + /** + * Renvoie la duree en seconde + * + * @param _y nb annees + * @param _m nb mois + * @param _d nb jours + * @param _h nb heures + * @param _min nb minutes + * @param _s nb secondes + * @return nb seconde totale + */ public static long getDuration( ! int _y, ! int _m, ! int _d, ! int _h, ! int _min, ! int _s) { ! return (long) _s ! + (long) _min * 60l ! + (long) _h * 3600l ! + (long) _d * 86400 ! + (long) _m * 86400l * 30l ! + (long) _y * 365l * 86400l; } + /** ! * initialise <code>_containter</code> avec [year,month,day,hour,minut,sec]: le tableau DOIT ! * contenir au moins 6 rangs. ! * ! * @param _container le tableau dans lequel les donnees seront mises ! * @param _s le nombre de secondes a convertir */ public static void getYearMonthDayTime(int[] _container, long _s) { ! long d = 365 * 86400; ! long timeRest = _s; ! long value = timeRest / d; ! _container[0] = (int) value; if (value > 0) { ! timeRest = timeRest - value * d; } ! d = 30 * 86400; ! value = timeRest / d; ! _container[1] = (int) value; if (value > 0) { ! timeRest = timeRest - value * d; } ! d = 86400; ! value = timeRest / d; ! _container[2] = (int) value; if (value > 0) { ! timeRest = timeRest - value * d; } ! d = 3600; ! value = timeRest / d; ! _container[3] = (int) value; if (value > 0) { ! timeRest = timeRest - value * d; } ! d = 60; ! value = timeRest / d; ! _container[4] = (int) value; if (value > 0) { ! timeRest = timeRest - value * d; } ! _container[5] = (int) timeRest; } /** ! * @param _s Le nombre de seconde a convertir. ! * @return un tableau a 6 rangee [year,month,day,hour,minut,sec] calcule a partir du temps _s */ public static int[] getYearMonthDayTime(long _s) { ! int[] r = new int[6]; getYearMonthDayTime(r, _s); return r; } private CtuluLib() { super(); *************** *** 119,176 **** if (_i < 11) { switch (_i) { ! case 0 : ! return ZERO; ! case 1 : ! return UN; ! case 2 : ! return DEUX; ! case 3 : ! return TROIS; ! case 4 : ! return QUATRE; ! case 5 : ! return CINQ; ! case 6 : ! return SIX; ! case 7 : ! return SEPT; ! case 8 : ! return HUIT; ! case 9 : ! return NEUF; ! case 10 : ! return DIX; ! default : ! return _i + ""; } ! } else ! return _i + ""; } public static File getAbsolutePath(String _baseDir, String _path) { ! File f= new File(_path); if (f.isAbsolute()) return f; ! else ! return new File(_baseDir, _path); } /** ! * if _path is absolute return new File(_path) else return ! * new File(_baseDir,_path) ! * @return null if one arg is null. */ public static File getAbsolutePath(File _baseDir, String _path) { ! if ((_path == null) || (_baseDir == null)) ! return null; ! File f= new File(_path); if (f.isAbsolute()) return f; ! else ! return getConanicalPathFile(new File(_baseDir, _path)); } /** ! * Renvoie le chemin canonique du fichier _f. Si une exception est levee ! * renvoie le chemin absolu. * @return une valeur non nulle * @see java.io.File#getCanonicalFile(); --- 194,263 ---- if (_i < 11) { switch (_i) { ! case 0: ! return ZERO; ! case 1: ! return UN; ! case 2: ! return DEUX; ! case 3: ! return TROIS; ! case 4: ! return QUATRE; ! case 5: ! return CINQ; ! case 6: ! return SIX; ! case 7: ! return SEPT; ! case 8: ! return HUIT; ! case 9: ! return NEUF; ! case 10: ! return DIX; ! default: ! return _i + ""; } ! } else ! return _i + ""; } + /** + * Si _path est absolu renvoie new File(_path) sinon renvoie new File(_baseDir,_path) + * + * @return null si un argument est nul. + * @param _baseDir le repertoire de base + * @param _path le path a convertir + */ public static File getAbsolutePath(String _baseDir, String _path) { ! File f = new File(_path); if (f.isAbsolute()) return f; ! else ! return new File(_baseDir, _path); } + /** ! * Si _path est absolu renvoie new File(_path) sinon renvoie new File(_baseDir,_path) ! * ! * @return null si un argument est nul. ! * @param _baseDir le repertoire de base ! * @param _path le path a convertir */ public static File getAbsolutePath(File _baseDir, String _path) { ! if ((_path == null) || (_baseDir == null)) ! return null; ! File f = new File(_path); if (f.isAbsolute()) return f; ! else ! return getConanicalPathFile(new File(_baseDir, _path)); } /** ! * Renvoie le chemin canonique du fichier _f. Si une exception est levee renvoie le chemin ! * absolu. ! * ! * @param _f le path canonique * @return une valeur non nulle * @see java.io.File#getCanonicalFile(); *************** *** 178,282 **** */ public static String getCanonicalPath(File _f) { ! String path= null; try { ! path= _f.getCanonicalPath(); } catch (IOException e) { e.printStackTrace(); ! path= _f.getAbsolutePath(); } return path; } public static File getConanicalPathFile(File _f) { ! File path= null; try { ! path= _f.getCanonicalFile(); } catch (IOException e) { e.printStackTrace(); ! path= _f.getAbsoluteFile(); } return path; } /** ! * Cherche l'index de la chaine <code>_string</code> ! * dans le tableau <code>_stringArray</code>. Renvoie <code>-1</code> si ! * l'un des deux parametres est nuls. * @return index si l'action du composant est trouvee dans le tableau, -1 sinon */ public static int getIndex(Object _obj, Object[] _objArray) { ! if ((_obj == null) || (_objArray == null)) { ! return -1; } ! int n= _objArray.length - 1; Object com; ! for (int i= n; i >= 0; i--) { ! com= _objArray[i]; ! if (_obj.equals(com)) ! return i; } return -1; } /** * Perment de déterminer le chemin relatif de _destFile par rapport a _baseDir. L'entier ! * _nbParentTest permet de limiter les recherches : maximum _nbParentTest repertoire parent teste ! * ( soit maximum _nbParentTest fois "../"). */ public static String getRelativeFile( ! File _destFile, ! File _baseDir, ! int _nbParentTest) { if (_destFile == null) return null; else if (_destFile.getParentFile().equals(_baseDir)) return _destFile.getName(); ! else if ((_baseDir == null) || (_destFile.getParentFile() == null)) ! return _destFile.getAbsolutePath(); ! String sFile= _destFile.getAbsolutePath(); ! String parentPath= _baseDir.getAbsolutePath(); if (sFile.startsWith(parentPath)) { ! String r= sFile.substring(parentPath.length()); if (r.startsWith(File.separator)) return r.substring(1); ! else ! return r; } ! File parent= _baseDir.getParentFile(); if (parent != null) { ! int nb= 1; ! if (_nbParentTest < 0) ! _nbParentTest= Integer.MAX_VALUE; while ((nb <= _nbParentTest) && (parent != null)) { ! parentPath= parent.getAbsolutePath(); if (sFile.startsWith(parentPath)) { ! StringBuffer r= new StringBuffer(); ! String append= ".." + File.separator; ! for (int i= nb; i > 0; i--) { r.append(append); } ! append= sFile.substring(parentPath.length()); ! if (append.startsWith(File.separator)) ! append= append.substring(1); r.append(append); return r.toString(); } nb++; ! parent= parent.getParentFile(); } } return _destFile.getAbsolutePath(); } ! ! public static void main(String[] args) { ! int[] ymht= ! getYearMonthDayTime( ! 3600 * 3 + 60 * 4 + 1 + 3600 * 24 * 1 + 3600 * 24 * 30 * 18); ! System.out.println("y=" + ymht[0]); ! System.out.println("m=" + ymht[1]); ! System.out.println("d=" + ymht[2]); ! System.out.println("h=" + ymht[3]); ! System.out.println("min=" + ymht[4]); ! System.out.println("s=" + ymht[5]); } - } --- 265,377 ---- */ public static String getCanonicalPath(File _f) { ! String path = null; try { ! path = _f.getCanonicalPath(); } catch (IOException e) { e.printStackTrace(); ! path = _f.getAbsolutePath(); } return path; } + + /** + * @param _f + * @return le fichier avec un chemin canonique + */ public static File getConanicalPathFile(File _f) { ! File path = null; try { ! path = _f.getCanonicalFile(); } catch (IOException e) { e.printStackTrace(); ! path = _f.getAbsoluteFile(); } return path; } + /** ! * Cherche l'index de la chaine <code>_string</code> dans le tableau <code>_stringArray</code>. ! * Renvoie <code>-1</code> si l'un des deux parametres est nuls. ! * * @return index si l'action du composant est trouvee dans le tableau, -1 sinon + * @param _obj objet a trouver + * @param _objArray tableau a parcourir */ public static int getIndex(Object _obj, Object[] _objArray) { ! if ((_obj == null) || (_objArray == null)) { ! return -1; } ! int n = _objArray.length - 1; Object com; ! for (int i = n; i >= 0; i--) { ! com = _objArray[i]; ! if (_obj.equals(com)) ! return i; } return -1; } + /** * Perment de déterminer le chemin relatif de _destFile par rapport a _baseDir. L'entier ! * _nbParentTest permet de limiter les recherches : maximum _nbParentTest repertoire parent teste ( ! * soit maximum _nbParentTest fois "../"). ! * ! * @param _destFile le fichier a traiter ! * @param _baseDir le repertoire de base ! * @param _nbParentTest le nombre de dossier parent a parcourir ! * @return le chemin relatif. */ public static String getRelativeFile( ! File _destFile, ! File _baseDir, ! int _nbParentTest) { if (_destFile == null) return null; else if (_destFile.getParentFile().equals(_baseDir)) return _destFile.getName(); ! else if ((_baseDir == null) || (_destFile.getParentFile() == null)) ! return _destFile.getAbsolutePath(); ! String sFile = _destFile.getAbsolutePath(); ! String parentPath = _baseDir.getAbsolutePath(); if (sFile.startsWith(parentPath)) { ! String r = sFile.substring(parentPath.length()); if (r.startsWith(File.separator)) return r.substring(1); ! else ! return r; } ! File parent = _baseDir.getParentFile(); if (parent != null) { ! int nb = 1; ! if (_nbParentTest < 0) ! _nbParentTest = Integer.MAX_VALUE; while ((nb <= _nbParentTest) && (parent != null)) { ! parentPath = parent.getAbsolutePath(); if (sFile.startsWith(parentPath)) { ! StringBuffer r = new StringBuffer(); ! String append = ".." + File.separator; ! for (int i = nb; i > 0; i--) { r.append(append); } ! append = sFile.substring(parentPath.length()); ! if (append.startsWith(File.separator)) ! append = append.substring(1); r.append(append); return r.toString(); } nb++; ! parent = parent.getParentFile(); } } return _destFile.getAbsolutePath(); } ! ! /** ! * @return true si la locale est egale a "fr". ! */ ! public static boolean isFrenchLanguageSelected(){ ! return "fr".equals(Locale.getDefault().getLanguage()); } } |
From: <de...@us...> - 2004-03-10 09:31:26
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469/src/org/fudaa/fudaa/tr Modified Files: TrImplHelper.java TrImplementation.java TrFileFormatManager.java Added Files: TrExplorer.java TrApplicationManager.java package.html Removed Files: TrCodePanel.java Log Message: Ajout du superviseur pour le prepro --- NEW FILE: TrExplorer.java --- /* * @file TrExplorer.java * @creation 8 mars 2004 * @modification $Date: 2004/03/10 09:13:29 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.util.Observable; import java.util.Observer; import com.memoire.bu.BuActionEnabler; import com.memoire.bu.BuExplorer; import com.memoire.bu.BuResource; import com.memoire.fu.FuFile; import org.fudaa.ebli.filechooser.EbliFavoriteFiles; /** * @author Fred Deniger * @version $id$ * */ public class TrExplorer extends BuExplorer implements Observer{ private TrApplicationManager appli_; private ActionListener dirAction_; private ActionListener fileAction_; /** * @param _appli * @param _path */ public TrExplorer(TrApplicationManager _appli, FuFile _path) { super(_appli.getImpl(), true, _path); EbliFavoriteFiles.INSTANCE.setObserver(this); miAntBuild_ = null; miCvsAdd_ = null; miCvsCommit_ = null; miCvsUpdate_ = null; miMake_ = null; setAppliManager(_appli); } protected void fireFileAction(String _action){ if("OUVRIR".equals(_action)){ appli_.ouvrir(getSelectedFile()); } } /** * @param _mng le nouveau gestion des appli. */ public final void setAppliManager(TrApplicationManager _mng){ appli_=_mng; buildMenuForDir(); buildMenuForFiles(); } private void buildMenuForFiles() { pmFiles_.removeAll(); miOuvrirFichier_ = pmFiles_.addMenuItem (BuResource.BU.getString("Ouvrir"), "OUVRIR_FICHIER", true); if(this.fileAction_==null) fileAction_=new FileActionListener(); appli_.buildCmdForMenuFile(pmFiles_,fileAction_); pmFiles_.addSeparator(); pmFiles_.addMenuItem(BuResource.BU.getString("Tout sélectionner"), "TOUTSELECTIONNER", true); pmFiles_.addSeparator(); pmFiles_.addMenuItem(BuResource.BU.getString("Renommer..."), "RENOMMER_FICHIER", true); pmFiles_.addMenuItem(BuResource.BU.getString("Détruire..."), "DETRUIRE_FICHIER", true); } private void buildMenuForDir(){ pmDirs_.removeAll(); if(this.dirAction_==null) dirAction_=new DirActionListener(); appli_.buildCmdForMenuDir(pmDirs_,dirAction_); pmDirs_.addSeparator(); pmDirs_.addMenuItem(BuResource.BU.getString("Ouvrir" ),"OUVRIR_REPERTOIRE" ,true); pmDirs_.addSeparator(); pmDirs_.addMenuItem(BuResource.BU.getString("Renommer..."),"RENOMMER_REPERTOIRE",true); pmDirs_.addMenuItem(BuResource.BU.getString("Détruire..."),"DETRUIRE_REPERTOIRE",true); } protected void updateMenuFiles() { int l = files_.getSelectedValues().length; BuActionEnabler.setEnabledForAction(pmFiles_, "OUVRIR_FICHIER", (l > 0) ); BuActionEnabler.setEnabledForAction(pmFiles_, "DETRUIRE_FICHIER", l == 1); BuActionEnabler.setEnabledForAction(pmFiles_, "RENOMMER_FICHIER", l == 1); pmFiles_.computeMnemonics(); appli_.updateOuvrirMenu(miOuvrirFichier_,l,getSelectedFile()); appli_.updateMenuFiles(l,getSelectedFile()); } protected void updateMenuCurrent() { /* * miCvsUpdate_.setEnabled (getCurrentDirectory().createChild("CVS" ).exists()); * miCvsCommit_.setEnabled (getCurrentDirectory().createChild("CVS" ).exists()); miAntBuild_ * .setEnabled (getCurrentDirectory().createChild("build.xml").exists()); miMake_ .setEnabled * (getCurrentDirectory().createChild("Makefile" ).exists()); */ } /** * @see java.util.Observer#update(java.util.Observable, java.lang.Object) */ public void update(Observable _o, Object _arg) { roots_.removeActionListener(this); roots_.removeAllItems(); super.addMtab(); roots_.addActionListener(this); } /** * @param _cmd la commande * @param _f le repertoire sélectionne */ public void dirAction(String _cmd,File _f){ appli_.dirAction(_cmd,_f); } /** * @param _cmd la commande * @param _f le fichier selectionne */ public void fileAction(String _cmd,File _f){ appli_.fileAction(_cmd,_f); } private class DirActionListener implements ActionListener{ /** * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent _e) { if(dirs_.getSelectedValues().length==1) TrExplorer.this.dirAction(_e.getActionCommand(),getSelectedDirectory()); } } private class FileActionListener implements ActionListener{ /** * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent _e) { if(files_.getSelectedValues().length==1) TrExplorer.this.fileAction(_e.getActionCommand(),getSelectedFile()); } } } --- NEW FILE: TrApplicationManager.java --- /* * @file TrMenuApplication.java * @creation 8 mars 2004 * @modification $Date: 2004/03/10 09:13:29 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import com.memoire.bu.BuDynamicMenu; import com.memoire.bu.BuMenu; import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuPopupMenu; import com.memoire.bu.BuResource; import com.memoire.bu.BuSeparator; import com.memoire.fu.FuFile; import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; import org.fudaa.fudaa.commun.exec.FudaaAppliManagerImpl; import org.fudaa.fudaa.meshviewer.Mv; /** * @author Fred DENIGER * @version $id$ */ public class TrApplicationManager extends FudaaAppliManagerImpl { private class TrAppliMainMenu extends BuDynamicMenu { /** * Appelle le constructeur avec "applications","APPLICATIONS" */ public TrAppliMainMenu() { super(TrResource.getS("Applications"), "APPLICATIONS"); } /** * @see com.memoire.bu.BuDynamicMenu#build() */ protected void build() { if (getMenuComponentCount() == 0) { buildTrItem(this); add(new BuSeparator()); TrApplicationManager.this.createMenuItems(this); } } /** * @see com.memoire.bu.BuDynamicMenu#isActive() */ protected boolean isActive() { return true; } } protected BuMenuItem createProject_; private BuDynamicMenu mainMenu_; /** * Constructeur par defaut. * * @param _impl l'implementation tr */ public TrApplicationManager(TrImplementation _impl) { super(_impl.getApplicationPreferences(), _impl); } private void buildMv(File _f) { Mv m = new Mv(); m.buildDefaultFrame(_f); m.pack(); m.setLocation(impl_.getFrame().getLocation()); m.show(); } /** * Permet de mettre a jour l'etat du menu ouvrir * @param _miOuvrirFichier * @param _nbSelectedFile * @param _selectedFile */ public void updateOuvrirMenu(BuMenuItem _miOuvrirFichier, int _nbSelectedFile, FuFile _selectedFile) { if (_nbSelectedFile == 1) { String s = ouvrir(_selectedFile, true); _miOuvrirFichier.setText(BuResource.BU.getString("Ouvrir") + CtuluLib.ESPACE + (s == null ? CtuluLib.EMPTY_STRING : "(" + s + ")")); _miOuvrirFichier.setEnabled(true); } else { _miOuvrirFichier.setText(BuResource.BU.getString("Ouvrir")); _miOuvrirFichier.setEnabled(false); } } /** * Ajoute les applications par defaut pour le prepro. * * @param _m */ protected void buildTrItem(BuMenu _m) { BuMenuItem it = new BuMenuItem(TrResource.getS("Explorateur")); it.setActionCommand("EXPLORER"); it.addActionListener(this); _m.add(it); it = new BuMenuItem(TrResource.getS("Meshiew")); it.setActionCommand("MESHVIEW"); it.addActionListener(this); _m.add(it); it = new BuMenuItem(TrResource.getS("Console")); it.setActionCommand("CONSOLE"); it.addActionListener(this); _m.add(it); } /** * @param _f le fichier a ouvrir */ protected void ouvrir(FuFile _f) { ouvrir(_f, false); } /** * @param _f le fichier a ouvrir */ protected String ouvrir(FuFile _f, boolean _infoOnly) { TrImplementation imp = getImpl(); String name = _f.getName(); TrFileFormatManager mng = imp.getFileFormatMng(); if (mng.isCasFile(name)) { if (_infoOnly) return TrResource.getS("Projet Télémac"); imp.ouvrirId(FileFormatSoftware.TELEMAC_IS.name, _f); } else if (mng.isRefluxFile(name)) { if (_infoOnly) return TrResource.getS("Projet Reflux"); imp.ouvrirId(FileFormatSoftware.REFLUX_IS.name, _f); } else if (_infoOnly) return TrResource.getS("MeshViewer"); if (mng.isGridExtension(name) != null) { buildMv(_f); } return null; } /** * CONSOLE, MESHVIEW,EXPLORER * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent _e) { String action = _e.getActionCommand(); if ("CONSOLE".equals(action)) { getImpl().openLogFrame(); } else if ("EXPLORER".equals(action)) { getImpl().showExplorer(); } else if ("MESHVIEW".equals(action)) { buildMv(null); } super.actionPerformed(_e); } /** * Methode a surcharger pour ajouter des actions au menu contextuel des rep. * Les evenements sont a recuperer dans la methode {@link #dirAction(String, File)}. * @param _m le menu contextuel a modifier * @param _l le listener a UTILISER ( dispatch les evenments) */ public void buildCmdForMenuDir(BuPopupMenu _m, ActionListener _l) {} /** * Methode a surcharger pour ajouter des actions au menu contextuel des fichiers. * Les evenements sont a recuperer dans la methode {@link #fileAction(String, File)}. * @param _m le menu de dest * @param _l le listener */ public void buildCmdForMenuFile(BuPopupMenu _m, ActionListener _l) { createProject_ = new BuMenuItem(null, TrResource.TR.getString("Créer projet")); createProject_.setActionCommand("CREATE_PROJECT"); createProject_.setIcon(BuResource.BU.getIcon("creer")); createProject_.addActionListener(_l); _m.add(createProject_); } /** * Methode appele par les items ajoutés dans la fonction {@link #buildCmdForMenuDir(BuPopupMenu, ActionListener)} * @param cmd la commande * @param _f le repertoire selectionne */ public void dirAction(String cmd, File _f) {} /** * @param cmd la commande envoyee * @param _f le fichier selectionnee */ public void fileAction(String cmd, File _f) { if ("CREATE_PROJECT".equals(cmd)) { createProject(_f); } } /** * Methode appele lors de l'action "creer projet" * @param _f le fichier maillage */ protected void createProject(File _f) { getImpl().creer(_f); } /** * @return le menu principal contenant les applis. */ public BuMenu getAppliMenu() { if (mainMenu_ == null) mainMenu_ = new TrAppliMainMenu(); return mainMenu_; } /** * @return l'implementation */ public TrImplementation getImpl() { return (TrImplementation) super.impl_; } /** * Met a jour le menu principal * * @see org.fudaa.fudaa.commun.exec.FudaaAppliManagerImpl#prefChanged() */ public void prefChanged() { if (mainMenu_ != null) { mainMenu_.removeAll(); } } /** * @param _nbFileChoosen le nombre de fichier selectionne * @param _f le fichier selectionne */ public void updateMenuFiles(int _nbFileChoosen, File _f) { createProject_.setEnabled((_nbFileChoosen == 1) && (getImpl().getFileFormatMng().isGridExtension(_f.getName()) != null)); } } --- NEW FILE: package.html --- (This appears to be a binary file; contents omitted.) Index: TrImplHelper.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplHelper.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TrImplHelper.java 12 Dec 2003 11:29:41 -0000 1.11 --- TrImplHelper.java 10 Mar 2004 09:13:29 -0000 1.12 *************** *** 8,25 **** */ package org.fudaa.fudaa.tr; - import java.io.File; - - import org.fudaa.ctulu.CtuluLib; import com.memoire.bu.BuIcon; import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuTask; ! import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.fichiers.FileFormatSoftware; - import org.fudaa.fudaa.ressource.FudaaResource; import org.fudaa.fudaa.tr.reflux.TrRefluxImplHelper; import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper; /** * @author deniger --- 8,30 ---- */ package org.fudaa.fudaa.tr; + import java.awt.Component; + import java.io.File; + import javax.swing.JMenu; + import com.memoire.bu.BuDynamicMenu; import com.memoire.bu.BuIcon; + import com.memoire.bu.BuMenu; + import com.memoire.bu.BuMenuBar; import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuTask; ! import com.memoire.fu.FuFile; ! import com.memoire.fu.FuLib; ! import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.fichiers.FileFormatSoftware; import org.fudaa.fudaa.ressource.FudaaResource; import org.fudaa.fudaa.tr.reflux.TrRefluxImplHelper; import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper; + /** * @author deniger *************** *** 27,70 **** */ public abstract class TrImplHelper { ! protected TrImplementation impl_; ! public TrImplHelper(TrImplementation _impl) { ! impl_= _impl; } public void active() { ! impl_.getFrame().setTitle( ! TrResource.getS("préprocesseur") + CtuluLib.ESPACE + getSoftwareID()); ! impl_.getFrame().setIconImage( ! FudaaResource.FUDAA.getIcon("appli/" + getSoftwareID()).getImage()); } ! public TrImplementation getImpl() { ! return impl_; } ! public abstract TrProjet ouvrir(ProgressionInterface _op,BuTask _t); ! public abstract TrProjet ouvrir(ProgressionInterface _op, File _f,BuTask _t); ! public abstract TrProjet creer(ProgressionInterface _op,BuTask _t); public BuIcon getIcon() { return FudaaResource.FUDAA.getToolIcon("appli/" + getSoftwareID()); } ! public abstract String getSoftwareID(); ! public BuMenuItem[] getMenuItemsOuvrir() { ! return null; } ! public BuMenuItem[] getMenuItemsProjet() { return null; } ! public static TrImplHelper getImplHelper( ! String _id, ! TrImplementation _impl) { ! if (_impl.getCurrentImplHelper() != null) { ! if (_id.equals(_impl.getCurrentImplHelper().getSoftwareID())) { ! return _impl.getCurrentImplHelper(); ! } ! } ! if (_id.equals(FileFormatSoftware.REFLUX_IS.name)) { ! return new TrRefluxImplHelper(_impl); ! } else if (_id.equals(FileFormatSoftware.TELEMAC_IS.name)) { ! return new TrTelemacImplHelper(_impl); ! } ! return null; } } --- 32,140 ---- */ public abstract class TrImplHelper { ! ! public static TrImplHelper getImplHelper( ! String _id, ! TrImplementation _impl) { ! if (_impl.getCurrentImplHelper() != null) { ! if (_id.equals(_impl.getCurrentImplHelper().getSoftwareID())) { ! return _impl.getCurrentImplHelper(); ! } ! } ! if (_id.equals(FileFormatSoftware.REFLUX_IS.name)) { ! return new TrRefluxImplHelper(_impl); ! } else if (_id.equals(FileFormatSoftware.TELEMAC_IS.name)) { ! return new TrTelemacImplHelper(_impl); ! } ! return null; ! } ! ! TrApplicationManager appliMng_; ! ! public TrImplHelper( TrApplicationManager _mng) { ! appliMng_ = _mng; ! } ! ! private void addOuvrirAutre() { ! final BuMenuItem[] items_ = getMenuItemsOuvrir(); ! if ((items_ != null) && (items_.length > 0)) { ! BuMenu ouvrirAutre = ! new BuDynamicMenu( ! TrResource.getS("Ouvrir autre") + "...", ! "OUVRIR_AUTRE") { ! ! public void build() { ! if (this.getMenuComponentCount() == 0) { ! //addMenuItem("Projet Télémac", PREF_OUVRIR + TrProjet.TELEMAC_ID); ! int n = items_.length; ! for (int i = 0; i < n; i++) { ! add(items_[i]); ! items_[i].addActionListener(getImpl()); ! } ! } ! } ! ! public boolean isActive() { ! return true; ! } ! }; ! BuMenuBar mb = getImpl().getApp().getMainMenuBar(); ! mb.getMenu("MENU_FICHIER").add(ouvrirAutre, 2); ! } ! } ! ! private void removeOuvrirAutre() { ! JMenu menu = getImpl().getApp().getMainMenuBar().getMenu("MENU_FICHIER"); ! Component c = menu.getMenuComponent(2); ! if ((c != null) ! && (c instanceof BuDynamicMenu) ! && (((BuDynamicMenu) c).getActionCommand().equals("OUVRIR_AUTRE"))) ! menu.remove(c); ! } ! ! protected TrApplicationManager getAppliMng() { ! return appliMng_; } + public void active() { ! getImpl().getFrame().setTitle( ! TrResource.getS("préprocesseur") + CtuluLib.ESPACE + getSoftwareID()); ! getImpl().getFrame().setIconImage( ! FudaaResource.FUDAA.getIcon("appli/" + getSoftwareID()).getImage()); ! addOuvrirAutre(); ! getImpl().addMenu(appliMng_.getAppliMenu(), getImpl().getNbMenuInMenuBar() - 1); } ! ! public TrExplorer createExplorer() { ! return new TrExplorer(appliMng_, FuFile ! .createFile(FuLib.getUserHome())); } ! ! public abstract TrProjet creer(ProgressionInterface _op, File _initGrid,BuTask _t); ! ! ! public BuIcon getIcon() { return FudaaResource.FUDAA.getToolIcon("appli/" + getSoftwareID()); } ! ! public TrImplementation getImpl(){ ! return appliMng_.getImpl(); } ! ! public BuMenuItem[] getMenuItemsOuvrir() { return null; } ! ! public abstract String getSoftwareID(); ! ! ! public abstract TrProjet ouvrir(ProgressionInterface _op, BuTask _t); ! ! public abstract TrProjet ouvrir(ProgressionInterface _op, File _f, BuTask _t); ! ! public void unactive() { ! removeOuvrirAutre(); ! BuMenuBar mb = getImpl().getMainMenuBar(); ! mb.remove(appliMng_.getAppliMenu()); } } Index: TrImplementation.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplementation.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** TrImplementation.java 5 Mar 2004 15:30:15 -0000 1.21 --- TrImplementation.java 10 Mar 2004 09:13:29 -0000 1.22 *************** *** 8,11 **** --- 8,12 ---- */ package org.fudaa.fudaa.tr; + import ghm.followgui.FollowApp; *************** *** 16,20 **** import java.awt.event.ItemEvent; import java.awt.event.ItemListener; [...1561 lines suppressed...] ! ! } ! if (com.equals("IMPORTER")) { ! buildImportMenu(); ! } ! menu.removeItemListener(this); ! } } } --- 887,896 ---- } /** ! * Enleve le glasspane */ ! public void unsetGlassPaneStop() { ! if (glassPaneStop_ != null) ! glassPaneStop_.setVisible(false); } } Index: TrFileFormatManager.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrFileFormatManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TrFileFormatManager.java 12 Feb 2004 16:15:21 -0000 1.8 --- TrFileFormatManager.java 10 Mar 2004 09:13:29 -0000 1.9 *************** *** 13,16 **** --- 13,17 ---- */ package org.fudaa.fudaa.tr; + import java.util.ArrayList; import java.util.Arrays; *************** *** 20,32 **** import java.util.List; import java.util.TreeMap; - import javax.swing.JMenuItem; - import org.fudaa.ctulu.CtuluLib; - import com.memoire.bu.BuInformationsSoftware; import com.memoire.bu.BuMenu; - import org.fudaa.dodico.commun.DodicoEnumType; import org.fudaa.dodico.dunes.io.DunesFileFormat; import org.fudaa.dodico.fichiers.FileFormat; --- 21,30 ---- import java.util.List; import java.util.TreeMap; import javax.swing.JMenuItem; import org.fudaa.ctulu.CtuluLib; import com.memoire.bu.BuInformationsSoftware; import com.memoire.bu.BuMenu; import org.fudaa.dodico.commun.DodicoEnumType; + import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.dunes.io.DunesFileFormat; import org.fudaa.dodico.fichiers.FileFormat; *************** *** 42,56 **** import org.fudaa.dodico.telemac.io.TelemacCLFileFormat; import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; /** * @author deniger - * * @version $Id$ - * */ public class TrFileFormatManager { private FileFormat[] formats_; - public static String EXPORT_PREF= "EXPORT"; - public static String IMPORT_PREF= "IMPORT"; /** * --- 40,55 ---- import org.fudaa.dodico.telemac.io.TelemacCLFileFormat; import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; + import org.fudaa.fudaa.commun.FudaaLib; /** * @author deniger * @version $Id$ */ public class TrFileFormatManager { + private FileFormat[] formats_; + public static String EXPORT_PREF = "EXPORT"; + public static String IMPORT_PREF = "IMPORT"; + private FileFormat[] gridFileFormat_; /** * *************** *** 63,76 **** public FileFormat getFileFormatWithID(String _id) { ! if (formats_ == null) ! buildFormat(); ! for (int i= formats_.length - 1; i >= 0; i--) { ! if (formats_[i].getID().equals(_id)) ! return formats_[i]; } return null; } private final void buildFormat() { ! HashSet s= new HashSet(15); s.add(INPFileFormat.getInstance()); s.add(DunesFileFormat.getInstance()); --- 62,76 ---- public FileFormat getFileFormatWithID(String _id) { ! if (formats_ == null) ! buildFormat(); ! for (int i = formats_.length - 1; i >= 0; i--) { ! if (formats_[i].getID().equals(_id)) ! return formats_[i]; } return null; } + private final void buildFormat() { ! HashSet s = new HashSet(15); s.add(INPFileFormat.getInstance()); s.add(DunesFileFormat.getInstance()); *************** *** 83,92 **** s.add(CrbFileFormat.getInstance()); s.add(CLTransitoireFileFormat.getInstance()); ! formats_= new FileFormat[s.size()]; s.toArray(formats_); - } public static FileFormat[] getArray(ArrayList _l) { ! FileFormat[] r= new FileFormat[_l.size()]; _l.toArray(r); return r; --- 83,92 ---- s.add(CrbFileFormat.getInstance()); s.add(CLTransitoireFileFormat.getInstance()); ! formats_ = new FileFormat[s.size()]; s.toArray(formats_); } + public static FileFormat[] getArray(ArrayList _l) { ! FileFormat[] r = new FileFormat[_l.size()]; _l.toArray(r); return r; *************** *** 94,110 **** public FileFormat[] getFileFormatForImportEvol() { ! ArrayList r= new ArrayList(10); ! if (formats_ == null) ! buildFormat(); FileFormat ft; ! for (int i= formats_.length - 1; i >= 0; i--) { ! ft= formats_[i]; if ((ft.getType() == H2dFileFormatType.COURBE_TRANSITOIRE.getId()) ! && (ft.getLastVersionInstance() ! instanceof H2dFileFormatEvolutionVersion)) { r.add(ft); } } ! FileFormat[] rf= new FileFormat[r.size()]; r.toArray(rf); return rf; --- 94,110 ---- public FileFormat[] getFileFormatForImportEvol() { ! ArrayList r = new ArrayList(10); ! if (formats_ == null) ! buildFormat(); FileFormat ft; ! for (int i = formats_.length - 1; i >= 0; i--) { ! ft = formats_[i]; if ((ft.getType() == H2dFileFormatType.COURBE_TRANSITOIRE.getId()) ! && (ft.getLastVersionInstance() ! instanceof H2dFileFormatEvolutionVersion)) { r.add(ft); } } ! FileFormat[] rf = new FileFormat[r.size()]; r.toArray(rf); return rf; *************** *** 112,136 **** public FileFormat[] getFormatWithGridSupport() { ! ArrayList r= new ArrayList(formats_.length); ! for (int i= formats_.length - 1; i >= 0; i--) { ! if (formats_[i].containsGrid()) ! r.add(formats_[i]); } ! FileFormat[] rf= new FileFormat[r.size()]; r.toArray(rf); Arrays.sort(rf); return rf; } /** ! * ! * Renvoie les format du tableau dont le type est egal au parametre ! * ! * <code>_type</code>. ! * */ public static FileFormat[] getFormatWhithType(int _type, FileFormat[] _f) { ! int n= _f.length; ! ArrayList r= new ArrayList(n); ! for (int i= n - 1; i >= 0; i--) { if (_f[i].getType() == _type) { r.add(_f[i]); --- 112,135 ---- public FileFormat[] getFormatWithGridSupport() { ! if (gridFileFormat_ != null) return gridFileFormat_; ! ArrayList r = new ArrayList(formats_.length); ! for (int i = formats_.length - 1; i >= 0; i--) { ! if (formats_[i].containsGrid()) ! r.add(formats_[i]); } ! FileFormat[] rf = new FileFormat[r.size()]; r.toArray(rf); Arrays.sort(rf); + gridFileFormat_ = rf; return rf; } + /** ! * Renvoie les format du tableau dont le type est egal au parametre <code>_type</code>. */ public static FileFormat[] getFormatWhithType(int _type, FileFormat[] _f) { ! int n = _f.length; ! ArrayList r = new ArrayList(n); ! for (int i = n - 1; i >= 0; i--) { if (_f[i].getType() == _type) { r.add(_f[i]); *************** *** 139,148 **** return getArray(r); } public static FileFormat[] getFormatWhithSoftware( ! BuInformationsSoftware _is, ! FileFormat[] _f) { ! int n= _f.length; ! ArrayList r= new ArrayList(n); ! for (int i= n - 1; i >= 0; i--) { if (_f[i].getSoftware() == _is) { r.add(_f[i]); --- 138,148 ---- return getArray(r); } + public static FileFormat[] getFormatWhithSoftware( ! BuInformationsSoftware _is, ! FileFormat[] _f) { ! int n = _f.length; ! ArrayList r = new ArrayList(n); ! for (int i = n - 1; i >= 0; i--) { if (_f[i].getSoftware() == _is) { r.add(_f[i]); *************** *** 151,191 **** return getArray(r); } public FileFormat[] getFormatWithType(int _type) { return getFormatWhithType(_type, formats_); } public FileFormat[] getFormatWhithSoftware(BuInformationsSoftware _is) { return getFormatWhithSoftware(_is, formats_); } /** ! * ! * Construit le menu export a partir des type de donnees rassemblees ! * ! * dans la classe ! * * {@link org.fudaa.dodico.h2d.type.H2dFileFormatType H2dFileFormatType}. - * */ public void buildExportMenu(BuMenu _m, TrImplementation _impl) { ! List l= new ArrayList(H2dFileFormatType.LIST); Collections.sort(l, new DodicoEnumType.H2dEnumIDComparator()); ! int n= l.size(); //on recupere les fileformat dans l'ordre des id ! for (int i= 0; i < n; i++) { ! H2dFileFormatType ft= (H2dFileFormatType)l.get(i); ! if (ft == null) ! continue; ! FileFormat[] fts= getFormatWithType(ft.getId()); ! BuMenu me= new BuMenu(ft.getNom(), ft.getNom()); //pour trier ( pas super intelligent ....) ! TreeMap map= new TreeMap(); ! for (int j= 0; j < fts.length; j++) { map.put(fts[j].getName(), fts[j].getID()); } ! for (Iterator it= map.keySet().iterator(); it.hasNext();) { ! String id= (String)it.next(); me.addMenuItem( ! id, ! TrFileFormatManager.EXPORT_PREF + (String)map.get(id), ! _impl); } //TODO : a ameliorer --- 151,189 ---- return getArray(r); } + public FileFormat[] getFormatWithType(int _type) { return getFormatWhithType(_type, formats_); } + public FileFormat[] getFormatWhithSoftware(BuInformationsSoftware _is) { return getFormatWhithSoftware(_is, formats_); } + /** ! * Construit le menu export a partir des type de donnees rassemblees dans la classe * {@link org.fudaa.dodico.h2d.type.H2dFileFormatType H2dFileFormatType}. */ public void buildExportMenu(BuMenu _m, TrImplementation _impl) { ! List l = new ArrayList(H2dFileFormatType.LIST); Collections.sort(l, new DodicoEnumType.H2dEnumIDComparator()); ! int n = l.size(); //on recupere les fileformat dans l'ordre des id ! for (int i = 0; i < n; i++) { ! H2dFileFormatType ft = (H2dFileFormatType) l.get(i); ! if (ft == null) ! continue; ! FileFormat[] fts = getFormatWithType(ft.getId()); ! BuMenu me = new BuMenu(ft.getNom(), ft.getNom()); //pour trier ( pas super intelligent ....) ! TreeMap map = new TreeMap(); ! for (int j = 0; j < fts.length; j++) { map.put(fts[j].getName(), fts[j].getID()); } ! for (Iterator it = map.keySet().iterator(); it.hasNext();) { ! String id = (String) it.next(); me.addMenuItem( ! id, ! TrFileFormatManager.EXPORT_PREF + (String) map.get(id), ! _impl); } //TODO : a ameliorer *************** *** 193,205 **** } } public void buildImportMenu(BuMenu _m, TrImplementation _impl) { ! BuMenu m= ! new BuMenu( ! H2dFileFormatType.COURBE_TRANSITOIRE.getNom(), ! CtuluLib.getString(H2dFileFormatType.COURBE_TRANSITOIRE.getId())); ! FileFormat[] ft= getFileFormatForImportEvol(); Arrays.sort(ft); ! int n= ft.length; ! for (int i= 0; i < n; i++) { m.addMenuItem(ft[i].getName(), IMPORT_PREF + ft[i].getID(), _impl); } --- 191,204 ---- } } + public void buildImportMenu(BuMenu _m, TrImplementation _impl) { ! BuMenu m = ! new BuMenu( ! H2dFileFormatType.COURBE_TRANSITOIRE.getNom(), ! CtuluLib.getString(H2dFileFormatType.COURBE_TRANSITOIRE.getId())); ! FileFormat[] ft = getFileFormatForImportEvol(); Arrays.sort(ft); ! int n = ft.length; ! for (int i = 0; i < n; i++) { m.addMenuItem(ft[i].getName(), IMPORT_PREF + ft[i].getID(), _impl); } *************** *** 208,223 **** public JMenuItem getMenuImportCourbeTrans(TrImplementation _impl) { ! BuMenu m= (BuMenu)_impl.getMainMenuBar().getMenu("IMPORTER"); ! if (m == null) ! return null; ! String actCmd= ! CtuluLib.getString(H2dFileFormatType.COURBE_TRANSITOIRE.getId()); ! for (int i= m.getItemCount() - 1; i >= 0; i--) { ! JMenuItem it= m.getItem(i); ! if (actCmd.equals(it.getActionCommand())) ! return it; } return null; } } \ No newline at end of file --- 207,247 ---- public JMenuItem getMenuImportCourbeTrans(TrImplementation _impl) { ! BuMenu m = (BuMenu) _impl.getMainMenuBar().getMenu("IMPORTER"); ! if (m == null) ! return null; ! String actCmd = ! CtuluLib.getString(H2dFileFormatType.COURBE_TRANSITOIRE.getId()); ! for (int i = m.getItemCount() - 1; i >= 0; i--) { ! JMenuItem it = m.getItem(i); ! if (actCmd.equals(it.getActionCommand())) ! return it; } return null; } + /** + * @param _file + * @return + */ + public FileFormat isGridExtension(String _file) { + getFormatWithGridSupport(); + return FudaaLib.guessFormat(_file, Arrays.asList(gridFileFormat_)); + } + + /** + * @param _file + * @return + */ + public boolean isCasFile(String _file) { + return ("cas".equals(_file)) || _file.endsWith(".cas") + || (_file.startsWith("cas") && (_file.indexOf('.') < 0)); + } + + /** + * @param _file + * @return + */ + public boolean isRefluxFile(String _file) { + return _file.endsWith(".inp"); + } } \ No newline at end of file --- TrCodePanel.java DELETED --- |
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469/src/org/fudaa/fudaa/commun/exec Modified Files: FudaaEditorExterne.java FudaaEditorInterne.java FudaaExecManagerPanel.java FudaaExecManager.java FudaaExecComboBoxEditor.java FudaaEditorInterface.java FudaaExecPanel.java FudaaExec.java Added Files: FudaaGlobalExecManager.java FudaaExecAction.java FudaaAppliManagerImpl.java Removed Files: FudaaExecServerManagerPanel.java FudaaAppliExecManager.java FudaaExecServerManager.java Log Message: Ajout du superviseur pour le prepro --- NEW FILE: FudaaGlobalExecManager.java --- /* * @file FudaaExecManager.java * @creation 28 mai 2003 * @modification $Date: 2004/03/10 09:13:29 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... */ package org.fudaa.fudaa.commun.exec; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import javax.swing.AbstractListModel; import javax.swing.ComboBoxModel; import com.memoire.bu.BuPreferences; import org.fudaa.fudaa.commun.FudaaPreferencesAbstract; /** * Permet de gérer tous les executables des applications Fudaa. * * @author deniger * @version $Id: FudaaGlobalExecManager.java,v 1.1 2004/03/10 09:13:29 deniger Exp $ */ public class FudaaGlobalExecManager { protected ArrayList execs_; protected BuPreferences preferences_; protected String prefixeForPref_; /** */ public FudaaGlobalExecManager() { preferences_ = BuPreferences.BU; prefixeForPref_ = "ext.executable"; loadList(); } public int getFudaaExecIndex(FudaaExec _name) { return execs_.indexOf(_name); } /** * @param _n l'identifiant de l'executable. */ private int getFudaaExecIndex(String _name) { return FudaaExec.getIdNameIndex(execs_, _name); } public FudaaExec getFudaaExec(String _name) { int i = getFudaaExecIndex(_name); return i >= 0 ? (FudaaExec) execs_.get(i) : null; } public List getAllExe() { return new ArrayList(execs_); } public int getFudaaExecNb() { return execs_.size(); } protected FudaaExec getFudaaExec(int i) { return (FudaaExec) execs_.get(i); } private void loadList() { execs_ = new ArrayList(15); int prefLength = prefixeForPref_.length(); int exeLength = FudaaExec.EXE.length(); for (Enumeration e = preferences_.keys(); e.hasMoreElements(); ) { String k = (String) e.nextElement(); if ((k.startsWith(prefixeForPref_)) && (k.endsWith(FudaaExec.EXE))) { String name = k.substring(prefLength + 1, k.length() - exeLength - 1); FudaaExec exe = FudaaExec.loadFromPref(name, preferences_, prefixeForPref_); execs_.add(exe); } } } public void reloadFromPref() { loadList(); } public void savePref() { int n = execs_.size() - 1; for (int i = n; i >= 0; i--) { savePref(i); } } public boolean contains(String _id) { return FudaaExec.getIdNameIndex(execs_, _id) >= 0; } public boolean contains(FudaaExec _ex) { return execs_.contains(_ex); } public void writePref() { preferences_.writeIniFile(); } public void savePref(int _i) { FudaaExec.savePref(getFudaaExec(_i), preferences_, prefixeForPref_); } public void savePref(FudaaExec _ex) { int i = getFudaaExecIndex(_ex); if (i >= 0) savePref(i); } public String toString() { int n = execs_.size(); StringBuffer buf = new StringBuffer(n * 10); for (int i = 0; i < n; i++) { buf.append(getFudaaExec(i).getIDName()); if (i != n - 1) buf.append(','); } return buf.toString(); } public void removeExec(FudaaExec _ex) { if (contains(_ex)) { execs_.remove(_ex); FudaaExec.razPref(_ex, preferences_, prefixeForPref_); } } public void set(FudaaExec _ex) { if (execs_.contains(_ex)) execs_.remove(_ex); execs_.add(_ex); savePref(_ex); } public void add(FudaaExec _ex) { if (!execs_.contains(_ex)) { execs_.add(_ex); savePref(_ex); } } public void setNewValues(FudaaExecManagerPanel _mng) { int n = execs_.size() - 1; List l = _mng.getFinalValues(); for (int i = n; i >= 0; i--) { FudaaExec ex = getFudaaExec(i); int index = l.indexOf(ex); if (index < 0) { FudaaExec.razPref(ex, preferences_, prefixeForPref_); } } execs_ = new ArrayList(l); savePref(); } public ComboBoxModel createComboBoxModel() { return new ExecComboBoxModel(); } private class ExecComboBoxModel extends AbstractListModel implements ComboBoxModel { private Object selected_; public Object getElementAt(int _i) { return execs_.get(_i); } public int getSize() { return execs_.size(); } /** * */ public Object getSelectedItem() { return selected_; } /** * */ public void setSelectedItem(Object anItem) { if ((selected_ == null && anItem != null) || (selected_ != null && !selected_.equals(anItem))) { selected_ = anItem; fireContentsChanged(this, -1, -1); } } } /** * */ public String getPrefixeForPref() { return prefixeForPref_; } } --- NEW FILE: FudaaExecAction.java --- /* * @file FudaaExecAction.java * @creation 9 mars 2004 * @modification $Date: 2004/03/10 09:13:29 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.commun.exec; import java.awt.event.ActionEvent; import java.io.File; import javax.swing.AbstractAction; import javax.swing.Action; import com.memoire.bu.BuLib; import com.memoire.bu.BuResource; import com.memoire.fu.FuLib; import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.objet.CExec; import org.fudaa.fudaa.ressource.FudaaResource; /** * @author Fred Deniger * @version $id$ * */ public class FudaaExecAction extends AbstractAction { protected FudaaExec exec_; /** * Constructeur par defaut. */ public FudaaExecAction() { super(); } /** * @param _ex l'exe en question non nul */ public FudaaExecAction(FudaaExec _ex) { super(); exec_ = _ex; if(exec_!=null) setExec(exec_); } /** * Appelle la fonction execInDir avec comme parametres le rep de l'utilisateur * @see #execInDir(File) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public final void actionPerformed(ActionEvent _e) { execInDir(new File(FuLib.getUserHome())); } /** * @return les parametres a passer a l'exe */ protected String[] getParam(){ return null; } /** * Lance l'exe dans le rep _dir et recupere les param a partir de la methode getParam * @see #getParam() * @param _dir le repertoire dans lequel l'exe doit se lancer */ public final void execInDir(File _dir){ if((_dir!=null) && (_dir.exists()) && (_dir.isDirectory())){ if(CtuluLib.DEBUG) CtuluLib.debug("launch "+getExec().getShownName()+" in "+_dir.getAbsolutePath()); exec(exec_.createExecutant(null,_dir)); } } protected final void exec(CExec _exec){ try { _exec.exec(); } catch (RuntimeException _io) { FudaaExecPanel pn = new FudaaExecPanel(exec_); pn.setErrorText(FudaaResource.getS("Exécutable non trouvé")); pn.afficheModale(BuLib.HELPER, BuResource.BU.getString("Erreur")); } } /** * @return Returns the exec. */ public FudaaExec getExec() { return exec_; } /** * Met a jour les prop de l'action * @param _ex le nouveau exec. */ protected final void setExec(FudaaExec _ex){ exec_=_ex; if(exec_!=null){ putValue(Action.SMALL_ICON, exec_.getIcon()); putValue(Action.NAME, exec_.getShownName()); } } } --- NEW FILE: FudaaAppliManagerImpl.java --- /* * @file FudaaAppliExecManager.java * @creation 2 juin 2003 * @modification $Date: 2004/03/10 09:13:29 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... */ package org.fudaa.fudaa.commun.exec; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import javax.swing.Action; import com.memoire.bu.BuCommonImplementation; import com.memoire.bu.BuMenu; import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuPreferences; import com.memoire.bu.BuResource; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ebli.dialog.EbliSimpleDialogPanel; import org.fudaa.fudaa.commun.FudaaPreferences; import org.fudaa.fudaa.ressource.FudaaResource; /** * Classe permettant de gerer les executables exterieures pour une application précise.Les * exécutables sont enregistres (ou supprimer) dans les preferences de bu. La liste des * preferences est enregistree dans les preferences de l'application. * * @author deniger * @version $Id: FudaaAppliManagerImpl.java,v 1.1 2004/03/10 09:13:29 deniger Exp $ */ public class FudaaAppliManagerImpl extends FudaaGlobalExecManager implements ActionListener { protected BuCommonImplementation impl_; BuPreferences prefAppli_; List actions_; /** * La cle preference pour la liste des executables */ private final static String LIST_EXE_PREF = "executable.list"; private String prefForList_; /** * @param _prefAppli les preferences contenant la liste * @param _impl l'implementation */ public FudaaAppliManagerImpl( BuPreferences _prefAppli, BuCommonImplementation _impl) { this(_prefAppli,_impl,null); } /** * @param _prefAppli les preferences stockant les exe * @param _impl l'impl parente */ public FudaaAppliManagerImpl( BuPreferences _prefAppli, BuCommonImplementation _impl,String _prefForList) { prefAppli_ = _prefAppli; impl_ = _impl; prefForList_=_prefForList; if(prefForList_==null) prefForList_=CtuluLib.EMPTY_STRING; reload(); } private String getKeyForList(){ return prefForList_==null?LIST_EXE_PREF:prefForList_+"."+LIST_EXE_PREF; } public final void reload() { reloadFromPref(); String exeList = prefAppli_.getStringProperty(getKeyForList(), null); if (exeList != null) { StringTokenizer tk=new StringTokenizer(exeList,","); int n = tk.countTokens(); actions_ = new ArrayList(n); for (int i = 0; i < n; i++) { actions_.add(initAction(getFudaaExec(tk.nextToken()))); } } else actions_=null; } /** * Methode appelee lorsque les preferences ont ete modifiees */ public void prefChanged(){} public Action getAction(int _i) { return (Action) actions_.get(_i); } public int getActionsNb() { return actions_ == null ? 0 : actions_.size(); } /** * @param _ex l'exe externe * @return l'action correspondante */ public static Action initAction(final FudaaExec _ex) { FudaaExecAction r=new FudaaExecAction(_ex); r.setEnabled(true); return r; } public static BuMenuItem createMenuItem(FudaaExec _e){ if(_e!=null) { BuMenuItem r=new BuMenuItem(); r.setAction(initAction(_e)); return r; } return null; } /** * Ajoute au menu _m toutes les actions concernant les applications * @param _m le menu qui recoit les actions */ public void createMenuItems(BuMenu _m){ int n = getActionsNb(); BuMenuItem it; for (int i = 0; i < n; i++) { it = new BuMenuItem(); it.setAction(FudaaAppliManagerImpl.this.getAction(i)); _m.add(it); } if(n>0) _m.addSeparator(); BuMenuItem menuMod = new BuMenuItem( FudaaResource.getS("Modifier les applications externes")); menuMod.setActionCommand("MANAGER"); menuMod.addActionListener(FudaaAppliManagerImpl.this); _m.add(menuMod); } public EbliSimpleDialogPanel createPanel() { return new FudaaExecManagerPanel(this); } /** * Gere la modification des actions */ public void actionPerformed(ActionEvent e) { if ("MANAGER".equals(e.getActionCommand())) { reloadFromPref(); int i = createPanel().afficheModale( impl_.getFrame(), FudaaResource.getS("Modifier")); if (EbliSimpleDialogPanel.isOkResponse(i)) { this.reload(); reloadFromPref(); prefChanged(); } } else if ("MANAGER_EDITEUR".equals(e.getActionCommand())) { FudaaEditorPanel pn = new FudaaEditorPanel(); int i = pn.afficheModale(impl_.getFrame(), BuResource.BU.getString("Editeur")); if (EbliSimpleDialogPanel.isOkResponse(i)) { FudaaPreferences.FUDAA.writeIniFile(); } } } } Index: FudaaEditorExterne.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaEditorExterne.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FudaaEditorExterne.java 25 Nov 2003 10:13:33 -0000 1.3 --- FudaaEditorExterne.java 10 Mar 2004 09:13:29 -0000 1.4 *************** *** 22,32 **** super(_name); } ! public synchronized Process edit(File _f) { if (_f != null) { ! try { ! return executeFast(new String[] { _f.getAbsolutePath()}); ! } catch (IOException _io) {} } - return null; } /** --- 22,29 ---- super(_name); } ! public synchronized void edit(File _f) { if (_f != null) { ! execute(new String[] { _f.getAbsolutePath()}).exec(); } } /** Index: FudaaEditorInterne.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaEditorInterne.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FudaaEditorInterne.java 25 Nov 2003 10:13:33 -0000 1.4 --- FudaaEditorInterne.java 10 Mar 2004 09:13:29 -0000 1.5 *************** *** 32,36 **** * */ ! public Process edit(File _f) { String r= null; FileInputStream in= null; --- 32,36 ---- * */ ! public void edit(File _f) { String r= null; FileInputStream in= null; *************** *** 44,48 **** } catch (IOException _io) { _io.printStackTrace(); ! return null; } finally { try { --- 44,48 ---- } catch (IOException _io) { _io.printStackTrace(); ! return; } finally { try { *************** *** 66,70 **** edit.run(); } ! return null; } /** --- 66,70 ---- edit.run(); } ! return; } /** Index: FudaaExecManagerPanel.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaExecManagerPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FudaaExecManagerPanel.java 12 Dec 2003 10:58:41 -0000 1.5 --- FudaaExecManagerPanel.java 10 Mar 2004 09:13:29 -0000 1.6 *************** *** 17,27 **** import org.fudaa.fudaa.ressource.FudaaResource; /** * @author deniger * @version $Id$ */ public class FudaaExecManagerPanel extends EbliSimpleDialogPanel { ! FudaaExecManager mng_; EbliPanelListEditorModel model_; ! public FudaaExecManagerPanel(FudaaExecManager _mng) { mng_= _mng; model_= new ExecModel(); --- 17,28 ---- import org.fudaa.fudaa.ressource.FudaaResource; /** + * A CONTINUER * @author deniger * @version $Id$ */ public class FudaaExecManagerPanel extends EbliSimpleDialogPanel { ! FudaaGlobalExecManager mng_; EbliPanelListEditorModel model_; ! public FudaaExecManagerPanel(FudaaAppliManagerImpl _mng) { mng_= _mng; model_= new ExecModel(); Index: FudaaExecManager.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaExecManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FudaaExecManager.java 25 Nov 2003 10:13:33 -0000 1.3 --- FudaaExecManager.java 10 Mar 2004 09:13:29 -0000 1.4 *************** *** 11,17 **** --- 11,20 ---- import java.util.Enumeration; import java.util.List; + import javax.swing.AbstractListModel; import javax.swing.ComboBoxModel; + import com.memoire.bu.BuPreferences; + import org.fudaa.fudaa.commun.FudaaPreferencesAbstract; /** *************** *** 22,32 **** public class FudaaExecManager { protected ArrayList execs_; ! protected FudaaPreferencesAbstract preferences_; protected String prefixeForPref_; ! public FudaaExecManager( ! FudaaPreferencesAbstract _pref, ! String _prefixForPref) { ! preferences_= _pref; ! prefixeForPref_= _prefixForPref; loadList(); } --- 25,34 ---- public class FudaaExecManager { protected ArrayList execs_; ! protected BuPreferences preferences_; protected String prefixeForPref_; ! ! public FudaaExecManager() { ! preferences_= BuPreferences.BU; ! prefixeForPref_= "ext.executable."; loadList(); } *************** *** 37,41 **** * @param _n l'identifiant de l'executable. */ ! public int getFudaaExecIndex(String _name) { return FudaaExec.getIdNameIndex(execs_, _name); } --- 39,43 ---- * @param _n l'identifiant de l'executable. */ ! private int getFudaaExecIndex(String _name) { return FudaaExec.getIdNameIndex(execs_, _name); } *************** *** 50,54 **** return execs_.size(); } ! public FudaaExec getFudaaExec(int i) { return (FudaaExec)execs_.get(i); } --- 52,56 ---- return execs_.size(); } ! protected FudaaExec getFudaaExec(int i) { return (FudaaExec)execs_.get(i); } *************** *** 57,61 **** int prefLength= prefixeForPref_.length(); int exeLength= FudaaExec.EXE.length(); ! for (Enumeration e= preferences_.allKeysWithDefaults(); e.hasMoreElements(); ) { --- 59,63 ---- int prefLength= prefixeForPref_.length(); int exeLength= FudaaExec.EXE.length(); ! for (Enumeration e= preferences_.keys(); e.hasMoreElements(); ) { *************** *** 130,134 **** int index= l.indexOf(ex); if (index < 0) { ! ex.razPref(ex, preferences_, prefixeForPref_); } } --- 132,136 ---- int index= l.indexOf(ex); if (index < 0) { ! FudaaExec.razPref(ex, preferences_, prefixeForPref_); } } Index: FudaaExecComboBoxEditor.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaExecComboBoxEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FudaaExecComboBoxEditor.java 12 Dec 2003 10:58:41 -0000 1.4 --- FudaaExecComboBoxEditor.java 10 Mar 2004 09:13:29 -0000 1.5 *************** *** 33,41 **** implements ComboBoxEditor, MouseListener { FudaaExec exec_; ! FudaaExecManager mng_; /** * */ ! public FudaaExecComboBoxEditor(FudaaExecManager _mng) { mng_= _mng; setBackground(UIManager.getColor("ComboBox.background")); --- 33,41 ---- implements ComboBoxEditor, MouseListener { FudaaExec exec_; ! FudaaGlobalExecManager mng_; /** * */ ! public FudaaExecComboBoxEditor(FudaaGlobalExecManager _mng) { mng_= _mng; setBackground(UIManager.getColor("ComboBox.background")); Index: FudaaEditorInterface.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaEditorInterface.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FudaaEditorInterface.java 25 Nov 2003 10:13:33 -0000 1.3 --- FudaaEditorInterface.java 10 Mar 2004 09:13:29 -0000 1.4 *************** *** 14,18 **** */ public interface FudaaEditorInterface { ! public Process edit(File _f); public boolean isExterne(); public String getName(); --- 14,18 ---- */ public interface FudaaEditorInterface { ! public void edit(File _f); public boolean isExterne(); public String getName(); Index: FudaaExecPanel.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaExecPanel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FudaaExecPanel.java 12 Dec 2003 10:58:41 -0000 1.6 --- FudaaExecPanel.java 10 Mar 2004 09:13:29 -0000 1.7 *************** *** 60,64 **** public void actionPerformed(ActionEvent _ae) { BuFileChooser bf= new EbliFileChooser(false); ! if ((iconURL_ != null) && (!fudaaExec_.isIconInterne())) bf.setCurrentDirectory(FuLib.getParentFile(new File(iconURL_))); else --- 60,64 ---- public void actionPerformed(ActionEvent _ae) { BuFileChooser bf= new EbliFileChooser(false); ! if (iconURL_ != null) bf.setCurrentDirectory(FuLib.getParentFile(new File(iconURL_))); else Index: FudaaExec.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaExec.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FudaaExec.java 12 Dec 2003 10:58:41 -0000 1.6 --- FudaaExec.java 10 Mar 2004 09:13:29 -0000 1.7 *************** *** 8,11 **** --- 8,12 ---- */ package org.fudaa.fudaa.commun.exec; + import java.io.File; import java.io.IOException; import java.util.ArrayList; *************** *** 54,83 **** execCommand_= idName_; setIconURL(_iconUrl); } ! // public String getDefaultIcon() ! // { ! // return FudaaPreferences.FUDAA.getDefaultValue(pref_ + ICON); ! // } ! // ! // public String getDefaultExe() ! // { ! // return FudaaPreferences.FUDAA.getDefaultValue(pref_ + EXE); ! // } public CExec execute(String[] _args) { ! int n= 0; ! if (_args != null) { ! n= _args.length; ! } ! ArrayList a= new ArrayList(3 + n); ! StringTokenizer st= new StringTokenizer(execCommand_, CtuluLib.ESPACE); ! while (st.hasMoreTokens()) { ! a.add(st.nextToken()); ! } ! for (int i= 0; i < n; i++) { ! a.add(_args[i]); ! } ! return new CExec(DodicoLib.enTableau(a)); } ! public Process executeFast(String[] _args) throws IOException { int n= 0; if (_args != null) { --- 55,75 ---- execCommand_= idName_; setIconURL(_iconUrl); + setShownName(_idName); } ! ! /** ! * @param _args les arguments a passer a l'executable ! * @return instance de cexec correctement initialisee ! */ public CExec execute(String[] _args) { ! return createExecutant(_args,null); } ! ! /** ! * @param _args les arguments a passer a l'executable ! * @param _f le repertoire dans lequel l'exe doit se lancer ! * @return instance de cexec correctement initialisee ! */ ! public CExec createExecutant(String[] _args,File _f) { int n= 0; if (_args != null) { *************** *** 85,90 **** } ArrayList a= new ArrayList(3 + n); - if (execCommand_ == null) - System.err.println("Executable null"); StringTokenizer st= new StringTokenizer(execCommand_, CtuluLib.ESPACE); while (st.hasMoreTokens()) { --- 77,80 ---- *************** *** 94,103 **** a.add(_args[i]); } ! Process p= null; ! p= Runtime.getRuntime().exec(DodicoLib.enTableau(a)); ! return p; } /** ! * */ public String getExecCommand() { --- 84,94 ---- a.add(_args[i]); } ! CExec ex=new CExec(DodicoLib.enTableau(a)); ! ex.setCatchExceptions(false); ! ex.setExecDirectory(_f); ! return ex; } /** ! * @return l'exe utilisee */ public String getExecCommand() { *************** *** 105,109 **** } /** ! * */ public Icon getIcon() { --- 96,100 ---- } /** ! * @return l'icone de l'exe */ public Icon getIcon() { *************** *** 267,270 **** --- 258,264 ---- * Permet de sauvegarder les donnees de cet exe dans les preferences <code>_pref</code>. La * cle commencera par <code>_idPref._ex.getIDname()</code>. + * @param _ex + * @param _pref + * @param _idPref */ public static void savePref( *************** *** 286,289 **** --- 280,288 ---- _pref.removeProperty(prefixe + NAME); } + /** + * @param _ex + * @param _pref + * @param _idPref + */ public static void razPref( FudaaExec _ex, *************** *** 297,301 **** } /** ! * */ public int compareTo(Object o) { --- 296,300 ---- } /** ! * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(Object o) { --- FudaaExecServerManagerPanel.java DELETED --- --- FudaaAppliExecManager.java DELETED --- --- FudaaExecServerManager.java DELETED --- |
From: <de...@us...> - 2004-03-10 09:31:26
|
Update of /cvsroot/fudaa/fudaa_web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9592 Modified Files: .cvsignore Log Message: Ajout du superviseur pour le prepro Index: .cvsignore =================================================================== RCS file: /cvsroot/fudaa/fudaa_web/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 4 Mar 2004 18:02:02 -0000 1.2 --- .cvsignore 10 Mar 2004 09:13:36 -0000 1.3 *************** *** 3,4 **** --- 3,5 ---- .project + dist |
From: <de...@us...> - 2004-03-10 09:31:26
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/etc/controle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469/etc/controle Modified Files: bandeau.html checks.xml index.html Log Message: Ajout du superviseur pour le prepro Index: bandeau.html =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/etc/controle/bandeau.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bandeau.html 4 Mar 2004 12:42:39 -0000 1.1 --- bandeau.html 10 Mar 2004 09:13:30 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- <title>Fudaa contrôle</title> <link href="stylesheet.css" type="text/css" rel="stylesheet"> + <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> Index: checks.xml =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/etc/controle/checks.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** checks.xml 4 Mar 2004 12:42:39 -0000 1.1 --- checks.xml 10 Mar 2004 09:13:30 -0000 1.2 *************** *** 1,208 **** ! <?xml version="1.0"?> ! <!DOCTYPE module PUBLIC ! "-//Puppy Crawl//DTD Check Configuration 1.1//EN" ! "http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> ! ! <!-- ! ! Checkstyle configuration that checks the sun coding conventions from: ! ! - the Java Language Specification at ! http://java.sun.com/docs/books/jls/second_edition/html/index.html ! ! - the Sun Code Conventions at http://java.sun.com/docs/codeconv/ ! ! - the Javadoc guidelines at ! http://java.sun.com/j2se/javadoc/writingdoccomments/index.html ! ! - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html ! ! - some best practices ! ! Checkstyle is very configurable. Be sure to read the documentation at ! http://checkstyle.sf.net (or in your downloaded distribution). ! ! Most Checks are configurable, be sure to consult the documentation. ! ! To completely disable a check, just comment it out or delete it from the file. ! ! Finally, it is worth reading the documentation. ! ! --> ! ! <module name="Checker"> ! ! <!-- Checks that a package.html file exists for each package. --> ! <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml --> ! <module name="PackageHtml"/> ! ! <!-- Checks whether files end with a new line. --> ! <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> ! <module name="NewlineAtEndOfFile"/> ! ! <!-- <module name="au.com.redhillconsulting.simian.SimianCheck"> ! <property name="language" value="java"/> ! </module>--> ! ! <module name="TreeWalker"> ! ! <!-- Checks for Javadoc comments. --> ! <!-- See http://checkstyle.sf.net/config_javadoc.html --> ! <module name="JavadocMethod"> ! <property name="scope" value="public"/> ! </module> ! <module name="JavadocType"> ! <property name="scope" value="public"/> ! </module> ! <module name="JavadocVariable"> ! <property name="scope" value="public"/> ! </module> ! <module name="JavadocStyle"> ! <property name="scope" value="public"/> ! </module> ! ! ! <!-- Checks for Naming Conventions. --> ! <!-- See http://checkstyle.sf.net/config_naming.html --> ! <module name="ConstantName"/> ! <module name="LocalFinalVariableName"> ! <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> ! </module> ! <module name="LocalVariableName"> ! <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> ! </module> ! <module name="MemberName"> ! <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/> ! </module> ! <module name="MethodName"/> ! <module name="PackageName"> ! <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/> ! </module> ! <module name="ParameterName"> ! <property name="format" value="^[a-z_][a-zA-Z0-9]*$"/> ! </module> ! <module name="StaticVariableName"/> ! <module name="TypeName"/> ! ! ! <!-- Checks for Headers --> ! <!-- See http://checkstyle.sf.net/config_header.html --> ! <!-- <module name="Header"> --> ! <!-- The follow property value demonstrates the ability --> ! <!-- to have access to ANT properties. In this case it uses --> ! <!-- the ${basedir} property to allow Checkstyle to be run --> ! <!-- from any directory within a project. See property --> ! <!-- expansion, --> ! <!-- http://checkstyle.sf.net/config.html#properties --> ! <!-- <property --> ! <!-- name="headerFile" --> ! <!-- value="${basedir}/java.header"/> --> ! <!-- </module> --> ! ! <!-- Following interprets the header file as regular expressions. --> ! <!-- <module name="RegexpHeader"/> --> ! ! ! <!-- Checks for imports --> ! <!-- See http://checkstyle.sf.net/config_import.html --> ! <module name="IllegalImport"/> <!-- defaults to sun.* packages --> ! <module name="RedundantImport"/> ! <module name="UnusedImports"/> ! ! ! <!-- Checks for Size Violations. --> ! <!-- See http://checkstyle.sf.net/config_sizes.html --> ! <module name="FileLength"/> ! <module name="LineLength"> ! <property name="ignorePattern" value="^ *\* *[^ ]+$"/> ! <property name="max" value="120"/> ! </module> ! <module name="MethodLength"/> ! <module name="ParameterNumber"/> ! ! ! <!-- Checks for whitespace --> ! <!-- See http://checkstyle.sf.net/config_whitespace.html --> ! <!-- <module name="EmptyForIteratorPad"/> ! <module name="NoWhitespaceAfter"/> ! <module name="NoWhitespaceBefore"/> ! <module name="OperatorWrap"/> ! <module name="ParenPad"/> ! <module name="TypecastParenPad"/> ! <module name="WhitespaceAround"/> ! --> ! <module name="TabCharacter"/> ! <module name="WhitespaceAfter"> ! <property name="tokens" value="SEMI"/> ! </module> ! ! ! ! <!-- Modifier Checks --> ! <!-- See http://checkstyle.sf.net/config_modifiers.html --> ! <!-- <module name="ModifierOrder"/>--> ! <module name="RedundantModifier"/> ! ! ! <!-- Checks for blocks. You know, those {}'s --> ! <!-- See http://checkstyle.sf.net/config_blocks.html --> ! <module name="AvoidNestedBlocks"/> ! <module name="EmptyBlock"/> ! <!-- <module name="LeftCurly"/> ! <module name="RightCurly"/> ! ! <module name="NeedBraces"/> ! --> ! ! ! <!-- Checks for common coding problems --> ! <!-- See http://checkstyle.sf.net/config_coding.html --> ! <!--<module name="AvoidInlineConditionals"/>--> ! <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> ! <module name="EmptyStatement"/> ! <module name="EqualsHashCode"/> ! <module name="HiddenField"/> ! <module name="IllegalInstantiation"> ! <property name="classes" value="java.lang.Boolean"/> ! </module> ! <module name="InnerAssignment"/> ! <!-- <module name="MagicNumber"/>--> ! <module name="MissingSwitchDefault"/> ! <module name="RedundantThrows"/> ! <module name="SimplifyBooleanExpression"/> ! <module name="SimplifyBooleanReturn"/> ! <module name="SuperClone"/> ! <module name="SuperFinalize"/> ! <module name="PackageDeclaration"/> ! <module name="ReturnCount"> ! <property name="max" value="3"/> ! </module> ! <module name="IllegalType"/> ! <module name="ParameterAssignment"/> ! <module name="ExplicitInitialization"/> ! ! <!-- Checks for class design --> ! <!-- See http://checkstyle.sf.net/config_design.html --> ! <module name="FinalClass"/> ! <module name="HideUtilityClassConstructor"/> ! <module name="InterfaceIsType"/> ! ! ! ! ! <!-- Miscellaneous other checks. --> ! <!-- See http://checkstyle.sf.net/config_misc.html --> ! <module name="ArrayTypeStyle"/> ! <!-- <module name="FinalParameters"/>--> ! <module name="GenericIllegalRegexp"> ! <property name="format" value="\s+$"/> ! <property name="message" value="Line has trailing spaces."/> ! </module> ! <module name="UpperEll"/> ! <module name="CyclomaticComplexity"/> ! <module name="usage.UnusedLocalVariable"/> ! <module name="usage.UnusedPrivateField"/> ! <module name="usage.UnusedPrivateMethod"/> ! </module> ! ! </module> --- 1,208 ---- ! <?xml version="1.0"?> ! <!DOCTYPE module PUBLIC ! "-//Puppy Crawl//DTD Check Configuration 1.1//EN" ! "http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> ! ! <!-- ! ! Checkstyle configuration that checks the sun coding conventions from: ! ! - the Java Language Specification at ! http://java.sun.com/docs/books/jls/second_edition/html/index.html ! ! - the Sun Code Conventions at http://java.sun.com/docs/codeconv/ ! ! - the Javadoc guidelines at ! http://java.sun.com/j2se/javadoc/writingdoccomments/index.html ! ! - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html ! ! - some best practices ! ! Checkstyle is very configurable. Be sure to read the documentation at ! http://checkstyle.sf.net (or in your downloaded distribution). ! ! Most Checks are configurable, be sure to consult the documentation. ! ! To completely disable a check, just comment it out or delete it from the file. ! ! Finally, it is worth reading the documentation. ! ! --> ! ! <module name="Checker"> ! ! <!-- Checks that a package.html file exists for each package. --> ! <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml --> ! <!--<module name="PackageHtml"/>--> ! ! <!-- Checks whether files end with a new line. --> ! <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> ! <module name="NewlineAtEndOfFile"/> ! ! <!-- <module name="au.com.redhillconsulting.simian.SimianCheck"> ! <property name="language" value="java"/> ! </module>--> ! ! <module name="TreeWalker"> ! ! <!-- Checks for Javadoc comments. --> ! <!-- See http://checkstyle.sf.net/config_javadoc.html --> ! <module name="JavadocMethod"> ! <property name="scope" value="public"/> ! </module> ! <module name="JavadocType"> ! <property name="scope" value="public"/> ! </module> ! <module name="JavadocVariable"> ! <property name="scope" value="public"/> ! </module> ! <module name="JavadocStyle"> ! <property name="scope" value="public"/> ! </module> ! ! ! <!-- Checks for Naming Conventions. --> ! <!-- See http://checkstyle.sf.net/config_naming.html --> ! <module name="ConstantName"/> ! <module name="LocalFinalVariableName"> ! <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> ! </module> ! <module name="LocalVariableName"> ! <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> ! </module> ! <module name="MemberName"> ! <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/> ! </module> ! <module name="MethodName"/> ! <module name="PackageName"> ! <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/> ! </module> ! <module name="ParameterName"> ! <property name="format" value="^[a-z_][a-zA-Z0-9]*$"/> ! </module> ! <module name="StaticVariableName"/> ! <module name="TypeName"/> ! ! ! <!-- Checks for Headers --> ! <!-- See http://checkstyle.sf.net/config_header.html --> ! <!-- <module name="Header"> --> ! <!-- The follow property value demonstrates the ability --> ! <!-- to have access to ANT properties. In this case it uses --> ! <!-- the ${basedir} property to allow Checkstyle to be run --> ! <!-- from any directory within a project. See property --> ! <!-- expansion, --> ! <!-- http://checkstyle.sf.net/config.html#properties --> ! <!-- <property --> ! <!-- name="headerFile" --> ! <!-- value="${basedir}/java.header"/> --> ! <!-- </module> --> ! ! <!-- Following interprets the header file as regular expressions. --> ! <!-- <module name="RegexpHeader"/> --> ! ! ! <!-- Checks for imports --> ! <!-- See http://checkstyle.sf.net/config_import.html --> ! <module name="IllegalImport"/> <!-- defaults to sun.* packages --> ! <module name="RedundantImport"/> ! <module name="UnusedImports"/> ! ! ! <!-- Checks for Size Violations. --> ! <!-- See http://checkstyle.sf.net/config_sizes.html --> ! <module name="FileLength"/> ! <module name="LineLength"> ! <property name="ignorePattern" value="^ *\* *[^ ]+$"/> ! <property name="max" value="120"/> ! </module> ! <module name="MethodLength"/> ! <module name="ParameterNumber"/> ! ! ! <!-- Checks for whitespace --> ! <!-- See http://checkstyle.sf.net/config_whitespace.html --> ! <!-- <module name="EmptyForIteratorPad"/> ! <module name="NoWhitespaceAfter"/> ! <module name="NoWhitespaceBefore"/> ! <module name="OperatorWrap"/> ! <module name="ParenPad"/> ! <module name="TypecastParenPad"/> ! <module name="WhitespaceAround"/> ! --> ! <module name="TabCharacter"/> ! <module name="WhitespaceAfter"> ! <property name="tokens" value="SEMI"/> ! </module> ! ! ! ! <!-- Modifier Checks --> ! <!-- See http://checkstyle.sf.net/config_modifiers.html --> ! <!-- <module name="ModifierOrder"/>--> ! <module name="RedundantModifier"/> ! ! ! <!-- Checks for blocks. You know, those {}'s --> ! <!-- See http://checkstyle.sf.net/config_blocks.html --> ! <module name="AvoidNestedBlocks"/> ! <module name="EmptyBlock"/> ! <!-- <module name="LeftCurly"/> ! <module name="RightCurly"/> ! ! <module name="NeedBraces"/> ! --> ! ! ! <!-- Checks for common coding problems --> ! <!-- See http://checkstyle.sf.net/config_coding.html --> ! <!--<module name="AvoidInlineConditionals"/>--> ! <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> ! <module name="EmptyStatement"/> ! <module name="EqualsHashCode"/> ! <module name="HiddenField"/> ! <module name="IllegalInstantiation"> ! <property name="classes" value="java.lang.Boolean"/> ! </module> ! <module name="InnerAssignment"/> ! <!-- <module name="MagicNumber"/>--> ! <module name="MissingSwitchDefault"/> ! <module name="RedundantThrows"/> ! <module name="SimplifyBooleanExpression"/> ! <module name="SimplifyBooleanReturn"/> ! <module name="SuperClone"/> ! <module name="SuperFinalize"/> ! <module name="PackageDeclaration"/> ! <module name="ReturnCount"> ! <property name="max" value="3"/> ! </module> ! <module name="IllegalType"/> ! <module name="ParameterAssignment"/> ! <module name="ExplicitInitialization"/> ! ! <!-- Checks for class design --> ! <!-- See http://checkstyle.sf.net/config_design.html --> ! <module name="FinalClass"/> ! <module name="HideUtilityClassConstructor"/> ! <module name="InterfaceIsType"/> ! ! ! ! ! <!-- Miscellaneous other checks. --> ! <!-- See http://checkstyle.sf.net/config_misc.html --> ! <module name="ArrayTypeStyle"/> ! <!-- <module name="FinalParameters"/>--> ! <module name="GenericIllegalRegexp"> ! <property name="format" value="\s+$"/> ! <property name="message" value="Line has trailing spaces."/> ! </module> ! <module name="UpperEll"/> ! <module name="CyclomaticComplexity"/> ! <module name="usage.UnusedLocalVariable"/> ! <module name="usage.UnusedPrivateField"/> ! <module name="usage.UnusedPrivateMethod"/> ! </module> ! ! </module> Index: index.html =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/etc/controle/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.html 4 Mar 2004 12:42:39 -0000 1.1 --- index.html 10 Mar 2004 09:13:30 -0000 1.2 *************** *** 7,15 **** <title>Fudaa contrôle</title> </head> ! <body> <frameset rows="10%,90%"> <frame name="bandeau" src="bandeau.html"> <frame name="main" src="main.html"> </frameset> ! </body> </html> --- 7,15 ---- <title>Fudaa contrôle</title> </head> ! <frameset rows="10%,90%"> <frame name="bandeau" src="bandeau.html"> <frame name="main" src="main.html"> </frameset> ! </html> |
From: <de...@us...> - 2004-03-10 09:31:26
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469/src/org/fudaa/fudaa/test Added Files: package.html Log Message: Ajout du superviseur pour le prepro --- NEW FILE: package.html --- <body> Les tests de fudaa </body> |
From: <de...@us...> - 2004-03-10 09:31:26
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469/src/org/fudaa/fudaa/meshviewer Modified Files: MvActViewDefault.java MvActLoadDefault.java Log Message: Ajout du superviseur pour le prepro Index: MvActViewDefault.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/MvActViewDefault.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MvActViewDefault.java 12 Feb 2004 16:15:20 -0000 1.1 --- MvActViewDefault.java 10 Mar 2004 09:13:30 -0000 1.2 *************** *** 9,13 **** package org.fudaa.fudaa.meshviewer; - import java.awt.Component; import java.awt.Container; import java.awt.Font; --- 9,12 ---- *************** *** 15,19 **** import java.util.List; - import javax.swing.Icon; import javax.swing.UIManager; import javax.swing.event.ChangeEvent; --- 14,17 ---- *************** *** 23,31 **** import com.memoire.bu.BuTabbedPane; - import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.ef.EfGridSource; import org.fudaa.dodico.ef.EfGridSourceMutable; import org.fudaa.dodico.fichiers.FileOperationSynthese; - import org.fudaa.fudaa.meshviewer.controle.MvControlResult; --- 21,27 ---- Index: MvActLoadDefault.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/MvActLoadDefault.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MvActLoadDefault.java 12 Feb 2004 16:15:20 -0000 1.1 --- MvActLoadDefault.java 10 Mar 2004 09:13:30 -0000 1.2 *************** *** 42,45 **** --- 42,46 ---- import org.fudaa.ebli.dialog.EbliSimpleDialogPanel; + import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.ressource.FudaaResource; *************** *** 154,177 **** } public static FileFormat guessFormat( String _fileName, List _fileFormatList) { ! if ((_fileName == null) || (_fileFormatList == null)) ! return null; ! int idx= _fileName.indexOf('.'); ! if ((idx > 0) && (idx < _fileName.length())) { ! String ext= _fileName.substring(idx + 1); ! FileFormat temp= null; ! for (int i= _fileFormatList.size() - 1; i >= 0; i--) { ! temp= (FileFormat)_fileFormatList.get(i); ! if (temp.isExtension(ext)) ! return temp; ! } ! } else if ( ! _fileFormatList.contains(SerafinFileFormat.getInstance()) ! && (_fileName.startsWith("geo"))) { ! return SerafinFileFormat.getInstance(); ! } ! return null; } --- 155,168 ---- } + /** + * @param _fileName + * @param _fileFormatList + * @return + * @see FudaaLib#guessFormat(String, List) + */ public static FileFormat guessFormat( String _fileName, List _fileFormatList) { ! return FudaaLib.guessFormat(_fileName,_fileFormatList); } |
From: <de...@us...> - 2004-03-10 09:31:26
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469/src/org/fudaa/fudaa/commun Modified Files: FudaaCommonImplementation.java FudaaLib.java Log Message: Ajout du superviseur pour le prepro Index: FudaaCommonImplementation.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/FudaaCommonImplementation.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FudaaCommonImplementation.java 12 Feb 2004 16:15:13 -0000 1.15 --- FudaaCommonImplementation.java 10 Mar 2004 09:13:30 -0000 1.16 *************** *** 74,83 **** */ protected BuHelpFrame aide_; ! public final static String LOCAL_MAN="file://"+System.getProperty("user.dir")+"/aide/"; public final static String REMOTE_MAN= "http://www.utc.fr/fudaa/aide/aide_html/"; /** * Return le chemin de la propriete user.dir dans le format * file://.... */ public static final String getUserDirUrl() { --- 74,92 ---- */ protected BuHelpFrame aide_; ! ! /** ! * URL pour l'aide locale. ! */ ! public final static String LOCAL_MAN=getUserDirUrl()+"/aide/"; ! /** ! * URL pour l'aide distante. ! */ public final static String REMOTE_MAN= "http://www.utc.fr/fudaa/aide/aide_html/"; + /** * Return le chemin de la propriete user.dir dans le format * file://.... + * @return le chemin de l'utilisateur sous forme d'url valide */ public static final String getUserDirUrl() { *************** *** 96,99 **** --- 105,109 ---- b.add(_m, _idx); b.computeMnemonics(); + b.revalidate(); } public int getNbMenuInMenuBar() { *************** *** 314,318 **** } /** ! * */ public boolean confirmation(String _titre, String _text) { --- 324,328 ---- } /** ! * @see org.fudaa.fudaa.commun.FudaaUI#confirmation(java.lang.String, java.lang.String) */ public boolean confirmation(String _titre, String _text) { *************** *** 320,324 **** } /** ! * */ public boolean manageErrorOperationAndIsFatal(FileOperationSynthese _opResult) { --- 330,334 ---- } /** ! * @see org.fudaa.fudaa.commun.FudaaUI#manageErrorOperationAndIsFatal(org.fudaa.dodico.fichiers.FileOperationSynthese) */ public boolean manageErrorOperationAndIsFatal(FileOperationSynthese _opResult) { Index: FudaaLib.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/FudaaLib.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FudaaLib.java 21 Jan 2004 11:07:28 -0000 1.15 --- FudaaLib.java 10 Mar 2004 09:13:30 -0000 1.16 *************** *** 9,18 **** package org.fudaa.fudaa.commun; import java.io.File; import java.util.Vector; import javax.swing.JOptionPane; - import org.fudaa.ctulu.CtuluLib; - import com.memoire.bu.BuCommonInterface; import com.memoire.bu.BuDialogConfirmation; --- 9,18 ---- package org.fudaa.fudaa.commun; import java.io.File; + import java.net.MalformedURLException; + import java.util.List; import java.util.Vector; import javax.swing.JOptionPane; import com.memoire.bu.BuCommonInterface; import com.memoire.bu.BuDialogConfirmation; *************** *** 21,26 **** import com.memoire.bu.BuDialogWarning; import com.memoire.bu.BuIcon; - import com.memoire.fu.FuLib; import org.fudaa.fudaa.ressource.FudaaResource; /** --- 21,28 ---- import com.memoire.bu.BuDialogWarning; import com.memoire.bu.BuIcon; + import org.fudaa.ctulu.CtuluLib; + import org.fudaa.dodico.fichiers.FileFormat; + import org.fudaa.dodico.telemac.io.SerafinFileFormat; import org.fudaa.fudaa.ressource.FudaaResource; /** *************** *** 138,176 **** * Normalement pour une URL correcte, les ":" apres le C doivent etre * remplaces par "|" mais cela pose des problemes sous Windows. */ public static String pathToUrl(String _file) { ! if((!_file.startsWith("/")) && (_file.indexOf('\\')>0)){ String s1=FuLib.replace(_file, "\\", "\\\\"); ! return "file://"+FuLib.replace(s1, "/", "\\\\"); } else ! return "file://"+_file; } - - public static String urlToPath(String _url) { - if (_url.startsWith("file://")) - _url= _url.substring(7); - int premSigneSpeciale= indexOfSpecialCar(_url); - String urlFinale= ""; - if (premSigneSpeciale > 0) { - urlFinale= _url.substring(premSigneSpeciale); - _url= _url.substring(0, premSigneSpeciale); - } - _url= _url.replace('|', ':'); - if (File.separatorChar != '/') - _url= _url.replace('/', File.separatorChar); - return _url + urlFinale; - } - private static int indexOfSpecialCar(String _file) { - int premSigneSpeciale= _file.indexOf("?"); - int premDiese= _file.indexOf("#"); - if ((premDiese > 0) && (premSigneSpeciale > 0)) - premSigneSpeciale= Math.min(premDiese, premSigneSpeciale); - else if (premDiese > 0) - premSigneSpeciale= premDiese; - return premSigneSpeciale; - } /** * Transforme un tableau de chaine en une unique chaine avec des saut de --- 140,163 ---- * Normalement pour une URL correcte, les ":" apres le C doivent etre * remplaces par "|" mais cela pose des problemes sous Windows. + * @return url valide pour _file + * @param _file le chemin du fichier a transformer */ public static String pathToUrl(String _file) { ! try{ ! return new File(_file).toURL().toString(); ! } ! catch(MalformedURLException e){ ! e.printStackTrace(); ! return "file:/"+_file; ! } ! /* if((!_file.startsWith("/")) && (_file.indexOf('\\')>0)){ String s1=FuLib.replace(_file, "\\", "\\\\"); ! return "file:/"+FuLib.replace(s1, "/", "\\\\"); } else ! return "file:/"+_file;*/ } /** * Transforme un tableau de chaine en une unique chaine avec des saut de *************** *** 301,303 **** --- 288,319 ---- || (_r == JOptionPane.CLOSED_OPTION); } + + /** + * + * @param _fileName le nom de fichier + * @param _fileFormatList la liste des formats + * @return le format correspondant au nom de fichier + */ + public static FileFormat guessFormat( + String _fileName, + List _fileFormatList) { + if ((_fileName == null) || (_fileFormatList == null)) + return null; + int idx= _fileName.indexOf('.'); + if ((idx > 0) && (idx < _fileName.length())) { + String ext= _fileName.substring(idx + 1); + FileFormat temp= null; + for (int i= _fileFormatList.size() - 1; i >= 0; i--) { + temp= (FileFormat)_fileFormatList.get(i); + if (temp.isExtension(ext)) + return temp; + } + } else if ( + _fileFormatList.contains(SerafinFileFormat.getInstance()) + && (_fileName.startsWith("geo"))) { + return SerafinFileFormat.getInstance(); + } + return null; + } + } |
From: <de...@us...> - 2004-03-10 09:31:26
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469 Modified Files: build.xml Log Message: Ajout du superviseur pour le prepro Index: build.xml =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/build.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** build.xml 4 Mar 2004 12:06:48 -0000 1.12 --- build.xml 10 Mar 2004 09:13:30 -0000 1.13 *************** *** 441,446 **** </target> ! <target name="checksource" depends=".initialisation" ! description="verification du style de fudaa" if="checkstyle.classpath"> <!--Déclaration de la tâche checksource--> <taskdef resource="checkstyletask.properties" --- 441,450 ---- </target> ! ! <target name="check-style" ! depends=".initialisation" ! if="checkstyle.classpath" ! description="Checkstyle lance sur tout fudaa" ! > <!--Déclaration de la tâche checksource--> <taskdef resource="checkstyletask.properties" *************** *** 448,454 **** /> <!-- Création des répertoire de dest--> <mkdir dir="${fudaa.check.dir}/style"/> - <mkdir dir="${fudaa.check.dir}/depend"/> - <mkdir dir="${fudaa.check.dir}/junit"/> <property name="temp.file" value="${fudaa.check.dir}/temp.html"/> --- 452,457 ---- /> <!-- Création des répertoire de dest--> + <delete dir="${fudaa.check.dir}/style"/> <mkdir dir="${fudaa.check.dir}/style"/> <property name="temp.file" value="${fudaa.check.dir}/temp.html"/> *************** *** 556,561 **** srcfile="${fudaa.check.dir}/style/header-fudaa.xml" /> ! <copy overwrite="true" tofile="${fudaa.check.dir}/style/index.html" ! file="${etc.dir}/controle/index_checkstyle.html.tpl" > <filterset> --- 559,567 ---- srcfile="${fudaa.check.dir}/style/header-fudaa.xml" /> ! <copy encoding="iso-8859-1" ! outputencoding="iso-8859-1" ! overwrite="true" ! tofile="${fudaa.check.dir}/style/index.html" ! file="${etc.dir}/controle/index_checkstyle.html.tpl" > <filterset> *************** *** 571,574 **** --- 577,595 ---- /> + <delete file="${temp.file}"/> + <!-- Suppression de tous les fichiers xml --> + <delete> + + <fileset dir="${fudaa.check.dir}/style" includes="**/*.xml"/> + </delete> + </target> + + <target name="check-jdepend" + depends=".initialisation" + description="lancement de jdepend sur toutes les sources" + > + <delete dir="${fudaa.check.dir}/depend"/> + <mkdir dir="${fudaa.check.dir}/depend"/> + <property name="temp.file" value="${fudaa.check.dir}/temp.html"/> <!--jdepend--> <!-- Analyse de tous les packages de fudaa. Les fichiers java générés *************** *** 598,601 **** --- 619,639 ---- /> </style> + <delete file="${temp.file}"/> + <!-- Suppression de tous les fichiers xml + <delete> + + <fileset dir="${fudaa.check.dir}/depend/" includes="**/*.xml"/> + </delete> --> + + </target> + + <target name="check-junit" + depends=".initialisation" + description="lancement de jdepend sur toutes les sources" + > + <delete dir="${fudaa.check.dir}/depend"/> + <mkdir dir="${fudaa.check.dir}/depend"/> + <property name="temp.file" value="${fudaa.check.dir}/temp.html"/> + <mkdir dir="${fudaa.check.dir}/junit"/> <!--Lancement de junit dans les répertoire test--> <!-- Les fichiers xml de résultats sont rassemblés *************** *** 606,616 **** <batchtest todir="${fudaa.check.dir}/junit"> <fileset dir="${dodico.src.dir}"> ! <include name="**/test/**/Test*.java"/> </fileset> <fileset dir="${ebli.src.dir}"> ! <include name="**/test/**/Test*.java"/> </fileset> <fileset dir="${fudaa.src.dir}"> ! <include name="**/test/**/Test*.java"/> </fileset> --- 644,654 ---- <batchtest todir="${fudaa.check.dir}/junit"> <fileset dir="${dodico.src.dir}"> ! <include name="**/test/**/TestJ*.java"/> </fileset> <fileset dir="${ebli.src.dir}"> ! <include name="**/test/**/TestJ*.java"/> </fileset> <fileset dir="${fudaa.src.dir}"> ! <include name="**/test/**/TestJ*.java"/> </fileset> *************** *** 625,628 **** --- 663,678 ---- <report format="frames" todir="${fudaa.check.dir}/junit"/> </junitreport> + <delete file="${temp.file}"/> + <!-- Suppression de tous les fichiers xml --> + <delete> + + <fileset dir="${fudaa.check.dir}/junit/" includes="**/*.xml"/> + </delete> + + </target> + <target name="checksource" depends="check-jdepend,check-junit,check-style" + description="verification du style de fudaa" > + + <!-- Copie des fichiers html dans le dossier de dest et mise à jour des chaînes @date@--> *************** *** 751,755 **** ---FUDAA:suppression de ${fudaa.classes.dir}--- </echo> ! <delete includeEmptyDirs="true"> <fileset dir="${fudaa.classes.dir}"/> </delete> --- 801,805 ---- ---FUDAA:suppression de ${fudaa.classes.dir}--- </echo> ! <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${fudaa.classes.dir}"/> </delete> *************** *** 765,772 **** ---FUDAA:suppression de ${fudaa.build.dir}--- </echo> ! <delete includeEmptyDirs="true"> <fileset dir="${fudaa.build.dir}"/> </delete> ! <delete includeEmptyDirs="true"> <fileset dir="${fudaa.dist.dir}"/> </delete> --- 815,822 ---- ---FUDAA:suppression de ${fudaa.build.dir}--- </echo> ! <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${fudaa.build.dir}"/> </delete> ! <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${fudaa.dist.dir}"/> </delete> |
From: <de...@us...> - 2004-03-10 09:31:19
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469/src/org/fudaa/fudaa/tr/reflux Modified Files: TrRefluxProjet.java TrRefluxImplHelper.java TrRefluxParametres.java Log Message: Ajout du superviseur pour le prepro Index: TrRefluxProjet.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxProjet.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TrRefluxProjet.java 12 Feb 2004 16:15:21 -0000 1.18 --- TrRefluxProjet.java 10 Mar 2004 09:13:30 -0000 1.19 *************** *** 71,74 **** --- 71,76 ---- TrImplementation impl_; /** + * Il est conseille d'utiliser l'usine pour construire un projet + * @param _params les parametres de ce projet. * */ *************** *** 79,106 **** --- 81,135 ---- } + /** + * @see org.fudaa.fudaa.tr.TrProjet#getSoftwareID() + * @return FileFormatSoftware.REFLUX_IS.name + */ public String getSoftwareID() { return FileFormatSoftware.REFLUX_IS.name; } + /** + * @see org.fudaa.fudaa.fdico.FDicoProjetInterface#getImpl() + */ public FudaaCommonImplementation getImpl() { return impl_; } + /** + * @return les parametres correspondants + */ public TrRefluxParametres getRefluxParametres() { return params_; } + /** + * Appelle {@link #enregistrerParametres(ProgressionInterface)} + * @see org.fudaa.fudaa.fdico.FDicoProjetInterface#save(org.fudaa.dodico.commun.ProgressionInterface) + */ public void save(ProgressionInterface _prog) { enregistrerParametres(_prog); } + /** + * Appelle {@link org.fudaa.fudaa.tr.reflux.TrRefluxParametres#getH2dRefluxParametres()}; + * @return les params + */ public H2dRefluxParameters getH2dRefluxParametres() { return params_.getH2dRefluxParametres(); } + /** + * @return le gestionnaire des prop elementaires + */ public H2dRefluxElementPropertyMngAbstract getElementPropMng() { return params_.getH2dRefluxParametres().getElementPropMng(); } + /** + * @see org.fudaa.fudaa.tr.TrProjet#getEvolMng() + */ public H2dEvolutionManager getEvolMng() { return params_.getH2dRefluxParametres().getEvolMng(); } + /** + * @see org.fudaa.fudaa.tr.TrProjet#activeGrapheFille() + */ public synchronized void activeGrapheFille() { if ((impl_ == null) || (getEvolMng() == null)) *************** *** 124,128 **** } /** ! * */ public BuInformationsDocument getInformationsDocument() { --- 153,157 ---- } /** ! * @return les infos sur ce projets */ public BuInformationsDocument getInformationsDocument() { *************** *** 132,136 **** } /** ! * */ public void enregistrerParametres(ProgressionInterface _prog) { --- 161,166 ---- } /** ! * sauve les parametres uniquement. ! * @param _prog la barre de progression */ public void enregistrerParametres(ProgressionInterface _prog) { *************** *** 286,290 **** } /** ! * @return */ public FudaaCalculAction getCalculActions() { --- 316,320 ---- } /** ! * @return les actions de calcul */ public FudaaCalculAction getCalculActions() { Index: TrRefluxImplHelper.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxImplHelper.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TrRefluxImplHelper.java 12 Feb 2004 16:15:21 -0000 1.11 --- TrRefluxImplHelper.java 10 Mar 2004 09:13:30 -0000 1.12 *************** *** 8,13 **** */ package org.fudaa.fudaa.tr.reflux; - import java.io.File; import javax.swing.JComboBox; import javax.swing.JFileChooser; --- 8,13 ---- */ package org.fudaa.fudaa.tr.reflux; + import java.io.File; import javax.swing.JComboBox; import javax.swing.JFileChooser; *************** *** 15,21 **** import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; - - import org.fudaa.ctulu.CtuluLib; - import com.memoire.bu.BuComboBox; import com.memoire.bu.BuGridLayout; --- 15,18 ---- *************** *** 23,28 **** import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuTask; ! ! import org.fudaa.dodico.commun.DodicoPreferences; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.ef.FileFormatGridVersion; --- 20,24 ---- import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuTask; ! import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.ef.FileFormatGridVersion; *************** *** 32,45 **** import org.fudaa.dodico.reflux.io.INPFileFormat; import org.fudaa.dodico.telemac.io.TelemacDicoFileFormat; - import org.fudaa.ebli.dialog.EbliSimpleDialogPanel; import org.fudaa.ebli.filechooser.EbliFileChooser; - - import org.fudaa.fudaa.commun.exec.FudaaExecServerManager; import org.fudaa.fudaa.ressource.FudaaResource; import org.fudaa.fudaa.tr.TrFileFormatManager; import org.fudaa.fudaa.tr.TrImplHelper; import org.fudaa.fudaa.tr.TrImplementation; - import org.fudaa.fudaa.tr.TrPreferences; import org.fudaa.fudaa.tr.TrProjet; import org.fudaa.fudaa.tr.TrResource; --- 28,38 ---- import org.fudaa.dodico.reflux.io.INPFileFormat; import org.fudaa.dodico.telemac.io.TelemacDicoFileFormat; import org.fudaa.ebli.dialog.EbliSimpleDialogPanel; import org.fudaa.ebli.filechooser.EbliFileChooser; import org.fudaa.fudaa.ressource.FudaaResource; + import org.fudaa.fudaa.tr.TrApplicationManager; import org.fudaa.fudaa.tr.TrFileFormatManager; import org.fudaa.fudaa.tr.TrImplHelper; import org.fudaa.fudaa.tr.TrImplementation; import org.fudaa.fudaa.tr.TrProjet; import org.fudaa.fudaa.tr.TrResource; *************** *** 49,196 **** */ public class TrRefluxImplHelper extends TrImplHelper { - public static FudaaExecServerManager SERVEURS= - new FudaaExecServerManager( - TrPreferences.TR, - DodicoPreferences.buildPrefKey( - FileFormatSoftware.REFLUX_IS.name, - TrPreferences.KEY_SERVEUR_PREFIXE)); - public TrRefluxImplHelper(TrImplementation _impl) { - super(_impl); - } - public TrProjet ouvrir(ProgressionInterface _op, File _f, BuTask _bu) { - return _ouvrir(_op, _f, _bu); - } - public TrProjet ouvrir(ProgressionInterface _op, BuTask _bu) { - final File fic= - impl_.ouvrirFileChooser(null, TrResource.getS("fichier inp de Reflux")); - if (fic != null) { - return _ouvrir(_op, fic, _bu); - } - return null; - } - public BuMenuItem[] getMenuItemsOuvrir() { - BuMenuItem r0= - new BuMenuItem( - FudaaResource.FUDAA.getToolIcon("appli/telemac"), - TrResource.getS("Projet Télémac")); - r0.setActionCommand(impl_.PREF_OUVRIR + FileFormatSoftware.TELEMAC_IS.name); - BuMenuItem r= new BuMenuItem(null, TrResource.getS("Projet Dico")); - r.setActionCommand( - impl_.PREF_OUVRIR + TelemacDicoFileFormat.DICO_PROJET_ID); - return new BuMenuItem[] { r0, r }; - } - private TrProjet _ouvrir(ProgressionInterface _op, File _fic, BuTask _bu) { - impl_.initTaskView(_bu); - if (_fic != null) { - _op.setDesc(TrResource.getS("import fichier inp")); - BuMainPanel mp= getImpl().getMainPanel(); - mp.setMessage(TrResource.getS("Ouverture projet")); - TrRefluxProjet projet= - TrRefluxProjectFactory.createRefluxProject( - _fic, - INPFileFormat.getInstance().getLastINPVersionImpl(), - _op, - getImpl()); - mp.setProgression(60); - _op.setDesc(CtuluLib.EMPTY_STRING); - _op.setProgression(0); - mp.setMessage(TrResource.getS("Affichage") + " ..."); - mp.setMessage(CtuluLib.EMPTY_STRING); - mp.setProgression(0); - return projet; - } - return null; - } - /** - * - */ - public String getSoftwareID() { - return FileFormatSoftware.REFLUX_IS.name; - } - /** - * - */ - public FudaaExecServerManager getServersMng() { - return SERVEURS; - } - /** - * - */ - public TrProjet creer(ProgressionInterface _op, BuTask _bu) { - OpenPanel openPn= new OpenPanel(); - if (EbliSimpleDialogPanel - .isOkResponse( - openPn.afficheModale( - impl_.getFrame(), - TrResource.getS("Nouveau projet Reflux")))) { - impl_.initTaskView(_bu); - impl_.setMainMessage(TrResource.getS("Création projet")); - File f= openPn.getSelectedFile(); - FileFormat format= openPn.getFileFormat(); - if (format == null) - return null; - FileFormatGridVersion v= - (FileFormatGridVersion)format.getLastVersionInstance(); - H2dProjetType t= openPn.getProjectType(); - if (t == null) - return null; - return TrRefluxProjectFactory.createRefluxProjectFromGrid( - f, - v, - t, - _op, - impl_); - - } - return null; - } private class OpenPanel ! extends EbliSimpleDialogPanel ! implements CaretListener { ! JComboBox cbProjectType_; ! JComboBox cbFormat_; ! JTextField file_; FileFormat[] fts_; ! public OpenPanel() { addEmptyBorder(5); setLayout(new BuGridLayout(2, 5, 5)); addLabel(TrResource.getS("Type:")); ! cbProjectType_= ! new BuComboBox( ! new H2dProjetType[] { ! H2dProjetType.COURANTOLOGIE_2D, ! H2dProjetType.COURANTOLOGIE_2D_LMG }); cbProjectType_.setSelectedIndex(0); add(cbProjectType_); addLabel(TrResource.getS("Fichier contenant le maillage")); ! file_= ! addLabelFileChooserPanel( ! this, ! null, ! CtuluLib.EMPTY_STRING, ! false, ! true); file_.addCaretListener(this); ! fts_= new TrFileFormatManager().getFormatWithGridSupport(); ! cbFormat_= new BuComboBox(fts_); addLabel(TrResource.getS("Format du fichier")); add(cbFormat_); } ! public File getSelectedFile() { ! return new File(file_.getText()); ! } ! ! public FileFormat getFileFormat() { ! return (FileFormat)cbFormat_.getSelectedItem(); ! } ! ! public H2dProjetType getProjectType() { ! return (H2dProjetType)cbProjectType_.getSelectedItem(); } /** ! * */ public JFileChooser createFileChooser() { --- 42,101 ---- */ public class TrRefluxImplHelper extends TrImplHelper { private class OpenPanel ! extends EbliSimpleDialogPanel ! implements CaretListener { ! ! JComboBox cbFormat_; ! JComboBox cbProjectType_; ! JTextField file_; FileFormat[] fts_; ! ! public OpenPanel(File _f) { addEmptyBorder(5); setLayout(new BuGridLayout(2, 5, 5)); addLabel(TrResource.getS("Type:")); ! cbProjectType_ = ! new BuComboBox( ! new H2dProjetType[] { ! H2dProjetType.COURANTOLOGIE_2D, ! H2dProjetType.COURANTOLOGIE_2D_LMG}); cbProjectType_.setSelectedIndex(0); add(cbProjectType_); addLabel(TrResource.getS("Fichier contenant le maillage")); ! file_ = ! addLabelFileChooserPanel( ! this, ! null, ! CtuluLib.EMPTY_STRING, ! false, ! true); file_.addCaretListener(this); ! if(_f!=null) file_.setText(_f.getAbsolutePath()); ! fts_ = new TrFileFormatManager().getFormatWithGridSupport(); ! cbFormat_ = new BuComboBox(fts_); addLabel(TrResource.getS("Format du fichier")); add(cbFormat_); } ! /** ! * ! */ ! public void caretUpdate(CaretEvent e) { ! String s = file_.getText(); ! if (s == null) ! return; ! int ptIdx = s.lastIndexOf('.'); ! if ((ptIdx <= 0) || ptIdx >= s.length() - 1) ! return; ! s = s.substring(ptIdx + 1); ! for (int i = fts_.length - 1; i >= 0; i--) { ! if (fts_[i].isExtension(s)) ! cbFormat_.setSelectedItem(fts_[i]); ! } } /** ! * */ public JFileChooser createFileChooser() { *************** *** 198,234 **** } ! /** ! * ! */ ! public void caretUpdate(CaretEvent e) { ! String s= file_.getText(); ! if (s == null) ! return; ! int ptIdx= s.lastIndexOf('.'); ! if ((ptIdx <= 0) || ptIdx >= s.length() - 1) ! return; ! s= s.substring(ptIdx + 1); ! for (int i= fts_.length - 1; i >= 0; i--) { ! if (fts_[i].isExtension(s)) ! cbFormat_.setSelectedItem(fts_[i]); ! } } /** ! * */ public boolean valide() { ! File f= getSelectedFile(); if ((f == null) || (!f.exists())) { setErrorText( ! TrResource.getS( ! "Le fichier {0} n'existe pas", ! f == null ? CtuluLib.EMPTY_STRING : f.getAbsolutePath())); return false; - } return true; } } } --- 103,227 ---- } ! public FileFormat getFileFormat() { ! return (FileFormat) cbFormat_.getSelectedItem(); ! } ! ! public H2dProjetType getProjectType() { ! return (H2dProjetType) cbProjectType_.getSelectedItem(); ! } ! ! public File getSelectedFile() { ! return new File(file_.getText()); } /** ! * */ public boolean valide() { ! File f = getSelectedFile(); if ((f == null) || (!f.exists())) { setErrorText( ! TrResource.getS( ! "Le fichier {0} n'existe pas", ! f == null ? CtuluLib.EMPTY_STRING : f.getAbsolutePath())); return false; } return true; } + } + + public TrRefluxImplHelper(TrImplementation _impl) { + super(new TrApplicationManager(_impl)); + } + + private TrProjet _ouvrir(ProgressionInterface _op, File _fic, BuTask _bu) { + getImpl().initTaskView(_bu); + if (_fic != null) { + _op.setDesc(TrResource.getS("import fichier inp")); + BuMainPanel mp = getImpl().getMainPanel(); + mp.setMessage(TrResource.getS("Ouverture projet")); + TrRefluxProjet projet = + TrRefluxProjectFactory.createRefluxProject( + _fic, + INPFileFormat.getInstance().getLastINPVersionImpl(), + _op, + getImpl()); + mp.setProgression(60); + _op.setDesc(CtuluLib.EMPTY_STRING); + _op.setProgression(0); + mp.setMessage(TrResource.getS("Affichage") + " ..."); + mp.setMessage(CtuluLib.EMPTY_STRING); + mp.setProgression(0); + return projet; + } + return null; + } + + public TrProjet creer(ProgressionInterface _op, File _f,BuTask _bu) { + OpenPanel openPn = new OpenPanel(_f); + if (EbliSimpleDialogPanel + .isOkResponse( + openPn.afficheModale( + getImpl().getFrame(), + TrResource.getS("Nouveau projet Reflux")))) { + getImpl().initTaskView(_bu); + getImpl().setMainMessage(TrResource.getS("Création projet")); + File f = openPn.getSelectedFile(); + FileFormat format = openPn.getFileFormat(); + if (format == null) + return null; + FileFormatGridVersion v = + (FileFormatGridVersion) format.getLastVersionInstance(); + H2dProjetType t = openPn.getProjectType(); + if (t == null) + return null; + return TrRefluxProjectFactory.createRefluxProjectFromGrid( + f, + v, + t, + _op, + getImpl()); + } + return null; + } + public BuMenuItem[] getMenuItemsOuvrir() { + BuMenuItem r0 = + new BuMenuItem( + FudaaResource.FUDAA.getToolIcon("appli/telemac"), + TrResource.getS("Projet Télémac")); + r0.setActionCommand(getImpl().PREF_OUVRIR + FileFormatSoftware.TELEMAC_IS.name); + BuMenuItem r = new BuMenuItem(null, TrResource.getS("Projet Dico")); + r.setActionCommand( + TrImplementation.PREF_OUVRIR + TelemacDicoFileFormat.DICO_PROJET_ID); + return new BuMenuItem[] { r0, r}; + } + + /** + * @return l'identifiant reflux + */ + public String getSoftwareID() { + return FileFormatSoftware.REFLUX_IS.name; + } + + /** + * @see org.fudaa.fudaa.tr.TrImplHelper#ouvrir(org.fudaa.dodico.commun.ProgressionInterface, + * com.memoire.bu.BuTask) + */ + public TrProjet ouvrir(ProgressionInterface _op, BuTask _bu) { + final File fic = + getImpl().ouvrirFileChooser(null, TrResource.getS("fichier inp de Reflux")); + if (fic != null) { + return _ouvrir(_op, fic, _bu); + } + return null; + } + + /** + * @see org.fudaa.fudaa.tr.TrImplHelper#ouvrir(org.fudaa.dodico.commun.ProgressionInterface, + * java.io.File, com.memoire.bu.BuTask) + */ + public TrProjet ouvrir(ProgressionInterface _op, File _f, BuTask _bu) { + return _ouvrir(_op, _f, _bu); } } Index: TrRefluxParametres.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxParametres.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TrRefluxParametres.java 12 Feb 2004 16:15:21 -0000 1.17 --- TrRefluxParametres.java 10 Mar 2004 09:13:30 -0000 1.18 *************** *** 14,21 **** import java.util.Map; - import org.fudaa.ctulu.CtuluLib; - import com.memoire.bu.BuResource; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.ProgressionInterface; --- 14,20 ---- import java.util.Map; import com.memoire.bu.BuResource; + import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.ProgressionInterface; *************** *** 37,41 **** import org.fudaa.dodico.reflux.io.INPInterface; import org.fudaa.dodico.reflux.io.PnTransitoireFileFormat; - import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.FudaaUI; --- 36,39 ---- *************** *** 50,56 **** public class TrRefluxParametres implements TrParametres { private class TrInpInterface extends EfGridSourcesAbstract implements INPInterface { - String[] fics_; H2dRefluxBordIndexGeneral[] bd_; H2dRefluxBoundaryCondition[] cls_; public TrInpInterface(String[] _fic) { fics_= _fic; --- 48,57 ---- public class TrRefluxParametres implements TrParametres { private class TrInpInterface extends EfGridSourcesAbstract implements INPInterface { H2dRefluxBordIndexGeneral[] bd_; H2dRefluxBoundaryCondition[] cls_; + String[] fics_; + /** + * @param _fic les fichiers a ajouter + */ public TrInpInterface(String[] _fic) { fics_= _fic; *************** *** 59,63 **** } /** ! * */ public boolean contientRadiations() { --- 60,64 ---- } /** ! * @return true si contient Radiations */ public boolean contientRadiations() { *************** *** 65,69 **** } /** ! * */ public boolean contientSollicitationsReparties() { --- 66,70 ---- } /** ! * @return true su sollications réparties */ public boolean contientSollicitationsReparties() { *************** *** 71,75 **** } /** ! * */ public boolean contientVent() { --- 72,76 ---- } /** ! * @return true si vent */ public boolean contientVent() { *************** *** 77,81 **** } /** ! * */ public H2dRefluxBordIndexGeneral[] getBords() { --- 78,82 ---- } /** ! * @return les bords dans le format "reflux" */ public H2dRefluxBordIndexGeneral[] getBords() { *************** *** 85,89 **** /** ! * */ public H2dRefluxBoundaryCondition getConditionLimite(int _r) { --- 86,90 ---- /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#getConditionLimite(int) */ public H2dRefluxBoundaryCondition getConditionLimite(int _r) { *************** *** 91,137 **** } /** ! * */ public Map getEntiteValue() { return params_.getDicoParams().getEntiteValues(); } /** ! * */ public String[] getFichiers() { return fics_; } /** ! * */ ! public H2dTimeStepGroup[] getGroupePasTemps() { ! return params_.getGroupePasTempsTab(); } /** ! * */ public EfGrid getGrid() { return params_.getMaillage(); } /** ! * */ public H2dNodalPropertyMixte[] getPropElementaires() { return params_.getProprieteElementaireTab(); } /** ! * */ public H2dProjetType getTypeProjet() { return params_.getProjetType(); } /** ! * */ public String getVersion() { return getINPVersion().getVersionName(); } /** ! * */ public boolean isRadiationsLecturePasDeTemps() { --- 92,158 ---- } /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#getEntiteValue() */ public Map getEntiteValue() { return params_.getDicoParams().getEntiteValues(); } + /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#getFichiers() */ public String[] getFichiers() { return fics_; } + + /** ! * @see org.fudaa.dodico.ef.EfGridSource#getFileFormat() */ ! public FileFormat getFileFormat() { ! return INPFileFormat.getInstance(); } /** ! * @see org.fudaa.dodico.ef.EfGridSource#getGrid() */ public EfGrid getGrid() { return params_.getMaillage(); } + /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#getGroupePasTemps() ! */ ! public H2dTimeStepGroup[] getGroupePasTemps() { ! return params_.getGroupePasTempsTab(); ! } ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#getPropElementaires() */ public H2dNodalPropertyMixte[] getPropElementaires() { return params_.getProprieteElementaireTab(); } + /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#getTimeBeginningForTrans() ! */ ! public double getTimeBeginningForTrans() { ! return params_.getBeginTimeForTrans(); ! } ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#getTypeProjet() */ public H2dProjetType getTypeProjet() { return params_.getProjetType(); } + /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#getVersion() */ public String getVersion() { return getINPVersion().getVersionName(); } + /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#isRadiationsLecturePasDeTemps() */ public boolean isRadiationsLecturePasDeTemps() { *************** *** 139,160 **** } /** ! * */ public boolean isVentLecturePasDeTemps() { return false; } - /** - * - */ - public double getTimeBeginningForTrans() { - return params_.getBeginTimeForTrans(); - } - - /** - * - */ - public FileFormat getFileFormat() { - return INPFileFormat.getInstance(); - } } --- 160,168 ---- } /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSourceInterface#isVentLecturePasDeTemps() */ public boolean isVentLecturePasDeTemps() { return false; } } *************** *** 171,178 **** super(); } - - public H2dRefluxBcManager getRefluxBcMng() { - return params_.getRefluxClManager(); - } private boolean _save(File _f, ProgressionInterface _prog, boolean _ask) { File dir= _f.getAbsoluteFile().getParentFile(); --- 179,182 ---- *************** *** 236,239 **** --- 240,256 ---- return true; } + + + /** + * @return true + * @see org.fudaa.fudaa.tr.TrParametres#canImportEvolution() + */ + public boolean canImportEvolution() { + return true; + } + /** + * @param _f le repertoire de dest. + * @return le fichier unique + */ public File enregistrerUniqueSousRepertoire(File _f) { if (!_f.isDirectory()) { *************** *** 268,285 **** } /** ! * */ public DicoParams getDicoParam() { return params_.getDicoParams(); } public File getFile() { return fINP_; } ! ! public File getOutFile(){ ! return new File(DodicoLib.getSansExtension(fINP_.getAbsolutePath())+".out"); } ! public FudaaUI getUI() { ! return ui_; } public INPFileFormat.INPVersion getINPVersion() { --- 285,308 ---- } /** ! * @return les params issu du dico */ public DicoParams getDicoParam() { return params_.getDicoParams(); } + + /** + * @return le manager des evolutions + */ + public H2dEvolutionManager getEvolMng(){ + return params_.getEvolMng(); + } public File getFile() { return fINP_; } ! public H2dParameters getH2dParametres() { ! return getH2dRefluxParametres(); } ! public H2dRefluxParameters getH2dRefluxParametres() { ! return params_; } public INPFileFormat.INPVersion getINPVersion() { *************** *** 292,315 **** return params_.getMaillage(); } ! public H2dParameters getH2dParametres() { ! return getH2dRefluxParametres(); } ! public H2dRefluxParameters getH2dRefluxParametres() { ! return params_; } public String getTitle() { return title_; } public boolean isModified() { return params_.isModified(); } - - public H2dEvolutionManager getEvolMng(){ - return params_.getEvolMng(); - } /** ! * */ public void loadGeometrie(ProgressionInterface _interface) {} public void save(ProgressionInterface _prog) { if(fINP_==null) saveAs(_prog); --- 315,351 ---- return params_.getMaillage(); } ! ! public File getOutFile(){ ! return new File(DodicoLib.getSansExtension(fINP_.getAbsolutePath())+".out"); } ! ! public H2dRefluxBcManager getRefluxBcMng() { ! return params_.getRefluxClManager(); } public String getTitle() { return title_; } + public FudaaUI getUI() { + return ui_; + } + /** + * + */ + public boolean isGeometrieLoaded() { + return true; + } public boolean isModified() { return params_.isModified(); } /** ! * Ne fais rien ! * @see org.fudaa.fudaa.tr.TrParametres#loadGeometrie(org.fudaa.dodico.commun.ProgressionInterface) */ public void loadGeometrie(ProgressionInterface _interface) {} + + /** + * Sauve les parametres. Ouvre une boite de dialogue si necessaire. + * @param _prog la barre de progression + */ public void save(ProgressionInterface _prog) { if(fINP_==null) saveAs(_prog); *************** *** 329,332 **** --- 365,372 ---- } } + /** + * Sauve le projet dans un autre fichier. + * @param _prog la barre de progression + */ public void saveAs(ProgressionInterface _prog) { final File fic= *************** *** 363,380 **** FudaaLib.info("save copy in " + fic.getAbsolutePath()); } - /** - * - */ - public boolean isGeometrieLoaded() { - return true; - } - - - /** - * - */ - public boolean canImportEvolution() { - return true; - } } --- 403,406 ---- |
From: <de...@us...> - 2004-03-10 09:31:19
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469/src/org/fudaa/fudaa/tr/telemac Modified Files: TrTelemac2dParametres.java TrTelemacImplHelper.java TrTelemacCommunParametres.java TrTelemacProjectFactory.java TrTelemac2dProject.java Added Files: TrTelemacRubensExec.java TrTelemacAppliManager.java Removed Files: TrTelemacCodePrefDialogPanel.java Log Message: Ajout du superviseur pour le prepro --- NEW FILE: TrTelemacRubensExec.java --- /* * @file TrRubensExec.java * @creation 10 mars 2004 * @modification $Date: 2004/03/10 09:13:29 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.telemac; import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; import org.fudaa.fudaa.commun.exec.FudaaExec; import org.fudaa.fudaa.commun.exec.FudaaExecAction; import org.fudaa.fudaa.tr.TrPreferences; /** * @author Fred Deniger * @version $id$ * */ public class TrTelemacRubensExec extends FudaaExecAction{ private String[] paramDefault_; /** * Essaie de charger les prop particuliere de rubens. Si aucune charge les props par défaut. */ public TrTelemacRubensExec() { super(FudaaExec.loadFromPref("rubens", TrPreferences.TR, FileFormatSoftware.TELEMAC_IS.name)); String id="rubens"; if (exec_ == null) { if (CtuluLib.DEBUG) CtuluLib.debug("load default exec: " + id); setExec(new FudaaExec(id, id, "(intern)appli/" + id)); } } /** * @see org.fudaa.fudaa.commun.exec.FudaaExecAction#getParam() */ protected String[] getParam() { if(CtuluLib.isFrenchLanguageSelected()) return null; else if (paramDefault_==null){ paramDefault_=new String[]{"-a"}; } return paramDefault_; } } --- NEW FILE: TrTelemacAppliManager.java --- /* * @file TrTelemacAppliManager.java * @creation 9 mars 2004 * @modification $Date: 2004/03/10 09:13:29 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.telemac; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; import com.memoire.bu.BuMenu; import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuPopupMenu; import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; import org.fudaa.dodico.telemac.io.SerafinFileFormat; import org.fudaa.fudaa.commun.exec.FudaaExec; import org.fudaa.fudaa.commun.exec.FudaaExecAction; import org.fudaa.fudaa.ressource.FudaaResource; import org.fudaa.fudaa.tr.TrApplicationManager; import org.fudaa.fudaa.tr.TrImplementation; import org.fudaa.fudaa.tr.TrPreferences; import org.fudaa.fudaa.tr.TrResource; /** * @author Fred Deniger * @version $id$ */ public final class TrTelemacAppliManager extends TrApplicationManager { private FudaaExecAction matisseExecAction_; private FudaaExecAction rubensExec_; private BuMenuItem createRubensProject_; /** * @param _impl */ public TrTelemacAppliManager(TrImplementation _impl) { super(_impl); getMatisseExec(); } private FudaaExecAction getExec(String _id) { FudaaExec r = FudaaExec.loadFromPref(_id, TrPreferences.TR, getSoftwareID()); if (r == null) { if (CtuluLib.DEBUG) CtuluLib.debug("load default exec: " + _id); r = new FudaaExec(_id, _id, "(intern)appli/" + _id); } if (r != null) return new FudaaExecAction(r); else return null; } /** * @see org.fudaa.fudaa.tr.TrApplicationManager#buildTrItem(com.memoire.bu.BuMenu) */ protected synchronized void buildTrItem(BuMenu _m) { BuMenuItem it; if (getRubensExec() != null) { it = new BuMenuItem(); it.setAction(rubensExec_); _m.add(it); } if (getMatisseExec() != null) { it = new BuMenuItem(); it.setAction(matisseExecAction_); _m.add(it); } it = new BuMenuItem(TrResource.getS("Explorateur")); it.setActionCommand("EXPLORER"); it.addActionListener(this); _m.add(it); it = new BuMenuItem(TrResource.getS("Meshiew")); it.setActionCommand("MESHVIEW"); it.addActionListener(this); _m.add(it); it = new BuMenuItem(TrResource.getS("Console")); it.setActionCommand("CONSOLE"); it.addActionListener(this); _m.add(it); } /** * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent _e) { super.actionPerformed(_e); } /** * @see org.fudaa.fudaa.tr.TrApplicationManager#buildCmdForMenuDir(com.memoire.bu.BuPopupMenu, * java.awt.event.ActionListener) */ public void buildCmdForMenuDir(BuPopupMenu _m, ActionListener _l) { BuMenuItem it = new BuMenuItem(null, TrResource.TR.getString("Lancer Rubens")); it.setActionCommand("OPEN_RUBENS_IN"); it.addActionListener(_l); _m.add(it); it = new BuMenuItem(null, TrResource.TR.getString("Lancer Matisse")); it.setActionCommand("OPEN_MATISSE_IN"); it.addActionListener(_l); _m.add(it); } /** * @see org.fudaa.fudaa.tr.TrApplicationManager#updateMenuFiles(int, java.io.File) */ public void updateMenuFiles(int _nbFileChoosen, File _f) { createProject_.setEnabled((_nbFileChoosen == 1) && (getImpl().getFileFormatMng().isGridExtension(_f.getName()) == SerafinFileFormat .getInstance())); createRubensProject_.setEnabled((_nbFileChoosen==1) && (_f.getName().endsWith(".slf"))); } /** * @see org.fudaa.fudaa.tr.TrApplicationManager#buildCmdForMenuFile(com.memoire.bu.BuPopupMenu, * java.awt.event.ActionListener) */ public void buildCmdForMenuFile(BuPopupMenu _m, ActionListener _l) { super.buildCmdForMenuFile(_m,_l); createRubensProject_ = new BuMenuItem(null, TrResource.TR.getString("Créer projet Rubens")); createRubensProject_.setActionCommand("CREATE_RUBENS_PROJECT"); createRubensProject_.addActionListener(_l); _m.add(createRubensProject_); } /** * @see org.fudaa.fudaa.tr.TrApplicationManager#dirAction(java.lang.String, java.io.File) */ public void dirAction(String cmd, File _f) { if ("OPEN_MATISSE_IN".equals(cmd)) { if (this.matisseExecAction_ == null) getMatisseExec(); if (this.matisseExecAction_ != null) matisseExecAction_.execInDir(_f); } if ("OPEN_RUBENS_IN".equals(cmd)) { if (this.rubensExec_ == null) getRubensExec(); if (this.rubensExec_ != null) rubensExec_.execInDir(_f); } } /** * @return l'exe pour matisse */ public final FudaaExecAction getMatisseExec() { if (!isMatisseActif()) return null; if (matisseExecAction_ == null) { matisseExecAction_ = getExec("matisse"); } return matisseExecAction_; } /** * @return l'exe pour rubens */ public FudaaExecAction getRubensExec() { if (!isRubensActif()) return null; if (rubensExec_ == null) rubensExec_ = new TrTelemacRubensExec(); return rubensExec_; } /** * @return l'id du software */ public String getSoftwareID() { return FileFormatSoftware.TELEMAC_IS.name; } /** * @return true si l'exe matisse est actif */ public boolean isMatisseActif() { return TrPreferences.TR.getBooleanProperty(getSoftwareID() + ".matisse.enable", true); } /** * @return true si l'exe rubens est actif */ public boolean isRubensActif() { return TrPreferences.TR.getBooleanProperty(getSoftwareID() + ".rubens.enable", true); } /** * @see org.fudaa.fudaa.commun.exec.FudaaAppliManagerImpl#prefChanged() */ public void prefChanged() { super.prefChanged(); if (CtuluLib.DEBUG) CtuluLib.debug(getClass() + "Pref changed"); matisseExecAction_ = null; rubensExec_ = null; } /** * Enregistre dans les prefs l'etat de matisse */ public void saveMatisseExec() { if (matisseExecAction_ != null) FudaaExec.savePref(matisseExecAction_.getExec(), TrPreferences.TR, getSoftwareID()); } /** * Enregistre dans les prefs l'état de rubens */ public void saveRubensExec() { if (rubensExec_ != null) FudaaExec.savePref(rubensExec_.getExec(), TrPreferences.TR, getSoftwareID()); } /** * @param _b le nouvel etat pour l'exe matisse */ public void setMatisseActif(boolean _b) { TrPreferences.TR.putBooleanProperty(getSoftwareID() + ".matisse.enable", _b); if (!_b) matisseExecAction_ = null; } /** * @param _b le nouvel etat pour l'exe rubens */ public void setRubensActif(boolean _b) { TrPreferences.TR.putBooleanProperty(getSoftwareID() + ".rubens.enable", _b); if (!_b) rubensExec_ = null; } /** * @see org.fudaa.fudaa.tr.TrApplicationManager#fileAction(java.lang.String, java.io.File) */ public void fileAction(String _cmd, File _f) { if("CREATE_RUBENS_PROJECT".equals(_cmd)){ createRubensProject(_f); } else super.fileAction(_cmd, _f); } private void createRubensProject(File _f){ File parent= _f.getParentFile(); if(!parent.canWrite()){ getImpl().error( FudaaResource.getS( "Le fichier {0} ne peut pas être écrit. Vérifier les droits utilisateur de votre système", _f.getAbsolutePath())); return; } if(new File(parent,"project.RUB").exists()){ if(getImpl().confirmation("Rubens",TrResource.getS("Un projet Rubens existe déjà")+CtuluLib.LINE_SEP+ TrResource.getS("Voulez-vous ouvrir rubens dans ce répertoire")+" ?")){ rubensExec_.execInDir(_f); } return; } File rubProj=new File(_f,"project.RUB"); if(!rubProj.mkdir()){ getImpl().error( FudaaResource.getS( "Le fichier {0} ne peut pas être écrit. Vérifier les droits utilisateur de votre système", rubProj.getAbsolutePath())); return; } File bidonFile=new File(rubProj,"bidon.i"); try{ bidonFile.createNewFile(); } catch(IOException e){ e.printStackTrace(); getImpl().error( FudaaResource.getS( "Le fichier {0} ne peut pas être écrit. Vérifier les droits utilisateur de votre système", bidonFile.getAbsolutePath())); } rubensExec_.execInDir(parent); //TODO A continuer } } Index: TrTelemac2dParametres.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemac2dParametres.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TrTelemac2dParametres.java 12 Feb 2004 16:15:22 -0000 1.7 --- TrTelemac2dParametres.java 10 Mar 2004 09:13:29 -0000 1.8 *************** *** 41,46 **** DicoCasInterface _src, H2dTelemacDicoFileFormatVersion _dico, ! File _f) { ! super(_ui, _src, _dico, _f); } --- 41,46 ---- DicoCasInterface _src, H2dTelemacDicoFileFormatVersion _dico, ! File _f,File _gridFile) { ! super(_ui, _src, _dico, _f,_gridFile); } *************** *** 49,54 **** Map _inits,Map _commentaire, H2dTelemacDicoFileFormatVersion _dico, ! File _f) { ! super(_ui, _inits,_commentaire, _dico, _f); } public Telemac2dFileFormat.TelemacVersion getTelemacFileFormatVersion() { --- 49,54 ---- Map _inits,Map _commentaire, H2dTelemacDicoFileFormatVersion _dico, ! File _f,File _gridFile) { ! super(_ui, _inits,_commentaire, _dico, _f,_gridFile); } public Telemac2dFileFormat.TelemacVersion getTelemacFileFormatVersion() { Index: TrTelemacImplHelper.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacImplHelper.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TrTelemacImplHelper.java 12 Feb 2004 16:15:22 -0000 1.13 --- TrTelemacImplHelper.java 10 Mar 2004 09:13:29 -0000 1.14 *************** *** 8,18 **** */ package org.fudaa.fudaa.tr.telemac; - import java.io.File; - - import org.fudaa.ctulu.CtuluLib; import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuTask; ! import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.dico.DicoLanguage; --- 8,16 ---- */ package org.fudaa.fudaa.tr.telemac; + import java.io.File; import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuTask; ! import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.dico.DicoLanguage; *************** *** 23,32 **** import org.fudaa.dodico.telemac.io.TelemacDicoFileFormat; import org.fudaa.dodico.telemac.io.TelemacDicoFileFormatVersion; - import org.fudaa.ebli.dialog.EbliSimpleDialogPanel; - import org.fudaa.fudaa.fdico.FDicoChooserPanel; import org.fudaa.fudaa.fdico.FDicoNewProjectPanel; import org.fudaa.fudaa.ressource.FudaaResource; import org.fudaa.fudaa.tr.TrImplHelper; import org.fudaa.fudaa.tr.TrImplementation; --- 21,29 ---- import org.fudaa.dodico.telemac.io.TelemacDicoFileFormat; import org.fudaa.dodico.telemac.io.TelemacDicoFileFormatVersion; import org.fudaa.ebli.dialog.EbliSimpleDialogPanel; import org.fudaa.fudaa.fdico.FDicoChooserPanel; import org.fudaa.fudaa.fdico.FDicoNewProjectPanel; import org.fudaa.fudaa.ressource.FudaaResource; + import org.fudaa.fudaa.tr.TrApplicationManager; import org.fudaa.fudaa.tr.TrImplHelper; import org.fudaa.fudaa.tr.TrImplementation; *************** *** 38,74 **** */ public class TrTelemacImplHelper extends TrImplHelper { public TrTelemacImplHelper(TrImplementation _impl) { ! super(_impl); ! } ! public TrProjet ouvrir(ProgressionInterface _op, File _f, BuTask _bu) { ! return _ouvrir(_op, _f, _bu); ! } ! public TrProjet ouvrir(ProgressionInterface _op, BuTask _bu) { ! File fic= ! impl_.ouvrirFileChooser(null, TrResource.getS("Télémac Fichier cas")); ! if (fic != null) { ! return _ouvrir(_op, fic, _bu); ! } ! return null; ! } ! private TrProjet _ouvrir(ProgressionInterface _op, File _fic, BuTask _bu) { ! return _ouvrir(_op, _fic, DicoLanguage.getCurrentID(), _bu); } private TrProjet _ouvrir( ! ProgressionInterface _op, ! final File _fic, ! final int _language, ! BuTask _bu) { ! impl_.initTaskView(_bu); if (_fic != null) { _op.setDesc(TrResource.getS("Import fichier cas")); ! TrProjet projet= ! TrTelemacProjectFactory.createTelemac2dProject( ! _fic, ! (Telemac2dFileFormat.TelemacVersion)Telemac2dFileFormat ! .getInstance() ! .getLastVersionImpl(_language), ! _op, ! getImpl()); _op.setProgression(90); return projet; --- 35,64 ---- */ public class TrTelemacImplHelper extends TrImplHelper { + + + + /** + * @param _impl l'implementation correspondante + */ public TrTelemacImplHelper(TrImplementation _impl) { ! super(new TrTelemacAppliManager(_impl)); } + private TrProjet _ouvrir( ! ProgressionInterface _op, ! final File _fic, ! final int _language, ! BuTask _bu) { ! getImpl().initTaskView(_bu); if (_fic != null) { _op.setDesc(TrResource.getS("Import fichier cas")); ! TrProjet projet = ! TrTelemacProjectFactory.createTelemac2dProject( ! _fic, ! (Telemac2dFileFormat.TelemacVersion) Telemac2dFileFormat ! .getInstance() ! .getLastVersionImpl(_language), ! _op, ! getImpl()); _op.setProgression(90); return projet; *************** *** 76,135 **** return null; } ! public TrProjet ouvrirDico(ProgressionInterface _op, BuTask _bu) { ! FDicoChooserPanel s= ! new FDicoChooserPanel(TelemacDicoManager.getINSTANCE()); ! int r= ! s.afficheModale(impl_.getFrame(), TrResource.getS("Choix fichier dico")); ! if (s.isOkResponse(r)) { ! return _ouvrir( ! _op, ! s.getSelectedFile(), ! (TelemacDicoFileFormat)s.getFileFormatSelected(), ! s.getVersionSelected(), ! s.getLanguageSelected(), ! _bu); ! } ! return null; ! } private TrProjet _ouvrir( ! ProgressionInterface _op, ! final File _fic, ! final TelemacDicoFileFormat _ft, ! final String _v, ! final int _language, ! BuTask _bu) { if (_fic != null) { ! if (_ft == Telemac2dFileFormat.getInstance()) { ! return _ouvrir(_op, _fic, _language, _bu); } ! impl_.initTaskView(_bu); _op.setDesc( ! TrResource.getS("import fichier cas pour") ! + CtuluLib.ESPACE ! + _ft.getName()); ! TelemacDicoFileFormatVersion version= ! TelemacDicoManager.getINSTANCE().createTelemacVersionImpl( ! _ft, ! _v, ! _language); if (version == null) { getImpl().error( ! TrResource.getS("Erreur interne"), ! TrResource.getS("Impossible de créer le modele du dictionnaire")); return null; } ! DicoModelAbstract m= version.getDico(); if (m == null) { getImpl().error( ! TrResource.getS("Erreur interne"), ! TrResource.getS("Impossible de créer le modele du dictionnaire")); return null; } else { ! TrProjet projet= ! TrTelemacProjectFactory.createTelemacProjet( ! _fic, ! version, ! _op, ! getImpl()); _op.setProgression(90); return projet; --- 66,110 ---- return null; } ! private TrProjet _ouvrir( ! ProgressionInterface _op, ! final File _fic, ! final TelemacDicoFileFormat _ft, ! final String _v, ! final int _language, ! BuTask _bu) { if (_fic != null) { ! if (_ft == Telemac2dFileFormat.getInstance()) { ! return _ouvrir(_op, _fic, _language, _bu); } ! getImpl().initTaskView(_bu); _op.setDesc( ! TrResource.getS("import fichier cas pour") ! + CtuluLib.ESPACE ! + _ft.getName()); ! TelemacDicoFileFormatVersion version = ! TelemacDicoManager.getINSTANCE().createTelemacVersionImpl( ! _ft, ! _v, ! _language); if (version == null) { getImpl().error( ! TrResource.getS("Erreur interne"), ! TrResource.getS("Impossible de créer le modele du dictionnaire")); return null; } ! DicoModelAbstract m = version.getDico(); if (m == null) { getImpl().error( ! TrResource.getS("Erreur interne"), ! TrResource.getS("Impossible de créer le modele du dictionnaire")); return null; } else { ! TrProjet projet = ! TrTelemacProjectFactory.createTelemacProjet( ! _fic, ! version, ! _op, ! getImpl()); _op.setProgression(90); return projet; *************** *** 138,184 **** return null; } /** ! * ! */ ! public String getSoftwareID() { ! return FileFormatSoftware.TELEMAC_IS.name; ! } ! /** ! * */ ! public BuMenuItem[] getMenuItemsOuvrir() { ! BuMenuItem r0= new BuMenuItem(TrResource.getS("Projet dico")); ! r0.setActionCommand( ! impl_.PREF_OUVRIR + TelemacDicoFileFormat.DICO_PROJET_ID); ! BuMenuItem r= ! new BuMenuItem( ! FudaaResource.FUDAA.getToolIcon("appli/reflux"), ! TrResource.getS("Projet Reflux")); ! r.setActionCommand(impl_.PREF_OUVRIR + FileFormatSoftware.REFLUX_IS.name); ! return new BuMenuItem[] { r0, r }; } /** ! * */ ! public TrProjet creer(ProgressionInterface _op, BuTask _bu) { ! impl_.clearTaskView(_bu); ! FDicoNewProjectPanel p= ! new FDicoNewProjectPanel(TelemacDicoManager.getINSTANCE()); ! FDicoChooserPanel cp= p.getChooserPanel(); cp.setDicoSelected(Telemac2dFileFormat.getInstance()); ! int r= p.afficheModale(impl_.getFrame()); if (EbliSimpleDialogPanel.isOkResponse(r)) { ! File f= p.getFile(); if (f != null) { ! TelemacDicoFileFormatVersion ft= ! TelemacDicoManager.getINSTANCE().createTelemacVersionImpl( ! cp.getFileFormatSelected(), ! cp.getVersionSelected(), ! cp.getLanguageSelected()); ! if (ft != null) { ! return TrTelemacProjectFactory.createNewTelemacProjet( ! f, ! ft, ! getImpl()); } } --- 113,154 ---- return null; } + + /** ! * @see org.fudaa.fudaa.tr.TrImplHelper#createAppliMng() */ ! protected TrApplicationManager createAppliMng() { ! return new TrTelemacAppliManager(getImpl()); } + + + + /** ! * @see org.fudaa.fudaa.tr.TrImplHelper#creer(org.fudaa.dodico.commun.ProgressionInterface, java.io.File, com.memoire.bu.BuTask) */ ! public TrProjet creer(ProgressionInterface _op,File _gridFile, BuTask _bu) { ! getImpl().clearTaskView(_bu); ! FDicoNewProjectPanel p = ! new FDicoNewProjectPanel(TelemacDicoManager.getINSTANCE()); ! FDicoChooserPanel cp = p.getChooserPanel(); ! if(_gridFile!=null){ ! cp.setDefaultFile(new File(_gridFile.getParentFile(),"cas").getAbsolutePath()); ! } cp.setDicoSelected(Telemac2dFileFormat.getInstance()); ! int r = p.afficheModale(getImpl().getFrame()); if (EbliSimpleDialogPanel.isOkResponse(r)) { ! File f = p.getFile(); if (f != null) { ! TelemacDicoFileFormatVersion ft = ! TelemacDicoManager.getINSTANCE().createTelemacVersionImpl( ! cp.getFileFormatSelected(), ! cp.getVersionSelected(), ! cp.getLanguageSelected()); ! if (ft != null) { ! return TrTelemacProjectFactory.createNewTelemacProjet( ! f, ! ft, ! getImpl(),_gridFile); } } *************** *** 186,188 **** --- 156,218 ---- return null; } + + + + /** + * @return les menuitem a rajouter dans le menu ouvrir + */ + public BuMenuItem[] getMenuItemsOuvrir() { + BuMenuItem r0 = new BuMenuItem(TrResource.getS("Projet dico")); + r0.setActionCommand( + TrImplementation.PREF_OUVRIR + TelemacDicoFileFormat.DICO_PROJET_ID); + BuMenuItem r = + new BuMenuItem( + FudaaResource.FUDAA.getToolIcon("appli/reflux"), + TrResource.getS("Projet Reflux")); + r.setActionCommand(TrImplementation.PREF_OUVRIR + FileFormatSoftware.REFLUX_IS.name); + return new BuMenuItem[] { r0, r}; + } + + + /** + * @return l'id du software + */ + public String getSoftwareID() { + return FileFormatSoftware.TELEMAC_IS.name; + } + + + /** + * Ouvre le fichier _f (Telemac 2D) + * + * @see org.fudaa.fudaa.tr.TrImplHelper#ouvrir(org.fudaa.dodico.commun.ProgressionInterface, + * java.io.File, com.memoire.bu.BuTask) + */ + public TrProjet ouvrir(ProgressionInterface _op, File _f, BuTask _bu) { + FDicoChooserPanel s = + new FDicoChooserPanel(TelemacDicoManager.getINSTANCE()); + if (_f != null) s.setSelectedFic(_f.getAbsolutePath()); + int r = + s.afficheModale( + getImpl().getFrame(), TrResource.getS("Choix fichier dico")); + if (EbliSimpleDialogPanel.isOkResponse(r)) { + return _ouvrir( + _op, + s.getSelectedFile(), + (TelemacDicoFileFormat) s.getFileFormatSelected(), + s.getVersionSelected(), + s.getLanguageSelected(), + _bu); + } + return null; + } + + /** + * @param _op l'ecouteur pour l'avancement + * @param _bu la tache "parente" + * @return null is aucun projet ouvert + */ + public TrProjet ouvrir(ProgressionInterface _op, BuTask _bu) { + return ouvrir(_op, null, _bu); + } } Index: TrTelemacCommunParametres.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCommunParametres.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TrTelemacCommunParametres.java 12 Feb 2004 16:15:22 -0000 1.9 --- TrTelemacCommunParametres.java 10 Mar 2004 09:13:29 -0000 1.10 *************** *** 12,16 **** import org.fudaa.ctulu.CtuluLib; - import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.dico.DicoCasInterface; --- 12,15 ---- *************** *** 31,35 **** import org.fudaa.dodico.telemac.io.TelemacDicoFileFormatVersion; import org.fudaa.dodico.telemac.io.TelemacLib; - import org.fudaa.fudaa.commun.FudaaCommonImplementation; import org.fudaa.fudaa.commun.FudaaLib; --- 30,33 ---- *************** *** 51,57 **** DicoCasInterface _src, H2dTelemacDicoFileFormatVersion _dico, ! File _f) { super(_ui, _f, new H2dTelemacDicoParams(_src, _dico)); params_= new H2dTelemacParameters((H2dTelemacDicoParams)getDicoParams()); } --- 49,57 ---- DicoCasInterface _src, H2dTelemacDicoFileFormatVersion _dico, ! File _f,File _gridFile) { super(_ui, _f, new H2dTelemacDicoParams(_src, _dico)); params_= new H2dTelemacParameters((H2dTelemacDicoParams)getDicoParams()); + if(_gridFile!=null) setGridFile(_gridFile); + } *************** *** 60,121 **** Map _inits,Map _commentaire, H2dTelemacDicoFileFormatVersion _dico, ! File _f) { super(_ui, _f, new H2dTelemacDicoParams(_inits,_commentaire, _dico)); params_= new H2dTelemacParameters((H2dTelemacDicoParams)getDicoParams()); } - - public boolean isValide() { - return super.isValide(); - } - - public boolean canImportEvolution(){ - return params_.isTransientAvailable(); - } - - public H2dEvolutionManager getEvolMng(){ - return params_.getEvolMng(); - } - - - - public FudaaCommonImplementation getImpl() { - return (FudaaCommonImplementation)getUI(); - } - public TelemacDicoFileFormatVersion getDicoFileFormatVersion() { - return (TelemacDicoFileFormatVersion)getFileFormatVersion(); - } - public boolean isGeometrieLoaded() { - return dicoParams_.isLoaded( - getDicoFileFormatVersion().getMaillageEntiteFile()); - } - public boolean isBoundaryConditionLoaded() { - return dicoParams_.isLoaded(getDicoFileFormatVersion().getCLEntiteFile()); - } - public boolean isAllLoaded() { - return isBoundaryConditionLoaded(); - } - protected void loadAllAction(ProgressionInterface _prg) { - loadGeometrie(_prg); - if (isGeometrieLoaded()) - loadConditionsLimite(_prg); - } - public void loadGeometrie(ProgressionInterface _prg) { - if (!isGeometrieLoaded()) { - _loadGeometrie(_prg); - } - getUI().unsetMainMessage(); - } - public final void loadAll(ProgressionInterface _prg) { - if (!isAllLoaded()) { - loadAllAction(_prg); - } - } - /** - * @return true if the parameters corresponding to the entity are loaded. - */ - public boolean isParametersLoaded(DicoEntite _ent) { - return dicoParams_.isLoaded(_ent); - } private synchronized boolean _loadGeometrie(ProgressionInterface _prg) { DicoEntite entFile= getDicoFileFormatVersion().getMaillageEntiteFile(); --- 60,69 ---- Map _inits,Map _commentaire, H2dTelemacDicoFileFormatVersion _dico, ! File _f,File _gridFile) { super(_ui, _f, new H2dTelemacDicoParams(_inits,_commentaire, _dico)); params_= new H2dTelemacParameters((H2dTelemacDicoParams)getDicoParams()); + if(_gridFile!=null) setGridFile(_gridFile); } private synchronized boolean _loadGeometrie(ProgressionInterface _prg) { DicoEntite entFile= getDicoFileFormatVersion().getMaillageEntiteFile(); *************** *** 258,282 **** return false; } - public File getFileCas() { - return getMainFile(); - } - /** - * Renvoie le maillage. Si nul, il est necessaire de charger - * le maillage avec {@link #loadGeometrie(ProgressionInterface) loadGeometrie} - */ - public EfGrid getMaillage() { - if (params_ == null) - return null; - return params_.getMaillage(); - } - public H2dTelemacParameters getTelemacParametres() { - return params_; - } - public H2dParameters getH2dParametres() { - return getTelemacParametres(); - } - public H2dTelemacBcManager getClManager() { - return params_.getTelemacCLManager(); - } private boolean saveClFile(ProgressionInterface _prog, File _f) { // DicoEntite e= getDicoFileFormatVersion().getCLEntiteFile(); --- 206,209 ---- *************** *** 298,312 **** return !ui_.manageErrorOperationAndIsFatal(op); } ! /** ! * ! */ ! protected boolean saveDicoEntiteFileAction( ! DicoEntite _entFile, ! File _f, ! ProgressionInterface _interface) { ! if (_entFile == getDicoFileFormatVersion().getCLEntiteFile()) { ! return saveClFile(_interface, _f); ! } else ! return super.saveDicoEntiteFileAction(_entFile, _f, _interface); } protected String computeNewEntieFileToSave(DicoEntite _e) { --- 225,238 ---- return !ui_.manageErrorOperationAndIsFatal(op); } ! ! private void setGridFile(File _f){ ! DicoEntite entFile= getDicoFileFormatVersion().getMaillageEntiteFile(); ! if (entFile == null) { ! getUI().error( ! TrResource.getS("Fichier de maillage"), ! TrResource.getS("Définition du fichier géométrie non trouvée")); ! } ! String name=CtuluLib.getRelativeFile(_f,getDirBase(),5); ! getDicoParams().setValue(entFile,name); } protected String computeNewEntieFileToSave(DicoEntite _e) { *************** *** 326,329 **** --- 252,342 ---- return casName + ext; } + protected void loadAllAction(ProgressionInterface _prg) { + loadGeometrie(_prg); + if (isGeometrieLoaded()) + loadConditionsLimite(_prg); + } + /** + * + */ + protected boolean saveDicoEntiteFileAction( + DicoEntite _entFile, + File _f, + ProgressionInterface _interface) { + if (_entFile == getDicoFileFormatVersion().getCLEntiteFile()) { + return saveClFile(_interface, _f); + } else + return super.saveDicoEntiteFileAction(_entFile, _f, _interface); + } + + public boolean canImportEvolution(){ + return params_.isTransientAvailable(); + } + public H2dTelemacBcManager getClManager() { + return params_.getTelemacCLManager(); + } + public TelemacDicoFileFormatVersion getDicoFileFormatVersion() { + return (TelemacDicoFileFormatVersion)getFileFormatVersion(); + } + + public H2dEvolutionManager getEvolMng(){ + return params_.getEvolMng(); + } + public File getFileCas() { + return getMainFile(); + } + public H2dParameters getH2dParametres() { + return getTelemacParametres(); + } + + + + public FudaaCommonImplementation getImpl() { + return (FudaaCommonImplementation)getUI(); + } + /** + * Renvoie le maillage. Si nul, il est necessaire de charger + * le maillage avec {@link #loadGeometrie(ProgressionInterface) loadGeometrie} + */ + public EfGrid getMaillage() { + if (params_ == null) + return null; + return params_.getMaillage(); + } + public H2dTelemacParameters getTelemacParametres() { + return params_; + } + public boolean isAllLoaded() { + return isBoundaryConditionLoaded(); + } + public boolean isBoundaryConditionLoaded() { + return dicoParams_.isLoaded(getDicoFileFormatVersion().getCLEntiteFile()); + } + public boolean isGeometrieLoaded() { + return dicoParams_.isLoaded( + getDicoFileFormatVersion().getMaillageEntiteFile()); + } + /** + * @return true if the parameters corresponding to the entity are loaded. + */ + public boolean isParametersLoaded(DicoEntite _ent) { + return dicoParams_.isLoaded(_ent); + } + + + public boolean isValide() { + return super.isValide(); + } + public final void loadAll(ProgressionInterface _prg) { + if (!isAllLoaded()) { + loadAllAction(_prg); + } + } + public void loadGeometrie(ProgressionInterface _prg) { + if (!isGeometrieLoaded()) { + _loadGeometrie(_prg); + } + getUI().unsetMainMessage(); + } Index: TrTelemacProjectFactory.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacProjectFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TrTelemacProjectFactory.java 12 Feb 2004 16:15:22 -0000 1.5 --- TrTelemacProjectFactory.java 10 Mar 2004 09:13:29 -0000 1.6 *************** *** 8,11 **** --- 8,12 ---- */ package org.fudaa.fudaa.tr.telemac; + import java.io.File; import java.util.Map; *************** *** 22,25 **** --- 23,27 ---- */ public class TrTelemacProjectFactory { + /** * *************** *** 28,107 **** super(); } public static TrProjet createNewTelemacProjet( ! File _f, ! TelemacDicoFileFormatVersion _v, ! TrImplementation _ui) { ! return createNewTelemacProjet(_f, _v, _ui, null, null); } ! public static TrProjet createNewTelemacProjet( ! File _f, ! TelemacDicoFileFormatVersion _v, ! TrImplementation _ui, ! Map _m,Map _commentaire) { if (TelemacDicoManager.isTelemac2d(_v.getDicoFileFormat())) { ! return createNewTelemac2dProjet(_f, _v, _ui, _m,_commentaire); } ! return new TrTelemacCommunProjet( ! new TrTelemacCommunParametres(_ui, _m,_commentaire, _v, _f)); } ! public static TrProjet createNewTelemac2dProjet( ! File _f, ! TelemacDicoFileFormatVersion _v, ! TrImplementation _ui, ! Map _m,Map _com) { ! return new TrTelemac2dProject(new TrTelemac2dParametres(_ui, _m,_com, _v, _f)); } public static TrProjet createTelemacProjet( ! File _file, ! TelemacDicoFileFormatVersion _fileFormat, ! ProgressionInterface _progress, ! TrImplementation _ui) { ! if (TelemacDicoManager.isTelemac2d(_fileFormat.getDicoFileFormat())) { ! return createTelemac2dProject( ! _file, ! (Telemac2dFileFormat.TelemacVersion)_fileFormat, ! _progress, ! _ui); } ! FDicoParams.DicoReadData p= ! FDicoParams.createData( ! _file, ! _fileFormat, ! _progress, ! _ui, ! TelemacDicoManager.getINSTANCE()); if ((p == null) || (p.src == null)) return null; else { return new TrTelemacCommunProjet( ! new TrTelemacCommunParametres( ! _ui, ! p.src, ! (TelemacDicoFileFormatVersion)p.version, ! _file)); } } public static TrProjet createTelemac2dProject( ! File _file, ! Telemac2dFileFormat.TelemacVersion _fileFormat, ! ProgressionInterface _progress, ! TrImplementation _ui) { ! FDicoParams.DicoReadData p= ! FDicoParams.createData( ! _file, ! _fileFormat, ! _progress, ! _ui, ! TelemacDicoManager.getINSTANCE()); if ((p == null) || (p.src == null)) return null; else { ! TrTelemac2dParametres r= ! new TrTelemac2dParametres( ! _ui, ! p.src, ! (TelemacDicoFileFormatVersion)p.version, ! _file); return new TrTelemac2dProject(r); } --- 30,115 ---- super(); } + public static TrProjet createNewTelemacProjet( ! File _f, ! TelemacDicoFileFormatVersion _v, ! TrImplementation _ui, File _gridFile) { ! return createNewTelemacProjet(_f, _v, _ui, null, null, _gridFile); } ! public static TrProjet createNewTelemacProjet( ! File _f, ! TelemacDicoFileFormatVersion _v, ! TrImplementation _ui, ! Map _m, Map _commentaire, File _gridFile) { ! TrTelemacCommunProjet r; if (TelemacDicoManager.isTelemac2d(_v.getDicoFileFormat())) { ! r = createNewTelemac2dProjet(_f, _v, _ui, _m, _commentaire,_gridFile); } ! r = new TrTelemacCommunProjet( ! new TrTelemacCommunParametres(_ui, _m, _commentaire, _v, _f,_gridFile)); ! return r; } ! ! public static TrTelemac2dProject createNewTelemac2dProjet( ! File _f, ! TelemacDicoFileFormatVersion _v, ! TrImplementation _ui, ! Map _m, Map _com,File _gridFile) { ! return new TrTelemac2dProject(new TrTelemac2dParametres(_ui, _m, _com, _v, _f,_gridFile)); } + public static TrProjet createTelemacProjet( ! File _file, ! TelemacDicoFileFormatVersion _fileFormat, ! ProgressionInterface _progress, ! TrImplementation _ui) { ! if (TelemacDicoManager.isTelemac2d(_fileFormat.getDicoFileFormat())) { ! return createTelemac2dProject( ! _file, ! (Telemac2dFileFormat.TelemacVersion) _fileFormat, ! _progress, ! _ui); } ! FDicoParams.DicoReadData p = ! FDicoParams.createData( ! _file, ! _fileFormat, ! _progress, ! _ui, ! TelemacDicoManager.getINSTANCE()); if ((p == null) || (p.src == null)) return null; else { return new TrTelemacCommunProjet( ! new TrTelemacCommunParametres( ! _ui, ! p.src, ! (TelemacDicoFileFormatVersion) p.version, ! _file,null)); } } + public static TrProjet createTelemac2dProject( ! File _file, ! Telemac2dFileFormat.TelemacVersion _fileFormat, ! ProgressionInterface _progress, ! TrImplementation _ui) { ! FDicoParams.DicoReadData p = ! FDicoParams.createData( ! _file, ! _fileFormat, ! _progress, ! _ui, ! TelemacDicoManager.getINSTANCE()); if ((p == null) || (p.src == null)) return null; else { ! TrTelemac2dParametres r = ! new TrTelemac2dParametres( ! _ui, ! p.src, ! (TelemacDicoFileFormatVersion) p.version, ! _file,null); return new TrTelemac2dProject(r); } Index: TrTelemac2dProject.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemac2dProject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TrTelemac2dProject.java 25 Nov 2003 10:14:31 -0000 1.2 --- TrTelemac2dProject.java 10 Mar 2004 09:13:29 -0000 1.3 *************** *** 16,24 **** extends TrTelemacCommunProjet /**FDicoProjetAbstract implements TrProjet**/ { public TrTelemac2dProject(TrTelemac2dParametres _params) { super(_params); } /** ! * */ public String getID() { --- 16,27 ---- extends TrTelemacCommunProjet /**FDicoProjetAbstract implements TrProjet**/ { + /** + * @param _params les param du projet + */ public TrTelemac2dProject(TrTelemac2dParametres _params) { super(_params); } /** ! * @return l'identifiant de la chaine de calcul */ public String getID() { --- TrTelemacCodePrefDialogPanel.java DELETED --- |
From: <de...@us...> - 2004-03-10 09:31:19
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/fdico In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9469/src/org/fudaa/fudaa/fdico Modified Files: FDicoChooserPanel.java Added Files: package.html Log Message: Ajout du superviseur pour le prepro --- NEW FILE: package.html --- <body> Une interface graphique pour les dictionnaires du LNHE. Equivalent a edamox. </body> Index: FDicoChooserPanel.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/fdico/FDicoChooserPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FDicoChooserPanel.java 12 Feb 2004 16:15:19 -0000 1.1 --- FDicoChooserPanel.java 10 Mar 2004 09:13:29 -0000 1.2 *************** *** 47,53 **** --- 47,61 ---- DicoLanguage.LanguageComboBoxModel langChooser_; JTextField fic_; + /** + * @param _m les dico a prendre en compte + */ public FDicoChooserPanel(DicoManager _m) { this(_m, true); } + + + /** + * @param _f + */ public void setDicoSelected(DicoCasFileFormat _f) { if (dicoChooser_ != null) { *************** *** 55,58 **** --- 63,73 ---- } } + + /** + * @param _f le fichier a afficher par defaut + */ + public void setDefaultFile(String _f){ + fic_.setText(_f); + } public FDicoChooserPanel(DicoManager _m, boolean _fileChooser) { dicoMng_= _m; *************** *** 92,95 **** --- 107,115 ---- return langChooser_.getSelectedLanguage(); } + + public void setSelectedFic(String _f){ + fic_.setText(_f); + + } public File getSelectedFile() { return new File(fic_.getText()); |
From: <de...@us...> - 2004-03-10 09:27:54
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8895/src/org/fudaa/ebli/test Added Files: TestJGr.java Removed Files: TestGr.java Log Message: Renommage fichier de test --- NEW FILE: TestJGr.java --- (This appears to be a binary file; contents omitted.) --- TestGr.java DELETED --- |
From: <de...@us...> - 2004-03-10 09:27:54
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/filechooser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8895/src/org/fudaa/ebli/filechooser Modified Files: EbliFavoriteFiles.java Log Message: Renommage fichier de test Index: EbliFavoriteFiles.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/filechooser/EbliFavoriteFiles.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EbliFavoriteFiles.java 12 Dec 2003 10:52:25 -0000 1.2 --- EbliFavoriteFiles.java 10 Mar 2004 09:10:03 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- */ package org.fudaa.ebli.filechooser; + import java.awt.event.ActionEvent; import java.awt.event.ActionListener; *************** *** 17,21 **** import java.util.Enumeration; import java.util.List; ! import javax.swing.AbstractListModel; import javax.swing.JComboBox; --- 18,22 ---- import java.util.Enumeration; import java.util.List; ! import java.util.Observer; import javax.swing.AbstractListModel; import javax.swing.JComboBox; *************** *** 24,28 **** import javax.swing.JLabel; import javax.swing.MutableComboBoxModel; - import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuButtonLayout; --- 25,28 ---- *************** *** 31,35 **** import com.memoire.bu.BuResource; import com.memoire.bu.BuToolButton; ! import org.fudaa.ebli.dialog.EbliSimpleDialogPanel; import org.fudaa.ebli.ressource.EbliResource; --- 31,35 ---- import com.memoire.bu.BuResource; import com.memoire.bu.BuToolButton; ! import org.fudaa.ctulu.CtuluLib; import org.fudaa.ebli.dialog.EbliSimpleDialogPanel; import org.fudaa.ebli.ressource.EbliResource; *************** *** 38,62 **** import org.fudaa.ebli.tableau.EbliPanelListEditorModel; /** * @author deniger * @version $Id$ */ public class EbliFavoriteFiles { ! public static final String PREF_ID= "filechooser.favorite"; ! public static final String PREF_LAST= "filechooser.last.dir"; ! public static final EbliFavoriteFiles INSTANCE= new EbliFavoriteFiles(); ! List list_; /** ! * */ private EbliFavoriteFiles() { loadFavorites(); } private void loadFavorites() { ! list_= new ArrayList(20); ! for (Enumeration e= BuPreferences.BU.keys(); e.hasMoreElements();) { ! String k= (String)e.nextElement(); ! if (k.startsWith(PREF_ID)) { ! String val= BuPreferences.BU.getStringProperty(k); ! File f= new File(val); if ((!f.exists()) || (!f.isDirectory())) { BuPreferences.BU.removeProperty(k); --- 38,120 ---- import org.fudaa.ebli.tableau.EbliPanelListEditorModel; /** + * Permet de gerer les dossiers favoris et le dernier repertoire favori * @author deniger * @version $Id$ */ public class EbliFavoriteFiles { ! /** ! * Le prefix pour les favoris ! */ ! public static final String PREF_ID = "explorer.favorite."; ! /** ! * Le suffixe pardi ! */ ! public static final String SUF_ID = ".path"; ! /** ! * La cle de la pref pour le nombre de dossier favoris ! */ ! public static final String PREF_NB = "explorer.favorite.nb"; ! /** ! * La cle pour le dernier rep ouvert ! */ ! public static final String PREF_LAST = "explorer.last.dir"; ! /** ! * Le singleton ! */ ! public static final EbliFavoriteFiles INSTANCE = new EbliFavoriteFiles(); ! List list_; ! private Observer observer_; ! ! /** ! * */ private EbliFavoriteFiles() { loadFavorites(); } + + /** + * L'observer recevra un update avec des arguments null a chaque modif des favoris. + * @param _o le nouvel Observer + */ + public void setObserver(Observer _o) { + observer_ = _o; + } + + /** + * @param _f un nouveau rep favoris + */ + public void addFile(File _f) { + if ((_f != null) && (_f.exists()) && (_f.isDirectory())) { + String s = _f.getAbsolutePath(); + if (!list_.contains(s)) { + list_.add(s); + fireChange(); + } + } + } + private void loadFavorites() { ! list_ = new ArrayList(20); ! int nb = BuPreferences.BU.getIntegerProperty(PREF_NB, -1); ! if (nb < 0) { ! for (Enumeration e = BuPreferences.BU.keys(); e.hasMoreElements();) { ! String k = (String) e.nextElement(); ! if (k.startsWith(PREF_ID)) { ! String val = BuPreferences.BU.getStringProperty(k); ! File f = new File(val); ! if ((!f.exists()) || (!f.isDirectory())) { ! BuPreferences.BU.removeProperty(k); ! } else { ! list_.add(val); ! } ! } ! } ! } ! for (int i = 1; i <= nb; i++) { ! String k = PREF_ID + i+SUF_ID; ! String val = BuPreferences.BU.getStringProperty(k); ! if (val != null) { ! File f = new File(val); if ((!f.exists()) || (!f.isDirectory())) { BuPreferences.BU.removeProperty(k); *************** *** 68,92 **** Collections.sort(list_); } private class FavoriteModel ! extends AbstractListModel ! implements MutableComboBoxModel { Object selected_; /** ! * ! */ public Object getSelectedItem() { return selected_; } public void setSelectedItem(Object anItem) { if (((anItem != null) ! && (!anItem.equals(selected_)) ! || ((anItem == null) && selected_ != null))) { ! selected_= anItem; fireContentsChanged(this, -1, -1); } } public boolean contains(Object o) { return list_.contains(o); } public void addElement(Object obj) { if (obj instanceof String) { --- 126,166 ---- Collections.sort(list_); } + private class FavoriteModel ! extends AbstractListModel ! implements MutableComboBoxModel { ! Object selected_; + /** ! * @return l'obj selectionne ! */ public Object getSelectedItem() { return selected_; } + + /** + * @see javax.swing.ComboBoxModel#setSelectedItem(java.lang.Object) + */ public void setSelectedItem(Object anItem) { if (((anItem != null) ! && (!anItem.equals(selected_)) ! || ((anItem == null) && selected_ != null))) { ! selected_ = anItem; fireContentsChanged(this, -1, -1); } } + + /** + * @param o l'objet a tester + * @return true si l'objet est contenu dans la liste + */ public boolean contains(Object o) { return list_.contains(o); } + + /** + * @see javax.swing.MutableComboBoxModel#addElement(java.lang.Object) + */ public void addElement(Object obj) { if (obj instanceof String) { *************** *** 96,107 **** } } /** ! * Adds an item at a specific index */ public void insertElementAt(Object obj, int index) { addElement(obj); } /** * Removes an item at a specific index */ public void removeElementAt(int _i) { --- 170,184 ---- } } + /** ! * @see javax.swing.MutableComboBoxModel#insertElementAt(java.lang.Object, int) */ public void insertElementAt(Object obj, int index) { addElement(obj); } + /** * Removes an item at a specific index + * @param _i l'index a supprimer et pan! */ public void removeElementAt(int _i) { *************** *** 111,114 **** --- 188,192 ---- } } + protected void update() { if (list_.contains(getSelectedItem())) { *************** *** 117,134 **** fireContentsChanged(this, 0, list_.size()); } /** ! * */ public Object getElementAt(int arg0) { return list_.get(arg0); } /** ! * */ public int getSize() { return list_.size(); } /** ! * */ public void removeElement(Object obj) { --- 195,216 ---- fireContentsChanged(this, 0, list_.size()); } + /** ! * @see javax.swing.ListModel#getElementAt(int) */ public Object getElementAt(int arg0) { return list_.get(arg0); } + + /** ! * @see javax.swing.ListModel#getSize() */ public int getSize() { return list_.size(); } + /** ! * @see javax.swing.MutableComboBoxModel#removeElement(java.lang.Object) */ public void removeElement(Object obj) { *************** *** 136,149 **** } } public JComponent createComponent(final JFileChooser _f) { ! BuPanel pn= new BuPanel(); ! pn.setLayout(new BuBorderLayout(2, 2)); ! JLabel lb= new JLabel(EbliResource.getS("Favoris") + ":"); ! pn.add(lb, BuBorderLayout.WEST); ! final FavoriteModel model= new FavoriteModel(); ! final JComboBox j= new JComboBox(model); ! EbliCellTextRenderer cellRenderer= new EbliCellTextRenderer() { protected void setValue(Object value) { ! String s= (String)value; setToolTipText(s); setText(s); --- 218,237 ---- } } + + /** + * @param _f le file chooser dans lequel le composant sera affiche + * @return un composant a ajouter au JFileChooser _f + */ public JComponent createComponent(final JFileChooser _f) { ! BuPanel pnMain = new BuPanel(); ! pnMain.setLayout(new BuBorderLayout(2, 2)); ! JLabel lb = new JLabel(EbliResource.getS("Favoris") + ":"); ! pnMain.add(lb, BuBorderLayout.WEST); ! final FavoriteModel model = new FavoriteModel(); ! final JComboBox j = new JComboBox(model); ! EbliCellTextRenderer cellRenderer = new EbliCellTextRenderer() { ! protected void setValue(Object value) { ! String s = (String) value; setToolTipText(s); setText(s); *************** *** 153,200 **** j.setRenderer(cellRenderer); j.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { if (model.getSelectedItem() != null) { ! _f.setCurrentDirectory(new File((String)model.getSelectedItem())); } } } }); ! pn.add(j, BuBorderLayout.CENTER); ! BuToolButton bt= new BuToolButton(BuResource.BU.loadMenuCommandIcon("oui")); bt.setToolTipText( ! EbliResource.getS("Ajouter le répertoire courant aux favoris")); bt.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent _ae) { ! String s= _f.getCurrentDirectory().getAbsolutePath(); if (!list_.contains(s)) { model.addElement(s); } } }); ! BuPanel pnBt= new BuPanel(); pnBt.setLayout(new BuButtonLayout(1, BuButtonLayout.CENTER)); pnBt.add(bt); ! bt= new BuToolButton(BuResource.BU.loadMenuCommandIcon("editer")); bt.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent _ae) { ! EbliPanelListEditorModel listmodel= ! new EbliPanelListEditorModel(list_, false); ! EbliPanelListEditor editor= ! new EbliPanelListEditor(listmodel, false, true, false) { public void initCellRendererEditor() { ! EbliCellTextRenderer txt= new EbliCellTextRenderer(); txt.setIcon(BuResource.BU.getToolIcon("ouvrir")); table_.getColumnModel().getColumn(0).setCellRenderer(txt); } }; ! EbliSimpleDialogPanel pn= new EbliSimpleDialogPanel(); pn.setLayout(new BuBorderLayout()); pn.add(editor, BuBorderLayout.CENTER); if (EbliSimpleDialogPanel ! .isOkResponse( ! pn.afficheModale(j, EbliResource.getS("Edition des favoris")))) { ! list_= listmodel.getValuesInList(); model.update(); } } --- 241,294 ---- j.setRenderer(cellRenderer); j.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { if (model.getSelectedItem() != null) { ! _f.setCurrentDirectory(new File((String) model.getSelectedItem())); } } } }); ! pnMain.add(j, BuBorderLayout.CENTER); ! BuToolButton bt = new BuToolButton(BuResource.BU.loadMenuCommandIcon("oui")); bt.setToolTipText( ! EbliResource.getS("Ajouter le répertoire courant aux favoris")); bt.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent _ae) { ! String s = _f.getCurrentDirectory().getAbsolutePath(); if (!list_.contains(s)) { model.addElement(s); + EbliFavoriteFiles.this.fireChange(); } } }); ! BuPanel pnBt = new BuPanel(); pnBt.setLayout(new BuButtonLayout(1, BuButtonLayout.CENTER)); pnBt.add(bt); ! bt = new BuToolButton(BuResource.BU.loadMenuCommandIcon("editer")); bt.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent _ae) { ! EbliPanelListEditorModel listmodel = ! new EbliPanelListEditorModel(list_, false); ! EbliPanelListEditor editor = ! new EbliPanelListEditor(listmodel, false, true, false) { ! public void initCellRendererEditor() { ! EbliCellTextRenderer txt = new EbliCellTextRenderer(); txt.setIcon(BuResource.BU.getToolIcon("ouvrir")); table_.getColumnModel().getColumn(0).setCellRenderer(txt); } }; ! EbliSimpleDialogPanel pn = new EbliSimpleDialogPanel(); pn.setLayout(new BuBorderLayout()); pn.add(editor, BuBorderLayout.CENTER); if (EbliSimpleDialogPanel ! .isOkResponse( ! pn.afficheModale(j, EbliResource.getS("Edition des favoris")))) { ! list_ = listmodel.getValuesInList(); model.update(); + fireChange(); } } *************** *** 202,225 **** bt.setToolTipText(EbliResource.getS("Editer les favoris")); pnBt.add(bt); ! pn.add(pnBt, BuBorderLayout.EAST); ! return pn; } /** * Enregistre les preferences dans FudaaPreferences mais n'ecrit pas le fichier de pref. */ public void saveFavorites() { ! for (Enumeration e= BuPreferences.BU.keys(); e.hasMoreElements();) { ! String k= (String)e.nextElement(); if (k.startsWith(PREF_ID)) { BuPreferences.BU.removeProperty(k); } } - int n= list_.size(); - for (int i= 0; i < n; i++) { - String fin= Integer.toString(i); - StringBuffer b= new StringBuffer(PREF_ID.length() + fin.length() + 2); - b.append(PREF_ID).append('.').append(fin); - BuPreferences.BU.putStringProperty(b.toString(), (String)list_.get(i)); } } } --- 296,332 ---- bt.setToolTipText(EbliResource.getS("Editer les favoris")); pnBt.add(bt); ! pnMain.add(pnBt, BuBorderLayout.EAST); ! return pnMain; } + /** * Enregistre les preferences dans FudaaPreferences mais n'ecrit pas le fichier de pref. */ public void saveFavorites() { ! int nb = BuPreferences.BU.getIntegerProperty(PREF_NB, -1); ! if (nb < 0) { ! for (Enumeration e = BuPreferences.BU.keys(); e.hasMoreElements();) { ! String k = (String) e.nextElement(); if (k.startsWith(PREF_ID)) { BuPreferences.BU.removeProperty(k); } } } + else{ + for(int i=1;i<=nb;i++){ + BuPreferences.BU.removeProperty(PREF_ID+i+SUF_ID); + } + } + int n = list_.size(); + for (int i = 0; i < n; i++) { + String key = PREF_ID+CtuluLib.getString(i+1)+SUF_ID; + BuPreferences.BU.putStringProperty(key, (String) list_.get(i)); + } + BuPreferences.BU.putIntegerProperty(PREF_NB,list_.size()); + } + + protected void fireChange() { + saveFavorites(); + if (observer_ != null) observer_.update(null, null); } } |
From: <de...@us...> - 2004-03-10 09:27:52
|
Update of /cvsroot/fudaa/fudaa_devel/ebli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8895 Modified Files: build.xml Log Message: Renommage fichier de test Index: build.xml =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/ebli/build.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** build.xml 12 Feb 2004 16:41:22 -0000 1.8 --- build.xml 10 Mar 2004 09:10:03 -0000 1.9 *************** *** 356,360 **** ---EBLI:suppression de ${ebli.classes.dir}--- </echo> ! <delete includeEmptyDirs="true"> <fileset dir="${ebli.classes.dir}"/> </delete> --- 356,360 ---- ---EBLI:suppression de ${ebli.classes.dir}--- </echo> ! <delete quiet="true" includeEmptyDirs="true"> <fileset dir="${ebli.classes.dir}"/> </delete> *************** *** 369,373 **** ---EBLI:suppression de ${ebli.build.dir}--- </echo> ! <delete includeEmptyDirs="true"> <fileset dir="${ebli.build.dir}"/> </delete> --- 369,373 ---- ---EBLI:suppression de ${ebli.build.dir}--- </echo> ! <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${ebli.build.dir}"/> </delete> |
From: <de...@us...> - 2004-03-10 09:26:26
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/trigrid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8592/src/org/fudaa/dodico/trigrid Modified Files: TrigridReader.java Log Message: Un fichier geo (binaire) n'etait pas dans le bon format Correction de TestIO.getFile prob sous windows Ajout commentaires Index: TrigridReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/trigrid/TrigridReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TrigridReader.java 12 Feb 2004 15:45:32 -0000 1.1 --- TrigridReader.java 10 Mar 2004 09:08:37 -0000 1.2 *************** *** 14,22 **** import org.fudaa.ctulu.CtuluLib; - - import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.ef.EfElement; import org.fudaa.dodico.ef.EfElementType; - import org.fudaa.dodico.ef.EfGrid; import org.fudaa.dodico.ef.EfGridMutable; import org.fudaa.dodico.ef.EfGridSource; --- 14,19 ---- *************** *** 30,34 **** * Un lecteur de fichier trigrid ngh. Ce lecteur se base sur les sources du projet telemac. * Le maillage lu, n'est pas forcément supervalide : il faut vérifier par exemple ! * que les elements soient bien orienter,etc,... * @author deniger * @version $Id$ --- 27,31 ---- * Un lecteur de fichier trigrid ngh. Ce lecteur se base sur les sources du projet telemac. * Le maillage lu, n'est pas forcément supervalide : il faut vérifier par exemple ! * que les elements soient bien orientes,etc,... * @author deniger * @version $Id$ *************** *** 38,41 **** --- 35,41 ---- private TrigridFileFormat.TrigridVersion version_; + /** + * @param _version la version a utiliser + */ public TrigridReader(TrigridFileFormat.TrigridVersion _version) { version_= _version; *************** *** 164,168 **** /** ! * */ public FileFormatVersion getVersion() { --- 164,168 ---- /** ! * @return la version de trigrid utilisee */ public FileFormatVersion getVersion() { |
From: <de...@us...> - 2004-03-10 09:26:26
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8592/src/org/fudaa/dodico/test Modified Files: TestIO.java Log Message: Un fichier geo (binaire) n'etait pas dans le bon format Correction de TestIO.getFile prob sous windows Ajout commentaires Index: TestIO.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestIO.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TestIO.java 12 Feb 2004 15:32:49 -0000 1.8 --- TestIO.java 10 Mar 2004 09:08:37 -0000 1.9 *************** *** 11,14 **** --- 11,17 ---- import java.io.IOException; import java.net.URL; + + import com.memoire.fu.FuLib; + import junit.framework.TestCase; import org.fudaa.dodico.fichiers.FileFormat; *************** *** 26,29 **** --- 29,33 ---- fic_= getFile(_fic); assertNotNull(fic_); + assertTrue(fic_.exists()); } public abstract void testLecture(); *************** *** 47,51 **** if (url == null) return null; ! return new File(url.getPath()); } public static final File getFile(Class _c, String _f) { --- 51,56 ---- if (url == null) return null; ! File f=new File(FuLib.decode(url.getPath().substring(1))); ! return f; } public static final File getFile(Class _c, String _f) { |
From: <de...@us...> - 2004-03-10 09:26:26
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8592/src/org/fudaa/dodico/fichiers Modified Files: FileFormat.java FileOperationAbstract.java Log Message: Un fichier geo (binaire) n'etait pas dans le bon format Correction de TestIO.getFile prob sous windows Ajout commentaires Index: FileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileFormat.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FileFormat.java 11 Dec 2003 12:41:27 -0000 1.7 --- FileFormat.java 10 Mar 2004 09:08:37 -0000 1.8 *************** *** 155,158 **** --- 155,159 ---- return getName(); } + } Index: FileOperationAbstract.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fichiers/FileOperationAbstract.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FileOperationAbstract.java 12 Feb 2004 15:32:44 -0000 1.7 --- FileOperationAbstract.java 10 Mar 2004 09:08:37 -0000 1.8 *************** *** 14,21 **** import java.io.IOException; - import org.fudaa.ctulu.CtuluLib; - import org.fudaa.dodico.commun.DodicoAnalyze; - import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.fortran.FortranInterface; --- 14,18 ---- *************** *** 28,31 **** --- 25,31 ---- protected ProgressionInterface progress_; protected DodicoAnalyze analyze_; + /** + * @param _progressReceiver l'ecouter pour la progression + */ public void setProgressReceiver(ProgressionInterface _progressReceiver) { progress_= _progressReceiver; *************** *** 33,36 **** --- 33,40 ---- protected abstract String getOperationDescription(); protected abstract FortranInterface getFortranInterface(); + + /** + * @param _f le fichier a lire + */ public abstract void setFile(File _f); // public abstract FileFormatVersion getVersion(); *************** *** 49,52 **** --- 53,60 ---- return r; } + /** + * @param _f le fichier a lire + * @return le FileReader correspondant + */ public static final FileReader initFileReader(File _f) { FileReader r= null; *************** *** 56,59 **** --- 64,71 ---- return r; } + /** + * @param _f le fichier a ecrire + * @return le FileWriter correspondant + */ public static final FileWriter initFileWriter(File _f) { FileWriter r= null; |
From: <de...@us...> - 2004-03-10 09:26:25
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8592/src/org/fudaa/dodico/commun Modified Files: DodicoAnalyze.java Log Message: Un fichier geo (binaire) n'etait pas dans le bon format Correction de TestIO.getFile prob sous windows Ajout commentaires Index: DodicoAnalyze.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoAnalyze.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DodicoAnalyze.java 12 Feb 2004 15:32:43 -0000 1.11 --- DodicoAnalyze.java 10 Mar 2004 09:08:36 -0000 1.12 *************** *** 47,52 **** if (an != null) { if (i != 0) ! b.append(CtuluLib.SEP_LINE); ! b.append(an.getDesc()).append(CtuluLib.SEP_LINE); b.append(an.getResume()); } --- 47,52 ---- if (an != null) { if (i != 0) ! b.append(CtuluLib.LINE_SEP); ! b.append(an.getDesc()).append(CtuluLib.LINE_SEP); b.append(an.getResume()); } *************** *** 54,60 **** --- 54,67 ---- return b.toString(); } + /** + * Ecrit sur la sortie standart le resume de l'analyse + * @param _prefix le prefixe pour chaque ligne + */ public void printResume(String _prefix) { System.out.println(getResume(_prefix)); } + /** + * @return le resume de l'analyse + */ public String getResume() { return getResume(CtuluLib.EMPTY_STRING); |
From: <de...@us...> - 2004-03-10 09:26:25
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8592/src/org/fudaa/dodico/test/telemac Modified Files: TestJTrigrid.java trigrid.geo Log Message: Un fichier geo (binaire) n'etait pas dans le bon format Correction de TestIO.getFile prob sous windows Ajout commentaires Index: TestJTrigrid.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestJTrigrid.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestJTrigrid.java 5 Mar 2004 15:18:24 -0000 1.1 --- TestJTrigrid.java 10 Mar 2004 09:08:36 -0000 1.2 *************** *** 34,37 **** --- 34,39 ---- public TestJTrigrid() { super("trigrid.ngh"); + assertNotNull(fic_); + assertTrue(fic_.exists()); g_ = ( (EfGridSource) TrigridFileFormat *************** *** 43,47 **** /** ! * */ public void testEcriture() { --- 45,49 ---- /** ! * Test Ecriture */ public void testEcriture() { *************** *** 50,54 **** f, g_, null); - System.out.println(f.getAbsolutePath()); EfGrid g = ((EfGridSource) TrigridFileFormat --- 52,55 ---- Index: trigrid.geo =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/trigrid.geo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvs4NQddQ and /tmp/cvsOoOg5r differ |
From: <de...@us...> - 2004-03-10 09:26:25
|
Update of /cvsroot/fudaa/fudaa_devel/dodico In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8592 Modified Files: build.xml Log Message: Un fichier geo (binaire) n'etait pas dans le bon format Correction de TestIO.getFile prob sous windows Ajout commentaires Index: build.xml =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/build.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** build.xml 12 Feb 2004 16:41:22 -0000 1.12 --- build.xml 10 Mar 2004 09:08:35 -0000 1.13 *************** *** 595,599 **** ---DODICO:suppression de ${dodico.classes.dir}--- </echo> ! <delete includeEmptyDirs="true"> <fileset dir="${dodico.classes.dir}"/> </delete> --- 595,599 ---- ---DODICO:suppression de ${dodico.classes.dir}--- </echo> ! <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${dodico.classes.dir}"/> </delete> *************** *** 610,617 **** ---DODICO:effacement de ${dodico.classes.dir}--- </echo> ! <delete includeEmptyDirs="true"> <fileset dir="${dodico.classes.dir}"/> </delete> ! <delete includeEmptyDirs="true"> <fileset dir="${dodico.java.genere.dir}"/> </delete> --- 610,617 ---- ---DODICO:effacement de ${dodico.classes.dir}--- </echo> ! <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${dodico.classes.dir}"/> </delete> ! <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${dodico.java.genere.dir}"/> </delete> |
From: <de...@us...> - 2004-03-10 09:26:24
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fortran In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8592/src/org/fudaa/dodico/fortran Modified Files: FortranLib.java Log Message: Un fichier geo (binaire) n'etait pas dans le bon format Correction de TestIO.getFile prob sous windows Ajout commentaires Index: FortranLib.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fortran/FortranLib.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FortranLib.java 12 Dec 2003 10:30:53 -0000 1.5 --- FortranLib.java 10 Mar 2004 09:08:35 -0000 1.6 *************** *** 60,64 **** if (r != null) { return DodicoResource.getS("Erreur lors de la fermeture du flux") ! + CtuluLib.SEP_LINE + r.getMessage(); } else --- 60,64 ---- if (r != null) { return DodicoResource.getS("Erreur lors de la fermeture du flux") ! + CtuluLib.LINE_SEP + r.getMessage(); } else |
From: <de...@us...> - 2004-03-10 09:24:16
|
Update of /cvsroot/fudaa/fudaa_devel/aide In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8220 Added Files: .cvsignore Log Message: Ignore .project et .classpath --- NEW FILE: .cvsignore --- .classpath .project |