Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico
In directory sc8-pr-cvs1:/tmp/cvs-serv23146/dico
Modified Files:
DicoCasFileFormat.java DicoEntite.java DicoExec.java
DicoParams.java DicoParamsListener.java dico_en.fr_txt
Log Message:
Ajout de fonctionnalites au modele h2d
Index: DicoCasFileFormat.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoCasFileFormat.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DicoCasFileFormat.java 25 Nov 2003 10:11:27 -0000 1.7
--- DicoCasFileFormat.java 11 Dec 2003 12:41:26 -0000 1.8
***************
*** 33,36 ****
--- 33,41 ----
return getDicoManager().createLastVersionImpl(this, _language);
}
+
+ public FileFormatVersion getLastVersionInstance(){
+ return getLastVersionImpl();
+ }
+
public DicoCasFileFormatVersion getLastVersionImpl() {
return getDicoManager().createLastVersionImpl(
Index: DicoEntite.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoEntite.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** DicoEntite.java 25 Nov 2003 10:11:28 -0000 1.9
--- DicoEntite.java 11 Dec 2003 12:41:26 -0000 1.10
***************
*** 234,237 ****
--- 234,240 ----
return false;
}
+ public int getNbElemFixed() {
+ return nbElem;
+ }
/**
*
***************
*** 469,473 ****
*/
public boolean isValide(String _data) {
! if (nbElem <= 0)
return (fillListWithValidValues(_data, new ArrayList()) == null);
else {
--- 472,476 ----
*/
public boolean isValide(String _data) {
! if (nbElem < 0)
return (fillListWithValidValues(_data, new ArrayList()) == null);
else {
***************
*** 475,479 ****
String s= fillListWithValidValues(_data, l);
if (s == null) {
! return l.size() == nbElem;
}
return false;
--- 478,482 ----
String s= fillListWithValidValues(_data, l);
if (s == null) {
! return l.size() <= nbElem;
}
return false;
***************
*** 483,490 ****
_l.clear();
String s= fillListWithValidValues(_data, _l);
! if ((s == null) && (nbElem > 0)) {
! if (_l.size() != nbElem) {
! DicoResource.getS(
! "Le nombre d'élément doit être égal à {0}",
DodicoLib.getString(nbElem));
}
--- 486,496 ----
_l.clear();
String s= fillListWithValidValues(_data, _l);
! if ((s == null) && (nbElem >= 0)) {
! if (_l.size() > nbElem) {
! if(nbElem==0)
! return DicoResource.getS(
! "Ce mot-clé est inutile");
! return DicoResource.getS(
! "Le nombre d'éléments doit être inférieur à {0}",
DodicoLib.getString(nbElem));
}
***************
*** 498,501 ****
--- 504,510 ----
if (!isModifiable())
return DicoResource.getS("non modifiable");
+ else if (nbElem >= 0) {
+ return DicoResource.getS("Nombre maximal de champs") + ": " + nbElem;
+ }
return null;
}
***************
*** 828,835 ****
}
}
- public static void main(String[] args) {
- DodicoLib.printStringArray(
- DicoEntite.Vecteur.getValues("'B' ; ';C;';D;E;'F'''", ";"));
- }
/**
*
--- 837,840 ----
***************
*** 839,843 ****
}
/**
! *
*/
public void setRequired(boolean _b) {
--- 844,848 ----
}
/**
! * Ce mot-clé est nécessaire a l'appli
*/
public void setRequired(boolean _b) {
Index: DicoExec.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoExec.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DicoExec.java 25 Nov 2003 10:11:29 -0000 1.4
--- DicoExec.java 11 Dec 2003 12:41:26 -0000 1.5
***************
*** 22,77 ****
public class DicoExec extends CalculExec {
String execName_;
public DicoExec(String _execName) {
if (_execName == null)
throw new IllegalArgumentException("Argument null");
! execName_= _execName;
}
public static String getPrefIdFor(String _execName) {
return DodicoPreferences.buildPrefKey("serveur", _execName, "exe");
}
/**
*
*/
! public String[] getLaunchArray(
! File _paramsFile,
! String[] _codeArgs,
! DodicoUI _ui) {
! ArrayList l= new ArrayList(15);
! boolean win= false;
! File dir= new File("serveurs/dico");
! if (FuLib.isWindows()) {
! win= true;
! l.add("start");
! l.add(new File(dir, "universal-launcher.bat").getAbsolutePath());
! } else {
! l.add(new File(dir, "universal-launcher.sh").getAbsolutePath());
! }
! String exe=
! DodicoPreferences.DODICO.getStringProperty(
! getPrefIdFor(execName_),
! execName_);
! l.add(exe);
! if (win) {
! if (!CalculExec.getWinParams(_paramsFile, _codeArgs, l)) {
! _ui.error(
! BuResource.BU.getString("Erreur"),
! DicoResource.getS("Arguments nuls"));
! return null;
! }
! } else {
! if (!CalculExec.getUnixParams(_paramsFile, _codeArgs, l)) {
! _ui.error(
! BuResource.BU.getString("Erreur"),
! DicoResource.getS("Arguments nuls"));
! return null;
! }
! }
! return DodicoLib.enTableau(l);
}
/**
*
*/
! public int getMaxArgsNb() {
! return 5;
}
}
--- 22,64 ----
public class DicoExec extends CalculExec {
String execName_;
+ boolean log_;
public DicoExec(String _execName) {
if (_execName == null)
throw new IllegalArgumentException("Argument null");
! setChangeWorkingDirectory(true);
! setLauchInNewTerm(true);
! String exe=
! DodicoPreferences.DODICO.getStringProperty(
! getPrefIdFor(_execName),
! _execName);
! execName_= exe;
! }
! public String getExecName() {
! return execName_;
}
public static String getPrefIdFor(String _execName) {
return DodicoPreferences.buildPrefKey("serveur", _execName, "exe");
}
+ public String[] getLaunchCmd(File _paramsFile, DodicoUI _ui) {
+ String[] r= new String[log_ ? 3 : 2];
+ r[0]= execName_;
+ if (log_) {
+ r[1]= "-s";
+ r[2]= _paramsFile.getName();
+ } else
+ r[1]= _paramsFile.getName();
+ return r;
+ }
/**
*
*/
! public boolean isLog() {
! return log_;
}
/**
*
*/
! public void setLog(boolean _b) {
! log_= _b;
}
}
Index: DicoParams.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoParams.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** DicoParams.java 25 Nov 2003 10:11:29 -0000 1.11
--- DicoParams.java 11 Dec 2003 12:41:26 -0000 1.12
***************
*** 41,44 ****
--- 41,45 ----
private Set badValues_;
private Set entitesFiles_;
+ private Set entitesToBeEmpty_;
private DicoCasFileFormatVersionAbstract ft_;
private DicoEntite casFileEntite_;
***************
*** 61,64 ****
--- 62,85 ----
return (entitesFiles_ == null ? 0 : entitesFiles_.size());
}
+
+ public void setDicoEntiteMustBeEmpty(DicoEntite _e, boolean _b) {
+ if (_b) {
+ if (entitesToBeEmpty_ == null)
+ entitesToBeEmpty_= new HashSet();
+ entitesToBeEmpty_.add(_e);
+ if (isValueSetFor(_e)) {
+ badValues_.add(_e);
+ fireEntiteValidStateUpdated(_e);
+ }
+ } else {
+ if (entitesToBeEmpty_ != null)
+ entitesToBeEmpty_.remove(_e);
+ if (badValues_.contains(_e)) {
+ badValues_.remove(_e);
+ fireEntiteValidStateUpdated(_e);
+ }
+ }
+
+ }
public void testIfValid(DicoEntite e) {
if ((ft_.getDico().contains(e)) && (isValueSetFor(e))) {
***************
*** 67,75 ****
if (badValues_.contains(e)) {
badValues_.remove(e);
! fireEntiteStateUpdated(e);
}
} else if (!badValues_.contains(e)) {
badValues_.add(e);
! fireEntiteStateUpdated(e);
}
}
--- 88,96 ----
if (badValues_.contains(e)) {
badValues_.remove(e);
! fireEntiteValidStateUpdated(e);
}
} else if (!badValues_.contains(e)) {
badValues_.add(e);
! fireEntiteValidStateUpdated(e);
}
}
***************
*** 77,83 ****
public String getInvalidMessage(DicoEntite _e) {
if (!isValueValideFor(_e)) {
! if (isValueSetFor(_e))
return _e.getInvalideMessage(getValue(_e));
! else if (_e.isRequired())
return DicoResource.getS("Ce mot-clé doit être défini");
else
--- 98,107 ----
public String getInvalidMessage(DicoEntite _e) {
if (!isValueValideFor(_e)) {
! if (isValueSetFor(_e)) {
! if ((entitesToBeEmpty_ != null) && (entitesToBeEmpty_.contains(_e))) {
! return DicoResource.getS("Ce mot-clé est inutile");
! }
return _e.getInvalideMessage(getValue(_e));
! } else if (_e.isRequired())
return DicoResource.getS("Ce mot-clé doit être défini");
else
***************
*** 113,116 ****
--- 137,156 ----
return false;
}
+
+ /**
+ * Enleve le mot-clé _e des mot-clés chargés
+ */
+ public void setUnloaded(DicoEntite _e) {
+ if (loadedEntiteState_ != null) {
+ loadedEntiteState_.remove(_e);
+ }
+ }
+ /**
+ * Enregistre que le mot-cle _e est charge a partir du fichier _f et
+ * le rend modifie si _m.
+ * @param _e le mot-cle charge
+ * @param _f le fichier a partir duquel le mot-clé a ete charge
+ * @param _m mot-cle modifie ou non
+ */
public boolean setLoaded(DicoEntite _e, File _f, boolean _m) {
if ((_e == null) || (!_e.isFileType()))
***************
*** 177,182 ****
DicoEntite ent= (DicoEntite)it.next();
if (!isValueSetFor(ent)) {
- System.out.println("alors " + ent);
l.add(ent);
}
}
--- 217,223 ----
DicoEntite ent= (DicoEntite)it.next();
if (!isValueSetFor(ent)) {
l.add(ent);
+ //DEBUG A ENLEVER
+ System.out.println("ent to save " + ent.getNom());
}
}
***************
*** 185,194 ****
return r;
}
! public void setModified(DicoEntite _e, boolean _b) {
DicoEntiteFileState fs= getFileState(_e);
! if (fs != null) {
fs.setModified(_b);
! } else if (_b)
setLoaded(_e, null, _b);
}
public boolean isModified() {
--- 226,239 ----
return r;
}
! public void setLoadedModified(DicoEntite _e, boolean _b) {
DicoEntiteFileState fs= getFileState(_e);
! if (fs != null && (fs.isModified() != _b)) {
fs.setModified(_b);
! fireProjectEntiteFileStateChange(_e);
! } else if (_b) {
setLoaded(_e, null, _b);
+ fireProjectEntiteFileStateChange(_e);
+ }
+
}
public boolean isModified() {
***************
*** 456,463 ****
String old= getValue(_ent);
entitesValues_.put(_ent, _value);
! if (_ent.isValide(_value)) {
badValues_.remove(_ent);
} else
badValues_.add(_ent);
fireEntiteUpdated(_ent, old);
return true;
--- 501,512 ----
String old= getValue(_ent);
entitesValues_.put(_ent, _value);
! if ((entitesToBeEmpty_ != null)
! && (entitesToBeEmpty_.contains(_ent))) {
! badValues_.add(_ent);
! } else if (_ent.isValide(_value)) {
badValues_.remove(_ent);
} else
badValues_.add(_ent);
+
fireEntiteUpdated(_ent, old);
return true;
***************
*** 472,476 ****
if (canUpdate(_ent) == null) {
entitesValues_.put(_ent, _value);
! if (_ent.isValide(_value)) {
badValues_.remove(_ent);
} else
--- 521,528 ----
if (canUpdate(_ent) == null) {
entitesValues_.put(_ent, _value);
! if ((entitesToBeEmpty_ != null)
! && (entitesToBeEmpty_.contains(_ent))) {
! badValues_.add(_ent);
! } else if (_ent.isValide(_value)) {
badValues_.remove(_ent);
} else
***************
*** 623,631 ****
}
}
! protected void fireEntiteStateUpdated(DicoEntite _ent) {
if (modelListener_ != null) {
synchronized (modelListener_) {
for (Iterator it= modelListener_.iterator(); it.hasNext();) {
! ((DicoParamsListener)it.next()).dicoParamsStateEntiteUpdated(
this,
_ent);
--- 675,683 ----
}
}
! protected void fireEntiteValidStateUpdated(DicoEntite _ent) {
if (modelListener_ != null) {
synchronized (modelListener_) {
for (Iterator it= modelListener_.iterator(); it.hasNext();) {
! ((DicoParamsListener)it.next()).dicoParamsValidStateEntiteUpdated(
this,
_ent);
Index: DicoParamsListener.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoParamsListener.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DicoParamsListener.java 25 Nov 2003 10:11:30 -0000 1.5
--- DicoParamsListener.java 11 Dec 2003 12:41:26 -0000 1.6
***************
*** 23,27 ****
DicoEntite _ent,
String _oldValue);
! public void dicoParamsStateEntiteUpdated(DicoParams _cas, DicoEntite _ent);
public void dicoParamsProjectModifyStateChanged(DicoParams _cas);
public void dicoParamsStateLoadedEntiteChanged(
--- 23,27 ----
DicoEntite _ent,
String _oldValue);
! public void dicoParamsValidStateEntiteUpdated(DicoParams _cas, DicoEntite _ent);
public void dicoParamsProjectModifyStateChanged(DicoParams _cas);
public void dicoParamsStateLoadedEntiteChanged(
Index: dico_en.fr_txt
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/dico_en.fr_txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** dico_en.fr_txt 14 Nov 2003 08:22:19 -0000 1.4
--- dico_en.fr_txt 11 Dec 2003 12:41:26 -0000 1.5
***************
*** 77,79 ****
La chaine {0} n'est pas un mot-clé=The String {0} is not a keyword
La valeur {0} est ignorée=The value {0} is skipped
! Ce mot-clé doit être défini=This keyword is required
\ No newline at end of file
--- 77,81 ----
La chaine {0} n'est pas un mot-clé=The String {0} is not a keyword
La valeur {0} est ignorée=The value {0} is skipped
! Ce mot-clé doit être défini=This keyword is required
! Le nombre d'éléments doit être inférieur à {0}=The number of elements must be lower than {0}
! Ce mot-clé est inutile=This keyword is unused
|