Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr
In directory sc8-pr-cvs1:/tmp/cvs-serv10343/tr
Modified Files:
TrFileFormatManager.java TrImplHelper.java
TrImplementation.java TrPreferences.java TrProjectManager.java
TrProjet.java
Added Files:
TrExport.java
Log Message:
Gestion de l'export pour le projet tr
--- NEW FILE: TrExport.java ---
(This appears to be a binary file; contents omitted.)
Index: TrFileFormatManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrFileFormatManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrFileFormatManager.java 18 Aug 2003 11:54:43 -0000 1.1
--- TrFileFormatManager.java 19 Aug 2003 07:48:40 -0000 1.2
***************
*** 38,42 ****
* @version $Id$
*/
! public class TrFileFormatManager implements ActionListener {
private FileFormat[] formats_;
--- 38,42 ----
* @version $Id$
*/
! public class TrFileFormatManager{
private FileFormat[] formats_;
***************
*** 67,71 ****
}
! public static FileFormat[] getFormatWhithCode(int _type, FileFormat[] _f) {
int n= _f.length;
ArrayList r= new ArrayList(n);
--- 67,75 ----
}
! /**
! * Renvoie les format du tableau dont le type est egal au parametre
! * <code>_type</code>.
! */
! public static FileFormat[] getFormatWhithType(int _type, FileFormat[] _f) {
int n= _f.length;
ArrayList r= new ArrayList(n);
***************
*** 91,96 ****
}
! public FileFormat[] getFormatWithCode(int _type) {
! return getFormatWhithCode(_type, formats_);
}
--- 95,100 ----
}
! public FileFormat[] getFormatWithType(int _type) {
! return getFormatWhithType(_type, formats_);
}
***************
*** 99,112 ****
}
! public void buildExportMenu(BuMenu _m) {
List l= H2dFileFormatType.LIST;
int n= l.size();
! //dans l'ordre des id
for (int i= 0; i < n; i++) {
H2dFileFormatType ft= (H2dFileFormatType)H2dEnumType.getIdInList(l, i);
! FileFormat[] fts= getFormatWithCode(ft.getId());
BuMenu me= new BuMenu(ft.getNom(), ft.getNom());
TreeMap map= new TreeMap();
- //pour trier
for (int j= 0; j < fts.length; j++) {
map.put(fts[j].getName(), fts[j].getID());
--- 103,121 ----
}
! /**
! * Construit le menu export a partir des type de donnees rassemblees
! * dans la classe
! * {@link org.fudaa.dodico.h2d.type.H2dFileFormatType H2dFileFormatType}.
! */
! public void buildExportMenu(BuMenu _m,TrImplementation _impl) {
List l= H2dFileFormatType.LIST;
int n= l.size();
! //on recupere les fileformat dans l'ordre des id
for (int i= 0; i < n; i++) {
H2dFileFormatType ft= (H2dFileFormatType)H2dEnumType.getIdInList(l, i);
! FileFormat[] fts= getFormatWithType(ft.getId());
BuMenu me= new BuMenu(ft.getNom(), ft.getNom());
+ //pour trier ( pas super intelligent ....)
TreeMap map= new TreeMap();
for (int j= 0; j < fts.length; j++) {
map.put(fts[j].getName(), fts[j].getID());
***************
*** 114,118 ****
for (Iterator it= map.keySet().iterator(); it.hasNext();) {
String id= (String)it.next();
! me.addMenuItem(id, "EXPORT"+(String)map.get(id), this);
}
_m.addSubMenu(me, true);
--- 123,127 ----
for (Iterator it= map.keySet().iterator(); it.hasNext();) {
String id= (String)it.next();
! me.addMenuItem(id, TrExport.EXPORT_PREF + (String)map.get(id), _impl);
}
_m.addSubMenu(me, true);
***************
*** 120,130 ****
}
- /**
- *
- */
- public void actionPerformed(ActionEvent e) {
- if (FudaaLib.DEBUG)
- System.out.println("TrFileFormatManager " + e.getActionCommand());
- }
}
--- 129,132 ----
Index: TrImplHelper.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplHelper.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TrImplHelper.java 18 Aug 2003 11:54:43 -0000 1.3
--- TrImplHelper.java 19 Aug 2003 07:48:40 -0000 1.4
***************
*** 25,43 ****
* @version $Id$
*/
! public abstract class TrImplHelper
! {
protected TrImplementation impl_;
! public TrImplHelper(TrImplementation _impl)
! {
! impl_ = _impl;
impl_.getFrame().setTitle("Superviseur " + getID());
! impl_.getFrame().setIconImage(FudaaResource.FUDAA.getIcon("appli/" + getID()).getImage());
!
}
! public TrImplementation getImpl()
! {
return impl_;
}
--- 25,40 ----
* @version $Id$
*/
! public abstract class TrImplHelper {
protected TrImplementation impl_;
! public TrImplHelper(TrImplementation _impl) {
! impl_= _impl;
impl_.getFrame().setTitle("Superviseur " + getID());
! impl_.getFrame().setIconImage(
! FudaaResource.FUDAA.getIcon("appli/" + getID()).getImage());
}
! public TrImplementation getImpl() {
return impl_;
}
***************
*** 46,93 ****
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 static TrImplHelper getImplHelper(String _id, TrImplementation _impl)
! {
! if(FudaaLib.DEBUG) System.out.println("Choix impl helper");
! if (_impl.getCurrentImplHelper() != null)
! {
! if (_id.equals(_impl.getCurrentImplHelper().getID()))
! {
! if(FudaaLib.DEBUG) System.out.println("impl courant");
return _impl.getCurrentImplHelper();
}
}
! if (_id.equals(FileFormatSoftware.REFLUX_IS.name))
! {
! if(FudaaLib.DEBUG) System.out.println("impl reflux");
return new TrRefluxImplHelper(_impl);
! }
! else if (_id.equals(FileFormatSoftware.TELEMAC_IS.name))
! {
! if(FudaaLib.DEBUG) System.out.println("impl telemac");
return new TrTelemacImplHelper(_impl);
}
return null;
}
-
-
}
--- 43,75 ----
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 static TrImplHelper getImplHelper(
! String _id,
! TrImplementation _impl) {
! if (_impl.getCurrentImplHelper() != null) {
! if (_id.equals(_impl.getCurrentImplHelper().getID())) {
return _impl.getCurrentImplHelper();
}
}
! if (_id.equals(FileFormatSoftware.REFLUX_IS.name)) {
return new TrRefluxImplHelper(_impl);
! } else if (_id.equals(FileFormatSoftware.TELEMAC_IS.name)) {
return new TrTelemacImplHelper(_impl);
}
return null;
}
}
Index: TrImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplementation.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TrImplementation.java 18 Aug 2003 11:54:43 -0000 1.3
--- TrImplementation.java 19 Aug 2003 07:48:40 -0000 1.4
***************
*** 183,186 ****
--- 183,189 ----
} else if ("MODIFIER_CHAINE".equals(action)) {
changeChaineCalcul();
+ } else if (action.startsWith(TrExport.EXPORT_PREF)){
+ projetCourant().export(action);
+
} else {
super.actionPerformed(_evt);
***************
*** 445,457 ****
*/
public void exit() {
- super.exit();
TrPreferences.TR.writeIniFile();
FudaaFavoriteFiles.INSTANCE.saveFavorites();
FudaaPreferences.FUDAA.writeIniFile();
}
private void buildExporterMenu() {
fileFormatMng_.buildExportMenu(
! (BuMenu)getMainMenuBar().getMenu("EXPORTER"));
}
--- 448,460 ----
*/
public void exit() {
TrPreferences.TR.writeIniFile();
FudaaFavoriteFiles.INSTANCE.saveFavorites();
FudaaPreferences.FUDAA.writeIniFile();
+ super.exit();
}
private void buildExporterMenu() {
fileFormatMng_.buildExportMenu(
! (BuMenu)getMainMenuBar().getMenu("EXPORTER"),this);
}
Index: TrPreferences.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrPreferences.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TrPreferences.java 18 Aug 2003 11:54:43 -0000 1.3
--- TrPreferences.java 19 Aug 2003 07:48:40 -0000 1.4
***************
*** 30,167 ****
* @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(FileFormatSoftware.REFLUX_IS.name);
! }
!
! public boolean isCodeRefluxDef()
! {
! return FileFormatSoftware.REFLUX_IS.name.equals(getStringProperty(KEY_CODE_ID, null));
! }
!
! public boolean isCodeTelemacDef()
! {
! return FileFormatSoftware.TELEMAC_IS.name.equals(getStringProperty(KEY_CODE_ID, null));
}
! public String getCodePrefPrefixeTelemac()
! {
! return getCodePrefPrefixe(FileFormatSoftware.TELEMAC_IS.name);
! }
! 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));
}
--- 30,133 ----
* @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();
! // }
! // }
! File 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();
}
}
! // 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(FileFormatSoftware.REFLUX_IS.name);
! // }
! //
! // public boolean isCodeRefluxDef() {
! // return FileFormatSoftware.REFLUX_IS.name.equals(
! // getStringProperty(KEY_CODE_ID, null));
! // }
! //
! // public boolean isCodeTelemacDef() {
! // return FileFormatSoftware.TELEMAC_IS.name.equals(
! // getStringProperty(KEY_CODE_ID, null));
! // }
! //
! // public String getCodePrefPrefixeTelemac() {
! // return getCodePrefPrefixe(FileFormatSoftware.TELEMAC_IS.name);
! // }
! /**
! * Renvoie l'identifiant pour l'appli <code>appli</code>
! */
! // 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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrProjectManager.java 4 Jul 2003 15:34:57 -0000 1.2
--- TrProjectManager.java 19 Aug 2003 07:48:40 -0000 1.3
***************
*** 9,19 ****
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;
/**
--- 9,15 ----
Index: TrProjet.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrProjet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TrProjet.java 18 Aug 2003 11:54:43 -0000 1.3
--- TrProjet.java 19 Aug 2003 07:48:40 -0000 1.4
***************
*** 13,18 ****
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;
--- 13,16 ----
***************
*** 41,44 ****
--- 39,43 ----
public File getParamsFile();
public FudaaCalculAction getCalculActions();
+ public void export(String _actionCommand);
}
|