From: <had...@us...> - 2009-01-06 20:21:37
|
Revision: 4328 http://fudaa.svn.sourceforge.net/fudaa/?rev=4328&view=rev Author: hadouxad Date: 2009-01-06 20:21:36 +0000 (Tue, 06 Jan 2009) Log Message: ----------- corrections/ameliorations Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSource.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTrajectoireLineLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2009-01-06 20:18:57 UTC (rev 4327) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2009-01-06 20:21:36 UTC (rev 4328) @@ -39,10 +39,10 @@ //TODO a modifier class TrPostCourbeAddVariableAction extends EbliActionSimple { - final FudaaCommonImplementation impl_; + final TrPostCommonImplementation impl_; final EGGraphe model_; - public TrPostCourbeAddVariableAction(final FudaaCommonImplementation _impl, final EGGraphe _model) { + public TrPostCourbeAddVariableAction(final TrPostCommonImplementation _impl, final EGGraphe _model) { super(CtuluLib.getS("Ajouter des variables"), BuResource.BU.getToolIcon("ajouter"), "ADD_VARIALBES"); impl_ = _impl; model_ = _model; @@ -61,18 +61,56 @@ return null; } + + public static int selectSource(final Object[] _init, final String _title, final Component _parent) { + Arrays.sort(_init, FuComparator.STRING_COMPARATOR); + final BuList l = CtuluLibSwing.createBuList(_init); + final CtuluDialogPanel pn = new CtuluDialogPanel(false); + pn.setLayout(new BuBorderLayout()); + pn.setBorder(BuBorders.EMPTY3333); + pn.add(new BuLabel(CtuluLib.getS("S\xE9lectionner le fichier r\xE9sultat")), BuBorderLayout.NORTH); + pn.add(new BuScrollPane(l)); + if (CtuluDialogPanel.isOkResponse(pn.afficheModale(_parent, _title))) { return l.getSelectedIndex(); } + return -1; + } + @Override public void actionPerformed(final ActionEvent _e) { final TrPostCourbeTreeModel model = (TrPostCourbeTreeModel) model_.getModel(); - final EGCourbe selectedComponent = model_.getSelectedComponent(); + //final EGCourbe selectedComponent = model_.getSelectedComponent(); + // final EGCourbe selectedComponent = model_.getModel().getCourbes()[0]; TrPostSource src = null; - if (selectedComponent != null && selectedComponent.getModel() instanceof TrPostCourbeModel) { - src = ((TrPostCourbeModel) selectedComponent.getModel()).getSource(); - } +// if (selectedComponent != null && selectedComponent.getModel() instanceof TrPostCourbeModel) { +// src = ((TrPostCourbeModel) selectedComponent.getModel()).getSource(); +// } + + + //-- creation d'un lister de fichier source --// + final String[] values = impl_.c_.formattageDonnees(false); + + final int selectedSource = selectSource(values, (String) getValue(Action.NAME), impl_.getFrame()); + if(selectedSource !=-1) + src=impl_.c_.getSource(selectedSource); + + if (src == null) return; final TrPostSource finalSrc = src; + + + final Set var = new HashSet(Arrays.asList(src.getAllVariablesNonVec())); + if(model.varSupported_!=null) var.removeAll(model.varSupported_); + + + if(model.objIdx_==null){ + model.objIdx_=new int[src.getTime().getNbTimeStep()]; + for(int i=0;i<src.getTime().getNbTimeStep();i++) + model.objIdx_[i]=i; + } + if(model.intepolPt_==null) + model.intepolPt_ = new HashSet(); + final H2dVariableType[] vars = (H2dVariableType[]) var.toArray(new H2dVariableType[var.size()]); final Object[] selected = select(vars, (String) getValue(Action.NAME), impl_.getFrame()); if (!CtuluLibArray.isEmpty(selected)) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java 2009-01-06 20:18:57 UTC (rev 4327) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java 2009-01-06 20:21:36 UTC (rev 4328) @@ -123,7 +123,7 @@ } - public static EbliActionInterface[] getSpecActions(final EGGraphe _g, final FudaaCommonImplementation _impl, + public static EbliActionInterface[] getSpecActions(final EGGraphe _g, final TrPostCommonImplementation _impl, final TrPostVisuPanel _vue2d) { return new EbliActionInterface[] { new TrPostCourbeAddVariableAction(_impl, _g), new TrPostCourbeRemoveVariableAction(_impl, _g), new TrPostCourbeAddPointsAction(_impl, _g, _vue2d) }; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2009-01-06 20:18:57 UTC (rev 4327) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2009-01-06 20:21:36 UTC (rev 4328) @@ -332,7 +332,19 @@ protected void addVariables(final TrPostSource _src, final List _var, final ProgressionInterface _prog, final CtuluCommandContainer _cmd) { // buildTimeSteps(); + + + //-- Attention cas particulier, il faut conserver le groupe sans variable pour le rajouter a la fin --// +// EGGroup groupeSansVariables =null; +// if(existGroupFor(H2dVariableType.SANS)) +// groupeSansVariables=getGroupFor(H2dVariableType.SANS); + startUpdating(); + + if(varSupported_==null) + varSupported_= new HashSet(); + + // fusion graphes _var.removeAll(varSupported_); final int nbPt = objIdx_.length; @@ -391,6 +403,13 @@ _cmd.addCmd(cmp); } + + + //-- on ajoute de le groupe sans variable si il existait avant les modif: --// +// if(groupeSansVariables!=null){ +// add(groupeSansVariables); +// fireStructureChanged(); +// } } @@ -637,6 +656,20 @@ return group; } + public boolean existGroupFor(final H2dVariableType _t) { + if (_t == null) { return false; } + H2dVariableType parent = _t.getParentVariable(); + if (parent == null) { + parent = _t; + } + EGGroup group = (EGGroup) varGroup_.get(parent); + if (group == null) { + return false; + } + return true; + } + + public Set getIntepolPt() { return intepolPt_; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSource.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSource.java 2009-01-06 20:18:57 UTC (rev 4327) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSource.java 2009-01-06 20:21:36 UTC (rev 4328) @@ -301,6 +301,9 @@ void updateUserValue(final H2dVariableTypeCreated _old, final H2dVariableTypeCreated _new, final TrPostDataCreated _newData, final CtuluCommandContainer _cmd); + + + /** * @param _analyze permet d'initialise la base temporaire. */ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTrajectoireLineLayer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTrajectoireLineLayer.java 2009-01-06 20:18:57 UTC (rev 4327) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTrajectoireLineLayer.java 2009-01-06 20:21:36 UTC (rev 4328) @@ -159,6 +159,8 @@ } protected String getSelectedAttributeName() { + if(attSelectionModel_.getMaxSelectionIndex()==-1) + return ""; return attList_.get(attSelectionModel_.getMaxSelectionIndex()).getName(); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java 2009-01-06 20:18:57 UTC (rev 4327) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java 2009-01-06 20:21:36 UTC (rev 4328) @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -39,7 +40,7 @@ boolean simplified; String idSource; GrBoite zoom_; - + TrPostVisuPanelPersistManager() { } @@ -108,6 +109,14 @@ TrPostVisuPanel newPanel = new TrPostVisuPanel(projet.getImpl(), projet, legendeCalque, src); + + //-- on verifie si il faut charger les donnees zippees ou laisser tout se recalculer --// + final List<String> listeReloadSource=(List<String>) parameters.get("RELOAD"); + + + if(listeReloadSource!=null && listeReloadSource.contains(idSource)){ + + }else{ // -- restorer les donn\xE9es --// FudaaSaveZipLoader loader = null; try { @@ -119,7 +128,7 @@ } finally { if (loader != null) loader.safeClose(); } - + } // -- restoration du zoom --// // if(zoom_!=null) // newPanel.getVueCalque().changeRepere(newPanel, zoom_); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java 2009-01-06 20:18:57 UTC (rev 4327) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java 2009-01-06 20:21:36 UTC (rev 4328) @@ -209,7 +209,7 @@ /** * Methode qui: merge le calque choisi dans la combo avec el ndoe actuel degage le node choisi de la scene remet a - * jour al combo actuelle + * jour la combo actuelle */ private void mergeCalques() { @@ -225,11 +225,23 @@ // --Ajout du noeud --// listeToMerge.add(nodeToMerge); + + + if(((EbliWidgetVueCalque)nodeToMerge.getWidget().getIntern()).getCalqueController().hasLegende() ){ + EbliNode nodeLegende=((EbliWidgetVueCalque)nodeToMerge.getWidget().getIntern()).nodeLegende; + EbliScene scene=nodeToMerge.getWidget().getEbliScene(); + scene.removeNode(nodeLegende); + scene.refresh(); + + } } // -- ajout du node initial --// listeToMerge.add(nodeCalque_); + + + // --ajout de la courbe au widget de base --// // new CtuluTaskOperationGUI(projet_.impl_, TrResource.getS("Fusion avec un autre calque")) { // Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2009-01-06 20:18:57 UTC (rev 4327) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2009-01-06 20:21:36 UTC (rev 4328) @@ -603,7 +603,7 @@ * @throws IOException * @throws ClassNotFoundException */ - public boolean loadSource(final File file) { + public boolean loadSource(final File file, final HashMap<String, Object> parametres) { boolean reussite=true; // -- outputstream du xstream --// @@ -626,7 +626,14 @@ //-- lecture de la liste des objets source perssitant --// final List<TrPostSourcePersist> listeCouplesIdSources = (List<TrPostSourcePersist>) in.readObject(); + //-- liste qui contient l'ensemble des fichiers \xE0 recharger pour les vues 2d et vues 1d + final List<String> listeReloadSource=new ArrayList<String>(); + parametres.put("RELOAD", listeReloadSource); for (int i = 0; i < nbSources; i++) { + + + if(listeCouplesIdSources.get(i).rechargerLesLiens) + listeReloadSource.add(listeCouplesIdSources.get(i).IdSource); // -- tentative de lecture du path relatif --// String path = CtuluLibFile.getAbsolutePathnameTo(projet_, new File(listeCouplesIdSources.get(i).pathRelatifSource)).getPath(); @@ -656,7 +663,7 @@ trprojet_.getImpl().warn(TrLib.getString("Solution d\xE9j\xE0 charg\xE9e"), TrLib.getString("Le fichier source existe d\xE9j\xE0 et ne peut \xEAtre ajout\xE9 au projet.")); - //--ACHTUNG !!! --// + //--ACHTUNG !!! --// //-- mise a jour de l'ID necessaire afin de charger correctement la suite --// trprojet_.findSource(path).setId(listeCouplesIdSources.get(i).IdSource); } else { @@ -930,7 +937,10 @@ managerError.clear(); //-- on elimine les doublons potentiels des frames layouts --// ui_.elimineDoublonNomsLayout(); - + + // -- creation des params pour les datas --// + final HashMap<String, Object> parametres = new HashMap<String, Object>(); + progression("Lecture du r\xE9pertoire", 10); // -- etape 1 lecture du repertoire global ou du fichier param --// @@ -947,7 +957,7 @@ // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts progression("Chargement du fichier descripteur de sources", 15); file = new File(projet_.getAbsolutePath() + File.separator + setupProject); - if(! loadSource(file)){ + if(! loadSource(file,parametres)){ managerError.addMessageError("Veuillez corriger les chemins des fichiers r\xE9sultats dans le fichier setup et r\xE9it\xE9rez l'op\xE9ration."); managerError.showDialog(ui_); return false; @@ -963,8 +973,7 @@ // -- etape 4 chargement des ebliscene unitairement --// progression("Cr\xE9ation des fichiers layout", 40); - // -- creation des params pour les datas --// - final HashMap<String, Object> parametres = new HashMap<String, Object>(); + parametres.put("path", projet_.getAbsolutePath()); parametres.put("ui", ui_); parametres.put("TrPostProjet", trprojet_); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java 2009-01-06 20:18:57 UTC (rev 4327) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java 2009-01-06 20:21:36 UTC (rev 4328) @@ -22,6 +22,7 @@ String IdSource; String pathSource; String pathRelatifSource; + boolean rechargerLesLiens=false; public TrPostSourcePersist(){} /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |