|
From: <de...@us...> - 2003-08-19 07:48:43
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico
In directory sc8-pr-cvs1:/tmp/cvs-serv10343/dico
Modified Files:
FDicoProjet.java FDicoProjetAbstract.java
Added Files:
FDicoChooserPanel.java
Log Message:
Gestion de l'export pour le projet tr
--- NEW FILE: FDicoChooserPanel.java ---
(This appears to be a binary file; contents omitted.)
Index: FDicoProjet.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico/FDicoProjet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FDicoProjet.java 18 Aug 2003 14:12:52 -0000 1.2
--- FDicoProjet.java 19 Aug 2003 07:48:40 -0000 1.3
***************
*** 9,53 ****
package org.fudaa.fudaa.dico;
- import java.awt.Dimension;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
import java.io.File;
- import javax.swing.BorderFactory;
- import javax.swing.JButton;
- import javax.swing.JMenuBar;
- import javax.swing.JTable;
-
- import com.memoire.bu.BuBorderLayout;
- import com.memoire.bu.BuButton;
- import com.memoire.bu.BuInformationsDocument;
- import com.memoire.bu.BuInternalFrame;
- import com.memoire.bu.BuMainPanel;
- import com.memoire.bu.BuPanel;
- import com.memoire.bu.BuResource;
- import com.memoire.bu.BuScrollPane;
- import com.memoire.bu.BuTable;
- import com.memoire.bu.BuTaskOperation;
-
- import org.fudaa.dodico.calcul.CalculLauncher;
- import org.fudaa.dodico.commun.DodicoLib;
- import org.fudaa.dodico.commun.ProgressionBuAdapter;
import org.fudaa.dodico.commun.ProgressionInterface;
! import org.fudaa.dodico.dico.*;
! import org.fudaa.dodico.dico.DicoCasFileFormat;
! import org.fudaa.dodico.dico.DicoCasInterface;
! import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.*;
! import org.fudaa.dodico.h2d.H2dParametres;
import org.fudaa.fudaa.commun.FudaaCommonImplementation;
- import org.fudaa.fudaa.commun.FudaaLib;
- import org.fudaa.fudaa.commun.FudaaUI;
- import org.fudaa.fudaa.commun.calcul.FudaaCalculAction;
- import org.fudaa.fudaa.commun.calcul.FudaaCalculSupportInterface;
- import org.fudaa.fudaa.commun.tableau.FudaaCellTextRenderer;
- import org.fudaa.fudaa.ressource.FudaaResource;
- import org.fudaa.fudaa.tr.TrImplementation;
- import org.fudaa.fudaa.tr.TrProjet;
- import org.fudaa.fudaa.tr.telemac.TrTelemacParametres;
/**
--- 9,18 ----
package org.fudaa.fudaa.dico;
import java.io.File;
import org.fudaa.dodico.commun.ProgressionInterface;
! import org.fudaa.dodico.dico.DicoCasFileFormatVersion;
!
import org.fudaa.fudaa.commun.FudaaCommonImplementation;
/**
Index: FDicoProjetAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico/FDicoProjetAbstract.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FDicoProjetAbstract.java 18 Aug 2003 11:54:43 -0000 1.2
--- FDicoProjetAbstract.java 19 Aug 2003 07:48:40 -0000 1.3
***************
*** 45,50 ****
*/
public abstract class FDicoProjetAbstract
! implements FDicoProjetInterface, FudaaCalculSupportInterface,ActionListener
! {
protected FudaaCommonImplementation impl_;
protected FudaaCalculAction actions_;
--- 45,49 ----
*/
public abstract class FDicoProjetAbstract
! implements FDicoProjetInterface, FudaaCalculSupportInterface, ActionListener {
protected FudaaCommonImplementation impl_;
protected FudaaCalculAction actions_;
***************
*** 52,108 ****
FDicoFilleProjet entiteFille_;
! public FDicoProjetAbstract(FudaaCommonImplementation _impl)
! {
! this(_impl,true);
}
!
!
! protected FDicoProjetAbstract(FudaaCommonImplementation _impl,boolean _actionStopCalcul)
! {
! impl_=_impl;
! actions_=new FudaaCalculAction(this,_actionStopCalcul);
}
!
! public void setActionStopVisible(boolean b)
! {
! if(b != actions_.isStopCalculVisible())
! {
! actions_=new FudaaCalculAction(this,b);
}
}
-
-
-
/**
*
*/
! public BuInformationsDocument getInformationsDocument()
! {
! if(idoc_==null) idoc_=new BuInformationsDocument();
return idoc_;
}
! public File getParamsFile()
! {
! if(getKeys()==null) return null;
return getKeys().getMainFile();
}
!
! public String getTitle()
! {
! if(getKeys()==null) return DodicoLib.EMPTY_STRING;
return getKeys().getTitle();
}
! public void active()
! {
if (impl_ == null)
return;
! if (entiteFille_ == null)
! {
! entiteFille_ = new FDicoFilleProjet(this);
! Dimension dim = impl_.getMainPanel().getDesktop().getSize();
entiteFille_.setSize(
(int) (dim.getWidth() * 0.8),
--- 51,98 ----
FDicoFilleProjet entiteFille_;
! public FDicoProjetAbstract(FudaaCommonImplementation _impl) {
! this(_impl, true);
}
!
! protected FDicoProjetAbstract(
! FudaaCommonImplementation _impl,
! boolean _actionStopCalcul) {
! impl_= _impl;
! actions_= new FudaaCalculAction(this, _actionStopCalcul);
}
!
! public void setActionStopVisible(boolean b) {
! if (b != actions_.isStopCalculVisible()) {
! actions_= new FudaaCalculAction(this, b);
}
}
/**
*
*/
! public BuInformationsDocument getInformationsDocument() {
! if (idoc_ == null)
! idoc_= new BuInformationsDocument();
return idoc_;
}
! public File getParamsFile() {
! if (getKeys() == null)
! return null;
return getKeys().getMainFile();
}
! public String getTitle() {
! if (getKeys() == null)
! return DodicoLib.EMPTY_STRING;
return getKeys().getTitle();
}
! public void active() {
if (impl_ == null)
return;
! if (entiteFille_ == null) {
! entiteFille_= new FDicoFilleProjet(this);
! Dimension dim= impl_.getMainPanel().getDesktop().getSize();
entiteFille_.setSize(
(int) (dim.getWidth() * 0.8),
***************
*** 111,116 ****
impl_.addInternalFrame(entiteFille_);
}
! JMenuBar menu=entiteFille_.getJMenuBar();
! JButton bt=new BuButton("Comparer");
bt.addActionListener(this);
bt.setIcon(FudaaResource.FUDAA.getIcon("diff_16"));
--- 101,106 ----
impl_.addInternalFrame(entiteFille_);
}
! JMenuBar menu= entiteFille_.getJMenuBar();
! JButton bt= new BuButton("Comparer");
bt.addActionListener(this);
bt.setIcon(FudaaResource.FUDAA.getIcon("diff_16"));
***************
*** 120,134 ****
entiteFille_.setVisible(true);
}
!
! public boolean isValide()
! {
return getKeys().isValide();
}
-
! public void save()
! {
! if (!isValide())
! {
if (!impl_
.confirmation(
--- 110,120 ----
entiteFille_.setVisible(true);
}
!
! public boolean isValide() {
return getKeys().isValide();
}
! public void save() {
! if (!isValide()) {
if (!impl_
.confirmation(
***************
*** 137,144 ****
return;
}
! new BuTaskOperation(impl_, "sauvegarde fichier cas")
! {
! public void act()
! {
getKeys().saveCas(new ProgressionBuAdapter(this));
this.setProgression(100);
--- 123,128 ----
return;
}
! new BuTaskOperation(impl_, "sauvegarde fichier cas") {
! public void act() {
getKeys().saveCas(new ProgressionBuAdapter(this));
this.setProgression(100);
***************
*** 148,164 ****
}
! public void saveAs()
! {
! final File fic =
! impl_.ouvrirFileChooser(
! null,
! "Enregistrement Fichier cas Télémac",
! true);
if (fic == null)
return;
! new BuTaskOperation(impl_, "sauvegarde fichier cas")
! {
! public void act()
! {
getKeys().saveAs(fic, new ProgressionBuAdapter(this));
this.setProgression(100);
--- 132,142 ----
}
! public void saveAs() {
! final File fic=
! impl_.ouvrirFileChooser(null, "Enregistrement Fichier cas", true);
if (fic == null)
return;
! new BuTaskOperation(impl_, "sauvegarde fichier cas") {
! public void act() {
getKeys().saveAs(fic, new ProgressionBuAdapter(this));
this.setProgression(100);
***************
*** 168,178 ****
}
-
-
/**
*
*/
! public FudaaCommonImplementation getImpl()
! {
return impl_;
}
--- 146,153 ----
}
/**
*
*/
! public FudaaCommonImplementation getImpl() {
return impl_;
}
***************
*** 181,201 ****
*
*/
! public void setImpl(FudaaCommonImplementation _implementation)
! {
! impl_ = _implementation;
}
! public boolean isModified()
! {
! if(getKeys()!=null)
! return getKeys().isModified();
return false;
}
-
! public void close()
! {
! if (isModified())
! {
if (FudaaLib
.showConfirmation(
--- 156,171 ----
*
*/
! public void setImpl(FudaaCommonImplementation _implementation) {
! impl_= _implementation;
}
! public boolean isModified() {
! if (getKeys() != null)
! return getKeys().isModified();
return false;
}
! public void close() {
! if (isModified()) {
if (FudaaLib
.showConfirmation(
***************
*** 204,225 ****
"Les données ont été modifiées,\nVoulez-vous sauvegarder les données ?"))
this.save();
! }
! else
! {
System.out.println("données non modifiées");
}
entiteFille_.dispose();
! entiteFille_ = null;
! // impl_.closeProjet(this);
}
-
-
/**
*
*/
! public String getCodeName()
! {
! if(getKeys()==null) return DodicoLib.EMPTY_STRING;
return getKeys().getDico().getCodeName();
}
--- 174,191 ----
"Les données ont été modifiées,\nVoulez-vous sauvegarder les données ?"))
this.save();
! } else {
System.out.println("données non modifiées");
}
entiteFille_.dispose();
! entiteFille_= null;
! // impl_.closeProjet(this);
}
/**
*
*/
! public String getCodeName() {
! if (getKeys() == null)
! return DodicoLib.EMPTY_STRING;
return getKeys().getDico().getCodeName();
}
***************
*** 228,233 ****
* @return
*/
! public FudaaCalculAction getCalculActions()
! {
return actions_;
}
--- 194,198 ----
* @return
*/
! public FudaaCalculAction getCalculActions() {
return actions_;
}
***************
*** 236,242 ****
* @return
*/
! public CalculLauncher actionCalcul()
! {
! FDicoCalculLocal r = new FDicoCalculLocal(this);
r.setImpl(impl_);
return r;
--- 201,206 ----
* @return
*/
! public CalculLauncher actionCalcul() {
! FDicoCalculLocal r= new FDicoCalculLocal(this);
r.setImpl(impl_);
return r;
***************
*** 246,251 ****
*
*/
! public void addParamModelListener(DicoParamsListener _l)
! {
getKeys().getDicoParams().addModelListener(_l);
}
--- 210,214 ----
*
*/
! public void addParamModelListener(DicoParamsListener _l) {
getKeys().getDicoParams().addModelListener(_l);
}
***************
*** 254,309 ****
*
*/
! public void removeParamModelListener(DicoParamsListener _l)
! {
getKeys().removeModelListener(_l);
}
! public FDicoComparator compareWith(File _n, ProgressionInterface _progress)
! {
return getKeys().compareWith(_n, _progress);
}
! public void compareWith()
! {
! final File fic =
! impl_.ouvrirFileChooser(null, "fichier à comparer", false);
if (fic == null)
return;
! new BuTaskOperation(impl_, "Comparaison")
! {
! public void act()
! {
! BuMainPanel mp = impl_ == null ? null : impl_.getMainPanel();
! if (mp != null)
! {
mp.setMessage("Initialisation comparaison");
mp.setProgression(0);
}
! FDicoComparator c = compareWith(fic, new ProgressionBuAdapter(this));
! if(c==null) return;
! if (mp != null)
! {
mp.setMessage("Affichage");
mp.setProgression(80);
}
! BuInternalFrame f=new BuInternalFrame("Comparaison de "+getParamsFile().getName()+" <-> "+
! fic.getName(),true,true,true,true);
! BuPanel pn=new BuPanel();
! pn.setLayout(new BuBorderLayout(5,5));
! pn.setBorder(BorderFactory.createEmptyBorder(5, 5,5,5));
! JTable table=new JTable(c.createTableModel());
c.createRenderer(table);
!
! // table.setDefaultRenderer(String.class, new FudaaCellTextRenderer());
! pn.add(new BuScrollPane(table),BuBorderLayout.CENTER);
f.setContentPane(pn);
impl_.addInternalFrame(f);
f.pack();
f.setVisible(true);
! f.setSize(500,400);
! f.setPreferredSize(new Dimension(500,400));
! if (mp != null)
! {
mp.setMessage("");
mp.setProgression(0);
--- 217,272 ----
*
*/
! public void removeParamModelListener(DicoParamsListener _l) {
getKeys().removeModelListener(_l);
}
! public FDicoComparator compareWith(File _n, ProgressionInterface _progress) {
return getKeys().compareWith(_n, _progress);
}
! public void compareWith() {
! final File fic= impl_.ouvrirFileChooser(null, "fichier à comparer", false);
if (fic == null)
return;
! new BuTaskOperation(impl_, "Comparaison") {
! public void act() {
! BuMainPanel mp= impl_ == null ? null : impl_.getMainPanel();
! if (mp != null) {
mp.setMessage("Initialisation comparaison");
mp.setProgression(0);
}
! FDicoComparator c= compareWith(fic, new ProgressionBuAdapter(this));
! if (c == null)
! return;
! if (mp != null) {
mp.setMessage("Affichage");
mp.setProgression(80);
}
! BuInternalFrame f=
! new BuInternalFrame(
! "Comparaison de "
! + getParamsFile().getName()
! + " <-> "
! + fic.getName(),
! true,
! true,
! true,
! true);
! BuPanel pn= new BuPanel();
! pn.setLayout(new BuBorderLayout(5, 5));
! pn.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
! JTable table= new JTable(c.createTableModel());
c.createRenderer(table);
!
! // table.setDefaultRenderer(String.class, new FudaaCellTextRenderer());
! pn.add(new BuScrollPane(table), BuBorderLayout.CENTER);
f.setContentPane(pn);
impl_.addInternalFrame(f);
f.pack();
f.setVisible(true);
! f.setSize(500, 400);
! f.setPreferredSize(new Dimension(500, 400));
! if (mp != null) {
mp.setMessage("");
mp.setProgression(0);
***************
*** 318,331 ****
*
*/
! public void saveCopy()
! {
! final File fic =
! impl_.ouvrirFileChooser(null, "Enregistrement Copie", true);
if (fic == null)
return;
! new BuTaskOperation(impl_, "sauvegarde copie")
! {
! public void act()
! {
getKeys().saveCopy(fic, new ProgressionBuAdapter(this));
this.setProgression(100);
--- 281,290 ----
*
*/
! public void saveCopy() {
! final File fic= impl_.ouvrirFileChooser(null, "Enregistrement Copie", true);
if (fic == null)
return;
! new BuTaskOperation(impl_, "sauvegarde copie") {
! public void act() {
getKeys().saveCopy(fic, new ProgressionBuAdapter(this));
this.setProgression(100);
***************
*** 339,347 ****
*
*/
! public void actionPerformed(ActionEvent e)
! {
System.out.println(e.getActionCommand());
! if(e.getActionCommand().equals("COMPARER"))
! {
System.out.println("comparaison");
compareWith();
--- 298,304 ----
*
*/
! public void actionPerformed(ActionEvent e) {
System.out.println(e.getActionCommand());
! if (e.getActionCommand().equals("COMPARER")) {
System.out.println("comparaison");
compareWith();
|