Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun
In directory sc8-pr-cvs1:/tmp/cvs-serv15410
Modified Files:
DodicoAnalyze.java DodicoLib.java DodicoPreferences.java
DodicoResource.java ProgressionBuAdapter.java
ProgressionDodicoAdapter.java ProgressionInterface.java
Added Files:
DodicoDoubleDoubleSortedList.java DodicoPermanentList.java
DodicoUI.java DodicoUIDefault.java
Removed Files:
DodicoFileFormat.java
Log Message:
DodicoDoubleDoubleSortedList: liste permettant de manipuler une table de
correspondance de double triee.
DodicoPermanentList : liste non modifiable.
DodicoUI : interface utilisateur ( envoyer des messages normaux et
d'erreur). Cette interface permet de choisir le type de rendu ( console,
graphique, log...)
DodicoUIDefault :implementation de base de DodicoUI qui envoie les
messages dans la console.
--- NEW FILE: DodicoDoubleDoubleSortedList.java ---
/*
* @file DodicoDoubleDoubleSortedList.java
* @creation 26 juin 2003
* @modification $Date: 2003/07/04 08:11:42 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.commun;
import gnu.trove.TDoubleArrayList;
import gnu.trove.TDoubleDoubleHashMap;
/**
* @author deniger
* @version $Id: DodicoDoubleDoubleSortedList.java,v 1.1 2003/07/04 08:11:42 deniger Exp $
*/
public class DodicoDoubleDoubleSortedList
{
TDoubleArrayList t_;
TDoubleArrayList val_;
public DodicoDoubleDoubleSortedList()
{
t_ = new TDoubleArrayList();
val_ = new TDoubleArrayList();
}
public boolean containsKey(double _key)
{
return indexOfKey(_key)>=0;
}
/**
*
*/
public DodicoDoubleDoubleSortedList(int _n)
{
t_ = new TDoubleArrayList(_n);
val_ = new TDoubleArrayList(_n);
}
public int size()
{
return t_.size();
}
public void put(double _t, double _val)
{
if (t_.size() == 0)
{
t_.add(_t);
val_.add(_val);
}
else
{
int k = t_.binarySearch(_t);
if (k < 0)
{
k = -k;
if (k > t_.size())
{
t_.add(_t);
val_.add(_val);
}
else
{
t_.insert(k-1, _t);
val_.insert(k-1, _val);
}
}
else
{
val_.set(k, _val);
}
}
}
public String toString()
{
return t_.toString()+DodicoLib.LINE_SEP+val_.toString();
}
public void removeKey(double _key)
{
int index=indexOfKey(_key);
if(index>=0)
{
t_.remove(index);
val_.remove(index);
}
}
public void removeValue(double _val)
{
int index=indexOfValue(_val);
if(index>=0)
{
t_.remove(index);
val_.remove(index);
}
}
public int indexOfKey(double _key)
{
return t_.binarySearch(_key);
}
public int indexOfValue(double _val)
{
return val_.binarySearch(_val);
}
public double getKeyAtIndex(int _offset)
{
return t_.get(_offset);
}
public double getQuickKeyAtIndex(int _offset)
{
return t_.getQuick(_offset);
}
public double getValueAtIndex(int _offset)
{
return val_.get(_offset);
}
public double getQuickValueAtIndex(int _offset)
{
return val_.getQuick(_offset);
}
public double getValueForKey(double _key)
{
int i = indexOfKey(_key);
return i < 0 ? (double) 0 : val_.getQuick(i);
}
public double getKeyForValue(double _val)
{
int i = indexOfValue(_val);
return i < 0 ? (double) 0 : t_.getQuick(i);
}
public static void main(String[] args)
{
DodicoDoubleDoubleSortedList l=new DodicoDoubleDoubleSortedList(15);
l.put(1d,1d);
l.put(3d,3d);
l.put(5d,5d);
l.put(4d,5d);
l.put(0d,0d);
l.put(4d,4d);
System.out.println(l.toString());
System.out.println(l.getValueForKey(1d));
System.out.println(l.getKeyForValue(5d));
System.out.println(l.containsKey(0d));
l.removeKey(4d);
l.removeValue(1d);
System.out.println(l.toString());
}
}
--- NEW FILE: DodicoPermanentList.java ---
/*
* @file DodicoPermanentList.java
* @creation 17 juin 2003
* @modification $Date: 2003/07/04 08:11:42 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.commun;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
/**
* @author deniger
* @version $Id: DodicoPermanentList.java,v 1.1 2003/07/04 08:11:42 deniger Exp $
*/
public class DodicoPermanentList extends ArrayList
{
/**
* @param c
*/
public DodicoPermanentList(Collection c)
{
super(c);
super.trimToSize();
}
public DodicoPermanentList(Object[] _o)
{
this(Arrays.asList(_o));
}
/**
*
*/
public void add(int index, Object element)
{
throw new UnsupportedOperationException();
}
/**
*
*/
public boolean add(Object o)
{
throw new UnsupportedOperationException();
}
/**
*
*/
public boolean addAll(Collection c)
{
throw new UnsupportedOperationException();
}
/**
*
*/
public boolean addAll(int index, Collection c)
{
throw new UnsupportedOperationException();
}
/**
*
*/
public void clear()
{
throw new UnsupportedOperationException();
}
/**
*
*/
public void ensureCapacity(int minCapacity)
{
throw new UnsupportedOperationException();
}
/**
*
*/
public Object remove(int index)
{
throw new UnsupportedOperationException();
}
/**
*
*/
protected void removeRange(int fromIndex, int toIndex)
{
throw new UnsupportedOperationException();
}
/**
*
*/
public Object set(int index, Object element)
{
throw new UnsupportedOperationException();
}
/**
*
*/
public void trimToSize()
{
throw new UnsupportedOperationException();
}
}
--- NEW FILE: DodicoUI.java ---
/*
* @file DodicoUI.java
* @creation 13 juin 2003
* @modification $Date: 2003/07/04 08:11:42 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.commun;
/**
* @author fred deniger
* @version $Id: DodicoUI.java,v 1.1 2003/07/04 08:11:42 deniger Exp $
*
*/
public interface DodicoUI
{
public void error(String _titre,String _msg);
public void message(String _titre,String _msg);
public void error(String _msg);
public void message(String _msg);
}
--- NEW FILE: DodicoUIDefault.java ---
/*
* @file DodicoUIDefault.java
* @creation 13 juin 2003
* @modification $Date: 2003/07/04 08:11:42 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.commun;
/**
* @author fred deniger
* @version $Id: DodicoUIDefault.java,v 1.1 2003/07/04 08:11:42 deniger Exp $
*
*/
public class DodicoUIDefault implements DodicoUI
{
public final static DodicoUIDefault INSTANCE= new DodicoUIDefault();
private DodicoUIDefault()
{
}
/**
* @param _titre
* @param _msg
*/
public void error(String _titre, String _msg)
{
System.err.println(_titre + ": " + _msg);
}
/**
* @param _titre
* @param _msg
*/
public void message(String _titre, String _msg)
{
System.out.println(_titre + ": " + _msg);
}
/**
* @param _msg
*/
public void error(String _msg)
{
error(DodicoLib.EMPTY_STRING, _msg);
}
/**
* @param _msg
*/
public void message(String _msg)
{
message(DodicoLib.EMPTY_STRING, _msg);
}
}
Index: DodicoAnalyze.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoAnalyze.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DodicoAnalyze.java 17 Apr 2003 17:26:16 -0000 1.3
--- DodicoAnalyze.java 4 Jul 2003 08:11:42 -0000 1.4
***************
*** 9,12 ****
--- 9,15 ----
package org.fudaa.dodico.commun;
+ import java.io.FileNotFoundException;
+ import java.io.IOException;
+ import java.io.LineNumberReader;
import java.util.ArrayList;
import java.util.Collection;
***************
*** 17,22 ****
* Cette classe sert a transmettre les informations d'une operation de lecture
* ou d'ecriture. Les informations et les erreurs de l'operation sont stockées
! * avec eventuellement leur numero de ligne.
! * TODO : Creer une interface pour ne pas modifier ces donnees.
* @author deniger
* @version $Id$
--- 20,25 ----
* Cette classe sert a transmettre les informations d'une operation de lecture
* ou d'ecriture. Les informations et les erreurs de l'operation sont stockées
! * avec eventuellement leur numero de ligne et un identifiant ( a modifier ...).
! *
* @author deniger
* @version $Id$
***************
*** 27,30 ****
--- 30,35 ----
private DodicoAnalyze.Field[] warns_;
private DodicoAnalyze.Field[] infos_;
+ private DodicoAnalyze.Field fatalError_;
+ private String desc_;
public DodicoAnalyze(DodicoAnalyze.Editor _io)
***************
*** 32,50 ****
if (_io != null)
{
! errors_ = _io.getErrors();
! warns_ = _io.getWarnings();
! infos_ = _io.getInfos();
}
}
!
public static DodicoAnalyze[] getAnalyze(DodicoAnalyze.Editor[] _io)
{
!
! if(_io==null) return null;
! int nb=_io.length;
! DodicoAnalyze[] r=new DodicoAnalyze[nb];
! for(int i=nb-1;i>=0;i--)
{
! r[i]=_io[i].toAnalyze();
}
return r;
--- 37,63 ----
if (_io != null)
{
! errors_= _io.getErrors();
! warns_= _io.getWarnings();
! infos_= _io.getInfos();
! fatalError_= _io.getFatalError();
! desc_= _io.desc_;
}
}
!
! public boolean containsFatalError()
! {
! return fatalError_ != null;
! }
!
public static DodicoAnalyze[] getAnalyze(DodicoAnalyze.Editor[] _io)
{
!
! if (_io == null)
! return null;
! int nb= _io.length;
! DodicoAnalyze[] r= new DodicoAnalyze[nb];
! for (int i= nb - 1; i >= 0; i--)
{
! r[i]= _io[i].toAnalyze();
}
return r;
***************
*** 56,59 ****
--- 69,93 ----
}
+ public static String getResume(DodicoAnalyze[] _analyzes)
+ {
+ if (_analyzes == null)
+ return DodicoLib.EMPTY_STRING;
+ int n= _analyzes.length;
+ StringBuffer b= new StringBuffer();
+ DodicoAnalyze an;
+ for (int i= 0; i < n; i++)
+ {
+ an= _analyzes[i];
+ if (an != null)
+ {
+ if (i != 0)
+ b.append(DodicoLib.SEP_LINE);
+ b.append(an.getDesc()).append(DodicoLib.SEP_LINE);
+ b.append(an.getResume());
+ }
+ }
+ return b.toString();
+ }
+
public void printResume(String _prefix)
{
***************
*** 68,79 ****
public String getResume(String _prefix)
{
! String s = "";
! String t = getResume("Erreurs", errors_, _prefix);
if (t != null)
s += DodicoLib.LINE_SEP + t;
! t = getResume("Avertissements", warns_, _prefix);
if (t != null)
s += DodicoLib.LINE_SEP + t;
! t = getResume("Informations", infos_, _prefix);
if (t != null)
s += DodicoLib.LINE_SEP + t;
--- 102,122 ----
public String getResume(String _prefix)
{
!
! String s= "";
! if(fatalError_!=null)
! {
! s+=DodicoLib.LINE_SEP+_prefix+"Erreur fatale";
! if(fatalError_.getOffset()>=0)
! s+=DodicoLib.LINE_SEP+_prefix+fatalError_.toString();
! else
! s+=DodicoLib.LINE_SEP+_prefix+fatalError_.getMessage();
! }
! String t= getResume("Erreurs", errors_, _prefix);
if (t != null)
s += DodicoLib.LINE_SEP + t;
! t= getResume("Avertissements", warns_, _prefix);
if (t != null)
s += DodicoLib.LINE_SEP + t;
! t= getResume("Informations", infos_, _prefix);
if (t != null)
s += DodicoLib.LINE_SEP + t;
***************
*** 110,114 ****
public boolean containsErrors()
{
! return ((errors_ != null) && (errors_.length > 0)) ? true : false;
}
--- 153,157 ----
public boolean containsErrors()
{
! return ((fatalError_!=null) || ((errors_ != null) && (errors_.length > 0))) ? true : false;
}
***************
*** 128,132 ****
}
! protected static String getResume(String _titre, DodicoAnalyze.Field[] _ls, String _prefix)
{
if ((_ls == null) || (_ls.length <= 0))
--- 171,239 ----
}
! public static void manageException(
! FileNotFoundException _e,
! DodicoAnalyze.Editor _analyze)
! {
! _analyze.addError("Fichier non trouvé");
! _analyze.addInfo(_e.getMessage());
! if (DodicoLib.DEBUG)
! _e.printStackTrace();
! }
!
!
! public static void manageException(
! IOException _e,
! DodicoAnalyze.Editor _analyze)
! {
! _analyze.addError("Erreur d'entrée/sortie");
! _analyze.addInfo(_e.getMessage());
! if (DodicoLib.DEBUG)
! _e.printStackTrace();
! }
!
! public static void manageException(
! NumberFormatException _e,
! DodicoAnalyze.Editor _analyze,
! FortranReader _l)
! {
! manageException(_e,_analyze,_l,0);
! }
!
! public static void manageException(
! NumberFormatException _e,
! DodicoAnalyze.Editor _analyze,
! FortranReader _l,int fieldId)
! {
! _analyze.addError("Format du champ incorrect", _l).setId(fieldId);
! _analyze.addInfo(_e.getMessage()).setId(fieldId);
! if (DodicoLib.DEBUG)
! _e.printStackTrace();
! }
!
!
! public static void manageException(
! IllegalArgumentException _e,
! DodicoAnalyze.Editor _analyze)
! {
! _analyze.addError("Erreur interne d'argument");
! _analyze.addInfo(_e.getMessage());
! if (DodicoLib.DEBUG)
! _e.printStackTrace();
! }
!
! public static void manageException(
! Exception _e,
! DodicoAnalyze.Editor _analyze)
! {
! _analyze.addError("Erreur à l'exécution");
! _analyze.addInfo(_e.getMessage());
! if (DodicoLib.DEBUG)
! _e.printStackTrace();
! }
!
! protected static String getResume(
! String _titre,
! DodicoAnalyze.Field[] _ls,
! String _prefix)
{
if ((_ls == null) || (_ls.length <= 0))
***************
*** 134,147 ****
return null;
}
! StringBuffer r = new StringBuffer(200);
r.append(_prefix);
r.append(_titre);
! String lineSep = DodicoLib.LINE_SEP;
Field element;
! int nb = _ls.length;
! for (int i = 0; i < nb; i++)
{
r.append(lineSep);
! element = _ls[i];
r.append(_prefix);
r.append("Ligne " + element.getOffset() + ": " + element.getMessage());
--- 241,254 ----
return null;
}
! StringBuffer r= new StringBuffer(200);
r.append(_prefix);
r.append(_titre);
! String lineSep= DodicoLib.LINE_SEP;
Field element;
! int nb= _ls.length;
! for (int i= 0; i < nb; i++)
{
r.append(lineSep);
! element= _ls[i];
r.append(_prefix);
r.append("Ligne " + element.getOffset() + ": " + element.getMessage());
***************
*** 153,160 ****
public static class Editor
{
!
! private ArrayList warnings_;
! private ArrayList errors_;
! private ArrayList infos_;
public Editor()
--- 260,268 ----
public static class Editor
{
! String desc_;
! private ArrayList editorWarnings_;
! private ArrayList editorErrors_;
! private ArrayList editorInfos_;
! private DodicoAnalyze.Field editorFatalError_;
public Editor()
***************
*** 163,173 ****
}
public void merge(DodicoAnalyze.Editor _a)
{
if ((_a == null) || _a.isEmpty())
return;
! warnings_ = merge(warnings_, _a.warnings_);
! infos_ = merge(infos_, _a.infos_);
! errors_ = merge(errors_, _a.errors_);
}
--- 271,286 ----
}
+ public DodicoAnalyze.Field getFatalError()
+ {
+ return editorFatalError_;
+ }
+
public void merge(DodicoAnalyze.Editor _a)
{
if ((_a == null) || _a.isEmpty())
return;
! editorWarnings_= merge(editorWarnings_, _a.editorWarnings_);
! editorInfos_= merge(editorInfos_, _a.editorInfos_);
! editorErrors_= merge(editorErrors_, _a.editorErrors_);
}
***************
*** 188,197 ****
public void clear()
{
! if (warnings_ != null)
! warnings_.clear();
! if (errors_ != null)
! errors_.clear();
! if (infos_ != null)
! infos_.clear();
}
--- 301,310 ----
public void clear()
{
! if (editorWarnings_ != null)
! editorWarnings_.clear();
! if (editorErrors_ != null)
! editorErrors_.clear();
! if (editorInfos_ != null)
! editorInfos_.clear();
}
***************
*** 202,206 ****
public DodicoAnalyze.Field[] getErrors()
{
! return getFieldArray(errors_);
}
--- 315,319 ----
public DodicoAnalyze.Field[] getErrors()
{
! return getFieldArray(editorErrors_);
}
***************
*** 211,215 ****
public DodicoAnalyze.Field[] getWarnings()
{
! return getFieldArray(warnings_);
}
--- 324,328 ----
public DodicoAnalyze.Field[] getWarnings()
{
! return getFieldArray(editorWarnings_);
}
***************
*** 220,224 ****
public DodicoAnalyze.Field[] getInfos()
{
! return getFieldArray(infos_);
}
--- 333,337 ----
public DodicoAnalyze.Field[] getInfos()
{
! return getFieldArray(editorInfos_);
}
***************
*** 229,253 ****
public boolean containsErrors()
{
! return errors_ == null ? false : true;
}
public boolean containsInfos()
{
! return infos_ == null ? false : true;
}
public boolean containsWarnings()
{
! return warnings_ == null ? false : true;
}
public boolean isEmpty()
{
! return ((warnings_ == null) && (infos_ == null) && (errors_ == null)) ? true : false;
}
!
public DodicoAnalyze toAnalyze()
{
! return (isEmpty())?null:new DodicoAnalyze(this);
}
--- 342,368 ----
public boolean containsErrors()
{
! return editorErrors_ == null ? false : true;
}
public boolean containsInfos()
{
! return editorInfos_ == null ? false : true;
}
public boolean containsWarnings()
{
! return editorWarnings_ == null ? false : true;
}
public boolean isEmpty()
{
! return ((editorWarnings_ == null) && (editorInfos_ == null) && (editorErrors_ == null) && (editorFatalError_==null))
! ? true
! : false;
}
!
public DodicoAnalyze toAnalyze()
{
! return (isEmpty()) ? null : new DodicoAnalyze(this);
}
***************
*** 262,372 ****
if ((_list == null) || (_list.size() == 0))
return null;
! int l = _list.size();
! DodicoAnalyze.Field[] r = new DodicoAnalyze.Field[l];
_list.toArray(r);
return r;
}
! /**
! * Ajoute une erreur traduite (offset=-1).
! */
! public void addTranslateError(String _message)
! {
! addError(_message, -1, true);
! }
!
! public void addError(String _message)
{
! addError(_message, -1, false);
}
! public void addError(String _message, FortranReader _in)
{
! addError(_message, _in.getLineNumber(), false);
}
! public void addError(String _message, FortranReader _in, boolean _t)
{
! addError(_message, _in.getLineNumber(), _t);
}
! public void addError(String _message, int _offset)
{
! addError(_message, _offset, false);
}
! public synchronized void addError(String _message, int _offset, boolean _translate)
{
! if (errors_ == null)
! errors_ = new ArrayList();
! if (_message == null)
! {
! addField(errors_, "Erreur inconnue", _offset, true);
! return;
! }
! addField(errors_, _message, _offset, _translate);
}
! public void addWarning(String _message, FortranReader _in)
{
! addWarning(_message, _in.getLineNumber(), false);
}
! public void addWarning(String _message, FortranReader _in, boolean _t)
{
! addWarning(_message, _in.getLineNumber(), _t);
}
! public void addWarning(String _message, int _offset)
{
! addWarning(_message, _offset, false);
}
! public synchronized void addWarning(String _message, int _offset, boolean _translate)
{
! if (warnings_ == null)
! warnings_ = new ArrayList();
if (_message == null)
{
! addField(warnings_, "Avertissement inconnu", _offset, true);
! return;
}
! addField(warnings_, _message, _offset, _translate);
}
! public void addInfo(String _message, FortranReader _in)
{
! addInfo(_message, _in.getLineNumber(), false);
}
! public void addInfo(String _message, FortranReader _in, boolean _t)
{
! addInfo(_message, _in.getLineNumber(), _t);
}
! public void addInfo(String _message)
{
! addInfo(_message, -1, false);
}
! public void addInfo(String _message, int _offset)
{
! addInfo(_message, _offset, false);
}
! public synchronized void addInfo(String _message, int _offset, boolean _translate)
{
! if (infos_ == null)
! infos_ = new ArrayList();
if (_message == null)
{
! addField(infos_, "Information inconnue", _offset, true);
! return;
}
! addField(infos_, _message, _offset, _translate);
}
/**
! * Appelle la methode complete avec _offset=-1 et sans tranduction du
* message.
* @see #getField(String, int, boolean)
--- 377,487 ----
if ((_list == null) || (_list.size() == 0))
return null;
! int l= _list.size();
! DodicoAnalyze.Field[] r= new DodicoAnalyze.Field[l];
_list.toArray(r);
return r;
}
! public Field addError(String _message)
{
! return addError(_message, 0);
}
! public Field addError(String _message, FortranReader _in)
{
! return addError(_message, _in.getLineNumber());
}
! public Field addError(String _message, LineNumberReader _in)
{
! return addError(_message, _in.getLineNumber());
}
! public boolean containsFatalError()
{
! return editorFatalError_ != null;
}
! public Field addFatalError(String _message)
{
! return addFatalError(_message, 0);
}
! public Field addFatalError(String _message, LineNumberReader _in)
{
! return addFatalError(_message, _in.getLineNumber());
}
! public Field addFatalError(String _message, FortranReader _in)
{
! return addFatalError(_message, _in.getLineNumber());
}
! public Field addFatalError(String _message, int _offset)
{
! if (editorFatalError_ == null)
! {
! editorFatalError_= new DodicoAnalyze.Field(_message, _offset);
! }
!
! return editorFatalError_;
}
! public synchronized Field addError(String _message, int _offset)
{
! if (editorErrors_ == null)
! editorErrors_= new ArrayList();
if (_message == null)
{
! return addField(editorErrors_, "Erreur inconnue", _offset);
}
! return addField(editorErrors_, _message, _offset);
}
!
! public Field addWarning(String _message, FortranReader _in)
{
! return addWarning(_message, _in.getLineNumber());
}
! public synchronized Field addWarning(String _message, int _offset)
{
! if (editorWarnings_ == null)
! editorWarnings_= new ArrayList();
! if (_message == null)
! {
! return addField(editorWarnings_, "Avertissement inconnu", _offset);
! }
! return addField(editorWarnings_, _message, _offset);
}
! public Field addInfo(String _message, FortranReader _in)
{
! return addInfo(_message, _in.getLineNumber());
}
! public Field addInfo(String _message, LineNumberReader _in)
{
! return addInfo(_message, _in.getLineNumber());
}
! public Field addInfo(String _message)
{
! return addInfo(_message, 0);
! }
!
! public Field addInfo(String _message, int _offset)
! {
! if (editorInfos_ == null)
! editorInfos_= new ArrayList();
if (_message == null)
{
! return addField(editorInfos_, "Information inconnue", _offset);
}
! return addField(editorInfos_, _message, _offset);
}
/**
! * Appelle la methode complete avec _offset=0 et sans tranduction du
* message.
* @see #getField(String, int, boolean)
***************
*** 374,387 ****
public static DodicoAnalyze.Field createField(String _message)
{
! return createField(_message, -1);
! }
!
! /**
! * Appelle la methode complete sans tranduction du message.
! * @see #getField(String, int, boolean)
! */
! public static DodicoAnalyze.Field createField(String _message, int _offset)
! {
! return createField(_message, _offset, false);
}
--- 489,493 ----
public static DodicoAnalyze.Field createField(String _message)
{
! return createField(_message, 0);
}
***************
*** 391,449 ****
* @param _message le message
* @param _offset la ligne (ou le byte) concerne
- * @param _translate si true le message est traduit.
*/
! public static DodicoAnalyze.Field createField(String _message, int _offset, boolean _translate)
{
if (_message == null)
return null;
! return new DodicoAnalyze.Field(_translate ? DodicoLib.geti18n(_message) : _message, _offset);
}
/**
! * Ajoute l'info sans traduction.
! * @see #addField(Collection, String, FortranReader)
*/
! public static void addField(Collection _warns, String _message, FortranReader _in)
{
! addField(_warns, _message, _in, false);
}
/**
! * Ajoute l'info sans traduction.
! * @see #addField(Collection, String, int)
*/
! public static void addField(Collection _warns, String _message, int _offset)
{
! addField(_warns, _message, _offset, false);
}
-
/**
! * Ajoute le message <code>_message</code> traduit a la collection
! * <code>_warns</code>.Le numero de ligne sera determine a partir de
! * la methode <code>_in.getLineNumber()</code>.
! * @see #addField(Collection, String, int, boolean)
*/
! public static void addField(Collection _warns, String _message, FortranReader _in, boolean _translate)
{
! addField(_warns, _message, _in.getLineNumber(), _translate);
}
/**
! * Ajoute le message <code>_message</code> NON traduit a la collection
! * <code>_warns</code>.Le numero de ligne sera determine a partir de
! * la methode <code>_in.getLineNumber()</code>.
*/
! private static void addField(Collection _warns, String _message, int _offset, boolean _translate)
{
! _warns.add(DodicoAnalyze.Editor.createField(_message, _offset, _translate));
}
}
public static class Field
{
/**
* Le message de l'erreur ou de l'info.
*/
private String message_;
/**
* La ligne (ou le byte ?) de l'erreur
--- 497,562 ----
* @param _message le message
* @param _offset la ligne (ou le byte) concerne
*/
! public static DodicoAnalyze.Field createField(String _message, int _offset)
{
if (_message == null)
return null;
! return new DodicoAnalyze.Field(_message, _offset);
}
/**
! * Ajoute le message <code>_message</code> a la collection
! * <code>_warns</code>.Le numero de ligne sera determine a partir de
! * la methode <code>_in.getLineNumber()</code>.
! * @see #addField(Collection, String, int)
*/
! public static void addField(
! Collection _warns,
! String _message,
! FortranReader _in)
{
! addField(_warns, _message, _in.getLineNumber());
}
/**
! * Ajoute le message <code>_message</code>a la collection
! * <code>_warns</code>.Le numero de ligne sera determine a partir de
! * la methode <code>_in.getLineNumber()</code>.
*/
! private static Field addField(
! Collection _warns,
! String _message,
! int _offset)
{
! Field f= DodicoAnalyze.Editor.createField(_message, _offset);
! _warns.add(f);
! return f;
}
/**
! *
*/
! public String getDesc()
{
! return desc_;
}
/**
! *
*/
! public void setDesc(String _string)
{
! desc_= _string;
}
+
}
public static class Field
{
+
/**
* Le message de l'erreur ou de l'info.
*/
private String message_;
+
/**
* La ligne (ou le byte ?) de l'erreur
***************
*** 451,460 ****
private int offset_;
/**
! * Initialyse l'offset a -1.
*/
public Field(String _message)
{
! this(_message, -1);
}
--- 564,575 ----
private int offset_;
+ private int id_;
+
/**
! * Initialyse l'offset a 0.
*/
public Field(String _message)
{
! message_= _message;
}
***************
*** 464,469 ****
public Field(String _message, int _offset)
{
! message_ = _message;
! offset_ = _offset;
}
--- 579,584 ----
public Field(String _message, int _offset)
{
! message_= _message;
! offset_= _offset;
}
***************
*** 491,494 ****
--- 606,651 ----
}
+ /**
+ * un identifiant qui peut etre le num de fichier : A voir.
+ * @return
+ *
+ */
+ public int getId()
+ {
+ return id_;
+ }
+
+ /**
+ * @param _i
+ */
+ public void setId(int _i)
+ {
+ id_= _i;
+ }
+
+ }
+
+ /**
+ *
+ */
+ public DodicoAnalyze.Field getFatalError()
+ {
+ return fatalError_;
+ }
+
+ /**
+ *
+ */
+ public String getDesc()
+ {
+ return desc_;
+ }
+
+ /**
+ *
+ */
+ public void setDesc(String _string)
+ {
+ desc_= _string;
}
Index: DodicoLib.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoLib.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** DodicoLib.java 19 May 2003 13:53:58 -0000 1.8
--- DodicoLib.java 4 Jul 2003 08:11:42 -0000 1.9
***************
*** 9,17 ****
--- 9,29 ----
package org.fudaa.dodico.commun;
+ import java.io.BufferedInputStream;
+ import java.io.BufferedOutputStream;
+ import java.io.BufferedReader;
+ import java.io.BufferedWriter;
import java.io.File;
+ import java.io.FileInputStream;
+ import java.io.FileNotFoundException;
[...987 lines suppressed...]
! int temp;
! for (int i= n; i > n2; i--) {
! temp= _t[i];
! _t[i]= _t[nOffset - i];
! _t[nOffset - i]= temp;
! }
! }
!
! public static void main(String[] args) {
! int[] d=new int[]{1,2,3,4,5,6,7
! };
! invert(d);
! DodicoLib.printObject(d, true);
! d=new int[]{1,2,3,4,5,6
! };
! invert(d,7);
! DodicoLib.printObject(d, true);
! }
!
! }
Index: DodicoPreferences.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoPreferences.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DodicoPreferences.java 1 Apr 2003 09:06:54 -0000 1.3
--- DodicoPreferences.java 4 Jul 2003 08:11:42 -0000 1.4
***************
*** 10,14 ****
package org.fudaa.dodico.commun;
! import com.memoire.bu.*;
/**
--- 10,14 ----
package org.fudaa.dodico.commun;
! import com.memoire.bu.BuPreferences;
/**
***************
*** 16,26 ****
* @author Fred Deniger
*/
! public class DodicoPreferences
! extends BuPreferences
{
! public final static DodicoPreferences DODICO= new DodicoPreferences();
private DodicoPreferences()
{
}
--- 16,56 ----
* @author Fred Deniger
*/
! public class DodicoPreferences extends BuPreferences
{
! public final static DodicoPreferences DODICO = new DodicoPreferences();
! public static final String VALUE_SEPARATOR = ",";
! public static final String KEY_SEPARATOR = ".";
private DodicoPreferences()
{
+ }
+
+ public static String buildPrefKey(String _deb, String _fin)
+ {
+ return buildPrefKey(_deb,_fin,false);
+ }
+
+ public static String buildPrefKey(String _deb, String _fin, boolean _sepFin)
+ {
+ StringBuffer b = new StringBuffer(_deb.length() + _fin.length() + 2);
+ b.append(_deb).append(KEY_SEPARATOR).append(_fin);
+ if (_sepFin)
+ b.append(KEY_SEPARATOR);
+ return b.toString();
+ }
+
+ public static String buildPrefKey(String _a, String _b, String _c)
+ {
+ return buildPrefKey(_a, _b, _c, false);
+ }
+
+ public static String buildPrefKey(String _a, String _b, String _c, boolean _sepFin)
+ {
+ StringBuffer b = new StringBuffer(_a.length() + _b.length() + _c.length() + 1);
+ b.append(_a).append(KEY_SEPARATOR).append(_b).append(KEY_SEPARATOR).append(_c);
+ if (_sepFin)
+ b.append(KEY_SEPARATOR);
+ return b.toString();
+
}
Index: DodicoResource.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoResource.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DodicoResource.java 1 Apr 2003 09:06:54 -0000 1.3
--- DodicoResource.java 4 Jul 2003 08:11:42 -0000 1.4
***************
*** 10,14 ****
package org.fudaa.dodico.commun;
! import com.memoire.bu.*;
/**
--- 10,14 ----
package org.fudaa.dodico.commun;
! import com.memoire.bu.BuResource;
/**
Index: ProgressionBuAdapter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/ProgressionBuAdapter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ProgressionBuAdapter.java 18 Mar 2003 10:48:48 -0000 1.5
--- ProgressionBuAdapter.java 4 Jul 2003 08:11:42 -0000 1.6
***************
*** 39,44 ****
public void setProgression(int _v)
{
- System.out.println("progression : "+_v);
if(t_!=null) t_.setProgression(_v);
}
}
--- 39,48 ----
public void setProgression(int _v)
{
if(t_!=null) t_.setProgression(_v);
+ }
+
+ public void setDesc(String _s)
+ {
+ if(t_!=null) t_.setName(_s);
}
}
Index: ProgressionDodicoAdapter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/ProgressionDodicoAdapter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ProgressionDodicoAdapter.java 1 Apr 2003 09:06:55 -0000 1.4
--- ProgressionDodicoAdapter.java 4 Jul 2003 08:11:42 -0000 1.5
***************
*** 24,34 ****
{
t_=_t;
! if(_txt==null) t_.operation="";
! else t_.operation=_txt;
}
! public void setProgression(int _v)
{
! t_.pourcentage=_v;
}
}
--- 24,38 ----
{
t_=_t;
! setDesc(_txt);
}
! public final void setProgression(int _v)
{
! if(t_!=null) t_.pourcentage=_v;
! }
!
! public final void setDesc(String _s)
! {
! if(t_!=null) t_.operation=_s;
}
}
Index: ProgressionInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/ProgressionInterface.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ProgressionInterface.java 1 Apr 2003 09:06:56 -0000 1.3
--- ProgressionInterface.java 4 Jul 2003 08:11:42 -0000 1.4
***************
*** 18,21 ****
--- 18,22 ----
{
void setProgression(int _v);
+ void setDesc(String _s);
}
--- DodicoFileFormat.java DELETED ---
|