From: <de...@us...> - 2008-08-25 20:37:00
|
Revision: 3835 http://fudaa.svn.sourceforge.net/fudaa/?rev=3835&view=rev Author: deniger Date: 2008-08-25 20:37:03 +0000 (Mon, 25 Aug 2008) Log Message: ----------- Modified Paths: -------------- 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 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-08-25 20:36:21 UTC (rev 3834) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-08-25 20:37:03 UTC (rev 3835) @@ -68,6 +68,8 @@ import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; @@ -272,7 +274,7 @@ * Fenetre fille qui contient le layout scene. Cette fenetre remplace petit a * petit fille_ */ - transient TrPostLayoutFille filleLayout_ = new TrPostLayoutFille(this); + transient TrPostLayoutFille filleLayout_; transient BuInternalFrame frVariables_; @@ -804,8 +806,8 @@ } - protected TrPostVisuPanel buildVisuPanel() { - return new TrPostVisuPanel(impl_, this, new BCalqueLegende()); + protected TrPostVisuPanel buildVisuPanel(EbliScene _scene) { + return new TrPostVisuPanel(impl_, this, new EbliWidgetCalqueLegende(_scene)); } /** @@ -976,7 +978,7 @@ public void act() { filleLayout_ = new TrPostLayoutFille(TrPostProjet.this); - final TrPostVisuPanel pnVisu = buildVisuPanel(); + final TrPostVisuPanel pnVisu = buildVisuPanel(filleLayout_.getScene()); // fille_ = new TrPostFille(pnVisu); Modified: 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/TrPostVisuPanel.java 2008-08-25 20:36:21 UTC (rev 3834) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-08-25 20:37:03 UTC (rev 3835) @@ -44,6 +44,9 @@ import org.fudaa.ebli.commun.EbliActionPaletteAbstract; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliLib; +import org.fudaa.ebli.geometrie.GrBoite; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.meshviewer.MvSelectionNodeOrEltData; import org.fudaa.fudaa.meshviewer.export.MvExportFactory; @@ -468,12 +471,9 @@ } /** - * @param _impl - * l'implementation - * @param _src - * la source - * @param _selection - * la selection + * @param _impl l'implementation + * @param _src la source + * @param _selection la selection */ public static void startExport(final CtuluUI _impl, final TrPostSource _src, final MvSelectionNodeOrEltData _selection) { TrExportFactory fac = null; @@ -501,47 +501,16 @@ /** * duplication du trPostVisuPanel. surcharge de la duplication du zeblicalquePanel. */ - public TrPostVisuPanel duplicate(Map options) { + public TrPostVisuPanel duplicate(Map _options) { - final TrPostVisuPanel duplic = new TrPostVisuPanel(this.getImpl(), this.getProjet(), null); - // -- duplication du layer qui contient les memes proprietes --// - duplic.isoLayer_ = (TrIsoLayer) this.isoLayer_.duplicate(); + final TrPostVisuPanel duplic = new TrPostVisuPanel(this.getImpl(), this.getProjet(), new EbliWidgetCalqueLegende( + (EbliScene) _options.get("scene"))); + // -- sauvegarde de l etat --// + BCalqueSaverInterface savedData = getDonneesCalque().getPersistenceMng().save(getDonneesCalque(), null); - // -- duplication des donnees via sauvegarde thread--// - new CtuluTaskOperationGUI(this.impl_, TrResource.getS("Enregistrement")) { + // -- chargement de l etat dans le calque duplique --// + duplic.getDonneesCalque().getPersistenceMng().restore(savedData, duplic, duplic.getDonneesCalque(), null); - public void act() { - - // -- sauvegarde de l etat --// - BCalqueSaverInterface savedData = getDonneesCalque().getPersistenceMng().save(getDonneesCalque(), - impl_.createProgressionInterface(this)); - - // -- chargement de l etat dans le calque duplique --// - duplic.getDonneesCalque().getPersistenceMng().restore(savedData, duplic, duplic.getDonneesCalque(), - impl_.createProgressionInterface(this)); - - // -- destruction des calques doublons du duplic pour recuperer une - // bonne arborescence --// - - // BCalque[] liste = duplic.getDonneesCalque().getCalques(); - // for (int i = 0; i < liste.length; i++) { - // BCalque calque = liste[i]; - // boolean existeDeja = false; - // // --recherche si doublon --// - // for (int j = i + 1; j < liste.length; j++) { - // BCalque calque2 = liste[j]; - // if (calque == calque2) - // liste[j].setDestructible(true); - // // duplic.getDonneesCalque().detruire(liste[j]); - // duplic.detruireCalque(liste[j]); - // - // } - // - // } - - } - }.start(); - return duplic; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-08-26 16:15:47
|
Revision: 3840 http://fudaa.svn.sourceforge.net/fudaa/?rev=3840&view=rev Author: hadouxad Date: 2008-08-26 16:15:56 +0000 (Tue, 26 Aug 2008) Log Message: ----------- - Panel de Gestion des projets utilisant un jxtable et model associ?\195?\169 - Panel de chooser des projet pour la fonction de creation du calque: on choisit dans la liste le jeux de donn?\195?\169es a utiliser - Implementation du design pattern observer observable pour les modifs de la liste des src. - Mise en place des modifs auto en cas de suppression ou ajout de jeux de donn?\195?\169es. - Creation de l action TrPostActionChooseAndCreateCalque qui permet de choisir le jeux de donn?\195?\169es et de cr?\195?\169er le widget correspondant. Fonctionne OK - Modif de TRPOSTVISUPANEL: il prend en parametre l indice de la source utilis?\195?\169e, et utilise l accesseur getSource(int index) pour r?\195?\169cup?\195?\169rer le bon jeu de donn?\195?\169es. - Information du jeux de donn?\195?\169e utilis?\195?\169e: indiqu?\195?\169 en toolTip sur la widget - Menu 'Info' suppl?\195?\169mentaire ajout?\195?\169 a la widget pour indiquer entre autre le jeux de donn?\195?\169es utilis?\195?\169es. - Creation des menus sp?\195?\169cifiques pour chaque simulation: - chaque simulation a son onglet de menu qui porte le nom du fichier - les evenements sont numerotes dans le meme ordre que le rangement des simulations - Refonte de la fonction "ouvrir" qui ouvre un source dans le multi-source dans le projet. Un truc sympa car il fallait tenir compte des plusieurs simul et de la possibilite d en supprimer: - refonte des evenements liees au multi-sources: - on gere une liste de menu qui representent chacun une simulation - pour retrouver l evenement du bon menu enclench?\195?\169, on parcours la liste et onv?\195?\169rifie 2 choses: le menuitem est le bon et l'event est bon. Au final la complexit?\195?\169 de l algo: lin?\195?\169aire (* par constante ?\195?\169gale au nombre de sous menus de post donc n?\195?\169gligeable...) Refonte des fonctions li?\195?\169es au post pour gere le multi osurce: - Export data OK. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionRemoveSrc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionRemoveSrc.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionRemoveSrc.java 2008-08-26 16:06:40 UTC (rev 3839) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionRemoveSrc.java 2008-08-26 16:15:56 UTC (rev 3840) @@ -69,7 +69,7 @@ .activate(); if (confirmation == 0) { - if (projet_.removeSource(src)) { + if (projet_.removeSource(src, projet_.filleProjetctManager_.listProjets_.getSelectedRow())) { new BuDialogMessage(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), "Le fichier a \xE9t\xE9 correctement enlev\xE9 du projet").activate(); 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-08-26 16:06:40 UTC (rev 3839) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-08-26 16:15:56 UTC (rev 3840) @@ -456,13 +456,31 @@ * : TrPostSource, retourne true si la suppression a bien ete * effectuee. */ - public boolean removeSource(TrPostSource src){ + public boolean removeSource(TrPostSource src, int n) { if (isSourceExist(src.getFile().getAbsolutePath())) { listeSrc_.remove(src); - + // --recuperation du menu simul --// + BuMenu menuSimul = listeMenuProjets_.get(n); + // --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 le menuSimul de la liste --// + menuPost_.remove(menuSimul); + + // -- on retire de la liste des menus le menusimul et la liste des sous + // menus --// + listeMenuProjets_.remove(n); + listeSousMenuProjets_.remove(n); + + // -- mise a jour de la barre des menus --// + impl_.getMainMenuBar().revalidate(); + return true; } else { // -- messqge d erreur: le fichier est deja ouvert --// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-02 21:48:31
|
Revision: 3864 http://fudaa.svn.sourceforge.net/fudaa/?rev=3864&view=rev Author: deniger Date: 2008-09-02 21:48:34 +0000 (Tue, 02 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChooseAndCreateCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.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 Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChooseAndCreateCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChooseAndCreateCalque.java 2008-09-02 16:29:18 UTC (rev 3863) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChooseAndCreateCalque.java 2008-09-02 21:48:34 UTC (rev 3864) @@ -7,7 +7,7 @@ import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; +import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; import com.memoire.bu.BuDialogChoice; import com.memoire.bu.BuDialogError; @@ -91,12 +91,12 @@ .getSource(indiceSOURCESelect)); EbliNode node = projet_.filleLayout_.controller_.addCalque("Calque principal", pnVisu.getLocation(), pnVisu .getPreferredSize(), - pnVisu, new EbliWidgetCalqueLegende(projet_.filleLayout_.getScene(), pnVisu + pnVisu, new CalqueLegendeWidgetAdapter(projet_.filleLayout_.getScene(), pnVisu .getArbreCalqueModel())); // -- ajout de l INFO de la source utilis\xE9e --// - node.getCreator().getWidget().getController_().setDescription_("Source: " + values[indiceSOURCESelect]); + node.getCreator().getWidget().getController_().setDescription("Source: " + values[indiceSOURCESelect]); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java 2008-09-02 16:29:18 UTC (rev 3863) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java 2008-09-02 21:48:34 UTC (rev 3864) @@ -33,7 +33,7 @@ */ public class TrPostActionController extends FSigVisuPanelController { - Set<String> useAsPalette = new HashSet<String>(Arrays.asList("CONFIGURE")); + Set<String> useAsPalette = new HashSet<String>(Arrays.asList("CONFIGURE","CHANGE_REFERENCE")); /** * Contient chaque palette enlevee sous la forme l'actionCommand-> l'action 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-09-02 16:29:18 UTC (rev 3863) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-02 21:48:34 UTC (rev 3864) @@ -20,6 +20,7 @@ import org.fudaa.ctulu.CtuluUndoRedoInterface; import org.fudaa.ctulu.gui.CtuluFilleWithComponent; import org.fudaa.ebli.calque.BArbreCalque; +import org.fudaa.ebli.calque.BCalquePaletteInfo; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; import org.fudaa.ebli.calque.action.EbliCalqueActionVariableChooser; @@ -39,7 +40,7 @@ import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionConfigure; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetEditCreator; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; +import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.tr.common.TrLib; @@ -92,7 +93,7 @@ /** * Scroll qui contient le tree a droite. Ce panel est modifi\xE9 des que l on change de type d elements. */ - JScrollPane panelTreeModifiable_; + JComponent panelTreeModifiable_; /** * palette d infos pour le calque associe. */ @@ -106,7 +107,7 @@ * bouton qui permet de masquer/afficher le tree */ JButton toggleTree_; - + TrPostProjet projet_; /** @@ -115,7 +116,7 @@ public TrPostLayoutFille(TrPostProjet _projet) { super(); setTitle(TrResource.getS("vue 2D")); - + projet_ = _projet; // creation de la scene EBLI controller_ = new TrPostLayoutPanelController(new TrPostScene(), _projet); @@ -146,9 +147,8 @@ * java.awt.Dimension, org.fudaa.ebli.calque.ZEbliCalquesPanel) */ public EbliNode addCalque(String _title, Point _preferredLocation, Dimension _preferedDimension, - TrPostVisuPanel _calque, EbliWidgetCalqueLegende _legende) { - - + TrPostVisuPanel _calque, CalqueLegendeWidgetAdapter _legende) { + return controller_.addCalque(_title, _preferredLocation, _preferedDimension, _calque, _legende); } @@ -182,12 +182,11 @@ selector.add(projet_.impl_.getMainPanel().getScrollDesktop_().getCorner(JScrollPane.LOWER_RIGHT_CORNER)); selector.add(toggle); projet_.impl_.getMainPanel().getScrollDesktop_().setCorner(JScrollPane.LOWER_RIGHT_CORNER, toggle);// selector - // ) - // ; - - + // ) + // ; + JPanel over = new JPanel(new BorderLayout()); - // over.add(toggle, BorderLayout.NORTH); + // over.add(toggle, BorderLayout.NORTH); over.add(pane, BorderLayout.CENTER); pane.add(getScene().createSatelliteView()); right.add(over, BorderLayout.NORTH); @@ -205,36 +204,33 @@ // pane.add(panelTreeModifiable_); // right.add(conteneurTree_, BorderLayout.CENTER); - toggleTree_ = new JButton("Arbre"); toggleTree_.setText("Composants"); panelTreeModifiable_ = new JScrollPane(controller_.createTree()); // right.add(panelTreeModifiable_, BorderLayout.CENTER); conteneurTree_ = new JPanel(new BorderLayout()); - // conteneurTree_.add(toggleTree_, BorderLayout.NORTH); + // conteneurTree_.add(toggleTree_, BorderLayout.NORTH); conteneurTree_.add(panelTreeModifiable_, BorderLayout.CENTER); - + right.add(conteneurTree_, BorderLayout.CENTER); - - // -- ajout du bouton qui permet de g\xE9rer tous les resultats - BuButton boutonGestionMultiSrc = new BuButton("Gestion des projets"); - - boutonGestionMultiSrc.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent e) { - // -- affichage de la fenetre de gestion multi projet --// - if (!projet_.filleProjetctManager_.isVisible()) - projet_.impl_.addInternalFrame(projet_.filleProjetctManager_); - - // projet_.filleProjetctManager_.setSize(500, 250); - - } - - }); - over.add(boutonGestionMultiSrc, BorderLayout.SOUTH); + // TODO a enlever doit etre dans le menu Post + // BuButton boutonGestionMultiSrc = new BuButton("Gestion des projets"); + // + // boutonGestionMultiSrc.addActionListener(new ActionListener() { + // + // public void actionPerformed(ActionEvent e) { + // // -- affichage de la fenetre de gestion multi projet --// + // if (!projet_.filleProjetctManager_.isVisible()) projet_.impl_.addInternalFrame(projet_.filleProjetctManager_); + // + // // projet_.filleProjetctManager_.setSize(500, 250); + // + // } + // + // }); + // over.add(boutonGestionMultiSrc, BorderLayout.SOUTH); // --verification qu il n existe pas de composant sur la scene auquel cas, // selection automatique pour modification --// @@ -244,10 +240,7 @@ getScene().refresh(); } } - - - - + return right; } @@ -354,7 +347,7 @@ } public void duplicate() { - JOptionPane.showMessageDialog(null, "duplicate()"); + throw new IllegalAccessError("not supported"); } public void paste() { @@ -444,7 +437,7 @@ } EbliNode node = (EbliNode) newSelection.iterator().next(); - // TODO a gerer de maniere Generique + // FIXME a gerer de maniere Generique: ce sont les widget qui doivent donner toutes ces infos // 3 cas pour le moment: graphe ou calque ou rien if (!node.hasWidget()) return; @@ -507,36 +500,27 @@ * @param calque */ private void changeTreeCalque(ZEbliCalquesPanel _calque) { - + // FIXME ne doit pas recree \xE0 chaque fois: porb de listener... conteneurTree_.remove(panelTreeModifiable_); // JComponent component = EbliWidgetEditCreator.createView(new // BArbreCalque(_calque.getArbreCalqueModel()), // EbliResource.EBLI.getToolIcon("arbre"), "Calques", false); - //TODO dangereux car chaque arbre s'enregistre en tant que listener du calque et il ne d\xE9sabonne jamais. - panelTreeModifiable_ = new JScrollPane(new BArbreCalque(_calque.getArbreCalqueModel())); + // FIXME dangereux car chaque arbre s'enregistre en tant que listener du calque et il ne d\xE9sabonne jamais. + panelTreeModifiable_ = new JPanel(new BorderLayout()); + // FIXME DANGEREUX: le barbecalque s'enregistre en tant que listener du model a chaque fois !!!!!!! + panelTreeModifiable_.add(new BArbreCalque(_calque.getArbreCalqueModel())); // panelTreeModifiable_ = new JScrollPane(component); this.toggleTree_.setText("Calques"); - + + BCalquePaletteInfo info = new BCalquePaletteInfo(_calque.getArbreCalqueModel()); + info.setAvailable(true); + panelTreeModifiable_.add(info, BorderLayout.NORTH); conteneurTree_.add(panelTreeModifiable_, BorderLayout.CENTER); - // conteneurTree_.add(, BorderLayout.SOUTH); - - - // -- ajout de la toolBar d'infos au sud --// - TrPostActionController controller = (TrPostActionController) _calque.getController(); - EbliActionPaletteAbstract pal = controller.getPaletteAction("INFOS"); - if (pal != null) { - pal.updateBeforeShow(); - pal.setSelected(true); - palette_ = pal.buildContentPane(); - conteneurTree_.add(palette_, BorderLayout.SOUTH); - } - - // mise a jour du panel conteneurTree_.validate(); - + panelTreeModifiable_.revalidate(); } @@ -548,8 +532,7 @@ private void changeTreeGraphe(EGGraphe _graphe) { conteneurTree_.remove(panelTreeModifiable_); - if (palette_ != null) - conteneurTree_.remove(palette_); + if (palette_ != null) conteneurTree_.remove(palette_); // JComponent component = EbliWidgetEditCreator.createView(new // JTree((EGGrapheTreeModel) _graphe.getModel()), // EbliResource.EBLI.getToolIcon("arbre"), "Courbes", false); @@ -577,9 +560,8 @@ */ private void changeTreeScene() { conteneurTree_.remove(panelTreeModifiable_); - if (palette_ != null) - conteneurTree_.remove(palette_); - JComponent component = EbliWidgetEditCreator.createView(controller_.createTree(), EbliResource.EBLI + if (palette_ != null) conteneurTree_.remove(palette_); + JComponent component = EbliWidgetEditCreator.createView(controller_.createTree(), EbliResource.EBLI .getToolIcon("arbre"), "Composants", false); panelTreeModifiable_ = new JScrollPane(controller_.createTree()); @@ -610,8 +592,6 @@ toolBarModifiable_.addSeparator(); } else { toolBarModifiable_.add(object.buildToolButton(EbliComponentFactory.INSTANCE)); - - } } @@ -622,47 +602,43 @@ menuModifiable_.add(specificMenus[i]); } - // -- ajout des comboBox des variables --// - EbliCalqueActionVariableChooser chooser = new EbliCalqueActionVariableChooser(_calque.getArbreCalqueModel()); - // obligatoire pour creer le BselecteurList - chooser.buildContentPane(); - chooser.updateBeforeShow(); - BSelecteurList listselector = (BSelecteurList) chooser.getPalette_(); BSelecteurListComboBox combo = new BSelecteurListComboBox(); - combo.setPalettePanelTarget(listselector.getTarget_()); - combo.setMaximumSize(combo.getPreferredSize()); + // pour mettre \xE0 jour la combo d\xE8s que la s\xE9lection de l'arbre change + _calque.getArbreCalqueModel().getTreeSelectionModel().addTreeSelectionListener(combo); + combo.setPalettePanelTarget(_calque.getArbreCalqueModel().getSelectedCalque()); + // combo.setPalettePanelTarget(listselector.getTarget()); + combo.setMinimumSize(combo.getPreferredSize()); + combo.setMaximumSize(combo.getPreferredSize()); // ajout combobox - toolBarModifiable_.add(chooser.buildToolButton(EbliComponentFactory.INSTANCE)); - // combo.setToolTipText(); toolBarModifiable_.add(combo); - - - - - EbliCalqueActionTimeChooser chooserT = new EbliCalqueActionTimeChooser(_calque.getArbreCalqueModel()); - // obligatoire pour creer le BselecteurList - chooserT.buildContentPane(); + + EbliCalqueActionTimeChooser chooserT = new EbliCalqueActionTimeChooser(_calque.getArbreCalqueModel() + .getTreeSelectionModel(), true); + // pour activer l'action + chooserT.setSelected(true); + // // obligatoire pour creer le BselecteurList + // listselector = (BSelecteurList) chooserT.getPalette_(); + combo = (BSelecteurListComboBox) chooserT.buildContentPane(); chooserT.updateBeforeShow(); - listselector = (BSelecteurList) chooserT.getPalette_(); - combo = new BSelecteurListComboBox(); - combo.setPalettePanelTarget(listselector.getTarget_()); - combo.setMaximumSize(combo.getPreferredSize()); + // _calque.getArbreCalqueModel().getTreeSelectionModel().addTreeSelectionListener(combo); + // combo.setPalettePanelTarget(listselector.getTarget_()); + combo.setMaximumSize(combo.getPreferredSize()); + combo.setMinimumSize(combo.getPreferredSize()); // ajout combobox - toolBarModifiable_.add(chooserT.buildToolButton(EbliComponentFactory.INSTANCE)); + // toolBarModifiable_.add(chooserT.buildToolButton(EbliComponentFactory.INSTANCE)); // combo.setToolTipText(); toolBarModifiable_.add(combo); - + + // ajout bouton toolbar + // -- ajotu d un bouton pour la paletet des legendes --// // toolBarModifiable_.add(new // PaletteEditAction(_calque.getArbreCalqueModel() // .getTreeSelectionModel())); - - - - + // mise a jour des params toolBarModifiable_.revalidate(); menuModifiable_.revalidate(); @@ -675,7 +651,7 @@ EGFillePanel _graphe = creator.getGraphePanel(); TrPostVisuPanel _calque = (TrPostVisuPanel) creator.getCalquepanelProvenance(); - + // nettoyage de la toolbar toolBarModifiable_.removeAll(); menuModifiable_.removeAll(); @@ -691,25 +667,20 @@ } } - - - // ajout des menus specifiques JMenu menu = new JMenu("Menu graphe"); _graphe.fillSpecificMenu(menu); menuModifiable_.add(menu); - - // -- ajout de l'action qui ajoute un point au graphe --// TrPostCourbeAddPointsAction addPoint = new TrPostCourbeAddPointsAction(projet_.impl_, _graphe.getGraphe(), _calque); toolBarModifiable_.add(addPoint.buildToolButton(EbliComponentFactory.INSTANCE)); menu.add(addPoint); - + TrPostCourbeAddVariableAction addVariable = new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe()); toolBarModifiable_.add(addVariable.buildToolButton(EbliComponentFactory.INSTANCE)); menu.add(addVariable); - + // mise a jour des params toolBarModifiable_.revalidate(); menuModifiable_.revalidate(); 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-09-02 16:29:18 UTC (rev 3863) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-09-02 21:48:34 UTC (rev 3864) @@ -15,7 +15,6 @@ import javax.swing.ListSelectionModel; import org.fudaa.ctulu.CtuluCommandManager; -import org.fudaa.ebli.calque.BArbreCalqueModel; import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.commun.EbliActionAbstract; @@ -42,7 +41,7 @@ import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionImageChooser; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRetaillageHorizontal; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRetaillageVertical; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; +import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerCalque; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorLegende; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; @@ -112,7 +111,7 @@ * @return le node cree */ public EbliNode addCalque(String title, Point preferredLocation, Dimension preferedDimension, TrPostVisuPanel calque, - EbliWidgetCalqueLegende _legende) { + CalqueLegendeWidgetAdapter _legende) { // TODO a eviter // -- enregistrement du calque principal --// if (calquePrincipal == null) @@ -246,11 +245,11 @@ * Methode d ajout d'un calque legende. * @return */ - public EbliNode addCalqueLegende(BCalqueLegende legende, BArbreCalqueModel model) { + public EbliNode addCalqueLegende(BCalqueLegende legende) { // -- ajout du rectangle --// final EbliNodeDefault nodeLegende = new EbliNodeDefault(); nodeLegende.setTitle("Legende calque"); - nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0), model)); + nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0))); nodeLegende.setPreferedSize(new Dimension(200, 100)); nodeLegende.setPreferedLocation(new Point(350, 125)); // ajout du node au layout 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-09-02 16:29:18 UTC (rev 3863) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-09-02 21:48:34 UTC (rev 3864) @@ -71,7 +71,7 @@ import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; +import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; @@ -816,7 +816,7 @@ // -- 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 EbliWidgetCalqueLegende(compFille.getScene(), pnVisu.getArbreCalqueModel())); + new CalqueLegendeWidgetAdapter(compFille.getScene(), pnVisu.getArbreCalqueModel())); // test si il faut ajouter le calque if (_isInitGridDisplay) { @@ -955,7 +955,7 @@ } - protected TrPostVisuPanel buildVisuPanel(EbliScene _scene, EbliWidgetCalqueLegende legende) { + protected TrPostVisuPanel buildVisuPanel(EbliScene _scene, CalqueLegendeWidgetAdapter legende) { return new TrPostVisuPanel(impl_, this, legende); } @@ -1147,10 +1147,10 @@ filleLayout_ = new TrPostLayoutFille(TrPostProjet.this); // -- creation d une instance de la legende du calque --// - EbliWidgetCalqueLegende legendeCalque = new EbliWidgetCalqueLegende(filleLayout_.getScene(), null); + CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter(filleLayout_.getScene(), null); final TrPostVisuPanel pnVisu = buildVisuPanel(filleLayout_.getScene(), legendeCalque); - legendeCalque.setModelTreeCalque(pnVisu.getArbreCalqueModel()); +// legendeCalque.setModelTreeCalque(pnVisu.getArbreCalqueModel()); // fille_ = new TrPostFille(pnVisu); // --creation de l internalframe layout --// @@ -1160,7 +1160,7 @@ EbliNode node = filleLayout_.addCalque("Calque principal", pnVisu.getLocation(), pnVisu.getPreferredSize(), pnVisu, legendeCalque); // -- ajout de l INFO de la source utilis\xE9e --// - node.getCreator().getWidget().getController_().setDescription_(formatInfoSource(getSource(0))); + node.getCreator().getWidget().getController_().setDescription(formatInfoSource(getSource(0))); // -- decoration de la fille layout --// decoreFilleVisu(); Modified: 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/TrPostVisuPanel.java 2008-09-02 16:29:18 UTC (rev 3863) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-09-02 21:48:34 UTC (rev 3864) @@ -44,7 +44,7 @@ import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; +import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.meshviewer.MvSelectionNodeOrEltData; import org.fudaa.fudaa.meshviewer.export.MvExportFactory; @@ -541,9 +541,9 @@ public TrPostVisuPanel duplicate(Map _options) { - EbliWidgetCalqueLegende legendeCalque=new EbliWidgetCalqueLegende((EbliScene) _options.get("scene"), null); + CalqueLegendeWidgetAdapter legendeCalque=new CalqueLegendeWidgetAdapter((EbliScene) _options.get("scene"), null); final TrPostVisuPanel duplic = new TrPostVisuPanel(this.getImpl(), this.getProjet(), legendeCalque); - legendeCalque.setModelTreeCalque(duplic.getArbreCalqueModel()); +// legendeCalque.setModelTreeCalque(duplic.getArbreCalqueModel()); System.err.println(duplic.getCqLegend()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-03 18:39:29
|
Revision: 3878 http://fudaa.svn.sourceforge.net/fudaa/?rev=3878&view=rev Author: hadouxad Date: 2008-09-03 18:39:34 +0000 (Wed, 03 Sep 2008) Log Message: ----------- - g?\195?\169rer les multi scene - g?\195?\169rer les permutations de scene, ajout, suppression - r?\195?\169aliser un menu sp?\195?\169cifique a cot?\195?\169 de 'post' pour g?\195?\169rer la scene: contient un menuitem par liste puis a la fin les onglets d'ajout et suppression - g?\195?\169rer une combo de choix des scene:ajout?\195?\169 dans le panel de droite - creation des operations de bases: - ajout - suppression - changement de layout - possibilit?\195?\169 de creer des widget dans n importe quel layout - possibilit?\195?\169 de switcher de layout - gestion des menus des layout Modified Paths: -------------- 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 Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrpostComboMultiScenes.java 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-09-03 17:07:03 UTC (rev 3877) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-03 18:39:34 UTC (rev 3878) @@ -204,7 +204,7 @@ right.add(conteneurTree_, BorderLayout.CENTER); - + conteneurTree_.add(controller_.getComboMultiScenes(), BorderLayout.NORTH); if (controller_ != null) { Set<EbliNode> noeudContenus = (Set<EbliNode>) controller_.getSceneCourante().getObjects(); @@ -497,7 +497,7 @@ /** * Met a jour le tree a droite si ni un graphe ni un calque n est selectionn\xE9. */ - private synchronized void changeTreeScene() { + public synchronized void changeTreeScene() { conteneurTree_.remove(panelTreeModifiable_); panelTreeModifiable_ = new JScrollPane(getScene().getController().getOverviewComponent()); @@ -567,7 +567,7 @@ this.revalidate(); } - private synchronized void changeToolbarScene() { + public synchronized void changeToolbarScene() { // nettoyage de la toolbar this.remove(toolBarModifiable_); this.remove(menuModifiable_); 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-09-03 17:07:03 UTC (rev 3877) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-09-03 18:39:34 UTC (rev 3878) @@ -3,6 +3,7 @@ import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -14,6 +15,7 @@ import javax.swing.JScrollPane; import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.CtuluResource; import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.commun.EbliActionAbstract; @@ -47,11 +49,17 @@ import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorEllipse; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorFleche; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorRectangle; +import org.fudaa.fudaa.tr.common.TrResource; import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuComboBox; import com.memoire.bu.BuDesktop; +import com.memoire.bu.BuDialogConfirmation; +import com.memoire.bu.BuDialogError; +import com.memoire.bu.BuDialogMessage; import com.memoire.bu.BuMenu; +import com.memoire.bu.BuMenuBar; +import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuPanel; import com.memoire.bu.BuResource; import com.memoire.bu.BuSeparator; @@ -62,7 +70,7 @@ * @author Adrien Hadoux * */ -public class TrPostLayoutPanelController { +public class TrPostLayoutPanelController implements ActionListener { JPanel pn_; @@ -76,13 +84,19 @@ /** * combobox qui gere le multiscene */ - BuComboBox comboMultiScenes_; + BuComboBox comboMultiScenes_ = new BuComboBox();; + + JScrollPane conteneurSceneView_; + /** * Liste qui contient l'ensemble des scenes. */ ArrayList<EbliScene> listeScenes_ = new ArrayList<EbliScene>(); + BuMenu menuScenes_ = new BuMenu(TrResource.getS("Liste des Layouts"), "LISTELAYOUT"); + ArrayList<BuMenuItem> listeMenusScenes_ = new ArrayList<BuMenuItem>(); + List<EbliActionAbstract> actions; TrPostProjet projet_; @@ -95,31 +109,82 @@ TrPostLayoutPanelController(EbliScene _scene, TrPostProjet _projet) { // treeModel_ = _scene.getTreeModel(); sceneCourante_ = _scene; - listeScenes_.add(_scene); + addScene(_scene); _scene.setCmdMng(new CtuluCommandManager()); projet_ = _projet; - comboMultiScenes_ = new BuComboBox(); + comboMultiScenes_.addActionListener(this); + construitMenuMultiScenes(_projet.impl_.getMainMenuBar()); + + } + public void construitMenuMultiScenes(BuMenuBar _bar) { + + // -- creation du menu principal des scenes a cote de post --// + BuMenu menu = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER"); + menu.addMenuItem(TrResource.getS(("Ajouter un layout")), "AJOUTLAYOUT", CtuluResource.CTULU + .getIcon("crystal_ajouter"), + this); + menu.addMenuItem(TrResource.getS(("Retirer un layout")), "RETIRELAYOUT", CtuluResource.CTULU + .getIcon("crystal_enlever"), this); + menu.addSeparator("Layouts"); + menu.addSubMenu(menuScenes_, true); + + // ajout a cote de menu post + _bar.add(menu, 3); + + } + public void addScene(EbliScene _scene){ listeScenes_.add(_scene); + + // -- ajout dans la combo --// + comboMultiScenes_.addItem("Layout " + listeScenes_.size()); + + // -- ajout dans le menu la scene --// + listeMenusScenes_.add(menuScenes_.addMenuItem(TrResource.getS(("Layout ")) + listeScenes_.size(), "LAYOUT" + + (listeScenes_.size() - 1), null, this)); + } public int getNbScene() { return listeScenes_.size(); } - public boolean removeScene(EbliScene _scene) { - return listeScenes_.remove(_scene); + public boolean removeScene(EbliScene _scene,int index) { + listeScenes_.remove(_scene); + + comboMultiScenes_.removeItemAt(index); + + menuScenes_.remove(listeMenusScenes_.get(index)); + menuScenes_.validate(); + listeMenusScenes_.remove(index); + + if (_scene == sceneCourante_) { + + sceneCourante_ = getScene(0); + } + + return true; } - public void changeScene(EbliScene _scene) { + /** + * Methode qui met a jour l affichage avec la nouvelle scene + * + * @param _scene + */ + public void changeScene(EbliScene _scene, int index) { sceneCourante_ = _scene; + + comboMultiScenes_.setSelectedIndex(index); + + majVue(); + } public EbliScene getScene(int i) { @@ -131,6 +196,10 @@ return sceneCourante_; } + public BuComboBox getComboMultiScenes() { + return comboMultiScenes_; + } + /** * Methode specialisee dans l ajout d un ndoe de type calque a la scene. * @@ -444,13 +513,19 @@ return actions; } + /** + * affichage de la scene. + * + * @return + */ public JPanel getPanel() { if (pn_ == null) { // -- creation du conteneur de base qui contient tout --// pn_ = new BuPanel(new BuBorderLayout()); // ajout de la scene au centre - pn_.add(new JScrollPane(getSceneCourante().createView()), BuBorderLayout.CENTER); + conteneurSceneView_ = new JScrollPane(getSceneCourante().createView()); + pn_.add(conteneurSceneView_, BuBorderLayout.CENTER); // // -- construction de la barre des commandes de base --// // content.add(buildToolBar(), BuBorderLayout.NORTH); @@ -458,6 +533,82 @@ return pn_; } + + /** + * methode qui met a jour la vue de la scene + */ + public void majVue() { + pn_.remove(conteneurSceneView_); + conteneurSceneView_ = new JScrollPane(getSceneCourante().createView()); + pn_.add(conteneurSceneView_, BuBorderLayout.CENTER); + conteneurSceneView_.revalidate(); + + pn_.revalidate(); + // -- met a jour les arbres et toolbar --// + projet_.filleLayout_.changeTreeScene(); + projet_.filleLayout_.changeToolbarScene(); + + + } + + + + public void actionPerformed(ActionEvent _e) { + + if(_e.getSource()==this.comboMultiScenes_){ + + //-- recuperation de la scene selectionnee --// + int indiceScene=comboMultiScenes_.getSelectedIndex(); + + //-- on change la scene --// + changeScene(getScene(indiceScene), indiceScene); + } else { + + final String commandeBrute = _e.getActionCommand(); + + if (commandeBrute.equals("AJOUTLAYOUT")) { + + // -- on ajoute une nouvelle scene + addScene(new EbliScene()); + + new BuDialogMessage(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), TrResource + .getS("Layout correctement ajout\xE9.")).activate(); + + } else if (commandeBrute.equals("RETIRELAYOUT")) { + + if (getNbScene() == 1) { + new BuDialogError(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), TrResource + .getS("Vous ne pouvez supprimer l'unique layout du projet.")).activate(); + return; + } + + int indiceScene = comboMultiScenes_.getSelectedIndex(); + + int confirmation = new BuDialogConfirmation( + projet_.impl_.getApp(), + projet_.impl_.getInformationsSoftware(), + TrResource.getS("\xCAtes-vous sur de vouloir retirer \n le layout ") + comboMultiScenes_.getSelectedItem() + " du projet?") + .activate(); + + if (confirmation == 0) { + removeScene(getScene(indiceScene), indiceScene); + } + + } else + + if (commandeBrute.startsWith("LAYOUT")) { + + //-- recuperation de l'indice --// + String number = commandeBrute.substring(commandeBrute.lastIndexOf('T') + 1); + int indiceScene = Integer.parseInt(number); + + // -- on change la scene --// + changeScene(getScene(indiceScene), indiceScene); + } + + } + } + } Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrpostComboMultiScenes.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrpostComboMultiScenes.java 2008-09-03 17:07:03 UTC (rev 3877) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrpostComboMultiScenes.java 2008-09-03 18:39:34 UTC (rev 3878) @@ -1,20 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import javax.swing.DefaultComboBoxModel; - -public class TrpostComboMultiScenes extends DefaultComboBoxModel { - - TrPostLayoutPanelController controller_; - - - public Object getElementAt(int _index) { - return controller_.getScene(_index); - } - - public int getSize() { - - return controller_.getNbScene(); - } - - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-08 18:33:29
|
Revision: 3898 http://fudaa.svn.sourceforge.net/fudaa/?rev=3898&view=rev Author: hadouxad Date: 2008-09-08 18:33:38 +0000 (Mon, 08 Sep 2008) Log Message: ----------- - ajout du menu multi-fenetre: permet d activer la fillelayout en cliquant sur son menuitem correspondant => cas ou l utilisateur ferme sa fenetre sans faire gaffe, il peut maintenant la recuperer - Ajout de l action editeur de texte en utilisant ekitcore - possibiliter de mettre: - des formules mathematiaues - gras, soulign?\195?\169,italique... - espaces, passages de lignes - ALARMA! les aligns internes ne marchent pas - REFACTORISATION: methode getWidget et setWidget dans le ebliNode - Repositionnement des widgets dans la scene: miux cal?\195?\169s , calque et sa legende - Traduction des chaines ebli et tr dans les fichiers correspondants - Gestion du cut/copy/paste: fonctionne nickel: - on peut selectionner plusieurs widgets simultanement - On peut copier/couper depuis une fillelayout vers une autre sans prob et vice-versa - Gestion de la position precedentes pour le cut/copy OK - Gestion des multi fenetre: enregistrement des liste cut/copy dans le trpostprojet - GEstion des undo/redo poru le cut/copy/paste - MULTILAYOUT ONGLET:degage des onglets scenes ainsi que des menus correspondant - MULTI LAYOUT FRAME: lors de la suppression, confirmation puis suppression - confirmation suppression - lors de la fermeture degage la reference de la fille - degage les menus d activation des frames Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChooseAndCreateCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionRemoveSrc.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 Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java 2008-09-08 10:47:27 UTC (rev 3897) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java 2008-09-08 18:33:38 UTC (rev 3898) @@ -31,7 +31,7 @@ public TrPostActionChangeSceneForWidget(EbliScene _scene, TrPostProjet _projet) { super(_scene, EbliResource.EBLI.getString("changer de layout les objets s\xE9lectionn\xE9s"), CtuluResource.CTULU - .getIcon("crystal_deplacer"), "DEPLACER"); + .getIcon("crystal_couper"), "DEPLACER"); projet_=_projet; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChooseAndCreateCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChooseAndCreateCalque.java 2008-09-08 10:47:27 UTC (rev 3897) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChooseAndCreateCalque.java 2008-09-08 18:33:38 UTC (rev 3898) @@ -7,6 +7,7 @@ import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionSimple; import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; +import org.fudaa.fudaa.tr.common.TrResource; import com.memoire.bu.BuDialogChoice; import com.memoire.bu.BuDialogError; @@ -31,7 +32,7 @@ TrPostLayoutPanelController controller_; public TrPostActionChooseAndCreateCalque(TrPostProjet _projet, TrPostLayoutPanelController _controller) { - super(_controller.getSceneCourante(), EbliResource.EBLI.getString("Calque principal"), BuResource.BU + super(_controller.getSceneCourante(), EbliResource.EBLI.getString("ins\xE9rer un calque"), BuResource.BU .getToolIcon("crystal_graphe"), "WIDGETRECALQUE"); @@ -69,7 +70,7 @@ // -- ouverture du chooser --// BuDialogChoice chooser = new BuDialogChoice(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - "Cr\xE9ation d'un calque", "S\xE9lectionnez le jeux de donn\xE9es ", values); + TrResource.getS("Cr\xE9ation d'un calque"), TrResource.getS("S\xE9lectionnez le jeux de donn\xE9es "), values); int response = chooser.activate(); @@ -79,7 +80,8 @@ if (indiceSOURCESelect >= projet_.listeSrc_.size()) { new BuDialogError(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - "La source s\xE9lecionn\xE9e n'existe pas.").activate(); + TrResource + .getS("La source s\xE9lecionn\xE9e n'existe pas")).activate(); return; } @@ -92,13 +94,13 @@ TrPostVisuPanel pnVisu = new TrPostVisuPanel(projet_.getImpl(), projet_, legendeCalque, projet_ .getSource(indiceSOURCESelect)); - EbliNode node = controller_.addCalque("Calque principal", pnVisu.getLocation(), pnVisu + EbliNode node = controller_.addCalque(TrResource.getS("Calque"), pnVisu.getLocation(), pnVisu .getPreferredSize(), pnVisu, legendeCalque); // -- ajout de l INFO de la source utilis\xE9e --// - node.getCreator().getWidget().getController_().setDescription("Source: " + values[indiceSOURCESelect]); + node.getWidget().getController_().setDescription("Source: " + values[indiceSOURCESelect]); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionRemoveSrc.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionRemoveSrc.java 2008-09-08 10:47:27 UTC (rev 3897) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionRemoveSrc.java 2008-09-08 18:33:38 UTC (rev 3898) @@ -6,7 +6,6 @@ import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.fudaa.tr.common.TrLib; -import com.memoire.bu.BuDialogConfirmation; import com.memoire.bu.BuDialogError; import com.memoire.bu.BuDialogMessage; import com.memoire.bu.BuResource; @@ -44,6 +43,7 @@ // -- cas rien de selectionnee --// if (projet_.listeSrc_.size() <= 1) { // FIXME . utilise impl_.error() + // projet_.getImpl().error(_titre, _text) new BuDialogError(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), "Ce fichier ne peut \xEAtre supprim\xE9.\n Il faut garder au moins un fichier de donn\xE9es.").activate(); return; 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-09-08 10:47:27 UTC (rev 3897) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-08 18:33:38 UTC (rev 3898) @@ -4,6 +4,7 @@ import java.awt.Dimension; import java.awt.Point; import java.util.ArrayList; +import java.util.HashSet; import java.util.Iterator; import java.util.Set; @@ -11,12 +12,12 @@ import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JMenu; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.event.InternalFrameAdapter; +import javax.swing.event.InternalFrameEvent; import org.fudaa.ctulu.CtuluCommandManager; -import org.fudaa.ctulu.CtuluExportDataInterface; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ctulu.CtuluUndoRedoInterface; import org.fudaa.ctulu.gui.CtuluFilleWithComponent; @@ -27,6 +28,8 @@ import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidgetController; +import org.fudaa.ebli.visuallibrary.actions.CommandUndoRedoCut; +import org.fudaa.ebli.visuallibrary.actions.CommandUndoRedoPaste; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionConfigure; import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; @@ -40,6 +43,7 @@ import org.netbeans.api.visual.model.ObjectState; import com.memoire.bu.BuCutCopyPasteInterface; +import com.memoire.bu.BuDialogConfirmation; import com.memoire.bu.BuInternalFrame; import com.memoire.bu.BuMenu; import com.memoire.bu.BuMenuBar; @@ -128,6 +132,29 @@ panelSouthSuiviSouris_ = new JLabel(); this.add(panelSouthSuiviSouris_, BorderLayout.SOUTH); + + + + + this.addInternalFrameListener(new InternalFrameAdapter() { + + + public void internalFrameClosing(InternalFrameEvent _e) { + // -- confirmation de la suppression de l internalframe --// + + BuDialogConfirmation chooser = new BuDialogConfirmation(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), + TrResource.getS("Etes vous sur de vouloir supprimer le layout? ")); + + int response = chooser.activate(); + + if (response == 0) { + projet_.listeFillesLayout.remove(projet_.getSelectedFilleLayout()); + + + } + } + + }); } /** @@ -279,23 +306,23 @@ } } - // liste des noeuds copies - Set<EbliNode> nodesCopyied = null; - // liste des noeuuds coupes - Set<EbliNode> nodesCutted = null; + public void copy() { - JOptionPane.showMessageDialog(null, "copy()"); + // JOptionPane.showMessageDialog(null, "copy()"); // on copie la widget selectionnee // ie on fait une duplication partielle // on ajoute pas tout de suite le noeud dans la scene // --recuperation des noeuds a copier --// - nodesCopyied = (Set<EbliNode>) getScene().getSelectedObjects(); + projet_.nodesCopyied = new HashSet<EbliNode>(); + + for (Iterator<EbliNode> it = ((Set<EbliNode>) getScene().getSelectedObjects()).iterator(); it.hasNext();) + projet_.nodesCopyied.add(it.next()); // -- reinit de la commande cut si on voulait faire un ctrl+x - nodesCutted = null; + projet_.nodesCutted = null; } @Override @@ -306,23 +333,35 @@ } public void cut() { - JOptionPane.showMessageDialog(null, "cut()"); + // JOptionPane.showMessageDialog(null, "cut()"); // --recuperation des noeuds a copier --// - nodesCutted = (Set<EbliNode>) getScene().getSelectedObjects(); + projet_.nodesCutted = new HashSet<EbliNode>(); - // enlever les nodes de la scene - for (Iterator<EbliNode> it = nodesCutted.iterator(); it.hasNext();) { + for (Iterator<EbliNode> it = ((Set<EbliNode>) getScene().getSelectedObjects()).iterator(); it.hasNext();) { EbliNode node = it.next(); + projet_.nodesCutted.add(node); + + + + } + // -- suppression des nodes depuis cetet kliste pour eviter les concourant + // -//exception + for (Iterator<EbliNode> it = projet_.nodesCutted.iterator(); it.hasNext();) { + EbliNode node = it.next(); + // enlever les nodes de la scene // le node existe toujours apres l'avoir enleve getScene().removeNode(node); - } + // reinit de la liste des noeuds a copier au cas ou on change d avis - nodesCopyied = null; + projet_.nodesCopyied = null; + // --creation de la commande undo/redo --// + getScene().getCmdMng().addCmd(new CommandUndoRedoCut(projet_.nodesCutted)); + } public void duplicate() { @@ -331,30 +370,60 @@ public void paste() { - // TODO a ameliorer : TENIR COMPTE DE LA POSITION DE LA SOURIS + // Point locationSouris = this.getMousePosition(); + + // JOptionPane.showMessageDialog(null, "paste(): nb elements " + + // nodesCopyied.size()); - JOptionPane.showMessageDialog(null, "paste()"); - // --recuperation des noeuds copies --// - if (nodesCopyied != null) { + if (projet_.nodesCopyied != null) { - for (Iterator<EbliNode> it = nodesCopyied.iterator(); it.hasNext();) { + for (Iterator<EbliNode> it = projet_.nodesCopyied.iterator(); it.hasNext();) { EbliNode node = it.next(); // --duplication du node --// - node.duplicate(null); + EbliNode nouveauNode = node.duplicate(null); + + getScene().addNode(nouveauNode); + // -- duplication des map de property graphique de la widget --// + node.getWidget().setPropGraphique(node.getWidget().duplicateGraphicalProperties()); + // -- duplication de la taille --// + node.getWidget().setPreferredBounds(node.getWidget().getPreferredBounds()); + Point newLocation = nouveauNode.getWidget().getPreferredLocation(); + newLocation.x += 30; + newLocation.y += 30; + + nouveauNode.getWidget().setPreferredLocation(newLocation); + + + } - // reinititalisation de la liste - nodesCopyied = null; + + // --creation de la commande undo/redo --// + getScene().getCmdMng().addCmd(new CommandUndoRedoPaste(projet_.nodesCopyied)); - } else if (nodesCutted != null) { + // reinitialisation de la liste + projet_.nodesCopyied = null; - for (Iterator<EbliNode> it = nodesCutted.iterator(); it.hasNext();) { + + getScene().refresh(); + + } else if (projet_.nodesCutted != null) { + + for (Iterator<EbliNode> it = projet_.nodesCutted.iterator(); it.hasNext();) { EbliNode node = it.next(); // --ajout du node --// + getScene().addNode(node); } + // --creation de la commande undo/redo --// + getScene().getCmdMng().addCmd(new CommandUndoRedoPaste(projet_.nodesCutted)); + + // reinit de la liste - nodesCutted = null; + projet_.nodesCutted = null; + + getScene().refresh(); + } } @@ -525,7 +594,7 @@ toolBarModifiable_ = _controller.getToolbarComponent(); menuModifiable_ = _controller.getMenubarComponent(); - ajoutMenusLayoutTabbed(menuModifiable_); + // ajoutMenusLayoutTabbed(menuModifiable_); // mise a jour des params // toolBarModifiable_.revalidate(); @@ -576,7 +645,7 @@ menuModifiable_.add(menu); // mise a jour des params - ajoutMenusLayoutTabbed(menuModifiable_); + // ajoutMenusLayoutTabbed(menuModifiable_); this.setToolBar(toolBarModifiable_); this.setJMenuBar(menuModifiable_); @@ -627,7 +696,9 @@ // -- creation du menu principal des scenes a cote de post --// // ajout a cote de menu post - menubar.add(menuLayoutManager_, menubar.getComponentCount()); + menubar.add(menuLayoutManager_, menubar.getComponentCount()); } + + } 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-09-08 10:47:27 UTC (rev 3897) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-09-08 18:33:38 UTC (rev 3898) @@ -45,6 +45,7 @@ import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRetaillageHorizontal; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRetaillageVertical; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionSimple; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActiontextEditor; import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerCalque; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorLegende; @@ -297,7 +298,10 @@ ((EbliWidgetControllerCalque) creator.getWidgetCalque().getController_()).setLegendeWidget_(_legende); // -- creation de la legende par default --// - creator.getWidgetCalque().nodeLegende = _legende.createLegende(); + Point positionLegende = new Point(); + positionLegende.x = nodeCalque.getWidget().getLocation().x + preferedDimension.width + 20; + positionLegende.y = nodeCalque.getWidget().getPreferredLocation().y; + creator.getWidgetCalque().nodeLegende = _legende.createLegende(positionLegende); return nodeCalque; @@ -426,6 +430,10 @@ addRectangleTexte(); } }); + // widget texte + // TODO a revoir + _l.add(new EbliWidgetActiontextEditor(getSceneCourante())); + // -- palette fleche --// _l.add(new EbliActionSimple(EbliResource.EBLI.getString("Fleche"), EbliResource.EBLI.getToolIcon("crystal_bu_link"), "WIDGETFLECHE") { @@ -462,9 +470,7 @@ // widget image _l.add(new EbliWidgetActionImageChooser(getSceneCourante())); - // widget texte - //TODO a revoir -// _l.add(new EbliWidgetActiontextEditor(getScene())); + } @@ -528,11 +534,11 @@ init.add(new EbliWidgetActionAlign.Top(getSceneCourante())); init.add(new EbliWidgetActionAlign.Bottom(getSceneCourante())); init.add(null); - init.add(null); + init.add(new EbliWidgetActionForeGround(getSceneCourante())); init.add(new EbliWidgetActionBackGround(getSceneCourante())); init.add(null); - init.add(null); + // -- actions de retaillage min et max --// // init.add(new EbliWidgetActionRetaillageHorizontal(getScene(), // EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MIN)); @@ -541,25 +547,25 @@ init.add(new EbliWidgetActionRetaillageVertical(getSceneCourante(), EbliWidgetActionRetaillageVertical.RETAIILLAGE_MAX)); init.add(null); - init.add(null); + // -- blocage des widgets --// init.add(new EbliWidgetActionBloqueOuDebloqueWidget.Bloque(getSceneCourante())); init.add(new EbliWidgetActionBloqueOuDebloqueWidget.DeBloque(getSceneCourante())); init.add(null); - init.add(null); + // -- action de duplication --// // init.add(new EbliWidgetActionDuplicate(getSceneCourante())); init.add(new TrPostActionDuplicate(getSceneCourante(), projet_)); init.add(new TrPostActionChangeSceneForWidget(getSceneCourante(), projet_)); init.add(null); - init.add(null); + // -- Action sur le format --// init.add(new EbliWidgetActionColorForeground(getSceneCourante())); init.add(new EbliWidgetActionColorBackground(getSceneCourante())); // -- action de configuration des composants graphiques--// init.add(new EbliWidgetActionConfigure(getSceneCourante())); init.add(null); - init.add(null); + @@ -576,7 +582,7 @@ init.add(new TrPostActionAddPointFromWidgetCalque.Temporel(getSceneCourante(), projet_.impl_)); init.add(new TrPostActionAddPointFromWidgetCalque.Spatial(getSceneCourante(), projet_.impl_)); init.add(null); - init.add(null); + actions_ = Collections.unmodifiableList(init); @@ -606,9 +612,11 @@ conteneur_ = new JPanel(new BorderLayout()); - conteneur_.add(pn_, BorderLayout.CENTER); - // conteneur_.add(buildToolBar(), BorderLayout.NORTH); + // -- decomenter cela pour reprendre le systeme d onglet --// + // conteneur_.add(pn_, BorderLayout.CENTER); + conteneur_.add(conteneurSceneView_, BorderLayout.CENTER); + } return conteneur_; @@ -687,7 +695,7 @@ int confirmation = new BuDialogConfirmation( projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - TrResource.getS("\xCAtes-vous sur de vouloir retirer \n le layout ") + indiceScene + " du projet?") + TrResource.getS("\xCAtes-vous sur de vouloir retirer le layout ") + indiceScene + " du projet?") .activate(); if (confirmation == 0) { @@ -711,10 +719,11 @@ public void stateChanged(ChangeEvent _e) { - if (pn_.getTabCount() == 1) - return; - int index = pn_.getSelectedIndex(); - changeScene(getScene(index), index); + // -- a decommenter si l on veut gerer par des onglets + /* + * if (pn_.getTabCount() == 1) return; int index = pn_.getSelectedIndex(); + * changeScene(getScene(index), index); + */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-13 20:38:31
|
Revision: 3921 http://fudaa.svn.sourceforge.net/fudaa/?rev=3921&view=rev Author: hadouxad Date: 2008-09-13 20:38:41 +0000 (Sat, 13 Sep 2008) Log Message: ----------- COrrection bugs - action configurer: delegue toujours a son widgetBordure. - cas special legende: Copier/couper: lors de la copie/couper de legende, n enregistre rien pour eviter le plantage. Correction bug wizard courbes temporelles - l'action ajouter en cliquant sur la ligene de la cellule vide - action supprimer: qui supprime les points saisis - action modifs: en double cliquant sur les cellules (cf setValueAt) - s'il n'y a pas de graphe dispo, l'option cr?\195?\169e un nouveau graphe doit etre coch?\195?\169e et disable ( l'utilisateur n'a pas le choix...) - Bug bizarre lors de la saisie de certains points pour les courbes temporelles... FONCTION AJOUT COURBE SOURCE OK!! - Fonction clic droit sur courbe du graphe FONCTIONNE! - methode TrPostCourbeTreeModel.duplicateWithChooseSrc() - Il fallait initialiser le tableau des y en recuperant la taille du y de son duplicata - utilsier la methode update - GESTION DE TOUS LEs CAS (tentative) - creation courbe REELLE sur nouveau src depuis courbe REELLE ancien source - creation courbe INTERPOLEE sur nouveau src depuis courbe REELLE ancien source - creation courbe REELLE sur nouveau src depuis courbe INTERPOLEE ancien source - creation courbe INTERPOLEE sur nouveau src depuis courbe INTERPOLEE ancien source Modified Paths: -------------- 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/TrPostWizardCourbeTemporelle.java 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 2008-09-13 20:37:51 UTC (rev 3920) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-09-13 20:38:41 UTC (rev 3921) @@ -26,15 +26,19 @@ import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; +import org.fudaa.ctulu.gis.GISPrecision; import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.TrPostCourbeModel.Node; +import com.memoire.bu.BuDialogChoice; import com.memoire.bu.BuLib; import com.memoire.fu.FuComparator; import com.memoire.fu.FuEmptyArrays; @@ -70,6 +74,8 @@ Set varSupported_; + TrPostProjet projet_; + public Set getVarSupported() { return varSupported_; } @@ -95,7 +101,7 @@ * ] * _timeIdx */, - final H2dVariableType[] _vars) { + final H2dVariableType[] _vars, TrPostProjet _projet) { src_ = _src; varGroup_ = new HashMap(); // tidx_ = _timeIdx; @@ -105,6 +111,7 @@ varSupported_ = new HashSet(Arrays.asList(_vars)); impl_ = _impl; isAllTimeStep_ = true;// tidx_.length == _src.getNbTimeStep(); + projet_ = _projet; } public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src,/* @@ -115,15 +122,15 @@ * _timeIdx * , */ - final int[] _objIdx, final H2dVariableType[] _vars) { - this(_impl, _src/* , _timeIdx */, _vars); + final int[] _objIdx, final H2dVariableType[] _vars, TrPostProjet _projet) { + this(_impl, _src/* , _timeIdx */, _vars, _projet); objIdx_ = _objIdx; Arrays.sort(objIdx_); } public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src, final int[] _timeIdx, - final TrPostInterpolatePoint _interpol, final H2dVariableType[] _vars) { - this(_impl, _src/* , _timeIdx */, _vars); + final TrPostInterpolatePoint _interpol, final H2dVariableType[] _vars, TrPostProjet _projet) { + this(_impl, _src/* , _timeIdx */, _vars, _projet); intepolPt_.add(_interpol); } @@ -692,7 +699,147 @@ return isAllTimeStep_; } - // public void updateTimeStep(int[] _idx, ProgressionInterface _prog) { - // } + protected EGCourbeChild duplicateCourbe(final EGCourbeChild _c) { + return null; + } + + String[] formattageDonnees() { + String[] listeSimul = new String[projet_.listeSrc_.size()]; + int cpt = 0; + for (Iterator<TrPostSource> it = projet_.listeSrc_.iterator(); it.hasNext();) { + + TrPostSource src = it.next(); + + // --ajout dans la liste des titres --// + listeSimul[cpt++] = projet_.formatInfoSource(src); + } + + return listeSimul; + } + + /** + * OVERIDE. methode qui demande a l user de choisir sa courbe puis genere une + * copie avec la source en cours. + * + * @param _child + * @return + */ + protected EGCourbeChild duplicateWithChooseSrc(EGCourbeChild _child) { + + + // -- mise en place du chooser des projets sources disponibles --// + + // -- recuperation du source voulu --// + // -- recuperation de la liste des src sous forme de liste --// + String[] values = formattageDonnees(); + + // -- ouverture du chooser --// + BuDialogChoice chooser = new BuDialogChoice(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), + TrResource.getS("Cr\xE9ation d'un calque"), TrResource.getS("S\xE9lectionnez le jeux de donn\xE9es "), values); + + int response = chooser.activate(); + + if (response == 0) { + + int indiceSOURCESelect = chooser.getSelectedIndex(); + + TrPostSource srcChoisie=projet_.getSource(indiceSOURCESelect); + + + EGCourbeChild newCurve=null; + + //-- recuperation du point interpol\xE9 ou non selon le cas --// + if(_child.getModel() instanceof TrPostCourbeModel.Node){ + + // -- CAS COURBE REELLE --// + TrPostCourbeModel.Node modelBase=(Node) _child.getModel(); + H2dVariableType var = modelBase.getVar(); + + // -- verification si le point du model choisi est reel ou interpol\xE9 + // dans la nouvelle source --// + if (srcChoisie.getGrid().contientPoint(src_.getGrid().getPtX(modelBase.ptIdx_), + src_.getGrid().getPtY(modelBase.ptIdx_))) { + + // -- CREATION DE LA COURBE REELE DEPUIS COURBE REELLE --// + newCurve = TrPostCourbeModel.Node.buildCourbeModel(var, modelBase.ptIdx_, modelBase.getTime(), + _child.getParentGroup(), srcChoisie); + } else { + // -- on recupere le point le plus proche pour interpoler --// + GrPoint pointAInterpole=new GrPoint(src_.getGrid().getPtX(modelBase.ptIdx_),src_.getGrid().getPtY(modelBase.ptIdx_),0); + int newPtIdx = TrIsoLayerDefault.sondeSelection(pointAInterpole, srcChoisie.getGrid()); + + if (newPtIdx != -1) { + + TrPostInterpolatePoint interpolatePoint = new TrPostInterpolatePoint(newPtIdx, pointAInterpole.x_, + pointAInterpole.y_, new GISPrecision()); + + // -- CREATION DE LA COURBE INTERPOLEE DEPUIS COURBE REELLE --// + newCurve = TrPostCourbeModel.Interpolated.buildCourbeModel(modelBase.getVar(), interpolatePoint, modelBase + .getTime(), _child.getParentGroup(), srcChoisie); + } + } + + // -- recuperation des y de son duplicata --// + ((TrPostCourbeModel) newCurve.getModel()).setY(new double[modelBase.getY().length]); + + double[] ds = modelBase.getTime(); + for (int i = 0; i < ds.length; i++) { + ((TrPostCourbeModel) newCurve.getModel()).updateY(i, var); + } + + } + else{ + + // -- CAS COURBE INTERPOLEE --// + TrPostCourbeModel.Interpolated modelBase=(TrPostCourbeModel.Interpolated) _child.getModel(); + H2dVariableType var = modelBase.getVar(); + + // -- verification si le point du model choisi est reel ou interpol\xE9 + // dans la nouvelle source --// + if (srcChoisie.getGrid().contientPoint(modelBase.ptIdx_.x_, modelBase.ptIdx_.y_)) { + + // -- recuperation du point interpol\xE9 pour la nouvelle source --// + GrPoint pointInterpol = new GrPoint(modelBase.ptIdx_.x_, modelBase.ptIdx_.y_, 0); + int newPtIdx = TrIsoLayerDefault.sondeSelection(pointInterpol, srcChoisie.getGrid()); + if (newPtIdx != -1) { + // -- CREATION DE LA COURBE REELE DEPUIS COURBE INTERPOLEE --// + newCurve = TrPostCourbeModel.Node.buildCourbeModel(var, newPtIdx, modelBase.getTime(), _child + .getParentGroup(), srcChoisie); + } + } else { + // -- on recupere le point le plus proche pour interpoler --// + GrPoint pointInterpol = new GrPoint(modelBase.ptIdx_.x_, modelBase.ptIdx_.y_, 0); + int newPtIdx = TrIsoLayerDefault.sondeSelection(pointInterpol, srcChoisie.getGrid()); + + if (newPtIdx != -1) { + + TrPostInterpolatePoint interpolatePoint = new TrPostInterpolatePoint(newPtIdx, modelBase.ptIdx_.x_, + modelBase.ptIdx_.y_, new GISPrecision()); + + // -- CREATION DE LA COURBE INTERPOLEE DEPUIS COURBE INTERPOLEE --// + newCurve = TrPostCourbeModel.Interpolated.buildCourbeModel(modelBase.getVar(), interpolatePoint, modelBase + .getTime(), _child.getParentGroup(), srcChoisie); + } + } + + + // -- recuperation des y de son duplicata --// + ((TrPostCourbeModel) newCurve.getModel()).setY(new double[modelBase.getY().length]); + double[] ds = modelBase.getTime(); + for (int i = 0; i < ds.length; i++) { + ((TrPostCourbeModel) newCurve.getModel()).updateY(i, var); + } + + } + newCurve.setTitle(newCurve.getTitle() + " " + + projet_.formatName(projet_.getSource(indiceSOURCESelect).getTitle())); + + + return newCurve; + } + return null; + } + + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java 2008-09-13 20:37:51 UTC (rev 3920) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java 2008-09-13 20:38:41 UTC (rev 3921) @@ -31,7 +31,6 @@ import com.memoire.bu.BuCheckBox; import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuTextField; -import com.memoire.bu.BuValueValidator; import com.memoire.bu.BuWizardTask; import com.memoire.fu.FuLog; @@ -88,8 +87,79 @@ public class ModelListePoints extends AbstractTableModel { - String[] titre_; + // -- variables utilisees pour stocker la saisie de l utilisateur + String xTempCreate = null; + String yTempCreate = null; + public void setValueAt(Object _value, int _rowIndex, int _columnIndex) { + + if (_columnIndex == 0) + return; + + // -- cas edition interne de nouveau point --// + if (ptIdx_ != null && _rowIndex == ptIdx_.length) { + if (_columnIndex == 1) { + xTempCreate = (String) _value; + + } else if (_columnIndex == 2) { + + yTempCreate = (String) _value; + } + + // -- verification si les 2 params sont saisis, on ajoute le point au + // tableau + if (xTempCreate != null && yTempCreate != null) { + + if (!checkAndReplaceSonde(xTempCreate, yTempCreate, this, ptIdx_.length)) { + + projet_.impl_.error("Le point rentr\xE9 n'est pas dans le maillage."); + //-- on reintialise les donnees --// + if (_columnIndex == 1) { + xTempCreate = null; + + } else if (_columnIndex == 2) { + yTempCreate = null; + } + + } else { + + // -- le point est ajout\xE9 auto dans la methode check, on + // repositionne anull les temp --// + xTempCreate = null; + yTempCreate = null; + } + } + + } else { + // cas normal de modif de val --// + if (_columnIndex == 1) { + String val = (String) _value; + // -- on recupere le y et on v\xE9rifie que le point est toujours bon + // --// + String y = (String) getValueAt(_rowIndex, 2); + + if (!checkAndReplaceSonde(xTempCreate, yTempCreate, this, _rowIndex)) { + projet_.impl_.error("Le point rentr\xE9 n'est pas dans le maillage."); + } + + + } else if (_columnIndex == 2) { + + String val = (String) _value; + // -- on recupere le x et on v\xE9rifie que le point est toujours bon + // --// + String x = (String) getValueAt(_rowIndex, 1); + + + + } + + } + + } + + String[] titre_; + public ModelListePoints() { String[] val = { "Point", "X", "Y" }; titre_ = val; @@ -111,12 +181,24 @@ public int getRowCount() { if (ptIdx_ != null) - return ptIdx_.length; + return ptIdx_.length + 1; else return 1; } public Object getValueAt(int _rowIndex, int _columnIndex) { + + // -- cas edition interne de nouveau point --// + if (ptIdx_ != null && _rowIndex == ptIdx_.length) + if (_columnIndex == 1 && xTempCreate != null) + return xTempCreate; + else if (_columnIndex == 2 && yTempCreate != null) + return yTempCreate; + else + return ""; + + + if(_columnIndex==0){ if(ptIdx_!=null) return ptIdx_[_rowIndex]; @@ -150,7 +232,10 @@ } public boolean isCellEditable(int _rowIndex, int _columnIndex) { + if (_columnIndex == 0) return false; + else + return true; } @@ -172,6 +257,11 @@ pt_ = _pt; ptIdx_ = _ptIdx; + // -- si les 2 sont nuls, on initialise la liste des points modifiable --// + if (pt_ == null && ptIdx_ == null) + ptIdx_ = new int[0]; + + // creationNewGraphe_.addActionListener(new ActionListener() { // // public void actionPerformed(ActionEvent _e) { @@ -269,7 +359,8 @@ final JXTable tableau = new JXTable(model); content.add(new BuScrollPane(tableau), BorderLayout.CENTER); if (pt_ == null) { - content.add(new JLabel(TrResource.getS("Choisir parmi les points selectionn\xE9s.")), BorderLayout.NORTH); + content.add(new JLabel(TrResource.getS("Saisir ou modifier des points en cliquant dans le tableau.")), + BorderLayout.NORTH); } else @@ -277,47 +368,58 @@ // -- ajout du jtext pour ajout uniquement d'un point interpol\xE9 --// - if (ptIdx_ == null) { + if (ptIdx_ != null) { JPanel control = new JPanel(new FlowLayout(FlowLayout.CENTER)); - control.add(new JLabel(TrResource.getS("Cr\xE9ez votre point interpol\xE9. x:"))); - tf1_1 = new BuTextField(10); - tf1_1.setValueValidator(BuValueValidator.DOUBLE); - tf1_2 = new BuTextField(10); - tf1_2.setValueValidator(BuValueValidator.DOUBLE); - control.add(tf1_1); - control.add(new JLabel("y:")); - control.add(tf1_2); - JButton valide = new JButton(EbliResource.EBLI.getIcon("crystal_valider")); - valide.addActionListener(new ActionListener() { + control.add(new JLabel(TrResource.getS("Supprimer les points s\xE9lectionn\xE9s:"))); + + JButton supprimer = new JButton("Supprimer", EbliResource.EBLI.getIcon("crystal_supprimer")); + supprimer.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent _e) { - if (!checkAndReplaceSonde(tf1_1.getText(), tf1_2.getText(), model)) { - projet_.getImpl().error(TrResource.getS("Le point rentr\xE9 n'est pas correct")); - } + + int[] listePointToDelete = tableau.getSelectedRows(); + + if (listePointToDelete != null) { + + + boolean selectEmptyRow = false; + for (int i = 0; !selectEmptyRow && i < listePointToDelete.length; i++) + if (listePointToDelete[i] == ptIdx_.length) + selectEmptyRow = true; + + int[] newTab = null; + if (selectEmptyRow) + newTab = new int[ptIdx_.length - listePointToDelete.length + 1]; + else + newTab = new int[ptIdx_.length - listePointToDelete.length]; + + int cpt = 0; + for (int i = 0; i < ptIdx_.length; i++) { + + boolean mustDelete = false; + + for (int k = 0; !mustDelete && k < listePointToDelete.length; k++) + if (listePointToDelete[k] ==i) + mustDelete = true; + + if(!mustDelete) + newTab[cpt++] = ptIdx_[i]; + + + } + + ptIdx_ = newTab; + + model.fireTableDataChanged(); + } + } }); - control.add(valide); + control.add(supprimer); content.add(control, BorderLayout.SOUTH); - } else { - // -- fonction specifique a la liste de points reels: possibilit\xE9de - // degager els points snon selectionner --// - JPanel control = new JPanel(new FlowLayout(FlowLayout.CENTER)); - control.add(new JLabel(TrResource - .getS("Garder uniquement les points choisis (ctrl+ clic pour en choisir plusieurs)"))); - JButton valide = new JButton(EbliResource.EBLI.getIcon("crystal_valider")); - valide.addActionListener(new ActionListener() { + } - public void actionPerformed(ActionEvent _e) { - checkAndReplacePoints(model, tableau.getSelectedRows()); - - } - - }); - control.add(valide); - content.add(control, BorderLayout.SOUTH); - } - return content; } @@ -333,6 +435,11 @@ JPanel bouttonCenter = new JPanel(new FlowLayout(FlowLayout.CENTER)); bouttonCenter.add(creationNewGraphe_); content.add(bouttonCenter, BorderLayout.SOUTH); + if (actionChoixGraphes_.listeGraphesPossibles.size() == 0 && actionChoixGraphes_.listeGraphesChoisis.size() == 0) { + creationNewGraphe_.setSelected(true); + creationNewGraphe_.setEnabled(false); + actionChoixGraphes_.setEnabled(false); + } return content; } } @@ -342,22 +449,38 @@ /** * Methode qui verifie que le nouveau point peut etre une sonde et le remplace - * par l actuelle. + * par l actuel ou alors l ajoute dans le tableau selon l indice. */ - public boolean checkAndReplaceSonde(String xs, String ys, ModelListePoints model) { + public boolean checkAndReplaceSonde(String xs, String ys, ModelListePoints model, int _indiceTableauAmodif) { double x = Double.parseDouble(xs); double y = Double.parseDouble(ys); GrPoint point=new GrPoint( x,y,0); + + + // -- verification que le point peut etre une sonde --// int idxElt = TrIsoLayerDefault.sondeSelection(point, (TrPostModelInterface) calque_.getIsoLayer().getIsoModel()); if (idxElt > -1){ //--on remoplace la sonde actuelle --// pt_ = new TrPostInterpolatePoint(idxElt, x, y, new GISPrecision()); - // -- mise a jour des donnees sur le calque --// - int[] newVal = new int[1]; - newVal[0] = pt_.idxElt_; + + + + if (_indiceTableauAmodif < ptIdx_.length) + this.ptIdx_[_indiceTableauAmodif] = pt_.idxElt_; + else { + // -- il faut reconstruire le tableau avec size +1 en ajoutant le point + int[] newVal = new int[ptIdx_.length + 1]; + for (int i = 0; i < ptIdx_.length; i++) { + newVal[i] = ptIdx_[i]; + FuLog.warning("ptIdx_[" + i + "]=" + newVal[i]); + } + newVal[ptIdx_.length] = pt_.idxElt_; + ptIdx_ = newVal; + + } model.fireTableDataChanged(); return true; } @@ -365,21 +488,8 @@ } - public void checkAndReplacePoints(ModelListePoints model, int[] pointsChoisis) { - - int[] newPtIdx=new int[pointsChoisis.length]; - for (int i = 0; i < pointsChoisis.length; i++) { - newPtIdx[i] = ptIdx_[pointsChoisis[i]]; - } - ptIdx_ = newPtIdx; - // -- mise a jour des donnees sur le calque --// - // ((ZCalqueAffichageDonnees) - // calque_.getCalqueActif()).setSelection(ptIdx_); - // -- mise a joru des donnees sur le model --// - model.fireTableDataChanged(); - - } + private static int cptGraphe = 1; /** * Action de creation d un nouveau widget graphe en live @@ -399,13 +509,13 @@ FuLog.warning("Sonde: " + pt_ + "\n liste points. " + ptIdx_); // -- cas listes de noeuds if (pt_ == null) - model = TrPostCourbeBuilder.build(projet_.getImpl(), calque_.getSourceCalque(), chooserVarTime_ + model = TrPostCourbeBuilder.build(projet_, calque_.getSourceCalque(), chooserVarTime_ .getSelectedTimeStepIdx(), var, ptIdx_, prog); else // -- cas sonde --// if (ptIdx_ == null || ptIdx_.length == 0) model = TrPostCourbeBuilder.build( - projet_.getImpl(), calque_.getSourceCalque(), + projet_, calque_.getSourceCalque(), chooserVarTime_ .getSelectedTimeStepIdx(), var, pt_, prog); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-28 21:25:30
|
Revision: 4000 http://fudaa.svn.sourceforge.net/fudaa/?rev=4000&view=rev Author: deniger Date: 2008-09-28 21:25:27 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java 2008-09-28 21:25:07 UTC (rev 3999) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java 2008-09-28 21:25:27 UTC (rev 4000) @@ -101,29 +101,6 @@ fenetre = ls.get(indiceFilleelect); } return fenetre.controller_.getSceneCourante(); - // EbliScene dest = null; - // // -- on recherche si dans la fille selectionne il existe plusieurs sous - // // layout --// - // if (fenetre.controller_.listeScenes_.size() <= 1) { - // dest = fenetre.controller_.getSceneCourante(); - // } else { - // - // // recuperation de toutes les noms des frames post du projet --// - // String[] listeLayout = formatteLayout(fenetre.controller_); - // - // BuDialogChoice chooser = new BuDialogChoice(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - // TrResource.TR.getS("S\xE9lectionnez"), TrResource.TR.getS("S\xE9lectionnez le layout de la fen\xEAtre") - // + fenetre.getTitle() + TrResource.TR.getS(" dans laquelle dupliquer l'objet "), listeLayout); - // - // int response = chooser.activate(); - // - // if (response == 0) { - // int indiceLayoutelect = chooser.getSelectedIndex(); - // dest = fenetre.controller_.getScene(indiceLayoutelect); - // } - // - // } - } // public String[] formatteLayout(TrPostLayoutPanelController _controller) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java 2008-09-28 21:25:07 UTC (rev 3999) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java 2008-09-28 21:25:27 UTC (rev 4000) @@ -48,8 +48,8 @@ vx = x_.getValue(_idxElt); vy = y_.getValue(_idxElt); } else { - vx = EfInterpolator.interpolate(_idxElt, _x, _y, x_, y_, true, _grid); - vy = EfInterpolator.interpolate(_idxElt, _x, _y, x_, y_, false, _grid); + vx = EfInterpolator.interpolateDangerous(_idxElt, _x, _y, x_, _grid); + vy = EfInterpolator.interpolateDangerous(_idxElt, _x, _y, y_, _grid); } _target.e_.x_ = _x + vx; _target.e_.y_ = _y + vy; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2008-09-28 21:25:07 UTC (rev 3999) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2008-09-28 21:25:27 UTC (rev 4000) @@ -527,11 +527,11 @@ protected InterpolationVectorContainer createVectorInterpolation() { if (vectors_ == null) { vectors_ = new InterpolationVectorContainer(); - if (fleches_ != null) { - for (int i = 0; i < fleches_.length; i++) { - vectors_.addVxVy(fleches_[i].getVx(), fleches_[i].getVy()); - } - } + // if (fleches_ != null) { + // for (int i = 0; i < fleches_.length; i++) { + // vectors_.addVxVy(fleches_[i].getVx(), fleches_[i].getVy()); + // } + // } } return vectors_; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-10-30 17:10:32
|
Revision: 4122 http://fudaa.svn.sourceforge.net/fudaa/?rev=4122&view=rev Author: deniger Date: 2008-10-30 17:10:26 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.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/TrPostDataCreatedNorm.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator.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/TrPostRubarLimniMng.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/TrPostSourceAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTimeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -1,34 +1,15 @@ package org.fudaa.fudaa.tr.post; -import gnu.trove.TIntHashSet; -import gnu.trove.TIntIterator; - -import java.io.IOException; import java.util.ArrayList; -import java.util.List; -import org.fudaa.ctulu.CtuluActivity; -import org.fudaa.ctulu.CtuluVariable; +import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.ctulu.gis.GISGeometryFactory; -import org.fudaa.dodico.ef.EfData; -import org.fudaa.dodico.ef.EfElement; -import org.fudaa.dodico.ef.EfGridInterface; -import org.fudaa.dodico.ef.EfNeighborMesh; -import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; -import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolatorDefault; -import org.fudaa.dodico.ef.interpolation.EfInterpolator; -import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestElt; -import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestNode; -import org.fudaa.dodico.ef.operation.EfLineIntersection; -import org.fudaa.dodico.ef.operation.EfLineIntersectionParent; -import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsMng; -import org.fudaa.dodico.ef.operation.EfLineIntersectorActivity; +import org.fudaa.dodico.ef.operation.EfTrajectoireActivity; +import org.fudaa.dodico.ef.operation.EfTrajectoireParameters; import org.fudaa.ebli.geometrie.GrPoint; -import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.meshviewer.profile.MvProfileCoteTester; import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.LineString; /** * Algorithme de Calcul les lignes de courants TODO mettre la classe dans EF il y a la classe qui est charge de faire le @@ -36,36 +17,14 @@ * * @author Adrien Hadoux */ -public class TrComputeLigneCourantTrajectoire implements EfLineIntersectionParent, CtuluActivity { +public class TrComputeLigneCourantTrajectoire { - /** - * data - */ - TrPostVisuPanel calque_; - final TrPostSource data_; + final TrPostVisuPanel calque_; - /** - * pour interpoler les valeur - */ - final EfInterpolator interpolator_; + boolean stop_; - final EfLineIntersectorActivity lineIntersect_; - ProgressionInterface prog_; - - List<Coordinate> listePointsARepartir_ = new ArrayList<Coordinate>(); // les GrPoint ne sont utilisee que pour - // l'affichage - - /** - * Liste des intersections r\xE9sultats - */ - ArrayList<EfLineIntersection> listeIntersection_ = null; - public TrComputeLigneCourantTrajectoire(final TrPostVisuPanel calque) { - super(); - calque_ = calque; - this.data_ = calque.getSource(); - this.interpolator_ = data_.getInterpolator(); - this.lineIntersect_ = new EfLineIntersectorActivity(data_); + this.calque_ = calque; } /** @@ -128,15 +87,8 @@ return listePointsARepartir; } - public void progression(final String desc, final int completionRate) { - if (prog_ == null) return; - prog_.setDesc(TrResource.getS(desc)); - prog_.setProgression(5); + EfTrajectoireActivity activity_; - } - - EfNeighborMesh voisinage_; - /** * Methode appel\xE9e par l'interface de calcul des lignes de courant. * @@ -145,286 +97,23 @@ * @param indicePdt indice du pas de temps * @param finesse coefficient de finesse double * @param vx la variable a utiliser - * @param prog l'interface de progression, peut etre null + * @param _prog l'interface de progression, peut etre null * @return */ - public ArrayList<EfLineIntersection> computeLigneCourant(final GrPoint extrem1segment, final GrPoint extrem2segment, - final int nbPointsARepartirUniformement, final double dureeIntegration, final int indicePdt, - final double finesse, final CtuluVariable vx, final CtuluVariable vy, final ProgressionInterface prog) {// FIXME - // trop de - // variable - // faire - // une - // classe - prog_ = prog; + public void computeLigneCourant(EfTrajectoireParameters _data, final CtuluAnalyze _analyse, + final ProgressionInterface _prog) { + stop_ = false; + activity_ = new EfTrajectoireActivity(calque_.getSource().getInterpolator(), new MvProfileCoteTester(), calque_ + .getSource().getTime().getTimesInSec()); + activity_.computeLigneCourant(_data, _prog, _analyse); - // on repartit les points uniform\xE9ment sur le segment - listePointsARepartir_ = repartirUniformementPointsSurSegment(extrem1segment, extrem2segment, - nbPointsARepartirUniformement); - - // test de l'algo avec le premier point - final Coordinate init = listePointsARepartir_.get(0); - - // on init le temps total avec l'indice du pas de temps fourni au depart - double tempsTotal = data_.getTimeStep(indicePdt); - double oldTempsTotal; - boolean termine = false; - - // -- variables d'initialisation - // point courant tout au long de l'algo - final Coordinate pointCourant = init; - // element sur lequel on se situe a l'iteration i - int elementCourant; - // intersection courante - EfLineIntersection intersectionCourante; - - // initialisation - progression("Recherche \xE9l\xE9ment englobant", 5); - elementCourant = elementEnglobant(pointCourant); - // creation de l'intersection avec l'\xE9l\xE9ment courant - progression("Recherche des intersection", 7); - intersectionCourante = new EfLineIntersection.ItemMesh(elementCourant, pointCourant.x, pointCourant.y); - - // recup des datas a partir de la var et du pas de temps initial - // donn\xE9es r\xE9cup\xE9r\xE9es fixe pour les lignes de courants - EfData dataX = null; - EfData dataY = null; - try { - dataX = data_.getData(vx, indicePdt); - dataY = data_.getData(vy, indicePdt); - } catch (final IOException e) { - e.printStackTrace();// erreur de lecteur arrrete le tout - } - - // -- Algo principal --// - final Coordinate c = new Coordinate(); - if (elementCourant != -1) { - final TIntHashSet elementsAdjacent = new TIntHashSet(); - - while (!termine && Math.abs(tempsTotal) <= Math.abs(dureeIntegration)) {// FIXME - // faux - // comparaison - // d'une - // duree et - // d'un - // temps. En - // fait la - // duree - // initiale - // ( - // tempsTotal - // ) vaut - // zero - // il faut faire attention: si la dureeIntegration est negative. Il faut comparer les valeurs absolues - oldTempsTotal = tempsTotal; - - // ajout de l'intersection dans la liste r\xE9sultats - listeIntersection_.add(intersectionCourante); - - // recherche des vitesses - // double vitesseX = intersectionCourante.getDistanceFrom(pointCourant.x, pointCourant.y);//FIXME la vitesse - // c'est pas la distance depuis le debut - // mais la valeur de vx - // FIXME attention pour les trajectoires les valeurs dataX et dataY doivent etre recalcule au vrai temps - // il faudra surement interpoler en temps ! - final double vitesseX = intersectionCourante.getValueBadInterpolation(dataX); - final double vitesseY = intersectionCourante.getValueBadInterpolation(dataY); - - // calcul des distances avec son voisinage - progression("Calcul des distances avec le voisinage", 10); - // FIXME ce calcul est long il faut le faire en dehors de la boucld ! - // EfNeighborMesh voisinage = EfNeighborMesh.compute(data_.getGrid(), prog_); - elementsAdjacent.clear(); - // la set elementAdjacent comporte tous les \xE9l\xE9ements adjacents \xE0 l'intersection courante - intersectionCourante.fillWithAdjacentMeshes(elementsAdjacent); - double distanceMaxEntrePoints = 0; - final int[] listeEltVoisins = null; - int voisinChoisi = 0;// ne sert a rien - // ATTENTION: pour calcul le prochain point il faut partir du point en cours, - // et se d\xE9placer selon les vitesses x2=x1*vx*delta T - // REATTENTION: il faut prendre en compte le fait que la duree d'integration peut etre negative - // cas sur un noeud - // FIXME inutile desormais - // if (intersectionCourante.isNodeIntersection()) { - // int nbVoisins = voisinage_.getNbNeighborMeshes(elementCourant); - // listeEltVoisins = new int[nbVoisins]; - // for (int i = 0; i < nbVoisins; i++) { - // // On calcule la distance avec lequel de ces points??? - // // avec tous - // listeEltVoisins[i] = voisinage_.getNeighborMesh(elementCourant, i); - // } - // - // } else { - // // comment faire en fudaa pour les autres cas??? - // // cas des arretes - // - // } - - // calcul de la distance max - // pour calculer la distance max, il faut parcourir tous les \xE9l\xE9ments trouve et tous les noeuds des \xE9l\xE9ments - for (final TIntIterator it = elementsAdjacent.iterator(); it.hasNext();) { - final int idxElt = it.next(); - final EfElement elt = data_.getGrid().getElement(idxElt); - for (int i = 0; i < elt.getPtNb(); i++) { - data_.getGrid().getCoord(elt.getPtIndex(i), c); - distanceMaxEntrePoints = Math.max(distanceMaxEntrePoints, intersectionCourante.getDistanceFrom(c.x, c.y)); - } - } - // maintenant, on a la distance max, on calcul la duree du d\xE9placement. On a la vitesse qui vaut - // sqrt(vx*vx+vy*vy) - // Attenion. si la duree d'integration est negative il faut avoir une duree de deplacement n\xE9gative - // y=y1+vy*(delta t) et meme chose pour x - - // le reste est faux: on calcule une trajectoire et donc il faut se deplacer selon vx et vy et ne pas prendre le - // noeud du voisinage le plus loin ! - if (listeEltVoisins != null && listeEltVoisins.length > 0) voisinChoisi = listeEltVoisins[0];// pourquoi le - // premier ? - for (int i = 0; i < listeEltVoisins.length; i++) { - final int eltVoisin = listeEltVoisins[i]; - - // coordonn\xE9es de l'\xE9l\xE9ment voisin - // double x = 123456789;//getCoordonnees(eltVoisin).x_;//FAUX - // double y = 123456789;//getCoordonnees(eltVoisin).y_;//FAUX - // double distance = Math.sqrt((pointCourant.x - x) * (pointCourant.x - - // x) + (pointCourant.y - y) - // * (pointCourant.y - y)); - // if (distanceMaxEntrePoints > distance) { - // // candidat potentiel - // - // // ACHTUNG!! VERIFIER QUE LE t+ deltaT<dureeIntegration si on choisit - // // cette distance - // if (vitesseY != 0 - // && (Math.abs(tempsTotal) + distance / Math.sqrt(vitesseY * vitesseY + vitesseX * vitesseX) <= - // Math - // .abs(dureeIntegration))) {// FIXME pourquoi seulement la - // // vitesse y. Il faut - // //faire sqrt(vx*vx+vy*vy) - // distanceMaxEntrePoints = distance; - // voisinChoisi = eltVoisin; - // } - // } - // } - // - // - // - // // on calcul le nouveau temps total - // if (vitesseY != 0) tempsTotal += distanceMaxEntrePoints / vitesseY;//FIXME pour calcul le - - // -- calcul du temps pass\xE9 pour aller jusqu'a distance max --// - - double deltaT = 0; - if (Math.sqrt(vitesseY * vitesseY + vitesseX * vitesseX) != 0) deltaT = distanceMaxEntrePoints - / Math.sqrt(vitesseY * vitesseY + vitesseX * vitesseX); - - // -- on ajoute si cela ne fait pas depasser --// - if (Math.abs(tempsTotal + deltaT) <= (Math.abs(dureeIntegration))) tempsTotal += deltaT; - else { - - // FIXME que fait-on si le temps total d\xE9passe? Tu parlais de diviser les intervalles, je n'ai pas bien - // compris mais je tente quand meme - - } - - // on verifie que l'on n'est pas inactif: pas necessaire - if (oldTempsTotal == tempsTotal) { - termine = true; - } else { - - // on a ondc un segment form\xE9 par element courant vers element choisi - final GrPoint pointchoisi = new GrPoint(data_.getGrid().getCoor(voisinChoisi).x, data_.getGrid().getCoor( - voisinChoisi).y, 0); - - // FIXME non on recherche le point le plus eloigne pour savoir sur - // combien de temps on doit bouge - - // listeCoor[1] = new Coordinate(pointchoisi.x, pointchoisi.y); - - // LineString ligne = new LineString(listeCoor, new - // PrecisionModel(),0); - - // utilse GISGeometryFactory.createSegment - final LineString ligne = GISGeometryFactory.INSTANCE.createSegment(pointCourant.x, pointCourant.y, - pointchoisi.x_, pointchoisi.y_); - progression("Recherche des intersections", 50); - final EfLineIntersectionsResultsMng res = lineIntersect_.computeForMeshes(ligne, prog_); - - if (res.isSegmentOut(0)) { - // particules est sortie du maillage, le calcul s'arrete - termine = true; - } else { - - } - // recuperationde la nouvelle intersection aui devien courante - intersectionCourante = res.getFoundIntersect(1);// Je crois qu'il - // faut prendre - // l'intersection 1 - // car la 0 est le - // point de d\xE9part - - // cette intersection sera automatiquement ajout\xE9e a la liste solution a la prochaine it\xE9ration (premiere - // instruction du while) - - } - } - }// fin du while - - } - return listeIntersection_; } /** - * Retourne les coordonn\xE9es associ\xE9es a l \xE9l\xE9ment du point FIXME faux - * - * @param element - * @return - */ - // GrPoint getCoordonnees(int element) { - // GrPoint point = new GrPoint(); - // calque_.getIsoLayer().getIsoModel().point(element, point);// FIXME Faux on passe un element et on renvoie un point - // ! - // return point; - // } - /** - * Recherche l'\xE9l\xE9lment englobant pour un point donn\xE9 - * - * @param _prReel - * @param grid - * @return - */ - public int elementEnglobant(final Coordinate _prReel) { - final EfGridInterface grid = data_.getGrid(); - if (grid.getIndex() != null) { - final EfIndexVisitorNearestElt visitor = new EfIndexVisitorNearestElt(grid, _prReel.x, _prReel.y, 0); - grid.getIndex().query(EfIndexVisitorNearestNode.getEnvelope(_prReel.x, _prReel.y, 0), visitor); - return visitor.isIn() ? visitor.getSelected() : -1; - } else return -1; - } - - public void buildNeighbor(final ProgressionInterface _prog) { - if (voisinage_ == null) { - voisinage_ = EfNeighborMesh.compute(data_.getGrid(), _prog); - } - // TODO Auto-generated method stub - - } - - public EfGridInterface getGrid() { - // TODO Auto-generated method stub - return data_.getGrid(); - } - - public EfGridDataInterpolator getGridData() { - // TODO le stocker dans un champ prive - return new EfGridDataInterpolatorDefault(data_, interpolator_); - } - - public EfNeighborMesh getNeighbor() { - return voisinage_; - } - - /** * fonction appel\xE9e en cas de stop de thread */ - public void stop() {} - + public void stop() { + stop_ = true; + if (activity_ != null) activity_.stop(); + } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -36,8 +36,7 @@ import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.CtuluRange; import org.fudaa.dodico.ef.EfGridInterface; -import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestElt; -import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestNode; +import org.fudaa.dodico.ef.operation.EfIndexHelper; import org.fudaa.dodico.ef.operation.EfIsoRestructuredGridActivity; import org.fudaa.dodico.ef.operation.EfIsoRestructuredGridResult; import org.fudaa.dodico.h2d.type.H2dVariableType; @@ -228,11 +227,7 @@ */ public static int sondeSelection(final GrPoint _prReel, final TrPostModelInterface _model) { final EfGridInterface grid = _model.getGrid(); - if (grid.getIndex() != null) { - final EfIndexVisitorNearestElt visitor = new EfIndexVisitorNearestElt(grid, _prReel.x_, _prReel.y_, 0); - grid.getIndex().query(EfIndexVisitorNearestNode.getEnvelope(_prReel.x_, _prReel.y_, 0), visitor); - return visitor.isIn() ? visitor.getSelected() : -1; - } + if (grid.getIndex() != null) { return EfIndexHelper.getElementEnglobant(grid, _prReel.x_, _prReel.y_, null); } return sondeSelectionLong(_prReel, _model); } @@ -244,12 +239,7 @@ * @return */ public static int sondeSelection(final GrPoint _prReel, final EfGridInterface grid) { - - if (grid.getIndex() != null) { - final EfIndexVisitorNearestElt visitor = new EfIndexVisitorNearestElt(grid, _prReel.x_, _prReel.y_, 0); - grid.getIndex().query(EfIndexVisitorNearestNode.getEnvelope(_prReel.x_, _prReel.y_, 0), visitor); - return visitor.isIn() ? visitor.getSelected() : -1; - } + if (grid.getIndex() != null) { return EfIndexHelper.getElementEnglobant(grid, _prReel.x_, _prReel.y_, null); } return -1; } 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 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -42,7 +42,7 @@ } public static EvolutionReguliere getEvol(final TrPostSource _src, final int _idxPtElt, final H2dVariableType _var) { - final double[] times = _src.getTime().getInitTimeSteps(); + final double[] times = _src.getTime().getTimeListModel().getTimesInSec(); if (times == null) { return null; } final double[] values = new double[times.length]; try { 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 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -53,7 +53,7 @@ public class TrPostCourbeTreeModel extends EGGrapheTreeModel implements TrPostTimeContentListener, Target { - FudaaCommonImplementation impl_; + FudaaCommonImplementation impl_; Set intepolPt_; @@ -536,25 +536,25 @@ // -- verification si le point du model choisi est reel ou interpol\xE9 // dans la nouvelle source --// - if (srcChoisie.getGrid().contientPoint(modelBase.getPtX(), modelBase.getPtY())) { + // if (srcChoisie.getGrid().contientPoint(modelBase.getPtX(), modelBase.getPtY())) { + // + // // -- CREATION DE LA COURBE REELE DEPUIS COURBE REELLE --// + // newCurve = TrPostCourbeModel.buildCourbeModel(var, ((TrPostCourbeModel.Node) modelBase).ptIdx_, _child + // .getParentGroup(), srcChoisie); + // } else { + // -- on recupere le point le plus proche pour interpoler --// + final GrPoint pointAInterpole = new GrPoint(modelBase.getPtX(), modelBase.getPtY(), 0); + final int newPtIdx = TrIsoLayerDefault.sondeSelection(pointAInterpole, srcChoisie.getGrid()); - // -- CREATION DE LA COURBE REELE DEPUIS COURBE REELLE --// - newCurve = TrPostCourbeModel.buildCourbeModel(var, ((TrPostCourbeModel.Node) modelBase).ptIdx_, _child - .getParentGroup(), srcChoisie); - } else { - // -- on recupere le point le plus proche pour interpoler --// - final GrPoint pointAInterpole = new GrPoint(modelBase.getPtX(), modelBase.getPtY(), 0); - final int newPtIdx = TrIsoLayerDefault.sondeSelection(pointAInterpole, srcChoisie.getGrid()); + if (newPtIdx != -1) { - if (newPtIdx != -1) { + final TrPostInterpolatePoint interpolatePoint = new TrPostInterpolatePoint(newPtIdx, pointAInterpole.x_, + pointAInterpole.y_, new GISPrecision()); - final TrPostInterpolatePoint interpolatePoint = new TrPostInterpolatePoint(newPtIdx, pointAInterpole.x_, - pointAInterpole.y_, new GISPrecision()); - - // -- CREATION DE LA COURBE INTERPOLEE DEPUIS COURBE REELLE --// - newCurve = TrPostCourbeModel.buildCourbeModel(modelBase.getVar(), interpolatePoint, _child.getParentGroup(), - srcChoisie); - } + // -- CREATION DE LA COURBE INTERPOLEE DEPUIS COURBE REELLE --// + newCurve = TrPostCourbeModel.buildCourbeModel(modelBase.getVar(), interpolatePoint, _child.getParentGroup(), + srcChoisie); + // } } // -- recuperation des y de son duplicata --// @@ -912,26 +912,26 @@ @Override public Object getSpecificPersitDatas(Map Params) { // TODO Auto-generated method stub - TrPostCourbeTreeModelPersist dataPersist=new TrPostCourbeTreeModelPersist(); - //-- on remplit les donn\xE9es persistantes --// - dataPersist.fillDataWithModel(this); - + TrPostCourbeTreeModelPersist dataPersist = new TrPostCourbeTreeModelPersist(); + // -- on remplit les donn\xE9es persistantes --// + dataPersist.fillDataWithModel(this); + return dataPersist; } @Override public void setSpecificPersitDatas(final Object specPersitData, Map params) { // TODO Auto-generated method stub - TrPostCourbeTreeModelPersist data=(TrPostCourbeTreeModelPersist) specPersitData; - - //-- remplissage du model avec les data persistantes --// - data.fillModelWith(this); - - //-- recuperation du trpostprojet specifique au chargement --// - TrPostProjet projet=(TrPostProjet) params.get("TrPostProjet"); - this.projet_=projet; - this.impl_=projet.impl_; - + TrPostCourbeTreeModelPersist data = (TrPostCourbeTreeModelPersist) specPersitData; + + // -- remplissage du model avec les data persistantes --// + data.fillModelWith(this); + + // -- recuperation du trpostprojet specifique au chargement --// + TrPostProjet projet = (TrPostProjet) params.get("TrPostProjet"); + this.projet_ = projet; + this.impl_ = projet.impl_; + } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedNorm.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedNorm.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedNorm.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -56,7 +56,7 @@ for (int i = norm.length - 1; i >= 0; i--) { final double vxi = vx.getValue(i); final double vyi = vy.getValue(i); - norm[i] = Math.sqrt(vxi * vxi + vyi * vyi); + norm[i] = Math.hypot(vxi, vyi); } return vx.isElementData() ? ((EfData) new EfDataElement(norm)) : ((EfData) new EfDataNode(norm)); } @@ -66,7 +66,7 @@ try { final double vx = src_.getData(idxX_, _idxTime, _idxObject); final double vy = src_.getData(idxY_, _idxTime, _idxObject); - return Math.sqrt(vx * vx + vy * vy); + return Math.hypot(vx, vy); } catch (final IOException _e) { FuLog.warning(_e); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -11,7 +11,7 @@ import org.fudaa.ctulu.interpolation.InterpolationVectorContainer; import org.fudaa.dodico.ef.EfData; import org.fudaa.dodico.ef.EfGridInterface; -import org.fudaa.dodico.ef.interpolation.EfInterpolator; +import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; import org.fudaa.ebli.geometrie.GrSegment; /** @@ -47,8 +47,8 @@ vx = x_.getValue(_idxElt); vy = y_.getValue(_idxElt); } else { - vx = EfInterpolator.interpolateDangerous(_idxElt, _x, _y, x_, _grid); - vy = EfInterpolator.interpolateDangerous(_idxElt, _x, _y, y_, _grid); + vx = EfGridDataInterpolator.interpolateDangerous(_idxElt, _x, _y, x_, _grid); + vy = EfGridDataInterpolator.interpolateDangerous(_idxElt, _x, _y, y_, _grid); } _target.e_.x_ = _x + vx; _target.e_.y_ = _y + vy; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -83,7 +83,7 @@ try { final double vx = src_.getData(varVx_, _idxTime, _idxObject); final double vy = src_.getData(varVy_, _idxTime, _idxObject); - return Math.sqrt(vx * vx + vy * vy); + return Math.hypot(vx,vy); } catch (final IOException _e) { FuLog.warning(_e); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -266,7 +266,6 @@ _impl, _inter); if (retour == null) { return; } retour.setId(id); - retour.buildDefaultVarUpdateLists(); projetCourant_.ajouterSource(retour); 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-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -378,6 +378,7 @@ _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 &&)) @@ -500,7 +501,7 @@ */ public String formatInfoSource(final TrPostSource _src) { // --ajout dans la liste des titres --// - return "Fichier: " + formatFichier(_src.getFile())+" |"+formatName(_src.getTitle()) ; + return formatName(_src.getTitle()) + " | Fichier: " + formatFichier(_src.getFile()); } public String formatFichier(final File file) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLimniMng.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLimniMng.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLimniMng.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -145,9 +145,7 @@ // ce test me semble dangereux: mais je ne comprends pas certaines exceptions dues // au TRC ... if (itime < evx.getNbValues() && itime < evy.getNbValues()) { - final double vxi = evx.getY(itime); - final double vyi = evy.getY(itime); - vScalaire[itime] = Math.sqrt(vxi * vxi + vyi * vyi); + vScalaire[itime] = Math.hypot(evx.getY(itime), evy.getY(itime)); } else { vScalaire[itime] = -1; } 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 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSource.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -25,7 +25,7 @@ import org.fudaa.dodico.ef.EfFilter; import org.fudaa.dodico.ef.EfGridData; import org.fudaa.dodico.ef.EfGridInterface; -import org.fudaa.dodico.ef.interpolation.EfInterpolator; +import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.dodico.h2d.type.H2dVariableTypeCreated; import org.fudaa.ebli.calque.BCalqueLegende; @@ -53,7 +53,7 @@ public void activate(); - EfInterpolator getInterpolator(); + EfGridDataInterpolator getInterpolator(); /** * @param _var la var a enlever Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -51,7 +51,7 @@ import org.fudaa.dodico.ef.EfFilter; import org.fudaa.dodico.ef.EfGridInterface; import org.fudaa.dodico.ef.EfLib; -import org.fudaa.dodico.ef.interpolation.EfInterpolator; +import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; import org.fudaa.dodico.h2d.resource.H2dResource; import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.dodico.h2d.type.H2dVariableTypeCreated; @@ -196,7 +196,7 @@ protected boolean inspected_; - EfInterpolator interpolator_; + EfGridDataInterpolator interpolator_; GISPrecision precision_; @@ -549,7 +549,7 @@ _m.put("X", CtuluLib.DEFAULT_NUMBER_FORMAT.format(_x)); _m.put("Y", CtuluLib.DEFAULT_NUMBER_FORMAT.format(_y)); _m.put(TrResource.getS("El\xE9ment englobant"), CtuluLibString.getString(_element + 1)); - final EfInterpolator interpolator = getInterpolator(); + final EfGridDataInterpolator interpolator = getInterpolator(); for (int i = 0; i < variable_.length; i++) { try { _m.put(variable_[i].getName(), CtuluLib.DEFAULT_NUMBER_FORMAT.format(interpolator.interpolate(_element, _x, @@ -859,8 +859,8 @@ return null; } - public EfInterpolator getInterpolator() { - if (interpolator_ == null) interpolator_ = new EfInterpolator(this, createVectorInterpolation()); + public EfGridDataInterpolator getInterpolator() { + if (interpolator_ == null) interpolator_ = new EfGridDataInterpolator(this, createVectorInterpolation()); return interpolator_; } @@ -1054,7 +1054,7 @@ */ public boolean interpolate(final H2dVariableType[] _t, final int _time, final double[] _values, final int _elementIdx, final double _x, final double _y) { - final EfInterpolator interpolator = getInterpolator(); + final EfGridDataInterpolator interpolator = getInterpolator(); for (int i = _t.length - 1; i >= 0; i--) { try { _values[i] = interpolator.interpolate(_elementIdx, _x, _y, _t[i], _time); @@ -1414,8 +1414,8 @@ // } public String getId(){ -// if(id_==null) -// id_=generateId(); + if(id_==null) + id_=generateId(); return id_; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTimeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTimeModel.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTimeModel.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -34,6 +34,8 @@ */ public class TrPostTimeModel { + + /** * Un modele pour les pas de temps. * @@ -115,6 +117,14 @@ public TrPostTimeModel() { super(); } + + /** + * @return + * @see org.fudaa.fudaa.tr.post.TrPostTimeModel.TimeListModel#getTimesInSec() + */ + public double[] getTimesInSec() { + return getTimeListModel().getTimesInSec(); + } CtuluExpr buildExpr() { final CtuluExpr r = expr_ == null ? new CtuluExpr() : new CtuluExpr(expr_); Modified: 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/TrPostVisuPanel.java 2008-10-30 17:09:20 UTC (rev 4121) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-10-30 17:10:26 UTC (rev 4122) @@ -36,7 +36,6 @@ import org.fudaa.ebli.calque.ZCalqueSondeInterface; import org.fudaa.ebli.calque.ZEbliCalquePanelController; import org.fudaa.ebli.calque.ZEbliCalquesPanelPersistManager; -import org.fudaa.ebli.calque.ZebliCalquePersist; import org.fudaa.ebli.calque.action.CalqueActionSonde; import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; import org.fudaa.ebli.calque.action.EbliCalqueActionVariableChooser; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-30 19:48:49
|
Revision: 4134 http://fudaa.svn.sourceforge.net/fudaa/?rev=4134&view=rev Author: hadouxad Date: 2008-10-30 19:48:39 +0000 (Thu, 30 Oct 2008) Log Message: ----------- maj donn?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator2.java Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator2.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator2.java 2008-10-30 19:48:39 UTC (rev 4134) @@ -0,0 +1,255 @@ +package org.fudaa.fudaa.tr.post; + +import java.io.File; + +import org.fudaa.ctulu.CtuluLibGenerator; +import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.fileformat.FileFormat; +import org.fudaa.ctulu.gui.CtuluDialogPanel; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; +import org.fudaa.dodico.ef.FileFormatGridVersion; +import org.fudaa.dodico.fichiers.FileFormatSoftware; +import org.fudaa.dodico.reflux.io.RefluxRefondeSolutionSequentielResult; +import org.fudaa.dodico.telemac.io.SerafinFileFormat; +import org.fudaa.fudaa.tr.common.TrFileFormatManager; + +import com.memoire.bu.BuLib; + +public class TrPostMultiSourceActivator2 { + + public TrPostProjet projetCourant_; + + public TrPostMultiSourceActivator2(final TrPostProjet _projet) { + super(); + projetCourant_ = _projet; + + } + + /** + * @param _s la source + * @param _impl l'impl parente + */ + protected static void afficheFrame(final TrPostProjet _p, final TrPostCommonImplementation _impl) { + + _impl.setProjet(_p); + + + } + + public static void activeFile(final File _f, final TrPostCommonImplementation _impl) { + TrPostProjet pro = _impl.getCurrentProject(); + if (pro == null) { + pro = new TrPostProjet(_impl); + } + new TrPostMultiSourceActivator(pro).active(_f, _impl); + + } + + /** + * @param _f le fichier a ouvrir + * @param _impl l'impl parent + */ + public void activeSerafin(final File _f, final TrPostCommonImplementation _impl,final String id) { + + final TrPostSource source = activeSerafinAction(_f, _impl, _impl.getMainProgression()); + if (source == null) { return; } + source.setId(id); + if (SerafinFileFormat.is3DGrid(source.getGrid())) { + + TrPostSourceBuilder.affiche3D(source, _impl); + + + + } else { + afficheFrame(projetCourant_, _impl); + } + + + } + + public void activeGrid(final File _f, final FileFormatGridVersion _fmt, final TrPostCommonImplementation _impl,final String id) { + + activeGridAction(_f, _fmt, _impl, _impl.getMainProgression(),id); + if (projetCourant_ != null) { + afficheFrame(projetCourant_, _impl); + } + + } + + + public void active(final File _f, final TrPostCommonImplementation _impl){ + + String uniqueId; + if(_impl.c_!=null) + uniqueId=_impl.c_.deliverSourceId(_f.getName()); + else + uniqueId=CtuluLibGenerator.getInstance().deliverUniqueStringId(); + + active(_f,_impl,uniqueId); + } + + /** + * Ouvre le fichier en fonction de l'extension. + * + * @param _f le fichier correct + * @param _impl l'impl parent + */ + public void active(final File _f, final TrPostCommonImplementation _impl,String IdSourceToActive) { + if (_f == null) { return; } + final TrFileFormatManager mng = TrFileFormatManager.INSTANCE; + final String name = _f.getName(); + if (TrPostSourceBuilder.isReflux(name)) { + activeINP(_f, _impl,IdSourceToActive); + return; + } + if (mng.isRubarTPSFile(name)) { + activeRubar(_f, _impl,IdSourceToActive); + return; + } + // mettre serafin en dernier car le test est tres large .... + if (SerafinFileFormat.getInstance().createFileFilter().accept(_f)) { + activeSerafin(_f, _impl,IdSourceToActive); + return; + } + final FileFormat ft = FileFormat.findFileFormat(TrFileFormatManager.getAllGridFormat(), _f); + if (ft == null) { + final String id = _impl.getLauncher().getCurrentPrefHydId(); + if (FileFormatSoftware.REFLUX_IS.name.equals(id)) { + activeINP(_f, _impl,IdSourceToActive); + } else if (FileFormatSoftware.TELEMAC_IS.name.equals(id)) { + activeSerafin(_f, _impl,IdSourceToActive); + } else if (FileFormatSoftware.RUBAR_IS.name.equals(id)) { + activeRubar(_f, _impl,IdSourceToActive); + } + } else { + activeGrid(_f, (FileFormatGridVersion) ft, _impl,IdSourceToActive); + } + } + + /** + * Ouvir une boite de dialogue pour determiner le fichier inp et le fichier sov. + * + * @param _f le fichier xinp,sov ou inp + * @param _impl l'impl parent + */ + public void activeINP(final File _f, final TrPostCommonImplementation _impl,final String id) { + if (RefluxRefondeSolutionSequentielResult.isRefonde(_f)) { + final File inp = TrPostSourceBuilder.getInpFileForRefonde(_f, _impl); + if (inp != null) { + activeINP(inp, _f, _impl,id); + } + return; + } + final TrPostSourceBuilder.INPChooseFile pn = new TrPostSourceBuilder.INPChooseFile(_f); + if (CtuluDialogPanel.isOkResponse(pn.afficheModale(_impl.getFrame()))) { + activeINP(pn.getInp(), pn.getsov(), _impl,id); + } + } + + /** + * @param _f le fichier tps + * @param _impl l'impl parente + */ + public void activeRubar(final File _f, final TrPostCommonImplementation _impl,final String id) { + + final ProgressionInterface prog = _impl.getMainProgression(); + final TrPostSourceRubar src = activeRubarAction(_f, _impl, prog); + if(src!=null) + src.setId(id); + final TrPostRubarLoader loader = new TrPostRubarLoader(src, _f, true); + loader.active(_impl, prog); + afficheFrame(projetCourant_, _impl); + + + } + + /** + * @param _f le fichier inp + * @param _sov le fichier sov + * @param _impl l'impl parente + */ + public void activeINP(final File _f, final File _sov, final TrPostCommonImplementation _impl,final String id) { + + activeINPAction(_f, _sov, _impl, _impl.getMainProgression(),id); + if (projetCourant_ != null) { + afficheFrame(projetCourant_, _impl); + } + + } + + /** + * @param _f le fichier serafin + * @param _impl l'impl parent + * @param _inter la barre de progress + * @return le source post + */ + public TrPostSource activeSerafinAction(final File _f, final TrPostCommonImplementation _impl, + final ProgressionInterface _inter) { + final TrPostSource r = TrPostSourceBuilder.activeSerafinSourceAction(_f, _impl, _inter, null); + if (r != null) { + + // ajout de la source au postProjet + this.projetCourant_.ajouterSource(r); + } + return r; + } + + /** + * @param _f le fichier serafin + * @param _impl l'impl parent + * @param _inter la barre de progress + * @return le source post + */ + public TrPostSourceRubar activeRubarAction(final File _f, final TrPostCommonImplementation _impl, + final ProgressionInterface _inter) { + final TrPostSourceRubar src = TrPostSourceBuilder.activeRubarSrcAction(_f, _impl, _inter); + if (src == null) { return null; } + + this.projetCourant_.ajouterSource(src); + + return src; + } + + public static void loadData(final CtuluUI _impl, final ProgressionInterface _inter, final TrPostProjet _proj) { + if (_proj != null && _proj.openSrcDataAndIsModified(_impl, _inter)) { + _proj.setProjectModified(); + } + } + + /** + * @param _gridFile le fichier inp ou ximp + * @param _sovFile le fichier contenant les solutions + * @param _impl l'impl parent + * @param _inter la barre de progression + * @return le source + */ + public void activeINPAction(final File _gridFile, final File _sovFile, final CtuluUI _impl, + final ProgressionInterface _inter,String id) { + + final TrPostSourceReflux retour = (TrPostSourceReflux) TrPostSourceBuilder.activeINPSource(_gridFile, _sovFile, + _impl, _inter); + if (retour == null) { return; } + retour.setId(id); + retour.buildDefaultVarUpdateLists(); + + projetCourant_.ajouterSource(retour); + + loadData(_impl, _inter, projetCourant_); + return; + } + + public void activeGridAction(final File _f, final FileFormatGridVersion _ftGrid, + final TrPostCommonImplementation _impl, final ProgressionInterface _inter,String id) { + + final TrPostSource retour = TrPostSourceBuilder.activeGridSource(_f, _ftGrid, _impl, _inter); + if (retour == null) { return; } + retour.setId(id); + this.projetCourant_.ajouterSource(retour); + + loadData(_impl, _inter, projetCourant_); + return; + } + + } 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 2008-10-30 19:48:29 UTC (rev 4133) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-30 19:48:39 UTC (rev 4134) @@ -43,9 +43,11 @@ import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; import org.fudaa.fudaa.tr.post.TrPostLayoutFille; import org.fudaa.fudaa.tr.post.TrPostMultiSourceActivator; +import org.fudaa.fudaa.tr.post.TrPostMultiSourceActivator2; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.TrPostSourceAbstract; +import org.fudaa.fudaa.tr.post.TrPostTimeModelSaver; import org.fudaa.fudaa.tr.post.TrPostUserVariableSaver; import org.fudaa.fudaa.tr.post.actions.TrPostActionFusionCalques; import org.netbeans.api.visual.widget.Widget; @@ -526,6 +528,7 @@ final List<TrPostSourcePersist> listeCouplesIdSources = new ArrayList<TrPostSourcePersist>(); final List<TrPostUserVariableSaver> listeVar = new ArrayList<TrPostUserVariableSaver>();// getPersitantVariablesList + final List<TrPostTimeModelSaver> listePdt = new ArrayList<TrPostTimeModelSaver>(); // ( // pathVariables // , @@ -543,6 +546,7 @@ // -- sauveagrde de la variable correspondante --// final TrPostUserVariableSaver var = TrPostUserVariableSaver.saveIn((TrPostSourceAbstract) src, null); listeVar.add(var); + listePdt.add(new TrPostTimeModelSaver(src)); } // -- sauvegarde du fichier contenant les liens path/Sources --// @@ -552,10 +556,13 @@ // -- sauvegarde dans le repertoire variable c un fichier par donnees // persistantes --// int cpt=0; - for (TrPostUserVariableSaver var : listeVar) { + for (int i=0;i<listeVar.size();i++) { + TrPostUserVariableSaver var=listeVar.get(i); + TrPostTimeModelSaver ptd=listePdt.get(i); out = getParser().createObjectOutputStream( new FileWriter(pathVariables + File.separator + "variables_" + listeCouplesIdSources.get(cpt++).IdSource)); out.writeObject(var); + out.writeObject(ptd); out.close(); } @@ -584,7 +591,7 @@ in = getParser().createObjectInputStream(new FileReader(file)); // -- recuperation du multiSourceActivator--// - final TrPostMultiSourceActivator multiProjectActivator = new TrPostMultiSourceActivator(trprojet_); + final TrPostMultiSourceActivator2 multiProjectActivator = new TrPostMultiSourceActivator2(trprojet_); //-- lecture des commentaires --// Object debutFichier=in.readObject(); @@ -675,6 +682,14 @@ final TrPostUserVariableSaver varUser = (TrPostUserVariableSaver) var; varUser.restore(src, new CtuluAnalyze(), ui_.createProgressionInterface(this), ui_); } + + var = in.readObject(); + if (var instanceof TrPostTimeModelSaver) { + final TrPostTimeModelSaver varUser = (TrPostTimeModelSaver) var; + varUser.restore(src, ui_.createProgressionForMainPanel(), true); + } + + } catch (FileNotFoundException e) { e.printStackTrace(); @@ -895,15 +910,17 @@ progression("Chargement du fichier descripteur de sources", 15); file = new File(projet_.getAbsolutePath() + File.separator + setupProject); loadSource(file); - + // -- etape 6; lecture des variables --// + progression("Lecture variables", 20); + loadVariables(pathVariables); // -- etape 3: sauvegarde du fichier de descriptions des layout // --// - progression("Cr\xE9ation du descripteur de layout", 20); + progression("Cr\xE9ation du descripteur de layout", 30); file = new File(projet_.getAbsolutePath() + File.separator + INFOSCENE); final List<String> listeFichiers = loadDescriptorScenes(file); // -- etape 4 chargement des ebliscene unitairement --// - progression("Cr\xE9ation des fichiers layout", 30); + 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()); @@ -917,7 +934,7 @@ for (final String fichier : listeFichiers) { file = new File(fichier); - if (listeFichiers.size() != 0) progression("chargement du fichier " + fichier, 30 + 70 / listeFichiers.size()); + if (listeFichiers.size() != 0) progression("chargement du fichier " + fichier, 40 + 60 / listeFichiers.size()); // -- creation de la trpostlayoutFille --// final TrPostLayoutFille postFrame = new TrPostLayoutFille(trprojet_); @@ -928,9 +945,8 @@ loadPersitSceneXml(file, postFrame, parametres, listeCouplesNoms); } - // -- etape 6; lecture des variables --// - progression("Lecture variables", 90); - loadVariables(pathVariables); + + progression("", 100); managerError.showDialog(ui_); @@ -965,6 +981,9 @@ xstream.alias("SOURCE", TrPostSourcePersist.class); xstream.alias("LAYOUTDESCRIPTOR", LayoutDescriptor.class); xstream.alias("README", XmlCommentaire.class); + xstream.alias("TIMEMODEL", TrPostTimeModelSaver.class); + xstream.alias("USERVAR", TrPostUserVariableSaver.class); + // xstream.addImplicitCollection(EbliWidgetSerializeXml.CoupleNomId.class, // "FRAMENAME"); // xstream.alias( "NbElements",Integer.class); @@ -1171,7 +1190,8 @@ final HashMap<String, HashSet<Object>> listeGroupToPerform = new HashMap<String, HashSet<Object>>(); List<EbliWidgetSerializeXml> listeWidgetLinked=new ArrayList<EbliWidgetSerializeXml>(); - + Map<EbliWidgetSerializeXml, Integer> listePositionWidgetLinked=new HashMap<EbliWidgetSerializeXml, Integer> (); + // -- r\xE9cup\xE9ration via xml des eblinode/widgets --// for (int i = 0; i < sceneXml.getNbFrames(); i++) { @@ -1207,6 +1227,7 @@ // -- on ajoute la widget liee a la liste des widget a cree au // final--// listeWidgetLinked.add(widgetXml); + listePositionWidgetLinked.put(widgetXml, new Integer(i)); } } @@ -1214,12 +1235,17 @@ // --On executre les widgets liees --// for (EbliWidgetSerializeXml widgetXml : listeWidgetLinked) { + // generation de la widget dans la scene parametres.put("nodeName", getNodeName(listeCouplesNoms, widgetXml.getId())); final EbliNode node = widgetXml.generateWidgetInScene(parametres, scenToUpdate); // ajout des noeuds a ajouter dans la selection if (widgetXml.isSelected()) listeNodeSelect.add(node); + Integer position=listePositionWidgetLinked.get(widgetXml); + if(position!=null) + scenToUpdate.moveWidgetTo(node.getWidget(), position.intValue()); + // ajout de la creation d'un groupe if (!widgetXml.getIdGroup().equals(EbliWidgetGroup.NOGROUP)) { // il y a un group a prendre en compte d'id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-12-08 18:24:24
|
Revision: 4279 http://fudaa.svn.sourceforge.net/fudaa/?rev=4279&view=rev Author: hadouxad Date: 2008-12-08 18:24:20 +0000 (Mon, 08 Dec 2008) Log Message: ----------- ***** Correction du Bug zoom:***** l'affichage du calque est op?\195?\169rationnel et proportionnel a sa widget! en utilisant la m?\195?\169thode calquePanel_.restaurer(); Mais the question is: Is the method optimized? (tout est dans EbliWidgetVueCalque) **** Evolution: Fonction duplcation layout **** possibilit?\195?\169 via le clic sur un bouton de dupliquer int?\195?\169gralement le contenu d'un layout et de g?\195?\169n?\195?\169rer une nouvelle trpostLayoutfille pour l'occasion Menu actions du trpostlayout Modified Paths: -------------- 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 Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionDuplicateLayout.java 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-08 16:30:11 UTC (rev 4278) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-12-08 18:24:20 UTC (rev 4279) @@ -3,6 +3,8 @@ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Point; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.HashSet; @@ -17,6 +19,8 @@ import javax.swing.JMenuBar; import javax.swing.JPanel; import javax.swing.JToolBar; +import javax.swing.event.InternalFrameEvent; +import javax.swing.event.InternalFrameListener; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluUndoRedoInterface; @@ -114,6 +118,8 @@ TrPostProjet projet_; + Dimension oldSize_; + /** * Constructeur de la fenetre. */ @@ -142,7 +148,46 @@ panelSouthSuiviSouris_ = new JLabel(); this.add(panelSouthSuiviSouris_, BorderLayout.SOUTH); + + oldSize_=getSize(); + //-- ajout du controller en cas de resize --// + this.addComponentListener(new ComponentListener(){ + @Override + public void componentHidden(ComponentEvent e) { + // TODO Auto-generated method stub + + } + + @Override + public void componentMoved(ComponentEvent e) { + // TODO Auto-generated method stub + + } + + @Override + public void componentResized(ComponentEvent e) { + // TODO Auto-generated method stub +// Dimension size=getSize(); +// System.out.println("Size nouvelle:"+size); +// if(size!=oldSize_ ){ +// controller_.getSceneCourante().resizeInnerWidget(size,oldSize_); +// +// //-- stockage de la taille comme ancienne size --// +// oldSize_=size; +// } + } + + @Override + public void componentShown(ComponentEvent e) { + // TODO Auto-generated method stub + + } + + }); + + + } /** 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-08 16:30:11 UTC (rev 4278) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-12-08 18:24:20 UTC (rev 4279) @@ -60,6 +60,7 @@ import org.fudaa.fudaa.tr.post.actions.TrPostActionChangeSceneForWidget; import org.fudaa.fudaa.tr.post.actions.TrPostActionChooseAndCreateCalque; import org.fudaa.fudaa.tr.post.actions.TrPostActionDuplicate; +import org.fudaa.fudaa.tr.post.actions.TrPostActionDuplicateLayout; import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardCreateScope; import org.jdesktop.swingx.ScrollPaneSelector; @@ -193,7 +194,10 @@ // comboMultiScenes_.addActionListener(this); // comboMultiScenes_.setMaximumSize(comboMultiScenes_.getPreferredSize()); // comboMultiScenes_.setMinimumSize(comboMultiScenes_.getPreferredSize()); - + + + + } // public BuComboBox getComboMultiScenes() { @@ -536,6 +540,7 @@ // -- action de duplication --// // init.add(new EbliWidgetActionDuplicate(getSceneCourante())); init.add(new TrPostActionDuplicate(getSceneCourante(), projet_)); + init.add(new TrPostActionDuplicateLayout(getSceneCourante(), projet_)); init.add(new TrPostActionChangeSceneForWidget(getSceneCourante(), projet_)); init.add(null); 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-08 16:30:11 UTC (rev 4278) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-12-08 18:24:20 UTC (rev 4279) @@ -1360,13 +1360,15 @@ /** * Cree une nouvelle fenetre dans le post contenant son jeu de layouts */ - public void createNewLayoutFrame() { + public TrPostLayoutFille createNewLayoutFrame() { final TrPostLayoutFille newLayoutFille = new TrPostLayoutFille(this); newLayoutFille.setTitle(newLayoutFille.getTitle() + " N\xB0 " + (++idx)); // addFillesLayout(newLayoutFille); impl_.addInternalFrame(newLayoutFille); + + return newLayoutFille; } } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionDuplicateLayout.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionDuplicateLayout.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionDuplicateLayout.java 2008-12-08 18:24:20 UTC (rev 4279) @@ -0,0 +1,61 @@ +package org.fudaa.fudaa.tr.post.actions; + +import java.util.Iterator; +import java.util.List; + +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionDuplicate; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionDuplicateLayout; +import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; +import org.fudaa.fudaa.tr.post.TrPostLayoutFille; +import org.fudaa.fudaa.tr.post.TrPostProjet; + +import com.memoire.bu.BuDialogChoice; + + +/** + * Action qui duplique le layout en en creant un nouveau. + * @author Adrien Hadoux + * + */ +public class TrPostActionDuplicateLayout extends EbliWidgetActionDuplicateLayout{ + + TrPostProjet projet_; + + public TrPostActionDuplicateLayout(final EbliScene _scene, final TrPostProjet _projet) { + super(_scene); + + projet_ = _projet; + } + + /** + * surcharge de la methode. Creation d'un nouveau layout avec le contenu du duplicata + */ + @Override + protected EbliScene selectionneSceneNode() { + EbliScene dest = null; + TrPostLayoutFille fenetre = projet_.createNewLayoutFrame(); + dest = fenetre.controller_.getSceneCourante(); + return dest; + } + + public static String[] formatteFilles(final List<TrPostLayoutFille> ls) { + final String[] noms = new String[ls.size()]; + int cpt = 0; + for (final Iterator<TrPostLayoutFille> it = ls.iterator(); it.hasNext();) { + noms[cpt++] = it.next().getTitle(); + } + return noms; + } + + // public String[] formatteLayout(TrPostLayoutPanelController _controller) { + // String[] noms = new String[_controller.listeScenes_.size()]; + // + // for (int cpt = 0; cpt < _controller.listeScenes_.size(); cpt++) { + // noms[cpt] = "Layout " + (cpt + 1); + // } + // return noms; + // } + + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-05 19:02:11
|
Revision: 4323 http://fudaa.svn.sourceforge.net/fudaa/?rev=4323&view=rev Author: hadouxad Date: 2009-01-05 19:02:06 +0000 (Mon, 05 Jan 2009) Log Message: ----------- Corrections partielles retour 15/12/2008 Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.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/actions/TrPostActionOpenSrc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFusionProjet.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2009-01-05 15:46:50 UTC (rev 4322) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2009-01-05 19:02:06 UTC (rev 4323) @@ -24,6 +24,7 @@ import org.fudaa.fudaa.tr.common.TrCommonImplementation; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.actions.TrPostActionChooseAndCreateCalque; import com.memoire.bu.BuLib; import com.memoire.bu.BuMenu; @@ -34,256 +35,279 @@ */ public abstract class TrPostCommonImplementation extends TrCommonImplementation { - TrPostProjet c_; + TrPostProjet c_; - public final TrPostProjet getCurrentProject() { - return c_; - } + public final TrPostProjet getCurrentProject() { + return c_; + } - /** - * @return toutes les fenetres de PostLayout - */ - public List<TrPostLayoutFille> getAllLayoutFille() { - final JInternalFrame[] allInternalFrames = getAllInternalFrames(); - if (allInternalFrames == null) return Collections.emptyList(); - final List<TrPostLayoutFille> res = new ArrayList<TrPostLayoutFille>(allInternalFrames.length); - for (int i = 0; i < allInternalFrames.length; i++) { - final JInternalFrame internalFrame = allInternalFrames[i]; - if (internalFrame instanceof TrPostLayoutFille) { - res.add((TrPostLayoutFille) internalFrame); - } - } - return res; - } + /** + * @return toutes les fenetres de PostLayout + */ + public List<TrPostLayoutFille> getAllLayoutFille() { + final JInternalFrame[] allInternalFrames = getAllInternalFrames(); + if (allInternalFrames == null) return Collections.emptyList(); + final List<TrPostLayoutFille> res = new ArrayList<TrPostLayoutFille>(allInternalFrames.length); + for (int i = 0; i < allInternalFrames.length; i++) { + final JInternalFrame internalFrame = allInternalFrames[i]; + if (internalFrame instanceof TrPostLayoutFille) { + res.add((TrPostLayoutFille) internalFrame); + } + } + return res; + } - - public void elimineDoublonNomsLayout(){ - List<TrPostLayoutFille> liste=getAllLayoutFille(); - - for(int i=0;i<liste.size();i++){ - int cpt=1; - for(int j=i; j<liste.size();j++){ - if(liste.get(j).previousTitleFrame.equals(liste.get(i).previousTitleFrame)){ - - liste.get(j).previousTitleFrame+="_"+(cpt++); - } + + public void elimineDoublonNomsLayout(){ + List<TrPostLayoutFille> liste=getAllLayoutFille(); + + for(int i=0;i<liste.size();i++){ + int cpt=1; + for(int j=i; j<liste.size();j++){ + if(liste.get(j).previousTitleFrame.equals(liste.get(i).previousTitleFrame)){ + + liste.get(j).previousTitleFrame+="_"+(cpt++); + } } - - } - - } - - /** - * @return la fenetre layout active. - */ - public TrPostLayoutFille getCurrentLayoutFille() { - final JInternalFrame currentInternalFrame = getCurrentInternalFrame(); - return currentInternalFrame instanceof TrPostLayoutFille ? (TrPostLayoutFille) currentInternalFrame : null; - } - /** - * @return la fenetre layout active ou la premiere des LayoutFille de cette application - */ - public TrPostLayoutFille getCurrentLayoutFilleOrFirst() { - TrPostLayoutFille current = getCurrentLayoutFille(); - if (current == null) { - final List<TrPostLayoutFille> allLayoutFille = getAllLayoutFille(); - if (!allLayoutFille.isEmpty()) current = allLayoutFille.get(0); - } - return current; - } + } - @Override - public void init() { - super.init(); - final BuMenu menu = (BuMenu) getMainMenuBar().getMenu("IMPORTER"); - menu.addMenuItem(TrResource.getS("Autres r\xE9sultats"), getImportResultsAct()); - } + } - String getImportResultsAct() { - return "IMPORT_RESULTS"; - } + /** + * @return la fenetre layout active. + */ + public TrPostLayoutFille getCurrentLayoutFille() { + final JInternalFrame currentInternalFrame = getCurrentInternalFrame(); + return currentInternalFrame instanceof TrPostLayoutFille ? (TrPostLayoutFille) currentInternalFrame : null; + } - @Override - public void close() { - if (c_ != null) { - c_.close(); - } - removeInternalFrames(getAllInternalFrames()); - } + /** + * @return la fenetre layout active ou la premiere des LayoutFille de cette application + */ + public TrPostLayoutFille getCurrentLayoutFilleOrFirst() { + TrPostLayoutFille current = getCurrentLayoutFille(); + if (current == null) { + final List<TrPostLayoutFille> allLayoutFille = getAllLayoutFille(); + if (!allLayoutFille.isEmpty()) current = allLayoutFille.get(0); + } + return current; + } - public void setProjet(final TrPostProjet _c) { - if (c_ == _c) { return; } - new CtuluTaskOperationGUI(null, CtuluLibString.EMPTY_STRING) { + @Override + public void init() { + super.init(); + final BuMenu menu = (BuMenu) getMainMenuBar().getMenu("IMPORTER"); + menu.addMenuItem(TrResource.getS("Autres r\xE9sultats"), getImportResultsAct()); + } - @Override - public void act() { - saveAndCloseProjet(createProgressionInterface(this)); - c_ = _c; - if (c_ != null) { - c_.active(TrPostCommonImplementation.this); - BuLib.invokeNowOrLater(new Runnable() { - public void run() { - setEnabledForAction("ENREGISTRER", true); - setEnabledForAction("ENREGISTRERSOUS", true); - setEnabledForAction("IMPORTER", true); - setEnabledForAction(getImportResultsAct(), true); - setEnabledForAction("IMPORT_PROJECT", true); - } - }); - } - } - }.start(); + String getImportResultsAct() { + return "IMPORT_RESULTS"; + } - } + @Override + public void close() { + if (c_ != null) { + c_.close(); + } + removeInternalFrames(getAllInternalFrames()); + } - public boolean saveAndCloseProjet(final ProgressionInterface _interface) { - if (c_ != null) { - - // -- enregistrement sauce widget --// - final int i = CtuluLibDialog.confirmExitIfProjectisModified(getFrame()); - if (i == JOptionPane.CANCEL_OPTION) { - return false; - } - if (i != JOptionPane.NO_OPTION) { - c_.getManager().saveProject(false); - //c_.save(this, _interface); - } - - c_.close(); - c_ = null; - SwingUtilities.invokeLater(new Runnable() { + public void setProjet(final TrPostProjet _c) { + if (c_ == _c) { return; } + new CtuluTaskOperationGUI(null, CtuluLibString.EMPTY_STRING) { - public void run() { + @Override + public void act() { + saveAndCloseProjet(createProgressionInterface(this)); + c_ = _c; + if (c_ != null) { + c_.active(TrPostCommonImplementation.this); + BuLib.invokeNowOrLater(new Runnable() { + public void run() { + setEnabledForAction("CREER", true); + setEnabledForAction("ENREGISTRER", true); + setEnabledForAction("ENREGISTRERSOUS", true); + setEnabledForAction("IMPORTER", true); + setEnabledForAction(getImportResultsAct(), true); + setEnabledForAction("IMPORT_PROJECT", true); + } + }); + } + } + }.start(); - setEnabledForAction("ENREGISTRER", false); - setEnabledForAction("IMPORTER", false); - setEnabledForAction(getImportResultsAct(), false); - setEnabledForAction("IMPORT_PROJECT", false); - } - }); - } - - - - return true; - } + } - @Override - public boolean confirmExit() { - final boolean b = super.confirmExit(); - if (b && c_ != null && !saveAndCloseProjet(null)) { return false; } - return b; - } + public boolean saveAndCloseProjet(final ProgressionInterface _interface) { + if (c_ != null) { - @Override - public void actionPerformed(final ActionEvent _evt) { - final String com = _evt.getActionCommand(); + // -- enregistrement sauce widget --// + final int i = CtuluLibDialog.confirmExitIfProjectisModified(getFrame()); + if (i == JOptionPane.CANCEL_OPTION) { + return false; + } + if (i != JOptionPane.NO_OPTION) { + c_.getManager().saveProject(false); + //c_.save(this, _interface); + } - if ("OUVRIR".equals(com)) { - // -- ouverture d un nouveau projet --// - final int reponse = JOptionPane - .showConfirmDialog( - this.getParentComponent(), - TrResource - .getS("Voulez vous fermer le projet courant?\n Cliquez non si vous voulez ajouter le nouveau projet au projet existant.")); - if (reponse == JOptionPane.CANCEL_OPTION) { return; } - if (reponse == JOptionPane.OK_OPTION) { - c_.getManager().clearProject(); - } - c_.getManager().loadProject(false, null); + c_.close(); + c_ = null; + SwingUtilities.invokeLater(new Runnable() { - } else + public void run() { + setEnabledForAction("CREER", true); + setEnabledForAction("ENREGISTRER", false); + setEnabledForAction("IMPORTER", false); + setEnabledForAction(getImportResultsAct(), false); + setEnabledForAction("IMPORT_PROJECT", false); + } + }); + } - if ("FERMER".equals(com)) { - new CtuluTaskOperationGUI(this, TrResource.getS("Fermer")) { - @Override - public void act() { - saveAndCloseProjet(createProgressionInterface(this)); - } - }.start(); - } else if ("ENREGISTRER".equals(com) && c_ != null) { - new CtuluTaskOperationGUI(this, TrResource.getS("Enregistrement")) { - @Override - public void act() { - // c_.save(TrPostCommonImplementation.this, createProgressionInterface(this)); + return true; + } - // -- enregistrement sauce widget --// - c_.getManager().saveProject(false); + @Override + public boolean confirmExit() { + final boolean b = super.confirmExit(); + if (b && c_ != null && !saveAndCloseProjet(null)) { return false; } + return b; + } - } - }.start(); - } else if ("ENREGISTRERSOUS".equals(com) && c_ != null) { - new CtuluTaskOperationGUI(this, TrResource.getS("Enregistrement Sous")) { + @Override + public void actionPerformed(final ActionEvent _evt) { + final String com = _evt.getActionCommand(); - @Override - public void act() { - // c_.save(TrPostCommonImplementation.this, createProgressionInterface(this)); + if ("CREER".equals(com)) { + final int reponse = JOptionPane.showConfirmDialog(this.getParentComponent(),TrResource.getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); + if (reponse == JOptionPane.CANCEL_OPTION) { return; } + if (reponse == JOptionPane.OK_OPTION) { + c_.getManager().saveProject(false); + } + //-- nettoyage du projet pr\xE9c\xE9dent --// + c_.getManager().clearProject(); - // -- enregistrement sauce widget --// - c_.getManager().saveProject(true); + //-- ouverture d'un fichier r\xE9sultat qui sera automatiquement ajout\xE9 dans la layout courante --// + c_.createNewLayoutFrame(); + //-- ouverture d'un fichier r\xE9sultat --// + TrPostActionChooseAndCreateCalque chooserSource= new TrPostActionChooseAndCreateCalque(c_,c_.getImpl().getCurrentLayoutFille().controller_); + chooserSource.actionPerformed(null); - } - }.start(); - } - // else if (getImportResultsAct().equals(com) && c_ != null) { - // c_.importerVars(); - // } - else { - super.actionPerformed(_evt); - } - } - @Override - protected void ouvrir() { - cmdOuvrirFile(super.ouvrirFileChooser(TrResource.getS("Fichier post"), null)); - } + }else + if ("OUVRIR".equals(com)) { + // -- ouverture d un nouveau projet --// - @Override - public String getHelpDir() { - return getInformationsSoftware().man + "post/"; - } - /** - * Methode appelee pour creer un projet .POST - * - * @param _f - */ - public void cmdOuvrirLayoutFile(final File _f) { - if (c_ == null) { - // setProjet(new TrPostProjet(TrPostCommonImplementation.this)); - c_ = new TrPostProjet(TrPostCommonImplementation.this); - c_.active(TrPostCommonImplementation.this); - BuLib.invokeNowOrLater(new Runnable() { - public void run() { - setEnabledForAction("ENREGISTRER", true); - setEnabledForAction("ENREGISTRERSOUS", true); - setEnabledForAction("IMPORTER", true); - setEnabledForAction(getImportResultsAct(), true); - setEnabledForAction("IMPORT_PROJECT", true); - } - }); - } - BuLib.invokeLater(new Runnable() { - public void run() { - c_.getManager().loadProject(true, _f); - } - }); + final int reponse = JOptionPane.showConfirmDialog(this.getParentComponent(),TrResource.getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); + if (reponse == JOptionPane.CANCEL_OPTION) { return; } + if (reponse == JOptionPane.OK_OPTION) { + c_.getManager().saveProject(false); + } - } + //-- nettoyage du projet pr\xE9c\xE9dent --// + c_.getManager().clearProject(); - @Override - public void cmdOuvrirFile(final File _f) { - final TrPostCommonImplementation alreadyOpen = getLauncher().findPostWithOpenedFile(_f); - if (alreadyOpen == null) { - TrPostMultiSourceActivator.activeFile(_f, this); - } else { - error(TrLib.getMessageAlreadyOpen(_f)); - alreadyOpen.getFrame().toFront(); - } - } + c_.getManager().loadProject(false, null); + //new TrPostFusionProjet(c_); + + } else + + if ("FERMER".equals(com)) { + new CtuluTaskOperationGUI(this, TrResource.getS("Fermer")) { + + @Override + public void act() { + saveAndCloseProjet(createProgressionInterface(this)); + } + }.start(); + } else if ("ENREGISTRER".equals(com) && c_ != null) { + new CtuluTaskOperationGUI(this, TrResource.getS("Enregistrement")) { + + @Override + public void act() { + // c_.save(TrPostCommonImplementation.this, createProgressionInterface(this)); + + // -- enregistrement sauce widget --// + c_.getManager().saveProject(false); + + } + }.start(); + } else if ("ENREGISTRERSOUS".equals(com) && c_ != null) { + new CtuluTaskOperationGUI(this, TrResource.getS("Enregistrement Sous")) { + + @Override + public void act() { + // c_.save(TrPostCommonImplementation.this, createProgressionInterface(this)); + + // -- enregistrement sauce widget --// + c_.getManager().saveProject(true); + + } + }.start(); + } + + // else if (getImportResultsAct().equals(com) && c_ != null) { + // c_.importerVars(); + // } + else { + super.actionPerformed(_evt); + } + } + + @Override + protected void ouvrir() { + cmdOuvrirFile(super.ouvrirFileChooser(TrResource.getS("Fichier post"), null)); + } + + @Override + public String getHelpDir() { + return getInformationsSoftware().man + "post/"; + } + + /** + * Methode appelee pour creer un projet .POST + * + * @param _f + */ + public void cmdOuvrirLayoutFile(final File _f) { + if (c_ == null) { + // setProjet(new TrPostProjet(TrPostCommonImplementation.this)); + c_ = new TrPostProjet(TrPostCommonImplementation.this); + c_.active(TrPostCommonImplementation.this); + BuLib.invokeNowOrLater(new Runnable() { + public void run() { + setEnabledForAction("ENREGISTRER", true); + setEnabledForAction("ENREGISTRERSOUS", true); + setEnabledForAction("IMPORTER", true); + setEnabledForAction(getImportResultsAct(), true); + setEnabledForAction("IMPORT_PROJECT", true); + } + }); + } + BuLib.invokeLater(new Runnable() { + public void run() { + c_.getManager().loadProject(true, _f); + } + }); + + } + + @Override + public void cmdOuvrirFile(final File _f) { + final TrPostCommonImplementation alreadyOpen = getLauncher().findPostWithOpenedFile(_f); + if (alreadyOpen == null) { + TrPostMultiSourceActivator.activeFile(_f, this); + } else { + error(TrLib.getMessageAlreadyOpen(_f)); + alreadyOpen.getFrame().toFront(); + } + } + } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFusionProjet.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFusionProjet.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFusionProjet.java 2009-01-05 19:02:06 UTC (rev 4323) @@ -0,0 +1,176 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.ListSelectionModel; + +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.actions.TrPostActionChooseAndCreateCalque; + +import com.memoire.bu.BuCommonInterface; +import com.memoire.bu.BuDialog; +import com.memoire.bu.BuDialogMessage; +import com.memoire.bu.BuInformationsSoftware; +import com.memoire.bu.BuScrollPane; + +/** + * Classe qui gere le panel de configuration de fusion du projet actuel avec un nouveau projet. + * CLASSE NON UTILISEE + * @author Adrien Hadoux + * + */ +public class TrPostFusionProjet extends BuDialogMessage{ + + TrPostProjet projet_; + + public TrPostFusionProjet(TrPostProjet _projet) { + super(_projet.impl_.getApp(), _projet.impl_.getInformationsSoftware(), TrResource + .getS("Ouvrir un projet")); + // TODO Auto-generated constructor stub + projet_=_projet; + content_ = constructPanelOuvrir(); + setContentPane(content_); + setSize(550, 250); + setModal(true); + setTitle(TrResource.getS("Ouvrir un projet")); + // setLocation(widgetGraphe_.getLocation()); + activate(); + + } + + //-- true si le projet a charger est de type post --// + boolean typePost_=true; + + //-- indique si l'on conserve le precedent projet --// + boolean conservPreviousProject_=false; + + + /** + * Construit le panel d'ouverture du projet + * @return + */ + JComponent constructPanelOuvrir() { + + + final JLabel labelPost=new JLabel(""); + final JLabel labelSource=new JLabel(""); + + final JPanel content = new JPanel(new BorderLayout()); + // content.add(new JLabel(TrResource.getS("Ouvrir un projet")), BorderLayout.NORTH); + JPanel container=new JPanel(new GridLayout(2,1)); + content.add(container,BorderLayout.CENTER); + + //-- panel choix ouverture projet --// + final JPanel content1 = new JPanel(new GridLayout(2,1)); + content1.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Type de projet"))); + + ButtonGroup group = new ButtonGroup(); + JRadioButton postButton = new JRadioButton(TrResource.getS("Projet POST")); + postButton.setSelected(true); + postButton.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + typePost_=true; + } }); + JRadioButton sourceButton = new JRadioButton(TrResource.getS("Fichier r\xE9sultat")); + sourceButton.setSelected(false); + sourceButton.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + typePost_=false; + } }); + group.add(postButton); + group.add(sourceButton); + + + JPanel ligne1=new JPanel(new FlowLayout(FlowLayout.LEFT)); + ligne1.add(postButton); + ligne1.add(labelPost); + + JPanel ligne2=new JPanel(new FlowLayout(FlowLayout.LEFT)); + ligne2.add(sourceButton); + ligne2.add(labelSource); + content1.add(ligne1); + content1.add(ligne2); + + + final JPanel content2 =new JPanel(new GridLayout(3,1)); + content2.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Propri\xE9t\xE9s"))); + + final JCheckBox conservPrevious=new JCheckBox(TrResource.getS("Conserver le projet pr\xE9c\xE8dent ?")); + conservPrevious.setSelected(conservPreviousProject_); + conservPrevious.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + if(conservPrevious.isSelected()) + conservPreviousProject_=true; + else + conservPreviousProject_=false; + } }); + content2.add(conservPrevious); + content2.add(new JLabel(TrResource.getS("Dans le cas d'une ouverture d'un fichier r\xE9sultat, le nom du projet sera demand\xE9 \xE0 la sauvegarde."))); + content2.add(new JLabel(TrResource.getS("Dans le cas d'une ouverture d'un fichier POST, le pr\xE9c\xE9dent projet sera sauv\xE9 avec celui-ci \xE0 la sauvegarde."))); + + + container.add(content1); + container.add(content2); + + + + final JButton valide = new JButton(TrResource.getS("Valider"), EbliResource.EBLI + .getIcon("crystal_valider")); + valide.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + dispose(); + //-- realisation des operations --// + if(!conservPreviousProject_) + projet_.getManager().clearProject(); + if(typePost_){ + projet_.getManager().loadProject(false, null); + }else{ + + //-- verification qu'il existe une fenetre layout dispo sinon creation --// + if(projet_.getImpl().getCurrentLayoutFille()==null){ + projet_.createNewLayoutFrame(); + } + //-- ouverture d'un fichier r\xE9sultat --// + TrPostActionChooseAndCreateCalque chooserSource= new TrPostActionChooseAndCreateCalque(projet_,projet_.getImpl().getCurrentLayoutFille().controller_); + chooserSource.actionPerformed(null); + + + + } + + } }); + + final JButton annule = new JButton(TrResource.getS("Annuler"), EbliResource.EBLI + .getIcon("crystal_annuler")); + annule.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + //--annulation --// + dispose(); + } + + }); + final JPanel operations = new JPanel(new FlowLayout(FlowLayout.CENTER)); + operations.add(valide); + operations.add(annule); + content.add(operations, BorderLayout.SOUTH); + + return content; + } + + + + +} 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 2009-01-05 15:46:50 UTC (rev 4322) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2009-01-05 19:02:06 UTC (rev 4323) @@ -25,6 +25,7 @@ import javax.swing.JInternalFrame; import javax.swing.JMenu; +import javax.swing.JOptionPane; import javax.swing.JTable; import javax.swing.WindowConstants; import javax.swing.event.InternalFrameEvent; @@ -666,7 +667,24 @@ } }); + getMenuPost().addMenuItem(TrResource.getS(("Fusionner avec un autre projet POST")), "FUSIONPOST", + CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + + final int reponse = JOptionPane.showConfirmDialog(getImpl().getParentComponent(),TrResource.getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); + if (reponse == JOptionPane.CANCEL_OPTION) { return; } + if (reponse == JOptionPane.OK_OPTION) { + getManager().saveProject(false); + } + + getManager().loadProject(false, null); + //-- on reinitialise le nom path du projet a null pour qu'il soit redemand\xE9 lors de la nouvelle sauvegarde --// + getManager().setProjet_(null); + + } + }); + 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")); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionOpenSrc.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionOpenSrc.java 2009-01-05 15:46:50 UTC (rev 4322) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionOpenSrc.java 2009-01-05 19:02:06 UTC (rev 4323) @@ -2,9 +2,13 @@ import java.awt.event.ActionEvent; import java.io.File; +import java.util.ArrayList; import java.util.Iterator; +import java.util.List; +import org.fudaa.ctulu.fileformat.FileFormat; import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.fudaa.tr.common.TrFileFormatManager; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.fudaa.fudaa.tr.post.TrPostMultiSourceActivator; @@ -49,11 +53,19 @@ // --chargement du fichier source correspondant et ajout dans le projet // --// - final File fichierAbsolu = projet_.getImpl().ouvrirFileChooser(TrResource.getS("Fichier post"), null); + List<String> extensions=new ArrayList<String>(); + + FileFormat[] listeFormats= TrFileFormatManager.getAllGridFormat(); + + for(int i=0;i<listeFormats.length;i++) + for(int j=0;j<listeFormats[i].getExtensions().length;j++) + extensions.add(listeFormats[i].getExtensions()[j]); + + final File fichierAbsolu = projet_.getImpl().ouvrirFileChooser(TrResource.getS("S\xE9lectionnez le Fichier r\xE9sultat"), extensions.toArray(new String[extensions.size()])); // -- verification que le fichier n est pas deja ouvert --// if (projet_.isSourceLoaded(fichierAbsolu.getAbsolutePath())) { - projet_.getImpl().warn(TrLib.getString("Solution d\xE9j\xE0 charg\xE9e"), + projet_.getImpl().warn(TrLib.getString("Fichier r\xE9sultat d\xE9j\xE0 charg\xE9 dans le projet"), TrLib.getString("Le fichier source existe d\xE9j\xE0 et ne peut \xEAtre ajout\xE9 au projet.")); return; } 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-05 15:46:50 UTC (rev 4322) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2009-01-05 19:02:06 UTC (rev 4323) @@ -116,9 +116,17 @@ ProgressionInterface prog_; File projet_; - TrPostCommonImplementation ui_; + public File getProjet_() { + return projet_; +} +public void setProjet_(File projet_) { + this.projet_ = projet_; +} +TrPostCommonImplementation ui_; + + TrPostPersistanceErrorManager managerError=new TrPostPersistanceErrorManager(); @@ -629,6 +637,11 @@ if (trprojet_.isSourceLoaded(path)) { 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 !!! --// + //-- mise a jour de l'ID necessaire afin de charger correctement la suite --// + trprojet_.findSource(path).setId(listeCouplesIdSources.get(i).IdSource); + } else { // -- tentative de chargement du source dans le multi-projet --// multiProjectActivator.active(f, trprojet_.impl_,listeCouplesIdSources.get(i).IdSource); @@ -642,6 +655,10 @@ if (trprojet_.isSourceLoaded(path)) { 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 !!! --// + //-- mise a jour de l'ID necessaire afin de charger correctement la suite --// + trprojet_.findSource(path).setId(listeCouplesIdSources.get(i).IdSource); } else { // -- tentative de chargement du source dans le multi-projet --// multiProjectActivator.active(f, trprojet_.impl_, listeCouplesIdSources.get(i).IdSource); @@ -744,6 +761,9 @@ for (final JInternalFrame frame : trprojet_.getImpl().getAllInternalFrames()) { frame.dispose(); } + + //-- retire le nom de fichier du precedent projet POST --// + projet_=null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <de...@us...> - 2009-01-14 05:01:02
|
Revision: 4354 http://fudaa.svn.sourceforge.net/fudaa/?rev=4354&view=rev Author: deniger Date: 2009-01-14 05:00:56 +0000 (Wed, 14 Jan 2009) Log Message: ----------- merge trunk Property Changed: ---------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrIsoLineAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostCourbeAddPointsAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostProfileAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostVolumeAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreated.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedConstant.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedCstTime.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedCstTimeSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedExpr.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedFroud.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedImport.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedMoins.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedNorm.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedNorme3D.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPlus.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarVitesse.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatistic.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatisticSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationActions.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCommonPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCstPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditExprPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditStatisticPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataInfoDoc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataListener.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataMinMaxGlobalItem.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataUserVarModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataVecteur.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostExtremVisitor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostTrajectoireTaskModel.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/TrPostWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrIsoLineAction.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrIsoLineAction.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostCourbeAddPointsAction.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostCourbeAddPointsAction.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostProfileAction.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostProfileAction.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostVolumeAction.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostVolumeAction.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreated.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreated.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedConstant.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedConstant.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedCstTime.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedCstTime.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedCstTimeSaver.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedCstTimeSaver.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedDefault.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedDefault.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedExpr.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedExpr.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedFroud.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedFroud.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedImport.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedImport.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedMoins.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedMoins.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedNorm.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedNorm.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedNorme3D.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedNorme3D.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPlus.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPlus.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarVitesse.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarVitesse.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedSaver.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedSaver.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatistic.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatistic.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatisticSaver.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatisticSaver.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationActions.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationActions.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationFille.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationFille.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCommonPanel.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCommonPanel.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCstPanel.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCstPanel.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditExprPanel.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditExprPanel.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditStatisticPanel.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditStatisticPanel.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataInfoDoc.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataInfoDoc.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataListener.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataListener.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataMinMaxGlobalItem.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataMinMaxGlobalItem.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataUserVarModel.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataUserVarModel.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataVecteur.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataVecteur.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostExtremVisitor.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostExtremVisitor.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostTrajectoireTaskModel.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostTrajectoireTaskModel.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardImportScope.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardImportScope.java:1912-4350 Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java ___________________________________________________________________ Modified: svn:mergeinfo - + /trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java:1912-4350 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:25:23
|
Revision: 4373 http://fudaa.svn.sourceforge.net/fudaa/?rev=4373&view=rev Author: hadouxad Date: 2009-01-16 08:25:14 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- 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/TrPostProjet.java 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 2009-01-16 08:23:33 UTC (rev 4372) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java 2009-01-16 08:25:14 UTC (rev 4373) @@ -35,6 +35,14 @@ y_ = _y; precision_ = _prec; } + + public TrPostInterpolatePoint(TrPostInterpolatePoint duplique) { + super(); + idxElt_ = duplique.idxElt_; + x_ = duplique.x_; + y_ = duplique.y_; + precision_ = duplique.precision_; + } protected double getInterpolateValue(final H2dVariableType _var, final int _tIdx, final TrPostSource _src) { try { 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 2009-01-16 08:23:33 UTC (rev 4372) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2009-01-16 08:25:14 UTC (rev 4373) @@ -104,8 +104,8 @@ public class TrPostProjet implements ActionListener { - public final static boolean AMELIO_LOT_VISIBLE=true; + /** * Manager de sauvegarder/charghement des donn\xE9es */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-02-09 18:36:53
|
Revision: 4449 http://fudaa.svn.sourceforge.net/fudaa/?rev=4449&view=rev Author: hadouxad Date: 2009-02-09 18:36:49 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Correction + connecteurs fleches Modified Paths: -------------- 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/TrReplayCurvesData.java 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 2009-02-09 18:36:13 UTC (rev 4448) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2009-02-09 18:36:49 UTC (rev 4449) @@ -52,6 +52,7 @@ import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorLegende; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorArrowEditor; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorConnectionWidget; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorTextLabel; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorCircle; @@ -332,7 +333,9 @@ // nodeFleche.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorFlecheSimple())); nodeFleche.setCreator(new EbliWidgetCreatorArrowEditor(new EbliEditorArrow())); - + // nodeFleche.setCreator(new EbliWidgetCreatorConnectionWidget()); + + nodeFleche.setPreferedSize(new Dimension(200, 150)); nodeFleche.setPreferedLocation(new Point(350, 125)); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-02-09 18:36:13 UTC (rev 4448) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-02-09 18:36:49 UTC (rev 4449) @@ -255,7 +255,7 @@ */ private TrReplayDialog constructDialog(final TrPostVisuPanel vue2d, final TrPostCommonImplementation implementation,final EGModel modele,JComponent composantAdditionnel,boolean modeEdition,String title){ implementation.createTask(TrResource.getS("Origine ")+" "+modele.getTitle()); - final TrReplayDialog pn = new TrReplayDialog(false); + final TrReplayDialog pn = new TrReplayDialog(false,implementation.getParentComponent()); pn.setLayout(new BuBorderLayout()); pn.setBorder(BuBorders.EMPTY3333); //pn.add(new BuLabel(CtuluLib.getS("S\xE9lectionner le fichier r\xE9sultat")), BuBorderLayout.NORTH); @@ -315,7 +315,7 @@ //panelEAST.add(compEast,BorderLayout.CENTER); // panelEAST.setTopComponent(dialog); // panelEAST.setBottomComponent(compEast); - panelEAST.addTab("Rechercher", dialog); + panelEAST.addTab("Rechercher", new JScrollPane(dialog)); panelEAST.addTab("Infos Points, Variables", compEast); //pn.add(dialog,BorderLayout.WEST); pn.add(panelEAST,BuBorderLayout.EAST); @@ -350,8 +350,9 @@ panelSouth2.add(genereVue2d.buildButton(EbliComponentFactory.INSTANCE)); } - - + //pn.setSize(new Dimension(800,600)); +// if(pn.dialog_!=null) +// pn.dialog_.pack(); return pn; @@ -500,12 +501,14 @@ class TrReplayDialog extends CtuluDialogPanel{ CtuluDialog dialog_; - TrReplayDialog(boolean b){ + TrReplayDialog(boolean b,final Component _parent){ super(b); + dialog_= createDialog(_parent); } public int afficheModale(final Component _parent, final String _t, final int _option) { - dialog_= createDialog(_parent); + if(dialog_==null) + dialog_= createDialog(_parent); dialog_.setModal(false); dialog_.setInitParent(_parent); dialog_.setOption(_option); @@ -607,10 +610,10 @@ String title=TrResource.getS("<html><body>Choisir le point et la variable qui seront utilis\xE9s pour refaire le calcul(interpolation possible).<br /> Le point rouge d\xE9signe le point d'origine.</body></html>"); dialog_=constructDialog(vue2d, implementation, modele,/*constructSelectorVariable(vars)*/null,true,title); - dialog_.setPreferredSize(new Dimension(600,400)); + dialog_.setPreferredSize(new Dimension(800,600)); //-- on restaure la vue --// - vue2d.setSize(300, 300); + //vue2d.setSize(300, 300); vue2d.restaurer(); //-- on positionne la bonne variable et le bon pas de temps --// @@ -619,10 +622,13 @@ //-- on cr\xE9e le bouton de rejoue de donn\xE9es pour un autre fichier r\xE9sultat --// - + boolean restaurationInitiale=true; //-- on affiche tant que l'utilisateur valide des r\xE9sultats faux --// while(CtuluDialogPanel.isOkResponse(dialog_.afficheModale(implementation.getParentComponent(), TrResource.getS("Rejouer ")+" "+modele.getTitle())) && !replayEvolutionFor(srcChoisie,vue2d,treeModel,modele,implementation)){ - + if(restaurationInitiale){ + restaurationInitiale=false; + vue2d.restaurer(); + } } @@ -801,7 +807,7 @@ //-- on rappelle l'interface --// getProfilSpatialReplayData(newSrc, treeModel, modele, implementation); - + return; } else return; @@ -810,10 +816,10 @@ }); dialog_=constructDialog(vue2d, implementation, modele,/*constructSelectorVariable(vars)*/null,true,title); - dialog_.setPreferredSize(new Dimension(600,400)); + dialog_.setPreferredSize(new Dimension(800,600)); //-- on restaure la vue --// - vue2d.setSize(300, 300); + //vue2d.setSize(300, 300); vue2d.restaurer(); @@ -826,10 +832,14 @@ //final FSigLayerLineEditable cq4 = new FSigLayerLineEditable(new ZModeleLigneBriseeEditable(), vue2d.getGisEditor()); // cq4.setTitle("toto"); //vue2d.addCalque(cq4, true); - + boolean restaurationInitiale=true; //-- on affiche tant que l'utilisateur valide des r\xE9sultats faux --// while(CtuluDialogPanel.isOkResponse(dialog_.afficheModale(implementation.getParentComponent(), TrResource.getS("Rejouer ")+" "+modele.getTitle())) && !replayProfilSpatialFor(srcChoisie,vue2d,treeModel,modele,implementation)){ + if(restaurationInitiale){ + restaurationInitiale=false; + vue2d.restaurer(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |