From: <had...@us...> - 2009-01-16 18:56:27
|
Revision: 4379 http://fudaa.svn.sourceforge.net/fudaa/?rev=4379&view=rev Author: hadouxad Date: 2009-01-16 18:56:21 +0000 (Fri, 16 Jan 2009) Log Message: ----------- post Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGSpecificActions.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableGraphePanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 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/TrPostCourbeModel.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/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGActionAfficheOrigineCourbe.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -955,7 +955,7 @@ return (BCalqueLegende) getCqInfos().getCalqueParNom("cqLegende"); } - protected void removeCalqueLegend() { + public void removeCalqueLegend() { if (getCqLegend() != null) getCqInfos().remove(getCqLegend()); // getCqLegend().setVisible(false); } Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGActionAfficheOrigineCourbe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGActionAfficheOrigineCourbe.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGActionAfficheOrigineCourbe.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -0,0 +1,69 @@ +package org.fudaa.ebli.courbe; + +import java.awt.event.ActionEvent; +import java.util.HashMap; + +import javax.swing.Icon; + +import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.ressource.EbliResource; + +/** + * Action qui utilise les methodes viewGenerationSource() des modeles de courbes. + * Permet pour les modeles qui surcharge la methode d'afficher dans l'implementation fudaa voulue l'origine de la cr\xE9ation de la courbe. + * @author Adrien Hadoux + * + */ +public class EGActionAfficheOrigineCourbe extends EbliActionSimple{ + + /** + * Action utilis\xE9e uniquement pour les courbes unitaires (accessible via clic droit sur la courbe). + * @author genesis + * + */ + public static class CourbeOnly extends EGActionAfficheOrigineCourbe{ + EGModel model_; + public CourbeOnly(EGModel model,CtuluUI _impl){ + super(); + model_=model; + impl_=_impl; + } + public void actionPerformed(ActionEvent _e) { + if(model_!=null) + model_.viewGenerationSource(new HashMap(),impl_); + } + } + + EGFillePanel panelGraphe_; + CtuluUI impl_; + public EGActionAfficheOrigineCourbe(EGFillePanel _panel,CtuluUI _impl) { + this(); + panelGraphe_=_panel; + impl_=_impl; + } + public EGActionAfficheOrigineCourbe() { + super(EbliResource.EBLI.getString("Origine"),CtuluResource.CTULU.getIcon("crystal_visibilite"), "ORIGINE"); + } + @Override + public void actionPerformed(ActionEvent _e) { + + if(panelGraphe_.getGraphe().getSelectedComponent()==null || !(panelGraphe_.getGraphe().getSelectedComponent() instanceof EGCourbe)){ + impl_.error(EbliResource.EBLI.getString("Aucune courbe s\xE9lectionn\xE9e"),EbliResource.EBLI.getString("Aucune courbe s\xE9lectionn\xE9e"),true); + return; + }else if(panelGraphe_.getGraphe().getSelectedComponent().getModel()==null || !(panelGraphe_.getGraphe().getSelectedComponent().getModel() instanceof EGModel)){ + impl_.error(EbliResource.EBLI.getString("Aucune courbe s\xE9lectionn\xE9e"),EbliResource.EBLI.getString("Aucune courbe s\xE9lectionn\xE9e"),true); + return; + } + + //-- on recupere la courbe selectionnee dans le graphe --// + + EGModel modelSelectionne=panelGraphe_.getGraphe().getSelectedComponent().getModel(); + + modelSelectionne.viewGenerationSource(new HashMap(),impl_); + + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -13,6 +13,7 @@ import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; /** @@ -221,6 +222,10 @@ return duplic; } + public void viewGenerationSource(Map infos, CtuluUI impl){ + + } + public Object getPersistSpecificDatas() { return null; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -15,6 +15,8 @@ import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ebli.commun.EbliActionInterface; +import java.util.List; + /** * @author Fred Deniger * @version $Id: EGGrapheModel.java,v 1.8 2007-02-01 16:12:04 deniger Exp $ @@ -177,5 +179,14 @@ */ public void setSpecificPersitDatas(Object sepcPersitData,Map Params); + + /** + * Methode qui retournes les actions sp\xE9cifiques AUX COURBES d'un graphe en fonction de son treemodel. + * Ces actions seront situ\xE9es dans le menu popup de la courbe (ie via clic droit sur la courbe dans l'arbre des courbes). + * Par exemple dans tr, le TrPostCourbeTreeModel retourne des actions d'ajout de variables pour les \xE9volutions temporelles. + * @return + */ + public List<EbliActionInterface> getSpecificsActionsCurvesOnly(EGGraphe _target); + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -284,6 +284,9 @@ in.close(); + + //-- on finalise les actions d'un graphe --// + model.finalizePersistance(); //-- Etape finale: creation du graphe --// graphe=new EGGraphe(model); graphe.transformer_.setXAxe(axeX); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -810,4 +810,10 @@ } + +public List<EbliActionInterface> getSpecificsActionsCurvesOnly(EGGraphe _target) { + // TODO Auto-generated method stub + return null; +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -1132,4 +1132,18 @@ } + +public List<EbliActionInterface> getSpecificsActionsCurvesOnly(EGGraphe _target) { + // TODO Auto-generated method stub + return null; +} + + +/** + * Methode qui est appelee apres avoir charg\xE9 un model de graphe persistant. Doit etre surcharg\xE9 a plus haut niveau pour effectuer des actions de finalisation specifiques. + */ +public void finalizePersistance(){ + +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -162,6 +162,10 @@ return Collections.enumeration(comp_); } + public List getChildren() { + return comp_; + } + public boolean contains(final EGCourbe _i) { return comp_.contains(_i); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -11,6 +11,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.collection.CourbeInterface; import org.fudaa.ebli.palette.BPaletteInfo; @@ -191,11 +192,24 @@ */ EGModel duplicate(); + /** - * @return + * Methode qui une fois appel\xE9e se charge de creer un module ou interface qui affiche l'origine de la cr\xE9ation de la courbe. + * @param infos + * @param CtuluUI: l'implementation dans laquelle afficher les informations */ + void viewGenerationSource(Map infos, CtuluUI impl); + + /** + * retourner les infos persistantes de la courbe du mod\xE8le. + */ Object getPersistSpecificDatas(); + /** + *recuperer les infos persistantes de la courbe qui vont permettre de recr\xE9er le mod\xE8le. + * @param data + * @param infos + */ void setPersistSpecificDatas(Object data, Map infos); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGSpecificActions.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGSpecificActions.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGSpecificActions.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -16,8 +16,10 @@ import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.ctulu.gui.CtuluPopupMenu; +import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.ressource.EbliResource; @@ -50,6 +52,13 @@ target_ = _target; } + + CtuluUI ui_; + public EGSpecificActions(final EGGraphe _target,CtuluUI _ui) { + this(_target); + ui_=_ui; + } + private static String getActLast() { return "DERNIER"; } @@ -124,13 +133,21 @@ else menu_.addMenuItem(EbliResource.EBLI.getString("Courbe classique"), "NUAGE_POINTS", BuResource.BU .getIcon("crystal_oscilloscope"), true, this); + + //-- action origine de la courbe. --// + menu_.add(new EGActionAfficheOrigineCourbe.CourbeOnly(courbe.getModel(),ui_)); + + if(target_.getModel().getSpecificsActionsCurvesOnly(target_)!=null) + for(EbliActionInterface action:target_.getModel().getSpecificsActionsCurvesOnly(target_)) + menu_.add(action); + } } - + if(_evt!=null) menu_.show(_evt.getComponent(), _evt.getX(), _evt.getY()); } @@ -266,4 +283,12 @@ } +public CtuluPopupMenu getMenu() { + if(menu_==null) + buildPopupMenu(null); + return menu_; +} + + + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableGraphePanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableGraphePanel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableGraphePanel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -436,10 +436,15 @@ EvolTable t_; + + public EGTableGraphePanel() { + this(true); + } + boolean afficheNomCourbe_=true; /** * Initialise tous les composants n\xE9cessaires. */ - public EGTableGraphePanel() { + public EGTableGraphePanel(boolean afficheNomCourbe) { setLayout(new BuBorderLayout(5, 1, true, true)); setBorder(BorderFactory.createEmptyBorder(2, 5, 5, 2)); lb_ = new BuLabel(); @@ -447,7 +452,9 @@ lb_.setHorizontalTextPosition(SwingConstants.CENTER); lb_.setVerticalAlignment(SwingConstants.CENTER); lb_.setVerticalTextPosition(SwingConstants.CENTER); - add(lb_, BuBorderLayout.NORTH); + afficheNomCourbe_=afficheNomCourbe; + if(afficheNomCourbe) + add(lb_, BuBorderLayout.NORTH); t_ = new EvolTable() { public TableCellEditor getCellEditor(final int _row, final int _column) { @@ -624,7 +631,8 @@ updateButtons(); final BuPanel north = new BuPanel(); north.setLayout(new BuBorderLayout(2, 2, true, false)); - north.add(lb_, BuBorderLayout.NORTH); + if(afficheNomCourbe_) + north.add(lb_, BuBorderLayout.NORTH); final BuPanel pnBt = new BuPanel(); pnBt.setLayout(new BuButtonLayout(1, SwingConstants.LEFT)); pnBt.add(btAdd_); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -2,6 +2,7 @@ import java.awt.BorderLayout; import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -27,6 +28,7 @@ import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliComponentFactory; +import org.fudaa.ebli.courbe.EGActionAfficheOrigineCourbe; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; @@ -99,7 +101,9 @@ initTitlesOrigins(widgetGraphe_.panelGraphe_.getGraphe().getModel()); - + + + } @Override @@ -475,7 +479,7 @@ return menuGraphe_; } - + /** * Recupere les objets graphique tree et panel infos associe au calque. * @@ -485,19 +489,19 @@ public JComponent getOverviewComponent() { if (panelTreeGraphe_ == null) { - final EGTree tree = new EGTree(); - tree.setActions(new EGSpecificActions(getGraphe())); + final EGTree tree_ = new EGTree(); + tree_.setActions(new EGSpecificActions(getGraphe(),getWidget().getEbliScene().getCtuluUi() )); final EGGrapheTreeModel treeModel = (EGGrapheTreeModel) getGraphe().getModel(); - tree.setModel(treeModel); - tree.setSelectionModel(treeModel.getSelectionModel()); + tree_.setModel(treeModel); + tree_.setSelectionModel(treeModel.getSelectionModel()); - final EGTableGraphePanel tablePanel = new EGTableGraphePanel(); + final EGTableGraphePanel tablePanel = new EGTableGraphePanel(false); tablePanel.setGraphe(getGraphe()); tablePanel.addPanelAction(getGraphePanel()); final JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); - final JScrollPane compTop = new JScrollPane(tree); - compTop.setPreferredSize(new Dimension(150, 400)); + final JScrollPane compTop = new JScrollPane(tree_); + compTop.setPreferredSize(new Dimension(150, 200)); pane.setTopComponent(compTop); //-- panel global qui contient la paletet d'infos + tableau de valeurs --// @@ -505,12 +509,22 @@ final JSplitPane panelBottom = new JSplitPane(JSplitPane.VERTICAL_SPLIT); EGPaletteInfo paletteInfos=new EGPaletteInfo( getGraphePanel()); paletteInfos.setAvailable(true); - // final JScrollPane paletteInfos = new JScrollPane(paEg); - paletteInfos.setPreferredSize(new Dimension(150, 80)); - panelBottom.setTopComponent(paletteInfos); + paletteInfos.setPreferredSize(new Dimension(150, 120)); + //-- ajout des actions origine et replayData pour les graphes--// + BuPanel panelBoutons=new BuPanel(new FlowLayout(FlowLayout.LEFT)); + EGActionAfficheOrigineCourbe origine=new EGActionAfficheOrigineCourbe(getGraphePanel(),getWidget().getEbliScene().getCtuluUi()); + panelBoutons.add(origine.buildButton(EbliComponentFactory.INSTANCE)); + + + BuPanel miseEnPage=new BuPanel(new BorderLayout()); + miseEnPage.add(paletteInfos,BorderLayout.CENTER); + miseEnPage.add(panelBoutons,BorderLayout.SOUTH); + miseEnPage.setPreferredSize(new Dimension(150, 150)); + panelBottom.setTopComponent(miseEnPage); + final JScrollPane comp = new JScrollPane(tablePanel); - comp.setPreferredSize(new Dimension(150, 200)); + comp.setPreferredSize(new Dimension(150, 150)); panelBottom.setBottomComponent(comp); pane.setBottomComponent(panelBottom); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -13,6 +13,7 @@ import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; @@ -176,4 +177,7 @@ public void setPersistSpecificDatas(Object data, Map infos) { } + public void viewGenerationSource(Map infos, CtuluUI impl){ + + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -13,6 +13,7 @@ import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; @@ -219,5 +220,7 @@ public void setPersistSpecificDatas(Object data, Map infos) { } - + public void viewGenerationSource(Map infos, CtuluUI impl){ + + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -5,6 +5,7 @@ import java.util.Map; import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.ebli.courbe.EGModel; @@ -97,5 +98,12 @@ return new ScopeCourbeModel((EvolutionReguliere)this.e_.getCopy(this.e_.getListener())); } - + public void viewGenerationSource(Map infos, CtuluUI impl){ + if(infos_.get(ScopeStructure.NOM_FICHIER)!=null){ + String msg="Cette courbe est issue du fichier "+infos_.get(ScopeStructure.NOM_FICHIER); + impl.message("Origine de la courbe scop", msg, false); + }else{ + impl.message("Origine de la courbe scop", "Impossible de trouver", false); + } + } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -18,6 +18,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.CtuluVariable; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.dodico.ef.EfGridData; @@ -28,9 +29,11 @@ import org.fudaa.ebli.palette.BPaletteInfo.InfoData; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; +import org.fudaa.fudaa.tr.post.TrReplayCurvesData; import org.fudaa.fudaa.tr.post.actions.TrPostProfileAction; import com.vividsolutions.jts.geom.LineString; @@ -390,6 +393,35 @@ //-- rejouer les donn\xE9es --// this.computeY(projet.impl_.getMainProgression()); } + public void viewGenerationSource(Map infos, CtuluUI impl){ + if(!(impl instanceof TrPostCommonImplementation)){ + impl.error(TrResource.getS("Impossible de r\xE9cup\xE9rer la bonne interface fudaa")); + return; + } + TrPostCommonImplementation implementation=(TrPostCommonImplementation)impl; + //-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --// + TrReplayCurvesData.getInstance().constructProfilSpatialOrigine(this, implementation); + + } + + public EfGridData getData() { + return data_; + } + + public void setData(EfGridData _data) { + this.data_ = _data; + } + + public EfLineIntersectionsResultsBuilder getBuilder() { + return builder_; + } + + public void setBuilder(EfLineIntersectionsResultsBuilder _builder) { + this.builder_ = _builder; + } + + + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -11,6 +11,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsBuilder; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; @@ -197,5 +198,7 @@ public void setPersistSpecificDatas(Object data, Map infos) { } - + public void viewGenerationSource(Map infos, CtuluUI impl){ + + } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -12,6 +12,7 @@ import java.awt.EventQueue; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -57,6 +58,7 @@ import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; import org.fudaa.fudaa.tr.post.ScopCourbeTreeModel; +import org.fudaa.fudaa.tr.post.TrPostCourbeModel; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.actions.TrPostProfileAction; @@ -708,6 +710,66 @@ } + + public void finalizePersistance(){ + + //-- recupere les groupes de la persistance qui doivent etre supprim\xE9 car ne sont pas des liens directs avec les variables H2dVariableType du projet--// + ArrayList<EGGroup> listeGroupeAsupprimer=new ArrayList<EGGroup>(); + + + for(int i=0;i<this.getNbEGObject();i++){ + EGObject eg=this.getEGObject(i); + if((this.getEGObject(i) instanceof EGGroup) && !(this.getEGObject(i) instanceof MvProfileCourbeGroup)){ + + EGGroup groupe=(EGGroup) this.getEGObject(i); + ArrayList<EGCourbeChild> listeCourbeToAdd=new ArrayList<EGCourbeChild>(); + MvProfileCourbeGroup nvGroupe=null; + for(int k=0;k<groupe.getChildCount();k++){ + if(groupe.getCourbeAt(k)!=null){ + EGCourbeChild courbe=groupe.getCourbeAt(k); + + if(courbe.getModel()!=null && (courbe.getModel() instanceof MVProfileCourbeModel)){ + // List childrens=groupe.getChildren(); + MVProfileCourbeModel model=(MVProfileCourbeModel) courbe.getModel(); + //-- recherche ou creation du bon groupe correspondant--// + nvGroupe=getGroup(model.variable_,true); + //nvGroupe.addEGComponent(courbe); + + listeCourbeToAdd.add(courbe); + + + }else{ + //-- on cree le groupe sans car la courbe n'est pas profil spatioal, elel peut etre socpgen--// + nvGroupe=getGroup(H2dVariableType.SANS,true); + //nvGroupe.addEGComponent(courbe); + //listeVar.put(groupe, MvProfileFillePanel.createGroupFor(H2dVariableType.SANS)); + listeCourbeToAdd.add(courbe); + } + + } + + } + + //-- ajout de la liste des children dans le bon groupe --// + nvGroupe.addEGComponent(listeCourbeToAdd); + + //-- ajout du groupe dans la liste a supprimer --// + listeGroupeAsupprimer.add(groupe); + } + } + + this.fireStructureChanged(); + //-- ensuite on vire tout les eggroup et on les remplies dans les goup --// + for(EGGroup groupe:listeGroupeAsupprimer){ + + super.remove(groupe); + + } + + + + } + @Override public EGGrapheModel duplicate(final EGGrapheDuplicator _duplicator) { final MvProfileTreeModel duplic = new MvProfileTreeModel(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -133,5 +133,9 @@ return duplic; } + + public String getSelectedSpecificCourbeInfos(){ + return null; + } } 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-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -26,7 +26,6 @@ import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGGraphe; -import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuBorders; @@ -77,22 +76,26 @@ @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)){ + impl_.error("Impossibe, on ne peut ajouter des variables que pour une \xE9volution temporelle. \n La courbe choisie n'est pas une \xE9volution temporelle."); + return; + } + final TrPostCourbeModel modelEvol=(TrPostCourbeModel)selectedComponent.getModel(); + //-- 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; @@ -103,13 +106,13 @@ 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(); +// 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()); @@ -118,7 +121,7 @@ @Override public void act() { - model.addVariables(finalSrc, Arrays.asList(selected), new ProgressionBuAdapter(this), model_.getCmd()); + model.addVariables(modelEvol,finalSrc, Arrays.asList(selected), new ProgressionBuAdapter(this), model_.getCmd()); EventQueue.invokeLater(new Runnable() { public void run() { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -7,20 +7,30 @@ */ package org.fudaa.fudaa.tr.post; +import java.awt.Dimension; +import java.awt.Rectangle; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; +import javax.swing.JScrollPane; + import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.collection.CtuluArrayDouble; +import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.dodico.ef.EfData; import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.ebli.calque.BArbreCalque; +import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.courbe.EGCourbeChild; import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGModel; @@ -30,6 +40,10 @@ import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeModel; import org.fudaa.fudaa.tr.common.TrResource; +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuBorders; +import com.memoire.bu.BuLabel; +import com.memoire.bu.BuScrollPane; import com.memoire.fu.FuLog; import com.vividsolutions.jts.geom.Coordinate; @@ -51,22 +65,22 @@ */ public TrPostSource source_; - + public final static class Interpolated extends TrPostCourbeModel { - TrPostInterpolatePoint ptIdx_; + TrPostInterpolatePoint ptIdx_; - - /** - * ACHTUNG: constructeur utilis\xE9 uniquement pour la persistance des donn\xE9es!!! - */ - public Interpolated(){ - super(); - } - - + /** + * ACHTUNG: constructeur utilis\xE9 uniquement pour la persistance des donn\xE9es!!! + */ + public Interpolated(){ + super(); + } + + + /** * @param _ptIdx * @param _varIdx * @param _timeIdx @@ -124,47 +138,47 @@ if(point!=null && (point instanceof TrPostInterpolatePoint)) ptIdx_=(TrPostInterpolatePoint) point; } - + public String getInfosPoint() { - + return TrResource.getS("Point interpol\xE9:")+" ("+ptIdx_.x_+";"+ptIdx_.y_+")"; } - + @Override public boolean replayData(TrPostSource src, H2dVariableType var,EGGroup groupe,Map infos) { try{ - //-- creation d un nouveau node pour les donnees en entree --// - EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); - - //-- on remplace les anciennes valeurs par les nouvelles calculees --// - infos.put("MODELREPLAY", newCurve); - -// this.y_=((Node)newCurve.getModel()).y_; -// this.time_=((Node)newCurve.getModel()).time_; - + //-- creation d un nouveau node pour les donnees en entree --// + EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); + + //-- on remplace les anciennes valeurs par les nouvelles calculees --// + infos.put("MODELREPLAY", newCurve); + + // this.y_=((Node)newCurve.getModel()).y_; + // this.time_=((Node)newCurve.getModel()).time_; + }catch(Exception e){ e.printStackTrace(); return false; } return true; } - - - public EGModel duplicate() { - Interpolated duplic = new Interpolated(this.source_,new TrPostInterpolatePoint(this.ptIdx_),this.var_); - if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); - if (this.nom_ != null) duplic.nom_ = nom_; - if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); - return duplic; - } + public EGModel duplicate() { + Interpolated duplic = new Interpolated(this.source_,new TrPostInterpolatePoint(this.ptIdx_),this.var_); + if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); + if (this.nom_ != null) duplic.nom_ = nom_; + if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); + + return duplic; + } + } public final static class Node extends TrPostCourbeModel { - int ptIdx_; + int ptIdx_; /** * @param _ptIdx @@ -176,14 +190,14 @@ ptIdx_ = _ptIdx; } - + /** * ACHTUNG: constructeur utilis\xE9 uniquement pour la persistance des donn\xE9es!!! */ public Node(){ super(); } - + @Override protected void updateY() { createY(); @@ -197,7 +211,7 @@ FuLog.error(e); } // } - } + } // final EfData data = source_.getData(_var, _timeIdx); // if (data == null) { // FuLog.warning("TRP: data is null for " + _var); @@ -250,16 +264,16 @@ @Override public boolean replayData(TrPostSource src, H2dVariableType var,EGGroup groupe,Map infos) { try{ - //-- creation d un nouveau node pour les donnees en entree --// - EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); - - //-- on remplace les anciennes valeurs par les nouvelles calculees --// - infos.put("MODELREPLAY", newCurve); -// this.y_=((Node)newCurve.getModel()).y_; -// this.time_=((Node)newCurve.getModel()).time_; - - - + //-- creation d un nouveau node pour les donnees en entree --// + EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); + + //-- on remplace les anciennes valeurs par les nouvelles calculees --// + infos.put("MODELREPLAY", newCurve); + // this.y_=((Node)newCurve.getModel()).y_; + // this.time_=((Node)newCurve.getModel()).time_; + + + }catch(Exception e){ e.printStackTrace(); return false; @@ -268,18 +282,18 @@ } public EGModel duplicate() { - Node duplic = new Node(this.source_,this.ptIdx_,this.var_,CtuluLibArray.copy(time_)); - if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); - if (this.nom_ != null) duplic.nom_ = nom_; - if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); + Node duplic = new Node(this.source_,this.ptIdx_,this.var_,CtuluLibArray.copy(time_)); + if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); + if (this.nom_ != null) duplic.nom_ = nom_; + if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); - return duplic; - } - + return duplic; + } + @Override public String getInfosPoint() { - + return TrResource.getS("Point r\xE9el ")+ptIdx_+":("+this.source_.getGrid().getPtX(ptIdx_)+";"+this.source_.getGrid().getPtY(ptIdx_)+")"; } @@ -319,7 +333,7 @@ source_ = _src; var_ = _varIdx; } - + /** * ACTHUNG: constructeur utilis\xE9 uniquement pour la persistance des donn\xE9es!!! */ @@ -379,38 +393,38 @@ y_ = new double[source_.getNbTimeStep()]; } } - - - + + + public boolean addValue(double[] _x, double[] _y, CtuluCommandContainer _cmd) { - + time_ = CtuluLibArray.copy(_x); - y_ = CtuluLibArray.copy(_y); - -// for(int i=0;i<Math.min(_x.length,_y.lenght);i++){ -// -// } - + y_ = CtuluLibArray.copy(_y); + + // for(int i=0;i<Math.min(_x.length,_y.lenght);i++){ + // + // } + return true; } - - + + public void fillWithInfo(InfoData _table, CtuluListSelectionInterface _selectedPt) { if(EbliWidget.AMELIO_LOT_VISIBLE){ _table.put(TrResource.getS("Type"),"Evolution temporelle"); _table.put(TrResource.getS("Fichier r\xE9sultat"),this.source_.getFile().getName()); - _table.put(TrResource.getS("Chemin complet"),this.source_.getFile().getAbsolutePath()); - _table.put(TrResource.getS("Titre Fichier r\xE9sultat"),this.source_.getTitle()); - _table.put(TrResource.getS("Infos Point initial"),this.getInfosPoint()); - _table.put(TrResource.getS("Variable"),this.getVar().getName()+" en "+this.getVar().getCommonUnitString()); - - - + _table.put(TrResource.getS("Chemin complet"),this.source_.getFile().getAbsolutePath()); + _table.put(TrResource.getS("Titre Fichier r\xE9sultat"),this.source_.getTitle()); + _table.put(TrResource.getS("Infos Point initial"),this.getInfosPoint()); + _table.put(TrResource.getS("Variable"),this.getVar().getName()+" en "+this.getVar().getCommonUnitString()); + + + } } - - + + public Object getPersistSpecificDatas() { //-- retourne le quatuor point, pdt,variable et fichier source @@ -422,7 +436,7 @@ listeData.add(getSelectionPoint()); return listeData; } - + public abstract String getInfosPoint(); public abstract Object getSelectionPoint(); public abstract void setSelectionPoint(Object point); @@ -432,9 +446,9 @@ */ public abstract boolean replayData(TrPostSource src,H2dVariableType var,EGGroup groupe,Map infos); - + public void setPersistSpecificDatas(Object data, Map infos) { - if(data ==null || !(data instanceof ArrayList))return; + if(data ==null || !(data instanceof ArrayList))return; ArrayList<Object> liste=(ArrayList<Object>)data; String idSource=(String) liste.get(0); TrPostProjet projet = (TrPostProjet) infos.get("TrPostProjet"); @@ -446,13 +460,13 @@ this.source_=src; else{ ((List<String>) infos.get("errorMsg")) - .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); - return; + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); + return; } }else{ ((List<String>) infos.get("errorMsg")) - .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); - return; + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); + return; } // -- etape 2:times: ce sont les x donn\xE9es indirectement. --// @@ -460,18 +474,18 @@ // -- etape 3:variable --// String idVar=(String)liste.get(1); H2dVariableType var=null;//(H2dVariableType) liste.get(1); - + //-- recherche dans les sources de la variable par id --// for(int i=0;i<src.getAvailableVar().length;i++) if(src.getAvailableVar()[i].getID().equals(idVar)) var=src.getAvailableVar()[i]; - + if(var!=null) this.var_=var; else{ ((List<String>) infos.get("errorMsg")) - .add("Erreur, la frame graphe ne trouve pas la variable qui correspond \xE0 l'ID " + idVar); - return; + .add("Erreur, la frame graphe ne trouve pas la variable qui correspond \xE0 l'ID " + idVar); + return; } Object point=liste.get(2); if(point!=null) @@ -479,34 +493,45 @@ //-- FAUT il rejouer les donnees?? --// //final List<String> listeReloadSource=(List<String>) infos.get("RELOAD"); - + //if(listeReloadSource!=null && projet!=null && this.source_!=null && listeReloadSource.contains(idSource)){ - //-- on rejoue les donn\xE9es : methode specialisee replayData--// - this.updateY(); + //-- on rejoue les donn\xE9es : methode specialisee replayData--// + this.updateY(); //} + + + // if(listeReloadSource!=null && projet!=null && this.source_!=null && listeReloadSource.contains(idSource)){ + // //-- on rejoue les donn\xE9es : methode specialisee replayData--// + // EGGroup groupe =(EGGroup)infos.get("GROUPE"); + // if(groupe!=null){ + // + // + // if(replayData(this.source_, var,groupe,infos)){ + // + // }else{ + // //-- message d'erreur: rejoue des donnees foireux --// + // ((List<String>) infos.get("errorMsg")) + // .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); + // } + // }else{ + // //-- message d erreur: impossible de rejoeur les donnees --// + // ((List<String>) infos.get("errorMsg")) + // .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); + // } + // } + + + } + public void viewGenerationSource(Map infos, CtuluUI impl){ + + if(!(impl instanceof TrPostCommonImplementation)){ + impl.error(TrResource.getS("Impossible de r\xE9cup\xE9rer la bonne interface fudaa")); + return; + } + TrPostCommonImplementation implementation=(TrPostCommonImplementation)impl; + + //-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --// + TrReplayCurvesData.getInstance().constructEvolTemporelleOrigine(this, implementation); - -// if(listeReloadSource!=null && projet!=null && this.source_!=null && listeReloadSource.contains(idSource)){ -// //-- on rejoue les donn\xE9es : methode specialisee replayData--// -// EGGroup groupe =(EGGroup)infos.get("GROUPE"); -// if(groupe!=null){ -// -// -// if(replayData(this.source_, var,groupe,infos)){ -// -// }else{ -// //-- message d'erreur: rejoue des donnees foireux --// -// ((List<String>) infos.get("errorMsg")) -// .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); -// } -// }else{ -// //-- message d erreur: impossible de rejoeur les donnees --// -// ((List<String>) infos.get("errorMsg")) -// .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); -// } -// } - - } - } \ No newline at end of file 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-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -31,10 +31,12 @@ import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; +import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheDuplicator; import org.fudaa.ebli.courbe.EGGrapheModel; import org.fudaa.ebli.courbe.EGGrapheTreeModel; @@ -331,7 +333,16 @@ } - protected void addVariables(final TrPostSource _src, final List _var, final ProgressionInterface _prog, + /** + * Ajoute une variable par rapport a une courbe evolution temporelle selectionnee. + * La variable a ete choisie ainsi que le fichier source. + * @param modelCourbe + * @param _src + * @param _var + * @param _prog + * @param _cmd + */ + protected void addVariables(TrPostCourbeModel modelCourbe,final TrPostSource _src, final List _var, final ProgressionInterface _prog, final CtuluCommandContainer _cmd) { // buildTimeSteps(); @@ -349,23 +360,29 @@ // fusion graphes _var.removeAll(varSupported_); - final int nbPt = objIdx_.length; + //final int nbPt = objIdx_.length; final double[] timesInSec = _src.getTime().getTimeListModel().getTimesInSec(); - final TrPostCourbeModel[] model = new TrPostCourbeModel[_var.size() * (nbPt + intepolPt_.size())]; + final TrPostCourbeModel[] model = new TrPostCourbeModel[_var.size()];//_var.size() * (nbPt + intepolPt_.size())]; int idx = 0; final List courbeToMem = _cmd == null ? null : new ArrayList(); final List groupToMem = _cmd == null ? null : new ArrayList(); for (int i = 0; i < _var.size(); i++) { final H2dVariableType var = (H2dVariableType) _var.get(i); final EGGroup g = getGroupFor(var); - for (int idxPt = 0; idxPt < nbPt; idxPt++) { - final EGCourbeChild c = TrPostCourbeModel.buildCourbeModel(var, objIdx_[idxPt], g, _src); + // for (int idxPt = 0; idxPt < nbPt; idxPt++) { + + //-- cas reel --// + if(modelCourbe instanceof TrPostCourbeModel.Node){ + final EGCourbeChild c = TrPostCourbeModel.buildCourbeModel(var, ((Integer)modelCourbe.getSelectionPoint()).intValue(), g, _src); courbeToMem.add(c); groupToMem.add(g); model[idx++] = (TrPostCourbeModel) c.getModel(); } - for (final Iterator iter = intepolPt_.iterator(); iter.hasNext();) { - final TrPostInterpolatePoint element = (TrPostInterpolatePoint) iter.next(); + else{ + //for (final Iterator iter = intepolPt_.iterator(); iter.hasNext();) { + //-- cas point interpol\xE9 --// + + final TrPostInterpolatePoint element = (TrPostInterpolatePoint)modelCourbe.getSelectionPoint(); final EGCourbeChild c = TrPostCourbeModel.buildCourbeModel(var, element, g, _src); courbeToMem.add(c); groupToMem.add(g); @@ -415,6 +432,9 @@ } + + + private void buildUpdating() { if (updating_ == null) { updating_ = new EGGroup(); @@ -980,6 +1000,30 @@ /** + * parcours la liste de ses courbes et range les fons groupes de variables correspondant + */ + public void finalizePersistance(){ + for(int i=0;i<this.getNbEGObject();i++){ + + if(this.getEGObject(i) instanceof EGGroup){ + + EGGroup groupe=(EGGroup) this.getEGObject(i); + for(int k=0;k<groupe.getChildCount();k++){ + if(groupe.getCourbeAt(k)!=null){ + EGCourbeChild courbe=groupe.getCourbeAt(k); + if(courbe.getModel()!=null && (courbe.getModel() instanceof TrPostCourbeModel)){ + TrPostCourbeModel model=(TrPostCourbeModel) courbe.getModel(); + varGroup_.put(model.var_, groupe); + } + } + } + } + } + + + } + + /** * Methode qui affiche les infos principales de la courbe choisie * @return */ @@ -1022,5 +1066,19 @@ this.impl_ = projet.impl_; } + + + /** + * Les actions des courbes specifiques: l'ajout de variable. + */ + public List<EbliActionInterface> getSpecificsActionsCurvesOnly(EGGraphe _target) { + List<EbliActionInterface> listeActions=new ArrayList<EbliActionInterface>(); + + //-- action d'ajout des variables --// + listeActions.add(new TrPostCourbeAddVariableAction(projet_.impl_, _target)); + + return listeActions; + + } } 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 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -46,6 +46,7 @@ import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorArrowEditor; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorTextEditor; +import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetControllerGraphe; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; @@ -327,14 +328,20 @@ // TrPostVisuPanel _calque = (TrPostVisuPanel) creator.getCalquepanelProvenance(); // TODO trop dangereux... // listeActions.add(new TrPostCourbeAddPointsAction(projet_.impl_, _graphe.getGraphe(), _calque)); - if (!(_graphe.getGraphe().getModel() instanceof MvProfileTreeModel)) listeActions - .add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); + // if (!(_graphe.getGraphe().getModel() instanceof MvProfileTreeModel)) listeActions +// .add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); + + //-- action ajout de variable --// +// if (_graphe.getGraphe().getModel() instanceof TrPostCourbeTreeModel){ +// ((EbliWidgetControllerGraphe)_controller).tree_.getActions().getMenu().add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); +// +// } if (_graphe.getGraphe().getModel() instanceof MvProfileTreeModel) { listeActions .add(new TrPostActionBilan(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_.getImpl())); - // listeActions.add(new TrPostActionCubature(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_ - // .getImpl())); +// listeActions.add(new TrPostActionCubature(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_ +// .getImpl())); } // -- ajout de l'importation dans les courbes de l'action --// 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 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -179,7 +179,8 @@ projet_ = _controller; info_ = new TrPostInfoDelegate(source_, getEbliFormatter()); addCqInfos(source_.getGrid()); - addCqLegende(_leg); + if(_leg!=null) + addCqLegende(_leg); addCqMaillage(source_.getGrid(), info_); final MvGridLayerGroup gr = getGridGroup(); gr.getPointLayer().setVisible(false); Added: 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 (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -0,0 +1,233 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Rectangle; +import java.util.Vector; + +import javax.swing.JComponent; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; + +import org.fudaa.ctulu.gis.GISZoneCollectionPoint; +import org.fudaa.ctulu.gui.CtuluDialogPanel; +import org.fudaa.ebli.calque.BArbreCalque; +import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BCalqueLegende; +import org.fudaa.ebli.calque.ZCalquePoint; +import org.fudaa.ebli.calque.edition.ZModelePointEditable; +import org.fudaa.ebli.courbe.EGModel; +import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceIconModel; +import org.fudaa.ebli.trace.TraceLigneModel; +import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; +import org.fudaa.fudaa.meshviewer.profile.MVProfileCourbeModel; +import org.fudaa.fudaa.sig.layer.FSigEditor; +import org.fudaa.fudaa.sig.layer.FSigLayerPointEditable; +import org.fudaa.fudaa.tr.common.TrResource; + +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuBorders; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.LineString; + + + +/** + * Classe qui se charge d'afficher et rejouer les donn\xE9es d'origine des courbes TR. + * C'set a dire les courbes spatiales et evolutions temporelles. + * @author Adrien Hadoux + * + */ +public class TrReplayCurvesData { + + /** + * Classe singleton. + * Permet de stocker en memoire les constructions pour optimiser les calculs. + */ + private static TrReplayCurvesData instance_; + + /** + * Vue 2d gardee en memoire si on fait plusieurs appels cons\xE9cutifs \xE0 des courbes qui ont le meme fichier source. + */ + private TrPostVisuPanel memoire_; + private TrPostSource srcMemoire_; + + + public static TrReplayCurvesData getInstance(){ + + if(instance_==null) + instance_=new TrReplayCurvesData(); + return instance_; + + } + + /** + * Retourne une nouvelle vue 2d en fonction des parametres fournis. + * Dans le cas ou les parametres fournis ont deja constitu\xE9 le pr\xE9c\xE9dent appel, on retourne la construction graphique pr\xE9c\xE9dente. + * @param implementation + * @param src + * @return + */ + private TrPostVisuPanel createVue2d(TrPostCommonImplementation implementation,TrPostSource src){ + //-- petite optimisation --// + if(srcMemoire_!=null && memoire_!=null && srcMemoire_==src) + return memoire_; + + BCalqueLegende legende=new BCalqueLegende(); + TrPostVisuPanel vue2d=new TrPostVisuPanel(implementation,implementation.c_,legende,src); + vue2d.removeCalqueLegend(); + + vue2d.restaurer(); + Rectangle rec=new Rectangle(300,300); + vue2d.setPreferredSize(new Dimension(300,300)); + final BCalque[] tousCalques = vue2d.getVueCalque().getCalque().getTousCalques(); + vue2d.getVueCalque().setSize(rec.width, rec.height); + // calquePanel_.setPreferredSize(new Dimension(rec.width, rec.height)); + vue2d.getVueCalque().getCalque().setSize(rec.width, rec.height); + for (int i = 0; i < tousCalques.length; i++) { + tousCalques[i].setSize(rec.width, rec.height); + } + vue2d.restaurer(); + return vue2d; + } + + /** + * Cree la dialog qui affiche tout le contenu d'origine du graphe. + * @param vue2d + * @param implementation + * @param modele + */ + private void createDialogOrigine(TrPostVisuPanel vue2d, TrPostCommonImplementation implementation, EGModel modele,JComponent composantAdditionnel){ + //final JScrollPane arbreVue2d = new JScrollPane(new BArbreCalque(vue2d.getArbreCalqueModel())); + implementation.createTask(TrResource.getS("Origine ")+" "+modele.getTitle()); + 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(vue2d,BuBorderLayout.CENTER); + if(composantAdditionnel!=null) + pn.add(composantAdditionnel,BuBorderLayout.EAST); + //pn.add(arbreVue2d,BuBorderLayout.EAST); + pn.add(vue2d.getLabelSuiviSouris(),BuBorderLayout.SOUTH); + pn.afficheModale(implementation.getParentComponent(), TrResource.getS("Origine ")+" "+modele.getTitle()); + + + implementation.clearMainProgression(); + } + + /** + * Constructeur d'une dialog qui affiche l... [truncated message content] |