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...> - 2003-07-04 15:14:36
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/fileChooser In directory sc8-pr-cvs1:/tmp/cvs-serv8541/fileChooser Log Message: Directory /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/fileChooser added to the repository |
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/calcul
In directory sc8-pr-cvs1:/tmp/cvs-serv6779/calcul
Added Files:
FudaaCalculAction.java FudaaCalculOp.java
FudaaCalculSupportInterface.java
Log Message:
Des classes permettant de gerer l'execution d'un calcul
--- NEW FILE: FudaaCalculAction.java ---
/*
* @file TrCalculActions.java
* @creation 10 juin 2003
* @modification $Date: 2003/07/04 15:04:57 $
* @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.calcul;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JPanel;
import com.memoire.bu.BuButton;
import com.memoire.bu.BuButtonLayout;
import com.memoire.bu.BuPanel;
import com.memoire.bu.BuResource;
import org.fudaa.dodico.calcul.CalculLauncher;
import org.fudaa.dodico.calcul.CalculListener;
/**
* @author deniger
* @version $Id: FudaaCalculAction.java,v 1.1 2003/07/04 15:04:57 deniger Exp $
*/
public class FudaaCalculAction implements CalculListener
{
Action actCalcul_;
Action actStopCalcul_;
FudaaCalculSupportInterface support_;
CalculLauncher calculEnCours_;
/**
*
*/
public FudaaCalculAction(
final FudaaCalculSupportInterface _support,
boolean _stopCalcul)
{
support_=_support;
initCalcul();
if (_stopCalcul)
initStopCalcul();
}
private void initCalcul()
{
actCalcul_=
new AbstractAction("Calculer", BuResource.BU.getIcon("calculer"))
{
public void actionPerformed(ActionEvent _com)
{
if(calculEnCours_!=null) System.out.println("calcul en cours");
calculEnCours_=support_.actionCalcul();
calculEnCours_.addListener(FudaaCalculAction.this);
calculEnCours_.execute();
setEnableStopCalcul(true);
setEnableCalcul(false);
}
};
actCalcul_.setEnabled(false);
}
public boolean calculIsRunning()
{
return (calculEnCours_==null) || (calculEnCours_.isFinished());
}
private void initStopCalcul()
{
actStopCalcul_=
new AbstractAction("Arrêter", BuResource.BU.getIcon("arreter"))
{
public void actionPerformed(ActionEvent _com)
{
if(calculIsRunning())
{
calculEnCours_.stop();
}
}
};
actStopCalcul_.setEnabled(false);
}
public void setEnableCalcul(boolean _b)
{
if (actCalcul_ != null)
actCalcul_.setEnabled(_b);
}
public void setEnableStopCalcul(boolean _b)
{
if (actStopCalcul_ != null)
actStopCalcul_.setEnabled(_b);
}
public Action getCalcul()
{
return actCalcul_;
}
public Action getStopCalcul()
{
return actStopCalcul_;
}
public boolean isStopCalculVisible()
{
return actStopCalcul_!=null;
}
public JPanel createPanel()
{
BuPanel p= new BuPanel();
p.setLayout(new BuButtonLayout(5, BuButtonLayout.RIGHT));
if (actCalcul_ != null)
{
BuButton bt= new BuButton();
bt.setAction(actCalcul_);
p.add(bt);
}
if (actStopCalcul_ != null)
{
BuButton bt= new BuButton();
bt.setAction(actStopCalcul_);
p.add(bt);
}
return p;
}
/**
* @param _source
*/
public void calculFinished(CalculLauncher _source)
{
if(_source==calculEnCours_)
{
calculEnCours_=null;
setEnableStopCalcul(false);
setEnableCalcul(true);
}
}
}
--- NEW FILE: FudaaCalculOp.java ---
/*
* @file TrRefluxCalcul.java
* @creation 13 juin 2003
* @modification $Date: 2003/07/04 15:04:57 $
* @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.calcul;
import java.io.File;
import java.io.PrintStream;
import javax.swing.event.ChangeEvent;
import com.memoire.bu.BuCommonImplementation;
import com.memoire.bu.BuMainPanel;
import com.memoire.bu.BuProgressBar;
import com.memoire.bu.BuTask;
import com.memoire.bu.BuTaskOperation;
import org.fudaa.dodico.calcul.CalculExec;
import org.fudaa.dodico.calcul.CalculLauncher;
import org.fudaa.dodico.calcul.CalculLauncherAbstract;
import org.fudaa.dodico.calcul.CalculLauncherExe;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoUI;
import org.fudaa.dodico.commun.ProgressionBuAdapter;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.objet.CExecListener;
import org.fudaa.dodico.reflux.RefluxExec;
import org.fudaa.fudaa.commun.FudaaCommonImplementation;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.tr.TrImplementation;
import org.fudaa.fudaa.tr.TrProjet;
/**
* @author deniger
* @version $Id: FudaaCalculOp.java,v 1.1 2003/07/04 15:04:57 deniger Exp $
*/
public abstract class FudaaCalculOp
extends CalculLauncherAbstract
implements DodicoUI,CExecListener
{
BuCommonImplementation impl_;
CalculExec exe_;
boolean isFinished_;
boolean stop_;
Process p_;
public FudaaCalculOp(CalculExec _exe)
{
exe_= _exe;
}
protected String getTaskName()
{
return "Calcul";
}
public void setImpl(BuCommonImplementation _impl)
{
impl_= _impl;
}
public void execute()
{
new BuTaskOperation(impl_, getTaskName())
{
public void act()
{
isFinished_= false;
_calcul(new ProgressionBuAdapter(this));
isFinished_= true;
fireFinishedEvent();
}
}
.start();
}
public abstract File proceedParamFile(ProgressionInterface _inter);
protected void setEtat(String _msg, int _p)
{
if (impl_ != null)
{
BuMainPanel mp= impl_.getMainPanel();
mp.setMessage(_msg);
mp.setProgression(_p);
}
}
protected void initEtat()
{
setEtat(DodicoLib.EMPTY_STRING, 0);
}
protected void _calcul(ProgressionInterface _progress)
{
setEtat("enregistrement des résultats", 0);
if (stop_)
{
initEtat();
return;
}
File f= proceedParamFile(_progress);
setEtat("Lancement calcul", 10);
if (stop_)
{
initEtat();
return;
}
exe_.setUI(this);
exe_.setProgression(_progress);
exe_.launch(f, manageArgs(),this);
setEtat("fin calcul", 90);
FudaaLib.showMessage(impl_, "Calcul terminé", "Le calcul est terminé");
initEtat();
isFinished_= true;
}
public String[] manageArgs()
{
return args_;
}
/**
*
*/
public void error(String _msg)
{
error("Erreur à l'exécution", _msg);
}
/**
* @param _titre
* @param _msg
*/
public void error(String _titre, String _msg)
{
FudaaLib.showError(impl_, "Erreur à l'exécution", _msg);
}
/**
* @param _titre
* @param _msg
*/
public void message(String _titre, String _msg)
{
FudaaLib.showMessage(impl_, _titre, _msg);
}
/**
* @param _msg
*/
public void message(String _msg)
{
message("infos", _msg);
}
/**
* @return
*/
public boolean isFinished()
{
return false;
}
/**
* @param _err
*/
public void setErr(PrintStream _err)
{
exe_.setOutError(_err);
}
/**
* @param _std
*/
public void setStd(PrintStream _std)
{
exe_.setOutStandard(_std);
}
/**
*
*/
public void stop()
{
stop_= true;
if (p_ != null)
p_.destroy();
}
/**
*
* Methode appeler par CExec afin de stocker le processus avec
* le blocage du thread (p.waitfor()).
* Cela permet de stopper le process si necessaire.
* @param p
*/
public void setProcess(Process p)
{
p_=p;
}
}
--- NEW FILE: FudaaCalculSupportInterface.java ---
/*
* @file TrCalculSupportInterface.java
* @creation 10 juin 2003
* @modification $Date: 2003/07/04 15:04:57 $
* @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.calcul;
import org.fudaa.dodico.calcul.CalculLauncher;
/**
* @author deniger
* @version $Id: FudaaCalculSupportInterface.java,v 1.1 2003/07/04 15:04:57 deniger Exp $
*/
public interface FudaaCalculSupportInterface
{
public CalculLauncher actionCalcul();
}
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/aide
In directory sc8-pr-cvs1:/tmp/cvs-serv5622/aide
Added Files:
FudaaAidePreferencesPanel.java FudaaAstuces.java
FudaaAstucesDialog.java FudaaAstucesPanel.java astuces.txt
Log Message:
Creation d'un module pour l'aide astuce et pref
--- NEW FILE: FudaaAidePreferencesPanel.java ---
/*
* @file FudaaPreferencesPanel.java
* @creation 2001-09-13
* @modification $Date: 2003/07/04 14:58:10 $
* @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.aide;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JRadioButton;
import javax.swing.border.Border;
import com.memoire.bu.BuAbstractPreferencesPanel;
import com.memoire.bu.BuBorderLayout;
import com.memoire.bu.BuCheckBox;
import com.memoire.bu.BuCommonImplementation;
import com.memoire.bu.BuGridLayout;
import com.memoire.bu.BuLabel;
import com.memoire.bu.BuPanel;
import com.memoire.bu.BuPreferences;
import com.memoire.bu.BuTextField;
import com.memoire.bu.BuVerticalLayout;
import org.fudaa.fudaa.commun.FudaaImplementation;
import org.fudaa.fudaa.commun.FudaaLib;
/**
* Panneau de preferences pour Fudaa.
*
* @version $Revision: 1.1 $ $Date: 2003/07/04 14:58:10 $ by $Author: deniger $
* @author Fred Deniger
*/
public class FudaaAidePreferencesPanel
extends BuAbstractPreferencesPanel
implements ActionListener
{
/**
* Utiliser l'aide locale
*/
private JRadioButton cbAideLocale_;
/**
* Utiliser l'aide du site Fudaa
*/
private JRadioButton cbAideSiteFudaa_;
/**
* Utiliser une autre aide
*/
private JRadioButton cbAideExterne_;
/**
* Le chemin d'acces a l'aide
*/
private BuTextField urlAideExterne_;
/**
* La checkbox controlant l'aparition des astuces au demarrage
*/
private BuCheckBox cbAstuceVisible_;
/**
* L'application concernee.
*/
BuCommonImplementation app_;
/**
* Les options.
*/
BuPreferences options_;
/**
* Les variables utilisees dans les preferences.
*/
private static final String LOCALE="local";
private static final String SITE_FUDAA="site_fudaa";
private static final String AUTRE="autre";
/**
* Les noms des preferences utilisees.
*/
private static final String AIDE_SITE_TYPE_PREF="aide.site.type";
private static final String AIDE_URL_AUTRE_PREF="aide.site.url.autre";
private static final String ASTUCES_VISIBLES_PREF="astuce.visible";
/**
* Renvoie pour les preferences <code>_options</code>, le chemin d'acces
* a l'aide.
*/
public static String getHelpUrl( BuPreferences _options)
{
String type=_options.getStringProperty(AIDE_SITE_TYPE_PREF, LOCALE);
if( AUTRE.equals(type) )
return _options.getStringProperty(AIDE_URL_AUTRE_PREF,
FudaaImplementation.LOCAL_MAN);
else if ( SITE_FUDAA.equals(type) )
return FudaaImplementation.REMOTE_MAN;
else
return FudaaImplementation.LOCAL_MAN;
}
/**
* Renvoie <code>true</code> si les astuces sont declares comme visibles
* au demarrage dans les preferences <code>_options</code>.
*/
public static boolean isAstucesVisibles( BuPreferences _options)
{
return _options.getBooleanProperty(ASTUCES_VISIBLES_PREF,true);
}
/**
* Modifie la valeur concernant l'apparition automatique des astuces
* au demarrage de l'application.
*/
public static void setAstucesVisibles( BuPreferences _options,boolean _b)
{
_options.putBooleanProperty(ASTUCES_VISIBLES_PREF,_b);
_options.writeIniFile();
}
/**
* Initialise la bordure utilisee par les panels principaux: panel du
* format de page et le panel des entetes et pieds de page.
*
* @param _titre le titre ajoute a la bordure.
*/
private static final Border initTitreBorder(String _titre)
{
return BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder(FudaaLib.geti18n(_titre)),
BorderFactory.createEmptyBorder(5,5,5,5));
}
/**
* Initialisation de l'application et des composant swing.
*
* @param _app
*/
public FudaaAidePreferencesPanel(BuCommonImplementation _app,
BuPreferences _options)
{
super();
setLayout(new BuVerticalLayout(5,true,true));
setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
app_ = _app;
options_ = _options;
//astuces
BuPanel panelAstuce=new BuPanel();
panelAstuce.setLayout(new BuBorderLayout());
panelAstuce.setBorder(initTitreBorder("Astuces"));
cbAstuceVisible_ = new BuCheckBox
(FudaaLib.geti18n("Astuces au démarrage"));
panelAstuce.add(cbAstuceVisible_,BuBorderLayout.CENTER);
add(panelAstuce);
//aide
BuPanel panelAide = new BuPanel();
panelAide.setLayout(new BuGridLayout(2,5,5));
panelAide.setBorder(initTitreBorder("Aide ressources"));
cbAideLocale_=new JRadioButton(FudaaLib.geti18n("Locale"));
cbAideLocale_.setName("HELP_INTERNAL" );
cbAideLocale_.addActionListener(this);
panelAide.add(cbAideLocale_);
panelAide.add(getBuLabel(FudaaImplementation.LOCAL_MAN));
cbAideSiteFudaa_=new JRadioButton(FudaaLib.geti18n("Site Fudaa"));
cbAideSiteFudaa_.setName("HELP_SITE" );
cbAideSiteFudaa_.addActionListener(this);
panelAide.add(cbAideSiteFudaa_);
panelAide.add(getBuLabel(FudaaImplementation.REMOTE_MAN));
cbAideExterne_=new JRadioButton(FudaaLib.geti18n("Autre"));
cbAideExterne_.setName("HELP_OTHER");
cbAideExterne_.addActionListener(this);
urlAideExterne_=new BuTextField(
options_.getStringProperty(AIDE_URL_AUTRE_PREF));
urlAideExterne_.setEditable(false);
panelAide.add(cbAideExterne_);
panelAide.add(urlAideExterne_);
ButtonGroup bg=new ButtonGroup();
bg.add(cbAideLocale_);
bg.add(cbAideSiteFudaa_);
bg.add(cbAideExterne_);
add(panelAide);
updateComponents();
}
private BuLabel getBuLabel(String _txt)
{
BuLabel r=new BuLabel(_txt);
r.setVerticalAlignment(BuLabel.CENTER);
return r;
}
/**
* ....
*/
private void fillTable()
{
options_.putStringProperty(AIDE_SITE_TYPE_PREF,getType());
if( AUTRE.equals(getType()) )
{
String url=urlAideExterne_.getText();
if( (url ==null) || (url.length()==0) )
url=FudaaImplementation.LOCAL_MAN;
else if( !url.endsWith("/") )
url=url+"/";
options_.putStringProperty(AIDE_URL_AUTRE_PREF,url);
}
options_.putBooleanProperty(ASTUCES_VISIBLES_PREF,
cbAstuceVisible_.isSelected());
}
private String getType()
{
if( cbAideExterne_.isSelected() )
return AUTRE;
else if(cbAideSiteFudaa_.isSelected() )
return SITE_FUDAA;
else
return LOCALE;
}
/**
* ....
*/
private void updateComponents()
{
String type=options_.getStringProperty(AIDE_SITE_TYPE_PREF,LOCALE);
urlAideExterne_.setEditable(false);
if( AUTRE.equals(type) )
{
cbAideExterne_.setSelected(true);
urlAideExterne_.setEditable(true);
}
else if ( SITE_FUDAA.equals(type) )
{
cbAideSiteFudaa_.setSelected(true);
}
else
{
cbAideLocale_.setSelected(true);
}
cbAstuceVisible_.setSelected(
options_.getBooleanProperty(ASTUCES_VISIBLES_PREF,true));
}
/* private String getPreferencesHelpUrl()
{
return getPreferencesHelpUrl(options_);
} */
/**
* Le titre du panel.
*
* @return "Fudaa"
*/
public String getTitle()
{
return FudaaLib.geti18n("aide");
}
/**
* Retourne true.
*
* @return true
*/
public boolean isPreferencesValidable()
{
return true;
}
/**
* Retourne false.
*
* @return false
*/
public boolean isPreferencesApplyable()
{
return false;
}
/**
* Retourne false.
*
* @return false
*/
public boolean isPreferencesCancelable()
{
return true;
}
/**
* Gestion des evenements.
*
* @param _evt
*/
public void actionPerformed(ActionEvent _evt)
{
JComponent source = (JComponent)_evt.getSource();
System.err.println("SOURCE=" + source.getName());
System.err.println("ACTION=" + _evt.getActionCommand());
if( "HELP_OTHER".equals(source.getName()) )
urlAideExterne_.setEditable(true);
else
urlAideExterne_.setEditable(false);
}
/**
* Enregistrement des modification apportees dans ce panel.
*/
public void validatePreferences()
{
fillTable();
options_.writeIniFile();
updateComponents();
app_.getInformationsSoftware().man=getHelpUrl(options_);
}
/**
* Annuler les modifications.
*/
public void cancelPreferences()
{
options_.readIniFile();
updateComponents();
}
}
--- NEW FILE: FudaaAstuces.java ---
/*
* @file FudaaAstuces.java
* @creation 2001-09-01
* @modification $Date: 2003/07/04 14:58:10 $
* @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.aide;
import com.memoire.bu.BuPreferences;
import org.fudaa.fudaa.commun.FudaaPreferences;
import java.io.*;
/**
* Classe de gestion des astuces
*
* @version $Revision: 1.1 $ $Date: 2003/07/04 14:58:10 $ by $Author: deniger $
* @author Fred Deniger
*/
public class FudaaAstuces
{
/**
* Singleton de FudaaAstuces.
*/
public static FudaaAstuces FUDAA = new FudaaAstuces();
/**
* Le nom du fichier d'astuces.
*/
protected final static String NOM_FICHIER = "astuces.txt";
/**
* La variable utilisee dans les fichiers de ressources des applications.
*/
protected final static String NOM_VARIABLE = "astuce.nombre";
/**
* Choisit au hasard un entier strictement positif inferieur a _nombreMax.
* Si nombreMax_ est inferieur ou egal a 1, 1 est renvoye.
*
* @param _nombreMax
* @return entier strictement positif inferieur a _nombreMax
*/
public static int hasard(int _nombreMax)
{
//choisi dans l'intervalle [1,_nombreMax]
if(_nombreMax < 2)
{
return 1;
}
return (int)(Math.round(Math.random() * (_nombreMax - 1))) + 1;
}
/**
* Retourne l'astuce positionne a la place i.
*
* @param i
* @return astuce
*/
public String getAstuce(int i)
{
return lecture(i);
}
/**
* Retourne l'astuce suivante.
*
* @param i
* @return La valeur AstuceRecursif
*/
public String getAstuceRecursif(int i)
{
if((i < 1) || (i > getNombreLigneTotal()))
{
return "\nPas d'astuces trouvées";
}
int nombreInf = 0;
if(getParent() != null)
{
nombreInf = getParent().getNombreLigneTotal();
}
if(i > nombreInf)
{
return getAstuce(i - nombreInf);
}
else
{
if(getParent() != null)
{
return getParent().getAstuceRecursif(i);
}
}
return "\nPas d'astuce trouvée";
}
/**
* Calcule le nombre d'astuces total, choisi un nombre au hasard dans
* [0,nombreTotalAstuces] et retourne l'astuce correspondante.
*
* @return astuce au hasard.
*/
public String getAstuceHasard()
{
return getAstuceRecursif(hasard(getNombreLigneTotal()));
}
/**
* Retourne le nombre d'astuces.
*
* @return La valeur NombreLigne
*/
public int getNombreLigne()
{
String temp = (PREF().getStringProperty(NOM_VARIABLE)).trim();
if((temp == null) || ("".equals(temp)) || ("0".equals(temp)))
{
lecture(0);
temp = PREF().getStringProperty(NOM_VARIABLE);
}
return Integer.parseInt(temp);
}
/**
* Retourne la somme de tous les nombres de lignes des astuces parents.
*
* @return La valeur NombreLigneTotal
*/
public int getNombreLigneTotal()
{
int nbLigne = getNombreLigne();
if(getParent() != null)
{
nbLigne += getParent().getNombreLigneTotal();
}
return nbLigne;
}
/**
* Retourne le FudaaAstuces parent.
*
* @return null
*/
protected FudaaAstuces getParent()
{
return null;
}
/**
* Les preferences utilisees a ce niveau.
*
* @return FudaaPreferences.FUDAA
*/
protected BuPreferences PREF()
{
return FudaaPreferences.FUDAA;
}
/**
* Lit la ligne i dans le fichier d'astuces. En plus, Mise a jour de la valeur
* de NOM_VARIABLE dans les Preferences (PREF()).
*
* @param i
* @return Astuce a la place i.
*/
protected String lecture(int i)
{
String retour = "\nAstuce non trouvée.";
int nombreLigneLu = 0;
try
{
LineNumberReader lu = new LineNumberReader(
new InputStreamReader(new BufferedInputStream
(getClass().getResourceAsStream(NOM_FICHIER))));
while(lu.ready())
{
String ligneLu = lu.readLine();
if((ligneLu == null) || (ligneLu.equals("")))
{
break;
}
if(++nombreLigneLu == i)
{
retour = ligneLu;
}
}
PREF().putIntegerProperty(NOM_VARIABLE, nombreLigneLu);
PREF().writeIniFile();
return retour;
}
catch(Exception _exception)
{
return retour;
}
}
/**
* Main
*
* @param argv
*/
/*
public static void main(String argv[])
{
for(int i = 0; i < 20; i++)
{
System.out.println("num "+i);
System.out.println(hasard(i));
}
}*/
}
--- NEW FILE: FudaaAstucesDialog.java ---
/*
* @file FudaaAstucesDialog.java
* @creation 2001-09-01
* @modification $Date: 2003/07/04 14:58:10 $
* @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.aide;
import java.awt.*;
import java.awt.event.*;
import java.awt.BorderLayout;
import javax.swing.*;
import javax.swing.border.*;
import com.memoire.bu.*;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.ressource.*;
/**
* Fenetre dialohue pour afficher les astuces
*
* @version $Revision: 1.1 $ $Date: 2003/07/04 14:58:10 $ by $Author: deniger $
* @author Fred Deniger
*/
public class FudaaAstucesDialog
extends BuDialog
{
/**
* CheckBox pour valider ou non l'apparition des astuces.
*/
private JCheckBox cbShowNextTime_;
/**
* Le panel d'affichage.
*/
private FudaaAstucesPanel textePanel_;
/**
* La chaine correspondant a fermer.
*/
private final static String FERMER = FudaaLib.geti18n("Fermer");
/**
* L'icone fermer.
*/
private final static BuIcon BOUTON_FERMER = FudaaLib.getIcon("fermer");
/**
* L'icone suivant:nouvelle astuce.
*/
private final static BuIcon BOUTON_SUIVANT = FudaaLib.getIcon("avancer");
/**
* La chaine correspondant a afficher une autre astuce.
*/
private final static String SUIVANT = FudaaLib.geti18n("Autre Astuce");
/**
* Chaine pour ne plus voir les astuces.
*/
private final static String VOIR_ASTUCE = FudaaLib.geti18n(
"Toujours afficher les astuces");
/**
* Les preferences utilisees.
*/
private BuPreferences options_;
/**
* initialisation de textPanel_ et affichage.
*
* @param _parent
* @param _isoft
* @param _message
*/
public FudaaAstucesDialog(BuPreferences _options,BuCommonInterface _parent,
BuInformationsSoftware _isoft, FudaaAstucesPanel _message)
{
super(_parent, _isoft, FudaaLib.geti18n("Astuces"), _message);
options_=_options;
textePanel_ = _message;
cbShowNextTime_ = new BuCheckBox(VOIR_ASTUCE);
cbShowNextTime_.setSelected(
FudaaAidePreferencesPanel.isAstucesVisibles(options_));
BuButton btFermer = new BuButton(BOUTON_FERMER, FERMER);
btFermer.setActionCommand("FERMER");
getRootPane().setDefaultButton(btFermer);
BuButton btSuivant = new BuButton(BOUTON_SUIVANT, SUIVANT);
btSuivant.setActionCommand("SUIVANT");
BuPanel sousBoutons = new BuPanel();
sousBoutons.setLayout(new BuHorizontalLayout(5, true, true));
sousBoutons.add(btSuivant);
sousBoutons.add(btFermer);
BuPanel boutons = new BuPanel();
boutons.setLayout(new BuBorderLayout(5, 0));
boutons.add(sousBoutons, BuBorderLayout.EAST);
boutons.add(cbShowNextTime_, BuBorderLayout.WEST);
btSuivant.addActionListener(this);
btFermer.addActionListener(this);
content_.add(boutons, BorderLayout.SOUTH); pack();
}
/**
* Fonction appelée lors de la fermeture du dialogue.
*/
public void fermer()
{
reponse_ = JOptionPane.CLOSED_OPTION;
FudaaAidePreferencesPanel.setAstucesVisibles(
options_,cbShowNextTime_.isSelected());
dispose();
}
/**
* Gestion des actions sur la croix.
*
* @param _e
*/
protected void processWindowEvent(WindowEvent _e)
{
if(_e.getID() == WindowEvent.WINDOW_CLOSING)
{
fermer();
}
}
/**
* retourne la valeur Component de FudaaAstucesDialog object
*
* @return La valeur Component
*/
public JComponent getComponent()
{
return textePanel_;
}
/**
* Gestion des evenements sur les boutons fermer et suivant.
*
* @param _evt
*/
public void actionPerformed(ActionEvent _evt)
{
String source = _evt.getActionCommand();
if("SUIVANT".equals(source))
{
reponse_ = JOptionPane.OK_OPTION;
textePanel_.changeTexte();
}
if("FERMER".equals(source))
{
fermer();
}
}
/**
* Affiche la boite de dialogue de FudaaAstuces.
*
* @param _app
* @param _astuces
* @return
*/
public static int showDialog(BuPreferences _pref,BuCommonImplementation _app,
FudaaAstuces _astuces)
{
return new FudaaAstucesDialog
(_pref,_app, _app.getInformationsSoftware(), new FudaaAstucesPanel(_astuces))
.activate();
}
/**
* Le main.
*
* @param _args The command line arguments
*/
public static void main(String[] _args)
{
String essai="essai";
essai=null;
//showDialog(new BuApplication().getImplementation(), FudaaAstuces.FUDAA);
System.out.println("ok");
System.gc();
System.out.println("ok");
}
}
--- NEW FILE: FudaaAstucesPanel.java ---
/*
* @file FudaaAstucesPanel.java
* @creation 2000-09-01
* @modification $Date: 2003/07/04 14:58:10 $
* @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.aide;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import com.memoire.bu.*;
import org.fudaa.fudaa.commun.FudaaLib;
import java.util.Calendar;
import java.util.Vector;
/**
* Classe de création du Panel d'affichage des astuces
*
* @version $Revision: 1.1 $ $Date: 2003/07/04 14:58:10 $ by $Author: deniger $
* @author Fred Deniger
*/
public class FudaaAstucesPanel extends BuPanel
{
// variables privees
/**
* Astuces utilisees.
*/
private FudaaAstuces astuce_;
/**
* Le label contenant les astuces.
*/
private BuLabelMultiLine texte_;
/**
* L'image de fond.
*/
private BuPicture imageFond_;
/**
* Chaine correspondant a la fin du fichier image.
*/
private final static String FIN_NOM_IMAGE = "_astuce.jpg";
/**
* Initialisation: texte,astuce et image.
*
* @param _astuce
*/
public FudaaAstucesPanel(FudaaAstuces _astuce)
{
super();
setBorder(new EmptyBorder(15,0, 0, 0));
initialiseEcran();
astuce_ = _astuce;
changeTexte();
}
/**
* Initialisation de l'image de fond puis du texte.
*/
private void initialiseEcran()
{
setLayout(new BuOverlayLayout());
buildImageFond();
texte_ = new BuLabelMultiLine("?");
texte_.setOpaque(false);
texte_.setBorder(new EmptyBorder(5, 5, 5, 5));
//texte_.setFont(BuLib.deriveFont("Label",Font.PLAIN,0));
texte_.setFont(new Font("SansSerif", Font.PLAIN, 12));
//texte_.setSize(imageFond_.getPreferredSize());
add(texte_);
add(imageFond_);
}
/**
* Choisit une image en fonction du mois. Les images sont dans le fichier
* astuces.
*/
private void buildImageFond()
{
String mois = String.valueOf(Calendar.getInstance().get(Calendar.MONTH) + 1);
imageFond_ = new BuPicture
(FudaaLib.getIcon("astuces/" +
mois + FIN_NOM_IMAGE));
imageFond_.setMode(BuPicture.SCALE);
}
/**
* @return imageFond_
*/
public BuPicture getImageFond()
{
return imageFond_;
}
/**
* Choisit une astuce au hasard et
*/
public void changeTexte()
{
String t = astuce_.getAstuceHasard();
for(int i = 35; i < t.length(); i += 35)
{
int j = t.indexOf(' ', i);
if(j >= 0)
{
t = t.substring(0, j) + '\n' + t.substring(j + 1);
}
if(j > i)
{
i = j;
}
}
texte_.setText(t);
}
/*
public static void main(String[] argv)
{
FudaaAstucesPanel panel=new FudaaAstucesPanel(FudaaAstuces.FUDAA);
JFrame fen=new JFrame("essai");
fen.getContentPane().add(panel);
fen.pack();
fen.show();
}*/
}
--- NEW FILE: astuces.txt ---
(This appears to be a binary file; contents omitted.)
|
|
From: <de...@us...> - 2003-07-04 14:56:24
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/assistant In directory sc8-pr-cvs1:/tmp/cvs-serv5299/assistant Log Message: Directory /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/assistant added to the repository |
|
From: <de...@us...> - 2003-07-04 14:56:24
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec In directory sc8-pr-cvs1:/tmp/cvs-serv5299/exec Log Message: Directory /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/exec added to the repository |
|
From: <de...@us...> - 2003-07-04 14:56:24
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/aide In directory sc8-pr-cvs1:/tmp/cvs-serv5299/aide Log Message: Directory /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/aide added to the repository |
|
From: <de...@us...> - 2003-07-04 14:56:24
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/dodico In directory sc8-pr-cvs1:/tmp/cvs-serv5299/dodico Log Message: Directory /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/dodico added to the repository |
|
From: <de...@us...> - 2003-07-04 14:56:24
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/calcul In directory sc8-pr-cvs1:/tmp/cvs-serv5299/calcul Log Message: Directory /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/calcul added to the repository |
|
From: <de...@us...> - 2003-07-04 14:41:06
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico In directory sc8-pr-cvs1:/tmp/cvs-serv2774/dico Log Message: Directory /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico added to the repository |
|
From: <de...@us...> - 2003-07-04 14:40:20
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/etc In directory sc8-pr-cvs1:/tmp/cvs-serv2588 Added Files: reflux.jpg Log Message: Ajout d'un icone au format jpg --- NEW FILE: reflux.jpg --- (This appears to be a binary file; contents omitted.) |
|
From: <de...@us...> - 2003-07-04 14:32:52
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog
In directory sc8-pr-cvs1:/tmp/cvs-serv930/dialog
Modified Files:
EbliSimpleDialog.java
Added Files:
EbliSimpleDialogPanel.java EnhancedDialog.java
Log Message:
ZCalqueLongPolygone : permet de dessiner des polygones qui seraient long.
EnhancedDialog dialogue pouvant etre ferme avec la touche esc
--- NEW FILE: EbliSimpleDialogPanel.java ---
/*
* @file PrertPnDialog.java
* @creation 2002-09-03
* @modification $Date: 2003/07/04 14:32:48 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.ebli.dialog;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.File;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.KeyStroke;
import javax.swing.border.EmptyBorder;
import com.memoire.bu.BuBorderLayout;
import com.memoire.bu.BuButton;
import com.memoire.bu.BuCharValidator;
import com.memoire.bu.BuCommonImplementation;
import com.memoire.bu.BuCommonInterface;
import com.memoire.bu.BuFileChooser;
import com.memoire.bu.BuHorizontalLayout;
import com.memoire.bu.BuInformationsSoftware;
import com.memoire.bu.BuLabel;
import com.memoire.bu.BuLabelMultiLine;
import com.memoire.bu.BuLib;
import com.memoire.bu.BuPanel;
import com.memoire.bu.BuPicture;
import com.memoire.bu.BuStringValidator;
import com.memoire.bu.BuTextField;
import com.memoire.bu.BuValueValidator;
import com.memoire.bu.BuVerticalLayout;
import org.fudaa.ebli.commun.EbliLib;
/**
* Un panneau qui peut etre facilement affichable dans une boite de dialogue.
* Cette classe reprend le mode de fonctionnement de JOptionPane.
* Les methodes valide(), actionOk(), actionApply() et actionCancel() peuvent être
*
* @version $Id: EbliSimpleDialogPanel.java,v 1.1 2003/07/04 14:32:48 deniger Exp $
* @author Bertrand Marchand,Fred Deniger
*/
public class EbliSimpleDialogPanel
extends BuPanel
implements ActionListener, WindowListener
{
/**
* Option : uniquement un bouton ok sera affiche. Reponse donnee par le
* dialogue si le bouton "ok" utilise.
*/
public static final int OK_OPTION = 0;
public static final int OK_CANCEL_OPTION = 1;
public static final int OK_APPLY_OPTION = 2;
public static final int OK_CANCEL_APPLY_OPTION = 3;
public static final int CANCEL_OPTION = 4;
public static final String CHOOSE_FILE_TXT_FIELD_PROPERTY =
"fudaaChooseFileTxtField";
public static final String CHOOSE_FILE_OPEN_DIR = "fudaaChooseFileopenDir";
protected int option_;
protected boolean modale_;
protected JDialog dialog_;
private int response_;
private BuLabelMultiLine lbError_;
String title_;
private File lastFile_;
private BuInformationsSoftware isoft_;
public EbliSimpleDialogPanel()
{
this(OK_CANCEL_OPTION);
}
/**
* Les options possibles les variables statiques <code>OK_OPTION</code>
* (un bouton ok unique,
* <code>OK_CANCEL_OPTION</code>,...
*/
public EbliSimpleDialogPanel(int _option)
{
option_ = _option;
lbError_ = new BuLabelMultiLine();
lbError_.setVisible(false);
lbError_.setForeground(Color.red);
title_ = "";
response_ = JOptionPane.CANCEL_OPTION;
}
public void setErrorText(String _error)
{
if ((!lbError_.isVisible()) || (!_error.equals(lbError_.getText())))
{
lbError_.setVisible(true);
lbError_.setText(_error);
doLayout();
}
}
public void cancelErrorText()
{
if (lbError_.isVisible())
{
lbError_.setVisible(false);
lbError_.setText("");
doLayout();
}
}
public void setInfos(BuInformationsSoftware _is)
{
isoft_ = _is;
}
public void setInfos(BuCommonInterface _is)
{
if (_is != null)
setInfos(_is.getInformationsSoftware());
}
/**
* Permet d'initialiser ce dialogue a l'aide d'un objet : envoie une exception par defaut.
*/
public void setValue(Object _f)
{
throw new NoSuchMethodError("Methode non implantee");
}
/**
* Renvoie la chaine caracterisant le contenu de ce dialogue.
*/
public Object getValue()
{
throw new NoSuchMethodError("Methode non implantee");
}
public void setModale(boolean _modale)
{
modale_ = _modale;
}
public boolean valide()
{
return true;
}
/**
* Affiche le panel dans une boite de dialogue.
* @param _parent la boite de dialogue parent
* @param _titre le titre de la boite de dialogue
*/
public void affiche(Dialog _parent)
{
createDialog(_parent);
afficheDialog(_parent);
}
/**
* Affiche le panel dans une boite de dialogue.
* @param _parent la fenetre parent
*/
public void affiche(Frame _parent)
{
createDialog(_parent);
afficheDialog(_parent);
}
/**
* Affiche le panel dans une boite de dialogue.
* @param _parent la fenetre parent
*/
public void affiche(Component _parent)
{
createDialog();
afficheDialog(_parent);
}
private void createDialog()
{
if (dialog_ != null)
{
if (EbliLib.DEBUG)
System.err.println("Cet element est deja visualise");
dialog_.dispose();
}
dialog_ = new EbliSimpleDialog(this);
dialog_.setTitle(title_);
}
private void createDialog(Frame _parent)
{
if (dialog_ != null)
{
if (EbliLib.DEBUG)
System.err.println("Cet element est deja visualise");
}
dialog_ = new EbliSimpleDialog(_parent, this);
}
private void createDialog(Dialog _parent)
{
if (dialog_ != null)
{
if (EbliLib.DEBUG)
System.err.println("Cet element est deja visualise");
//dialog_.dispose();
}
dialog_ = new EbliSimpleDialog(_parent, this);
}
/**
* Affiche le panel dans une boite de dialogue modale.
* @param _parent la boite de dialogue parent
*/
public int afficheModale(Dialog _parent)
{
createDialog(_parent);
modale_ = true;
return afficheDialog(_parent);
}
/**
* Affiche le panel dans une boite de dialogue modale.
* @param _parent la fenetre parent
*/
public int afficheModale(Frame _parent)
{
createDialog(_parent);
modale_ = true;
return afficheDialog(_parent);
}
public int afficheModale(Dialog _parent, String _title)
{
setTitle(_title);
return afficheModale(_parent);
}
public int afficheModale(Frame _parent, String _title)
{
setTitle(_title);
return afficheModale(_parent);
}
public int afficheModale(Component _parent, String _title)
{
setTitle(_title);
return afficheModale(_parent);
}
/**
* Affiche le panel dans une boite de dialogue modale.
* @param _parent la fenetre parent
*/
public int afficheModale(Component _parent)
{
createDialog();
modale_ = true;
return afficheDialog(_parent);
}
public void addEmptyBorder(int _b)
{
addEmptyBorder(this, _b);
}
public void addEmptyBorder(JComponent _c, int _b)
{
_c.setBorder(BorderFactory.createEmptyBorder(_b, _b, _b, _b));
}
/**
* Affiche le dialogue et le positionne par rapport a <code>_parent</code>.
*/
private int afficheDialog(Component _parent)
{
dialog_.setModal(modale_);
dialog_.addWindowListener(this);
dialog_.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog_.setContentPane(construitDialogPanel());
dialog_.setLocationRelativeTo(_parent);
dialog_.pack();
dialog_.show();
return response_;
}
public static BuPanel getInfosPanel(BuInformationsSoftware _isoft)
{
BuPanel mpi = new BuPanel();
mpi.setLayout(new BuVerticalLayout(5));
mpi.setBorder(new EmptyBorder(5, 5, 5, 5));
mpi.setBackground(mpi.getBackground().darker());
mpi.setForeground(Color.white);
BuPicture ml_logo = null;
if (_isoft.logo != null)
{
ml_logo = new BuPicture(_isoft.logo);
}
BuLabelMultiLine ml_isoft =
new BuLabelMultiLine(
_isoft.name
+ "\nversion: "
+ _isoft.version
+ "\ndate: "
+ _isoft.date);
ml_isoft.setFont(BuLib.deriveFont("Label", Font.PLAIN, -2));
ml_isoft.setForeground(Color.white);
if (ml_logo != null)
mpi.add(ml_logo);
mpi.add(ml_isoft);
return mpi;
}
/**
* Construit le panel de la boite de dialogue.
*/
private BuPanel construitDialogPanel()
{
BuPanel princ = new BuPanel();
princ.setLayout(new BuBorderLayout());
if (isoft_ != null)
{
princ.add(getInfosPanel(isoft_), BuBorderLayout.WEST);
}
princ.add(lbError_, BuBorderLayout.NORTH);
princ.add(this, BuBorderLayout.CENTER);
BuPanel pnAction = new BuPanel();
pnAction.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 0));
pnAction.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
switch (option_)
{
case OK_CANCEL_APPLY_OPTION :
pnAction.add(construireOk());
pnAction.add(construireApply());
pnAction.add(construireCancel());
break;
case OK_CANCEL_OPTION :
pnAction.add(construireOk());
pnAction.add(construireCancel());
break;
case OK_OPTION :
pnAction.add(construireOk());
break;
case OK_APPLY_OPTION :
pnAction.add(construireOk());
pnAction.add(construireApply());
break;
case CANCEL_OPTION :
pnAction.add(construireCancel());
break;
}
princ.add(pnAction, BuBorderLayout.SOUTH);
princ.doLayout();
return princ;
}
protected JTextField addLabelFileChooserPanel(String _label)
{
return addLabelFileChooserPanel(this, _label, null, false);
}
protected JTextField addLabelFileChooserPanel(
String _label,
String _initValue)
{
return addLabelFileChooserPanel(this, _label, _initValue, false);
}
protected JTextField addLabelFileChooserPanel(
String _label,
String _initValue,
boolean _chooseDir)
{
return addLabelFileChooserPanel(this, _label, _initValue, _chooseDir);
}
protected JTextField addLabelFileChooserPanel(
Container _c,
String _label,
String _initValue,
boolean _chooseDir)
{
JLabel lb = addLabel(_c, _label);
lb.setVerticalTextPosition(JLabel.CENTER);
JTextField r = new BuTextField(_initValue);
r.setToolTipText(_initValue);
r.setColumns(15);
lb.setLabelFor(r);
BuPanel pn = new BuPanel();
pn.setLayout(new BuHorizontalLayout(0, false, true));
pn.add(r);
JButton j = new BuButton("...");
if (_chooseDir)
{
j.putClientProperty(CHOOSE_FILE_OPEN_DIR, Boolean.TRUE);
}
j.putClientProperty(CHOOSE_FILE_TXT_FIELD_PROPERTY, r);
j.setActionCommand("...");
j.addActionListener(this);
pn.add(j);
_c.add(pn);
return r;
}
/**
* Construit un bouton ayant comme label <code>_text</code> et comme
* "ActionCommand" <code>_action</code>.
*/
protected JButton construireBuButton(String _text, String _action)
{
BuButton r = new BuButton(_text);
r.setActionCommand(_action);
r.addActionListener(this);
return r;
}
protected JButton construireOk()
{
JButton bt = construireBuButton("Continuer", "OK");
bt.setMnemonic(KeyEvent.VK_C);
return bt;
}
protected JButton construireCancel()
{
JButton bt = construireBuButton("Annuler", "CANCEL");
bt.setMnemonic(KeyEvent.VK_N);
return bt;
}
private JButton construireApply()
{
JButton bt = construireBuButton("Appliquer", "APPLY");
bt.setMnemonic(KeyEvent.VK_A);
return bt;
}
/**
* ajoute au panel un label dont la couleur de texte est rouge.
*/
protected BuLabel addRedLabel()
{
return addRedLabel(this);
}
protected BuLabel addRedLabel(Container _c)
{
BuLabel r = new BuLabel();
r.setForeground(Color.red);
_c.add(r);
return r;
}
protected BuLabel addLabel(String _l)
{
return addLabel(this, _l);
}
protected BuLabel addLabel(Container _c, String _l)
{
BuLabel r = new BuLabel(_l);
_c.add(r);
return r;
}
protected BuTextField addLabelDoubleText(String _label)
{
return addLabelDoubleText(this, _label);
}
protected BuTextField addLabelDoubleText(Container _c, String _label)
{
addLabel(_c, _label);
return addDoubleText(_c);
}
protected BuTextField addLabelIntegerText(String _label)
{
return addLabelIntegerText(this, _label);
}
protected BuTextField addLabelIntegerText(Container _c, String _label)
{
addLabel(_c, _label);
return addIntegerText(_c);
}
protected BuTextField addLabelStringText(String _label)
{
addLabel(_label);
return addStringText();
}
protected BuTextField addDoubleText()
{
return addDoubleText(this);
}
protected BuTextField addDoubleText(Container _c)
{
BuTextField r = new BuTextField(20);
r.setCharValidator(BuCharValidator.DOUBLE);
r.setStringValidator(BuStringValidator.DOUBLE);
r.setValueValidator(BuValueValidator.DOUBLE);
_c.add(r);
return r;
}
protected BuTextField addDoubleText(Container _c, double _d)
{
BuTextField r = addDoubleText(_c);
r.setText(_d + "");
return r;
}
protected BuTextField addStringText()
{
return addStringText(this);
}
protected BuTextField addStringText(Container _c)
{
BuTextField txt = new BuTextField();
_c.add(txt);
return txt;
}
protected BuTextField addIntegerText()
{
return addIntegerText(this);
}
protected BuTextField addIntegerText(Container _c)
{
BuTextField r = new BuTextField(20);
r.setCharValidator(BuCharValidator.INTEGER);
r.setStringValidator(BuStringValidator.INTEGER);
r.setValueValidator(BuValueValidator.INTEGER);
_c.add(r);
return r;
}
protected BuTextField addIntegerText(int _d)
{
return addIntegerText(this, _d);
}
protected BuTextField addIntegerText(Container _c, int _d)
{
BuTextField r = addIntegerText(_c);
r.setText(_d + "");
return r;
}
public static final boolean isOkResponse(int r)
{
return r == JOptionPane.OK_OPTION;
}
public static final boolean isCancelResponse(int r)
{
return r == JOptionPane.CANCEL_OPTION;
}
/**
* Recupere les evt des boutons ok,cancel et apply.
* bouton OK : valide(), actionApply(),actionOK() et actionClose() )<br/>
* bouton cancel : actionCancel() et et actionClose()<br/>
* bouton apply : valide(), actionApply()<br/>
*/
public void actionPerformed(ActionEvent _evt)
{
String com = _evt.getActionCommand();
if ("OK".equals(com))
{
actionOK();
}
else if ("CANCEL".equals(com))
{
actionCancel();
}
else if ("APPLY".equals(com))
{
apply();
}
else if ("...".equals(com))
{
JComponent jsrc = (JComponent) _evt.getSource();
Object o = jsrc.getClientProperty(CHOOSE_FILE_TXT_FIELD_PROPERTY);
if (o instanceof JTextField)
{
JTextField txt = (JTextField) o;
JLabel l = (JLabel) txt.getClientProperty("labeledBy");
File initFile = null;
File dir = null;
String txtText = txt.getText();
if ((txtText != null) && (txtText.trim().length() > 0))
{
initFile = new File(txt.getText());
dir = initFile.getParentFile();
}
else
{
dir = lastFile_;
}
BuFileChooser bf = new BuFileChooser();
Boolean b = (Boolean) jsrc.getClientProperty(CHOOSE_FILE_OPEN_DIR);
if ((b != null) && (b.equals(Boolean.TRUE)))
{
bf.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
}
if ((dir != null) && (dir.isDirectory()))
{
bf.setCurrentDirectory(dir);
}
if (l != null)
bf.setDialogTitle(l.getText());
bf.setMultiSelectionEnabled(false);
int r = bf.showOpenDialog(this);
if (r == BuFileChooser.APPROVE_OPTION)
{
File out = bf.getSelectedFile();
setLastFile(out.getParentFile());
if ((initFile == null) || (!out.equals(initFile)))
{
String s = out.getAbsolutePath();
txt.setText(s);
txt.setToolTipText(s);
}
}
}
}
}
protected void fermerDialog()
{
closeDialog();
if (dialog_ != null)
{
dialog_.dispose();
}
dialog_ = null;
}
/**
* maj du layout et de la boite de dialogue.
*/
public void actualiseAffichage()
{
doLayout();
if (dialog_ != null)
dialog_.pack();
}
/**
* Méthode à surcharger : elle est appelee si le bouton APPLY est
* active.
*/
public void apply()
{
}
public void ok()
{
apply();
}
public void cancel()
{
}
public void closeDialog()
{
}
/**
* intialise la reponse (JOptionPane.CANCEL_OPTION)
* puis ferme le dialogue.
*/
public final void actionCancel()
{
response_ = JOptionPane.CANCEL_OPTION;
cancel();
fermerDialog();
}
/**
* Si valide, intialise la reponse (JOptionPane.OK_OPTION)
* ,appelle la fonction actionApply() puis ferme le dialogue.
*/
public final void actionOK()
{
if (valide())
{
response_ = JOptionPane.OK_OPTION;
ok();
fermerDialog();
}
}
public void windowActivated(WindowEvent e)
{
}
public void windowClosed(WindowEvent e)
{
}
public void windowClosing(WindowEvent e)
{
actionCancel();
}
public void windowDeactivated(WindowEvent e)
{
}
public void windowDeiconified(WindowEvent e)
{
}
public void windowIconified(WindowEvent e)
{
}
public void windowOpened(WindowEvent e)
{
}
/**
*
*/
public String getTitle()
{
return title_;
}
/**
*
*/
public void setTitle(String _string)
{
if (_string != null)
{
title_ = _string;
}
}
/**
*
*/
public File getLastFile()
{
return lastFile_;
}
/**
*
*/
public void setLastFile(File _file)
{
lastFile_ = _file;
}
}
--- NEW FILE: EnhancedDialog.java ---
/*
* EnhancedDialog.java - Handles OK/Cancel for you
* Copyright (C) 1998, 1999, 2001 Slava Pestov
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.fudaa.ebli.dialog;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
/**
* A dialog box that handles window closing, the ENTER key and the ESCAPE
* key for you. All you have to do is implement ok() (called when
* Enter is pressed) and cancel() (called when Escape is pressed, or window
* is closed).
* @author Slava Pestov
* @version $Id: EnhancedDialog.java,v 1.1 2003/07/04 14:32:48 deniger Exp $
*/
public class EnhancedDialog extends JDialog
{
public EnhancedDialog(Frame parent)
{
super(parent);
init();
}
public EnhancedDialog(Dialog _c)
{
super(_c);
init();
}
public EnhancedDialog()
{
super();
init();
}
private void init()
{
((Container)getLayeredPane()).addContainerListener(
new ContainerHandler());
getContentPane().addContainerListener(new ContainerHandler());
keyHandler = new KeyHandler();
addKeyListener(keyHandler);
addWindowListener(new WindowHandler());
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
}
public void ok()
{
}
public void cancel()
{
}
// protected members
protected KeyHandler keyHandler;
// Recursively adds our key listener to sub-components
class ContainerHandler extends ContainerAdapter
{
public void componentAdded(ContainerEvent evt)
{
componentAdded(evt.getChild());
}
public void componentRemoved(ContainerEvent evt)
{
componentRemoved(evt.getChild());
}
private void componentAdded(Component comp)
{
comp.addKeyListener(keyHandler);
if(comp instanceof Container)
{
Container cont = (Container)comp;
cont.addContainerListener(this);
Component[] comps = cont.getComponents();
for(int i = 0; i < comps.length; i++)
{
componentAdded(comps[i]);
}
}
}
private void componentRemoved(Component comp)
{
comp.removeKeyListener(keyHandler);
if(comp instanceof Container)
{
Container cont = (Container)comp;
cont.removeContainerListener(this);
Component[] comps = cont.getComponents();
for(int i = 0; i < comps.length; i++)
{
componentRemoved(comps[i]);
}
}
}
}
class KeyHandler extends KeyAdapter
{
public void keyPressed(KeyEvent evt)
{
if(evt.isConsumed())
return;
if(evt.getKeyCode() == KeyEvent.VK_ENTER)
{
// crusty workaround
Component comp = getFocusOwner();
while(comp != null)
{
if(comp instanceof JComboBox)
{
JComboBox combo = (JComboBox)comp;
if(combo.isEditable())
{
Object selected = combo.getEditor().getItem();
if(selected != null)
combo.setSelectedItem(selected);
}
break;
}
comp = comp.getParent();
}
ok();
evt.consume();
}
else if(evt.getKeyCode() == KeyEvent.VK_ESCAPE)
{
cancel();
evt.consume();
}
}
}
class WindowHandler extends WindowAdapter
{
public void windowClosing(WindowEvent evt)
{
cancel();
}
}
}
Index: EbliSimpleDialog.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog/EbliSimpleDialog.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** EbliSimpleDialog.java 19 May 2003 14:21:19 -0000 1.4
--- EbliSimpleDialog.java 4 Jul 2003 14:32:48 -0000 1.5
***************
*** 1,455 ****
/*
! * @file PrertPnDialog.java
! * @creation 2002-09-03
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
*/
package org.fudaa.ebli.dialog;
! import java.awt.Color;
! import java.awt.Component;
import java.awt.Dialog;
- import java.awt.FlowLayout;
import java.awt.Frame;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.WindowEvent;
- import java.awt.event.WindowListener;
-
- import javax.swing.BorderFactory;
- import javax.swing.JDialog;
- import javax.swing.JOptionPane;
-
- import com.memoire.bu.BuBorderLayout;
- import com.memoire.bu.BuButton;
- import com.memoire.bu.BuCharValidator;
- import com.memoire.bu.BuLabel;
- import com.memoire.bu.BuPanel;
- import com.memoire.bu.BuStringValidator;
- import com.memoire.bu.BuTextField;
- import com.memoire.bu.BuValueValidator;
-
- import org.fudaa.ebli.commun.EbliLib;
/**
! * Un panneau qui peut etre facilement affichable dans une boite de dialogue.
! * Cette classe reprend le mode de fonctionnement de JOptionPane.
! * Les methodes valide(), actionApply() et actionCancel() peuvent être
! * redefinies : valide() est appele avant d'appliquer les changements
! * ( la methode actionApply() ).
! *
! * @version $Id$
! * @author Bertrand Marchand,Fred Deniger
*/
! public class EbliSimpleDialog
! extends BuPanel
! implements ActionListener, WindowListener
{
- /**
- * Option : uniquement un bouton ok sera affiche. Reponse donnee par le
- * dialogue si le bouton "ok" utilise.
- */
- public static final int OK_OPTION = 0;
- public static final int OK_CANCEL_OPTION = 1;
- public static final int OK_APPLY_OPTION = 2;
- public static final int OK_CANCEL_APPLY_OPTION = 3;
- protected int option_;
- protected boolean modale_;
- protected JDialog dialog_;
- private int response_;
- public EbliSimpleDialog()
- {
- this(OK_CANCEL_OPTION);
- }
- /**
- * Les options possibles les variables statiques <code>OK_OPTION</code>
- * (un bouton ok unique,
- * <code>OK_CANCEL_OPTION</code>,...
- */
- public EbliSimpleDialog(int _option)
- {
- option_ = _option;
- response_ = JOptionPane.CANCEL_OPTION;
- }
-
-
- /**
- * Permet d'initialiser ce dialogue a l'aide d'une chaine. Envoie une exception si non implante.
- */
- public void setValue(String _f)
- {
- throw new NoSuchMethodError("Methode non implantee");
- }
-
- /**
- * Renvoie la chaine caracterisant le contenu de ce dialogue.
- */
- public String getValue()
- {
- throw new NoSuchMethodError("Methode non implantee");
- }
-
-
-
- public void setModale(boolean _modale)
- {
- modale_ = _modale;
- }
-
- public boolean valide()
- {
- return true;
- }
- /**
- * Affiche le panel dans une boite de dialogue.
- * @param _parent la boite de dialogue parent
- * @param _titre le titre de la boite de dialogue
- */
- public void affiche(Dialog _parent, String _titre)
- {
- createDialog(_parent,_titre);
- afficheDialog(_parent);
- }
! /**
! * Affiche le panel dans une boite de dialogue.
! * @param _parent la fenetre parent
! * @param _titre le titre de la boite de dialogue
! */
! public void affiche(Frame _parent, String _titre)
! {
! createDialog(_parent,_titre);
! afficheDialog(_parent);
! }
!
! /**
! * Affiche le panel dans une boite de dialogue.
! * @param _parent la fenetre parent
! * @param _titre le titre de la boite de dialogue
! */
! public void affiche(Component _parent, String _titre)
! {
! createDialog(_titre);
! afficheDialog(_parent);
! }
!
!
! private void createDialog(String _titre)
! {
! if (dialog_ != null)
! {
! if(EbliLib.DEBUG)
! System.err.println("Cet element est deja visualise");
! dialog_.dispose();
! }
! dialog_ = new JDialog();
! dialog_.setTitle(_titre);
! }
!
! private void createDialog(Frame _parent, String _titre)
{
! if (dialog_ != null)
! {
! if(EbliLib.DEBUG)
! System.err.println("Cet element est deja visualise");
! // dialog_.dispose();
! }
! dialog_ = new JDialog(_parent, _titre);
}
!
! private void createDialog(Dialog _parent, String _titre)
! {
! if (dialog_ != null)
{
! if(EbliLib.DEBUG)
! System.err.println("Cet element est deja visualise");
! //dialog_.dispose();
}
- dialog_ = new JDialog(_parent, _titre);
- }
-
-
!
! /**
! * Affiche le panel dans une boite de dialogue modale.
! * @param _parent la boite de dialogue parent
! * @param _titre le titre de la boite de dialogue
! */
! public int afficheModale(Dialog _parent, String _titre)
! {
! createDialog(_parent,_titre);
! modale_=true;
! return afficheDialog(_parent);
! }
!
! /**
! * Affiche le panel dans une boite de dialogue modale.
! * @param _parent la fenetre parent
! * @param _titre le titre de la boite de dialogue
! */
! public int afficheModale(Frame _parent, String _titre)
! {
! createDialog(_parent,_titre);
! modale_=true;
! return afficheDialog(_parent);
! }
!
! /**
! * Affiche le panel dans une boite de dialogue modale.
! * @param _parent la fenetre parent
! * @param _titre le titre de la boite de dialogue
! */
! public int afficheModale(Component _parent, String _titre)
! {
! createDialog(_titre);
! modale_=true;
! return afficheDialog(_parent);
! }
!
! public void addEmptyBorder(int _b)
! {
! setBorder(BorderFactory.createEmptyBorder(_b, _b, _b, _b));
! }
! /**
! * Affiche le dialogue et le positionne par rapport a <code>_parent</code>.
! */
! private int afficheDialog(Component _parent)
! {
! dialog_.setModal(modale_);
! dialog_.addWindowListener(this);
! dialog_.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
! dialog_.setContentPane(construitDialogPanel());
! // Dimension dParent;
! // Point pParent;
! // Dimension dThis = dialog_.getPreferredSize();
! // Point pThis = new Point();
! // if (_parent == null)
! // {
! // dParent = Toolkit.getDefaultToolkit().getScreenSize();
! // pParent = new Point(0, 0);
! // }
! // else
! // {
! // dParent = _parent.getPreferredSize();
! // pParent = _parent.getLocation();
! // }
! // pThis.x = pParent.x + (dParent.width - dThis.width) / 2;
! // pThis.y = pParent.y + (dParent.height - dThis.height) / 2;
! // dialog_.setLocation(pThis);
! dialog_.setLocationRelativeTo(_parent);
! dialog_.pack();
! dialog_.show();
! return response_;
! }
! /**
! * Construit le panel de la boite de dialogue.
! */
! private BuPanel construitDialogPanel()
! {
! BuPanel princ = new BuPanel();
! princ.setLayout(new BuBorderLayout());
! princ.add(this, BuBorderLayout.CENTER);
! BuPanel pnAction = new BuPanel();
! pnAction.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 0));
! pnAction.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
! switch (option_)
! {
! case OK_OPTION :
! construireOk(pnAction);
! break;
! case OK_CANCEL_OPTION :
! construireOk(pnAction);
! construireCancel(pnAction);
! break;
! case OK_APPLY_OPTION :
! construireOk(pnAction);
! construireApply(pnAction);
! break;
! case OK_CANCEL_APPLY_OPTION :
! construireOk(pnAction);
! construireApply(pnAction);
! construireCancel(pnAction);
! break;
! }
! princ.add(pnAction, BuBorderLayout.SOUTH);
! princ.doLayout();
! return princ;
! }
! /**
! * Construit un bouton ayant comme label <code>_text</code> et comme
! * "ActionCommand" <code>_action</code>.
! */
! private BuButton construireBuButton(String _text, String _action)
! {
! BuButton r = new BuButton(_text);
! r.setActionCommand(_action);
! r.addActionListener(this);
! return r;
! }
! private void construireOk(BuPanel _p)
! {
! _p.add(construireBuButton("Continuer", "OK"));
! }
! private void construireCancel(BuPanel _p)
! {
! _p.add(construireBuButton("Annuler", "CANCEL"));
! }
! private void construireApply(BuPanel _p)
! {
! _p.add(construireBuButton("Appliquer", "APPLY"));
! }
! /**
! * ajoute au panel un label dont la couleur de texte est rouge.
! */
! protected BuLabel addRedLabel()
! {
! BuLabel r = new BuLabel();
! r.setForeground(Color.red);
! add(r);
! return r;
! }
! protected BuLabel addLabel(String _l)
! {
! BuLabel r = new BuLabel(_l);
! add(r);
! return r;
! }
! protected BuTextField addLabelDoubleText(String _label)
! {
! addLabel(_label);
! return addDoubleText();
! }
! protected BuTextField addLabelIntegerText(String _label)
! {
! addLabel(_label);
! return addIntegerText();
! }
! protected BuTextField addDoubleText()
! {
! BuTextField r = new BuTextField(20);
! r.setCharValidator(BuCharValidator.DOUBLE);
! r.setStringValidator(BuStringValidator.DOUBLE);
! r.setValueValidator(BuValueValidator.DOUBLE);
! add(r);
! return r;
! }
! protected BuTextField addDoubleText(double _d)
! {
! BuTextField r = addDoubleText();
! r.setText(_d + "");
! return r;
! }
! protected BuTextField addIntegerText()
! {
! BuTextField r = new BuTextField(20);
! r.setCharValidator(BuCharValidator.INTEGER);
! r.setStringValidator(BuStringValidator.INTEGER);
! r.setValueValidator(BuValueValidator.INTEGER);
! add(r);
! return r;
! }
! protected BuTextField addIntegerText(int _d)
! {
! BuTextField r = addIntegerText();
! r.setText(_d + "");
! return r;
! }
!
! /**
! * Recupere les evt des boutons ok,cancel et apply.
! * bouton OK : valide(), actionApply(),actionOK() et actionClose() )<br/>
! * bouton cancel : actionCancel() et et actionClose()<br/>
! * bouton apply : valide(), actionApply()<br/>
! */
! public void actionPerformed(ActionEvent _evt)
! {
! String com = _evt.getActionCommand();
! if ("OK".equals(com))
! {
! if (valide())
! {
! actionApply();
! response_ = JOptionPane.OK_OPTION;
! actionOK();
! fermerDialog();
! }
! }
! else if ("CANCEL".equals(com))
! {
! actionCancel();
! response_ = JOptionPane.CANCEL_OPTION;
! fermerDialog();
! }
! else if ("APPLY".equals(com))
! if (valide())
! actionApply();
! }
!
! private void fermerDialog()
! {
! actionClose();
! if (dialog_ != null)
{
! dialog_.dispose();
}
! dialog_ = null;
! }
! /**
! * maj du layout et de la boite de dialogue.
! */
! public void actualiseAffichage()
! {
! doLayout();
! if (dialog_ != null)
! dialog_.pack();
! }
! /**
! * Méthode à surcharger : elle est appelee si le bouton APPLY ou OK est
! * active.
! */
! protected void actionApply()
! {
! }
! /**
! * Méthode action pour le bouton CANCEL à surcharger.
! */
! protected void actionCancel()
! {
! }
!
! public void actionOK()
{
}
!
! public void actionClose()
{
}
!
! public void windowActivated(WindowEvent e)
{
}
- public void windowClosed(WindowEvent e)
- {
! }
! public void windowClosing(WindowEvent e)
! {
! actionCancel();
! }
! public void windowDeactivated(WindowEvent e)
! {
! }
! public void windowDeiconified(WindowEvent e)
! {
! }
! public void windowIconified(WindowEvent e)
! {
! }
! public void windowOpened(WindowEvent e)
! {
! }
}
--- 1,59 ----
/*
! * @file EbliSimpleDialog.java
! * @creation 23 juin 2003
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
*/
package org.fudaa.ebli.dialog;
!
import java.awt.Dialog;
import java.awt.Frame;
/**
! * @author deniger
! * @version $Id$
*/
! public class EbliSimpleDialog extends EnhancedDialog
{
! EbliSimpleDialogPanel dial_;
! public EbliSimpleDialog(Frame parent,EbliSimpleDialogPanel _dial)
{
! super(parent);
! init(_dial);
}
! public EbliSimpleDialog(Dialog _c,EbliSimpleDialogPanel _dial)
{
! super(_c);
! init(_dial);
}
! public EbliSimpleDialog(EbliSimpleDialogPanel _dial)
{
! super();
! init(_dial);
}
!
! private void init(EbliSimpleDialogPanel _dial)
{
+ dial_=_dial;
+ setTitle(_dial.getTitle());
+
}
!
! public void ok()
{
+ dial_.actionOK();
}
! public void cancel()
{
+ dial_.actionCancel();
}
!
!
}
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque
In directory sc8-pr-cvs1:/tmp/cvs-serv930/calque
Modified Files:
EbliAdapteurSuiviSouris.java EbliFilleCalques.java
ZCalqueAffichageDonnees.java ZCalqueMaillageElement.java
ZCalquePoint.java ZCalquePolygone.java ZCalquePolyligne.java
ZEbliFilleCalques.java ZModeleDonnees.java
ZModeleMaillageElement.java
ZModeleStatiqueMaillageElement.java
Added Files:
ZCalqueLongPolygone.java ZModeleLongPolygone.java
Log Message:
ZCalqueLongPolygone : permet de dessiner des polygones qui seraient long.
EnhancedDialog dialogue pouvant etre ferme avec la touche esc
--- NEW FILE: ZCalqueLongPolygone.java ---
/*
* @file ZcalqueLongPolygone.java
* @creation 1 juil. 2003
* @modification $Date: 2003/07/04 14:32:48 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.ebli.calque;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.Icon;
import org.fudaa.ebli.commun.EbliListeSelection;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrMorphisme;
import org.fudaa.ebli.geometrie.GrPoint;
import org.fudaa.ebli.geometrie.GrPolygone;
import org.fudaa.ebli.trace.TraceLigne;
/**
* @author deniger
* @version $Id: ZCalqueLongPolygone.java,v 1.1 2003/07/04 14:32:48 deniger Exp $
*/
public class ZCalqueLongPolygone extends ZCalqueAffichageDonnees
{
/** Propriete modele*/
protected ZModeleLongPolygone modele_ = null;
protected TraceLigne tl_ = null;
protected TraceLigne tlSelection_ = null;
public ZCalqueLongPolygone()
{
super();
}
public ZCalqueLongPolygone(ZModeleLongPolygone _modele)
{
this();
modele(_modele);
}
/**
* @param _modele Modele
*/
public void modele(ZModeleLongPolygone _modele)
{
if (modele_ != _modele)
{
ZModeleLongPolygone vp = modele_;
modele_ = _modele;
firePropertyChange("modele", vp, modele_);
}
}
/**
* @return Modele
*/
public ZModeleLongPolygone modele()
{
return modele_;
}
public ZModeleDonnees modeleDonnees()
{
return modele();
}
/**
* @param _g
*/
public void paintComponent(Graphics _g)
{
super.paintComponent(_g);
if ((modele_ == null) || (modele_.getNombre() <= 0))
return;
GrBoite clip = getClipReel(_g);
GrBoite domaine = modele_.getDomaine();
if (!domaine.intersectXY(clip))
{
return;
}
GrMorphisme versEcran = getVersEcran();
boolean attenue = isAttenue();
boolean rapide = isRapide();
// BPaletteCouleur paletteCouleur = getPaletteCouleur();
// BPaletteIcone paletteIcone = getPaletteIcone();
int nombre = modele_.getNombre();
Color foreground = getForeground();
if (attenue)
foreground = attenueCouleur(foreground);
Icon icone = getIcone();
if (attenue)
icone = attenueIcone(icone);
GrBoite bPoly;
int incrementPt = 1;
if (tl_ == null)
tl_ = new TraceLigne((Graphics2D) _g);
else
tl_.graphics((Graphics2D) _g);
for (int i = 0; i < nombre; i++)
{
bPoly = modele_.getDomaineForPolygoneIdx(i);
//Si la boite du polygone n'est pas dans la boite d'affichage on passe
if (bPoly.intersectionXY(clip) == null)
continue;
int nbPoints = modele_.getNbPointForPolygoneIdx(i);
if (nbPoints <= 0)
continue;
if ((rapide) && (nbPoints > 15))
incrementPt = 3;
else
incrementPt = 1;
//QUESTION: a rajouter
/* double z = 0.;
if(domaine.e.z > domaine.o.z)
z = (p.z - domaine.o.z) / (domaine.e.z - domaine.o.z);*/
// p.autoApplique(versEcran);
Color c = foreground;
Icon s = icone;
/*if(paletteCouleur != null)
{
c = paletteCouleur.couleur(z);
if(attenue)
c = attenueCouleur(c);
}
if(paletteIcone != null)
{
s = paletteIcone.icone(z);
if(attenue)
s = attenueIcone(s);
} */
if (c == null)
return;
_g.setColor(c);
tl_.setCouleur(c);
GrPoint ptOri = new GrPoint();
modele_.point(ptOri, i, 0);
ptOri.autoApplique(versEcran);
GrPoint ptDest = new GrPoint();
for (int j = nbPoints - 1; j >= 0; j -= incrementPt)
{
//le point de dest est initialise
modele_.point(ptDest, i, j);
ptDest.autoApplique(versEcran);
if (s != null)
s.paintIcon(this, _g, (int) ptDest.x, (int) ptDest.y);
tl_.dessineTrait(ptOri.x, ptOri.y, ptDest.x, ptDest.y);
ptOri.initialise(ptDest);
}
}
if ((!rapide) && (!isSelectionEmpty()))
{
if (tlSelection_ == null)
tlSelection_ = new TraceLigne((Graphics2D) _g);
else
tlSelection_.graphics((Graphics2D) _g);
initIconeSelection();
initCouleurSelection();
Color cs = couleurSelection();
Icon ic = iconeSelection();
if (attenue)
{
cs = attenueCouleur(cs);
ic = attenueIcone(ic);
}
_g.setColor(cs);
tlSelection_.setCouleur(cs);
//tlSelection_.setEpaisseur(2f);
int nb = selection_.getMaxIndex();
for (int i = nb; i >= 0; i--)
{
if (!selection_.isSelected(i))
continue;
bPoly = modele_.getDomaineForPolygoneIdx(i);
//Si la boite du polygone n'est pas dans la boite d'affichage on passe
if (bPoly.intersectionXY(clip) == null)
continue;
int nbPoints = modele_.getNbPointForPolygoneIdx(i);
GrPoint ptOri = new GrPoint();
modele_.point(ptOri, i, 0);
ptOri.autoApplique(versEcran);
GrPoint ptDest = new GrPoint();
for (int j = nbPoints - 1; j >= 0; j--)
{
//le point de dest est initialise
modele_.point(ptDest, i, j);
ptDest.autoApplique(versEcran);
ic.paintIcon(this, _g, (int) ptDest.x, (int) ptDest.y);
tlSelection_.dessineTrait(ptOri.x, ptOri.y, ptDest.x, ptDest.y);
ptOri.initialise(ptDest);
}
}
/* if(!selection_.isSelectionPartielleVide())
{
int[] s=entitePartielleSelection();
int nb=s.length-1;
initIconeSelectionPartielle();
initCouleurSelection();
Color cs=couleurSelection();
Icon ic=iconeSelectionPartielle();
if(attenue)
{
cs=attenueCouleur(cs);
ic=attenueIcone(ic);
}
_g.setColor(cs);
int t;
for(int i = nb; i >=0; i--)
{
t=s[i];
modele_.polygone(p,t);
if(clip.intersectXY(p.boite()))
{
int[] atomes=partielleSelection(t);
int nbAtomes=atomes.length-1;
GrPoint pt=new GrPoint();
for(int j=nbAtomes;j>=0;j--)
{
p.sommets.renvoie(pt,atomes[j]);
if(clip.contientXY(pt))
{
p.autoApplique(versEcran);
ic.paintIcon(this, _g, (int)pt.x, (int)pt.y);
}
}
}
}
} */
}
}
public EbliListeSelection selection(
GrPolygone _polySelection,
boolean _partiel)
{
GrBoite boitePolySelection = _polySelection.boite();
GrMorphisme versEcran = getVersEcran();
GrBoite bClip = getDomaine();
bClip.autoApplique(versEcran);
if (!boitePolySelection.intersectXY(bClip))
return null;
int nb = modele().getNombre() - 1;
bClip = getClipReel(getGraphics());
// GrPolygone poly = new GrPolygone();
EbliListeSelection r = creeSelection();
if (_partiel)
{
/* for(int i=nb;i>=0;i--)
{
modele().polygone(poly,i);
if(bClip.intersectXY(poly.boite()))
{
poly.autoApplique(versEcran);
if(boitePolySelection.intersectXY(poly.boite()))
{
DefaultListSelectionModel l=GrPolygone.pointsSelectionnes(poly,_polySelection);
if(l!=null)
{
if(EbliListeSelection.estTotal(l,poly.nombre()))
r.add(i);
else
r.setSelectionPartielle(i,l);
}
}
}
} */
}
else
{
for (int i = nb; i >= 0; i--)
{
//modele().polygone(poly, i);
if (bClip.contientXY(modele_.getDomaineForPolygoneIdx(i)))
{
int nbPoint = modele_.getNbPointForPolygoneIdx(i) - 1;
GrPoint p = new GrPoint();
boolean selected = true;
for (int j = nbPoint;(j >= 0) && selected; j--)
{
modele_.point(p, i, j);
p.autoApplique(versEcran);
if ((!boitePolySelection.contient(p))
|| (!_polySelection.contientXY(p)))
{
selected = false;
}
}
if (selected)
r.add(i);
}
}
}
if (r.isEmpty())
return null;
else
return r;
}
public EbliListeSelection selection(
GrPoint _pt,
int _tolerance,
boolean _partiel)
{
GrMorphisme versEcran = getVersEcran();
GrBoite bClip = getDomaine();
bClip.autoApplique(versEcran);
if ((!bClip.contientXY(_pt)) && (bClip.distanceXY(_pt) > _tolerance))
return null;
int nb = modele().getNombre() - 1;
bClip = getClipReel(getGraphics());
GrPolygone poly = new GrPolygone();
GrPoint pt1 = new GrPoint();
GrPoint pt2 = new GrPoint();
poly.sommets.ajoute(pt1);
poly.sommets.ajoute(pt2);
if (_partiel)
{
/* GrPoint p=new GrPoint();
for(int i=nb;i>=0;i--)
{
modele().polygone(poly,i);
if(bClip.intersectXY(poly.boite()))
{
poly.autoApplique(versEcran);
int nbPt=poly.sommets.nombre()-1;
for(int j=nbPt;j>=0;j--)
{
poly.sommets.renvoie(p,j);
if(GrPoint.estSelectionne(p, _tolerance, _pt))
{
EbliListeSelection r=creeSelection();
r.setSelectionPartielle(i,j);
return r;
}
}
}
} */
}
else
{
for (int i = nb; i >= 0; i--)
{
if (bClip.intersectXY(modele_.getDomaineForPolygoneIdx(i)))
{
int nbPt = modele_.getNbPointForPolygoneIdx(i) - 1;
for (int j = nbPt; j >= 1; j--)
{
modele_.point(pt1, i, j);
modele_.point(pt2, i, j - 1);
poly.autoApplique(versEcran);
if (GrPolygone.estSelectionne(poly, _tolerance, _pt))
{
EbliListeSelection r = creeSelection();
r.add(i);
return r;
}
}
}
}
}
return null;
}
}
--- NEW FILE: ZModeleLongPolygone.java ---
/*
* @file ZmodeleLongPolygone.java
* @creation 1 juil. 2003
* @modification $Date: 2003/07/04 14:32:48 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.ebli.calque;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrPoint;
/**
* Cette interface permet de dessiner pas à pas un polygone qui serait tres long (le bord
* d'un maillage par exemple).
* @author deniger
* @version $Id: ZModeleLongPolygone.java,v 1.1 2003/07/04 14:32:48 deniger Exp $
*/
public interface ZModeleLongPolygone extends ZModeleDonnees
{
public int getPolygoneNb();
public int getNbPointForPolygoneIdx(int _idx);
public GrBoite getDomaineForPolygoneIdx(int _idx);
public boolean point(GrPoint _p,int _polygoneIdx,int _pointIdx);
}
Index: EbliAdapteurSuiviSouris.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/EbliAdapteurSuiviSouris.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** EbliAdapteurSuiviSouris.java 18 Mar 2003 16:04:07 -0000 1.2
--- EbliAdapteurSuiviSouris.java 4 Jul 2003 14:32:48 -0000 1.3
***************
*** 74,77 ****
--- 74,78 ----
r.append((int)c[i]);
}
+ // System.out.println(c[0]+", "+c[1]);
label_.setText(r.toString());
}
Index: EbliFilleCalques.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/EbliFilleCalques.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** EbliFilleCalques.java 18 Mar 2003 16:04:08 -0000 1.5
--- EbliFilleCalques.java 4 Jul 2003 14:32:48 -0000 1.6
***************
*** 248,251 ****
--- 248,252 ----
{
GrBoite b=vc_.getCalque().getDomaine();
+ System.out.println("fillecalque Domaine "+b);
if( (b==null)||b.indefinie() ) return;
vc_.changeRepere(this, b);
Index: ZCalqueAffichageDonnees.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonnees.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZCalqueAffichageDonnees.java 30 Jan 2003 10:56:50 -0000 1.1
--- ZCalqueAffichageDonnees.java 4 Jul 2003 14:32:48 -0000 1.2
***************
*** 163,167 ****
case ZCalqueSelectionInteraction.ACTION_ADD :
{
- System.out.println("add");
selection_.add(_s);
break;
--- 163,166 ----
***************
*** 169,173 ****
case ZCalqueSelectionInteraction.ACTION_DEL :
{
- System.out.println("del");
selection_.remove(_s);
break;
--- 168,171 ----
***************
*** 175,179 ****
case ZCalqueSelectionInteraction.ACTION_XOR :
{
- System.out.println("xor");
selection_.xor(_s);
break;
--- 173,176 ----
***************
*** 181,185 ****
case ZCalqueSelectionInteraction.ACTION_REPLACE :
{
- System.out.println("replace");
selection_.setSelection(_s);
break;
--- 178,181 ----
***************
*** 269,291 ****
{
GrBoite r = null;
- GrBoite b = new GrBoite();
-
if (isVisible())
{
ZModeleDonnees m = modeleDonnees();
r = super.getDomaine();
! if (m != null)
{
! m.getDomaine(b);
! if (r == null)
! {
! r = new GrBoite();
! r.ajuste(b);
! }
! else if (b != null)
! r = r.union(b);
}
}
! return r;
}
--- 265,281 ----
{
GrBoite r = null;
if (isVisible())
{
ZModeleDonnees m = modeleDonnees();
r = super.getDomaine();
! if(m==null) return r;
! if(r!=null)
{
! r.ajuste(m.getDomaine());
! return r;
}
+ else return m.getDomaine();
}
! return null;
}
Index: ZCalqueMaillageElement.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueMaillageElement.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZCalqueMaillageElement.java 30 Jan 2003 10:56:50 -0000 1.1
--- ZCalqueMaillageElement.java 4 Jul 2003 14:32:48 -0000 1.2
***************
*** 31,38 ****
{
/** */
! private GrBoite boite_;
!
! /** */
! protected Vector maillages_;
/** */
protected boolean elementsVisibles_;
--- 31,35 ----
{
/** */
! protected ZModeleMaillageElement maillage_;
/** */
protected boolean elementsVisibles_;
***************
*** 40,44 ****
protected boolean noeudsVisibles_;
-
/** */
public ZCalqueMaillageElement()
--- 37,40 ----
***************
*** 46,56 ****
super();
- maillages_ = new Vector();
- boite_ = null;
elementsVisibles_ = true;
noeudsVisibles_ = false;
}
-
/**
* Rend les éléments visibles
--- 42,49 ----
***************
*** 63,67 ****
}
-
/**
* Rend les noeuds visibles
--- 56,59 ----
***************
*** 73,77 ****
noeudsVisibles_ = _etat;
}
!
/**
* @param _mail Maillage
--- 65,69 ----
noeudsVisibles_ = _etat;
}
!
/**
* @param _mail Maillage
***************
*** 80,89 ****
public void setModele(ZModeleMaillageElement _mail)
{
! maillages_.clear();
! maillages_.add(_mail);
! boite_ = null;
}
-
/**
* @return ElementsVisibles
--- 72,78 ----
public void setModele(ZModeleMaillageElement _mail)
{
! maillage_ = _mail;
}
/**
* @return ElementsVisibles
***************
*** 94,98 ****
}
-
/**
* @return NoeudsVisibles
--- 83,86 ----
***************
*** 103,107 ****
}
-
/**
* Boite englobante des objets contenus dans le calque.
--- 91,94 ----
***************
*** 112,132 ****
public GrBoite getDomaine()
{
!
! if(boite_ == null && maillages_.size() > 0)
! {
! boite_ = new GrBoite();
! for(int i = 0; i < maillages_.size(); i++)
! {
! ZModeleMaillageElement tmp=(ZModeleMaillageElement)maillages_.get(i);
! /* GrBoite b=new GrBoite();
! for(int j=tmp.nombreNoeuds()-1;j>=0;j--)
! b.ajuste(tmp.noeud(j).point); */
! GrBoite b=tmp.domaine();
! if(b != null)
! boite_.ajuste(b);
! }
! }
!
! return boite_;
}
--- 99,103 ----
public GrBoite getDomaine()
{
! return maillage_.getDomaine();
}
***************
*** 139,155 ****
public ZModeleMaillageElement getModele()
{
! return (ZModeleMaillageElement)maillages_.get(0);
! }
!
!
! /**
! * @return Maillages
! */
! public Vector getMaillages()
! {
! return maillages_;
}
-
/**
* @param _c
--- 110,116 ----
public ZModeleMaillageElement getModele()
{
! return maillage_;
}
/**
* @param _c
***************
*** 164,180 ****
_g.translate(_x, _y);
! int w = getIconWidth();
! int h = getIconHeight();
! Color fg = getForeground();
! if(isAttenue())
fg = attenueCouleur(fg);
_g.setColor(fg);
! for(int i = 2; i < w - 5; i += 4)
! for(int j = 2; j < h - 5; j += 4)
{
! int[] vx = new int[]{i, i + 4, i + 4, i};
! int[] vy = new int[]{j, j, j + 4, j + 4};
_g.drawPolygon(vx, vy, 4);
--- 125,141 ----
_g.translate(_x, _y);
! int w = getIconWidth();
! int h = getIconHeight();
! Color fg = getForeground();
! if (isAttenue())
fg = attenueCouleur(fg);
_g.setColor(fg);
! for (int i = 2; i < w - 5; i += 4)
! for (int j = 2; j < h - 5; j += 4)
{
! int[] vx = new int[] { i, i + 4, i + 4, i };
! int[] vy = new int[] { j, j, j + 4, j + 4 };
_g.drawPolygon(vx, vy, 4);
***************
*** 191,276 ****
public void paintComponent(Graphics _g)
{
- if(maillages_.size() == 0)
- {
- super.paintComponent(_g);
- return;
- }
! if(boite_ == null)
! boite_ = getDomaine();
! if(boite_.indefinie())
return;
! GrMorphisme versEcran = getVersEcran();
! Polygon pecr = boite_.enPolygoneXY().applique(versEcran).polygon();
! Rectangle clip = _g.getClipBounds();
! Color ce = getForeground();
! if(isAttenue())
ce = attenueCouleur(ce);
! Color cn = new Color(0, 200, 0);
! if(isAttenue())
cn = attenueCouleur(cn);
! if(clip.intersects(pecr.getBounds()))
{
! for(int k = 0; k < maillages_.size(); k++)
{
! ZModeleMaillageElement modele = (ZModeleMaillageElement)maillages_.get(k);
! // Tracé des éléments de bord
! if(isRapide())
{
! _g.setColor(ce);
!
! for(int i = modele.nombreAretesContours()-1; i >=0; i--)
{
! for(int j = modele.nombreElementsArete(i)-1; j >=0 ; j--)
{
! Polygon p = modele.aretesContours(i,j).applique(versEcran).polygon();
! if(clip.intersects(p.getBounds()))
! _g.drawPolygon(p);
}
}
}
!
! else
{
! if(elementsVisibles_)
! {
! _g.setColor(ce);
! int n = modele.nombrePolygones();
! for(int i = 0; i < n; i++)
! {
! GrPolygone grP=modele.polygone(i);
! grP.autoApplique(versEcran);
! Polygon p = grP.polygon();
! if(clip.intersects(p.getBounds()))
! _g.drawPolygon(p);
! }
}
! // Noeuds visibles
! if(noeudsVisibles_)
! {
! //GrNoeud[] nds = maillageEcran_.noeuds();
! TracePoint tp = new TracePoint(_g);
! tp.setTypePoint(TracePoint.CROIX);
! tp.setTaillePoint(2);
! tp.setCouleur(cn);
!
! for(int i = modele.nombreNoeuds(); i >=0; i--)
{
! GrPoint pt= modele.point(i).applique(versEcran);
! tp.dessinePoint(pt.x, pt.y);
! ReserveGrPoint.EBLI.libere(pt);
}
!
}
}
}
--- 152,248 ----
public void paintComponent(Graphics _g)
{
! GrBoite b = maillage_.getDomaine();
!
! if (b.indefinie())
return;
! GrMorphisme versEcran = getVersEcran();
! Polygon pecr = b.enPolygoneXY().applique(versEcran).polygon();
! Rectangle clip = _g.getClipBounds();
! Color ce = getForeground();
! if (isAttenue())
ce = attenueCouleur(ce);
! Color cn = new Color(0, 200, 0);
! if (isAttenue())
cn = attenueCouleur(cn);
! if (clip.intersects(pecr.getBounds()))
{
+ GrPoint p = new GrPoint();
! // Tracé des éléments de bord
! if (isRapide())
{
! _g.setColor(ce);
! GrPoint p1 = new GrPoint();
! for (int i = maillage_.getNombreBord() - 1; i >= 0; i--)
{
! for (int j = maillage_.getNombrePointPourBord(i) - 1; j >= 1; j--)
{
! if ((maillage_.getBordPoint(i, j, p))
! && (maillage_.getBordPoint(i - 1, j, p1)))
{
! p.autoApplique(versEcran);
! p1.autoApplique(versEcran);
! _g.drawLine((int) p.x, (int) p.y, (int) p1.x, (int) p1.y);
! }
! else
! {
! System.out.println(
! "Erreur lors de l'affection du bord "
! + i
! + " et du point "
! + j);
}
}
}
! }
! else
! {
! if (elementsVisibles_)
{
! _g.setColor(ce);
! int n = maillage_.getNombrePolygones();
! GrPolygone poly = new GrPolygone();
! for (int i = 0; i < n; i++)
! {
! maillage_.polygone(i, poly);
! poly.autoApplique(versEcran);
! Polygon jpoly = poly.polygon();
! if (clip.intersects(jpoly.getBounds()))
! _g.drawPolygon(jpoly);
}
+ }
! // Noeuds visibles
! if (noeudsVisibles_)
! {
! //GrNoeud[] nds = maillageEcran_.noeuds();
! TracePoint tp = new TracePoint(_g);
! tp.setTypePoint(TracePoint.CROIX);
! tp.setTaillePoint(2);
! tp.setCouleur(cn);
!
! for (int i = maillage_.getNombreNoeuds(); i >= 0; i--)
! {
! if (maillage_.point(i, p))
{
! p.autoApplique(versEcran);
! tp.dessinePoint(p.x, p.y);
}
! else
! {
! System.err.println("Erreur lors de l'affectation du point "+i);
! }
! // ReserveGrPoint.EBLI.libere(pt);
}
+
}
}
***************
*** 280,314 ****
}
-
/** Reinitialise la liste de maillages */
public void reinitialise()
{
! maillages_ = new Vector();
! boite_ = null;
! }
!
!
! /**
! * Ajoute un maillage a la liste de maillages de ce calque.
! *
! * @param _mail
! */
! public void ajoute(ZModeleMaillageElement _mail)
! {
! maillages_.add(_mail);
! boite_ = null;
}
-
- /**
- * Retire un maillage de la liste de maillages de ce calque.
- *
- * @param _mail
- */
- public void enleve(ZModeleMaillageElement _mail)
- {
- maillages_.remove(_mail);
- boite_ = null;
- }
}
-
--- 252,260 ----
}
/** Reinitialise la liste de maillages */
public void reinitialise()
{
! maillage_ = null;
}
}
Index: ZCalquePoint.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZCalquePoint.java 30 Jan 2003 10:56:50 -0000 1.1
--- ZCalquePoint.java 4 Jul 2003 14:32:48 -0000 1.2
***************
*** 88,93 ****
if((modele_ == null) || (nombre<=0) ) return;
GrBoite clip=getClipReel(_g);
! GrBoite domaine=new GrBoite();
! modele_.getDomaine(domaine);
//Si le domaine des polys n'est pas dans le domaine d'affichage on arrete
if(!domaine.intersectXY(clip))
--- 88,92 ----
if((modele_ == null) || (nombre<=0) ) return;
GrBoite clip=getClipReel(_g);
! GrBoite domaine=modele_.getDomaine();
//Si le domaine des polys n'est pas dans le domaine d'affichage on arrete
if(!domaine.intersectXY(clip))
Index: ZCalquePolygone.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalquePolygone.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ZCalquePolygone.java 18 Mar 2003 16:04:06 -0000 1.2
--- ZCalquePolygone.java 4 Jul 2003 14:32:48 -0000 1.3
***************
*** 84,89 ****
if((modele_ == null) || (modele_.getNombre()<=0) ) return;
GrBoite clip=getClipReel(_g);
! GrBoite domaine=new GrBoite();
! modele_.getDomaine(domaine);
if(!domaine.intersectXY(clip))
{
--- 84,89 ----
if((modele_ == null) || (modele_.getNombre()<=0) ) return;
GrBoite clip=getClipReel(_g);
! GrBoite domaine=modele_.getDomaine();
!
if(!domaine.intersectXY(clip))
{
Index: ZCalquePolyligne.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalquePolyligne.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ZCalquePolyligne.java 18 Mar 2003 16:04:02 -0000 1.2
--- ZCalquePolyligne.java 4 Jul 2003 14:32:48 -0000 1.3
***************
*** 87,92 ****
//le clip d'affichage
GrBoite clip=getClipReel(_g);
! GrBoite domaine=new GrBoite();
! modele_.getDomaine(domaine);
//Si le domaine des polys n'est pas dans le domaine d'affichage on arrete
if(!domaine.intersectXY(clip))
--- 87,91 ----
//le clip d'affichage
GrBoite clip=getClipReel(_g);
! GrBoite domaine=modele_.getDomaine();
//Si le domaine des polys n'est pas dans le domaine d'affichage on arrete
if(!domaine.intersectXY(clip))
Index: ZEbliFilleCalques.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliFilleCalques.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ZEbliFilleCalques.java 18 Mar 2003 16:04:00 -0000 1.4
--- ZEbliFilleCalques.java 4 Jul 2003 14:32:48 -0000 1.5
***************
*** 58,62 ****
import org.fudaa.ebli.calque.state.EbliStateToggleButton;
import org.fudaa.ebli.calque.state.EbliStateZoom;
! import org.fudaa.ebli.dialog.EbliSimpleDialog;
import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.ebli.geometrie.GrBoite;
--- 58,62 ----
import org.fudaa.ebli.calque.state.EbliStateToggleButton;
import org.fudaa.ebli.calque.state.EbliStateZoom;
! import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.ebli.geometrie.GrBoite;
***************
*** 760,765 ****
{
specificToolsPrefView_=new ViewPreferences();
}
! specificToolsPrefView_.affiche(this, EbliLib.geti18n("Affichage"));
}
--- 760,766 ----
{
specificToolsPrefView_=new ViewPreferences();
+ specificToolsPrefView_.setTitle(EbliLib.geti18n("Affichage"));
}
! specificToolsPrefView_.affiche(this);
}
***************
*** 1402,1411 ****
* Le dialogue qui permet d'afficher la visibilite des specificTools.
*/
! private class ViewPreferences extends EbliSimpleDialog
{
protected GroupModel model_;
ViewPreferences()
{
! super(EbliSimpleDialog.OK_CANCEL_APPLY_OPTION);
this.setLayout(new BuBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10,10,10));
--- 1403,1412 ----
* Le dialogue qui permet d'afficher la visibilite des specificTools.
*/
! private class ViewPreferences extends EbliSimpleDialogPanel
{
protected GroupModel model_;
ViewPreferences()
{
! super(EbliSimpleDialogPanel.OK_CANCEL_APPLY_OPTION);
this.setLayout(new BuBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10,10,10));
***************
*** 1438,1442 ****
* Enregistre dans les prefs les modifs au niveau de la visibilite.
*/
! public void actionApply()
{
System.out.println("apply");
--- 1439,1443 ----
* Enregistre dans les prefs les modifs au niveau de la visibilite.
*/
! public void apply()
{
System.out.println("apply");
***************
*** 1451,1455 ****
* sont effacees et les proprietes du fichier de pref sont chargees.
*/
! public void actionCancel()
{
System.out.println("cancel");
--- 1452,1456 ----
* sont effacees et les proprietes du fichier de pref sont chargees.
*/
! public void cancel()
{
System.out.println("cancel");
***************
*** 1471,1475 ****
* Enregistre dans le fichier les preferences.
*/
! public void actionOK()
{
if(EbliLib.DEBUG) System.out.println("ViewPreferences ok");
--- 1472,1476 ----
* Enregistre dans le fichier les preferences.
*/
! public void ok()
{
if(EbliLib.DEBUG) System.out.println("ViewPreferences ok");
***************
*** 1480,1484 ****
* Met la variable specificToolsPrefView de ZEbliFilleCalques a null.
*/
! public void actionClose()
{
if(EbliLib.DEBUG) System.out.println("ViewPreferences close");
--- 1481,1485 ----
* Met la variable specificToolsPrefView de ZEbliFilleCalques a null.
*/
! public void closeDialog()
{
if(EbliLib.DEBUG) System.out.println("ViewPreferences close");
Index: ZModeleDonnees.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleDonnees.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZModeleDonnees.java 30 Jan 2003 10:56:50 -0000 1.1
--- ZModeleDonnees.java 4 Jul 2003 14:32:48 -0000 1.2
***************
*** 28,35 ****
GrBoite getDomaine();
- /**
- * Affecte a <code>_b</code> le domaine du modele
- */
- public void getDomaine(GrBoite _b);
/**
--- 28,31 ----
Index: ZModeleMaillageElement.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleMaillageElement.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZModeleMaillageElement.java 30 Jan 2003 10:56:50 -0000 1.1
--- ZModeleMaillageElement.java 4 Jul 2003 14:32:48 -0000 1.2
***************
*** 23,27 ****
* @return Le nombre de polygone du modele
*/
! public int nombrePolygones();
--- 23,27 ----
* @return Le nombre de polygone du modele
*/
! public int getNombrePolygones();
***************
*** 29,36 ****
* @return Le nombre de points
*/
! public int nombreNoeuds();
! public GrPolygone polygone(int i);
/**
--- 29,36 ----
* @return Le nombre de points
*/
! public int getNombreNoeuds();
! public boolean polygone(int i,GrPolygone _poly);
/**
***************
*** 38,69 ****
* @return le noeud i du maillage
*/
! public GrPoint point(int i);
/**
* Le domaine du maillage
*/
! public GrBoite domaine();
/**
* @return Le nombre d'elements composants le contours
*/
! public int nombreAretesContours();
/**
! * @param i le numero d'arete
! * @return Le nombre d'elements support pour l'arete i
*/
! public int nombreElementsArete(int i);
! /**
! * L'element support j de l'arete i
! *
! * @param i le numero d'arete
! * @param j le numero de l'element support
! * @return le polygone de l'element support j de l'arete i
! */
! public GrPolygone aretesContours(int i, int j);
}
--- 38,62 ----
* @return le noeud i du maillage
*/
! public boolean point(int i,GrPoint _p);
/**
* Le domaine du maillage
*/
! public GrBoite getDomaine();
/**
* @return Le nombre d'elements composants le contours
*/
! public int getNombreBord();
/**
! * @param i le numero du bord
! * @return Le nombre de points support pour l'arete i
*/
! public int getNombrePointPourBord(int i);
! public boolean getBordPoint(int _indexBord, int _indexPoint,GrPoint _p);
}
Index: ZModeleStatiqueMaillageElement.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleStatiqueMaillageElement.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZModeleStatiqueMaillageElement.java 30 Jan 2003 10:56:50 -0000 1.1
--- ZModeleStatiqueMaillageElement.java 4 Jul 2003 14:32:48 -0000 1.2
***************
*** 10,13 ****
--- 10,15 ----
package org.fudaa.ebli.calque;
+ import java.util.ArrayList;
+
import org.fudaa.ebli.geometrie.*;
***************
*** 18,95 ****
* @author Fred Deniger
*/
! public class ZModeleStatiqueMaillageElement
! implements ZModeleMaillageElement
{
private GrMaillageElement maillage_;
private GrNoeud[] noeuds_;
- private GrElement[][] aretes_;
private int nbNoeuds_;
! private int nbAretes_;
! private GrBoite domaine_;
public ZModeleStatiqueMaillageElement(GrMaillageElement _maillage)
{
! maillage_ =_maillage;
! domaine_=null;
! nbNoeuds_=-1;
! nbAretes_=-1;
}
!
! public int nombrePolygones()
{
! return maillage_.getNombre();
}
!
! public int nombreNoeuds()
{
! if(nbNoeuds_<0)
{
! if(noeuds_==null) noeuds_=maillage_.noeuds();
! nbNoeuds_=noeuds_.length;
}
return nbNoeuds_;
}
!
! public GrPolygone polygone(int i)
{
! return maillage_.element(i).polygone();
}
!
! public GrPoint point(int i)
{
! if(noeuds_==null)
! noeuds_=maillage_.noeuds();
! return noeuds_[i].point;
}
!
! public int nombreAretesContours()
{
! if(nbAretes_<0)
! {
! if(aretes_==null) aretes_=maillage_.aretesContours();
! nbAretes_=aretes_.length;
! }
! return nbAretes_;
}
!
! public int nombreElementsArete(int i)
{
! if(aretes_==null) aretes_=maillage_.aretesContours();
! return aretes_[i].length;
}
!
! public GrPolygone aretesContours(int i,int j)
{
! if(aretes_==null) aretes_=maillage_.aretesContours();
! return aretes_[i][j].polygone();
}
!
! public GrBoite domaine()
{
! GrBoite r=new GrBoite();
! if(noeuds_==null)
! noeuds_=maillage_.noeuds();
! for(int i=nombreNoeuds()-1;i>=0;i--) r.ajuste(noeuds_[i].point);
! return r;
}
}
--- 20,171 ----
* @author Fred Deniger
*/
! public class ZModeleStatiqueMaillageElement implements ZModeleMaillageElement
{
private GrMaillageElement maillage_;
private GrNoeud[] noeuds_;
private int nbNoeuds_;
! private GrBoite domaine_;
! GrPoint[][] pointsBords_;
public ZModeleStatiqueMaillageElement(GrMaillageElement _maillage)
{
! maillage_ = _maillage;
! domaine_ = null;
! nbNoeuds_ = -1;
! computeBord();
}
!
! private void computeBord()
{
! GrElement[][] aretes_ = maillage_.aretesContours();
! pointsBords_=new GrPoint[aretes_.length][];
! ArrayList l=new ArrayList(aretes_[0].length);
! int n=aretes_.length;
! for(int i=0;i<n;i++)
! {
! GrElement[] ele=aretes_[i];
! int nele=ele.length;
! for(int j=0;j<nele;j++)
! {
! GrNoeud[] pts=ele[j].noeuds;
! int nPoint=pts.length;
! for (int k = 0; k < nPoint; k++)
! {
! l.add(pts[k]);
! }
! }
! pointsBords_[i]=new GrPoint[l.size()];
! l.toArray(pointsBords_[i]);
! l.clear();
! }
}
!
! public int getNombreNoeuds()
{
! if (nbNoeuds_ < 0)
{
! if (noeuds_ == null)
! noeuds_ = maillage_.noeuds();
! nbNoeuds_ = noeuds_.length;
}
return nbNoeuds_;
}
!
! public int nombreAretesContours()
{
! return pointsBords_.length;
}
!
!
! /**
! *
! */
! public boolean getBordPoint(int _indexBord, int _indexPoint, GrPoint _p)
{
! GrPoint p=pointsBords_[_indexBord][_indexPoint];
! _p.initialise(p);
! return true;
}
!
! /**
! *
! */
! public GrBoite getDomaine()
{
! GrBoite r = new GrBoite();
! if (noeuds_ == null)
! noeuds_ = maillage_.noeuds();
! for (int i = getNombreNoeuds() - 1; i >= 0; i--)
! r.ajuste(noeuds_[i].point);
! return r;
}
!
! /**
! *
! */
! public int getNombreBord()
{
! return pointsBords_.length;
}
!
! /**
! *
! */
! public int getNombrePointPourBord(int i)
{
! if ((i >= 0) && (i < pointsBords_.length))
! return pointsBords_[i].length;
! else
! return 0;
}
!
! /**
! *
! */
! public int getNombrePolygones()
{
! return maillage_.getNombre();
! }
!
! /**
! *
! */
! public boolean point(int i, GrPoint _p)
! {
! GrPoint p=maillage_.noeud(i).point;
! _p.x=p.x;
! _p.y=p.y;
! _p.z=p.z;
! return true;
}
+
+ /**
+ *
+ */
+ public boolean polygone(int _i, GrPolygone _poly)
+ {
+ GrPolygone p=maillage_.element(_i).polygone();
+ int n=p.nombre();
+ if(_poly.sommets.nombre()!=n)
+ {
+ _poly.sommets=new VecteurGrPoint(p.nombre());
+ }
+
+ for(int i=n-1;i>=0;i--)
+ {
+ GrPoint pt=_poly.sommet(i);
+ if(pt!=null)
+ {
+ pt.initialise(p.sommet(i));
+ }
+ else
+ {
+ pt=new GrPoint(p.sommet(i));
+ _poly.sommets.remplace(pt, i);
+ }
+ }
+
+ return false;
+ }
+
}
|
|
From: <de...@us...> - 2003-07-04 14:32:52
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/graphe
In directory sc8-pr-cvs1:/tmp/cvs-serv930/graphe
Modified Files:
Graphe.java
Log Message:
ZCalqueLongPolygone : permet de dessiner des polygones qui seraient long.
EnhancedDialog dialogue pouvant etre ferme avec la touche esc
Index: Graphe.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/graphe/Graphe.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Graphe.java 18 Mar 2003 16:17:40 -0000 1.3
--- Graphe.java 4 Jul 2003 14:32:48 -0000 1.4
***************
*** 225,230 ****
Contrainte c=(Contrainte)o;
Axe aay=null;
! if( ay.isEmpty() ) aay=new Axe();
! else aay=(Axe)ay.get(c.axe);
c.dessine(g2d,x+marges.gauche,y+marges.haut,
w-marges.gauche-marges.droite,
--- 225,236 ----
Contrainte c=(Contrainte)o;
Axe aay=null;
! if( ay.isEmpty() )
! {
! aay=new Axe();
!
! }
! else {
! aay=(Axe)ay.get(c.axe);
! }
c.dessine(g2d,x+marges.gauche,y+marges.haut,
w-marges.gauche-marges.droite,
|
|
From: <de...@us...> - 2003-07-04 14:32:52
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/geometrie
In directory sc8-pr-cvs1:/tmp/cvs-serv930/geometrie
Modified Files:
GrPoint.java
Log Message:
ZCalqueLongPolygone : permet de dessiner des polygones qui seraient long.
EnhancedDialog dialogue pouvant etre ferme avec la touche esc
Index: GrPoint.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/geometrie/GrPoint.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** GrPoint.java 18 Mar 2003 16:14:15 -0000 1.2
--- GrPoint.java 4 Jul 2003 14:32:48 -0000 1.3
***************
*** 28,31 ****
--- 28,36 ----
{
}
+
+ public GrPoint(GrPoint _p)
+ {
+ initialise(_p);
+ }
public GrPoint(double _x, double _y, double _z)
***************
*** 41,44 ****
--- 46,54 ----
if (_c.length>1) y=_c[1];
if (_c.length>2) z=_c[2];
+ }
+
+ public final void initialise(GrPoint _p)
+ {
+ x=_p.x;y=_p.y;z=_p.z;
}
|
|
From: <de...@us...> - 2003-07-04 14:26:47
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test In directory sc8-pr-cvs1:/tmp/cvs-serv31714/test Modified Files: FortranReaderTest.java TestCMatriceComplexe.java TestCPoint.java TestCSurfaceComposee.java TestEdamoxWriter.java TestHydraulique1dLido.java TestIO.java TestServeur.java TestStructure.java Log Message: Maj import Index: FortranReaderTest.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/FortranReaderTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FortranReaderTest.java 21 Feb 2003 16:24:14 -0000 1.1 --- FortranReaderTest.java 4 Jul 2003 14:26:45 -0000 1.2 *************** *** 10,15 **** package org.fudaa.dodico.test; ! import java.io.*; ! import java.util.*; import org.fudaa.dodico.fortran.FortranReader; --- 10,15 ---- package org.fudaa.dodico.test; ! import java.io.File; ! import java.io.FileReader; import org.fudaa.dodico.fortran.FortranReader; Index: TestCMatriceComplexe.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestCMatriceComplexe.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestCMatriceComplexe.java 18 Mar 2003 15:36:08 -0000 1.3 --- TestCMatriceComplexe.java 4 Jul 2003 14:26:45 -0000 1.4 *************** *** 10,17 **** package org.fudaa.dodico.test; ! import org.fudaa.dodico.corba.objet.*; ! import org.fudaa.dodico.objet.*; ! import org.fudaa.dodico.corba.mathematiques.*; ! import org.fudaa.dodico.mathematiques.*; /** --- 10,18 ---- package org.fudaa.dodico.test; ! import org.fudaa.dodico.corba.mathematiques.IMatriceComplexe; ! import org.fudaa.dodico.corba.mathematiques.IMatriceComplexeHelper; ! import org.fudaa.dodico.corba.mathematiques.SComplexe; ! import org.fudaa.dodico.mathematiques.CMathComplexe; ! import org.fudaa.dodico.mathematiques.DMatriceComplexe; /** Index: TestCPoint.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestCPoint.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestCPoint.java 18 Mar 2003 15:36:08 -0000 1.3 --- TestCPoint.java 4 Jul 2003 14:26:45 -0000 1.4 *************** *** 10,16 **** package org.fudaa.dodico.test; ! import org.fudaa.dodico.objet.*; ! import org.fudaa.dodico.corba.geometrie.*; ! import org.fudaa.dodico.geometrie.*; /** --- 10,17 ---- package org.fudaa.dodico.test; ! import org.fudaa.dodico.corba.geometrie.IPoint; ! import org.fudaa.dodico.corba.geometrie.IPointHelper; ! import org.fudaa.dodico.geometrie.DPoint; ! import org.fudaa.dodico.objet.CDodico; /** Index: TestCSurfaceComposee.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestCSurfaceComposee.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestCSurfaceComposee.java 18 Mar 2003 15:36:03 -0000 1.2 --- TestCSurfaceComposee.java 4 Jul 2003 14:26:45 -0000 1.3 *************** *** 10,17 **** package org.fudaa.dodico.test; ! import org.fudaa.dodico.objet.*; ! import org.fudaa.dodico.corba.geometrie.*; ! import org.fudaa.dodico.geometrie.*; ! import org.fudaa.dodico.collection.*; /** --- 10,20 ---- package org.fudaa.dodico.test; ! import org.fudaa.dodico.corba.geometrie.IPoint; ! import org.fudaa.dodico.corba.geometrie.IPointHelper; ! import org.fudaa.dodico.corba.geometrie.ISurfaceComposee; ! import org.fudaa.dodico.corba.geometrie.ISurfaceComposeeHelper; ! import org.fudaa.dodico.corba.geometrie.ITriangle; ! import org.fudaa.dodico.geometrie.DPoint; ! import org.fudaa.dodico.geometrie.DSurfaceComposee; /** Index: TestEdamoxWriter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestEdamoxWriter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestEdamoxWriter.java 18 Mar 2003 15:36:02 -0000 1.2 --- TestEdamoxWriter.java 4 Jul 2003 14:26:45 -0000 1.3 *************** *** 10,17 **** package org.fudaa.dodico.test; ! import java.io.*; ! import java.util.*; ! import org.fudaa.dodico.mascaret.*; ! import org.fudaa.dodico.corba.mascaret.*; /** --- 10,14 ---- package org.fudaa.dodico.test; ! import org.fudaa.dodico.mascaret.EdamoxWriter; /** Index: TestHydraulique1dLido.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestHydraulique1dLido.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestHydraulique1dLido.java 18 Mar 2003 15:36:04 -0000 1.2 --- TestHydraulique1dLido.java 4 Jul 2003 14:26:45 -0000 1.3 *************** *** 11,14 **** --- 11,15 ---- import org.fudaa.dodico.objet.*; + import org.fudaa.dodico.usine.UsineHelper; import org.fudaa.dodico.hydraulique1d.*; import org.fudaa.dodico.corba.hydraulique1d.*; *************** *** 34,38 **** System.out.println("Creation de la connexion"); ! IUsine usine=CDodico.creeUsineLocale(); ServeurPersonne sp=new ServeurPersonne("test-personne-lido", "test-organisme-lido"); --- 35,39 ---- System.out.println("Creation de la connexion"); ! IUsine usine=UsineHelper.creeUsineLocale(); ServeurPersonne sp=new ServeurPersonne("test-personne-lido", "test-organisme-lido"); Index: TestIO.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestIO.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestIO.java 19 May 2003 13:54:02 -0000 1.3 --- TestIO.java 4 Jul 2003 14:26:45 -0000 1.4 *************** *** 15,20 **** import junit.framework.TestCase; ! import org.fudaa.dodico.h2d.H2dFileFormat; ! import org.fudaa.dodico.h2d.H2dFileReadView; /** --- 15,20 ---- import junit.framework.TestCase; ! import org.fudaa.dodico.fichiers.FileFormat; ! import org.fudaa.dodico.fichiers.FileOperationSynthese; /** *************** *** 28,67 **** protected double eps_; protected File fic_; - protected H2dFileFormat format_; - protected H2dFileReadView readResult_; ! public TestIO(String _fic, H2dFileFormat _tr) { eps_ = 1E-15; ! format_=_tr; ! fic_=getFile(_fic); assertNotNull(fic_); - readResult_= lecture(fic_); } - protected final synchronized H2dFileReadView lecture(File _f) - { - assertNotNull(_f); - H2dFileReadView r=format_.read(_f, null); - return r; - } - - public abstract void _interfaceTest(H2dFileReadView _r); - - public void testLecture() - { - assertNotNull(readResult_); - System.out.println("test"); - _interfaceTest(readResult_); - } ! public void testEcriture() { ! File tFile = null; try { ! tFile = File.createTempFile("fudaa", ".test"); } catch (IOException e) --- 28,50 ---- protected double eps_; protected File fic_; ! public TestIO(String _fic) { eps_ = 1E-15; ! fic_ = getFile(_fic); assertNotNull(fic_); } ! public abstract void testLecture(); ! ! public File createTempFile() { ! File f = null; try { ! f = File.createTempFile("fudaa", ".test"); } catch (IOException e) *************** *** 69,78 **** e.printStackTrace(); } ! assertNotNull(tFile); ! tFile.deleteOnExit(); ! assertNotNull(readResult_.getSource()); ! format_.write(tFile, readResult_.getSource(), null); ! _interfaceTest(lecture(tFile)); } protected final File getFile(String _f) --- 52,59 ---- e.printStackTrace(); } ! return f; } + + public abstract void testEcriture(); protected final File getFile(String _f) Index: TestServeur.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestServeur.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestServeur.java 18 Mar 2003 15:36:07 -0000 1.2 --- TestServeur.java 4 Jul 2003 14:26:45 -0000 1.3 *************** *** 11,14 **** --- 11,15 ---- import org.fudaa.dodico.objet.CDodico; + import org.fudaa.dodico.usine.UsineHelper; import org.fudaa.dodico.corba.usine.IUsine; import org.fudaa.dodico.corba.hydraulique1d.*; *************** *** 25,48 **** public static void main(String [] args) { ! /* IUsine usine=CDodico.creeUsineLocale(); ICalculHydraulique1d t=usine.creeHydraulique1dCalculHydraulique1d(); ! ITache vag=usine.creeVagCalculVag(); ! ILoiHydraulique d1=usine.creeHydraulique1dLoiHydraulique(); ! ILoiHydraulique d2=usine.creeHydraulique1dLoiHydraulique(); ! System.out.println(System.getProperty("java.version")); ! if(d1.equals(d2)) ! System.out.println("pas ok pour equals"); ! else ! System.out.println("ok pour equals"); ! ! ! if( t instanceof ICalcul) ! System.out.println("C'est un ICalcul"); ! else ! System.out.println("CE N'EST PAS un ICalcul"); ! if( vag instanceof ICalcul) ! System.out.println("VAG: ICalcul"); ! else ! System.out.println("VAG: N'EST PAS un ICalcul"); */ } } --- 26,52 ---- public static void main(String [] args) { ! long t1=System.currentTimeMillis(); ! IUsine usine=UsineHelper.creeUsineLocale(); ICalculHydraulique1d t=usine.creeHydraulique1dCalculHydraulique1d(); ! long t2=System.currentTimeMillis(); ! System.out.println("time "+(t2-t1)); ! // ITache vag=usine.creeVagCalculVag(); ! // ILoiHydraulique d1=usine.creeHydraulique1dLoiHydraulique(); ! // ILoiHydraulique d2=usine.creeHydraulique1dLoiHydraulique(); ! // System.out.println(System.getProperty("java.version")); ! // if(d1.equals(d2)) ! // System.out.println("pas ok pour equals"); ! // else ! // System.out.println("ok pour equals"); ! // ! // ! // if( t instanceof ICalcul) ! // System.out.println("C'est un ICalcul"); ! // else ! // System.out.println("CE N'EST PAS un ICalcul"); ! // if( vag instanceof ICalcul) ! // System.out.println("VAG: ICalcul"); ! // else ! // System.out.println("VAG: N'EST PAS un ICalcul"); */ } } Index: TestStructure.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestStructure.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestStructure.java 18 Mar 2003 14:05:20 -0000 1.2 --- TestStructure.java 4 Jul 2003 14:26:45 -0000 1.3 *************** *** 10,15 **** --- 10,28 ---- package org.fudaa.dodico.test; + import gnu.trove.TDoubleArrayList; + import gnu.trove.TDoubleDoubleHashMap; + import gnu.trove.TIntArrayList; + + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collections; + import java.util.HashSet; + import java.util.TreeSet; + import org.fudaa.dodico.corba.geometrie.*; + import org.fudaa.dodico.corba.oscar.VALEUR_NULLE; import org.fudaa.dodico.corba.usine.*; + + import org.fudaa.dodico.h2d.H2dTempsValeur; import org.fudaa.dodico.objet.*; /** *************** *** 19,53 **** public class TestStructure { ! SPoint[] sPts; ! int[][] poly_; ! public TestStructure(int N) { ! sPts=new SPoint[3*N]; ! poly_=new int[N][3]; ! for(int i=0;i<N;i++) { ! sPts[3*i]=new SPoint(); ! sPts[3*i].x=i; ! sPts[3*i].y=i; ! sPts[3*i].z=i; ! sPts[3*i+1]=new SPoint(); ! sPts[3*i+1].x=i; ! sPts[3*i+1].y=i; ! sPts[3*i+1].z=i; ! sPts[3*i+2]=new SPoint(); ! sPts[3*i+2].x=i; ! sPts[3*i+2].y=i; ! sPts[3*i+2].z=i; ! poly_[i][0]=3*i; ! poly_[i][1]=3*i+1; ! poly_[i][2]=3*i+2; } } ! public static void main(String [] args) { ! new TestStructure(10000); } } - - --- 32,149 ---- public class TestStructure { ! // SPoint[] sPts; ! // int[][] poly_; ! ObjetApproch obj_; ! ArrayApproch arr_; ! ArrayApproch2 arr2_; ! private class ObjetApproch { ! TreeSet l; ! H2dTempsValeur[] list_; ! public ObjetApproch(int n) { ! l = new TreeSet(); ! for (int i = n; i-- > 0;) ! { ! H2dTempsValeur tmp = new H2dTempsValeur((double) (n - i), (double) i); ! l.add(tmp); ! list_ = new H2dTempsValeur[l.size()]; ! l.toArray(list_); ! } ! ! } ! }; ! ! private class ArrayApproch ! { ! // TDoubleDoubleHashMap map_; ! TDoubleArrayList list_; ! TDoubleArrayList listV_; ! ! public ArrayApproch(int n) ! { ! list_ = new TDoubleArrayList(n); ! listV_ = new TDoubleArrayList(n); ! for (int i = n; i-- > 0;) ! { ! double t = (double) (n-i); ! double v = (double) i; ! if (list_.size() == 0) ! { ! list_.add(t); ! list_.add(v); ! } ! else ! { ! ! int k = list_.binarySearch(t); ! if (k < 0) ! { ! k = -k; ! if (k >= (list_.size()-1)) ! { ! list_.add(t); ! listV_.add(v); ! } ! else ! { ! list_.insert(k, t); ! listV_.insert(k, v); ! } ! } ! } ! ! } } + }; + + private class ArrayApproch2 + { + TDoubleDoubleHashMap map_; + TDoubleArrayList list_; + + public ArrayApproch2(int n) + { + map_ = new TDoubleDoubleHashMap(n); + for (int i = n; i-- > 0;) + { + double t = (double) (n-i); + double v = (double) i; + map_.put(t, v); + } + list_=new TDoubleArrayList(map_.size()); + list_.sort(); + } + }; + + public TestStructure(int N) + { + long t1 = System.currentTimeMillis(); + + obj_ = new ObjetApproch(10); + long t2 = System.currentTimeMillis(); + // arr_ = new ArrayApproch(N); + long t3 = System.currentTimeMillis(); + arr2_ = new ArrayApproch2(N); + long t4 = System.currentTimeMillis(); + System.out.println("object " + (t2 - t1)); + System.out.println("array " + (t3 - t2)); + System.out.println("array 2" + (t4 - t3)); + } ! public static void main(String[] args) { ! TestStructure test = new TestStructure(50000); ! ObjetApproch a = test.obj_; ! ArrayApproch b = test.arr_; ! ArrayApproch2 b2 = test.arr2_; ! System.out.println("FIN"); ! while (true) ! { ! a = test.obj_; ! b = test.arr_; ! b2=test.arr2_; ! } } } |
|
From: <de...@us...> - 2003-07-04 14:26:47
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv31714/telemac
Modified Files:
TelemacDicoManager.java
Log Message:
Maj import
Index: TelemacDicoManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TelemacDicoManager.java 19 May 2003 13:54:01 -0000 1.2
--- TelemacDicoManager.java 4 Jul 2003 14:26:45 -0000 1.3
***************
*** 9,15 ****
package org.fudaa.dodico.telemac;
! import org.fudaa.dodico.dico.DicoModelAbstract;
! import org.fudaa.dodico.telemac.dico.TelemacDicov5p2;
/**
--- 9,36 ----
package org.fudaa.dodico.telemac;
! import java.io.File;
! import java.io.FileFilter;
! import java.util.ArrayList;
! import java.util.HashMap;
! import java.util.HashSet;
+ import org.fudaa.dodico.commun.DodicoLib;
+ import org.fudaa.dodico.commun.DodicoPermanentList;
+ import org.fudaa.dodico.dico.DicoCasAbstract;
+ import org.fudaa.dodico.dico.DicoCasFileFormat;
+ import org.fudaa.dodico.dico.DicoLanguage;
+ import org.fudaa.dodico.dico.DicoManager;
+ import org.fudaa.dodico.dico.DicoModelAbstract;
+ import org.fudaa.dodico.dico.DicoManager.DicoDescription;
+ import org.fudaa.dodico.telemac.dico.DicoArtemisv5p3;
+ import org.fudaa.dodico.telemac.dico.DicoEstel2dv5p3;
+ import org.fudaa.dodico.telemac.dico.DicoEstel3dv5p3;
+ import org.fudaa.dodico.telemac.dico.DicoPostel3dv5p3;
+ import org.fudaa.dodico.telemac.dico.DicoSisyphev5p3;
+ import org.fudaa.dodico.telemac.dico.DicoStbtelv5p3;
+ import org.fudaa.dodico.telemac.dico.DicoSubief2dv5p3;
+ import org.fudaa.dodico.telemac.dico.DicoTelemac2dv5p3;
+ import org.fudaa.dodico.telemac.dico.DicoTelemac3dv5p3;
+ import org.fudaa.dodico.telemac.dico.DicoTomawacv5p3;
/**
***************
*** 17,26 ****
* @version $Id$
*/
! public class TelemacDicoManager
{
! protected DicoModelAbstract[] defautDicos_;
!
! private final static TelemacDicoManager INSTANCE=new TelemacDicoManager();
!
public final static TelemacDicoManager getINSTANCE()
{
--- 38,47 ----
* @version $Id$
*/
! public class TelemacDicoManager extends DicoManager
{
!
! private final static TelemacDicoManager INSTANCE = new TelemacDicoManager();
! private final static DicoModelAbstract Telemac2dv5p3=new DicoTelemac2dv5p3();
!
public final static TelemacDicoManager getINSTANCE()
{
***************
*** 28,40 ****
}
protected TelemacDicoManager()
{
! defautDicos_=new DicoModelAbstract[1];
! defautDicos_[0]=new TelemacDicov5p2();
}
!
! public final DicoModelAbstract getDefaut()
{
! return defautDicos_[0];
}
--- 49,107 ----
}
+
+
protected TelemacDicoManager()
{
! super(
! new DicoManager.DicoDescription[] {
! new DicoManager.DicoDescription("artemis","v5p3"),
! new DicoManager.DicoDescription("estel","2dv5p3"),
! new DicoManager.DicoDescription("estel","3dv5p3"),
! new DicoManager.DicoDescription("postel3d","v5p3"),
! new DicoManager.DicoDescription("sisyphe","v5p3"),
! new DicoManager.DicoDescription("stbtel","v5p3"),
! new DicoManager.DicoDescription("subief2d","v5p3"),
! new DicoManager.DicoDescription("telemac2d","v5p3"),
! new DicoManager.DicoDescription("telemac3d","v5p3"),
! new DicoManager.DicoDescription("tomawac","v5p3"),
! },
! "org.fudaa.dodico.telemac.dico.");
}
!
!
! public static void main(String[] args)
{
! System.out.println(TelemacDicoManager.INSTANCE.getLastVersion("telemac2d"));
! System.out.println(TelemacDicoManager.INSTANCE.getLastVersion("telemac2d",DicoLanguage.ENGLISH_ID));
! }
!
! /**
! *
! */
! public DicoModelAbstract createDico(DicoDescription _desc, int _language)
! {
! if( (_desc.getName().equals(Telemac2dv5p3.getCodeName()))
! && (_desc.getVersion().equals(Telemac2dv5p3.getVersion()))
! && (_language==Telemac2dv5p3.getLanguageIndex()))
! {
! return Telemac2dv5p3;
! }
!
! return super.createDico(_desc, _language);
! }
!
! /**
! *
! */
! public DicoModelAbstract createDico(DicoDescription _desc)
! {
! if( (_desc.getName().equals(Telemac2dv5p3.getCodeName()))
! && (_desc.getVersion().equals(Telemac2dv5p3.getVersion()))
! && (DicoLanguage.getCurrentID()==Telemac2dv5p3.getLanguageIndex()))
! {
! return Telemac2dv5p3;
! }
!
! return super.createDico(_desc);
}
|
|
From: <de...@us...> - 2003-07-04 14:22:44
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv31279/reflux
Modified Files:
TestCorEleBth.java TestDunes.java TestINP.java
Log Message:
Maj des test pour H2d
Index: TestCorEleBth.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestCorEleBth.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TestCorEleBth.java 19 May 2003 13:54:02 -0000 1.4
--- TestCorEleBth.java 4 Jul 2003 14:22:41 -0000 1.5
***************
*** 10,16 ****
import java.io.File;
- import java.io.FileReader;
- import java.io.FileWriter;
- import java.io.IOException;
import java.util.HashMap;
--- 10,13 ----
***************
*** 21,24 ****
--- 18,26 ----
import org.fudaa.dodico.corba.geometrie.SMaillageIndex;
import org.fudaa.dodico.corba.geometrie.SPoint;
+ import org.fudaa.dodico.fichiers.FileFormat;
+ import org.fudaa.dodico.fichiers.FileOperationSynthese;
+ import org.fudaa.dodico.h2d.H2dElement;
+ import org.fudaa.dodico.h2d.H2dMaillage;
+ import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.reflux.io.CorEleBthFileFormat;
import org.fudaa.dodico.reflux.io.CorEleBthInterface;
***************
*** 26,30 ****
import org.fudaa.dodico.reflux.io.CorEleBthWriter;
import org.fudaa.dodico.test.TestIO;
- import org.fudaa.dodico.h2d.H2dFileReadView;
/**
--- 28,31 ----
***************
*** 35,105 ****
public class TestCorEleBth extends TestIO
{
!
public TestCorEleBth()
{
! super("corelebth.cor",CorEleBthFileFormat.getInstance());
!
}
!
! public void _interfaceTest(H2dFileReadView _t)
{
! assertNotNull(_t);
! assertTrue(_t.getAnalyzes()[0].isEmpty());
! assertTrue(_t.getAnalyzes()[1].isEmpty());
! assertTrue(_t.getAnalyzes()[2].isEmpty());
! assertTrue(_t.getSource() instanceof CorEleBthInterface);
! CorEleBthInterface t=(CorEleBthInterface)_t.getSource();
! SMaillageIndex maill = t.getMaillage();
assertNotNull(maill);
! assertEquals(maill.typeElement, LTypeElement.T6);
! SPoint[] pts = maill.points;
! assertEquals(pts.length, 1791);
//test sur le point 34
! double d = 15.1515007;
! double dLu = pts[33].x;
assertEquals(d, dLu, eps_);
! d = 7.5;
! dLu = pts[33].y;
assertEquals(d, dLu, eps_);
! d = 14.954545975;
! dLu = pts[33].z;
assertEquals(d, dLu, eps_);
//test sur le point 1791
! d = 1000;
! dLu = pts[1790].x;
assertEquals(d, dLu, eps_);
! d = 10;
! dLu = pts[1790].y;
assertEquals(d, dLu, eps_);
! d = 12;
! dLu = pts[1790].z;
assertEquals(d, dLu, eps_);
//test sur l'element 33
! int[] elems = maill.elements[33];
! assertEquals(maill.elements.length, 792);
assertEquals(elems.length, 6);
! int i = 306;
! int iLu = elems[0];
assertEquals(i, iLu);
! i = 307;
! iLu = elems[1];
assertEquals(i, iLu);
! i = 308;
! iLu = elems[2];
assertEquals(i, iLu);
! i = 298;
! iLu = elems[3];
assertEquals(i, iLu);
! i = 288;
! iLu = elems[4];
assertEquals(i, iLu);
! i = 297;
! iLu = elems[5];
assertEquals(i, iLu);
}
-
-
public static void printAnalyze(String _titre, DodicoAnalyze _analyze)
{
--- 36,99 ----
public class TestCorEleBth extends TestIO
{
!
public TestCorEleBth()
{
! super("corelebth.cor");
}
! public void _interfaceTest(
! CorEleBthInterface _inter)
{
! assertNotNull(_inter);
! CorEleBthInterface t= _inter;
! H2dMaillage maill= t.getMaillage();
assertNotNull(maill);
! assertEquals(maill.getEltType(), H2dElement.T6);
! //H2dPoint[] pts= maill.getPts();
! assertEquals(maill.getPtsNb(), 1791);
//test sur le point 34
! double d= 15.1515007;
! double dLu= maill.getPt(33).getX();
assertEquals(d, dLu, eps_);
! d= 7.5;
! dLu= maill.getPt(33).getY();
assertEquals(d, dLu, eps_);
! d= 14.954545975;
! dLu= maill.getPt(33).getZ();
assertEquals(d, dLu, eps_);
//test sur le point 1791
! d= 1000;
! dLu= maill.getPt(1790).getX();
assertEquals(d, dLu, eps_);
! d= 10;
! dLu= maill.getPt(1790).getY();
assertEquals(d, dLu, eps_);
! d= 12;
! dLu= maill.getPt(1790).getZ();
assertEquals(d, dLu, eps_);
//test sur l'element 33
! int[] elems= maill.getElts()[33].getPtIndex();
! assertEquals(maill.getEltNb(), 792);
assertEquals(elems.length, 6);
! int i= 306;
! int iLu= elems[0];
assertEquals(i, iLu);
! i= 307;
! iLu= elems[1];
assertEquals(i, iLu);
! i= 308;
! iLu= elems[2];
assertEquals(i, iLu);
! i= 298;
! iLu= elems[3];
assertEquals(i, iLu);
! i= 288;
! iLu= elems[4];
assertEquals(i, iLu);
! i= 297;
! iLu= elems[5];
assertEquals(i, iLu);
}
public static void printAnalyze(String _titre, DodicoAnalyze _analyze)
{
***************
*** 113,120 ****
public static void main(String[] args)
{
! HashMap arg = DodicoLib.parseArgs(args);
! String fileName = (String) arg.get("-f");
if (fileName == null)
! fileName = (String) arg.get("-file");
if (fileName == null)
{
--- 107,114 ----
public static void main(String[] args)
{
! HashMap arg= DodicoLib.parseArgs(args);
! String fileName= (String) arg.get("-f");
if (fileName == null)
! fileName= (String) arg.get("-file");
if (fileName == null)
{
***************
*** 122,126 ****
return;
}
! File f = new File(fileName);
if (!f.exists())
{
--- 116,120 ----
return;
}
! File f= new File(fileName);
if (!f.exists())
{
***************
*** 128,133 ****
return;
}
! String base = f.getAbsolutePath();
! int temp = base.lastIndexOf('.');
if (temp < 0)
{
--- 122,127 ----
return;
}
! String base= f.getAbsolutePath();
! int temp= base.lastIndexOf('.');
if (temp < 0)
{
***************
*** 135,140 ****
return;
}
! base = base.substring(0, temp);
! File cor = new File(base + ".cor");
if (!cor.exists())
{
--- 129,134 ----
return;
}
! base= base.substring(0, temp);
! File cor= new File(base + ".cor");
if (!cor.exists())
{
***************
*** 143,147 ****
return;
}
! File ele = new File(base + ".ele");
if (!cor.exists())
{
--- 137,141 ----
return;
}
! File ele= new File(base + ".ele");
if (!cor.exists())
{
***************
*** 150,154 ****
return;
}
! File bth = new File(base + ".bth");
if (!cor.exists())
{
--- 144,148 ----
return;
}
! File bth= new File(base + ".bth");
if (!cor.exists())
{
***************
*** 157,197 ****
return;
}
! CorEleBthReader reader = null;
! CorEleBthInterface t = null;
! try
! {
! reader = new CorEleBthReader(CorEleBthFileFormat.getInstance());
! reader.setIn(
! new FileReader(cor),
! new FileReader(ele),
! new FileReader(bth));
! reader.setProgressReceiver(new ProgressionBuAdapter(null));
! reader.read();
! DodicoAnalyze[] analyses = reader.getAnalyzes();
! printAnalyze("FICHIER cor", analyses[0]);
! printAnalyze("FICHIER ele", analyses[1]);
! printAnalyze("FICHIER bth", analyses[2]);
! SMaillageIndex mail = reader.getMaillage();
! t = reader.getCorEleBthInterface();
! if (mail != null)
! {
! DodicoLib.printFields(mail, false);
! }
! }
! catch (IOException _e)
! {
! _e.printStackTrace();
! }
! finally
{
!
! if (reader != null)
! {
! IOException[] exs = reader.close();
! if (exs != null)
! System.err.println("probleme severe impossible de fermer le flux");
!
! }
!
}
if (t == null)
--- 151,167 ----
return;
}
! CorEleBthReader reader= null;
! CorEleBthInterface t= null;
! reader= new CorEleBthReader(CorEleBthFileFormat.getInstance());
! reader.setIn(cor, ele, bth);
! reader.setProgressReceiver(new ProgressionBuAdapter(null));
! FileOperationSynthese op= new FileOperationSynthese();
! t= reader.read(op);
! DodicoAnalyze analyse= op.getAnalyze();
! printAnalyze("FICHIERS cor,ele,bth", analyse);
! H2dMaillage mail= t.getMaillage();
! if (mail != null)
{
! DodicoLib.printFields(mail, false);
}
if (t == null)
***************
*** 199,206 ****
System.out.println("probl de lecture");
}
! String out = (String) arg.get("-out");
if (out == null)
return;
! File corOut = new File(out + ".cor");
if (corOut.exists())
{
--- 169,176 ----
System.out.println("probl de lecture");
}
! String out= (String) arg.get("-out");
if (out == null)
return;
! File corOut= new File(out + ".cor");
if (corOut.exists())
{
***************
*** 208,212 ****
return;
}
! File eleOut = new File(out + ".ele");
if (eleOut.exists())
{
--- 178,182 ----
return;
}
! File eleOut= new File(out + ".ele");
if (eleOut.exists())
{
***************
*** 214,218 ****
return;
}
! File bthOut = new File(out + ".bth");
if (bthOut.exists())
{
--- 184,188 ----
return;
}
! File bthOut= new File(out + ".bth");
if (bthOut.exists())
{
***************
*** 220,256 ****
return;
}
! CorEleBthWriter w = null;
! try
! {
! w = new CorEleBthWriter(CorEleBthFileFormat.getInstance());
! w.setOut(
! new FileWriter(corOut),
! new FileWriter(eleOut),
! new FileWriter(bthOut));
! w.setCorEleBthInterface(t);
! w.setProgressReceiver(new ProgressionBuAdapter(null));
! w.write();
! DodicoAnalyze[] analyses = w.getAnalyzes();
! System.out.println("Ecriture");
! printAnalyze("FICHIER cor", analyses[0]);
! printAnalyze("FICHIER ele", analyses[1]);
! printAnalyze("FICHIER bth", analyses[2]);
! }
! catch (IOException e)
! {
! }
! finally
! {
! if (w != null)
! {
! IOException[] exs = w.close();
! if (exs != null)
! {
! System.err.println("Fatal erreur");
! }
! }
}
}
}
--- 190,233 ----
return;
}
! CorEleBthWriter w= null;
! w= new CorEleBthWriter(CorEleBthFileFormat.getInstance());
! w.setFile(corOut, eleOut, bthOut);
! w.setProgressReceiver(new ProgressionBuAdapter(null));
! FileOperationSynthese opW= new FileOperationSynthese();
! w.write(t, opW);
! System.out.println("Ecriture");
! printAnalyze("FICHIER", opW.getAnalyze());
+ }
+
+ /**
+ *
+ */
+ public void testEcriture()
+ {
+ CorEleBthInterface inter=getInter(fic_);
+ File tmpFile=createTempFile();
+ FileOperationSynthese syntheseR=CorEleBthFileFormat.getInstance().write(tmpFile, inter, null);
+ assertNull(syntheseR.getAnalyze());
+ _interfaceTest(getInter(tmpFile));
+
}
+ public CorEleBthInterface getInter(File _f)
+ {
+ FileOperationSynthese syntheseR= new FileOperationSynthese();
+ CorEleBthInterface r=CorEleBthFileFormat.getInstance().read(_f, syntheseR, null);
+ assertNull(syntheseR.getAnalyze());
+ return r;
+ }
+
+ /**
+ *
+ */
+ public void testLecture()
+ {
+ _interfaceTest(getInter(fic_));
+
}
+
}
Index: TestDunes.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestDunes.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TestDunes.java 19 May 2003 13:54:03 -0000 1.5
--- TestDunes.java 4 Jul 2003 14:22:41 -0000 1.6
***************
*** 23,28 ****
import org.fudaa.dodico.dunes.io.DunesReader;
import org.fudaa.dodico.dunes.io.DunesWriter;
import org.fudaa.dodico.test.TestIO;
- import org.fudaa.dodico.h2d.H2dFileReadView;
import com.memoire.bu.BuTask;
--- 23,31 ----
import org.fudaa.dodico.dunes.io.DunesReader;
import org.fudaa.dodico.dunes.io.DunesWriter;
+ import org.fudaa.dodico.fichiers.FileOperationSynthese;
+ import org.fudaa.dodico.h2d.H2dElement;
+ import org.fudaa.dodico.h2d.H2dMaillage;
+ import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.test.TestIO;
import com.memoire.bu.BuTask;
***************
*** 38,50 ****
public TestDunes()
{
! super("mesh.mail",DunesFileFormat.getInstance());
}
! public synchronized void _interfaceTest(H2dFileReadView _t)
{
! assertNotNull(_t);
! assertTrue(_t.getAnalyzes()[0].isEmpty());
! assertTrue(_t.getSource() instanceof DunesInterface);
! DunesInterface t=(DunesInterface)_t.getSource();
double[] adapt = t.getAdaptatifValeur();
int temp = adapt.length;
--- 41,51 ----
public TestDunes()
{
! super("mesh.mail");
}
! public synchronized void _interfaceTest(DunesInterface _inter)
{
! assertNotNull(_inter);
! DunesInterface t=_inter;
double[] adapt = t.getAdaptatifValeur();
int temp = adapt.length;
***************
*** 60,82 ****
assertEquals(adapt[8], 1d, eps_);
assertNotNull(t.getMaillage());
! SPoint[] pts = t.getMaillage().points;
! temp = pts.length;
assertEquals(temp, 9);
! SPoint pt = pts[0];
! assertEquals(pt.x, 0d, eps_);
! assertEquals(pt.y, 0d, eps_);
! assertEquals(pt.z, 0.25, eps_);
! pt = pts[4];
! assertEquals(pt.x, 0d, eps_);
! assertEquals(pt.y, 3d, eps_);
! assertEquals(pt.z, 0.25, eps_);
! pt = pts[8];
! assertEquals(pt.x, 2d, eps_);
! assertEquals(pt.y, 1d, eps_);
! assertEquals(pt.z, 0.1, eps_);
! int[][] elems = t.getMaillage().elements;
temp = elems.length;
assertEquals(temp, 9);
! int[] indices = elems[1];
temp = indices.length;
assertEquals(temp, 3);
--- 61,83 ----
assertEquals(adapt[8], 1d, eps_);
assertNotNull(t.getMaillage());
! H2dMaillage m=t.getMaillage();
! temp = m.getPtsNb();
assertEquals(temp, 9);
! H2dPoint pt = m.getPt(0);
! assertEquals(pt.getX(), 0d, eps_);
! assertEquals(pt.getY(), 0d, eps_);
! assertEquals(pt.getZ(), 0.25, eps_);
! pt =m.getPt(4);
! assertEquals(pt.getX(), 0d, eps_);
! assertEquals(pt.getY(), 3d, eps_);
! assertEquals(pt.getZ(), 0.25, eps_);
! pt = m.getPt(8);
! assertEquals(pt.getX(), 2d, eps_);
! assertEquals(pt.getY(), 1d, eps_);
! assertEquals(pt.getZ(), 0.1, eps_);
! H2dElement[] elems = t.getMaillage().getElts();
temp = elems.length;
assertEquals(temp, 9);
! int[] indices = elems[1].getPtIndex();
temp = indices.length;
assertEquals(temp, 3);
***************
*** 84,88 ****
assertEquals(indices[1], 0);
assertEquals(indices[2], 5);
! indices = elems[6];
temp = indices.length;
assertEquals(temp, 3);
--- 85,89 ----
assertEquals(indices[1], 0);
assertEquals(indices[2], 5);
! indices = elems[6].getPtIndex();
temp = indices.length;
assertEquals(temp, 3);
***************
*** 91,94 ****
--- 92,128 ----
assertEquals(indices[2], 6);
}
+
+ /**
+ *
+ */
+ public void testEcriture()
+ {
+ DunesInterface inter=getInter(fic_);
+ File tmpFile=createTempFile();
+ FileOperationSynthese syntheseR=DunesFileFormat.getInstance().write(tmpFile, inter, null);
+ assertNull(syntheseR.getAnalyze());
+ _interfaceTest(getInter(tmpFile));
+
+ }
+
+ public static DunesInterface getInter(File _f)
+ {
+ FileOperationSynthese syntheseR= new FileOperationSynthese();
+ DunesInterface r=DunesFileFormat.getInstance().read(_f, syntheseR, null);
+ assertNull(syntheseR.getAnalyze());
+ if(syntheseR.containsMessages())
+ syntheseR.getAnalyze().printResume();
+ return r;
+ }
+
+ /**
+ *
+ */
+ public void testLecture()
+ {
+ _interfaceTest(getInter(fic_));
+
+ }
+
***************
*** 111,151 ****
return;
}
- DunesReader r = null;
- DunesInterface inter = null;
ProgressionBuAdapter progress = new ProgressionBuAdapter(new BuTask());
! try
! {
! r = new DunesReader();
! r.setIn(new FileReader(f));
! r.setProgressReceiver(progress);
! r.read();
! inter = r.getDunesInterface();
! DodicoAnalyze infos = r.getAnalyze();
! if(infos!=null) infos.printResume();
!
! if (inter != null)
! {
!
! System.out.println("+ source");
! DodicoLib.printFields(inter, true);
! DodicoLib.printFields(inter.getMaillage(), false);
! }
! else
! System.out.println("Attention Pas de source");
! }
! catch (IOException e)
! {
! e.printStackTrace();
! }
!
! finally
! {
! if (r != null)
! {
! IOException[] exs = r.close();
! if (exs != null)
! System.err.println("Impossible de fermer le flux");
! }
! }
fileName = (String) arg.get("-out");
if (fileName == null)
--- 145,152 ----
return;
}
ProgressionBuAdapter progress = new ProgressionBuAdapter(new BuTask());
! FileOperationSynthese op=new FileOperationSynthese();
! DunesInterface inter = DunesFileFormat.getInstance().read(f, op, progress);
! if(op.containsMessages()) op.getAnalyze().printResume();
fileName = (String) arg.get("-out");
if (fileName == null)
***************
*** 160,185 ****
return;
}
! DunesWriter w = null;
! try
! {
! w = new DunesWriter();
! w.setOut(new FileWriter(out));
! w.setProgressReceiver(progress);
! w.setDunesInterface(inter);
! w.write();
! }
! catch (IOException io)
! {
! io.printStackTrace();
! }
! finally
! {
! if (w != null)
! {
! IOException[] exs = w.close();
! if (exs != null)
! System.err.println("Impossible de fermer le flux");
! }
! }
}
--- 161,166 ----
return;
}
! FileOperationSynthese opw=DunesFileFormat.getInstance().write(out, inter, progress);
! if(opw.containsMessages()) opw.getAnalyze().printResume();
}
Index: TestINP.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestINP.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TestINP.java 19 May 2003 13:54:03 -0000 1.3
--- TestINP.java 4 Jul 2003 14:22:41 -0000 1.4
***************
*** 10,37 ****
import java.io.File;
- import java.io.IOException;
import java.util.HashMap;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionBuAdapter;
! import org.fudaa.dodico.corba.geometrie.SPoint;
! import org.fudaa.dodico.corba.tr.LTrMethodeResolution;
! import org.fudaa.dodico.corba.tr.LTrSchemaResolution;
! import org.fudaa.dodico.corba.tr.LTrTypeBord;
! import org.fudaa.dodico.corba.tr.LTrTypeProjet;
! import org.fudaa.dodico.corba.tr.STrConditionLimite;
! import org.fudaa.dodico.corba.tr.STrGroupeTemps;
! import org.fudaa.dodico.corba.tr.STrProjetH2d;
! import org.fudaa.dodico.corba.tr.STrProprieteElementaire;
! import org.fudaa.dodico.corba.tr.STrProprieteElementaireValeur;
import org.fudaa.dodico.reflux.io.INPFileFormat;
import org.fudaa.dodico.reflux.io.INPInterface;
- import org.fudaa.dodico.reflux.io.INPReader;
import org.fudaa.dodico.test.TestIO;
- import org.fudaa.dodico.h2d.H2dFileReadView;
- import org.fudaa.dodico.h2d.H2dParametres;
-
- import com.memoire.bu.BuTask;
/**
--- 10,42 ----
import java.io.File;
import java.util.HashMap;
+ import java.util.Map;
+
+ import com.memoire.bu.BuTask;
+
+ import org.fudaa.dodico.corba.tr.STrProjetH2d;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionBuAdapter;
! import org.fudaa.dodico.dico.DicoEntite;
! import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.H2dConditionLimiteReflux;
! import org.fudaa.dodico.h2d.H2dElement;
! import org.fudaa.dodico.h2d.H2dGroupePasTemps;
! import org.fudaa.dodico.h2d.H2dMaillage;
! import org.fudaa.dodico.h2d.H2dPoint;
! import org.fudaa.dodico.h2d.H2dProprieteElementaire;
! import org.fudaa.dodico.h2d.H2dRefluxDicoModel;
! import org.fudaa.dodico.h2d.type.H2dBordType;
! import org.fudaa.dodico.h2d.type.H2dClType;
! import org.fudaa.dodico.h2d.type.H2dMethodeResolutionType;
! import org.fudaa.dodico.h2d.type.H2dProjetType;
! import org.fudaa.dodico.h2d.type.H2dRefluxImpressionType;
! import org.fudaa.dodico.h2d.type.H2dSchemaResolutionType;
! import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.dodico.reflux.io.INPFileFormat;
import org.fudaa.dodico.reflux.io.INPInterface;
import org.fudaa.dodico.test.TestIO;
/**
***************
*** 44,48 ****
public TestINP()
{
! super("canal_s.inp",INPFileFormat.getInstance());
}
--- 49,53 ----
public TestINP()
{
! super("canal_s.inp");
}
***************
*** 51,97 ****
* @see org.fudaa.dodico.test.TestIO#_interfaceTest(TrFileReadView)
*/
! public void _interfaceTest(H2dFileReadView _r)
{
! INPInterface t=(INPInterface)_r.getSource();
! STrProjetH2d pr=t.getProjet();
! String v=pr.version;
! System.out.println(v);
! assertTrue("5.0".equals(v));
! assertEquals(pr.typeProjet, LTrTypeProjet.COURANTOLOGIE_2D);
! assertNotNull(pr.parametresCalcul);
! assertEquals(pr.parametresCalcul.impressions[0],"ITERATION");
! SPoint[] pts=pr.maillage.points;
! assertEquals(pts.length, 1791);
! SPoint pt=pts[1790];
! assertEquals(pt.x, 1000,eps_);
! assertEquals(pt.y, 10,eps_);
! assertEquals(pt.z, 12,eps_);
! pt=pts[1770];
! assertEquals(pt.x, 989.898987,eps_);
! assertEquals(pt.y, 7.5,eps_);
! assertEquals(pt.z, 12.030303,eps_);
! int[] itemp=pr.maillage.pointsExtremitesElements;
assertNotNull("Les points frontiere ne sont pas nuls",itemp);
assertEquals(itemp[5], 18);
assertEquals(itemp[499],1790);
! STrConditionLimite[] tabCl=pr.conditionsLimites;
! STrConditionLimite cl=getForIndex(tabCl, 818);
! assertEquals(cl.uCode, H2dParametres.CODE_PERMANENT);
! assertEquals(cl.u,0,eps_);
cl=getForIndex(tabCl, 1790);
! assertEquals(cl.vCode, H2dParametres.CODE_PERMANENT);
! assertEquals(cl.v,0,eps_);
! assertEquals(cl.normale, 0,eps_);
! assertEquals(cl.hCode, H2dParametres.CODE_PERMANENT);
! assertEquals(cl.h,13.3,eps_);
cl=getForIndex(tabCl, 1781);
! assertEquals(cl.normale, 90.0000041,eps_);
cl=getForIndex(tabCl, 0);
! assertEquals(cl.hCode, H2dParametres.CODE_PERMANENT);
! assertEquals(cl.h,16.325,eps_);
itemp=new int[]{1430,1421,1412,1403,1394};
--- 56,99 ----
* @see org.fudaa.dodico.test.TestIO#_interfaceTest(TrFileReadView)
*/
! public void _interfaceTest(INPInterface _t)
{
! INPInterface t=_t;
! assertTrue("5.0".equals(t.getVersion()));
! assertEquals(t.getTypeProjet(), H2dProjetType.COURANTOLOGIE_2D);
! assertNotNull(t.getEntiteValue());
! assertTrue(t.getEntiteValue().containsKey(t.getDicoModel().getEntite("ITERATION")));
! H2dMaillage m=t.getMaillage();
! assertEquals(m.getPtsNb(), 1791);
! H2dPoint pt=m.getPt(1790);
! assertEquals(pt.getX(), 1000,eps_);
! assertEquals(pt.getY(), 10,eps_);
! assertEquals(pt.getZ(), 12,eps_);
! pt=m.getPt(1770);
! assertEquals(pt.getX(), 989.898987,eps_);
! assertEquals(pt.getY(), 7.5,eps_);
! assertEquals(pt.getZ(), 12.030303,eps_);
! int[] itemp=t.getMaillage().getPtsExtremitesElement();
assertNotNull("Les points frontiere ne sont pas nuls",itemp);
assertEquals(itemp[5], 18);
assertEquals(itemp[499],1790);
! H2dConditionLimiteReflux[] tabCl=t.getConditionLimite();
! H2dConditionLimiteReflux cl=getForIndex(tabCl, 818);
! assertEquals(cl.getUType(), H2dClType.PERMANENT);
! assertEquals(cl.getU(),0,eps_);
cl=getForIndex(tabCl, 1790);
! assertEquals(cl.getVType(), H2dClType.PERMANENT);
! assertEquals(cl.getV(),0,eps_);
! assertEquals(cl.getNormale(), 0,eps_);
! assertEquals(cl.getHType(), H2dClType.PERMANENT);
! assertEquals(cl.getH(),13.3,eps_);
cl=getForIndex(tabCl, 1781);
! assertEquals(cl.getNormale(), 90.0000041,eps_);
cl=getForIndex(tabCl, 0);
! assertEquals(cl.getHType(), H2dClType.PERMANENT);
! assertEquals(cl.getH(),16.325,eps_);
itemp=new int[]{1430,1421,1412,1403,1394};
***************
*** 100,113 ****
{
cl=getForIndex(tabCl, itemp[i]);
! assertEquals(LTrTypeBord.SOLIDE,cl.typeBord);
! assertEquals(H2dParametres.CODE_PERMANENT,cl.stricklerCode);
! assertEquals(1d/3d,cl.strickler ,eps_);
}
! int[][] elems=pr.maillage.elements;
assertEquals(elems.length, 792);
! itemp=elems[791];
assertEquals(itemp[0], 1788);
assertEquals(itemp[1], 1789);
--- 102,115 ----
{
cl=getForIndex(tabCl, itemp[i]);
! assertEquals(H2dBordType.SOLIDE,cl.getBordType());
! assertEquals(H2dClType.PERMANENT,cl.getRugositeType());
! assertEquals(3d,cl.getRugosite(),eps_);
}
! H2dElement[] elems=t.getMaillage().getElts();
assertEquals(elems.length, 792);
! itemp=elems[791].getPtIndex();
assertEquals(itemp[0], 1788);
assertEquals(itemp[1], 1789);
***************
*** 117,154 ****
assertEquals(itemp[5], 1779);
! STrProprieteElementaire[] propelem=pr.proprietesElementaires;
! STrProprieteElementaire prTemp=propelem[0];
! assertEquals("VISCOSITE", prTemp.nom);
! assertEquals(prTemp.valeursTransitoires.length, 0);
! assertEquals(prTemp.valeurs.length, 0);
! assertEquals(prTemp.elementsLibres.length, 0);
! assertEquals(prTemp.valeurParDefaut,0.01,eps_);
prTemp=propelem[1];
! assertEquals("RUGOSITE", prTemp.nom);
! assertEquals(prTemp.valeursTransitoires.length, 0);
! assertEquals(prTemp.valeurs.length, 0);
! assertEquals(prTemp.elementsLibres.length, 0);
! assertEquals(prTemp.valeurParDefaut,0.025,eps_);
prTemp=propelem[2];
! assertEquals("LONGUEUR MELANGE", prTemp.nom);
! assertEquals(prTemp.valeursTransitoires.length, 0);
! assertEquals(prTemp.valeurs.length, 0);
! assertEquals(prTemp.elementsLibres.length, 0);
! assertEquals(prTemp.valeurParDefaut,0.0,eps_);
prTemp=propelem[3];
! assertEquals("PERTE CHARGE", prTemp.nom);
! assertEquals(prTemp.valeursTransitoires.length, 0);
! assertEquals(prTemp.elementsLibres.length, 0);
! assertEquals(prTemp.valeurParDefaut,0.0,eps_);
! assertEquals(prTemp.valeurs.length, 792);
! STrProprieteElementaireValeur[] vals=prTemp.valeurs;
for(int i=790;i>=0;i--)
{
if(i!=758)
! assertEquals(vals[i].valeur, 0.0,eps_);
else
! assertEquals(vals[i].valeur, 0.01,eps_);
}
String[] fics=t.getFichiers();
--- 119,156 ----
assertEquals(itemp[5], 1779);
! H2dProprieteElementaire[] propelem=t.getPropElementaires();
! H2dProprieteElementaire prTemp=propelem[0];
! assertEquals(prTemp.getVariableType(), H2dVariableType.VISCOSITE);
! assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentNb(), 0);
! assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(),0.01,eps_);
prTemp=propelem[1];
! assertEquals(prTemp.getVariableType(), H2dVariableType.RUGOSITE);
! assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentNb(), 0);
! assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(),0.025,eps_);
prTemp=propelem[2];
! assertEquals(prTemp.getVariableType(), H2dVariableType.ALPHA_LONGUEUR_MELANGE);
! assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentNb(), 0);
! assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(),0.0,eps_);
prTemp=propelem[3];
! assertEquals(prTemp.getVariableType(), H2dVariableType.PERTE_CHARGE);
! assertEquals(prTemp.getValeurTransitoireNb(), 0);
! assertEquals(prTemp.getPermanentNb(), 792);
! assertEquals(prTemp.getValeurLibreNb(), 0);
! assertEquals(prTemp.getDefaultValue(),0.0,eps_);
!
for(int i=790;i>=0;i--)
{
if(i!=758)
! assertEquals(prTemp.getPermanentValueForIndex(i), 0.0,eps_);
else
! assertEquals(prTemp.getPermanentValueForIndex(i), 0.01,eps_);
}
String[] fics=t.getFichiers();
***************
*** 160,197 ****
assertFalse(t.contientSollicitationsReparties());
assertFalse(t.contientVent());
! STrGroupeTemps[] gts=pr.parametresTemporels;
assertNotNull(gts);
assertEquals(gts.length, 1);
! STrGroupeTemps gt=gts[0];
assertNotNull(gt);
! assertEquals(gt.nbPasTemps, 1);
! assertEquals(gt.schema, LTrSchemaResolution.STATIONNAIRE);
! assertEquals(gt.methode, LTrMethodeResolution.SELECT_LUMPING);
! assertEquals(gt.relaxation, 1,eps_);
! assertEquals(gt.precision , 0.001,eps_);
! assertEquals(gt.precisionBancCouvrantDecouvrant , 0.05,eps_);
! assertEquals(gt.nombreIterationMax , 2);
! double[] dtemp=gt.coefficientsContribution;
assertNotNull(dtemp);
! for(int i=dtemp.length-1;i>=0;i--)
{
! assertEquals(dtemp[i] , i,eps_);
}
}
! private STrConditionLimite getForIndex(STrConditionLimite[] _tab,int _index)
{
int l=_tab.length-1;
for(int i=l;i>=0;i--)
{
! if(_tab[i].indexsPt==_index) return _tab[i];
}
return null;
}
public void testEcriture()
{
! //PAs implanter
}
--- 162,231 ----
assertFalse(t.contientSollicitationsReparties());
assertFalse(t.contientVent());
!
! H2dGroupePasTemps[] gts=t.getGroupePasTemps();
assertNotNull(gts);
assertEquals(gts.length, 1);
! H2dGroupePasTemps gt=gts[0];
assertNotNull(gt);
! assertEquals(gt.getNbPasTemps(), 1);
! assertEquals(gt.getSchema(), H2dSchemaResolutionType.STATIONNAIRE);
! assertEquals(gt.getMethode(), H2dMethodeResolutionType.SELECT_LUMPING);
! assertEquals(gt.getRelaxation(), 1,eps_);
! assertEquals(gt.getPrecision(), 0.001,eps_);
! assertEquals(gt.getPrecisionBancCouvrantDecouvrant(), 0.05,eps_);
! assertEquals(gt.getNombreIterationMax(), 2);
! Map dtemp=t.getEntiteValue();
assertNotNull(dtemp);
! H2dRefluxDicoModel model=t.getDicoModel();
! for(int i=8;i>=0;i--)
{
! DicoEntite ent=model.getCoefContribution(i);
! assertNotNull(ent);
! assertEquals(Double.parseDouble((String)dtemp.get(ent)) , i,eps_);
}
}
! private H2dConditionLimiteReflux getForIndex(H2dConditionLimiteReflux[] _tab,int _index)
{
int l=_tab.length-1;
for(int i=l;i>=0;i--)
{
! if(_tab[i].getIndexPt()==_index) return _tab[i];
}
return null;
}
+ /**
+ *
+ */
public void testEcriture()
{
! // CorEleBthInterface inter=getInter(fic_);
! // File tmpFile=createTempFile();
! // FileOperationSynthese syntheseR=CorEleBthFileFormat.getInstance().write(tmpFile, inter, null);
! // assertNull(syntheseR.getAnalyze());
! // _interfaceTest(getInter(tmpFile));
!
! }
!
! public INPInterface getInter(File _f)
! {
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! INPInterface r=INPFileFormat.getInstance().read(_f, syntheseR, null);
! if(syntheseR.getAnalyze()!=null)
! System.out.println( syntheseR.getAnalyze().getResume());
! assertNull(syntheseR.getAnalyze());
! return r;
}
+
+ /**
+ *
+ */
+ public void testLecture()
+ {
+ _interfaceTest(getInter(fic_));
+
+ }
+
***************
*** 216,262 ****
return;
}
- INPReader r = null;
- STrProjetH2d inter = null;
- ProgressionBuAdapter progress = new ProgressionBuAdapter(new BuTask());
! r = new INPReader();
! r.setIn(f);
! r.setProgressReceiver(progress);
! r.read();
! inter = r.getINPInterface().getProjet();
! DodicoAnalyze infos = r.getAnalyze();
if (infos != null)
infos.printResume();
- IOException[] exs = r.close();
- if (exs != null)
- System.err.println("Impossible de fermer le flux");
! if (inter != null)
! {
! if (inter.typeProjet.equals(LTrTypeProjet.COURANTOLOGIE_2D))
! System.out.println("courant 2D");
! else if (inter.typeProjet.equals(LTrTypeProjet.COURANTOLOGIE_2D_LMG))
! System.out.println("courant 2D LMG");
! else if (inter.typeProjet.equals(LTrTypeProjet.TRANSPORT_2D))
! System.out.println("transport 2D");
! else
! System.out.println("type inconnu");
! System.out.println();
! DodicoLib.printFields(inter, false);
! }
! if (inter.parametresCalcul != null)
! {
! System.out.println();
! System.out.println("Paramètres de calcul");
! DodicoLib.printFields(inter.parametresCalcul, true);
! }
! try
! {
! Thread.currentThread().sleep(10000);
! }
! catch(Exception e)
{
! e.printStackTrace();
}
}
--- 250,273 ----
return;
}
! FileOperationSynthese syntheseR= new FileOperationSynthese();
! INPInterface inpInter=INPFileFormat.getInstance().read(f, syntheseR, null);
! DodicoAnalyze infos = syntheseR.getAnalyze();
if (infos != null)
infos.printResume();
! if (inpInter != null)
{
! System.out.println(inpInter.getTypeProjet().toString());
! DodicoLib.printFields(inpInter, false);
}
+ // try
+ // {
+ // Thread.currentThread().sleep(10000);
+ // }
+ // catch(Exception e)
+ // {
+ // e.printStackTrace();
+ // }
}
|
|
From: <de...@us...> - 2003-07-04 14:22:44
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/junit In directory sc8-pr-cvs1:/tmp/cvs-serv31279/junit Modified Files: DodicoJUnitLauncher.java Log Message: Maj des test pour H2d Index: DodicoJUnitLauncher.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/junit/DodicoJUnitLauncher.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DodicoJUnitLauncher.java 18 Mar 2003 15:36:10 -0000 1.2 --- DodicoJUnitLauncher.java 4 Jul 2003 14:22:41 -0000 1.3 *************** *** 10,17 **** package org.fudaa.dodico.test.junit; - import java.io.*; - import java.net.*; - - import junit.framework.*; --- 10,13 ---- |
|
From: <de...@us...> - 2003-07-04 14:22:44
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/h2d
In directory sc8-pr-cvs1:/tmp/cvs-serv31279/h2d
Added Files:
TestMaillage.java
Log Message:
Maj des test pour H2d
--- NEW FILE: TestMaillage.java ---
/*
* @file TestMaillage.java
* @creation 3 juil. 2003
* @modification $Date: 2003/07/04 14:22:41 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.test.h2d;
import com.sun.corba.se.internal.io.util.Arrays;
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageBord;
import org.fudaa.dodico.h2d.H2dPoint;
import junit.framework.TestCase;
/**
* 8
* / | \
* / 7|8 \
* / | \
* 7-- 5---- 6
* |5/ |\ 4 / /
* |/3 |T\ / 6/
* 4-- 2-- 3 /
* |2/ \1| /
* |/ O \|/
* 0----- 1
* Test pour le maillage ci-dessus (T pour trou).
* @author deniger
* @version $Id: TestMaillage.java,v 1.1 2003/07/04 14:22:41 deniger Exp $
*/
public class TestMaillage extends TestCase {
H2dMaillage mail_;
double eps_;
/**
*
*/
public TestMaillage() {
eps_= 1E-15;
}
private void initMaillage() {
H2dPoint[] pts= new H2dPoint[9];
pts[0]= new H2dPoint(0, 0, 15);
pts[1]= new H2dPoint(2, -1, -15);
pts[2]= new H2dPoint(1, 2, -5);
pts[3]= new H2dPoint(2, 2, 30);
pts[4]= new H2dPoint(0, 2, 30);
pts[5]= new H2dPoint(1, 4, 30);
pts[6]= new H2dPoint(10, 11, 30);
pts[7]= new H2dPoint(0, 4, 30);
pts[8]= new H2dPoint(2, 20, 30);
H2dElement[] elt= new H2dElement[9];
elt[0]= new H2dElement(new int[] { 0, 2, 1 });
elt[1]= new H2dElement(new int[] { 1, 3, 2 });
elt[2]= new H2dElement(new int[] { 0, 4, 2 });
elt[3]= new H2dElement(new int[] { 4, 5, 2 });
elt[4]= new H2dElement(new int[] { 5, 3, 6 });
elt[5]= new H2dElement(new int[] { 5, 7, 4 });
elt[6]= new H2dElement(new int[] { 1, 3, 6 });
elt[7]= new H2dElement(new int[] { 7, 8, 5 });
elt[8]= new H2dElement(new int[] { 6, 8, 5 });
mail_= new H2dMaillage(pts, elt);
}
private void initMaillageT6() {
H2dPoint[] pts= new H2dPoint[27];
pts[0]= new H2dPoint(0, 0, 15);
pts[1]= new H2dPoint(2, -1, -15);
pts[2]= new H2dPoint(1, 2, -5);
pts[3]= new H2dPoint(2, 2, 30);
pts[4]= new H2dPoint(0, 2, 30);
pts[5]= new H2dPoint(1, 4, 30);
pts[6]= new H2dPoint(10, 11, 30);
pts[7]= new H2dPoint(0, 4, 30);
pts[8]= new H2dPoint(2, 20, 30);
//elt 0
pts[9]= H2dPoint.createMilieu(pts[0], pts[2]);
pts[10]= H2dPoint.createMilieu(pts[2], pts[1]);
pts[11]= H2dPoint.createMilieu(pts[1], pts[0]);
//elt 1
pts[12]= H2dPoint.createMilieu(pts[1], pts[3]);
pts[13]= H2dPoint.createMilieu(pts[2], pts[3]);
//pts10
//elt 2
pts[14]= H2dPoint.createMilieu(pts[0], pts[4]);
pts[15]= H2dPoint.createMilieu(pts[4], pts[2]);
//pts 9
// elt 3
pts[16]= H2dPoint.createMilieu(pts[5], pts[4]);
pts[17]= H2dPoint.createMilieu(pts[5], pts[2]);
//pts 15
// elt 4
pts[18]= H2dPoint.createMilieu(pts[5], pts[3]);
pts[19]= H2dPoint.createMilieu(pts[3], pts[6]);
pts[20]= H2dPoint.createMilieu(pts[5], pts[6]);
// elt 5
pts[21]= H2dPoint.createMilieu(pts[5], pts[7]);
pts[22]= H2dPoint.createMilieu(pts[4], pts[7]);
//pts 16
// elt 6
//pts12
//pts19
pts[23]= H2dPoint.createMilieu(pts[6], pts[1]);
// elt 7
pts[24]= H2dPoint.createMilieu(pts[7], pts[8]);
pts[25]= H2dPoint.createMilieu(pts[8], pts[5]);
//pts 21
// elt 8
pts[26]= H2dPoint.createMilieu(pts[6], pts[8]);
//Pts 25
//pts 20
H2dElement[] elt= new H2dElement[9];
elt[0]= new H2dElement(new int[] { 0, 9, 2, 10, 1, 11 });
elt[1]= new H2dElement(new int[] { 1, 12, 3, 13, 2, 10 });
elt[2]= new H2dElement(new int[] { 0, 14, 4, 15, 2, 9 });
elt[3]= new H2dElement(new int[] { 4, 16, 5, 17, 2, 15 });
elt[4]= new H2dElement(new int[] { 5, 18, 3, 19, 6, 20 });
elt[5]= new H2dElement(new int[] { 5, 21, 7, 22, 4, 16 });
elt[6]= new H2dElement(new int[] { 1, 12, 3, 19, 6, 23 });
elt[7]= new H2dElement(new int[] { 7, 24, 8, 25, 5, 21 });
elt[8]= new H2dElement(new int[] { 6, 26, 8, 25, 5, 20 });
mail_= new H2dMaillage(pts, elt);
}
public void testTrigo() {
initMaillage();
H2dElement el= mail_.getElement(0);
assertEquals(el.getPtIndex()[0], 0);
assertEquals(el.getPtIndex()[1], 2);
assertEquals(el.getPtIndex()[2], 1);
el= mail_.getElement(1);
assertEquals(el.getPtIndex()[0], 1);
assertEquals(el.getPtIndex()[1], 3);
assertEquals(el.getPtIndex()[2], 2);
assertEquals(mail_.isElementTrigoOriente(0), -1);
assertEquals(mail_.isElementTrigoOriente(1), 1);
assertEquals(el.isSegmentInEltOrient(1, 3), 1);
assertEquals(el.isSegmentInEltOrient(3, 2), 1);
assertEquals(el.isSegmentInEltOrient(2, 1), 1);
assertEquals(el.isSegmentInEltOrient(2, 3), -1);
assertEquals(el.isSegmentInEltOrient(2, 2), 0);
}
public void testTrigoT6() {
initMaillageT6();
H2dElement el= mail_.getElement(0);
assertEquals(el.getPtIndex()[0], 0);
assertEquals(el.getPtIndex()[1], 9);
assertEquals(el.getPtIndex()[2], 2);
assertEquals(mail_.isElementTrigoOriente(0), -1);
assertEquals(mail_.isElementTrigoOriente(1), 1);
assertEquals(el.isSegmentInEltOrient(0, 9), 1);
assertEquals(el.isSegmentInEltOrient(9, 2), 1);
assertEquals(el.isSegmentInEltOrient(2, 10), 1);
assertEquals(el.isSegmentInEltOrient(10, 1), 1);
assertEquals(el.isSegmentInEltOrient(1, 11), 1);
assertEquals(el.isSegmentInEltOrient(11, 0), 1);
assertEquals(el.isSegmentInEltOrient(0, 11), -1);
assertEquals(el.isSegmentInEltOrient(0, 12), 0);
}
private void _testMinMaxCommun() {
H2dPoint p= mail_.getMaxPoint();
assertEquals(p.getX(), 10, eps_);
assertEquals(p.getY(), 20, eps_);
assertEquals(p.getZ(), 30, eps_);
p= mail_.getMinPoint();
assertEquals(p.getX(), 0, eps_);
assertEquals(p.getY(), -1, eps_);
assertEquals(p.getZ(), -15, eps_);
}
public void testMinMaxCommun() {
initMaillage();
_testMinMaxCommun();
}
public void testMinMaxCommunT6() {
initMaillageT6();
_testMinMaxCommun();
}
public void _testBordCommun() {
H2dMaillageBord bord= mail_.getPtsFrontiere();
assertEquals(bord.getBordNb(), 2);
int[] eltContains4= mail_.getEltIdxContainsPtIdx(4);
Arrays.sort(eltContains4);
assertEquals(eltContains4.length, 3);
assertTrue(Arrays.binarySearch(eltContains4, 2) >= 0);
assertTrue(Arrays.binarySearch(eltContains4, 3) >= 0);
assertTrue(Arrays.binarySearch(eltContains4, 5) >= 0);
int n= bord.getPtNbForBord(0);
assertEquals(n, 6);
assertEquals(0, bord.getPtIdxForBord(0, 0));
assertEquals(1, bord.getPtIdxForBord(0, 1));
assertEquals(6, bord.getPtIdxForBord(0, 2));
assertEquals(8, bord.getPtIdxForBord(0, 3));
assertEquals(7, bord.getPtIdxForBord(0, 4));
assertEquals(4, bord.getPtIdxForBord(0, 5));
n= bord.getPtNbForBord(1);
assertEquals(n, 3);
assertEquals(2, bord.getPtIdxForBord(1, 0));
assertEquals(5, bord.getPtIdxForBord(1, 1));
assertEquals(3, bord.getPtIdxForBord(1, 2));
}
public void testBordFast() {
initMaillage();
mail_.computeBordFast(null);
_testBordCommun();
}
public void testBordFastT6() {
initMaillageT6();
mail_.computeBordFast(null);
_testBordCommunT6();
}
public void testBord() {
initMaillage();
mail_.computeBord(null);
_testBordCommun();
}
public void testBordT6() {
initMaillageT6();
mail_.computeBord(null);
_testBordCommunT6();
}
public void _testBordCommunT6() {
H2dMaillageBord bord= mail_.getPtsFrontiere();
assertEquals(bord.getBordNb(), 2);
int[] eltContains4= mail_.getEltIdxContainsPtIdx(4);
Arrays.sort(eltContains4);
assertEquals(eltContains4.length, 3);
assertTrue(Arrays.binarySearch(eltContains4, 2) >= 0);
assertTrue(Arrays.binarySearch(eltContains4, 3) >= 0);
assertTrue(Arrays.binarySearch(eltContains4, 5) >= 0);
int n= bord.getPtNbForBord(0);
assertEquals(n, 12);
assertEquals(0, bord.getPtIdxForBord(0, 0));
assertEquals(11, bord.getPtIdxForBord(0, 1));
assertEquals(1, bord.getPtIdxForBord(0, 2));
assertEquals(23, bord.getPtIdxForBord(0, 3));
assertEquals(6, bord.getPtIdxForBord(0, 4));
assertEquals(26, bord.getPtIdxForBord(0, 5));
assertEquals(8, bord.getPtIdxForBord(0, 6));
assertEquals(24, bord.getPtIdxForBord(0, 7));
assertEquals(7, bord.getPtIdxForBord(0, 8));
assertEquals(22, bord.getPtIdxForBord(0, 9));
assertEquals(4, bord.getPtIdxForBord(0, 10));
assertEquals(14, bord.getPtIdxForBord(0, 11));
n= bord.getPtNbForBord(1);
assertEquals(n, 6);
assertEquals(2, bord.getPtIdxForBord(1, 0));
assertEquals(17, bord.getPtIdxForBord(1, 1));
assertEquals(5, bord.getPtIdxForBord(1, 2));
assertEquals(18, bord.getPtIdxForBord(1, 3));
assertEquals(3, bord.getPtIdxForBord(1, 4));
assertEquals(13, bord.getPtIdxForBord(1, 5));
}
}
|
|
From: <de...@us...> - 2003-07-04 14:22:44
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/geodesie In directory sc8-pr-cvs1:/tmp/cvs-serv31279/geodesie Modified Files: TestEllipsoide.java Log Message: Maj des test pour H2d Index: TestEllipsoide.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/geodesie/TestEllipsoide.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestEllipsoide.java 18 Mar 2003 15:36:09 -0000 1.2 --- TestEllipsoide.java 4 Jul 2003 14:22:41 -0000 1.3 *************** *** 10,15 **** package org.fudaa.dodico.test.geodesie; ! import org.fudaa.dodico.geodesie.*; ! import junit.framework.*; /** * Test --- 10,17 ---- package org.fudaa.dodico.test.geodesie; ! import junit.framework.TestCase; ! ! import org.fudaa.dodico.geodesie.Ellipsoide; ! import org.fudaa.dodico.geodesie.SysGeodesiqueLambert; /** * Test |
|
From: <de...@us...> - 2003-07-04 14:20:46
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/h2d In directory sc8-pr-cvs1:/tmp/cvs-serv31129/h2d Log Message: Directory /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/h2d added to the repository |
|
From: <de...@us...> - 2003-07-04 14:16:59
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/vag In directory sc8-pr-cvs1:/tmp/cvs-serv30575/vag Modified Files: ServeurVag.java Log Message: Maj UsineHelper Index: ServeurVag.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/vag/ServeurVag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ServeurVag.java 18 Mar 2003 14:13:21 -0000 1.2 --- ServeurVag.java 4 Jul 2003 14:16:56 -0000 1.3 *************** *** 10,17 **** package org.fudaa.dodico.vag; ! import org.fudaa.dodico.corba.objet.*; ! import org.fudaa.dodico.objet.*; ! import org.fudaa.dodico.corba.vag.*; ! import java.util.*; /** --- 10,16 ---- package org.fudaa.dodico.vag; ! import java.util.Date; ! ! import org.fudaa.dodico.objet.CDodico; /** |
|
From: <de...@us...> - 2003-07-04 14:16:59
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/utilitaire In directory sc8-pr-cvs1:/tmp/cvs-serv30575/utilitaire Modified Files: DGestionnaireMessages.java Log Message: Maj UsineHelper Index: DGestionnaireMessages.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/utilitaire/DGestionnaireMessages.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DGestionnaireMessages.java 11 Apr 2003 16:09:24 -0000 1.3 --- DGestionnaireMessages.java 4 Jul 2003 14:16:56 -0000 1.4 *************** *** 10,17 **** package org.fudaa.dodico.utilitaire; ! import java.util.*; ! import org.fudaa.dodico.corba.objet.*; ! import org.fudaa.dodico.objet.*; ! import org.fudaa.dodico.corba.utilitaire.*; /** --- 10,18 ---- package org.fudaa.dodico.utilitaire; ! import java.util.Date; ! import java.util.Vector; ! ! import org.fudaa.dodico.corba.utilitaire.IGestionnaireMessagesOperations; ! import org.fudaa.dodico.objet.CDodico; /** |
|
From: <de...@us...> - 2003-07-04 14:16:05
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io In directory sc8-pr-cvs1:/tmp/cvs-serv30121 Removed Files: TelemacCasWriter.java Log Message: Inutile cf package dico --- TelemacCasWriter.java DELETED --- |
|
From: <de...@us...> - 2003-07-04 14:12:08
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/dico
In directory sc8-pr-cvs1:/tmp/cvs-serv29715/dico
Modified Files:
TelemacDicoFactory.java
Removed Files:
TelemacDicov5p2.java
Log Message:
Maj des classes de lecture/ecriture
Index: TelemacDicoFactory.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/dico/TelemacDicoFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TelemacDicoFactory.java 19 May 2003 14:04:02 -0000 1.1
--- TelemacDicoFactory.java 4 Jul 2003 14:12:06 -0000 1.2
***************
*** 11,33 ****
import java.io.File;
! import org.fudaa.dodico.dico.DicoFactory;
!
public class TelemacDicoFactory
{
!
public static void main(String[] args)
{
! DicoFactory fact=new DicoFactory("org.fudaa.dodico.telemac.dico","TelemacDico");
! File f=new File("serveurs/telemac/telemac2dv5p2.dico");
! File dest=new File("src/org/fudaa/dodico/telemac/dico");
! System.out.println("fichier dico "+f.getAbsolutePath());
! System.out.println("repertoire de dest "+dest.getAbsolutePath());
! fact.setDestDir(dest);
! fact.setDicoFile(f);
! fact.printAnalyze(fact.generate());
}
-
-
}
--- 11,58 ----
import java.io.File;
! import javax.swing.JFileChooser;
! import javax.swing.filechooser.FileFilter;
+ import org.fudaa.dodico.commun.DodicoAnalyze;
+ import org.fudaa.dodico.dico.DicoFactory;
public class TelemacDicoFactory
{
!
! public static boolean containsFatalError(DodicoAnalyze[] resume)
! {
! int n = resume.length - 1;
! for (int i = n; i >= 0; i--)
! {
! DodicoAnalyze analyze = resume[i];
! if ((analyze != null) && (analyze.containsFatalError()))
! return true;
! }
! return false;
! }
!
public static void main(String[] args)
{
! File repDico = new File("serveurs/telemac/");
! File[] dicos = repDico.listFiles();
! DicoFactory fact = new DicoFactory("org.fudaa.dodico.telemac.dico");
! File dest = new File("src/org/fudaa/dodico/telemac/dico");
! System.out.println("repertoire de dest " + dest.getAbsolutePath() + "\n\n");
! int n = dicos.length;
! File f;
! for (int i = 0; i < n; i++)
! {
! f = dicos[i];
! System.out.println("\n\nFICHIER " + f.getAbsolutePath());
! fact.setDestDir(dest);
! fact.setDicoFile(f);
! DodicoAnalyze[] err = fact.generate();
! fact.printAnalyze(err);
! if (containsFatalError(err))
! {
! System.out.println("\n\nERREUR");
! break;
! }
! }
}
}
--- TelemacDicov5p2.java DELETED ---
|