Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7396/src/org/fudaa/fudaa/tr/common Modified Files: TrCommonImplementation.java TrExplorer.java TrImplHelperAbstract.java TrParametres.java TrXmlProjectWriter.java tr_en.fr_txt TrFileFormatManager.java TrProjet.java TrProjectDispatcherListener.java TrXmlProjectReader.java TrApplicationManager.java Added Files: TrXmlData.java TrInformationsDocument.java TrInformationSystem.java Log Message: Ajout de rubar Index: TrFileFormatManager.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TrFileFormatManager.java 1 Jun 2004 11:27:43 -0000 1.2 --- TrFileFormatManager.java 11 Jun 2004 16:40:37 -0000 1.3 *************** *** 58,63 **** public static TrFileFormatManager INSTANCE=new TrFileFormatManager(); ! public static String getXmlName(String _ficSansExt){ ! return _ficSansExt+"."+XML_EXT; } --- 58,63 ---- public static TrFileFormatManager INSTANCE=new TrFileFormatManager(); ! public static String getXmlName(String _fic){ ! return _fic+"."+XML_EXT; } Index: TrParametres.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrParametres.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TrParametres.java 5 May 2004 12:42:37 -0000 1.1 --- TrParametres.java 11 Jun 2004 16:40:37 -0000 1.2 *************** *** 1,4 **** ! /* ! * @file TrParametres.java * @creation 20 août 2003 * @modification $Date$ --- 1,3 ---- ! /** * @creation 20 août 2003 * @modification $Date$ Index: TrProjet.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrProjet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TrProjet.java 1 Jun 2004 11:27:43 -0000 1.2 --- TrProjet.java 11 Jun 2004 16:40:37 -0000 1.3 *************** *** 29,33 **** public String getSoftwareID(); public boolean isModified(); ! public void active(TrImplementationEditorAbstract _impl); public String getTitle(); public File getParamsFile(); --- 29,33 ---- public String getSoftwareID(); public boolean isModified(); ! public void active(); public String getTitle(); public File getParamsFile(); *************** *** 42,44 **** --- 42,47 ---- public void activeGrapheFille(); public void applicationPreferencesChanged(); + public TrXmlData[] getXmlDataToSave(); + public void initFromXmlData(TrXmlData[] _l); + } Index: TrCommonImplementation.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrCommonImplementation.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TrCommonImplementation.java 1 Jun 2004 11:27:43 -0000 1.1 --- TrCommonImplementation.java 11 Jun 2004 16:40:37 -0000 1.2 *************** *** 9,25 **** import java.awt.Dimension; import java.awt.event.ActionEvent; ! import java.awt.event.WindowEvent; import java.io.File; import javax.swing.JComponent; - import javax.swing.JFrame; import javax.swing.JInternalFrame; - import javax.swing.JLabel; - import javax.swing.JPanel; import javax.swing.JScrollPane; ! import javax.swing.MenuSelectionManager; ! import javax.swing.SwingUtilities; ! import javax.swing.WindowConstants; import javax.swing.event.InternalFrameEvent; --- 9,23 ---- import java.awt.Dimension; + import java.awt.Frame; import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.awt.event.KeyEvent; import java.io.File; + import java.util.Locale; import javax.swing.JComponent; import javax.swing.JInternalFrame; import javax.swing.JScrollPane; ! import javax.swing.KeyStroke; import javax.swing.event.InternalFrameEvent; *************** *** 32,51 **** import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.fudaa.commun.FudaaCommonImplementation; import org.fudaa.fudaa.commun.FudaaPreferences; - import org.fudaa.fudaa.commun.aide.FudaaAidePreferencesPanel; import org.fudaa.fudaa.fdico.FDicoPreferences; - import org.fudaa.fudaa.meshviewer.controle.MvControlResult; - import com.memoire.bu.BuApplication; - import com.memoire.bu.BuBrowserPreferencesPanel; import com.memoire.bu.BuColumn; import com.memoire.bu.BuDesktopPreferencesPanel; import com.memoire.bu.BuInformationsSoftware; - import com.memoire.bu.BuLabel; import com.memoire.bu.BuLanguagePreferencesPanel; import com.memoire.bu.BuLib; import com.memoire.bu.BuLookPreferencesPanel; import com.memoire.bu.BuMainPanel; ! import com.memoire.bu.BuPopupMenu; import com.memoire.bu.BuPreferences; import com.memoire.bu.BuPreferencesEditorPanel; --- 30,47 ---- import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.fudaa.commun.FudaaCommonImplementation; + import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.FudaaPreferences; import org.fudaa.fudaa.fdico.FDicoPreferences; import com.memoire.bu.BuColumn; import com.memoire.bu.BuDesktopPreferencesPanel; + import com.memoire.bu.BuIcon; import com.memoire.bu.BuInformationsSoftware; import com.memoire.bu.BuLanguagePreferencesPanel; import com.memoire.bu.BuLib; import com.memoire.bu.BuLookPreferencesPanel; import com.memoire.bu.BuMainPanel; ! import com.memoire.bu.BuMenuBar; ! import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuPreferences; import com.memoire.bu.BuPreferencesEditorPanel; *************** *** 55,58 **** --- 51,55 ---- import com.memoire.bu.BuToolBar; import com.memoire.bu.BuUserPreferencesPanel; + import com.memoire.fu.FuLib; /** *************** *** 62,73 **** public abstract class TrCommonImplementation extends FudaaCommonImplementation { public void init() { super.init(); removeUnusedActions(); setEnabledForAction("QUITTER", true); } ! protected BuPreferencesEditorPanel buildPreferences() { ! BuPreferencesEditorPanel r= new BuPreferencesEditorPanel(); r.addTab(new BuUserPreferencesPanel(this)); r.addTab(new BuLanguagePreferencesPanel(this)); --- 59,92 ---- public abstract class TrCommonImplementation extends FudaaCommonImplementation { + /** + * @see com.memoire.bu.BuCommonInterface#init() + */ public void init() { super.init(); removeUnusedActions(); + BuMenuBar b = getMainMenuBar(); + b.getMenu("MENU_AIDE").add(buildAideContextItem(this), 0); setEnabledForAction("QUITTER", true); + setEnabledForAction("PREFERENCE", true); + setEnabledForAction("MAJ", true); + if (!isSupervisor()) { + BuToolBar tb = getMainToolBar(); + tb.addToolButton(TrResource.getSupervisorName(), TrResource.getS("ouvrir le superviseur"), + "SUPERVISEUR", TrResource.getSupervisorIcon(), true).setVisible(true); + } } ! ! protected static BuMenuItem buildAideContextItem(ActionListener _l) { ! BuMenuItem it = new BuMenuItem(BuResource.BU.getIcon("aide"), BuResource.BU.getString("Aide")); ! it.setActionCommand("AIDE"); ! it.setEnabled(true); ! it.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0, false)); ! if (_l != null) it.addActionListener(_l); ! return it; ! ! } ! protected BuPreferencesEditorPanel buildPreferences() { ! BuPreferencesEditorPanel r = new BuPreferencesEditorPanel(); r.addTab(new BuUserPreferencesPanel(this)); r.addTab(new BuLanguagePreferencesPanel(this)); *************** *** 140,143 **** --- 159,163 ---- removeAction("POINTEURAIDE"); removeAction("INDEX_THEMA"); + removeAction("INDEX_ALPHA"); removeAction("PROPRIETE"); removeAction("PLEINECRAN"); *************** *** 145,148 **** --- 165,171 ---- } + /** + * @return true si superviseur + */ public boolean isSupervisor() { return false; *************** *** 154,164 **** public void start() { super.start(); ! if (!isSupervisor()) { ! BuToolBar tb = getMainToolBar(); ! tb.addToolButton(TrResource.getSupervisorName(), TrResource.getS("ouvrir le superviseur"), ! "SUPERVISEUR", TrResource.getSupervisorIcon(), true); ! } } private void updateArbre() { if (arbre_ != null) { --- 177,190 ---- public void start() { super.start(); ! Frame f = getFrame(); ! f.setTitle(getSpecificName()); ! f.setIconImage(getSpecificIcon().getImage()); ! f.repaint(); } + protected abstract String getSpecificName(); + + protected abstract BuIcon getSpecificIcon(); + private void updateArbre() { if (arbre_ != null) { *************** *** 219,227 **** launcher_ = _l; } ! ! public TrLauncher getLauncher(){ return launcher_; } protected abstract void ouvrir(); --- 245,257 ---- launcher_ = _l; } ! ! public TrLauncher getLauncher() { return launcher_; } + public String getSpecificHtmlHelp() { + return null; + } + protected abstract void ouvrir(); *************** *** 230,238 **** */ public void actionPerformed(ActionEvent _evt) { ! if (_evt.getActionCommand().equals("SUPERVISEUR")) launcher_.openSupervisor(); ! else if (_evt.getActionCommand().equals("OUVRIR")) ouvrir(); else super.actionPerformed(_evt); } protected void savePref() { TrPreferences.TR.writeIniFile(); --- 260,296 ---- */ public void actionPerformed(ActionEvent _evt) { ! String act = _evt.getActionCommand(); ! if (act.equals("SUPERVISEUR")) launcher_.openSupervisor(); ! else if (act.equals("OUVRIR")) ouvrir(); ! else if (act.equals("AIDE")) displayAide(); ! else if (act.equals("AIDE_INDEX")) displayAideIndex(); ! else if (act.equals("MAJ")) maj(); else super.actionPerformed(_evt); } + protected void maj() { + if (FudaaLib.isLocalFrench()) { + displayURL(getInformationsSoftware().update + "&lang=fr"); + } + else displayURL(getInformationsSoftware().update); + } + + protected void displayAide() { + String m = launcher_.getCurrentPrefHydId(); + String spec = getSpecificHtmlHelp(); + if (spec != null) displayURL(getInformationsSoftware().man + m + "/" + spec); + else displayAideIndex(); + } + + protected void displayAideIndex() { + String m = launcher_.getCurrentPrefHydId(); + if (FudaaLib.isLocalFrench()) { + displayURL(getInformationsSoftware().man + m + "/index.html"); + } + else { + displayURL(getInformationsSoftware().man + m + "/index.en.html"); + } + } + protected void savePref() { TrPreferences.TR.writeIniFile(); *************** *** 243,245 **** --- 301,307 ---- } + + public void installContextHelp(JComponent _cp, String _url) {} + + public void installContextHelp(JComponent _cp) {} } \ No newline at end of file Index: tr_en.fr_txt =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tr_en.fr_txt 1 Jun 2004 11:27:43 -0000 1.3 --- tr_en.fr_txt 11 Jun 2004 16:40:37 -0000 1.4 *************** *** 211,213 **** Ce n'est pas le dossier des exécutable telemac=It's the Telemac binaries folder Exécutable non trouvé=Executable not found ! Vous pouvez modifier le dossier des exécutables Telemac dans le panneau des préférences (Alt+F2)=You can modify the Telemac binary folder thanks to the preferences panel (Alt+F2). \ No newline at end of file --- 211,228 ---- Ce n'est pas le dossier des exécutable telemac=It's the Telemac binaries folder Exécutable non trouvé=Executable not found ! Vous pouvez modifier le dossier des exécutables Telemac dans le panneau des préférences (Alt+F2)=You can modify the Telemac binary folder thanks to the preferences panel (Alt+F2). ! Créer projet Telemac=Create a Telemac project ! Fixe=Constant ! Variable en temps=Variable in time ! Variable en l'espace=Variable in space ! Libre=Free ! Imposé sur ce bord=Imposed on this boundary ! Reflux fait appel à l'optimiseur de bande OLB. Vous pouvez préciser le chemin de l'exécutable dans le panneau de préférences.=Reflux needs OLB to create a new project. you can specify the path for the OLB executable thanks to the preferences panel. ! Reflux ne fonctionne pas sur votre système=Reflux is not compatible with your system. ! Répertoire des exécutable Reflux=Reflux executables folder ! Répertoire des exécutable OLB=OLB executables folder ! répertoire non valide=Not valid folder ! Les variables {0} ne sont pas entièrement spécifiées.=The {0} variables are not well specified. ! Les points libres seront fixés à 0.=The free points will be fixed to 0. ! Nombre d'arêtes=Number of edges ! Arêtes externes=Extern edges \ No newline at end of file Index: TrApplicationManager.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TrApplicationManager.java 1 Jun 2004 11:27:43 -0000 1.3 --- TrApplicationManager.java 11 Jun 2004 16:40:37 -0000 1.4 *************** *** 294,298 **** */ public FudaaExecConsole() { ! super("console"); } --- 294,298 ---- */ public FudaaExecConsole() { ! super(TrResource.getS("console")); } *************** *** 410,413 **** --- 410,414 ---- */ public void execInDir(File _dir, FudaaUI _ui) { + System.out.println("launch post"); launcher_.openPost(null); } --- NEW FILE: TrInformationsDocument.java --- /** * @creation 7 juin 2004 * @modification $Date: 2004/06/11 16:40:37 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.common; import com.memoire.bu.BuInformationsDocument; /** * @author Fred Deniger * @version $Id: TrInformationsDocument.java,v 1.1 2004/06/11 16:40:37 deniger Exp $ */ public class TrInformationsDocument implements TrXmlData { public BuInformationsDocument doc_; /** * */ public TrInformationsDocument() { super(); } /** * @see org.fudaa.fudaa.tr.common.TrXmlData#initProjectFromData(org.fudaa.fudaa.tr.common.TrProjet) */ public void initProjectFromData(TrProjet _target) {} } --- NEW FILE: TrXmlData.java --- /** * @creation 7 juin 2004 * @modification $Date: 2004/06/11 16:40:37 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.common; /** * @author Fred Deniger * @version $Id: TrXmlData.java,v 1.1 2004/06/11 16:40:37 deniger Exp $ */ public interface TrXmlData { public void initProjectFromData(TrProjet _target); } Index: TrProjectDispatcherListener.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrProjectDispatcherListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TrProjectDispatcherListener.java 1 Jun 2004 11:27:43 -0000 1.2 --- TrProjectDispatcherListener.java 11 Jun 2004 16:40:37 -0000 1.3 *************** *** 1,4 **** ! /* ! * @file TrH2dProjectListener.java @creation 13 nov. 2003 @modification $Date$ * @license GNU General Public License 2 @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 * Compiegne @mail de...@fu... --- 1,4 ---- ! /** ! * @creation 13 nov. 2003 @modification $Date$ * @license GNU General Public License 2 @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 * Compiegne @mail de...@fu... *************** *** 7,10 **** --- 7,11 ---- import java.awt.Frame; + import java.io.File; import org.fudaa.ctulu.CtuluLib; *************** *** 20,23 **** --- 21,26 ---- import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.fudaa.commun.FudaaLib; + + import com.memoire.fu.FuLib; /** * @author deniger *************** *** 41,60 **** } ! protected static void changedMainFrameState(boolean _modified, Frame _f) { ! String s = _f.getTitle(); ! if (_modified) { ! if (!s.startsWith("*")) { ! _f.setTitle("*" + s); ! } ! } ! else { ! if (s.startsWith("*")) { ! _f.setTitle(s.substring(1)); ! } ! } } /** ! * */ public void bcBoundaryTypeChanged(H2dBoundary b, H2dBoundaryType _old) { --- 44,62 ---- } ! /** ! * @param _modified ! * @param _f ! * @param _p ! */ ! public static void changedMainFrameState(boolean _modified, Frame _f, TrProjet _p) { ! File f = _p.getParamsFile(); ! String s = _p.getSoftwareID() + ": " ! + (f == null ? "?" : FuLib.reducedPath(f.getAbsolutePath())) ! + (_modified ? "*" : CtuluLib.EMPTY_STRING); ! _f.setTitle(s); } /** ! * @see org.fudaa.dodico.h2d.H2dBcListener#bcBoundaryTypeChanged(org.fudaa.dodico.h2d.H2dBoundary, org.fudaa.dodico.h2d.type.H2dBoundaryType) */ public void bcBoundaryTypeChanged(H2dBoundary b, H2dBoundaryType _old) { *************** *** 63,67 **** /** ! * */ public void dicoParamsEntiteRemoved(DicoParams _cas, DicoEntite _ent, String _oldValue) { --- 65,69 ---- /** ! * @see org.fudaa.dodico.dico.DicoParamsListener#dicoParamsEntiteRemoved(org.fudaa.dodico.dico.DicoParams, org.fudaa.dodico.dico.DicoEntite, java.lang.String) */ public void dicoParamsEntiteRemoved(DicoParams _cas, DicoEntite _ent, String _oldValue) { *************** *** 70,74 **** /** ! * */ public void dicoParamsEntiteAdded(DicoParams _cas, DicoEntite _ent) { --- 72,76 ---- /** ! * @see org.fudaa.dodico.dico.DicoParamsListener#dicoParamsEntiteAdded(org.fudaa.dodico.dico.DicoParams, org.fudaa.dodico.dico.DicoEntite) */ public void dicoParamsEntiteAdded(DicoParams _cas, DicoEntite _ent) { *************** *** 77,81 **** /** ! * */ public void dicoParamsEntiteUpdated(DicoParams _cas, DicoEntite _ent, String _oldValue) { --- 79,83 ---- /** ! * @see org.fudaa.dodico.dico.DicoParamsListener#dicoParamsEntiteUpdated(org.fudaa.dodico.dico.DicoParams, org.fudaa.dodico.dico.DicoEntite, java.lang.String) */ public void dicoParamsEntiteUpdated(DicoParams _cas, DicoEntite _ent, String _oldValue) { *************** *** 85,89 **** /** ! * */ public void dicoParamsValidStateEntiteUpdated(DicoParams _cas, DicoEntite _ent) { --- 87,91 ---- /** ! * @see org.fudaa.dodico.dico.DicoParamsListener#dicoParamsValidStateEntiteUpdated(org.fudaa.dodico.dico.DicoParams, org.fudaa.dodico.dico.DicoEntite) */ public void dicoParamsValidStateEntiteUpdated(DicoParams _cas, DicoEntite _ent) { *************** *** 92,106 **** /** ! * */ public void dicoParamsProjectModifyStateChanged(DicoParams _cas) {} /** ! * */ public void dicoParamsStateLoadedEntiteChanged(DicoParams _cas, DicoEntite _ent) {} /** ! * */ public void bcFrontierStructureChanged(H2dBcFrontierInterface _b) { --- 94,108 ---- /** ! * @see org.fudaa.dodico.dico.DicoParamsListener#dicoParamsProjectModifyStateChanged(org.fudaa.dodico.dico.DicoParams) */ public void dicoParamsProjectModifyStateChanged(DicoParams _cas) {} /** ! * @see org.fudaa.dodico.dico.DicoParamsListener#dicoParamsStateLoadedEntiteChanged(org.fudaa.dodico.dico.DicoParams, org.fudaa.dodico.dico.DicoEntite) */ public void dicoParamsStateLoadedEntiteChanged(DicoParams _cas, DicoEntite _ent) {} /** ! * @see org.fudaa.dodico.h2d.H2dBcListener#bcFrontierStructureChanged(org.fudaa.dodico.h2d.H2dBcFrontierInterface) */ public void bcFrontierStructureChanged(H2dBcFrontierInterface _b) { *************** *** 109,113 **** /** ! * */ public void bcParametersChanged(H2dBoundary _b, H2dVariableType _t) { --- 111,115 ---- /** ! * @see org.fudaa.dodico.h2d.H2dBcListener#bcParametersChanged(org.fudaa.dodico.h2d.H2dBoundary, org.fudaa.dodico.h2d.type.H2dVariableType) */ public void bcParametersChanged(H2dBoundary _b, H2dVariableType _t) { *************** *** 118,122 **** /** ! * */ public void bcPointsParametersChanged(H2dVariableType _t) { --- 120,124 ---- /** ! * @see org.fudaa.dodico.h2d.H2dBcListener#bcPointsParametersChanged(org.fudaa.dodico.h2d.type.H2dVariableType) */ public void bcPointsParametersChanged(H2dVariableType _t) { *************** *** 126,130 **** /** ! * */ public void evolutionChanged(EvolutionReguliere _e) { --- 128,132 ---- /** ! * @see org.fudaa.dodico.mesure.EvolutionListener#evolutionChanged(org.fudaa.dodico.mesure.EvolutionReguliere) */ public void evolutionChanged(EvolutionReguliere _e) { *************** *** 134,138 **** /** ! * */ public void evolutionUsedChanged(H2dEvolution _e, int _old, int _new, boolean _isAdjusting) { --- 136,140 ---- /** ! * @see org.fudaa.dodico.h2d.H2dEvolutionListener#evolutionUsedChanged(org.fudaa.dodico.h2d.H2dEvolution, int, int, boolean) */ public void evolutionUsedChanged(H2dEvolution _e, int _old, int _new, boolean _isAdjusting) { *************** *** 148,152 **** /** ! * */ public void evolutionAdd(EvolutionReguliere _e) { --- 150,154 ---- /** ! * @see org.fudaa.dodico.mesure.EvolutionListener#evolutionAdd(org.fudaa.dodico.mesure.EvolutionReguliere) */ public void evolutionAdd(EvolutionReguliere _e) { *************** *** 156,159 **** --- 158,164 ---- } + /** + * @see org.fudaa.dodico.mesure.EvolutionListener#evolutionRemove(org.fudaa.dodico.mesure.EvolutionReguliere) + */ public void evolutionRemove(EvolutionReguliere _e) { super.evolutionRemove(_e); Index: TrImplHelperAbstract.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrImplHelperAbstract.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TrImplHelperAbstract.java 1 Jun 2004 11:27:43 -0000 1.2 --- TrImplHelperAbstract.java 11 Jun 2004 16:40:37 -0000 1.3 *************** *** 12,15 **** --- 12,16 ---- import java.io.File; + import javax.swing.Icon; import javax.swing.JMenu; *************** *** 32,40 **** TrApplicationManager mng_; /** * @param _mng l'appli manager */ public TrImplHelperAbstract(TrApplicationManager _mng) { ! mng_=_mng; } --- 33,42 ---- TrApplicationManager mng_; + /** * @param _mng l'appli manager */ public TrImplHelperAbstract(TrApplicationManager _mng) { ! mng_ = _mng; } *************** *** 71,87 **** && (((BuDynamicMenu) c).getActionCommand().equals("OUVRIR_AUTRE"))) menu.remove(c); } - - /** * Activation de la chaine */ public void active(TrImplementationEditorAbstract _impl) { ! _impl.getFrame().setTitle( ! TrResource.getS("Editeur")); ! // _impl.getFrame().setIconImage( ! // FudaaResource.FUDAA.getIcon("appli/" + getSoftwareID()).getImage()); addOuvrirAutre(_impl); ! // _impl.addMenu(appliMng_.getAppliMenu(), _impl.getNbMenuInMenuBar() - 1); } --- 73,88 ---- && (((BuDynamicMenu) c).getActionCommand().equals("OUVRIR_AUTRE"))) menu.remove(c); } /** * Activation de la chaine + * + * @param _impl l'impl cible */ public void active(TrImplementationEditorAbstract _impl) { ! _impl.getFrame().setTitle(TrResource.getS("Editeur")); ! Icon ic = FudaaResource.FUDAA.getIcon("appli/" + getSoftwareID()); ! if (ic != null) _impl.getMainPanel().getDesktop().setLogo(ic); addOuvrirAutre(_impl); ! // _impl.addMenu(appliMng_.getAppliMenu(), _impl.getNbMenuInMenuBar() - 1); } *************** *** 93,98 **** * @return un nouveau projet */ ! public abstract TrProjet creer(TrImplementationEditorAbstract _impl,ProgressionInterface _op, File _initGrid, BuTask _t); ! /** --- 94,99 ---- * @return un nouveau projet */ ! public abstract TrProjet creer(TrImplementationEditorAbstract _impl, ProgressionInterface _op, ! File _initGrid, BuTask _t); /** *************** *** 113,117 **** * @return le projet ouvert */ ! public abstract TrProjet ouvrir(TrImplementationEditorAbstract _impl,ProgressionInterface _op, BuTask _t); /** --- 114,119 ---- * @return le projet ouvert */ ! public abstract TrProjet ouvrir(TrImplementationEditorAbstract _impl, ProgressionInterface _op, ! BuTask _t); /** *************** *** 121,125 **** * @return le projet ouvert */ ! public abstract TrProjet ouvrir(TrImplementationEditorAbstract _impl,ProgressionInterface _op, File _f, BuTask _t); /** --- 123,128 ---- * @return le projet ouvert */ ! public abstract TrProjet ouvrir(TrImplementationEditorAbstract _impl, ProgressionInterface _op, ! File _f, BuTask _t); /** *************** *** 132,136 **** } - public TrApplicationManager getAppliMng() { return mng_; --- 135,138 ---- Index: TrXmlProjectWriter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrXmlProjectWriter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TrXmlProjectWriter.java 5 May 2004 12:42:37 -0000 1.1 --- TrXmlProjectWriter.java 11 Jun 2004 16:40:37 -0000 1.2 *************** *** 1,4 **** ! /* ! * @file TrXmlProject.java * @creation 15 mars 2004 * @modification $Date$ --- 1,3 ---- ! /** * @creation 15 mars 2004 * @modification $Date$ *************** *** 9,20 **** package org.fudaa.fudaa.tr.common; import java.io.IOException; - import java.io.Writer; - - import com.memoire.bu.BuInformationsDocument; - - import org.fudaa.ctulu.CtuluLib; - import org.fudaa.dodico.commun.DodicoAnalyze; /** --- 8,16 ---- package org.fudaa.fudaa.tr.common; + import java.io.File; + import java.io.FileOutputStream; import java.io.IOException; + import org.fudaa.dodico.boony.BoonyXmlSerializer; /** *************** *** 22,100 **** * @version $Id$ */ ! public abstract class TrXmlProjectWriter { ! String enconding_; ! protected Writer out_; ! String lineSep_; ! protected DodicoAnalyze a_; /** * */ ! public TrXmlProjectWriter() { ! lineSep_ = CtuluLib.LINE_SEP; ! enconding_ = System.getProperty("file.encoding"); ! if (enconding_ == null) { ! if (CtuluLib.isFrenchLanguageSelected()) ! enconding_ = "ISO-8859-1"; ! else enconding_ = "UTF-8"; ! } } /** ! * @return le projet en question ! */ ! public abstract TrParametres getProjet(); ! ! /** ! * Ecriture du fichier */ ! public final void writeFile() { ! a_ = new DodicoAnalyze(); try { ! out_.write("<project>"); ! writeDocInfo(getProjet().getInformationsDocument()); ! writeData(); ! out_.write("</project>"); ! out_.close(); } catch (IOException e) { ! a_.manageException(e); } - } - - - /** - * Ecrit les donnees specifiques du projet - * - * @throws IOException - */ - protected void writeData() throws IOException {} - - /** - * @param _doc la doc - * @throws IOException - */ - protected final void writeDocInfo(BuInformationsDocument _doc) throws IOException { - out_.write("<doc>"); - write("author", _doc.author); - write("date", _doc.date); - write("version", _doc.version); - write("location", _doc.location); - write("comment", _doc.comment); - out_.write("</doc>"); - } - protected void write(String _xmlTag, String _n) throws IOException { - if ((_n != null) && (_n.length() > 0)) - out_.write("<" + _xmlTag + ">" + _n + "</" + _xmlTag + ">" + lineSep_); } ! /** ! * @param _l la ligne a ecrire ! * @throws IOException ! */ ! public void writeln(String _l) throws IOException { ! out_.write(_l + lineSep_); ! } ! } --- 18,60 ---- * @version $Id$ */ ! public final class TrXmlProjectWriter { ! TrProjet p_; ! TrXmlData[] ds_; /** * */ ! public TrXmlProjectWriter(TrProjet _p) { ! p_ = _p; ! ds_ = _p.getXmlDataToSave(); } /** ! * @param _f */ ! public void write(File _f) { ! if (ds_ == null) return; ! BoonyXmlSerializer xml = null; try { ! xml = new BoonyXmlSerializer(false); ! xml.open(new FileOutputStream(_f)); ! for (int i = 0; i < ds_.length; i++) { ! xml.write(ds_[i]); ! } } catch (IOException e) { ! e.printStackTrace(); ! } ! finally { ! try { ! xml.close(); ! } ! catch (IOException e1) { ! e1.printStackTrace(); ! } } } ! } \ No newline at end of file --- NEW FILE: TrInformationSystem.java --- /** * @creation 7 juin 2004 * @modification $Date: 2004/06/11 16:40:37 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.common; /** * @author Fred Deniger * @version $Id: TrInformationSystem.java,v 1.1 2004/06/11 16:40:37 deniger Exp $ */ public class TrInformationSystem implements TrXmlData{ /** * L'identifiant du systeme Reflux,Telemac ou Rubar */ public String id_; /** * Le langage choisi pour la modelisation. * Typique Telemac */ public String language_; /** * La version du systeme utilise pour le projet */ public String version_; /** * Subief, Telemac 2d, Courantologie 2d, 3d,etc */ public String modelType_; /** * */ public TrInformationSystem() { super(); } public void initProjectFromData(TrProjet _target) {} } Index: TrExplorer.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrExplorer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TrExplorer.java 1 Jun 2004 11:27:43 -0000 1.3 --- TrExplorer.java 11 Jun 2004 16:40:37 -0000 1.4 *************** *** 31,35 **** * @version $id$ */ ! public class TrExplorer extends FudaaExplorer implements Observer { private class ExplorerMenuItem extends BuMenuItem { --- 31,35 ---- * @version $id$ */ ! public class TrExplorer extends FudaaExplorer { private class ExplorerMenuItem extends BuMenuItem { *************** *** 99,103 **** public TrExplorer(TrCommonImplementation _impl, TrApplicationManager _appli, FuFile _path) { super(_impl, true, _path); ! EbliFavoriteFiles.INSTANCE.setObserver(this); ui_=_impl; miAntBuild_ = null; --- 99,103 ---- public TrExplorer(TrCommonImplementation _impl, TrApplicationManager _appli, FuFile _path) { super(_impl, true, _path); ! ui_=_impl; miAntBuild_ = null; *************** *** 174,186 **** } ! /** ! * @see java.util.Observer#update(java.util.Observable, java.lang.Object) ! */ ! public void update(Observable _o, Object _arg) { ! roots_.removeActionListener(this); ! roots_.removeAllItems(); ! super.addMtab(); ! roots_.addActionListener(this); ! } protected void updateMenuCurrent() { --- 174,178 ---- } ! protected void updateMenuCurrent() { Index: TrXmlProjectReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/common/TrXmlProjectReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TrXmlProjectReader.java 5 May 2004 12:42:36 -0000 1.1 --- TrXmlProjectReader.java 11 Jun 2004 16:40:37 -0000 1.2 *************** *** 1,4 **** ! /* ! * @file TrXmlProjectReader.java * @creation 16 mars 2004 * @modification $Date$ --- 1,3 ---- ! /** * @creation 16 mars 2004 * @modification $Date$ *************** *** 10,114 **** import java.io.File; import java.io.IOException; ! import java.util.HashMap; ! import java.util.Map; ! ! import com.memoire.bu.BuInformationsDocument; ! import com.memoire.xml.XmlListener; ! import com.memoire.xml.XmlParser; import org.fudaa.fudaa.commun.FudaaUI; - /** * @author Fred Deniger * @version $Id$ */ ! public class TrXmlProjectReader implements XmlListener{ ! ! /** ! * Reader pour la documentation ! */ ! public class DocXmlReader implements XmlListener{ ! private final int author_=1; ! private final int date_=author_+1; ! private final int comment_=date_+1; ! ! int data_; ! ! ! /** ! * @see com.memoire.xml.XmlListener#attribute(java.lang.String, java.lang.String) ! */ ! public void attribute(String _name, String _value) { ! } ! ! /** ! * @see com.memoire.xml.XmlListener#endElement(java.lang.String) ! */ ! public void endElement(String _tag) { ! data_=-1; ! } ! ! /** ! * @see com.memoire.xml.XmlListener#error(java.lang.String) ! */ ! public void error(String _message) { ! TrXmlProjectReader.this.error(_message); ! } ! ! /** ! * @see com.memoire.xml.XmlListener#location(java.lang.String, int, int) ! */ ! public void location(String _origin, int _lineno, int _charno) { ! } ! ! /** ! * @see com.memoire.xml.XmlListener#startElement(java.lang.String) ! */ ! public void startElement(String _tag) { ! if(_tag.equals("doc")){ ! doc_=new BuInformationsDocument(); ! } ! else if("author".equals(_tag)){ ! this.data_=author_; ! } ! else if("date".equals(_tag)){ ! this.data_=date_; ! } ! else if("comment".equals(_tag)){ ! this.data_=comment_; ! } ! ! } ! ! /** ! * @see com.memoire.xml.XmlListener#text(java.lang.String) ! */ ! public void text(String _data) { ! if(data_>=0){ ! if(data_==author_){ ! doc_.author=_data; ! } ! else if(data_==date_){ ! doc_.date=_data; ! } ! else if(data_==comment_){ ! ! doc_.comment=_data; ! } ! } ! else error(_data); ! } ! ! } ! ! protected XmlListener currentListener_; ! protected String currentNode_; ! protected BuInformationsDocument doc_; ! protected Map elementListener_; ! File f_; ! protected boolean isProjectStart_; protected FudaaUI ui_; --- 9,27 ---- import java.io.File; + import java.io.FileInputStream; import java.io.IOException; ! import java.util.NoSuchElementException; + import org.fudaa.ctulu.CtuluLib; + import org.fudaa.dodico.boony.BoonyXmlDeserializer; import org.fudaa.fudaa.commun.FudaaUI; /** * @author Fred Deniger * @version $Id$ */ ! public class TrXmlProjectReader { ! File f_; protected FudaaUI ui_; *************** *** 117,214 **** */ public TrXmlProjectReader(File _f) { ! f_=_f; ! elementListener_=new HashMap(5); ! } ! ! protected void initListener(){ ! elementListener_.put("doc",new DocXmlReader()); ! } ! /** ! * @see com.memoire.xml.XmlListener#attribute(java.lang.String, java.lang.String) ! */ ! public void attribute(String _name, String _value) { ! if(currentListener_!=null){ ! currentListener_.attribute(_name,_value); ! } } ! /** ! * @see com.memoire.xml.XmlListener#endElement(java.lang.String) ! */ ! public void endElement(String _tag) { ! if(_tag.equals(currentNode_)){ ! if(currentListener_!=null) ! currentListener_.endElement(_tag); ! currentListener_=null; ! } ! else if(currentListener_!=null){ ! currentListener_.endElement(_tag); ! } ! else if("project".equals(_tag)){ ! System.out.println("fin"); ! } ! else{ ! error("doc invalide"); } ! } ! ! /** ! * @see com.memoire.xml.XmlListener#error(java.lang.String) ! */ ! public void error(String _message) { ! ui_.error(_message); ! } ! ! /** ! * @see com.memoire.xml.XmlListener#location(java.lang.String, int, int) ! */ ! public void location(String _origin, int _lineno, int _charno) { ! if(currentListener_!=null){ ! currentListener_.location(_origin,_lineno,_charno); } ! } ! ! /** ! * @throws IOException ! */ ! public void read() throws IOException{ ! XmlParser parser=new XmlParser(f_,XmlParser.XML); ! initListener(); ! parser.setXmlListener(this); ! parser.parse(); ! } ! ! /** ! * @see com.memoire.xml.XmlListener#startElement(java.lang.String) ! */ ! public void startElement(String _tag) { ! if(!isProjectStart_ && (_tag.equals("project"))){ ! isProjectStart_=true; } ! else if(currentListener_!=null){ ! currentListener_.startElement(_tag); } ! else{ ! currentListener_=(XmlListener)elementListener_.get(_tag); ! ! currentNode_=_tag; ! if(currentListener_==null) error("tag non connu"); ! else currentListener_.startElement(_tag); } } ! /** ! * @see com.memoire.xml.XmlListener#text(java.lang.String) ! */ ! public void text(String _data) { ! if(currentListener_!=null) currentListener_.text(_data); ! } ! ! /** ! * @return Returns the doc. ! */ ! public BuInformationsDocument getDoc() { ! return doc_; ! } ! ! } --- 30,72 ---- */ public TrXmlProjectReader(File _f) { ! f_ = _f; } ! public void read(TrProjet _p, FudaaUI _ui) { ! if (_p == null) return; ! if (f_ == null) { ! if (_ui != null) _ui.error(TrResource.getS("Le fichier n'existe pas")); } ! BoonyXmlDeserializer xml = null; ! try { ! xml = new BoonyXmlDeserializer(false); ! xml.open(new FileInputStream(f_)); ! Object o = xml.read(); ! while (o != null) { ! ((TrXmlData) o).initProjectFromData(_p); ! try { ! o = xml.read(); ! } ! catch (NoSuchElementException e) { ! if (CtuluLib.DEBUG) CtuluLib.debug("xml reading end"); ! break; ! } ! } } ! catch (IOException _e) { ! if (_ui != null) _ui.error(_e.getLocalizedMessage()); } ! catch (ClassNotFoundException _e) { ! if (_ui != null) _ui.error(_e.getLocalizedMessage()); } ! finally { ! try { ! if (xml != null) xml.close(); ! } ! catch (IOException e1) { ! e1.printStackTrace(); ! } } } ! } \ No newline at end of file |