|
From: <de...@us...> - 2003-08-22 23:17:10
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico
In directory sc8-pr-cvs1:/tmp/cvs-serv7810/dico
Modified Files:
FDicoImplementation.java FDicoParams.java
FDicoProjetAbstract.java
Log Message:
tr: ajout de l'export pour le maillage
gestion affichage maillage
commun modif mineure
Index: FDicoImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico/FDicoImplementation.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FDicoImplementation.java 4 Jul 2003 14:44:20 -0000 1.1
--- FDicoImplementation.java 22 Aug 2003 16:02:23 -0000 1.2
***************
*** 9,23 ****
package org.fudaa.fudaa.dico;
! import java.io.File;
! import java.io.IOException;
!
! import com.memoire.bu.BuCommonImplementation;
! import org.fudaa.dodico.commun.DodicoAnalyze;
! import org.fudaa.dodico.commun.ProgressionInterface;
! import org.fudaa.dodico.fichiers.FileFormat;
! import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.fudaa.commun.*;
! import org.fudaa.fudaa.commun.FudaaLib;
/**
--- 9,15 ----
package org.fudaa.fudaa.dico;
! import com.memoire.bu.BuPreferences;
! import org.fudaa.fudaa.commun.FudaaCommonImplementation;
/**
***************
*** 25,142 ****
* @version $Id$
*/
! public class FDicoImplementation extends BuCommonImplementation implements FudaaUI
{
- /**
- *
- */
- public FDicoImplementation()
- {
- super();
- }
-
- /**
- *
- */
- public void error(String _titre, String _text)
- {
- FudaaLib.showError(this, _titre, _text);
- System.err.println(_titre+" "+_text);
-
- }
-
- /**
- *
- */
- public void message(String _titre, String _text)
- {
- FudaaLib.showMessage(this, _titre, _text);
-
- }
/**
*
*/
! public boolean confirmation(String _titre, String _text)
! {
! return FudaaLib.showConfirmation(this, _titre, _text);
! }
!
! // public FileOperationSynthese readFile(File _file, FileFormat _fileFormat, ProgressionInterface _progress)
! // {
! // FileOperationSynthese r = _fileFormat.read(_file, _progress);
! // manageClosingException(r.getClosingException(), _file);
! // if ((r.getAnalyze() != null) && (r.getAnalyze().getFatalError() != null))
! // {
! // DodicoAnalyze.Field f = r.getAnalyze().getFatalError();
! // error("Erreur de lecture", f.getOffset() < 0 ? f.getMessage() : f.toString());
! // return null;
! // }
! // return r;
! // }
! //
! // public FileOperationSynthese write(File _f, Object _interface, FileFormat _ft, ProgressionInterface _progress)
! // {
! // FileOperationSynthese r = _ft.write(_f, _interface, _progress);
! // manageClosingException(r.getClosingException(), _f);
! // if ((r.getAnalyze() != null) && (r.getAnalyze().getFatalError() != null))
! // {
! // DodicoAnalyze.Field f = r.getAnalyze().getFatalError();
! // error("Erreur de lecture", f.getOffset() < 0 ? f.getMessage() : f.toString());
! // return null;
! // }
! // return r;
! // }
!
! // public void manageClosingException(IOException[] _e,FileW _f)
! // {
! // if(_e==null) return;
! // System.err.println("FATAL :erreur lors de la fermeture de "+_f.getAbsolutePath());
! // System.out.println(_e[0]);
! //
! // }
!
! /**
! *
! */
! public boolean manageErrorOperation(FileOperationSynthese _opResult)
! {
! if(_opResult.getClosingException()!=null)
! {
! System.err.println("FATAL :erreur lors de la fermeture de "+_opResult.getFile());
! }
! if(_opResult.getAnalyze() != null)
! {
! if(_opResult.getAnalyze().getFatalError() != null)
! {
!
! DodicoAnalyze.Field f = _opResult.getAnalyze().getFatalError();
! error(_opResult.getDesc(), f.getOffset() < 0 ? f.getMessage() : f.toString());
! return true;
! }
! else
! {
! FudaaLib.showError(this,_opResult.getDesc(),_opResult.getAnalyze().getResume());
! }
! }
! return false;
! }
!
! /**
! * @param _msg
! */
! public void error(String _msg)
! {
! error("Erreur",_msg);
!
! }
!
! /**
! * @param _msg
! */
! public void message(String _msg)
! {
! message("Message",_msg);
!
}
--- 17,29 ----
* @version $Id$
*/
! public class FDicoImplementation extends FudaaCommonImplementation
{
/**
*
*/
! public BuPreferences getApplicationPreferences() {
! return null;
}
Index: FDicoParams.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico/FDicoParams.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FDicoParams.java 18 Aug 2003 11:54:43 -0000 1.2
--- FDicoParams.java 22 Aug 2003 16:02:23 -0000 1.3
***************
*** 40,44 ****
private String casFileName_;
! protected long casFileTimeLoaded_;
protected DicoParams dicoParams_;
protected FudaaUI ui_;
--- 40,44 ----
private String casFileName_;
! protected long fileLastModified_;
protected DicoParams dicoParams_;
protected FudaaUI ui_;
***************
*** 52,62 ****
File _file,
DicoCasFileFormatVersion _ft,
! Map _initialSetValues,
! long _timeloaded) {
dicoParams_= new DicoParams(_initialSetValues, _ft);
- casFileTimeLoaded_= _timeloaded;
dirBase_= _file.getParent();
casFileName_= _file.getName();
! casFileTimeLoaded_= _timeloaded;
dicoParams_.addModelListener(this);
}
--- 52,60 ----
File _file,
DicoCasFileFormatVersion _ft,
! Map _initialSetValues) {
dicoParams_= new DicoParams(_initialSetValues, _ft);
dirBase_= _file.getParent();
casFileName_= _file.getName();
! fileLastModified_= _file.lastModified();
dicoParams_.addModelListener(this);
}
***************
*** 71,78 ****
ProgressionInterface _progress,
FudaaUI _ui) {
! FileOperationSynthese op= new FileOperationSynthese();
! DicoCasInterface inter= _fileFormat.readCas(_file, op, _progress);
if (_ui != null)
! _ui.manageErrorOperation(op);
if (inter == null)
return null;
--- 69,76 ----
ProgressionInterface _progress,
FudaaUI _ui) {
! FileOperationSynthese op= _fileFormat.read(_file, _progress);
! DicoCasInterface inter=(DicoCasInterface)op.getSource();
if (_ui != null)
! _ui.manageErrorOperationAndIsFatal(op);
if (inter == null)
return null;
***************
*** 85,89 ****
}
FDicoParams r=
! new FDicoParams(_file, _fileFormat, inter.getInputs(), op.getOpTime());
r.setUI(_ui);
return r;
--- 83,87 ----
}
FDicoParams r=
! new FDicoParams(_file, _fileFormat, inter.getInputs());
r.setUI(_ui);
return r;
***************
*** 326,336 ****
}
FileOperationSynthese r=
! getFileFormatVersion().writeCas(
file,
dicoParams_.createCasWriterInterface(casFileName_),
_progress);
! r.setDesc("Sauvegarde fichier cas " + file.getAbsolutePath());
! if (ui_.manageErrorOperation(r)) {
! casFileTimeLoaded_= System.currentTimeMillis();
isModified_= false;
}
--- 324,333 ----
}
FileOperationSynthese r=
! getFileFormatVersion().writeMaillage(
file,
dicoParams_.createCasWriterInterface(casFileName_),
_progress);
! if (ui_.manageErrorOperationAndIsFatal(r)) {
! fileLastModified_= file.lastModified();
isModified_= false;
}
***************
*** 354,358 ****
dirBase_= _n.getParentFile().getAbsolutePath();
casFileName_= _n.getName();
! casFileTimeLoaded_= System.currentTimeMillis();
isModified_= false;
}
--- 351,355 ----
dirBase_= _n.getParentFile().getAbsolutePath();
casFileName_= _n.getName();
! fileLastModified_= System.currentTimeMillis();
isModified_= false;
}
***************
*** 362,369 ****
public FDicoComparator compareWith(File _n, ProgressionInterface _progress) {
! FileOperationSynthese syn= new FileOperationSynthese();
if (_progress != null)
_progress.setDesc("lecture " + _n.getName());
! DicoCasInterface inter= getFileFormatVersion().readCas(_n, syn, _progress);
if (syn.containsFatalError()) {
ui_.error(
--- 359,367 ----
public FDicoComparator compareWith(File _n, ProgressionInterface _progress) {
!
if (_progress != null)
_progress.setDesc("lecture " + _n.getName());
! FileOperationSynthese syn= getFileFormatVersion().read(_n, _progress);
! DicoCasInterface inter=(DicoCasInterface)syn.getSource();
if (syn.containsFatalError()) {
ui_.error(
***************
*** 446,454 ****
}
FileOperationSynthese op=
! getFileFormatVersion().writeCas(
_n,
new DicoCasAbstract(entitesValues),
_progress);
! if (ui_.manageErrorOperation(op)) {
isModified_= false;
return true;
--- 444,452 ----
}
FileOperationSynthese op=
! getFileFormatVersion().writeMaillage(
_n,
new DicoCasAbstract(entitesValues),
_progress);
! if (ui_.manageErrorOperationAndIsFatal(op)) {
isModified_= false;
return true;
***************
*** 470,474 ****
*/
public long getCasFileTimeLoaded() {
! return casFileTimeLoaded_;
}
--- 468,472 ----
*/
public long getCasFileTimeLoaded() {
! return fileLastModified_;
}
Index: FDicoProjetAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico/FDicoProjetAbstract.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FDicoProjetAbstract.java 19 Aug 2003 07:48:40 -0000 1.3
--- FDicoProjetAbstract.java 22 Aug 2003 16:02:23 -0000 1.4
***************
*** 49,53 ****
protected FudaaCalculAction actions_;
BuInformationsDocument idoc_;
! FDicoFilleProjet entiteFille_;
public FDicoProjetAbstract(FudaaCommonImplementation _impl) {
--- 49,53 ----
protected FudaaCalculAction actions_;
BuInformationsDocument idoc_;
! protected FDicoFilleProjet entiteFille_;
public FDicoProjetAbstract(FudaaCommonImplementation _impl) {
***************
*** 89,97 ****
}
public void active() {
if (impl_ == null)
return;
if (entiteFille_ == null) {
! entiteFille_= new FDicoFilleProjet(this);
Dimension dim= impl_.getMainPanel().getDesktop().getSize();
entiteFille_.setSize(
--- 89,109 ----
}
+ protected void buildEntiteFille() {
+ if (entiteFille_ != null)
+ return;
+ entiteFille_= new FDicoFilleProjet(this);
+ JMenuBar menu= entiteFille_.getJMenuBar();
+ JButton bt= new BuButton("Comparer");
+ bt.addActionListener(this);
+ bt.setIcon(FudaaResource.FUDAA.getIcon("diff_16"));
+ bt.setActionCommand("COMPARER");
+ menu.add(bt);
+ }
+
public void active() {
if (impl_ == null)
return;
if (entiteFille_ == null) {
! buildEntiteFille();
Dimension dim= impl_.getMainPanel().getDesktop().getSize();
entiteFille_.setSize(
***************
*** 100,112 ****
entiteFille_.setLocation(0, 0);
impl_.addInternalFrame(entiteFille_);
}
! JMenuBar menu= entiteFille_.getJMenuBar();
! JButton bt= new BuButton("Comparer");
! bt.addActionListener(this);
! bt.setIcon(FudaaResource.FUDAA.getIcon("diff_16"));
! bt.setActionCommand("COMPARER");
! menu.add(bt);
! entiteFille_.pack();
! entiteFille_.setVisible(true);
}
--- 112,120 ----
entiteFille_.setLocation(0, 0);
impl_.addInternalFrame(entiteFille_);
+ } else {
+ impl_.activateInternalFrame(entiteFille_);
}
! // entiteFille_.pack();
! // entiteFille_.setVisible(true);
}
|