From: <de...@us...> - 2008-12-14 20:45:22
|
Revision: 4301 http://fudaa.svn.sourceforge.net/fudaa/?rev=4301&view=rev Author: deniger Date: 2008-12-14 20:45:17 +0000 (Sun, 14 Dec 2008) Log Message: ----------- maquetee v7 Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2008-12-14 20:44:06 UTC (rev 4300) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2008-12-14 20:45:17 UTC (rev 4301) @@ -131,8 +131,8 @@ infoSoft = new BuInformationsSoftware(); infoSoft.name = "prepro"; - infoSoft.version = "0.92-MAQUETTE-V6"; - infoSoft.date = "2008-10-31"; + infoSoft.version = "0.92-MAQUETTE-V7"; + infoSoft.date = "2008-12-13"; infoSoft.rights = TrResource.getS("Tous droits r\xE9serv\xE9s") + ". CETMEF (c)2003-2007"; infoSoft.contact = "fre...@fu..."; infoSoft.license = "GPL2"; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt =================================================================== (Binary files differ) Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java 2008-12-14 20:44:06 UTC (rev 4300) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java 2008-12-14 20:45:17 UTC (rev 4301) @@ -18,7 +18,7 @@ public class TrPostInterpolatePoint { public final int idxElt_; - public final double x_; + final double x_; final double y_; private final GISPrecision precision_; @@ -95,11 +95,11 @@ return idxElt_; } - protected double getX() { + public double getX() { return x_; } - protected double getY() { + public double getY() { return y_; } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-12-14 20:44:06 UTC (rev 4300) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-12-14 20:45:17 UTC (rev 4301) @@ -221,8 +221,8 @@ * @param _node * @see org.fudaa.fudaa.tr.post.TrPostLayoutPanelController#addNode(org.fudaa.ebli.visuallibrary.EbliNode) */ - public void addNode(final EbliNode _node) { - controller_.addNode(_node); + public Widget addNode(final EbliNode _node) { + return controller_.addNode(_node); } /** Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-12-14 20:44:06 UTC (rev 4300) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-12-14 20:45:17 UTC (rev 4301) @@ -68,6 +68,7 @@ import org.fudaa.fudaa.tr.post.actions.TrPostActionDuplicateLayout; import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardCreateScope; import org.jdesktop.swingx.ScrollPaneSelector; +import org.netbeans.api.visual.widget.Widget; import com.memoire.bu.BuDesktop; import com.memoire.bu.BuMenu; @@ -325,20 +326,20 @@ return nodeFleche; } - + public EbliNode addFlecheSimple() { - // -- ajout du rectangle --// - final EbliNodeDefault nodeFleche = new EbliNodeDefault(); - nodeFleche.setTitle("Fleche simple"); - nodeFleche.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorFlecheSimple())); - nodeFleche.setPreferedSize(new Dimension(100, 50)); - nodeFleche.setPreferedLocation(new Point(350, 125)); + // -- ajout du rectangle --// + final EbliNodeDefault nodeFleche = new EbliNodeDefault(); + nodeFleche.setTitle("Fleche simple"); + nodeFleche.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorFlecheSimple())); + nodeFleche.setPreferedSize(new Dimension(100, 50)); + nodeFleche.setPreferedLocation(new Point(350, 125)); - // ajout du node au layout - addNode(nodeFleche); + // ajout du node au layout + addNode(nodeFleche); - return nodeFleche; - } + return nodeFleche; + } public EbliNode addDblFleche() { // -- ajout du rectangle --// @@ -359,8 +360,8 @@ * * @param node */ - public void addNode(final EbliNode node) { - getSceneCourante().addNode(node); + public Widget addNode(final EbliNode node) { + Widget addNode = getSceneCourante().addNode(node); // -- rafraichissement de la scene pour eviter les plantages --// getSceneCourante().refresh(); @@ -368,6 +369,7 @@ // -- commande undo/redo pour la creation de widget --// getSceneCourante().getCmdMng().addCmd( new CommandUndoRedoCreation(node, getSceneCourante(), node.getPreferedLocation())); + return addNode; } public EbliNode addRectangle() { @@ -443,7 +445,7 @@ addFleche(); } }); - + // -- palette double fleche --// // crystal_bu_scrollpane_corner.png _l.add(new EbliActionSimple(EbliResource.EBLI.getString("Double Fleche"), EbliResource.EBLI Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-12-14 20:44:06 UTC (rev 4300) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-12-14 20:45:17 UTC (rev 4301) @@ -14,6 +14,9 @@ import java.awt.event.ActionListener; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Observable; @@ -67,6 +70,8 @@ import org.fudaa.fudaa.tr.post.data.TrPostDataListener; import org.fudaa.fudaa.tr.post.persist.TrPostPersistenceManager; import org.fudaa.fudaa.tr.post.save.TrPostProjetSaver; +import org.netbeans.api.visual.model.ObjectState; +import org.netbeans.api.visual.widget.Widget; import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuButton; @@ -95,1285 +100,1287 @@ */ public class TrPostProjet implements ActionListener { - /** - * Manager de sauvegarder/charghement des donn\xE9es - */ - private TrPostPersistenceManager manager_; + /** + * Manager de sauvegarder/charghement des donn\xE9es + */ + private TrPostPersistenceManager manager_; - public TrPostPersistenceManager getManager() { - if (manager_ == null) manager_ = new TrPostPersistenceManager(this); + public TrPostPersistenceManager getManager() { + if (manager_ == null) manager_ = new TrPostPersistenceManager(this); - return manager_; - } + return manager_; + } - private class TimeContentUpdater implements ListDataListener { + private class TimeContentUpdater implements ListDataListener { - protected TimeContentUpdater() { + protected TimeContentUpdater() { - } + } - protected void updateAll() { - // TODO a revoir - // if (fille_ != null && fille_.isVisible()) { - // if (CtuluLibMessage.DEBUG) { - // CtuluLibMessage.debug("update fill time format"); - // } - // final TrPostVisuPanel panel = (TrPostVisuPanel) fille_.getVisuPanel(); - // final BCalque[] cqs = panel.getDonneesCalque().getCalques(); - // for (int i = cqs.length - 1; i >= 0; i--) { - // final BCalque calque = cqs[i]; - // if (calque instanceof TrPostFlecheLayer) { - // ((TrPostFlecheLayer) calque).timeStepFormatChanged(); - // } else if (calque instanceof TrIsoLayerDefault) { - // ((TrIsoLayerDefault) calque).timeStepFormatChanged(); - // } - // } - // final TrPostFlecheLayer flecheLayer = panel.getFlecheLayer(); - // if (flecheLayer != null) { - // flecheLayer.timeStepFormatChanged(); - // } - // final TrIsoLayer liso = panel.getIsoLayer(); - // if (liso != null && liso.isVisible()) { - // liso.timeStepFormatChanged(); - // } - // if (!fille_.getArbreCalqueModel().getTreeSelectionModel().isSelectionEmpty()) { - // final TreePath[] path = fille_.getArbreCalqueModel().getTreeSelectionModel().getSelectionPaths(); - // fille_.getArbreCalqueModel().getTreeSelectionModel().clearSelection(); - // fille_.getArbreCalqueModel().getTreeSelectionModel().setSelectionPaths(path); - // } - // } - setProjectModified(); - } + protected void updateAll() { + // TODO a revoir + // if (fille_ != null && fille_.isVisible()) { + // if (CtuluLibMessage.DEBUG) { + // CtuluLibMessage.debug("update fill time format"); + // } + // final TrPostVisuPanel panel = (TrPostVisuPanel) fille_.getVisuPanel(); + // final BCalque[] cqs = panel.getDonneesCalque().getCalques(); + // for (int i = cqs.length - 1; i >= 0; i--) { + // final BCalque calque = cqs[i]; + // if (calque instanceof TrPostFlecheLayer) { + // ((TrPostFlecheLayer) calque).timeStepFormatChanged(); + // } else if (calque instanceof TrIsoLayerDefault) { + // ((TrIsoLayerDefault) calque).timeStepFormatChanged(); + // } + // } + // final TrPostFlecheLayer flecheLayer = panel.getFlecheLayer(); + // if (flecheLayer != null) { + // flecheLayer.timeStepFormatChanged(); + // } + // final TrIsoLayer liso = panel.getIsoLayer(); + // if (liso != null && liso.isVisible()) { + // liso.timeStepFormatChanged(); + // } + // if (!fille_.getArbreCalqueModel().getTreeSelectionModel().isSelectionEmpty()) { + // final TreePath[] path = fille_.getArbreCalqueModel().getTreeSelectionModel().getSelectionPaths(); + // fille_.getArbreCalqueModel().getTreeSelectionModel().clearSelection(); + // fille_.getArbreCalqueModel().getTreeSelectionModel().setSelectionPaths(path); + // } + // } + setProjectModified(); + } - public void contentsChanged(final ListDataEvent _event) { - updateAll(); - } + public void contentsChanged(final ListDataEvent _event) { + updateAll(); + } - public void intervalAdded(final ListDataEvent _event) { - updateAll(); - } + public void intervalAdded(final ListDataEvent _event) { + updateAll(); + } - public void intervalRemoved(final ListDataEvent _event) { - updateAll(); - } - } + public void intervalRemoved(final ListDataEvent _event) { + updateAll(); + } + } - class ModifyObserver implements Observer { + class ModifyObserver implements Observer { - private boolean isModified_; + private boolean isModified_; - protected void clearModified() { - isModified_ = false; - updateFrameState(); - } + protected void clearModified() { + isModified_ = false; + updateFrameState(); + } - protected void updateFrameState() { - if (impl_ != null) { - impl_.setEnabledForAction("ENREGISTRER", isModified_); - impl_.setEnabledForAction("ENREGISTRERSOUS", isModified_); - changedMainFrameState(); - } - } + protected void updateFrameState() { + if (impl_ != null) { + impl_.setEnabledForAction("ENREGISTRER", isModified_); + impl_.setEnabledForAction("ENREGISTRERSOUS", isModified_); + changedMainFrameState(); + } + } - public boolean isModified() { - return isModified_; - } + public boolean isModified() { + return isModified_; + } - public void setModified() { - isModified_ = true; - updateFrameState(); - } + public void setModified() { + isModified_ = true; + updateFrameState(); + } - public void update(final Observable _o, final Object _arg) { - setModified(); - } + public void update(final Observable _o, final Object _arg) { + setModified(); + } - } + } - class VariableListener implements TrPostDataListener { + class VariableListener implements TrPostDataListener { - public void dataAdded(final boolean _isFleche) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataAdded(_isFleche); - } - } - } - setProjectModified(); - } + public void dataAdded(final boolean _isFleche) { + if (impl_ == null) { return; } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataAdded(_isFleche); + } + } + } + setProjectModified(); + } - public void dataChanged(final H2dVariableType _old, final H2dVariableType _new, final boolean _contentChanged, - final boolean _isFleche, final Set _varDepending) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataChanged(_old, _new, _contentChanged, _isFleche, _varDepending); - } - } - } - setProjectModified(); - } + public void dataChanged(final H2dVariableType _old, final H2dVariableType _new, final boolean _contentChanged, + final boolean _isFleche, final Set _varDepending) { + if (impl_ == null) { return; } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataChanged(_old, _new, _contentChanged, _isFleche, _varDepending); + } + } + } + setProjectModified(); + } - public void dataRemoved(final H2dVariableType[] _vars, final boolean _isFleche) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataRemoved(_vars, _isFleche); - } - } - } - setProjectModified(); - } + public void dataRemoved(final H2dVariableType[] _vars, final boolean _isFleche) { + if (impl_ == null) { return; } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataRemoved(_vars, _isFleche); + } + } + } + setProjectModified(); + } - } + } - // transient TrPostFille fille_; - // - // /** - // * Fenetre fille qui contient le layout scene. Cette fenetre remplace petit a petit fille_ - // */ - // // protected transient TrPostLayoutFille filleLayout_; - // ArrayList<TrPostLayoutFille> listeFillesLayout = new ArrayList<TrPostLayoutFille>(); + // transient TrPostFille fille_; + // + // /** + // * Fenetre fille qui contient le layout scene. Cette fenetre remplace petit a petit fille_ + // */ + // // protected transient TrPostLayoutFille filleLayout_; + // ArrayList<TrPostLayoutFille> listeFillesLayout = new ArrayList<TrPostLayoutFille>(); - /** - * liste des noeuds pour gerer le cut/copy/paste avec en + le undo/redo - */ - // liste des noeuds copies - Set<EbliNode> nodesCopyied = null; - // liste des noeuuds coupes - Set<EbliNode> nodesCutted = null; + /** + * liste des noeuds pour gerer le cut/copy/paste avec en + le undo/redo + */ + // liste des noeuds copies + Set<EbliNode> nodesCopyied = null; + // liste des noeuuds coupes + Set<EbliNode> nodesCutted = null; - // /** - // *ajout une fillelayout a la liste des frame layout - // * - // * @param _fille - // */ - // public void addFillesLayout(TrPostLayoutFille _fille) { - // listeFillesLayout.add(_fille); - // } + // /** + // *ajout une fillelayout a la liste des frame layout + // * + // * @param _fille + // */ + // public void addFillesLayout(TrPostLayoutFille _fille) { + // listeFillesLayout.add(_fille); + // } - // /** - // * retourne la frame layout en cours d utilisation par le user. sinon retourne la premiere fille. IMPORTANT: il faut - // * passer par cette methode pour etre root\xE9 vers la bonne scene en cours de manip. - // * - // * @return - // */ - // public TrPostLayoutFille getSelectedFilleLayout() { - // for (Iterator<TrPostLayoutFille> it = listeFillesLayout.iterator(); it.hasNext();) { - // TrPostLayoutFille fille = it.next(); - // if (fille.isSelected()) return fille; - // } - // // sinon retourne la premier frame - // return listeFillesLayout.get(0); - // } + // /** + // * retourne la frame layout en cours d utilisation par le user. sinon retourne la premiere fille. IMPORTANT: il faut + // * passer par cette methode pour etre root\xE9 vers la bonne scene en cours de manip. + // * + // * @return + // */ + // public TrPostLayoutFille getSelectedFilleLayout() { + // for (Iterator<TrPostLayoutFille> it = listeFillesLayout.iterator(); it.hasNext();) { + // TrPostLayoutFille fille = it.next(); + // if (fille.isSelected()) return fille; + // } + // // sinon retourne la premier frame + // return listeFillesLayout.get(0); + // } - /** - * internalframe qui gere les multiProjets - */ - public TrPostProjetsManagerFille filleProjetctManager_; + /** + * internalframe qui gere les multiProjets + */ + public TrPostProjetsManagerFille filleProjetctManager_; - /** - * Le menu du post qui contient tout les sous menus des projets - */ - BuMenu menuPost_; - BuMenu menuLayout_ = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER");; - List<BuMenu> listeMenuProjets_; + /** + * Le menu du post qui contient tout les sous menus des projets + */ + BuMenu menuPost_; + BuMenu menuLayout_ = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER");; + List<BuMenu> listeMenuProjets_; - List<ArrayList<BuMenuItem>> listeSousMenuProjets_; + List<ArrayList<BuMenuItem>> listeSousMenuProjets_; - /** - * Observable custom reserv\xE9 aux modifs apport\xE9es a la liste des src. - * - * @author Adrien Hadoux - */ - class observableSupport extends Observable { - @Override - public void notifyObservers() { - this.setChanged(); - super.notifyObservers(); - } + /** + * Observable custom reserv\xE9 aux modifs apport\xE9es a la liste des src. + * + * @author Adrien Hadoux + */ + class observableSupport extends Observable { + @Override + public void notifyObservers() { + this.setChanged(); + super.notifyObservers(); + } - @Override - public void notifyObservers(final Object arg) { - this.setChanged(); - super.notifyObservers(arg); - } + @Override + public void notifyObservers(final Object arg) { + this.setChanged(); + super.notifyObservers(arg); + } - } + } - private observableSupport observable; + private observableSupport observable; - public observableSupport getObservable() { - if (observable == null) observable = new observableSupport(); - return observable; - } + public observableSupport getObservable() { + if (observable == null) observable = new observableSupport(); + return observable; + } - public void notifyObservers() { - // getObservable().setChanged(); + public void notifyObservers() { + // getObservable().setChanged(); - getObservable().notifyObservers(); + getObservable().notifyObservers(); - } + } - transient int idxFilleG_; + transient int idxFilleG_; - public transient TrPostCommonImplementation impl_; + public transient TrPostCommonImplementation impl_; - ModifyObserver modifyState_ = new ModifyObserver(); + ModifyObserver modifyState_ = new ModifyObserver(); - /** - * Donnees courantes du trpost. - */ - // transient TrPostSource src_; - /** - * liste des sources pour le multiProjet. - */ - public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>(); + /** + * Donnees courantes du trpost. + */ + // transient TrPostSource src_; + /** + * liste des sources pour le multiProjet. + */ + public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>(); - transient TimeContentUpdater timeUpdater_; + transient TimeContentUpdater timeUpdater_; - public TrPostProjet(final TrPostCommonImplementation _impl) { - this(null, _impl); + public TrPostProjet(final TrPostCommonImplementation _impl) { + this(null, _impl); - } + } - public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) { - if (_src != null) ajouterSource(_src); + public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) { + if (_src != null) ajouterSource(_src); - // -- creation de la frame de gestion multi projet --// - filleProjetctManager_ = new TrPostProjetsManagerFille(this); - impl_ = _impl; + // -- creation de la frame de gestion multi projet --// + filleProjetctManager_ = new TrPostProjetsManagerFille(this); + impl_ = _impl; - } + } - /** - * Permet d ajouter une source dans le projet afin de gerer le multi source. On doit toujorus passer par cette methode - * pour ajouter une source. - * - * @param _src - */ - public void ajouterSource(final TrPostSource _src) { - _src.addVariableListener(new VariableListener()); - if (_src.getFile() == null || !isSourceLoaded(_src.getFile().getAbsolutePath())) { - listeSrc_.add(_src); - _src.buildDefaultVarUpdateLists(); + /** + * Permet d ajouter une source dans le projet afin de gerer le multi source. On doit toujorus passer par cette methode + * pour ajouter une source. + * + * @param _src + */ + public void ajouterSource(final TrPostSource _src) { + _src.addVariableListener(new VariableListener()); + if (_src.getFile() == null || !isSourceLoaded(_src.getFile().getAbsolutePath())) { + listeSrc_.add(_src); + _src.buildDefaultVarUpdateLists(); - // -- ajout du menu correspondant uniquement a partir de la 2eme --// - // if (listeSrc_.size()>1 || (menuPost_!=null &&)) - construitMenuPostSpecifiqueSource(_src); + // -- ajout du menu correspondant uniquement a partir de la 2eme --// + // if (listeSrc_.size()>1 || (menuPost_!=null &&)) + construitMenuPostSpecifiqueSource(_src); - } else { - // -- messqge d erreur: le fichier est deja ouvert --// - new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), "Le fichier est deja ouvert.").activate(); + } else { + // -- messqge d erreur: le fichier est deja ouvert --// + new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), "Le fichier est deja ouvert.").activate(); - } + } - } + } - /** - * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. - * - * @param _file : path absolu du fichier - * @return - */ - public TrPostSource findSource(final String _file) { + /** + * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. + * + * @param _file : path absolu du fichier + * @return + */ + public TrPostSource findSource(final String _file) { - for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { - final TrPostSource src = it.next(); - if (src.getFile().getAbsolutePath().equals(_file)) return src; - } + for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { + final TrPostSource src = it.next(); + if (src.getFile().getAbsolutePath().equals(_file)) return src; + } - return null; - } + return null; + } - /** - * Retourne la source asscoi\xE9 a l id. - * @param _id - * @return - */ - public TrPostSource findSourceById(final String _id) { + /** + * Retourne la source asscoi\xE9 a l id. + * + * @param _id + * @return + */ + public TrPostSource findSourceById(final String _id) { - for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { - final TrPostSource src = it.next(); - if (src.getId().equals(_id)) return src; - } + for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { + final TrPostSource src = it.next(); + if (src.getId().equals(_id)) return src; + } - return null; - } - - /** - * indique si il existe une source portant le nom du fichier en param. - * - * @param _file : path absolu du fichier - * @return - */ - public boolean isSourceLoaded(final String _file) { - if (findSource(_file) == null) return false; - return true; - } + return null; + } - // /** - // * methode qui change la source courante et retourne true si la source existe bien, false sinon - // * - // * @param _file : path absolu du fichier - // * @return - // */ - // public boolean changeSource(final TrPostSource _src) { - // - // src_ = _src; - // - // return true; - // } + /** + * indique si il existe une source portant le nom du fichier en param. + * + * @param _file : path absolu du fichier + * @return + */ + public boolean isSourceLoaded(final String _file) { + if (findSource(_file) == null) return false; + return true; + } - /** - * Methode de suppression de la source - * - * @param src : TrPostSource, retourne true si la suppression a bien ete effectuee. - */ - public boolean removeSource(final TrPostSource src, final int n) { + // /** + // * methode qui change la source courante et retourne true si la source existe bien, false sinon + // * + // * @param _file : path absolu du fichier + // * @return + // */ + // public boolean changeSource(final TrPostSource _src) { + // + // src_ = _src; + // + // return true; + // } - if (isSourceLoaded(src.getFile().getAbsolutePath())) { - listeSrc_.remove(src); + /** + * Methode de suppression de la source + * + * @param src : TrPostSource, retourne true si la suppression a bien ete effectuee. + */ + public boolean removeSource(final TrPostSource src, final int n) { - // --recuperation du menu simul --// - final BuMenu menuSimul = getlisteMenuProjets_().get(n); + if (isSourceLoaded(src.getFile().getAbsolutePath())) { + listeSrc_.remove(src); - // --on retire les menus correspondants --// - // for (int i = 0; i < listeSousMenuProjets_.get(n).size(); i++) { - // BuMenuItem item = listeSousMenuProjets_.get(n).get(i); - // menuSimul.remove(item); - // } + // --recuperation du menu simul --// + final BuMenu menuSimul = getlisteMenuProjets_().get(n); - // -- on retire le menuSimul de la liste --// - menuPost_.remove(menuSimul); + // --on retire les menus correspondants --// + // for (int i = 0; i < listeSousMenuProjets_.get(n).size(); i++) { + // BuMenuItem item = listeSousMenuProjets_.get(n).get(i); + // menuSimul.remove(item); + // } - // -- on retire de la liste des menus le menusimul et la liste des sous - // menus --// - getlisteMenuProjets_().remove(n); - getlisteSousMenuProjets_().remove(n); + // -- on retire le menuSimul de la liste --// + menuPost_.remove(menuSimul); - // -- mise a jour de la barre des menus --// - impl_.getMainMenuBar().revalidate(); + // -- on retire de la liste des menus le menusimul et la liste des sous + // menus --// + getlisteMenuProjets_().remove(n); + getlisteSousMenuProjets_().remove(n); - //-- on met a jour la scene en enlevant tous les objets reli\xE9s \xE0 cette source --// - for(TrPostLayoutFille frame:impl_.getAllLayoutFille()){ - frame.getScene().removeAllWidgetLinkedToSrc(src); - } - - return true; - } else { - // -- messqge d erreur: le fichier est deja ouvert --// - new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), - "Impossible de supprimer ce fichier de la liste.").activate(); + // -- mise a jour de la barre des menus --// + impl_.getMainMenuBar().revalidate(); - return false; - } + // -- on met a jour la scene en enlevant tous les objets reli\xE9s \xE0 cette source --// + for (TrPostLayoutFille frame : impl_.getAllLayoutFille()) { + frame.getScene().removeAllWidgetLinkedToSrc(src); + } - } + return true; + } else { + // -- messqge d erreur: le fichier est deja ouvert --// + new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), + "Impossible de supprimer ce fichier de la liste.").activate(); - /** - * methode qui formatte les infos de la source - * - * @param _src - * @return - */ - public String formatInfoSource(final TrPostSource _src) { - // --ajout dans la liste des titres --// - return formatName(_src.getTitle()) + " | Fichier: " + formatFichier(_src.getFile()); - } + return false; + } - public String formatFichier(final File file) { - if (file == null) return ""; - final String nomFichier = file.getAbsolutePath(); - // int position = nomFichier.lastIndexOf(File.separator) + 1; - // if (position != -1) { - // nomFichier = nomFichier.substring(position); - // } - // position = nomFichier.lastIndexOf(CtuluLibString.DOT); - // if (position != -1) { - // nomFichier = nomFichier.substring(0, position); - // } - // FuLog.warning("nom du fichier: " + nomFichier); - return nomFichier; - } + } - /** - * formatte le titre - * - * @param file - * @return - */ - public String formatName(String title) { - // --suppression des trop long espaces du titre --// + /** + * methode qui formatte les infos de la source + * + * @param _src + * @return + */ + public String formatInfoSource(final TrPostSource _src) { + // --ajout dans la liste des titres --// + return formatName(_src.getTitle()) + " | Fichier: " + formatFichier(_src.getFile()); + } - title = title.replaceAll(" ", ""); + public String formatFichier(final File file) { + if (file == null) return ""; + final String nomFichier = file.getAbsolutePath(); + // int position = nomFichier.lastIndexOf(File.separator) + 1; + // if (position != -1) { + // nomFichier = nomFichier.substring(position); + // } + // position = nomFichier.lastIndexOf(CtuluLibString.DOT); + // if (position != -1) { + // nomFichier = nomFichier.substring(0, position); + // } + // FuLog.warning("nom du fichier: " + nomFichier); + return nomFichier; + } - return title; - } + /** + * formatte le titre + * + * @param file + * @return + */ + public String formatName(String title) { + // --suppression des trop long espaces du titre --// - /** - * Construit un menu specifique a la source choisie. A chaque fois que l on ajoute une source au projet, il faut - * ajouter un menu sp\xE9cifique. - * - * @param _src - */ - public void construitMenuPostSpecifiqueSource(final TrPostSource _src) { + title = title.replaceAll(" ", ""); - final BuMenu menuSimul = new BuMenu((listeSrc_.size()) + ". " + formatFichier(_src.getFile()), "SIMULATION" - + (listeSrc_.size())); + return title; + } - // -- ajout du menu au menu post --// - getMenuPost().add(menuSimul); + /** + * Construit un menu specifique a la source choisie. A chaque fois que l on ajoute une source au projet, il faut + * ajouter un menu sp\xE9cifique. + * + * @param _src + */ + public void construitMenuPostSpecifiqueSource(final TrPostSource _src) { - // -- sauvegarde d une trace du menu dans la liste pour une suppression - // ulterieure --// - getlisteMenuProjets_().add(menuSimul); + final BuMenu menuSimul = new BuMenu((listeSrc_.size()) + ". " + formatFichier(_src.getFile()), "SIMULATION" + + (listeSrc_.size())); - final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>(); + // -- ajout du menu au menu post --// + getMenuPost().add(menuSimul); - final BuIcon ic = BuResource.BU.getIcon("aucun"); + // -- sauvegarde d une trace du menu dans la liste pour une suppression + // ulterieure --// + getlisteMenuProjets_().add(menuSimul); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."), "COMPUTE_EXTREMA", ic, TrPostProjet.this)); - listSousMenus.add(menuSimul.addMenuItem(CtuluLib.getS("Editer les variables..."), "VARIABLES", ic, - TrPostProjet.this)); - menuSimul.addSeparator(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Palettes de couleurs"), "PALETTE_DEFAULT", ic, - TrPostProjet.this)); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Formater/modifier les pas de temps..."), "TIME_FORMAT", - ic, TrPostProjet.this)); + final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>(); - menuSimul.addSeparator(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer..."), "COMPARE", ic, TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Comparer les r\xE9sultats avec ceux d'un autre projet")); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter..."), "PROJECT", ic, TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent")); - if (_src != null && _src.isInspectable()) { - menuSimul.addSeparator(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Rafra\xEEchir les r\xE9sultats"), "MAJ_DATA", ic, - TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Les fichiers de r\xE9sultats seront relus")); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Rafra\xEEchir automatiquement"), "MAJ_DATA_ALWAYS", ic, - TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Les fichiers sont surveill\xE9s p\xE9riodiquement")); - menuSimul.addSeparator(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"), "EXPORTDATA", TrPostProjet.this)); - _src.addSpecificItemInMainMenu(menuSimul, getImpl()); + final BuIcon ic = BuResource.BU.getIcon("aucun"); - // -- ajout de la sous liste de menus pour la garder en memoire --// - getlisteSousMenuProjets_().add(listSousMenus); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."), "COMPUTE_EXTREMA", ic, TrPostProjet.this)); + listSousMenus.add(menuSimul.addMenuItem(CtuluLib.getS("Editer les variables..."), "VARIABLES", ic, + TrPostProjet.this)); + menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Palettes de couleurs"), "PALETTE_DEFAULT", ic, + TrPostProjet.this)); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Formater/modifier les pas de temps..."), "TIME_FORMAT", + ic, TrPostProjet.this)); - } - } + menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer..."), "COMPARE", ic, TrPostProjet.this)); + listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + TrResource.getS("Comparer les r\xE9sultats avec ceux d'un autre projet")); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter..."), "PROJECT", ic, TrPostProjet.this)); + listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + TrResource.getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent")); + if (_src != null && _src.isInspectable()) { + menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Rafra\xEEchir les r\xE9sultats"), "MAJ_DATA", ic, + TrPostProjet.this)); + listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + TrResource.getS("Les fichiers de r\xE9sultats seront relus")); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Rafra\xEEchir automatiquement"), "MAJ_DATA_ALWAYS", ic, + TrPostProjet.this)); + listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + TrResource.getS("Les fichiers sont surveill\xE9s p\xE9riodiquement")); + menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"), "EXPORTDATA", TrPostProjet.this)); + _src.addSpecificItemInMainMenu(menuSimul, getImpl()); - /** - * Construit le menu Layout. Cette methode doit etre appelee une seule fois - */ - // public void setMenuLayout() { - // //filleLayout_.controller_.construitMenuMultiScenes(impl_.getMainMenuBar()); - // final BuMenuBar menubar = impl_.getMainMenuBar(); - // // -- creation du menu principal des scenes a cote de post --// - // - // menuLayout_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), - // "AJOUTFRAME", CtuluResource.CTULU - // .getIcon("crystal_ajouter"), getSelectedFilleLayout().controller_); - // /* - // * - // * menu.addMenuItem(TrResource.getS(("Ajouter un layout dans la vue")), - // * "AJOUTLAYOUT", CtuluResource.CTULU .getIcon("crystal_ajouter"), - // * filleLayout_.controller_); - // * menu.addMenuItem(TrResource.getS(("Retirer un layout de la vue")), - // * "RETIRELAYOUT", CtuluResource.CTULU .getIcon("crystal_enlever"), - // * filleLayout_.controller_); menu.addSeparator("Layouts"); - // * menu.addSubMenu(filleLayout_.controller_.menuScenes_, true); - // */ - // // ajout a cote de menu post - // // menuLayout_.addSeparator(TrResource.getS("Liste des fen\xEAtres")); - // // menuLayout_.addMenuItem(TrResource.getS(("Layout ")) + - // // listeFillesLayout.size(), "FILLELAYOUT" - // // + (listeFillesLayout.size() - 1), null, this); - // // - // - // menubar.add(menuLayout_, 2); - // - // } - public BuMenu getMenuPost() { - if (menuPost_ == null) menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); - return menuPost_; - } + // -- ajout de la sous liste de menus pour la garder en memoire --// + getlisteSousMenuProjets_().add(listSousMenus); - /** - * Creation par defaut du menu post de l interface. Cette methdoe est appelee une seule dfois au moment de la creation - * de l impl. - */ - public void setMenuPost() { - final BuMenuBar menubar = impl_.getMainMenuBar(); + } + } - Component comp = null; - if (getMenuPost().getMenuComponentCount() > 0) { - comp = getMenuPost().getMenuComponent(0); - // getMenuPost().remove(0); - } + /** + * Construit le menu Layout. Cette methode doit etre appelee une seule fois + */ + // public void setMenuLayout() { + // //filleLayout_.controller_.construitMenuMultiScenes(impl_.getMainMenuBar()); + // final BuMenuBar menubar = impl_.getMainMenuBar(); + // // -- creation du menu principal des scenes a cote de post --// + // + // menuLayout_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), + // "AJOUTFRAME", CtuluResource.CTULU + // .getIcon("crystal_ajouter"), getSelectedFilleLayout().controller_); + // /* + // * + // * menu.addMenuItem(TrResource.getS(("Ajouter un layout dans la vue")), + // * "AJOUTLAYOUT", CtuluResource.CTULU .getIcon("crystal_ajouter"), + // * filleLayout_.controller_); + // * menu.addMenuItem(TrResource.getS(("Retirer un layout de la vue")), + // * "RETIRELAYOUT", CtuluResource.CTULU .getIcon("crystal_enlever"), + // * filleLayout_.controller_); menu.addSeparator("Layouts"); + // * menu.addSubMenu(filleLayout_.controller_.menuScenes_, true); + // */ + // // ajout a cote de menu post + // // menuLayout_.addSeparator(TrResource.getS("Liste des fen\xEAtres")); + // // menuLayout_.addMenuItem(TrResource.getS(("Layout ")) + + // // listeFillesLayout.size(), "FILLELAYOUT" + // // + (listeFillesLayout.size() - 1), null, this); + // // + // + // menubar.add(menuLayout_, 2); + // + // } + public BuMenu getMenuPost() { + if (menuPost_ == null) menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); + return menuPost_; + } - getMenuPost().setIcon(null); - getMenuPost().setName("mnPost"); + /** + * Creation par defaut du menu post de l interface. Cette methdoe est appelee une seule dfois au moment de la creation + * de l impl. + */ + public void setMenuPost() { + final BuMenuBar menubar = impl_.getMainMenuBar(); - menubar.add(getMenuPost(), 2); + Component comp = null; + if (getMenuPost().getMenuComponentCount() > 0) { + comp = getMenuPost().getMenuComponent(0); + // getMenuPost().remove(0); + } - getMenuPost().addSeparator(TrResource.getS("Layout")); - // -- ajout de l action de creation du calque --// - // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this)); - getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); - getMenuPost().addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", - CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { + getMenuPost().setIcon(null); + getMenuPost().setName("mnPost"); - public void actionPerformed(final ActionEvent _e) { - createNewLayoutFrame(); + menubar.add(getMenuPost(), 2); - } - }); + getMenuPost().addSeparator(TrResource.getS("Layout")); + // -- ajout de l action de creation du calque --// + // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this)); + getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); + getMenuPost().addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", + CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { - getMenuPost().addSeparator(TrResource.getS("Gestion")); - // -- ajout de l action de gestion des simus dans post --// - final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); - item.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + createNewLayoutFrame(); - public void actionPerformed(final ActionEvent e) { - // -- affichage de la fenetre de gestion multi projet --// + } + }); - if (!filleProjetctManager_.isVisible()) { - filleProjetctManager_.setSize(filleProjetctManager_.getSize().width, - filleProjetctManager_.getSize().height / 2); + getMenuPost().addSeparator(TrResource.getS("Gestion")); + // -- ajout de l action de gestion des simus dans post --// + final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); + item.addActionListener(new ActionListener() { - impl_.addInternalFrame(filleProjetctManager_); - } + public void actionPerformed(final ActionEvent e) { + // -- affichage de la fenetre de gestion multi projet --// - } + if (!filleProjetctManager_.isVisible()) { + filleProjetctManager_.setSize(filleProjetctManager_.getSize().width, + filleProjetctManager_.getSize().height / 2); - }); - getMenuPost().add(item); - getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats"); - // -- init de la liste des menus --// + impl_.addInternalFrame(filleProjetctManager_); + } - // -- construction par defaut du premier menu de simulation --// - // construitMenuPostSpecifiqueSource(getSource(0)); + } - if (comp != null) { - getMenuPost().add(comp); - } + }); + getMenuPost().add(item); + getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats"); + // -- init de la liste des menus --// - } + // -- construction par defaut du premier menu de simulation --// + // construitMenuPostSpecifiqueSource(getSource(0)); - public List<BuMenu> getlisteMenuProjets_() { - if (listeMenuProjets_ == null) listeMenuProjets_ = new ArrayList<BuMenu>(); - return listeMenuProjets_; - } + if (comp != null) { + getMenuPost().add(comp); + } - public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_() { - if (listeSousMenuProjets_ == null) listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); - return listeSousMenuProjets_; - } + } - /** - * calcul les extrema en fonction de la source proposee - * - * @param indiceSource_ - */ - private void showExtremum(final int indiceSource_) { - final JTable table = TrPostMinMaxTableModel.createTableFor(getSource(indiceSource_)); - final TrPostMinMaxTableModel model = (TrPostMinMaxTableModel) table.getModel(); - final CtuluDialogPanel panel = new CtuluDialogPanel(); - final CtuluDialog dial = new CtuluDialog(getImpl().getFrame(), panel); - final BuButton btCalcul = new BuButton(TrResource.getS("Calcul des extrema")); - dial.setTitle(btCalcul.getText()); - btCalcul.setActionCommand("EXTREMUM"); - panel.setLayout(new BuHorizontalLayout(3, false, false)); - final BuPanel center = new BuPanel(); - center.setLayout(new BuBorderLayout(2, 2, true, true)); - final BuScrollPane scroll = new BuScrollPane(table); - scroll.setPreferredHeight((int) (table.getPreferredSize().height * 1.3)); - center.add(scroll, BuBorderLayout.CENTER); - center.add(model.createInfoPanel(table), BuBorderLayout.SOUTH); - panel.add(center); - btCalcul.setAlignmentX(1f); - btCalcul.setAlignmentY(0f); - panel.add(btCalcul); + public List<BuMenu> getlisteMenuProjets_() { + if (listeMenuProjets_ == null) listeMenuProjets_ = new ArrayList<BuMenu>(); + return listeMenuProjets_; + } - btCalcul.addActionListener(new ActionListener() { + public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_() { + if (listeSousMenuProjets_ == null) listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); + return listeSousMenuProjets_; + } - public void actionPerformed(final ActionEvent _event) { - final BuGlassPaneStop stop = new BuGlassPaneStop(); - dial.setGlassPane(stop); - stop.setVisible(true); - new CtuluTaskOperationGUI(impl_, CtuluLibString.EMPTY_STRING) { + /** + * calcul les extrema en fonction de la source proposee + * + * @param indiceSource_ + */ + private void showExtremum(final int indiceSource_) { + final JTable table = TrPostMinMaxTableModel.createTableFor(getSource(indiceSource_)); + final TrPostMinMaxTableModel model = (TrPostMinMaxTableModel) table.getModel(); + final CtuluDialogPanel panel = new CtuluDialogPanel(); + final CtuluDialog dial = new CtuluDialog(getImpl().getFrame(), panel); + final BuButton btCalcul = new BuButton(TrResource.getS("Calcul des extrema")); + dial.setTitle(btCalcul.getText()); + btCalcul.setActionCommand("EXTREMUM"); + panel.setLayout(new BuHorizontalLayout(3, false, false)); + final BuPanel center = new BuPanel(); + center.setLayout(new BuBorderLayout(2, 2, true, true)); + final BuScrollPane scroll = new BuScrollPane(table); + scroll.setPreferredHeight((int) (table.getPreferredSize().height * 1.3)); + center.add(scroll, BuBorderLayout.CENTER); + center.add(model.createInfoPanel(table), BuBorderLayout.SOUTH); + panel.add(center); + btCalcul.setAlignmentX(1f); + btCalcul.setAlignmentY(0f); + panel.add(btCalcul); - @Override - public void act() { - model.apply(new ProgressionBuAdapter(this), impl_); - BuLib.invokeLater(new Runnable() { - public void run() { - TrPostProjet.this.setProjectModified(); - stop.setVisible(false); - dial.getRootPane().remove(stop); - } + btCalcul.addActionListener(new ActionListener() { - }); - } - }.start(); - } - }); - dial.afficheDialogModal(); - } + public void actionPerformed(final ActionEvent _event) { + final BuGlassPaneStop stop = new BuGlassPaneStop(); + dial.setGlassPane(stop); + stop.setVisible(true); + new CtuluTaskOperationGUI(impl_, CtuluLibString.EMPTY_STRING) { - private void updatePaletteMin(final TrPostSource _src) { - final TrPostMinPaletteTableModel model = _src.getMinPaletteModel(); - final BuTable table = new BuTable(model); - final CtuluDialogPanel pnDial = new CtuluDialogPanel() { + @Override + public void act() { + model.apply(new ProgressionBuAdapter(this), impl_); + BuLib.invokeLater(new Runnable() { + public void run() { + TrPostProjet.this.setProjectModified(); + stop.setVisible(false); + dial.getRootPane().remove(stop); + } - @Override - public void apply() { - if (table.isEditing()) { - table.getCellEditor().stopCellEditing(); - } - model.apply(); - } - }; + }); + } + }.start(); + } + }); + dial.afficheDialogModal(); + } - final TableColumn col0 = table.getColumnModel().getColumn(0); - col0.setMaxWidth(20); - col0.setCellRenderer(new CtuluCellBooleanRenderer()); - pnDial.setLayout(new BuVerticalLayout(2, true, true)); - pnDial.addLabel(TrResource - .getS("Activer et pr\xE9ciser les valeurs minimales \xE0 utiliser par d\xE9faut pour les palettes")); - pnDial.add(new BuScrollPane(table)); - pnDial.afficheModale(impl_.getFrame(), TrResource.getS("Valeurs par d\xE9faut pour les palettes")); + private void updatePaletteMin(final TrPostSource _src) { + final TrPostMinPaletteTableModel model = _src.getMinPaletteModel(); + final BuTable table = new BuTable(model); + final CtuluDialogPanel pnDial = new CtuluDialogPanel() { - } + @Override + public void apply() { + if (table.isEditing()) { + table.getCellEditor().stopCellEditing(); + } + model.apply(); + } + }; - TrPostInspectorReader createWatcher(final TrPostSource _src) { - return _src.createWatcher(this, true); - } + final TableColumn col0 = table.getColumnModel().getColumn(0); + col0.setMaxWidth(20); + col0.setCellRenderer(new CtuluCellBooleanRenderer()); + pnDial.setLayout(new BuVerticalLayout(2, true, true)); + pnDial.addLabel(TrResource + .getS("Activer et pr\xE9ciser les valeurs minimales \xE0 utiliser par d\xE9faut pour les palettes")); + pnDial.add(new BuScrollPane(table)); + pnDial.afficheModale(impl_.getFrame(), TrResource.getS("Valeurs par d\xE9faut pour les palettes")); - boolean openSrcDataAndIsModified(final CtuluUI _ui, final ProgressionInterface _prog) { - return new TrPostProjetSaver(this).openSrcDataAndIsModified(_ui, _prog); - } + } - public void save(final CtuluUI _ui, final ProgressionInterface _prog) { - new TrPostProjetSaver(this).save(_ui, _prog); - } + TrPostInspectorReader createWatcher(final TrPostSource _src) { + return _src.createWatcher(this, true); + } - /** - * Methode qui qctive l'internalFrame layout. - */ - protected void activeFille(final TrPostLayoutFille _fille) { + boolean openSrcDataAndIsModified(final CtuluUI _ui, final ProgressionInterface _prog) { + return new TrPostProjetSaver(this).openSrcDataAndIsModified(_ui, _prog); + } - impl_.addInternalFrame(_fille); - } + public void save(final CtuluUI _ui, final ProgressionInterface _prog) { + new TrPostProjetSaver(this).save(_ui, _prog); + } - /** - * Methode appelee apres ouverture du fichier de resultats. - * - * @param _destGrid - * @param _prog - * @param _isInitGridDisplay - */ - protected void activeProjectionAction(final TrPostSource _src, final EfGridInterface _destGrid, - final ProgressionInterface _prog, final boolean _isInitGridDisplay) { - final CtuluAnalyze ana = new CtuluAnalyze(); - _destGrid.computeBord(_prog, ana); - getImpl().manageAnalyzeAndIsFatal(ana); - final TrPostSourceProjected projection = new TrPostSourceProjected(_src, _src.getAvailableVar(), _destGrid, null, - _src.isRubar(), false, getImpl()); - projection.openDatas(_prog, null, null, getImpl()); - projection.buildDefaultVectors(); + /** + * Methode qui qctive l'internalFrame layout. + */ + protected void activeFille(final TrPostLayoutFille _fille) { - // creation du postprojet - // final TrPostProjet trPostProjet = new TrPostProjet(projection, impl_); + impl_.addInternalFrame(_fille); + } - // creation du panel de visualisation du posttraitement - final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl_, this, projection.getNbFleche() == 0, - new BCalqueLegende(), projection); + /** + * Methode appelee apres ouverture du fichier de resultats. + * + * @param _destGrid + * @param _prog + * @param _isInitGridDisplay + */ + protected void activeProjectionAction(final TrPostSource _src, final EfGridInterface _destGrid, + final ProgressionInterface _prog, final boolean _isInitGridDisplay) { + final CtuluAnalyze ana = new CtuluAnalyze(); + _destGrid.computeBord(_prog, ana); + getImpl().manageAnalyzeAndIsFatal(ana); + final TrPostSourceProjected projection = new TrPostSourceProjected(_src, _src.getAvailableVar(), _destGrid, null, + _src.isRubar(), false, getImpl()); + projection.openDatas(_prog, null, null, getImpl()); + projection.buildDefaultVectors(); - // creation de l internalframe qui contient le panel de visu - // final TrPostFille compFille = new TrPostFille(pnVisu); - // creation de la scene layout identique a au dessus - final TrPostLayoutFille compFille = new TrPostLayoutFille(this); + // creation du postprojet + // final TrPostProjet trPostProjet = new TrPostProjet(projection, impl_); - // -- on ajoute le panel de visu comm widget calque au layout --// - compFille.addCalque(MvResource.getS("Maillage initial"), new Point(250, 170), new Dimension(400, 200), pnVisu, - new CalqueLegendeWidgetAdapter(compFille.getScene(), pnVisu.getArbreCalqueModel())); + // creation du panel de visualisation du posttraitement + final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl_, this, projection.getNbFleche() == 0, + new BCalqueLegende(), projection); - // test si il faut ajouter le calque - if (_isInitGridDisplay) { - final MvGridLayerGroup src = new MvGridLayerGroup(_src.getGrid()); - src.setTitle(MvResource.getS("Maillage initial")); - src.setVisible(false); + // creation de l internalframe qui contient le panel de visu + // final TrPostFille compFille = new TrPostFille(pnVisu); + // creation de la scene layout identique a au dessus + final TrPostLayoutFille compFille = new TrPostLayoutFille(this); - // on ajoute le calque dans le panel visu - pnVisu.addCalque(src); + // -- on ajoute le panel de visu comm widget calque au layout --// + compFille.addCalque(MvResource.getS("Maillage initial"), new Point(250, 170), new Dimension(400, 200), pnVisu, + new CalqueLegendeWidgetAdapter(compFille.getScene(), pnVisu.getArbreCalqueModel())); - src.monter(); - src.monter(); - } + // test si il faut ajouter le calque + if (_isInitGridDisplay) { + final MvGridLayerGroup src = new MvGridLayerGroup(_src.getGrid()); + src.setTitle(MvResource.getS("Maillage initial")); + src.setVisible(false); - // titre et action de la internalFrame - compFille.setTitle(FDicoLib.getS("Projection")); - compFille.setClosable(true); - compFille.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + // on ajoute le calque dans le panel visu + pnVisu.addCalque(src); - // ajout du listener associe a la fille - compFille.addInternalFrameListener(new InternalFrameListener() { + src.monter(); + src.monter(); + } - public void internalFrameActivated(final InternalFrameEvent _e) {} + // titre et action de la internalFrame + compFille.setTitle(FDicoLib.getS("Projection")); + compFille.setClosable(true); + compFille.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - public void internalFrameClosed(final InternalFrameEvent _e) { - projection.close(); - } + // ajout du listener associe a la fille + compFille.addInternalFrameListener(new InternalFrameListener() { - public void internalFrameClosing(final InternalFrameEvent _e) {} + public void internalFrameActivated(final InternalFrameEvent _e) {} - public void internalFrameDeactivated(final InternalFrameEvent _e) {} + public void internalFrameClosed(final InternalFrameEvent _e) { + projection.close(); + } - public void internalFrameDeiconified(final InternalFrameEvent _e) {} + public void internalFrameClosing(final InternalFrameEvent _e) {} - public void internalFrameIconified(final InternalFrameEvent _e) {} + public void internalFrameDeactivated(final InternalFrameEvent _e) {} - public void internalFrameOpened(final InternalFrameEvent _e) {} + public void internalFrameDeiconified(final InternalFrameEvent _e) {} - }); + public void internalFrameIconified(final InternalFrameEvent _e) {} - // trPostProjet.fille_ = compFille; - // trPostProjet.filleLayout_ = compFille; - // addFillesLayout(compFille); + public void internalFrameOpened(final InternalFrameEvent _e) {} - BuLib.invokeLater(new Runnable() { + }); - public void run() { - getImpl().addInternalFrame(compFille); - pnVisu.restaurer(); - } - }); + // trPostProjet.fille_ = compFille; + // trPostProjet.filleLayout_ = compFille; + // addFillesLayout(compFille); - } + BuLib.invokeLater(new Runnable() { - /** - * refonte de addFille qui ajoute des widgets - */ - public void addFille(final TrPostCourbeTreeModel _model, final String _titre, final ProgressionInterface _prog, - final TrPostVisuPanel calque) { - final EGGraphe graphe = new EGGraphe(_model); - graphe.setXAxe(EGAxeHorizontal.buildDefautTimeAxe(calque.getSource().getTimeFormatter())); - graphe.setCmd(new CtuluCommandManager()); - addEbliNode(new FudaaGrapheTimeAnimatedVisuPanel(graphe), calque); - } + public void run() { + getImpl().addInternalFrame(compFille); + pnVisu.re... [truncated message content] |