Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr
In directory sc8-pr-cvs1:/tmp/cvs-serv12749
Modified Files:
Tr.java TrImplHelper.java TrImplementation.java TrLib.java
TrPreferences.java TrProjectManager.java TrProjet.java
Removed Files:
TrCellBooleanEditor.java TrCellBooleanRenderer.java
TrCellDecorator.java TrCellDialogEditor.java
TrCellRenderer.java TrCellTextRenderer.java TrEditor.java
TrEditorExterne.java TrEditorInterface.java
TrEditorInterne.java
Log Message:
Diverses refactorisation
Index: Tr.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/Tr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Tr.java 19 May 2003 14:31:47 -0000 1.1
--- Tr.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 22,28 ****
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.commun.FudaaSplashScreen;
/**
! * Classe de lancement de l'application Prert. Contient la methode main.
*
* @version $Id$
--- 22,29 ----
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.commun.FudaaSplashScreen;
+ import org.fudaa.fudaa.commun.FudaaTee;
/**
! * Classe de lancement de l'application Tr. Contient la methode main.
*
* @version $Id$
***************
*** 31,37 ****
public class Tr
{
/**
- * put your documentation comment here
* @param args
*/
--- 32,38 ----
public class Tr
{
+
/**
* @param args
*/
***************
*** 55,58 ****
--- 56,64 ----
System.err.println("Options valides: " + flags.flagTotalText());
System.exit(1);
+ }
+ if(!flags.no_log)
+ {
+ new FudaaTee(true);
+ System.out.println("ts.log créé");
}
// Preferences
Index: TrImplHelper.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrImplHelper.java 19 May 2003 14:31:48 -0000 1.1
--- TrImplHelper.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 9,20 ****
package org.fudaa.fudaa.tr;
/**
* @author deniger
* @version $Id$
*/
! public abstract class TrImplHelper
{
!
public abstract void ouvrir();
}
--- 9,155 ----
package org.fudaa.fudaa.tr;
+ import java.awt.event.ActionEvent;
+ import java.awt.event.ActionListener;
+ import java.io.File;
+
+ import com.memoire.bu.BuCommonImplementation;
+ import com.memoire.bu.BuDialogChoice;
+ import com.memoire.bu.BuDynamicMenu;
+ import com.memoire.bu.BuIcon;
+ import com.memoire.bu.BuMenu;
+ import com.memoire.bu.BuMenuItem;
+
+ import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
+ import org.fudaa.fudaa.commun.FudaaLib;
+ import org.fudaa.fudaa.commun.exec.FudaaExecServerManager;
+ import org.fudaa.fudaa.commun.exec.FudaaExecServerManagerPanel;
+ import org.fudaa.fudaa.ressource.FudaaResource;
+ import org.fudaa.fudaa.tr.reflux.TrRefluxImplHelper;
+ import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper;
+
/**
* @author deniger
* @version $Id$
*/
! public abstract class TrImplHelper implements ActionListener
{
! protected TrImplementation impl_;
!
! public TrImplHelper(TrImplementation _impl)
! {
! impl_ = _impl;
! impl_.getFrame().setTitle("Superviseur " + getID());
!
! }
!
! public TrImplementation getImpl()
! {
! return impl_;
! }
!
public abstract void ouvrir();
+ public abstract void ouvrir(File _f);
+
+ public BuIcon getIcon()
+ {
+ return FudaaResource.FUDAA.getToolIcon("appli/" + getID());
+ }
+
+ public abstract String getID();
+ public BuMenuItem[] getMenuItemsOuvrir()
+ {
+ return null;
+ }
+
+ public BuMenuItem[] getMenuItemsProjet()
+ {
+ return null;
+ }
+
+ public BuMenu getProjetMenu()
+ {
+ BuMenu projet = new BuDynamicMenu("Projet", "PROJET")
+ {
+ private boolean built_;
+ public boolean isActive()
+ {
+ return true;
+ }
+
+ public void build()
+ {
+ if (!built_)
+ {
+ BuMenuItem it = new BuMenuItem("Changer chaîne de calcul");
+ it.setActionCommand("MODIFIER_CHAINE");
+ add(it);
+ it.addActionListener(TrImplHelper.this);
+ built_ = true;
+ }
+ }
+ };
+ projet.setIcon(null);
+ return projet;
+ }
+
+ public static TrImplHelper getImplHelper(String _id, TrImplementation _impl)
+ {
+ if(FudaaLib.DEBUG) System.out.println("Choix impl helper");
+ System.out.println("id= \""+_id+"\"");
+ System.out.println("relfux= \""+TrProjet.REFLUX_ID+"\"");
+ if (_impl.getCurrentImplHelper() != null)
+ {
+ if (_id.equals(_impl.getCurrentImplHelper().getID()))
+ {
+ if(FudaaLib.DEBUG) System.out.println("impl courant");
+ return _impl.getCurrentImplHelper();
+ }
+ }
+ if (_id.equals(TrProjet.REFLUX_ID))
+ {
+ if(FudaaLib.DEBUG) System.out.println("impl reflux");
+ return new TrRefluxImplHelper(_impl);
+ }
+ else if (_id.equals(TrProjet.TELEMAC_ID))
+ {
+ if(FudaaLib.DEBUG) System.out.println("impl telemac");
+ return new TrTelemacImplHelper(_impl);
+ }
+ return null;
+ }
+
+ /**
+ *
+ */
+ public void actionPerformed(ActionEvent e)
+ {
+ String c = e.getActionCommand();
+ if (FudaaLib.DEBUG)
+ System.out.println(c);
+ if ("MODIFIER_CHAINE".equals(c))
+ {
+ String[] choix = new String[] { TrProjet.REFLUX_ID, TrProjet.TELEMAC_ID };
+ BuDialogChoice dialc =
+ new BuDialogChoice(
+ impl_,
+ impl_.informationsSoftware(),
+ "Configuration chaîne de calcul",
+ "Veuillez sélectionner la chaîne de calcul utilisée.\n"
+ + " La modification sera prise en compte au redémarrage de l'application",
+ choix);
+ dialc.setSize(200, 200);
+ if (FudaaLib.isOkResponse(dialc.activate()))
+ {
+
+ String id = dialc.getValue();
+ if (FudaaLib.DEBUG)
+ System.out.println("choix " + id);
+
+ TrPreferences.TR.putStringProperty("tr.code.id", id);
+ TrPreferences.TR.writeIniFile();
+ }
+ }
+
+ }
}
Index: TrImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplementation.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrImplementation.java 19 May 2003 14:31:48 -0000 1.1
--- TrImplementation.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 12,35 ****
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.io.File;
! import javax.swing.JScrollPane;
import com.memoire.bu.BuColumn;
! import com.memoire.bu.BuFileChooser;
! import com.memoire.bu.BuFileFilter;
import com.memoire.bu.BuInformationsDocument;
import com.memoire.bu.BuInformationsSoftware;
import com.memoire.bu.BuMainPanel;
import com.memoire.bu.BuPreferences;
import com.memoire.bu.BuResource;
import com.memoire.bu.BuScrollPane;
import com.memoire.bu.BuTaskView;
- import org.fudaa.dodico.h2d.H2dParametres;
import org.fudaa.ebli.calque.BArbreCalque;
! import org.fudaa.ebli.ressource.EbliResource;
! import org.fudaa.fudaa.commun.FudaaImplementation;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper;
--- 12,45 ----
import java.awt.Dimension;
import java.awt.event.ActionEvent;
+ import java.awt.event.KeyEvent;
import java.io.File;
! import javax.swing.JMenu;
import com.memoire.bu.BuColumn;
! import com.memoire.bu.BuDialogChoice;
! import com.memoire.bu.BuDynamicMenu;
! import com.memoire.bu.BuExplorer;
import com.memoire.bu.BuInformationsDocument;
import com.memoire.bu.BuInformationsSoftware;
import com.memoire.bu.BuMainPanel;
+ import com.memoire.bu.BuMenu;
+ import com.memoire.bu.BuMenuBar;
+ import com.memoire.bu.BuMenuItem;
import com.memoire.bu.BuPreferences;
import com.memoire.bu.BuResource;
import com.memoire.bu.BuScrollPane;
import com.memoire.bu.BuTaskView;
+ import com.memoire.fu.FuFile;
+ import com.memoire.fu.FuLib;
import org.fudaa.ebli.calque.BArbreCalque;
!
! import org.fudaa.fudaa.commun.FudaaCommonImplementation;
import org.fudaa.fudaa.commun.FudaaLib;
+ import org.fudaa.fudaa.commun.FudaaPreferences;
+ import org.fudaa.fudaa.commun.aide.FudaaAidePreferencesPanel;
+ import org.fudaa.fudaa.commun.exec.FudaaAppliExecManager;
+ import org.fudaa.fudaa.commun.fileChooser.FudaaFavoriteFiles;
import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper;
***************
*** 40,74 ****
* @author Fred Deniger
*/
! public class TrImplementation extends FudaaImplementation
{
! private final static BuInformationsSoftware isRt_ = new BuInformationsSoftware();
static {
isRt_.name = "Tr";
! isRt_.version = "0.0";
! isRt_.date = "29-avril-2003";
! isRt_.rights = "Tous droits réservés. CETMEF (c)2000";
! isRt_.contact = "deniger";
isRt_.license = "GPL2";
isRt_.languages = "fr";
isRt_.logo = null;
isRt_.banner = null;
! isRt_.http = "";
isRt_.update = "";
! isRt_.man = "";
isRt_.authors = new String[] { "Frédéric Deniger" };
isRt_.contributors = new String[] { "Equipes Dodico, Ebli et Fudaa" };
isRt_.documentors = new String[] { "" };
isRt_.testers = new String[] { "Frédéric Deniger" };
// idTr_.logo = EbliResource.EBLI.getIcon("minlogo.gif");
}
protected BArbreCalque arbre_;
- private String lastDir_;
private TrProjectManager projectManager_;
private TrImplHelper implHelper_;
-
BuTaskView taches_;
public void actionPerformed(ActionEvent _evt)
{
--- 50,133 ----
* @author Fred Deniger
*/
! public class TrImplementation extends FudaaCommonImplementation
{
! public final static String PREF_OUVRIR = "OUVRIR_";
! private final static BuInformationsSoftware isRt_ =
! new BuInformationsSoftware();
static {
isRt_.name = "Tr";
! isRt_.version = "0.02";
! isRt_.date = "18-juin-2003";
! isRt_.rights = "Tous droits réservés. CETMEF (c)2003";
! isRt_.contact = "fre...@eq...";
isRt_.license = "GPL2";
isRt_.languages = "fr";
isRt_.logo = null;
isRt_.banner = null;
! isRt_.http = "http://fudaa.sourceforge.net";
isRt_.update = "";
! isRt_.man = FudaaAidePreferencesPanel.getHelpUrl(TrPreferences.TR);
isRt_.authors = new String[] { "Frédéric Deniger" };
isRt_.contributors = new String[] { "Equipes Dodico, Ebli et Fudaa" };
isRt_.documentors = new String[] { "" };
isRt_.testers = new String[] { "Frédéric Deniger" };
+ isRt_.citation = "";
// idTr_.logo = EbliResource.EBLI.getIcon("minlogo.gif");
}
protected BArbreCalque arbre_;
private TrProjectManager projectManager_;
private TrImplHelper implHelper_;
BuTaskView taches_;
+ protected void ouvrir()
+ {
+ implHelper_.ouvrir();
+ }
+
+ protected void ouvrirId(String _id)
+ {
+
+ if (_id.equals(TrProjet.TELEMAC_DICO_ID))
+ {
+ TrTelemacImplHelper h =
+ (TrTelemacImplHelper) TrImplHelper.getImplHelper(
+ TrProjet.TELEMAC_ID,
+ this);
+ if (h == null)
+ error("Erreur interne", "impossible de trouver l'implantation telemac");
+ h.ouvrirDico();
+
+ }
+ else
+ {
+ TrImplHelper h = TrImplHelper.getImplHelper(_id, this);
+ if (h == null)
+ error("Erreur interne", "impossible de trouver l'implantation");
+ else
+ h.ouvrir();
+ }
+ }
+
+ protected void ouvrir(File _f)
+ {
+ implHelper_.ouvrir(_f);
+ }
+
+ public TrImplHelper getCurrentImplHelper()
+ {
+ return implHelper_;
+ }
+
+ protected void ouvrir(File _f, String _id)
+ {
+ TrImplHelper h = TrImplHelper.getImplHelper(_id, this);
+ if (h == null)
+ error("Erreur interne", "impossible de trouver l'implantation");
+ else
+ h.ouvrir(_f);
+ }
+
public void actionPerformed(ActionEvent _evt)
{
***************
*** 78,93 ****
if (FudaaLib.DEBUG)
System.err.println("ACTION=" + action);
! if("OUVRIR".equals(action))
{
! implHelper_.ouvrir();
}
- // if("IMPORT:IMAGE".equals(action)) importerImage();
- // else if(action.startsWith("IMPORT:MNT:"))
- // {
- // TrFormatMenuItem it=(TrFormatMenuItem)_evt.getSource();
- // importerMNT(it);
- // }
- // else if("CREER".equals(action)) creer();
-
}
--- 137,171 ----
if (FudaaLib.DEBUG)
System.err.println("ACTION=" + action);
! if ("OUVRIR".equals(action))
{
! ouvrir();
! }
! else if (action.startsWith(PREF_OUVRIR))
! {
! String id = action.substring(PREF_OUVRIR.length());
! if (FudaaLib.DEBUG)
! System.out.println("id= " + id);
! ouvrirId(id);
! }
! else if ("ENREGISTRER".equals(action))
! {
! projetCourant().save();
! }
! else if ("ENREGISTRERSOUS".equals(action))
! {
! projetCourant().saveAs();
! }
! else if ("ENREGISTRERCOPIE".equals(action))
! {
! projetCourant().saveCopy();
! }
! else if ("FERMER".equals(action))
! {
! projetCourant().close();
! }
! else
! {
! super.actionPerformed(_evt);
}
}
***************
*** 118,133 ****
return isRt_;
}
- private String getLastDir()
- {
- return lastDir_;
- }
public void init()
{
super.init();
! //BuMenuBar mb = getApp().getMainMenuBar();
! // BuMenu importer=(BuMenu)mb.getMenu("IMPORTER");
! // ajouteMNTImportMenus(importer,"IMPORT:MNT:");
! // importer.addMenuItem("Image","IMPORT:IMAGE",true);
BuMainPanel mp = getMainPanel();
BuColumn lc = mp.getLeftColumn();
--- 196,208 ----
return isRt_;
}
public void init()
{
super.init();
! BuMenuBar mb = getApp().getMainMenuBar();
! BuMenuItem it = new BuMenuItem("Enregister une copie");
! it.setActionCommand("ENREGISTRERCOPIE");
! it.addActionListener(this);
! mb.getMenu("MENU_FICHIER").add(it, 6);
BuMainPanel mp = getMainPanel();
BuColumn lc = mp.getLeftColumn();
***************
*** 139,197 ****
BuScrollPane sp = new BuScrollPane(taches_);
sp.setPreferredSize(new Dimension(150, 80));
! rc.addToggledComponent(BuResource.BU.getString("Tâches"), "TACHE", sp, this);
mp.setTaskView(taches_);
setEnabledForAction("CREER", false);
setEnabledForAction("OUVRIR", true);
! //setEnabledForAction("EXPORTER" ,true);
! setEnabledForAction("IMPORTER", false);
! setEnabledForAction("FERMER", true);
!
! projectManager_=new TrProjectManager();
! //DEBUG: a modifer
! implHelper_=new TrTelemacImplHelper(this);
!
! }
! public File ouvrirFileChooser(String[] _extension, String _desc)
! {
! return ouvrirFileChooser(_extension, _desc, getLastDir());
! }
!
! public File ouvrirFileChooser(String[] _extension, String _desc, String _defautDir)
! {
! BuFileChooser fileChooser = new BuFileChooser();
! fileChooser.setFileHidingEnabled(true);
! if (_defautDir == null)
! fileChooser.setCurrentDirectory(new File(System.getProperty("user.dir")));
! else
! fileChooser.setCurrentDirectory(new File(_defautDir));
! fileChooser.setMultiSelectionEnabled(false);
! BuFileFilter flt = new BuFileFilter(_extension, _desc);
! fileChooser.addChoosableFileFilter(flt);
! fileChooser.setFileFilter(flt);
! int returnVal = fileChooser.showOpenDialog(getFrame());
! if (returnVal == BuFileChooser.APPROVE_OPTION)
! {
! return fileChooser.getSelectedFile();
! }
! else
! return null;
}
! protected H2dParametres projetCourant()
{
return projectManager_.currentProjet_;
}
!
! protected void ouvrir()
{
!
}
!
public void addProjet(TrProjet _o)
{
projectManager_.addProjet(_o);
! _o.active(this);
}
--- 214,287 ----
BuScrollPane sp = new BuScrollPane(taches_);
sp.setPreferredSize(new Dimension(150, 80));
! rc.addToggledComponent(
! BuResource.BU.getString("Tâches"),
! "TACHE",
! sp,
! this);
mp.setTaskView(taches_);
+ BuExplorer explorer =
+ new BuExplorer(this, false, FuFile.createFile(FuLib.getUserHome()))
+ {
+ protected void fireFileAction(String _action)
+ {
+ if (_action.equals("OUVRIR"))
+ {
+ TrImplementation.this.ouvrir(getSelectedFile().getAbsoluteFuFile());
+ }
+ }
+ };
+ //explorer.set
+ lc.addToggledComponent(
+ "Explorateur",
+ "EXPLORATEUR",
+ BuResource.BU.getIcon("explorateur"),
+ explorer,
+ true,
+ this);
setEnabledForAction("CREER", false);
setEnabledForAction("OUVRIR", true);
! setEnabledForAction("QUITTER", true);
! setEnabledForAction("PREFERENCE", true);
! setEnabledForAction("ASTUCE", false);
! projectManager_ = new TrProjectManager();
! FudaaAppliExecManager execManager =
! new FudaaAppliExecManager(this.getApplicationPreferences(), this);
! JMenu menu = execManager.getMenu("Applications", "APPLICATIONS");
! menu.setMnemonic(KeyEvent.VK_P);
! // System.out.println("nb menu " + mb.getMenuCount());
! // System.out.println("nb menu sub" + mb.getSubElements().length);
! mb.add(menu, mb.getMenuCount() - 1);
! mp.setProgression(0);
}
! protected TrProjet projetCourant()
{
return projectManager_.currentProjet_;
}
!
! public void closeProjet(TrProjet _o)
{
! projectManager_.closeProjet(_o);
! setEnabledForAction("ENREGISTRER", false);
! setEnabledForAction("ENREGISTRERSOUS", false);
! setEnabledForAction("ENREGISTRERCOPIE", true);
! setEnabledForAction("FERMER", false);
}
!
public void addProjet(TrProjet _o)
{
+ if (projetCourant() != null)
+ {
+ projetCourant().close();
+ }
projectManager_.addProjet(_o);
! _o.active();
! setEnabledForAction("ENREGISTRER", true);
! setEnabledForAction("ENREGISTRERSOUS", true);
! setEnabledForAction("ENREGISTRERCOPIE", true);
! setEnabledForAction("FERMER", true);
!
}
***************
*** 201,209 ****
public void setLastDir(File _f)
{
! if (_f == null)
! return;
! File dir = _f.getParentFile();
! if (dir.isDirectory())
! lastDir_ = dir.getAbsolutePath();
}
--- 291,295 ----
public void setLastDir(File _f)
{
! FudaaLib.setLastDir(_f);
}
***************
*** 228,241 ****
// }
public void start()
{
super.start();
! // arbre_ = new BArbreCalque();
! // arbre_.setRootVisible(false);
! // arbre_.setModel(null);
! // JScrollPane sp = new JScrollPane(arbre_);
! // sp.setSize(150, 150);
! // sp.setVisible(false);
! // getMainPanel().getRightColumn().addToggledComponent(EbliResource.EBLI.getString("Calques"), "CALQUE", sp, this);
}
--- 314,405 ----
// }
+ private void initImplHelperFromPref()
+ {
+ String id =
+ TrPreferences.TR.getStringProperty(TrPreferences.KEY_CODE_ID, null);
+ if (id == null)
+ {
+ id = askForCode();
+ }
+ implHelper_ = TrImplHelper.getImplHelper(id, this);
+ if (implHelper_ == null)
+ {
+ id = askForCode();
+ implHelper_ = TrImplHelper.getImplHelper(id, this);
+ }
+ if (implHelper_ == null)
+ error("Erreur interne", "implementation non trouvée");
+
+ }
+
+ private String askForCode()
+ {
+ String id =
+ TrPreferences.TR.getStringProperty(
+ TrPreferences.KEY_CODE_ID,
+ TrProjet.REFLUX_ID);
+ String[] choix = new String[] { TrProjet.REFLUX_ID, TrProjet.TELEMAC_ID };
+ BuDialogChoice c =
+ new BuDialogChoice(
+ this,
+ informationsSoftware(),
+ "Configuration chaîne de calcul",
+ "Veuillez sélectionner la chaîne de calcul utilisée.",
+ choix);
+ c.setSize(200, 200);
+ c.activate();
+ id = c.getValue();
+ if (FudaaLib.DEBUG)
+ System.out.println("choix " + id);
+ TrPreferences.TR.putStringProperty("tr.code.id", id);
+ TrPreferences.TR.writeIniFile();
+ return id;
+ }
+
public void start()
{
super.start();
! initImplHelperFromPref();
! final BuMenuItem[] items_ = implHelper_.getMenuItemsOuvrir();
! if ((items_ != null) && (items_.length > 0))
! {
! BuMenu ouvrirAutre =
! new BuDynamicMenu("Ouvrir autre ...", "OUVRIR_AUTRE")
! {
! private boolean built_;
! public boolean isActive()
! {
! return true;
! }
!
! public void build()
! {
! if (!built_)
! {
! //addMenuItem("Projet Télémac", PREF_OUVRIR + TrProjet.TELEMAC_ID);
! int n = items_.length;
! for (int i = 0; i < n; i++)
! {
! add(items_[i]);
! items_[i].addActionListener(TrImplementation.this);
! }
! built_ = true;
! }
!
! }
!
! };
! BuMenuBar mb = getApp().getMainMenuBar();
! mb.getMenu("MENU_FICHIER").add(ouvrirAutre, 2);
! mb.add(implHelper_.getProjetMenu(), mb.getMenuCount() - 2);
! }
!
! // arbre_ = new BArbreCalque();
! // arbre_.setRootVisible(false);
! // arbre_.setModel(null);
! // JScrollPane sp = new JScrollPane(arbre_);
! // sp.setSize(150, 150);
! // sp.setVisible(false);
! // getMainPanel().getRightColumn().addToggledComponent(EbliResource.EBLI.getString("Calques"), "CALQUE", sp, this);
}
***************
*** 243,246 ****
--- 407,421 ----
{
return isRt_;
+ }
+
+ /**
+ *
+ */
+ public void exit()
+ {
+ super.exit();
+ TrPreferences.TR.writeIniFile();
+ FudaaFavoriteFiles.INSTANCE.saveFavorites();
+ FudaaPreferences.FUDAA.writeIniFile();
}
Index: TrLib.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrLib.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrLib.java 19 May 2003 14:31:48 -0000 1.1
--- TrLib.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 27,31 ****
public static void decoreComponent(JComponent _c, boolean valide)
{
! _c.setForeground(valide ? Color.black : Color.white);
}
--- 27,31 ----
public static void decoreComponent(JComponent _c, boolean valide)
{
! _c.setForeground(valide ? Color.black : Color.red);
}
Index: TrPreferences.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrPreferences.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrPreferences.java 19 May 2003 14:31:48 -0000 1.1
--- TrPreferences.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 10,14 ****
package org.fudaa.fudaa.tr;
! import com.memoire.bu.BuPreferences;
/**
--- 10,24 ----
package org.fudaa.fudaa.tr;
! import java.io.File;
! import java.io.FileInputStream;
! import java.io.FileNotFoundException;
! import java.io.IOException;
! import java.util.Enumeration;
!
! import com.memoire.fu.FuLib;
!
! import org.fudaa.dodico.commun.DodicoLib;
! import org.fudaa.dodico.commun.DodicoPreferences;
! import org.fudaa.fudaa.commun.FudaaPreferences;
/**
***************
*** 18,29 ****
* @author Fred Deniger
*/
! public class TrPreferences
! extends BuPreferences
{
! public final static TrPreferences TR=new TrPreferences();
public void applyOn(Object _o)
{
! if(!(_o instanceof TrImplementation))
! throw new RuntimeException(""+_o+" is not a TrImplementation.");
}
}
--- 28,168 ----
* @author Fred Deniger
*/
! public class TrPreferences extends FudaaPreferences
{
! public static final String KEY_SERVEUR_PREFIXE = "serveur";
! public static final String KEY_SERVEUR_SHOW_LOG = "serveur.log";
! public static final String KEY_CODE_ID = "tr.code.id";
!
! public final static TrPreferences TR = new TrPreferences();
!
! protected TrPreferences()
! {
! File f = new File("preferences/tr.base.pref");
! if (f.exists())
! {
! try
! {
! super.defaultValues_.load(new FileInputStream(f));
! }
! catch (FileNotFoundException e)
! {
! e.printStackTrace();
! }
! catch (IOException e)
! {
! e.printStackTrace();
! }
!
! }
! f = new File("preferences/tr.pref");
! if (f.exists())
! {
! try
! {
! super.defaultValues_.load(new FileInputStream(f));
! }
! catch (FileNotFoundException e)
! {
! e.printStackTrace();
! }
! catch (IOException e)
! {
! e.printStackTrace();
! }
!
! }
! if (super.defaultValues_!=null)
! {
! String[] sysPrefixes = new String[] { "linux.", "unix.", "win." };
! String sysPrefixe = null;
! if (FuLib.isLinux())
! {
! sysPrefixe = "linux.";
! }
! else if (FuLib.isUnix())
! {
! sysPrefixe = "unix.";
! }
! else if (FuLib.isWindows())
! {
! sysPrefixe = "win.";
! }
! if (sysPrefixe != null)
! {
! String s, s2, sProp;
! for (Enumeration e = super.defaultValues_.propertyNames();
! e.hasMoreElements();
! )
! {
! s = (String) e.nextElement();
! if (s.startsWith(sysPrefixe))
! {
! s2 = s.substring(sysPrefixe.length());
! sProp = super.defaultValues_.getProperty(s);
! super.defaultValues_.remove(s);
! super.defaultValues_.put(s2, sProp);
! }
! else
! {
! int i = s.indexOf('.');
! if (i > 0)
! {
! s2 = s.substring(0, i + 1);
! if (DodicoLib.findObject(sysPrefixes, s2) >= 0)
! {
! super.defaultValues_.remove(s);
! }
! }
! }
! }
! }
! }
! }
!
!
! public String getCodePrefPrefixeReflux()
! {
! return getCodePrefPrefixe(TrProjet.REFLUX_ID);
! }
!
! public boolean isCodeRefluxDef()
! {
! return TrProjet.REFLUX_ID.equals(getStringProperty(KEY_CODE_ID, null));
! }
!
! public boolean isCodeTelemacDef()
! {
! return TrProjet.TELEMAC_ID.equals(getStringProperty(KEY_CODE_ID, null));
! }
!
! public String getCodePrefPrefixeTelemac()
! {
! return getCodePrefPrefixe(TrProjet.TELEMAC_ID);
! }
!
! public String getCodePrefPrefixe(String appli)
! {
! return DodicoPreferences.buildPrefKey(
! appli,
! TrPreferences.KEY_SERVEUR_PREFIXE);
! }
!
public void applyOn(Object _o)
{
! if (!(_o instanceof TrImplementation))
! throw new RuntimeException("" + _o + " is not a TrImplementation.");
! }
!
! public static void main(String[] args)
! {
! TrPreferences pref = new TrPreferences();
! for (Enumeration e = pref.defaultValues_.propertyNames();
! e.hasMoreElements();
! )
! {
! String s = (String) e.nextElement();
! System.out.println(s + "= " + pref.defaultValues_.getProperty(s));
! }
}
+
}
Index: TrProjectManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrProjectManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrProjectManager.java 19 May 2003 14:31:48 -0000 1.1
--- TrProjectManager.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 9,13 ****
--- 9,17 ----
package org.fudaa.fudaa.tr;
+ import java.util.ArrayList;
+ import java.util.HashSet;
import java.util.Hashtable;
+ import java.util.Iterator;
+ import java.util.Set;
import org.fudaa.dodico.h2d.H2dParametres;
***************
*** 19,28 ****
public class TrProjectManager
{
! H2dParametres currentProjet_;
! Hashtable nomProjet_;
public TrProjectManager()
{
! nomProjet_=new Hashtable(5);
}
--- 23,32 ----
public class TrProjectManager
{
! Set projets_;
! TrProjet currentProjet_;
public TrProjectManager()
{
! projets_=new HashSet(5);
}
***************
*** 31,42 ****
* Renvoie le projet courant.
*/
! public H2dParametres getCurrentProjet()
{
return currentProjet_;
}
! public boolean containsProjectTitre(String _s)
{
! return nomProjet_.containsKey(_s);
}
--- 35,52 ----
* Renvoie le projet courant.
*/
! public TrProjet getCurrentProjet()
{
return currentProjet_;
}
! public TrProjet containsProjectTitre(String _s)
{
! TrProjet p;
! for(Iterator it=projets_.iterator();it.hasNext();)
! {
! p=(TrProjet)it.next();
! if(p.getTitle().equals(_s)) return p;
! }
! return null;
}
***************
*** 46,61 ****
public boolean addProjet(TrProjet _pro)
{
! String n=_pro.getTitre();
! if(containsProjectTitre(n)) return false;
else
{
! nomProjet_.put(n,_pro);
return true;
}
}
! public H2dParametres getProjet(String _n)
{
! return (H2dParametres)nomProjet_.get(_n);
}
--- 56,78 ----
public boolean addProjet(TrProjet _pro)
{
! String n=_pro.getTitle();
! if(containsProjectTitre(n)!=null) return false;
else
{
! projets_.add(_pro);
! currentProjet_=_pro;
return true;
}
}
! public void closeProjet(TrProjet _pro)
{
! projets_.remove(_pro);
! currentProjet_=null;
! }
!
! public TrProjet getProjet(String _n)
! {
! return containsProjectTitre(_n);
}
Index: TrProjet.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrProjet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrProjet.java 19 May 2003 14:31:48 -0000 1.1
--- TrProjet.java 4 Jul 2003 15:34:57 -0000 1.2
***************
*** 9,16 ****
package org.fudaa.fudaa.tr;
! import com.memoire.bu.BuCommonImplementation;
import com.memoire.bu.BuInformationsDocument;
import org.fudaa.dodico.h2d.H2dParametres;
/**
--- 9,20 ----
package org.fudaa.fudaa.tr;
! import java.io.File;
!
import com.memoire.bu.BuInformationsDocument;
import org.fudaa.dodico.h2d.H2dParametres;
+ import org.fudaa.dodico.objet.CExec;
+ import org.fudaa.fudaa.commun.calcul.FudaaCalculAction;
+ import org.fudaa.fudaa.commun.calcul.FudaaCalculSupportInterface;
/**
***************
*** 18,35 ****
* @version $Id$
*/
! public abstract class TrProjet
{
- public String getTitre()
- {
- return getParamatres().getTitre();
- }
! public BuInformationsDocument getInformationsDocument()
! {
! return getParamatres().getInformationsDocument();
! }
! public abstract H2dParametres getParamatres();
! public abstract void active(BuCommonImplementation _impl);
}
--- 22,47 ----
* @version $Id$
*/
! public interface TrProjet extends FudaaCalculSupportInterface
{
! public static final String TELEMAC_ID="telemac2d";
! public static final String TELEMAC_DICO_ID="dico";
! public static final String REFLUX_ID="reflux";
! public String getID();
! public BuInformationsDocument getInformationsDocument();
! public void save();
! public void saveAs();
! public void saveCopy();
! public void close();
!
!
! // public TrImplementation getImpl();
! public void active();
! public String getTitle();
!
! public File getParamsFile();
! public FudaaCalculAction getCalculActions();
!
}
--- TrCellBooleanEditor.java DELETED ---
--- TrCellBooleanRenderer.java DELETED ---
--- TrCellDecorator.java DELETED ---
--- TrCellDialogEditor.java DELETED ---
--- TrCellRenderer.java DELETED ---
--- TrCellTextRenderer.java DELETED ---
--- TrEditor.java DELETED ---
--- TrEditorExterne.java DELETED ---
--- TrEditorInterface.java DELETED ---
--- TrEditorInterne.java DELETED ---
|