Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr
In directory sc8-pr-cvs1:/tmp/cvs-serv11020/tr
Modified Files:
TrCodePanel.java TrImplHelper.java TrImplementation.java
TrPreferences.java TrProjet.java
Added Files:
TrFileFormatManager.java
Log Message:
Maj tr
--- NEW FILE: TrFileFormatManager.java ---
(This appears to be a binary file; contents omitted.)
Index: TrCodePanel.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrCodePanel.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrCodePanel.java 4 Jul 2003 15:50:53 -0000 1.1
--- TrCodePanel.java 18 Aug 2003 11:54:43 -0000 1.2
***************
*** 16,20 ****
import javax.swing.JButton;
import javax.swing.JComboBox;
- import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
--- 16,19 ----
***************
*** 31,35 ****
--- 30,37 ----
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPreferences;
+ import org.fudaa.dodico.fichiers.FileFormatSoftware;
+
import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
+
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.commun.exec.FudaaExec;
***************
*** 43,48 ****
* @version $Id$
*/
! public class TrCodePanel extends EbliSimpleDialogPanel
! {
File fParams_;
JComboBox cbCode_;
--- 45,49 ----
* @version $Id$
*/
! public class TrCodePanel extends EbliSimpleDialogPanel {
File fParams_;
JComboBox cbCode_;
***************
*** 54,71 ****
*
*/
! public TrCodePanel(TrProjet _proj, FudaaExecServerManager _mng)
! {
super();
! mng_ = _mng;
! fParams_ = _proj.getParamsFile();
addEmptyBorder(10);
setLayout(new BuBorderLayout(5, 5));
! JPanel pn = new BuPanel();
pn.setLayout(new BuGridLayout(3, 25, 5, true, true, true, true));
addLabel(pn, "Code ");
addLabel(pn, "Options");
addLabel(pn, "Fichier");
! cbCode_ = new BuComboBox();
cbCode_.setRenderer(new FudaaExecCellRenderer());
cbCode_.setEditor(new FudaaExecComboBoxEditor(mng_));
--- 55,71 ----
*
*/
! public TrCodePanel(TrProjet _proj, FudaaExecServerManager _mng) {
super();
! mng_= _mng;
! fParams_= _proj.getParamsFile();
addEmptyBorder(10);
setLayout(new BuBorderLayout(5, 5));
! JPanel pn= new BuPanel();
pn.setLayout(new BuGridLayout(3, 25, 5, true, true, true, true));
addLabel(pn, "Code ");
addLabel(pn, "Options");
addLabel(pn, "Fichier");
! cbCode_= new BuComboBox();
cbCode_.setRenderer(new FudaaExecCellRenderer());
cbCode_.setEditor(new FudaaExecComboBoxEditor(mng_));
***************
*** 73,84 ****
cbCode_.setModel(mng_.createComboBoxModel());
pn.add(cbCode_);
! txtOption_ = addStringText(pn);
! JLabel l = addLabel(pn, fParams_.getName());
l.setToolTipText(fParams_.getAbsolutePath());
! cbLogFrame_ = new BuCheckBox("Fenêtre de log");
pn.add(cbLogFrame_);
! BuPanel pnBt = new BuPanel();
pnBt.setLayout(new BuButtonLayout(5, BuButtonLayout.LEFT));
! JButton bt = new BuButton();
bt.setText("Modifier Valeurs par défaut");
bt.setToolTipText("Modifier les valeurs par defaut");
--- 73,84 ----
cbCode_.setModel(mng_.createComboBoxModel());
pn.add(cbCode_);
! txtOption_= addStringText(pn);
! JLabel l= addLabel(pn, fParams_.getName());
l.setToolTipText(fParams_.getAbsolutePath());
! cbLogFrame_= new BuCheckBox("Fenêtre de log");
pn.add(cbLogFrame_);
! BuPanel pnBt= new BuPanel();
pnBt.setLayout(new BuButtonLayout(5, BuButtonLayout.LEFT));
! JButton bt= new BuButton();
bt.setText("Modifier Valeurs par défaut");
bt.setToolTipText("Modifier les valeurs par defaut");
***************
*** 92,101 ****
}
! private void init()
! {
cbLogFrame_.setSelected(
TrPreferences.TR.getBooleanProperty(
DodicoPreferences.buildPrefKey(
! TrProjet.TELEMAC_ID,
TrPreferences.KEY_SERVEUR_SHOW_LOG),
true));
--- 92,100 ----
}
! private void init() {
cbLogFrame_.setSelected(
TrPreferences.TR.getBooleanProperty(
DodicoPreferences.buildPrefKey(
! FileFormatSoftware.TELEMAC_IS.name,
TrPreferences.KEY_SERVEUR_SHOW_LOG),
true));
***************
*** 104,161 ****
}
! public String[] launchParams()
! {
! ArrayList l = new ArrayList(5);
if (cbCode_.getSelectedItem() == null)
return null;
! StringTokenizer tk =
new StringTokenizer(
! ((FudaaExec) cbCode_.getSelectedItem()).getExecCommand(),
" ");
! while (tk.hasMoreElements())
! {
l.add(tk.nextToken());
}
! tk = new StringTokenizer(txtOption_.getText(), " ");
! while (tk.hasMoreElements())
! {
l.add(tk.nextToken());
}
l.add(fParams_.getAbsolutePath());
! String[] r = DodicoLib.enTableau(l);
if (FudaaLib.DEBUG)
DodicoLib.printStringArray(r);
return r;
}
!
! public String getExeCmd()
! {
! return ((FudaaExec) cbCode_.getSelectedItem()).getExecCommand();
}
!
! public String getOptions()
! {
return txtOption_.getText();
}
! public boolean isLogFrame()
! {
return cbLogFrame_.isSelected();
}
-
/**
*
*/
! public void actionPerformed(ActionEvent _evt)
! {
! if (_evt.getActionCommand().equals("MODIF_DEFAULT"))
! {
! int r =
new TrTelemacCodePrefDialogPanel(mng_).afficheModale(
this,
"Valeur par defaut de telemac");
! if (EbliSimpleDialogPanel.isOkResponse(r))
! {
mng_.writePref();
cbCode_.setSelectedItem(mng_.getDefaultServeur());
--- 103,150 ----
}
! public String[] launchParams() {
! ArrayList l= new ArrayList(5);
if (cbCode_.getSelectedItem() == null)
return null;
! StringTokenizer tk=
new StringTokenizer(
! ((FudaaExec)cbCode_.getSelectedItem()).getExecCommand(),
" ");
! while (tk.hasMoreElements()) {
l.add(tk.nextToken());
}
! tk= new StringTokenizer(txtOption_.getText(), " ");
! while (tk.hasMoreElements()) {
l.add(tk.nextToken());
}
l.add(fParams_.getAbsolutePath());
! String[] r= DodicoLib.enTableau(l);
if (FudaaLib.DEBUG)
DodicoLib.printStringArray(r);
return r;
}
!
! public String getExeCmd() {
! return ((FudaaExec)cbCode_.getSelectedItem()).getExecCommand();
}
!
! public String getOptions() {
return txtOption_.getText();
}
! public boolean isLogFrame() {
return cbLogFrame_.isSelected();
}
/**
*
*/
! public void actionPerformed(ActionEvent _evt) {
! if (_evt.getActionCommand().equals("MODIF_DEFAULT")) {
! int r=
new TrTelemacCodePrefDialogPanel(mng_).afficheModale(
this,
"Valeur par defaut de telemac");
! if (EbliSimpleDialogPanel.isOkResponse(r)) {
mng_.writePref();
cbCode_.setSelectedItem(mng_.getDefaultServeur());
***************
*** 169,181 ****
*
*/
! public boolean valide()
! {
! boolean v = mng_.getFudaaExecNb() > 0;
! if (v)
! {
cancelErrorText();
! }
! else
! {
setErrorText("Pas d'éxecutable");
}
--- 158,166 ----
*
*/
! public boolean valide() {
! boolean v= mng_.getFudaaExecNb() > 0;
! if (v) {
cancelErrorText();
! } else {
setErrorText("Pas d'éxecutable");
}
Index: TrImplHelper.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplHelper.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrImplHelper.java 4 Jul 2003 15:34:57 -0000 1.2
--- TrImplHelper.java 18 Aug 2003 11:54:43 -0000 1.3
***************
*** 9,27 ****
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;
--- 9,20 ----
package org.fudaa.fudaa.tr;
import java.io.File;
import com.memoire.bu.BuIcon;
import com.memoire.bu.BuMenuItem;
! import org.fudaa.dodico.fichiers.FileFormatSoftware;
!
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.ressource.FudaaResource;
import org.fudaa.fudaa.tr.reflux.TrRefluxImplHelper;
***************
*** 32,36 ****
* @version $Id$
*/
! public abstract class TrImplHelper implements ActionListener
{
protected TrImplementation impl_;
--- 25,29 ----
* @version $Id$
*/
! public abstract class TrImplHelper
{
protected TrImplementation impl_;
***************
*** 40,43 ****
--- 33,38 ----
impl_ = _impl;
impl_.getFrame().setTitle("Superviseur " + getID());
+ impl_.getFrame().setIconImage(FudaaResource.FUDAA.getIcon("appli/" + getID()).getImage());
+
}
***************
*** 57,60 ****
--- 52,56 ----
public abstract String getID();
+
public BuMenuItem[] getMenuItemsOuvrir()
{
***************
*** 67,101 ****
}
! 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)
{
--- 63,71 ----
}
!
public static TrImplHelper getImplHelper(String _id, TrImplementation _impl)
{
if(FudaaLib.DEBUG) System.out.println("Choix impl helper");
if (_impl.getCurrentImplHelper() != null)
{
***************
*** 106,115 ****
}
}
! 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");
--- 76,85 ----
}
}
! 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");
***************
*** 119,155 ****
}
! /**
! *
! */
! 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();
! }
! }
!
! }
}
--- 89,93 ----
}
!
}
Index: TrImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrImplementation.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrImplementation.java 4 Jul 2003 15:34:57 -0000 1.2
--- TrImplementation.java 18 Aug 2003 11:54:43 -0000 1.3
***************
*** 10,15 ****
--- 10,18 ----
package org.fudaa.fudaa.tr;
+ import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
+ import java.awt.event.ItemEvent;
+ import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
import java.io.File;
***************
*** 34,37 ****
--- 37,42 ----
import com.memoire.fu.FuLib;
+ import org.fudaa.dodico.fichiers.FileFormatSoftware;
+
import org.fudaa.ebli.calque.BArbreCalque;
***************
*** 50,76 ****
* @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");
}
--- 55,82 ----
* @author Fred Deniger
*/
! public class TrImplementation
! extends FudaaCommonImplementation
! implements ItemListener {
! 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");
}
***************
*** 79,98 ****
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)
--- 85,133 ----
private TrProjectManager projectManager_;
private TrImplHelper implHelper_;
+ private TrFileFormatManager fileFormatMng_;
BuTaskView taches_;
! protected void ouvrir() {
implHelper_.ouvrir();
}
! public void changeChaineCalcul() {
! String[] choix=
! new String[] {
! FileFormatSoftware.REFLUX_IS.name,
! FileFormatSoftware.TELEMAC_IS.name };
! BuDialogChoice dialc=
! new BuDialogChoice(
! TrImplementation.this,
! TrImplementation.this.informationsSoftware(),
! "Configuration chaîne de calcul",
! "Veuillez sélectionner la chaîne de calcul utilisée.",
! choix);
! dialc.setSize(200, 200);
! if (FudaaLib.isOkResponse(dialc.activate())) {
! String id= dialc.getValue();
! if (!id.equals(getCurrentImplHelper().getID())) {
! if (FudaaLib.DEBUG)
! System.out.println("choix " + id);
!
! TrPreferences.TR.putStringProperty("tr.code.id", id);
! TrPreferences.TR.writeIniFile();
! initImplHelperFromPref();
! removeOuvrirAutre();
! addOuvrirAutre();
! getFrame().repaint();
! }
! }
!
! }
!
! protected void ouvrirId(String _id) {
!
! if (_id.equals(FileFormatSoftware.TELEMAC_IS.name)) {
! TrTelemacImplHelper h=
! (TrTelemacImplHelper)TrImplHelper.getImplHelper(
! FileFormatSoftware.TELEMAC_IS.name,
this);
if (h == null)
***************
*** 100,107 ****
h.ouvrirDico();
! }
! else
! {
! TrImplHelper h = TrImplHelper.getImplHelper(_id, this);
if (h == null)
error("Erreur interne", "impossible de trouver l'implantation");
--- 135,140 ----
h.ouvrirDico();
! } else {
! TrImplHelper h= TrImplHelper.getImplHelper(_id, this);
if (h == null)
error("Erreur interne", "impossible de trouver l'implantation");
***************
*** 111,127 ****
}
! 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");
--- 144,157 ----
}
! 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");
***************
*** 130,190 ****
}
! public void actionPerformed(ActionEvent _evt)
! {
! String action = _evt.getActionCommand();
if (action == null)
return;
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);
}
}
! protected void connecter()
! {
! System.out.println("pas de connexion");
! }
! private void creer()
! {
}
! public BuPreferences getApplicationPreferences()
! {
return TrPreferences.TR;
}
! public BuInformationsDocument getInformationsDocument()
! {
if (projetCourant() == null)
return null;
--- 160,223 ----
}
! public void actionPerformed(ActionEvent _evt) {
! String action= _evt.getActionCommand();
if (action == null)
return;
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 if ("MODIFIER_CHAINE".equals(action)) {
! changeChaineCalcul();
! } else {
super.actionPerformed(_evt);
}
}
! public BuMenu buildProjetMenu() {
! BuMenu projet= new BuDynamicMenu("Projet", "PROJET") {
! private boolean built_;
! public boolean isActive() {
! return true;
! }
! public void build() {
! if (this.getMenuComponentCount() == 0) {
! BuMenuItem it= new BuMenuItem("Changer chaîne de calcul");
! it.setActionCommand("MODIFIER_CHAINE");
! add(it);
! it.addActionListener(TrImplementation.this);
! built_= true;
! }
! }
! };
! projet.setIcon(null);
! return projet;
! }
+ protected void connecter() {
+ System.out.println("pas de connexion");
}
! private void creer() {}
!
! public BuPreferences getApplicationPreferences() {
return TrPreferences.TR;
}
! public BuInformationsDocument getInformationsDocument() {
if (projetCourant() == null)
return null;
***************
*** 192,216 ****
}
! public BuInformationsSoftware getInformationsSoftware()
! {
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();
! BuColumn rc = mp.getRightColumn();
lc.setBorder(null);
// rc.setBorder(new EmptyBorder(0,2,0,2));
! taches_ = new BuTaskView();
! BuScrollPane sp = new BuScrollPane(taches_);
sp.setPreferredSize(new Dimension(150, 80));
rc.addToggledComponent(
--- 225,247 ----
}
! public BuInformationsSoftware getInformationsSoftware() {
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();
! BuColumn rc= mp.getRightColumn();
lc.setBorder(null);
// rc.setBorder(new EmptyBorder(0,2,0,2));
! taches_= new BuTaskView();
! BuScrollPane sp= new BuScrollPane(taches_);
sp.setPreferredSize(new Dimension(150, 80));
rc.addToggledComponent(
***************
*** 220,230 ****
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());
}
--- 251,258 ----
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());
}
***************
*** 242,278 ****
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();
}
--- 270,306 ----
setEnabledForAction("CREER", false);
setEnabledForAction("OUVRIR", true);
+ setEnabledForAction("EXPORTER", true);
setEnabledForAction("QUITTER", true);
setEnabledForAction("PREFERENCE", true);
+ setEnabledForAction("ENREGISTRERCOPIE", false);
setEnabledForAction("ASTUCE", false);
! projectManager_= new TrProjectManager();
! fileFormatMng_= new TrFileFormatManager();
! 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);
+ mb.getMenu("EXPORTER").addItemListener(this);
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", false);
setEnabledForAction("FERMER", false);
}
! public void addProjet(TrProjet _o) {
! if (projetCourant() != null) {
projetCourant().close();
}
***************
*** 289,294 ****
* _f doit etre le fichier dernierement ouvert
*/
! public void setLastDir(File _f)
! {
FudaaLib.setLastDir(_f);
}
--- 317,321 ----
* _f doit etre le fichier dernierement ouvert
*/
! public void setLastDir(File _f) {
FudaaLib.setLastDir(_f);
}
***************
*** 314,330 ****
// }
! 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)
--- 341,354 ----
// }
! 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)
***************
*** 333,344 ****
}
! 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,
--- 357,370 ----
}
! private String askForCode() {
! String id=
TrPreferences.TR.getStringProperty(
TrPreferences.KEY_CODE_ID,
! FileFormatSoftware.REFLUX_IS.name);
! String[] choix=
! new String[] {
! FileFormatSoftware.REFLUX_IS.name,
! FileFormatSoftware.TELEMAC_IS.name };
! BuDialogChoice c=
new BuDialogChoice(
this,
***************
*** 349,353 ****
c.setSize(200, 200);
c.activate();
! id = c.getValue();
if (FudaaLib.DEBUG)
System.out.println("choix " + id);
--- 375,379 ----
c.setSize(200, 200);
c.activate();
! id= c.getValue();
if (FudaaLib.DEBUG)
System.out.println("choix " + id);
***************
*** 357,388 ****
}
! 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;
}
--- 383,405 ----
}
! private void addOuvrirAutre() {
! final BuMenuItem[] items_= implHelper_.getMenuItemsOuvrir();
! if ((items_ != null) && (items_.length > 0)) {
! BuMenu ouvrirAutre=
! new BuDynamicMenu("Ouvrir autre ...", "OUVRIR_AUTRE") {
! public boolean isActive() {
return true;
}
! public void build() {
! if (this.getMenuComponentCount() == 0) {
! if (FudaaLib.DEBUG)
! System.out.println("construit menu ouv autre");
//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);
}
}
***************
*** 390,409 ****
};
! 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);
}
! public static BuInformationsSoftware informationsSoftware()
! {
return isRt_;
}
--- 407,441 ----
};
! BuMenuBar mb= getApp().getMainMenuBar();
mb.getMenu("MENU_FICHIER").add(ouvrirAutre, 2);
}
+ }
! private void removeOuvrirAutre() {
! BuMenu menu= (BuMenu)getApp().getMainMenuBar().getMenu("MENU_FICHIER");
! Component c= menu.getMenuComponent(2);
! if ((c != null)
! && (c instanceof BuDynamicMenu)
! && (((BuDynamicMenu)c).getActionCommand().equals("OUVRIR_AUTRE")))
! menu.remove(c);
}
! public void start() {
! super.start();
! initImplHelperFromPref();
! addOuvrirAutre();
! BuMenuBar mb= getApp().getMainMenuBar();
! mb.add(buildProjetMenu(), 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);
!
! public static BuInformationsSoftware informationsSoftware() {
return isRt_;
}
***************
*** 412,421 ****
*
*/
! public void exit()
! {
super.exit();
TrPreferences.TR.writeIniFile();
FudaaFavoriteFiles.INSTANCE.saveFavorites();
FudaaPreferences.FUDAA.writeIniFile();
}
--- 444,473 ----
*
*/
! public void exit() {
super.exit();
TrPreferences.TR.writeIniFile();
FudaaFavoriteFiles.INSTANCE.saveFavorites();
FudaaPreferences.FUDAA.writeIniFile();
+ }
+
+ private void buildExporterMenu() {
+ fileFormatMng_.buildExportMenu(
+ (BuMenu)getMainMenuBar().getMenu("EXPORTER"));
+ }
+
+ /**
+ *
+ */
+ public void itemStateChanged(ItemEvent e) {
+ if (e.getStateChange() == ItemEvent.SELECTED) {
+ if (FudaaLib.DEBUG)
+ System.out.println(((BuMenu)e.getSource()).getActionCommand());
+ BuMenu menu= (BuMenu)e.getSource();
+ if(menu.getMenuComponentCount()!=0) return;
+ if (menu.getActionCommand().equals("EXPORTER")) {
+ buildExporterMenu();
+ menu.removeItemListener(this);
+ }
+ }
}
Index: TrPreferences.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrPreferences.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrPreferences.java 4 Jul 2003 15:34:57 -0000 1.2
--- TrPreferences.java 18 Aug 2003 11:54:43 -0000 1.3
***************
*** 20,23 ****
--- 20,25 ----
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPreferences;
+ import org.fudaa.dodico.fichiers.FileFormatSoftware;
+
import org.fudaa.fudaa.commun.FudaaPreferences;
***************
*** 123,142 ****
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);
}
--- 125,144 ----
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);
}
Index: TrProjet.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrProjet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrProjet.java 4 Jul 2003 15:34:57 -0000 1.2
--- TrProjet.java 18 Aug 2003 11:54:43 -0000 1.3
***************
*** 25,31 ****
{
- 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();
--- 25,28 ----
|