From: <de...@us...> - 2008-09-28 21:22:05
|
Revision: 3997 http://fudaa.svn.sourceforge.net/fudaa/?rev=3997&view=rev Author: deniger Date: 2008-09-28 21:21:54 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineFlowrateResult.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/H2dParameters.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/lock_16.png branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/unlock_16.png Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineFlowrateResult.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineFlowrateResult.java 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineFlowrateResult.java 2008-09-28 21:21:54 UTC (rev 3997) @@ -9,18 +9,15 @@ import java.io.IOException; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluLibGeometrie; import org.fudaa.ctulu.CtuluVariable; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; -import org.fudaa.ctulu.interpolation.InterpolationVectorContainer; - import org.fudaa.dodico.ef.EfData; -import org.fudaa.dodico.ef.EfDataInterpolationAdapter; import org.fudaa.dodico.ef.EfGridData; +import com.memoire.fu.FuLog; + /** * Une classe permettant de calculer le d\xE9bit \xE0 partir d'un profil. * @@ -112,49 +109,49 @@ * @param _h la hauteur d'eau * @return le d\xE9bit */ - double getQ(int _idxPtOnProfil, EfData _norme, EfData _theta, EfData _h, EfLineIntersectionsResultsI _res) { + double getQ(int _idxPtOnProfil, EfData _vx, EfData _vy, EfData _h, EfLineIntersectionsResultsI _res) { if (_idxPtOnProfil >= _res.getNbIntersect() - 1) return 0; // le point 1 int idx = _idxPtOnProfil; calculator_.x1_ = _res.getIntersect(idx).getX(); calculator_.y1_ = _res.getIntersect(idx).getY(); - double n = _res.getIntersect(idx).getValueBadInterpolation(_norme); - double t = _res.getIntersect(idx).getValueBadInterpolation(_theta); - calculator_.vx1_ = InterpolationVectorContainer.getVx(n, t); - calculator_.vy1_ = InterpolationVectorContainer.getVy(n, t); + // double n = _res.getIntersect(idx).getValueBadInterpolation(_vx); + // double t = _res.getIntersect(idx).getValueBadInterpolation(_vy); + calculator_.vx1_ = _res.getIntersect(idx).getValueBadInterpolation(_vx);// InterpolationVectorContainer.getVx(n, t); + calculator_.vy1_ = _res.getIntersect(idx).getValueBadInterpolation(_vy); calculator_.h1_ = _res.getIntersect(idx).getValueBadInterpolation(_h); idx++; calculator_.x2_ = _res.getIntersect(idx).getX(); calculator_.y2_ = _res.getIntersect(idx).getY(); - n = _res.getIntersect(idx).getValueBadInterpolation(_norme); - t = _res.getIntersect(idx).getValueBadInterpolation(_theta); - calculator_.vx2_ = InterpolationVectorContainer.getVx(n, t); - calculator_.vy2_ = InterpolationVectorContainer.getVy(n, t); +// n = _res.getIntersect(idx).getValueBadInterpolation(_vx); +// t = _res.getIntersect(idx).getValueBadInterpolation(_vy); + calculator_.vx2_ = _res.getIntersect(idx).getValueBadInterpolation(_vx); + calculator_.vy2_ = _res.getIntersect(idx).getValueBadInterpolation(_vy); calculator_.h2_ = _res.getIntersect(idx).getValueBadInterpolation(_h); return calculator_.getQ(); } public double getQ(EfGridData _data, int _tidx, ProgressionInterface _prog) { - EfData norme = null; - EfData theta = null; + EfData vx = null; + EfData vy = null; EfData h = null; try { - EfData vx = _data.getData(vx_, _tidx); - EfData vy = _data.getData(vy_, _tidx); - norme = new EfDataInterpolationAdapter.Norm(vx, vy); - theta = new EfDataInterpolationAdapter.Theta(vx, vy); + vx = _data.getData(vx_, _tidx); + vy = _data.getData(vy_, _tidx); + // norme = new EfDataInterpolationAdapter.Norm(vx, vy); + // theta = new EfDataInterpolationAdapter.Theta(vx, vy); h = _data.getData(h_, _tidx); } catch (IOException _evt) { FuLog.error(_evt); } - if (norme == null || theta == null || h == null) return 0; + if (vx == null || vy == null || h == null) return 0; double q = 0; EfLineIntersectionsResultsI res = res_.createResults(_tidx, _prog); ProgressionUpdater up = new ProgressionUpdater(_prog); up.setValue(10, res.getNbIntersect() - 1); for (int i = 0; i < res.getNbIntersect() - 1; i++) { - if (res.isSegmentIn(i)) q += getQ(i, norme, theta, h, res); + if (res.isSegmentIn(i)) q += getQ(i, vx, vy, h, res); up.majAvancement(); } return q; Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/H2dParameters.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/H2dParameters.java 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/H2dParameters.java 2008-09-28 21:21:54 UTC (rev 3997) @@ -242,11 +242,11 @@ public static InterpolationVectorContainer createDefaultVectorContainer() { InterpolationVectorContainer defaultC = new InterpolationVectorContainer(); - defaultC.addVxVy(H2dVariableType.VENT_X, H2dVariableType.VENT_Y); - defaultC.addVxVy(H2dVariableType.VITESSE_U, H2dVariableType.VITESSE_V); - defaultC.addVxVy(H2dVariableType.VITESSE_NORMALE, H2dVariableType.VITESSE_TANGENTIELLE); - defaultC.addVxVy(H2dVariableType.DEBIT_NORMAL, H2dVariableType.DEBIT_TANGENTIEL); - defaultC.addVxVy(H2dVariableType.DEBIT_X, H2dVariableType.DEBIT_Y); +// defaultC.addVxVy(H2dVariableType.VENT_X, H2dVariableType.VENT_Y); +// defaultC.addVxVy(H2dVariableType.VITESSE_U, H2dVariableType.VITESSE_V); +// defaultC.addVxVy(H2dVariableType.VITESSE_NORMALE, H2dVariableType.VITESSE_TANGENTIELLE); +// defaultC.addVxVy(H2dVariableType.DEBIT_NORMAL, H2dVariableType.DEBIT_TANGENTIEL); +// defaultC.addVxVy(H2dVariableType.DEBIT_X, H2dVariableType.DEBIT_Y); return defaultC; } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 2008-09-28 21:21:54 UTC (rev 3997) @@ -621,4 +621,6 @@ Cliquez sur le graphe pour s\xE9lectionner le x voulu.=Click on the graph in order to select the proper x Fermer la palette pour quitter le mode s\xE9lection du graphe=Close the graphical ui in order to quit the graph's selection mode X s\xE9lectionn\xE9:=Selected X: -Interpolation Fusion=Fusion interpolation \ No newline at end of file +Interpolation Fusion=Fusion interpolation +Bloquer la taille et la position de la frame=Lock the size and the location of the frame +D\xE9bloquer la taille et la position de la frame=Unlock the size and the location of the frame \ No newline at end of file Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/lock_16.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/unlock_16.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-28 21:21:54 UTC (rev 3997) @@ -115,17 +115,16 @@ // -- raffraichissement de la scene --// widget_.getEbliScene().refresh(); } - + postActionDuplication(n, duplique); } }); } - + /** - * Methode a surcharger si on veut effectuer un traitement particulier apres - * duplication du widget. + * Methode a surcharger si on veut effectuer un traitement particulier apres duplication du widget. */ public void postActionDuplication(EbliNode node, EbliNode duplique) { @@ -246,17 +245,15 @@ } }); - + _popup.addSeparator(); constructMenuMasquer(_popup, cmd_); - + constructMenuBloquer(_popup, cmd_); + constructMenuSupprimer(_popup, cmd_); if (canDuplicate_) { + _popup.addSeparator(); constructMenuDupliquer(_popup, cmd_); } - constructMenuBloquer(_popup, cmd_); - - constructMenuSupprimer(_popup, cmd_); - } /** @@ -305,9 +302,9 @@ } public String getDescription() { - + return description_; - + } public BuMenuBar getMenubarComponent() { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java 2008-09-28 21:21:54 UTC (rev 3997) @@ -25,7 +25,7 @@ final CtuluCommandContainer cmd_; boolean bloque_ = true; EbliWidget widget_; - + public EbliWidgetActionBloqueOuDebloqueWidget(String name, Icon ic, String id, EbliWidget _widget, boolean bloque) { super(_widget.getEbliScene(), name, ic, id); @@ -34,20 +34,26 @@ bloque_ = bloque; } + @SuppressWarnings("serial") public static class Bloque extends EbliWidgetActionBloqueOuDebloqueWidget { public Bloque(EbliWidget _widget) { - super(EbliResource.EBLI.getString("Bloquer la frame"), CtuluResource.CTULU - .getIcon("crystal_tuer"), "BLOQUEWIDGET", _widget, true); + super(EbliResource.EBLI.getString("Bloquer la frame"), EbliResource.EBLI.getIcon("lock_16"), "BLOQUEWIDGET", + _widget, true); + setDefaultToolTip(EbliResource.EBLI.getString("Bloquer la taille et la position de la frame")); + } } + @SuppressWarnings("serial") public static class DeBloque extends EbliWidgetActionBloqueOuDebloqueWidget { public DeBloque(EbliWidget _widget) { - super(EbliResource.EBLI.getString("Debloquer la frame"), CtuluResource.CTULU - .getIcon("crystal_valider"), "DEBLOQUEWIDGET", _widget, false); + super(EbliResource.EBLI.getString("Debloquer la frame"), EbliResource.EBLI.getIcon("unblock_16"), + "DEBLOQUEWIDGET", _widget, false); + setDefaultToolTip(EbliResource.EBLI.getString("D\xE9bloquer la taille et la position de la frame")); + } } @@ -55,40 +61,32 @@ public void actionPerformed(ActionEvent e) { EbliWidgetController controller = null; - - - if (widget_ instanceof EbliWidgetBordureSingle) { - controller = ((EbliWidgetBordureSingle) widget_).getBordureController(); - } else - if (widget_.getParentWidget() instanceof EbliWidgetBordureSingle) { - controller = ((EbliWidgetBordureSingle) widget_.getParentWidget()).getBordureController(); - } else - controller = widget_.getController(); - - - if (bloque_) { + if (widget_ instanceof EbliWidgetBordureSingle) { + + controller = ((EbliWidgetBordureSingle) widget_).getBordureController(); + } else if (widget_.getParentWidget() instanceof EbliWidgetBordureSingle) { + controller = ((EbliWidgetBordureSingle) widget_.getParentWidget()).getBordureController(); + } else controller = widget_.getController(); + + if (bloque_) { controller.removeActionResizeAndMove(); - + // -- on change l action du bouton du controller --// // -- ACHTUNG!! il faut toujours utilsier el controller de la widget car // le controlelr de la bordure ne contient pas de menus widget_.getController().boutonBloque.setAction(new EbliWidgetActionBloqueOuDebloqueWidget.DeBloque(widget_)); widget_.getController().isBlocked = true; - - } else { - controller.replaceActionResizeAndMove(); - // -- on change l action du bouton du controller --// + + } else { + controller.replaceActionResizeAndMove(); + // -- on change l action du bouton du controller --// widget_.getController().boutonBloque.setAction(new EbliWidgetActionBloqueOuDebloqueWidget.Bloque(widget_)); - widget_.getController().isBlocked = false; - } - // -- rafraichissement de la scene --// - scene_.refresh(); + widget_.getController().isBlocked = false; + } + // -- rafraichissement de la scene --// + scene_.refresh(); - - - - // -- enregistrement de la commande undoRedo --// if (cmd_ != null) { cmd_.addCmd(new CommandUndoRedoBloque(controller, bloque_)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-25 15:22:19
|
Revision: 3982 http://fudaa.svn.sourceforge.net/fudaa/?rev=3982&view=rev Author: hadouxad Date: 2008-09-25 15:22:02 +0000 (Thu, 25 Sep 2008) Log Message: ----------- - fonction sonde ok - preparation des outils pour l'import export de graphe Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.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/rubar/TrRubarTarageCourbesManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheTreeCellRenderer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -14,25 +14,25 @@ import javax.swing.table.AbstractTableModel; -import com.vividsolutions.jts.algorithm.SIRtreePointInRing; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.LinearRing; - import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.gis.GISGeometryFactory; import org.fudaa.ctulu.gis.GISLib; - import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.geometrie.GrMorphisme; import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.palette.BPalettePlage; +import org.fudaa.ebli.palette.BPaletteInfo.InfoData; import org.fudaa.ebli.trace.TraceIcon; import org.fudaa.ebli.trace.TraceIconModel; +import com.vividsolutions.jts.algorithm.SIRtreePointInRing; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Envelope; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.LinearRing; + /** * Un calque d'affichage de point avec un icone. * @@ -91,6 +91,11 @@ } } + + public void fillWithInterpolateInfo(final InfoData _m) { + + } + /** * @author Fred Deniger * @version $Id: ZCalquePoint.java,v 1.51 2007-05-04 13:49:42 deniger Exp $ Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -1,20 +1,32 @@ package org.fudaa.ebli.calque; import java.awt.BorderLayout; +import java.awt.Frame; import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; +import java.util.Map; +import javax.swing.Icon; +import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluUIDialog; import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.ebli.palette.BPaletteInfo.InfoData; import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetVueCalque; +import org.fudaa.ebli.visuallibrary.graphe.GrapheTreeCellRenderer; import org.jdesktop.swingx.JXTreeTable; import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode; import org.jdesktop.swingx.treetable.DefaultTreeTableModel; @@ -32,24 +44,43 @@ //private List<ZCalqueSondeInterface> listeTarget_; final List<ZCalqueSondeInteraction> listeSondeInteractions_ = new ArrayList<ZCalqueSondeInteraction>(); - final List<String> listeNodeCalques = new ArrayList<String>(); - + + ArrayList<EbliWidgetVueCalque> listeWidgetCalque_ = new ArrayList<EbliWidgetVueCalque>(); + + /** + * Liste des panelTableModel qui contiennent les infos des calques. + */ + ArrayList<DataSonde> listInfoData_ = new ArrayList<DataSonde>(); + + /** + * HahMap qui contient les infos mises a jour des positions des sondes. + */ + + + public ZCalqueSondeSynchroniserFusion() { + } int cpt = 1; - public void addZCalqueSondeInteraction(ZCalqueSondeInteraction si/* - * , EbliNode - * node - */) { + public void addZCalqueSondeInteraction(ZCalqueSondeInteraction si, EbliWidgetVueCalque _widget) { // -- ajout de la sonde dans le manager --// listeSondeInteractions_.add(si); - - listeNodeCalques.add("calque " + (cpt++)); + + // -- ajout de la widget --// + listeWidgetCalque_.add(_widget); + + // -- ajout du model de la palete info du calque --// + // listTableModel_.add(_widget.getCalqueController().getVisuPanel(). + // getController().getPaletteInfo().getTableModel()); + + //-- init des datas --// + listInfoData_.add(new DataSonde()); + // -- enregistrement aupres de la sonde du manager comme listener --// si.addZCalqueSondeListener(this); - + } /** @@ -60,91 +91,309 @@ for (ZCalqueSondeInteraction sondeInteraction : listeSondeInteractions_) sondeInteraction.removeZCalqueSondeListener(this); } - + /** * lorsque c'est appel\xE9, met a jour les sondes pour tous les autre * zcalquesondeInteraction. */ public void notifySondeMoved(ZCalqueSondeInteraction _activator, MouseEvent _e) { - for (ZCalqueSondeInteraction sondeInteraction : listeSondeInteractions_) { - if (sondeInteraction != _activator && sondeInteraction.getTarget() != null) { - // -- on recupere le point et on met a jour les sondes --// + if (structureModel_ == null) + structureModel_ = constructStructureModel(); + + for (int i=0;i<listeSondeInteractions_.size();i++) { + + ZCalqueSondeInteraction sondeInteraction=listeSondeInteractions_.get(i); + if (/* sondeInteraction != _activator && */sondeInteraction.getTarget() != null) { + // -- on recupere le point et on met a jour les sondes --// final GrPoint pt = new GrPoint(_e.getX(), _e.getY(), 0); pt.autoApplique(((BCalque) sondeInteraction.getTarget()).getVersReel()); // -- on replace la sonde des autres calques --// ZCalqueSondeInterface objet = sondeInteraction.getTarget(); + objet.setSondeEnable(true); objet.changeSonde(pt); + + //--remplissage des infos specifiques a la sonde --// + ZCalquePoint isoLayer = listeWidgetCalque_.get(i).getCalqueController().getVisuPanel().getIsoLayer(); + isoLayer.fillWithInterpolateInfo(listInfoData_.get(i)); + + // -- mise a jour du model avec les nouvelles infos + // structureModel_.fillWithInfos(i, listInfoData_.get(i)); } } + buildDialog(); - + // structureModel_ = constructStructureModel(); + // treeTableNodes_.setTreeTableModel(structureModel_); + // treeTableNodes_.expandAll(); + structureModel_.reload(); } - + JDialog dialog_; public void buildDialog() { if (dialog_ != null) { dialog_.setVisible(true); return; } - -// CtuluUIDialog ui = new CtuluUIDialog(listeSondeInteractions_); -// final Frame f = CtuluLibSwing.getFrameAncestorHelper(ui.getParentComponent()); - dialog_ = new JDialog(/*f*/); + // CtuluUIDialog ui_ = new + // CtuluUIDialog(listeWidgetCalque_.get(0).getCalqueController + // ().getVisuPanel()); + CtuluUIDialog ui = new CtuluUIDialog(listeWidgetCalque_.get(0).getEbliScene().getView()); + final Frame f = CtuluLibSwing.getFrameAncestorHelper(ui.getParentComponent()); + dialog_ = new JDialog(f); + dialog_.addWindowListener(new WindowAdapter() { - public void windowClosed(WindowEvent _e) { - // on desactive l action de suivi sur le graphe - dialog_ = null; - } + public void windowClosed(WindowEvent _e) { + // on desactive l action de suivi sur le graphe + dialog_ = null; + } - public void windowClosing(WindowEvent _e) { - dialog_ = null; - } - }); - - + public void windowClosing(WindowEvent _e) { + dialog_ = null; + } + }); + + dialog_.setModal(false); dialog_.pack(); dialog_.setTitle(getTitle()); JPanel container=new JPanel(new BorderLayout()); - container.add(new JScrollPane(buildComponent()),BorderLayout.CENTER); + container.add(buildComponent(), BorderLayout.CENTER); container - .add( - new JLabel( - "<html> <body><b>" + getTitle() + "</b> </body></html>"), + .add(new JLabel("<html> <body><b><center>" + getTitle() + "</center></b> </body></html>"), BorderLayout.NORTH); dialog_.setContentPane(container); - dialog_.setSize(250, 400); - // dialog_.setLocationRelativeTo(CtuluLibSwing.getFrameAncestor(ui. - // getParentComponent())); + dialog_.setSize(400, 250); + dialog_.setLocationRelativeTo(CtuluLibSwing.getFrameAncestor(ui.getParentComponent())); dialog_.setVisible(true); - + } - + public String getTitle() { return EbliResource.EBLI.getString("-- Interpolation r\xE9sultats -- "); } - + + JXTreeTable treeTableNodes_; public JComponent buildComponent() { JPanel container = new JPanel(new BorderLayout()); - JXTreeTable treeTableNodes_ = new JXTreeTable(constructStructureModel()); - container.add(treeTableNodes_, BorderLayout.CENTER); + if (structureModel_ == null) + structureModel_ = constructStructureModel(); + treeTableNodes_ = new JXTreeTable(structureModel_); + + // treeTableNodes.setRowHeight(60); + treeTableNodes_.getColumn(0).setMinWidth(100); + treeTableNodes_.setTreeCellRenderer(new GrapheTreeCellRenderer()); + JPanel containerTree = new JPanel(new BorderLayout()); + containerTree.add(treeTableNodes_, BorderLayout.CENTER); + container.add(new JScrollPane(containerTree), BorderLayout.CENTER); container.add(treeTableNodes_.getTableHeader(), BorderLayout.NORTH); return container; } + - public DefaultTreeTableModel constructStructureModel() { + TreeTableModelGraphe structureModel_; + + public TreeTableModelGraphe constructStructureModel() { DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode("Sonde pour la fusion des calques"); - for (String titre : listeNodeCalques) - root.add(new DefaultMutableTreeTableNode(titre)); - - DefaultTreeTableModel model = new DefaultTreeTableModel(); + for (int i = 0; i < listeWidgetCalque_.size(); i++) { + EbliWidgetVueCalque widget = listeWidgetCalque_.get(i); + JLabel label = new JLabel(); + label.setText(getTitleCalque(widget)); + label.setIcon(getIconCalque(widget)); + DefaultMutableTreeTableNode nodeCalque = new DefaultMutableTreeTableNode(label); + root.add(nodeCalque); + + fillWithInfos(i, nodeCalque, listInfoData_.get(i)); + + + // -- parcours des donn\xE9es + + } + TreeTableModelGraphe model = new TreeTableModelGraphe(); model.setRoot(root); return model; } + + public String getTitleCalque(EbliWidgetVueCalque _widget) { + return ((EbliNode) _widget.getEbliScene().findObject(_widget)).getTitle(); + } + + public Icon getIconCalque(EbliWidgetVueCalque _widget) { + return new ImageIcon(_widget.getCalqueController().getVisuPanel().produceImage(60, 30, new HashMap())); + } + + + + public class DataSonde implements InfoData { + private Map<String, Object> mapValueSonde = new HashMap<String, Object>(); + public ArrayList<String> listOrdonneetitres_ = new ArrayList<String>(); + private String valueEmpty = "N/A"; + + public DataSonde() { + // -- init de la map sonde avec les valeurs par defaut --// + + listOrdonneetitres_.add("X"); + listOrdonneetitres_.add("Y"); + listOrdonneetitres_.add("El\xE9ment englobant"); + listOrdonneetitres_.add("Bathym\xE9trie"); + listOrdonneetitres_.add("Cote eau"); + listOrdonneetitres_.add("Hauteur d'eau"); + listOrdonneetitres_.add("Nombre de Froude"); + listOrdonneetitres_.add("Vitesse"); + listOrdonneetitres_.add("Vitesse u"); + listOrdonneetitres_.add("Vitesse v"); + + for (String key : listOrdonneetitres_) { + mapValueSonde.put(key, valueEmpty); + + } + + + + + } + + public boolean isTitleSet() { + return false; + } + + public void put(String _key, String _value) { + mapValueSonde.put(_key, _value); + if (!listOrdonneetitres_.contains(_key)) + listOrdonneetitres_.add(_key); + } + + public void setTitle(String _title) { + } + + + } + + public class SondeCouple { + public String name; + public int indiceData_; + + public SondeCouple(String _name, int indiceData) { + super(); + name = _name; + indiceData_ = indiceData; + } + + public Object getValue() { + return listInfoData_.get(indiceData_).mapValueSonde.get(name); + } + + } + + + public class TreeTableModelGraphe extends DefaultTreeTableModel { + String[] titre_; + + // -- data correspondant au x donn\xE9 --// + double[] dataY_ = new double[0]; + + public TreeTableModelGraphe() { + String[] val = { "Nom", "Valeur" }; + titre_ = val; + } + + public int getColumnCount() { + + return titre_.length; + } + + @Override + public boolean isCellEditable(Object _node, int _column) { + return false; + } + + public String getColumnName(int _columnIndex) { + return titre_[_columnIndex]; + } + + public int getRowCount() { + return listeWidgetCalque_.size(); + + } + + public Object getValueAt(Object node, int column) { + Object res = new DefaultMutableTreeTableNode("n/a"); + if (node instanceof DefaultMutableTreeTableNode) { + DefaultMutableTreeTableNode defNode = (DefaultMutableTreeTableNode) node; + if (defNode.getUserObject() instanceof JLabel) { + if (column == 0) + return defNode.getUserObject(); + else + return ""; + } else if (defNode.getUserObject() instanceof SondeCouple) { + SondeCouple couple = (SondeCouple) defNode.getUserObject(); + if (column == 0) + return couple.name; + else if (column == 1) + return couple.getValue(); + else + return ""; + } + else + return ""; + } + return res; + } + + public DefaultMutableTreeTableNode getTreeNodeCalque(int i) { + return (DefaultMutableTreeTableNode) getRoot().getChildAt(i); + + } + + public void reload() { + + this.modelSupport.fireTreeStructureChanged(treeTableNodes_.getPathForRow(0)); +// treeTableNodes_.collapseAll(); +// treeTableNodes_.expandAll(); + } + + + /** + * met a jour les nodes childre ndu node calque pour le jtree. + * + * @param _treenode + */ + + + + + } + + public void fillWithInfos(int indice, DefaultMutableTreeTableNode treenode, DataSonde data_) { + + // on enleve les children + // Enumeration<? extends MutableTreeTableNode> children = + // treenode.children(); + // ArrayList<MutableTreeTableNode> listChildren = new + // ArrayList<MutableTreeTableNode>(); + // while (children.hasMoreElements()) { + // MutableTreeTableNode node = children.nextElement(); + // listChildren.add(node); + // + // } + // for (MutableTreeTableNode node : listChildren) { + // node.removeFromParent(); + // } + // -- on ajoute les nouveaux + for (Iterator<String> it = data_.listOrdonneetitres_.iterator(); it.hasNext();) { + String key = it.next(); + Object value = data_.mapValueSonde.get(key); + DefaultMutableTreeTableNode node = new DefaultMutableTreeTableNode( + new SondeCouple(key, indice)); + treenode.add(node); + } + } + + + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -44,6 +44,7 @@ import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BConfigurePaletteAction; import org.fudaa.ebli.geometrie.GrBoite; +import org.fudaa.ebli.palette.BPaletteInfo; import org.fudaa.ebli.palette.BPaletteInfoAbstractAction; import org.fudaa.ebli.palette.PaletteEditAction; import org.fudaa.ebli.repere.BControleRepereTexte; @@ -334,6 +335,15 @@ public final CtuluUI getUI() { return ui_; } + + /** + * A overrider. + * + * @return + */ + public BPaletteInfo getPaletteInfo() { + return null; + } protected void removePaletteAction() { navigationActionGroup_ = removePaletteAction(navigationActionGroup_); 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 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -110,6 +110,10 @@ } } + public ZCalquePoint getIsoLayer() { + return null; + } + /** * @author Fred Deniger * @version $Id: ZEbliCalquesPanel.java,v 1.55 2007-06-05 08:58:38 deniger Exp $ Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -23,13 +23,13 @@ import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumnModel; +import org.fudaa.ebli.commun.EbliLib; + import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuPanel; import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuTextField; -import org.fudaa.ebli.commun.EbliLib; - /** * Un panel affichant les infos envoyes. * @@ -115,6 +115,11 @@ protected Component parent_; protected JTable table_; protected transient PanelTableModel tableModel_; + + public PanelTableModel getTableModel() { + return tableModel_; + } + protected JTextField txtTitle_; public BPaletteInfo() { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -85,9 +85,11 @@ */ public void synchroniseSondeFusion() { + // -- creation du manager de sonde fusion qui synchronise toute ses sondes // --// managerSondesFusion_ = new ZCalqueSondeSynchroniserFusion(); + for (EbliWidgetVueCalque widget : listeWidgetCalque_) { ZEbliCalquesPanel panel = widget.calquePanel_; @@ -99,7 +101,7 @@ ZCalqueSondeInteraction sonde = panel.getController().getCalqueSondeInteraction(); // -- ajout de la sonde dans le manager - managerSondesFusion_.addZCalqueSondeInteraction(sonde); + managerSondesFusion_.addZCalqueSondeInteraction(sonde, widget); } // -- ajout dans les toolbars de tous les calques de la meme action --// // for (EbliWidgetVueCalque widget : listeWidgetCalque_) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -37,4 +37,7 @@ } return this; } + + + } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheTreeCellRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheTreeCellRenderer.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheTreeCellRenderer.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -0,0 +1,68 @@ +package org.fudaa.ebli.visuallibrary.graphe; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; + +import javax.swing.JLabel; +import javax.swing.JTree; +import javax.swing.UIManager; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.TreeCellRenderer; + +import org.fudaa.ebli.calque.ZCalqueSondeSynchroniserFusion.SondeCouple; +import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode; + +/** + * Tree cell Renderer classique pour afficher les icones mignature a cot\xE9 des + * objets + * + * @author genesis + * + */ +public class GrapheTreeCellRenderer extends JLabel implements TreeCellRenderer { + private final Color HIGHLIGHT_COLOR = UIManager.getColor("Tree.selectionBackground"); + private DefaultTreeCellRenderer rendererClassique_ = new DefaultTreeCellRenderer(); + JLabel defaultZone_ = new JLabel(""); + + public GrapheTreeCellRenderer() { + setOpaque(true); + setIconTextGap(12); + setSize(150, 100); + setMinimumSize(new Dimension(150, 100)); + + } + + public Component getTreeCellRendererComponent(JTree _tree, Object _value, boolean _selected, boolean _expanded, + boolean _leaf, int _row, boolean _hasFocus) { + + + + DefaultMutableTreeTableNode node= (DefaultMutableTreeTableNode) _value; + + if(node.getUserObject() instanceof JLabel){ + JLabel entry = (JLabel) node.getUserObject(); + + setText(entry.getText()); + setIcon(entry.getIcon()); + if (_selected) { + setBackground(HIGHLIGHT_COLOR); + setForeground(Color.white); + } else { + setBackground(Color.white); + setForeground(Color.black); + } + return this; + } + else if (node.getUserObject() instanceof SondeCouple){ + SondeCouple entry = (SondeCouple) node.getUserObject(); + defaultZone_.setText(entry.name); + return defaultZone_; + } + else + return rendererClassique_.getTreeCellRendererComponent(_tree, _value, _selected, _expanded, _leaf, _row, + _hasFocus); + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -15,9 +15,6 @@ import javax.swing.filechooser.FileFilter; -import com.memoire.bu.BuFileFilter; -import com.memoire.bu.BuResource; - import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.CtuluLib; @@ -30,7 +27,6 @@ import org.fudaa.ctulu.gui.CtuluFileChooser; import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; - import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; @@ -38,18 +34,22 @@ import org.fudaa.dodico.reflux.io.CrbFileFormat; import org.fudaa.dodico.rubar.io.RubarCLIFileFormat; import org.fudaa.dodico.rubar.io.RubarTARFileFormat; +import org.fudaa.dodico.telemac.io.ScopeGENEFileFormat; +import org.fudaa.dodico.telemac.io.ScopeSFileFormat; +import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; - import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGExporter; import org.fudaa.ebli.courbe.EGGraphe; - import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.impl.FudaaGuiLib; import org.fudaa.fudaa.commun.impl.FudaaImportCsvPanel; +import com.memoire.bu.BuFileFilter; +import com.memoire.bu.BuResource; + /** * @author fred deniger * @version $Id: FudaaCourbeImporter.java,v 1.8 2007-06-29 15:09:42 deniger Exp $ @@ -95,7 +95,10 @@ if (op.getSource() == null) { _ui.warn(FudaaLib.getS("Import"), FudaaLib.getS("Pas de courbes \xE0 importer")); } else { + if (op.getSource() instanceof EvolutionReguliereInterface[]) _target.importCourbes((EvolutionReguliereInterface[]) op.getSource(), _mng, prog); + else + _target.importCourbes((ScopeStructure) op.getSource(), _mng, prog); } } _ui.unsetMainMessage(); @@ -107,9 +110,16 @@ public interface Target { void importCourbes(EvolutionReguliereInterface[] _crb, CtuluCommandManager _mng, ProgressionInterface _prog); + + /** + * a utiliser pour les formats scope + * + */ + void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog); + } - private static class ExportAction extends EbliActionSimple { + public static class ExportAction extends EbliActionSimple { final EGGraphe graphe_; final CtuluUI impl_; @@ -130,7 +140,7 @@ new ExportAction(_graphe, _imp) }; } - private static class ImportAction extends EbliActionSimple { + public static class ImportAction extends EbliActionSimple { final FudaaCourbeImporter.Target target_; final FudaaCommonImplementation ui_; final CtuluCommandManager mng_; @@ -178,6 +188,9 @@ r.add(CLTransitoireFileFormat.getInstance()); r.add(RubarTARFileFormat.getInstance()); r.add(RubarCLIFileFormat.getInstance()); + r.add(ScopeSFileFormat.getInstance()); + r.add(ScopeGENEFileFormat.getInstance()); + final FileFormat[] rf = new FileFormat[r.size()]; r.toArray(rf); return rf; Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -0,0 +1,51 @@ +package org.fudaa.fudaa.tr.common; + +import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.mesure.EvolutionReguliereInterface; +import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; + +/** + * Manager pour gerer l'importation de courbes au format scope. + * + * @author Adrien Hadoux + * + */ +public class TrCourbeSpatialManager implements FudaaCourbeImporter.Target { + + EGGraphe graphe_; + MvProfileTreeModel modelGraphe_; + /** + * indique si la courbe a importer est correcte + */ + private boolean enabled = true; + TrCommonImplementation impl_; + + + public TrCourbeSpatialManager(EGGraphe _graphe, TrCommonImplementation _impl) { + super(); + graphe_ = _graphe; + impl_ = _impl; + if (_graphe.getModel() instanceof MvProfileTreeModel) + modelGraphe_ = (MvProfileTreeModel) _graphe.getModel(); + else + enabled = false; + } + + public void importCourbes(EvolutionReguliereInterface[] _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + } + + public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + if (!enabled) { + impl_.error("Le graphe n'est pas compatible. Il ne s'agit pas de profil spatiaux."); + return; + } else { + // blablabli recup de ma structure + + } + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -19,15 +19,11 @@ import javax.swing.JComboBox; import javax.swing.tree.TreePath; -import com.memoire.bu.BuResource; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluRange; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluDialogPanel; - import org.fudaa.dodico.h2d.H2dEvolutionFrontiereLiquide; import org.fudaa.dodico.h2d.H2dParameters; import org.fudaa.dodico.h2d.type.H2dVariableType; @@ -35,7 +31,7 @@ import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.mesure.EvolutionReguliereAbstract; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; - +import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbe; @@ -45,11 +41,13 @@ import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGObject; import org.fudaa.ebli.palette.BPalettePlageDefault; - import org.fudaa.fudaa.commun.courbe.FudaaCourbeCreateGroupPanel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; +import com.memoire.bu.BuResource; +import com.memoire.fu.FuLog; + /** * Il est suppose qu'il n'y a qu'un seul graphe dessine. * @@ -464,4 +462,7 @@ fireGlobalChanged(); } + public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + } + } \ No newline at end of file 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-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -526,11 +526,16 @@ public void fillWithInfo(final InfoData _m) { _m.setTitle(getTitle()); if (isSondeActive()) { - getIsoModelAbstract().fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.x_, sondePt_.y_, getTitle()); + fillWithInterpolateInfo(_m); } else { modele_.fillWithInfo(_m, this); } } + + + public void fillWithInterpolateInfo(final InfoData _m) { + getIsoModelAbstract().fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.x_, sondePt_.y_, getTitle()); + } public final String getDataDescription() { return getTitle(); 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-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -16,6 +16,7 @@ import org.fudaa.ctulu.CtuluUI; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; +import org.fudaa.ebli.palette.BPaletteInfo; import org.fudaa.fudaa.sig.layer.FSigVisuPanel; import org.fudaa.fudaa.sig.layer.FSigVisuPanelController; @@ -79,7 +80,11 @@ } return tabPalettes_; } - + + public BPaletteInfo getPaletteInfoModel() { + return ((BPaletteInfo) mapTabPalettes_.get("INFOS").buildContentPane()); + } + @Override public FSigVisuPanel getVisuPanel() { return super.getVisuPanel(); 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-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -37,7 +37,9 @@ import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorLegende; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; +import org.fudaa.fudaa.tr.common.TrCourbeSpatialManager; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.netbeans.api.visual.widget.Widget; @@ -559,6 +561,12 @@ // TODO trop dangereux... // listeActions.add(new TrPostCourbeAddPointsAction(projet_.impl_, _graphe.getGraphe(), _calque)); listeActions.add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); + + //--ajout des actions import export format scope --// + listeActions.add(new FudaaCourbeImporter.ImportAction(new TrCourbeSpatialManager(_graphe.getGraphe(), + projet_.impl_), projet_.impl_, creator.getGraphe().getCmd())); + listeActions.add( new FudaaCourbeImporter.ExportAction(creator.getGraphe(), projet_.impl_)); + _controller.addFonctionsSpecific(listeActions); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -13,19 +13,18 @@ import javax.swing.Action; -import com.memoire.bu.BuInformationsDocument; - +import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluHtmlWriter; import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluHelpComponent; - import org.fudaa.dodico.h2d.resource.H2dResource; import org.fudaa.dodico.h2d.rubar.H2dRubarTarageListener; import org.fudaa.dodico.h2d.rubar.H2dRubarTarageMng; import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.dodico.mesure.EvolutionReguliereAbstract; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; - +import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGAxeVertical; @@ -33,7 +32,6 @@ import org.fudaa.ebli.courbe.EGFilleSimple; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGTableGraphePanel; - import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.tr.common.TrCourbeUseAction; @@ -41,6 +39,8 @@ import org.fudaa.fudaa.tr.common.TrResource; import org.fudaa.fudaa.tr.common.TrRubarCourbeTarageUseFinder; +import com.memoire.bu.BuInformationsDocument; + /** * @author Fred Deniger * @version $Id: TrRubarTarageCourbesManager.java,v 1.25 2007-04-30 14:22:40 deniger Exp $ @@ -149,4 +149,7 @@ return true; } + public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-26 15:21:15
|
Revision: 3992 http://fudaa.svn.sourceforge.net/fudaa/?rev=3992&view=rev Author: hadouxad Date: 2008-09-26 15:21:04 +0000 (Fri, 26 Sep 2008) Log Message: ----------- exportation scopeS, scopeGen Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeKeyWord.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeKeyWord.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeKeyWord.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeKeyWord.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -15,8 +15,8 @@ public final static String TYPE_COURBE_SPATIALE = "ScopT"; public final static String TYPE_COURBE_MIXTE = "SCOPGENE"; public final static String SYMBOL_VALUE_UNDEFINED = "*"; + public final static long VALUE_UNDEFINED = 9999999; - public ScopeKeyWord() { } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -185,10 +185,11 @@ for (int i = 0; i < nbFields; i++) { // on inscrit la valeur pour la variable du pas de temps // correspondant - double value =0; + double value = key.VALUE_UNDEFINED; if (!key.isUndefined(in_.stringField(i))) value = in_.doubleField(i); - + + structure.addValueForVariableAtPdt(value, i, valuePasDetemps); } } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -134,9 +134,11 @@ if (!key.isBlocCommentaireSorT(in_.getLine())) { // -- on recupere toutes les valeurs de la variable --// for (int i = 0; i < structure.getNbVariables(); i++) { - double val = in_.doubleField(i); + double value = key.VALUE_UNDEFINED; + if (!key.isUndefined(in_.stringField(i))) + value = in_.doubleField(i); // ajout dans la map - structure.addValueForVariable(val, i); + structure.addValueForVariable(value, i); } } in_.readFields(); Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -84,6 +84,23 @@ public double getX(int i) { return getAllX().get(i); } + + + private void insertX(double x) { + getAllX().add(x); + } + /** + * Methode qui insert le x dans les variables que si il n'existe pas deja. + * + * @param x + */ + public void insertNewX(double x) { + + for (int i = 0; i < getAllX().size(); i++) + if (x == getX(i)) + return; + insertX(x); + } /** * Retourne le nombre de valeur pour chaque variables @@ -111,8 +128,11 @@ for (int i = 0; i < getNbVariables(); i++) { if (i > 0) brochetteVal += " "; + if (data_.get(listeVariales_.get(i)).get(indiceValue) != KEY.VALUE_UNDEFINED) brochetteVal += data_.get(listeVariales_.get(i)).get(indiceValue); - + else + brochetteVal += KEY.SYMBOL_VALUE_UNDEFINED; + } return brochetteVal; } @@ -171,11 +191,43 @@ public void addVariable(String ligne) { ligne = ligne.replace(KEY.getBlocCommentaireGENE(), ""); listeVariales_.add(ligne); - - - + } + + + + public List<Double> getAllX(String pdt) { + return data_.get(pdt).get(0); } + + /** + * retourne un x sp\xE9cifi\xE9. + * + * @param i + * @return + */ + public double getX(int i, String pdt) { + return getAllX(pdt).get(i); + } + + private void insertX(double x, String pdt) { + getAllX(pdt).add(x); + } + + /** + * Methode qui insert le x dans les variables que si il n'existe pas deja. + * + * @param x + */ + public void insertNewX(double x, String pdt) { + + for (int i = 0; i < getAllX(pdt).size(); i++) + if (x == getX(i, pdt)) + return; + insertX(x, pdt); + } + + public void addPasDeTemps(String ligne) { ligne = ligne.replace(KEY.getBlocCommentaireGENE(), ""); @@ -258,7 +310,10 @@ ArrayList<Double> listeValueOfVar = getListValueForVariableForPDT(pasDetemps, i); if (i != 0) ligneBrochette += " "; + if (listeValueOfVar.get(indiceValue) != KEY.VALUE_UNDEFINED) ligneBrochette += listeValueOfVar.get(indiceValue); + else + ligneBrochette += KEY.SYMBOL_VALUE_UNDEFINED; } return ligneBrochette; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -29,8 +29,8 @@ import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.ctulu.gui.CtuluTableCsvWriter; import org.fudaa.ctulu.gui.CtuluTableExcelWriter; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.ctulu.gui.CtuluWriter; -import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; @@ -215,7 +215,7 @@ // --ajout des formats scope --// liste.add(new FudaaWriterScopeS()); - + liste.add(new FudaaWriterScopeGENE()); return liste; } Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -0,0 +1,160 @@ +package org.fudaa.fudaa.commun.courbe; + +import java.io.File; +import java.io.IOException; + +import jxl.write.WriteException; + +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gui.CtuluTableModelInterface; +import org.fudaa.ctulu.gui.CtuluWriter; +import org.fudaa.dodico.telemac.io.ScopeGENEFileFormat; +import org.fudaa.dodico.telemac.io.ScopeKeyWord; +import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.ebli.courbe.EGAxeHorizontal; +import org.fudaa.ebli.courbe.EGCourbe; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGExportData; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.courbe.EGObject; + +import com.memoire.bu.BuFileFilter; + +/** + * Writer, passe de la structure Eggraphe a la structure scopeGENE. + * + * @author Adrien Hadoux + * + */ +public class FudaaWriterScopeGENE implements CtuluWriter { + + ScopeGENEFileFormat format_; + File destination_; + ScopeStructure.Gene structure_; + String extension_ = ".scopGENE"; + BuFileFilter filter_; + + + public FudaaWriterScopeGENE(){ + format_ = ScopeGENEFileFormat.getInstance(); + filter_ = format_.createFileFilter(); + + } + + public BuFileFilter getFilter() { + return filter_; + } + + public String getMostPopularExtension() { + return extension_; + } + + public void setFile(File _f) { + destination_ = _f; + + } + + public void setModel(CtuluTableModelInterface _model) { + + structure_ = new ScopeStructure.Gene(); + + //-- data qui contient les courbes choisies --// + EGExportData data = (EGExportData) _model; + EGGraphe graphe_ = data.getGraphe(); + EGCourbe[] listeChoixUser = data.getCourbes(); + + //-- on ajoute un pas de temps qui decrit le graphe --// + String keyPDt="contenu graphe"; + structure_.addPasDeTemps(keyPDt); + + + + //--on ajoute tous les x donn\xE9s de la courbe= UNION DE TOUTES LES COURBES--// + final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); + for (int i = listeChoixUser.length - 1; i >= 0; i--) { + final EGCourbe c = listeChoixUser[i]; + for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { + final double x = c.getModel().getX(j); + // if ( (h.containsPoint(x))) { + // -- on ajoute le x pour les variables x si il n existe pas deja --// + structure_.insertNewX(x,keyPDt); + // } + } + } + + //-- ON INSERE LES Y CORRESPONDANTS POUR CHAQUE VARIABLES--// + for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { + final EGObject ci = graphe_.getModel().getEGObject(i); + if (ci instanceof EGGroup) { + EGGroup groupe = (EGGroup) ci; + + boolean hasAlreadyRegistered=false; + + + for (int k = 0; k < groupe.getChildCount(); k++) { + EGCourbeChild courbe = groupe.getCourbeAt(k); + + boolean selected = false; + for (int j = 0; !selected && j < listeChoixUser.length; j++) + if (listeChoixUser[j] == courbe) + selected = true; + + if (selected) { + + // -- il y a au moins une courbe selectionnee pour la variable, on + // va donc enregistrer la variable dans la structure + if (!hasAlreadyRegistered) { + hasAlreadyRegistered = true; + structure_.addVariable(groupe.getTitle()); + } + + // --ajout des valeurs pour chaque X--/ + for (int g = 0; g < structure_.getAllX(keyPDt).size(); g++) { + //-- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis --// + double x = structure_.getX(g,keyPDt); + + //-- on v\xE9rifie que le x existe pour la courbe actuelle --// + boolean xExistForCourbe = false; + int emplacementYcorrespondant = -1; + for (int l = 0; !xExistForCourbe && l < courbe.getModel().getNbValues(); l++) { + if (courbe.getModel().getX(l) == x) { + xExistForCourbe = true; + emplacementYcorrespondant = l; + } + } + + //double yInterpole = courbe.interpol(x); + + // -- si le x existe dans la courbe alors on inscrit son y + // correspondant pour la bonne variable--// + if (xExistForCourbe) + structure_.addValueForVariableAtPdt(courbe.getModel().getY(emplacementYcorrespondant), structure_.getNbVariables()-1, keyPDt); + else + // -- on enregistre une valeure foireuse. + structure_.addValueForVariableAtPdt(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables()-1, keyPDt); + } + + } + } + + + + } + + } + + + + } + + public void write(ProgressionInterface _p) throws IOException, WriteException { + format_.getLastVersionInstance(null).write(destination_, structure_, null); + + } + + public boolean allowFormatData() { + return false; + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -8,6 +8,7 @@ import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluTableModelInterface; import org.fudaa.ctulu.gui.CtuluWriter; +import org.fudaa.dodico.telemac.io.ScopeKeyWord; import org.fudaa.dodico.telemac.io.ScopeSFileFormat; import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.ebli.courbe.EGAxeHorizontal; @@ -20,6 +21,13 @@ import com.memoire.bu.BuFileFilter; + +/** + * Writer, passe de la structure Eggraphe a la structure scopeS. + * + * @author Adrien Hadoux + * + */ public class FudaaWriterScopeS implements CtuluWriter { ScopeSFileFormat format_; @@ -48,55 +56,190 @@ } + public void setModel(CtuluTableModelInterface _model) { + setModelVersionInterpoleY(_model); + } + + /** + * Cette version recupere l'union des X de toutes les courebs pour chaque + * variable du graphe. Ecrit le y du x si x appartient a la courbe sinon ecrit + * la valeur interpol\xE9e de x + * + * @param _model + */ + public void setModelVersionInterpoleY(CtuluTableModelInterface _model) { + + structure_ = new ScopeStructure.SorT(); + + // -- data qui contient les courbes choisies --// + EGExportData data = (EGExportData) _model; + EGGraphe graphe_ = data.getGraphe(); + EGCourbe[] listeChoixUser = data.getCourbes(); + + // -- on ajoute la var des x, debut de chaque ligne de valeurs --// + structure_.addVariable("X"); + + // --on ajoute tous les x donn\xE9s de la courbe= UNION DE TOUTES LES + // COURBES--// + final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); + for (int i = listeChoixUser.length - 1; i >= 0; i--) { + final EGCourbe c = listeChoixUser[i]; + for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { + final double x = c.getModel().getX(j); + // if ( (h.containsPoint(x))) { + // -- on ajoute le x pour les variables x si il n existe pas deja --// + structure_.insertNewX(x); + // } + } + } + + // -- ON INSERE LES Y CORRESPONDANTS POUR CHAQUE VARIABLES--// + for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { + final EGObject ci = graphe_.getModel().getEGObject(i); + if (ci instanceof EGGroup) { + EGGroup groupe = (EGGroup) ci; + + boolean hasAlreadyRegistered = false; + + for (int k = 0; k < groupe.getChildCount(); k++) { + EGCourbeChild courbe = groupe.getCourbeAt(k); + + boolean selected = false; + for (int j = 0; !selected && j < listeChoixUser.length; j++) + if (listeChoixUser[j] == courbe) + selected = true; + + if (selected) { + + // -- il y a au moins une courbe selectionnee pour la variable, on + // va donc enregistrer la variable dans la structure + if (!hasAlreadyRegistered) { + hasAlreadyRegistered = true; + structure_.addVariable(groupe.getTitle()); + } + + // --ajout des valeurs pour chaque X--/ + for (int g = 0; g < structure_.getAllX().size(); g++) { + // -- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis + // --// + double x = structure_.getX(g); + + // -- on v\xE9rifie que le x existe pour la courbe actuelle --// + // boolean xExistForCourbe = false; + // int emplacementYcorrespondant = -1; + // for (int l = 0; !xExistForCourbe && l < + // courbe.getModel().getNbValues(); l++) { + // if (courbe.getModel().getX(l) == x) { + // xExistForCourbe = true; + // emplacementYcorrespondant = l; + // } + // } + + double yInterpole = courbe.interpol(x); + + // -- si le x existe dans la courbe alors on inscrit son y + // correspondant pour la bonne variable--// + + structure_.addValueForVariable(yInterpole, structure_ + .getNbVariables() - 1); + + } + + } + } + + } + + } + + } + + + /** + * Cette version recupere l'union des X de toutes les courebs pour chaque + * variable du graphe. Ecrit le y du x que si x de l'union appartient a la courbe + * + * @param _model + */ + public void setModelVersionUnionXcoubesY(CtuluTableModelInterface _model) { + structure_ = new ScopeStructure.SorT(); //-- data qui contient les courbes choisies --// EGExportData data = (EGExportData) _model; EGGraphe graphe_ = data.getGraphe(); - EGCourbe[] liste=data.getCourbes(); + EGCourbe[] listeChoixUser = data.getCourbes(); //-- on ajoute la var des x, debut de chaque ligne de valeurs --// structure_.addVariable("X"); - //--on ajoute tous les x donn\xE9s de la courbe--// + - + //--on ajoute tous les x donn\xE9s de la courbe= UNION DE TOUTES LES COURBES--// final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); - for (int i = liste.length - 1; i >= 0; i--) { - final EGCourbe c = liste[i]; + for (int i = listeChoixUser.length - 1; i >= 0; i--) { + final EGCourbe c = listeChoixUser[i]; for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { final double x = c.getModel().getX(j); - if ( (h.containsPoint(x))) { - //-- on ajoute le x pour les variables x --// - structure_.addValueForVariable(x,0); - } + // if ( (h.containsPoint(x))) { + // -- on ajoute le x pour les variables x si il n existe pas deja --// + structure_.insertNewX(x); + // } } } - + //-- ON INSERE LES Y CORRESPONDANTS POUR CHAQUE VARIABLES--// for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { final EGObject ci = graphe_.getModel().getEGObject(i); if (ci instanceof EGGroup) { EGGroup groupe = (EGGroup) ci; - structure_.addVariable(groupe.getTitle()); + boolean hasAlreadyRegistered = false; + for (int k = 0; k < groupe.getChildCount(); k++) { EGCourbeChild courbe = groupe.getCourbeAt(k); boolean selected = false; - for (int j = 0; !selected && j < liste.length; j++) - if (liste[j] == courbe) + for (int j = 0; !selected && j < listeChoixUser.length; j++) + if (listeChoixUser[j] == courbe) selected = true; if (selected) { + + // -- il y a au moins une courbe selectionnee pour la variable, on + // va donc enregistrer la variable dans la structure + if (!hasAlreadyRegistered) { + hasAlreadyRegistered = true; + structure_.addVariable(groupe.getTitle()); + } + // --ajout des valeurs pour chaque X--/ for (int g = 0; g < structure_.getAllX().size(); g++) { //-- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis --// double x = structure_.getX(g); - double yInterpole = courbe.interpol(x); - structure_.addValueForVariable(yInterpole, structure_.getNbVariables() - 1); + + //-- on v\xE9rifie que le x existe pour la courbe actuelle --// + boolean xExistForCourbe = false; + int emplacementYcorrespondant = -1; + for (int l = 0; !xExistForCourbe && l < courbe.getModel().getNbValues(); l++) { + if (courbe.getModel().getX(l) == x) { + xExistForCourbe = true; + emplacementYcorrespondant = l; + } + } + + //double yInterpole = courbe.interpol(x); + + // -- si le x existe dans la courbe alors on inscrit son y + // correspondant pour la bonne variable--// + if (xExistForCourbe) + structure_.addValueForVariable(courbe.getModel().getY(emplacementYcorrespondant), structure_ + .getNbVariables() - 1); + else + // -- on enregistre une valeure foireuse. + structure_.addValueForVariable(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables() - 1); } } @@ -112,13 +255,16 @@ } + + + public void write(ProgressionInterface _p) throws IOException, WriteException { format_.getLastVersionInstance(null).write(destination_, structure_, null); } public boolean allowFormatData() { - return true; + return false; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-29 15:44:18
|
Revision: 4006 http://fudaa.svn.sourceforge.net/fudaa/?rev=4006&view=rev Author: hadouxad Date: 2008-09-29 15:43:55 +0000 (Mon, 29 Sep 2008) Log Message: ----------- - correction bug legende - convertisseur structure scope en evolutionReguliere - Creation de l action et de l'interface des bilans - Correction des appelation multi fichier Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.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/common/TrImportCourbeScopeManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/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/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -1,6 +1,7 @@ package org.fudaa.dodico.telemac.io; import java.io.File; +import java.util.Map; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.ProgressionInterface; @@ -9,6 +10,7 @@ import org.fudaa.ctulu.fileformat.FileWriteOperationAbstract; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; +import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; /** * Manager de fichiers au format scope. Utilis\xE9 pour la cr\xE9ation des graphes. au @@ -17,7 +19,7 @@ * @author Adrien Hadoux * */ -public class ScopeGENEFileFormat extends FileFormatUnique { +public class ScopeGENEFileFormat extends FileFormatUnique implements EvolutionFileFormatVersion { static final ScopeGENEFileFormat INSTANCE = new ScopeGENEFileFormat(); @@ -48,5 +50,9 @@ public FileWriteOperationAbstract createWriter() { return new ScopeWriterGENE(this); } + + public CtuluIOOperationSynthese readEvolutions(File _f, ProgressionInterface _prog, Map _options) { + return super.read(_f, _prog); + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -9,6 +9,7 @@ import org.fudaa.ctulu.fileformat.FileFormatVersionInterface; import org.fudaa.dodico.fortran.FileOpReadCharSimpleAbstract; import org.fudaa.dodico.h2d.resource.H2dResource; +import org.fudaa.dodico.mesure.EvolutionReguliere; /** * Classe reader de fichier au format scope Gene, evolu\xE9 par rapport a s ou t. @@ -60,7 +61,7 @@ * * @return */ - ScopeStructure readStructure() { + EvolutionReguliere[] readStructure() { if (super.in_ == null) { analyze_.addError(H2dResource.getS("Flux d'entr\xE9e non trouv\xE9"), 0); @@ -118,7 +119,7 @@ } } catch (EOFException Exc) { - return structure; + return structure.returnEvolReguliere(); } } catch (IOException e) { Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -9,6 +9,7 @@ import org.fudaa.ctulu.fileformat.FileFormatVersionInterface; import org.fudaa.dodico.fortran.FileOpReadCharSimpleAbstract; import org.fudaa.dodico.h2d.resource.H2dResource; +import org.fudaa.dodico.mesure.EvolutionReguliere; /** * Classe reader de fichier au format scope. Utilise fortranReader @@ -59,7 +60,7 @@ * * @return */ - ScopeStructure readStructure() { + EvolutionReguliere[] readStructure() { if (super.in_ == null) { @@ -93,7 +94,7 @@ }catch(EOFException Exc){ - return structure; + return structure.returnEvolReguliere(); } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -1,6 +1,7 @@ package org.fudaa.dodico.telemac.io; import java.io.File; +import java.util.Map; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.ProgressionInterface; @@ -9,6 +10,7 @@ import org.fudaa.ctulu.fileformat.FileWriteOperationAbstract; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; +import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; /** * Manager de fichiers au format scope. Utilis\xE9 pour la cr\xE9ation des graphes. au @@ -17,7 +19,7 @@ * @author Adrien Hadoux * */ -public class ScopeSFileFormat extends FileFormatUnique { +public class ScopeSFileFormat extends FileFormatUnique implements EvolutionFileFormatVersion { static final ScopeSFileFormat INSTANCE = new ScopeSFileFormat(); @@ -48,5 +50,9 @@ public FileWriteOperationAbstract createWriter() { return new ScopeWriterSorT(this); } + + public CtuluIOOperationSynthese readEvolutions(File _f, ProgressionInterface _prog, Map _options) { + return super.read(_f, _prog); + } } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -5,6 +5,8 @@ import java.util.List; import java.util.Map; +import org.fudaa.dodico.mesure.EvolutionReguliere; + /** * Structure de donn\xE9es utilis\xE9e pour la lecture des fichiers scope. * @@ -145,6 +147,37 @@ return brochetteVal; } + /** + * Transforme la structure en evol regulieres. + * + * @return + */ + public EvolutionReguliere[] returnEvolReguliere() { + EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbVariables()]; + + // -- on parcours toutes les variables --// + for (int i = 0; i < getNbVariables(); i++) { + String nomVar = getVariable(i); + + List<Double> listeX = getAllX(); + List<Double> listeY = getListValueForVariable(i); + + double[] tabX = new double[listeX.size()]; + double[] tabY = new double[listeY.size()]; + + for (int j = 0; j < listeX.size(); j++) { + tabX[i] = listeX.get(i); + tabY[i] = listeY.get(i); + + } + + evolReg[i] = new EvolutionReguliere(tabX, tabY, false); + evolReg[i].setNom("courbe de " + nomVar); + } + return evolReg; + } + + @Override public void printResults() { System.err.print("\n Contenu du fichier scope"); @@ -344,7 +377,39 @@ return titles_.get(i); } + + public EvolutionReguliere[] returnEvolReguliere() { + EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbPasDeTemps() * getNbVariables()]; + // -- on parcours tous les pas de temps --// + for (int h = 0; h < getNbPasDeTemps(); h++) { + + String pdt = getPasDeTemps(h); + + // -- on parcours toutes les variables --// + for (int i = 0; i < getNbVariables(); i++) { + String nomVar = getVariable(i); + + List<Double> listeX = getAllX(pdt); + List<Double> listeY = getListValueForVariableForPDT(pdt, i); + + double[] tabX = new double[listeX.size()]; + double[] tabY = new double[listeY.size()]; + + for (int j = 0; j < listeX.size(); j++) { + tabX[i] = listeX.get(i); + tabY[i] = listeY.get(i); + + } + + evolReg[i] = new EvolutionReguliere(tabX, tabY, false); + evolReg[i].setNom("courbe de " + nomVar); + } + + } + return evolReg; + } + @Override public void printResults() { // titres Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -1,6 +1,7 @@ package org.fudaa.dodico.telemac.io; import java.io.File; +import java.util.Map; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.ProgressionInterface; @@ -9,6 +10,7 @@ import org.fudaa.ctulu.fileformat.FileWriteOperationAbstract; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; +import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; /** * Manager de fichiers au format scope. Utilis\xE9 pour la cr\xE9ation des graphes. au @@ -17,7 +19,7 @@ * @author Adrien Hadoux * */ -public class ScopeTFileFormat extends FileFormatUnique { +public class ScopeTFileFormat extends FileFormatUnique implements EvolutionFileFormatVersion { static final ScopeTFileFormat INSTANCE = new ScopeTFileFormat(); @@ -48,5 +50,9 @@ public FileWriteOperationAbstract createWriter() { return new ScopeWriterSorT(this); } + + public CtuluIOOperationSynthese readEvolutions(File _f, ProgressionInterface _prog, Map _options) { + return super.read(_f, _prog); + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -153,6 +153,11 @@ if (standardActionGroup_ == null) { buildButtonGroupStandard(); } + if (standardActionGroup_ == null) { + buildButtonGroupSpecifique(); + } + + } protected EbliActionInterface createRepereAction() { @@ -318,6 +323,11 @@ // this.updateMapKeyStroke(standardActionGroup_); } + + public EbliActionInterface[] buildButtonGroupSpecifique() { + return null; + } + protected final EbliActionInterface[] getSpecificActionGroup() { return specificActionGroup_; } 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 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -52,6 +52,9 @@ */ boolean isStructureModifiable(); + + + /** * @return true si le contenu de courbe peut etre modifie */ Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -20,7 +20,6 @@ import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; import org.netbeans.api.visual.border.BorderFactory; import org.netbeans.api.visual.layout.LayoutFactory.SerialAlignment; @@ -187,6 +186,14 @@ EbliScene scene_; + public EbliScene getScene() { + return scene_; + } + + public void setScene(EbliScene _scene) { + scene_ = _scene; + } + public CalqueLegendeWidgetAdapter(EbliScene _scene, BArbreCalqueModel model) { super(); scene_ = _scene; @@ -210,16 +217,16 @@ * * @return EbliNode cree ajoute a la scene. */ - public EbliNode createLegende(Point _location) { - + public EbliNode createLegende(Point _location, EbliScene _scene) { + setScene(_scene); EbliNodeDefault def = new EbliNodeDefault(); def.setPreferedLocation(_location); // def.setPreferedSize(new Dimension(150, 250)); def.setCreator(new EbliWidgetCreatorLegende(legendePanel_)); def.setTitle("L\xE9gende calque"); // TODO non stable - scene_.addNode(def); - scene_.refresh(); + _scene.addNode(def); + _scene.refresh(); return def; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -25,6 +25,7 @@ import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; +import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliComponentFactory; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BSelecteurListComboBox; @@ -64,7 +65,7 @@ BuMenuBar menuCalque_; JComponent panelTreeCalque_; - + public boolean alreadyCreate_; BuToolBar toolbarCalque_; EbliWidgetVueCalque widgetCalque_; @@ -87,7 +88,26 @@ } + /** + * ajoute des toolsbuton specifiques si pas deja ajoutes. + */ + public void addFonctionsSpecific(ArrayList<EbliActionSimple> _listeActions) { + + if (!fonctionsAlreadySpecified()) { + alreadyCreate_ = true; + + for (Iterator<EbliActionSimple> it = _listeActions.iterator(); it.hasNext();) { + EbliActionSimple action = it.next(); + toolbarCalque_.add(action.buildToolButton(EbliComponentFactory.INSTANCE)); + menuCalque_.getMenu(0).add(new JMenuItem(action)); + } + + } + + } + + /** * Methode a surcharger si on veut effectuer un traitement particulier apres duplication du widget. */ @Override @@ -134,7 +154,7 @@ if (widget_.getBounds() != null && widget_.getPreferredLocation() != null) { positionLegende.x = widget_.getPreferredLocation().x + widget_.getBounds().width + 20; positionLegende.y = widget_.getPreferredLocation().y; - setNodeLegende(legendeWidget_.createLegende(positionLegende)); + setNodeLegende(legendeWidget_.createLegende(positionLegende, widget_.getEbliScene())); } widget_.getEbliScene().refresh(); } else if (getNodeLegende().hasWidget()) @@ -427,5 +447,7 @@ public void setNodeLegende(final EbliNode node) { widgetCalque_.nodeLegende = node; } - + public boolean fonctionsAlreadySpecified() { + return alreadyCreate_; + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -45,7 +45,7 @@ positionLegende.x = _dest.getLocation().x + _dest.getIntern().getPreferredSize().width + 5; positionLegende.y = _dest.getPreferredLocation().y; EbliWidgetVueCalque vue = (EbliWidgetVueCalque) _dest.getIntern(); - vue.nodeLegende = _legende.createLegende(positionLegende); + vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene()); ((EbliWidgetControllerCalque) vue.getController()).setLegendeWidget(_legende); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -103,8 +103,9 @@ } else { if (op.getSource() instanceof EvolutionReguliereInterface[]) _target.importCourbes((EvolutionReguliereInterface[]) op.getSource(), _mng, prog); - else - _target.importCourbes((ScopeStructure) op.getSource(), _mng, prog); + // else + // _target.importCourbes((ScopeStructure) op.getSource(), _mng, + // prog); } } _ui.unsetMainMessage(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -75,7 +75,10 @@ // -- data qui contient les courbes choisies --// EGExportData data = (EGExportData) _model; EGGraphe graphe_ = data.getGraphe(); - EGCourbe[] listeChoixUser = data.getCourbes(); + + // -- on prends UNIQUEMENT la premiere courbe choisie --// + EGCourbe[] listeChoixUser = new EGCourbe[1]; + listeChoixUser[0] = data.getCourbes()[0]; // -- on ajoute la var des x, debut de chaque ligne de valeurs --// structure_.addVariable("X"); 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 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -98,6 +98,15 @@ } + + + public H2dVariableType[] getVariables() { + + List values = getShownVar(); + + return null; + } + public boolean isStructureModifiable() { return true; } @@ -212,7 +221,12 @@ return true; } - List getShownVar() { + /** + * retourne la liste des variables du graphe. + * + * @return + */ + public List getShownVar() { final List res = new ArrayList(getNbEGObject() - 1); for (int i = getNbEGObject() - 1; i >= 0; i--) { final EGGroup g = getGroup(i); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -1,7 +1,10 @@ package org.fudaa.fudaa.tr.common; +import java.util.List; + import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.dodico.telemac.io.ScopeStructure.Gene; @@ -19,7 +22,7 @@ public class TrImportCourbeScopeManager implements FudaaCourbeImporter.Target { EGGraphe graphe_; - MvProfileTreeModel modelGraphe_; + /** * indique si la courbe a importer est correcte */ @@ -31,10 +34,7 @@ super(); graphe_ = _graphe; impl_ = _impl; - // if (_graphe.getModel() instanceof MvProfileTreeModel) - modelGraphe_ = (MvProfileTreeModel) _graphe.getModel(); - // else - // enabled = false; + } public void importCourbes(EvolutionReguliereInterface[] _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { @@ -69,15 +69,31 @@ */ public void importCourbesSorT(ScopeStructure.SorT s, CtuluCommandManager _mng, ProgressionInterface _prog) { + EvolutionReguliere[] evolReg=new EvolutionReguliere[s.getNbVariables()]; + // -- on parcours toutes les variables --// for (int i = 0; i < s.getNbVariables(); i++) { - - // --on recherche si cette variable n'existe pas deja dans le graphe --// - // graphe_.getModel().get + String nomVar = s.getVariable(i); - } + List<Double> listeX=s.getAllX(); + List<Double> listeY=s.getListValueForVariable(i); + + double[] tabX=new double[listeX.size()]; + double[] tabY=new double[listeY.size()]; + + for(int j=0;j<listeX.size();j++){ + tabX[i]=listeX.get(i); + tabY[i]=listeY.get(i); + + } + + evolReg[i]=new EvolutionReguliere(tabX,tabY,false); - + + + + } + } 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-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -45,6 +45,8 @@ super(_ui); } + + @Override protected void buildButtonGroupNavigation() { if (navigationActionGroup_ != null) { return; } @@ -66,6 +68,24 @@ standardActionGroup_ = removePalettes(standardActionGroup_); } + + protected void buildButtonGroupSpecifiques() { + if (standardActionGroup_ != null) + return; + super.buildButtonGroupStandard(); + standardActionGroup_ = removePalettes(standardActionGroup_); + + + + + + + + + + + } + /** * recupere les palettes et initialise les actions */ Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBilanAction.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -0,0 +1,61 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.event.ActionEvent; + +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.fudaa.meshviewer.MvResource; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; + +import com.vividsolutions.jts.geom.LineString; + +/** + * Action pour le calcul des bilans. Cette action peut etre executee depuis le + * mode edition du calque pu le mode edition d'un profil spoatial. + * + * @author Adrien Hadoux + * + */ +public class TrPostBilanAction extends EbliActionSimple { + + // final MvProfileTarget src_; + final TrPostVisuPanel panel_; + final MvProfileTreeModel modelGraphe_; + final boolean startWithCalque; + TrPostCommonImplementation impl_; + + public TrPostBilanAction(final TrPostVisuPanel _visu, TrPostCommonImplementation impl) { + super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); + panel_ = _visu; + modelGraphe_ = null; + startWithCalque = true; + impl_ = impl; + } + + public TrPostBilanAction(final MvProfileTreeModel _model, TrPostCommonImplementation impl) { + super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); + modelGraphe_ = _model; + panel_ = null; + startWithCalque = false; + impl_ = impl; + } + + public void actionPerformed(final ActionEvent _e) { + // -- creation du wizard depusi le calque --// + if (startWithCalque) { + new TrPostDialogBilan(panel_, impl_); + } else { + new TrPostDialogBilan(modelGraphe_, impl_); + } + } + + + protected LineString getSelectedLine() { + // pas de calque s\xE9lectionn\xE9 + if (!(panel_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { + return null; + } + return ((ZCalqueAffichageDonneesInterface) panel_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); + } +} + Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -0,0 +1,319 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.AbstractAction; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.ListModel; +import javax.swing.ListSelectionModel; + +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; +import org.fudaa.fudaa.tr.common.TrResource; + +import com.memoire.bu.BuCharValidator; +import com.memoire.bu.BuStringValidator; +import com.memoire.bu.BuTextField; +import com.memoire.bu.BuValueValidator; +import com.vividsolutions.jts.geom.LineString; + +/** + * Wizard pour gerer les bilans des courbes. + * + * @author Adrien Hadoux + * + */ +public class TrPostDialogBilan { + + /** + * booleen qui indique si le wizard a \xE9t\xE9t lanc\xE9 depuis un calque + */ + + private boolean startWithCalque_ = true; + TrPostSource source_; + TrPostVisuPanel calque_; + MvProfileTreeModel modelGraphe_; + TrPostCommonImplementation impl_; + + // donnees graphiques + JDialog dialog_; + + // variables + private JPanel panelVariables_; + ListModel modelVariables_; + JList listVar_; + + // isolignes + private JPanel panelIsolignes_; + JCheckBox boxSelectLineAuto_ = new JCheckBox(TrResource.getS("Choisir l'isoligne du calque")); + JCheckBox boxSelectLineManu_ = new JCheckBox(TrResource.getS("Cr\xE9er manuellement lisoligne")); + BuTextField textX1 = new BuTextField(10); + BuTextField textX2 = new BuTextField(10); + BuTextField textY1 = new BuTextField(10); + BuTextField textY2 = new BuTextField(10); + + // results + JPanel panelResults_; + JLabel results_; + JButton ajouter = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); + /** + * Constructeur reserv\xE9 au calques + * + * @param _builderParams + * @param _calque + * @param _modelGraphe + * @param _panelVariables + * @param _source + */ + public TrPostDialogBilan(TrPostVisuPanel _calque, TrPostCommonImplementation impl) { + impl_ = impl; + calque_ = _calque; + modelGraphe_ = null; + source_ = calque_.getSource(); + modelVariables_ = source_.getNewVarListModel(); + startWithCalque_ = true; + + // -- construction de la dialog --// + buildDialog(); + } + + /** + * constructeur reserv\xE9 aux graphes spatiaux + * + * @param _builderParams + * @param _calque + * @param _modelGraphe + * @param _panelVariables + * @param _source + */ + public TrPostDialogBilan(MvProfileTreeModel _modelGraphe, TrPostCommonImplementation impl) { + calque_ = null; + impl_ = impl; + modelGraphe_ = _modelGraphe; + source_ = (TrPostSource) _modelGraphe.target_.getData(); + startWithCalque_ = false; + modelVariables_ = source_.getNewVarListModel(); + + // -- construction de la dialog --// + buildDialog(); + } + + /** + * Construit le panel des variables + * + * @return + */ + private JPanel buildIsoLignes() { + JPanel content=new JPanel(new BorderLayout()); + JPanel panelChek = new JPanel(new FlowLayout(FlowLayout.CENTER)); + panelChek.add(new JLabel(TrResource.getS("Choisir l'isoligne du calque"))); + panelChek.add(boxSelectLineAuto_); + panelChek.add(new JLabel(TrResource.getS("Cr\xE9er manuellement l'isoligne"))); + panelChek.add(boxSelectLineManu_); + content.add(panelChek, BorderLayout.NORTH); + + JPanel center = new JPanel(new GridLayout(2, 1)); + JPanel center1 = new JPanel(new FlowLayout(FlowLayout.CENTER)); + center1.add(new JLabel("Point 1 X:")); + center1.add(textX1); + center1.add(new JLabel("Y:")); + center1.add(textY1); + JPanel center2 = new JPanel(new FlowLayout(FlowLayout.CENTER)); + center2.add(new JLabel("Point 2 X:")); + center2.add(textX2); + center2.add(new JLabel("Y:")); + center2.add(textY2); + center.add(center1); + center.add(center2); + content.add(center, BorderLayout.CENTER); + content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de l'isoligne"))); + + // -- init et gestion des evenements --// + textX1.setCharValidator(BuCharValidator.FLOAT); + textX1.setStringValidator(BuStringValidator.FLOAT); + textX1.setValueValidator(BuValueValidator.FLOAT); + + textX2.setCharValidator(BuCharValidator.FLOAT); + textX2.setStringValidator(BuStringValidator.FLOAT); + textX2.setValueValidator(BuValueValidator.FLOAT); + + textY1.setCharValidator(BuCharValidator.FLOAT); + textY1.setStringValidator(BuStringValidator.FLOAT); + textY1.setValueValidator(BuValueValidator.FLOAT); + + textY2.setCharValidator(BuCharValidator.FLOAT); + textY2.setStringValidator(BuStringValidator.FLOAT); + textY2.setValueValidator(BuValueValidator.FLOAT); + + boxSelectLineAuto_.setAction(new AbstractAction() { + public void actionPerformed(ActionEvent _e) { + boolean enabled = false; + textX1.setEnabled(enabled); + textX2.setEnabled(enabled); + textY1.setEnabled(enabled); + textY2.setEnabled(enabled); + boxSelectLineManu_.setSelected(false); + if (boxSelectLineAuto_.isSelected()) + ajouter.setEnabled(true); + else + ajouter.setEnabled(false); + } + + }); + boxSelectLineManu_.setAction(new AbstractAction() { + public void actionPerformed(ActionEvent _e) { + boolean enabled = true; + textX1.setEnabled(enabled); + textX2.setEnabled(enabled); + textY1.setEnabled(enabled); + textY2.setEnabled(enabled); + boxSelectLineAuto_.setSelected(false); + if (boxSelectLineManu_.isSelected()) + ajouter.setEnabled(true); + else + ajouter.setEnabled(false); + } + + }); + + // -- test si une ligne a ete au prealable selectionnee par l user sur le + // calque --// + if (calque_ != null && getSelectedLineOfCalque() != null) { + boxSelectLineAuto_.setSelected(true); + boolean enabled = false; + textX1.setEnabled(enabled); + textX2.setEnabled(enabled); + textY1.setEnabled(enabled); + textY2.setEnabled(enabled); + boxSelectLineManu_.setSelected(false); + + } else { + boxSelectLineAuto_.setSelected(false); + boxSelectLineManu_.setSelected(true); + // impossible de choisir cetet checkbox + boxSelectLineAuto_.setEnabled(false); + } + + return content; + } + + + private JPanel buildresults() { + JPanel content = new JPanel(new FlowLayout(FlowLayout.LEFT)); + + results_ = new JLabel(""); + content.add(ajouter); + content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); + content.add(results_); + + content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("R\xE9sultats"))); + return content; + } + + protected LineString getSelectedLineOfCalque() { + // pas de calque s\xE9lectionn\xE9 + if (!(calque_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { + return null; + } + return ((ZCalqueAffichageDonneesInterface) calque_.getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); + } + + private JPanel buildVariables() { + JPanel content = new JPanel(new BorderLayout()); + listVar_ = new JList(modelVariables_); + listVar_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + content.add(new JScrollPane(listVar_), BorderLayout.CENTER); + content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de la variable"))); + content.add(new JLabel(TrResource.getS("Veuillez s\xE9lectionner la variable sur laquelle appliquer le calcul")), + BorderLayout.NORTH); + return content; + } + + + /** + * Creation du panel graphique. + * + * @return + */ + public Box buildContent() { + + Box content = Box.createVerticalBox(); + + // -- panel des isolignes --// + if (panelIsolignes_ == null) + panelIsolignes_ = buildIsoLignes(); + content.add(panelIsolignes_); + + // -- panel des variables --// + if (panelVariables_ == null) + panelVariables_ = buildVariables(); + content.add(panelVariables_); + + // -- panel des resultats --// + if (panelResults_ == null) + panelResults_ = buildresults(); + content.add(panelResults_); + + + + return content; + } + + + public void buildDialog() { + + + // CtuluUIDialog ui_ = new + // CtuluUIDialog(listeWidgetCalque_.get(0).getCalqueController + // ().getVisuPanel()); + + final Frame f = CtuluLibSwing.getFrameAncestorHelper(impl_.getCurrentInternalFrame()); + dialog_ = new JDialog(f); + + dialog_.addWindowListener(new WindowAdapter() { + public void windowClosed(WindowEvent _e) { + // on desactive l action de suivi sur le graphe + dialog_ = null; + } + + public void windowClosing(WindowEvent _e) { + dialog_ = null; + } + }); + + dialog_.setModal(true); + dialog_.pack(); + dialog_.setTitle(getTitle()); + JPanel container = new JPanel(new BorderLayout()); + container.add(buildContent(), BorderLayout.CENTER); + container.add(new JLabel("<html> <body><b><center>" + getTitle() + "</center></b> </body></html>"), + BorderLayout.NORTH); + dialog_.setContentPane(container); + dialog_.setSize(400, 450); + dialog_.setLocationRelativeTo(CtuluLibSwing.getFrameAncestor(impl_.getCurrentInternalFrame())); + dialog_.setVisible(true); + + } + + public String getTitle() { + return TrResource.getS("Bilans"); + + } + +} 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-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -17,7 +17,6 @@ import javax.swing.JPanel; import org.fudaa.ctulu.CtuluCommandManager; -import org.fudaa.ctulu.CtuluResource; import org.fudaa.ctulu.CtuluUndoRedoInterface; import org.fudaa.ctulu.gui.CtuluFilleWithComponent; import org.fudaa.ctulu.image.CtuluImageProducer; @@ -39,7 +38,7 @@ import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; -import org.fudaa.fudaa.tr.common.TrImportCourbeScopeManager; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.netbeans.api.visual.widget.Widget; @@ -447,6 +446,7 @@ // -- etape 2: rechargement de la toolbar specifique dans this --// changeToolbar(node.getWidget().getController()); + changeToolbarSpecifiqueCalque(node.getWidget().getController(), (EbliWidgetCreatorVueCalque) node.getCreator()); setTitle(previousTitleFrame + " " + node.getWidget().getController().getDescription(), false); } else if (node.getCreator() instanceof EbliWidgetCreatorGraphe) { FuLog.debug("change tree GRAPHE"); @@ -565,11 +565,21 @@ // 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 TrPostBilanAction(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_.getImpl())); + } + //--ajout des actions import export format scope --// - listeActions.add(new FudaaCourbeImporter.ImportAction(new TrImportCourbeScopeManager(_graphe.getGraphe(), - projet_.impl_), projet_.impl_, creator.getGraphe().getCmd())); + + // FIXME comment recuperer les parametres H2DParameter + // TrCourbeTemporelleManager manager = new + // TrCourbeTemporelleManager(null); + // listeActions.add(new FudaaCourbeImporter.ImportAction(manager, + // projet_.impl_, creator.getGraphe().getCmd())); listeActions.add( new FudaaCourbeImporter.ExportAction(creator.getGraphe(), projet_.impl_)); _controller.addFonctionsSpecific(listeActions); @@ -579,7 +589,28 @@ // mise a jour des params this.revalidate(); } + + + private void changeToolbarSpecifiqueCalque(final EbliWidgetController _controller, + final EbliWidgetCreatorVueCalque creator) { + // -- change la toolbar avec els actions generiques du controller --// + changeToolbar(_controller); + + if (!_controller.fonctionsAlreadySpecified()) { + // -- ajout des actions tr --// + final ArrayList<EbliActionSimple> listeActions = new ArrayList<EbliActionSimple>(); + + listeActions.add(new TrPostBilanAction((TrPostVisuPanel) creator.getCalque(), projet_.getImpl())); + _controller.addFonctionsSpecific(listeActions); + + } + + // mise a jour des params + this.revalidate(); + } + + public void changeToolbarScene() { // nettoyage de la toolbar this.remove(toolBarModifiable_); 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-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -77,7 +77,6 @@ import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuTable; import com.memoire.bu.BuVerticalLayout; -import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; /** @@ -597,8 +596,25 @@ menubar.add(menuPost_, 2); + + + + menuPost_.addSeparator(TrResource.getS("Layout")); + // -- ajout de l action de creation du calque --// + // menuPost_.add(new TrPostActionChooseAndCreateCalque(this)); + menuPost_.addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); + menuPost_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", CtuluResource.CTULU + .getIcon("crystal_ajouter"), new ActionListener() { + + public void actionPerformed(final ActionEvent _e) { + createNewLayoutFrame(); + + } + }); + + menuPost_.addSeparator(TrResource.getS("Gestion")); // -- ajout de l action de gestion des simus dans post --// - final BuMenuItem item = new BuMenuItem("Gestion Multi-projets"); + final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); item.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { @@ -614,22 +630,8 @@ } }); - menuPost_.add(item); - menuPost_.addSeparator(TrResource.getS("Vue 2D")); - // -- ajout de l action de creation du calque --// - // menuPost_.add(new TrPostActionChooseAndCreateCalque(this)); - menuPost_.addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); - menuPost_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", CtuluResource.CTULU - .getIcon("crystal_ajouter"), new ActionListener() { - - public void actionPerformed(final ActionEvent _e) { - createNewLayoutFrame(); - - } - }); - - menuPost_.addSeparator("Liste des projets"); + menuPost_.addSeparator("Liste des Fichiers r\xE9sultats"); // -- init de la liste des menus --// listeMenuProjets_ = new ArrayList<BuMenu>(); @@ -839,7 +841,10 @@ * @param calque */ private void addEbliNode(final EGFillePanel pn, final TrPostVisuPanel calque) { + if (calque != null) addGrapheNodeInCurrentScene(pn, formatInfoSource(calque.getSource())); + else + addGrapheNodeInCurrentScene(pn, "profil spatial"); } public void addGrapheNodeInCurrentScene(final EGFillePanel _pn, final String _desc) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java 2008-09-29 10:28:00 UTC (rev 4005) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java 2008-09-29 15:43:55 UTC (rev 4006) @@ -173,7 +173,7 @@ // --creation graphique --// // setSize(500, 250); // setPreferredSize(new Dimension(500, 250)); - setTitle(TrResource.getS("Gestion multi-projets")); + setTitle(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); setLayout(new BorderLayout()); // Box centrePanel = Box.createHorizontalBox(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-29 21:21:02
|
Revision: 4007 http://fudaa.svn.sourceforge.net/fudaa/?rev=4007&view=rev Author: deniger Date: 2008-09-29 21:20:15 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerInterface.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.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/tr/post/TrPostActionFusionCalques.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCursorProvider.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliAlignWithMoveStrategyProvider.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -11,16 +11,23 @@ private static final Color COLOR_HOVERED = new Color(0x447BCD); private static final Color COLOR_SELECTED = COLOR_HOVERED.brighter(); + /** + * + */ + private static final Border ROUNDED_BORDER = BorderFactory.createRoundedBorder(0, 0, 0, 0, COLOR_SELECTED, + COLOR_HOVERED); + + private static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(); private static final int MINI_THICKNESS = 8; private static final Border MINI_BORDER_SELECTED = BorderFactory.createRoundedBorder(MINI_THICKNESS, MINI_THICKNESS, MINI_THICKNESS, MINI_THICKNESS, COLOR_SELECTED, COLOR_SELECTED.darker()); private static final Border RESIZE_BORDER = BorderFactory.createResizeBorder(MINI_THICKNESS, COLOR_HOVERED, true); - private static final Border RESIZE_BORDER_SELECTED = BorderFactory.createCompositeBorder(BorderFactory - .createRoundedBorder(0, 0, 0, 0, COLOR_SELECTED, COLOR_HOVERED), RESIZE_BORDER); + private static final Border RESIZE_BORDER_SELECTED = BorderFactory.createCompositeBorder(ROUNDED_BORDER, + RESIZE_BORDER); private static final Border DEFAULT_BORDER = BorderFactory.createEmptyBorder(MINI_THICKNESS); - private static final Border NON_RESIZE_BORDER_SELECTED = BorderFactory.createCompositeBorder(BorderFactory - .createRoundedBorder(0, 0, 0, 0, COLOR_SELECTED, COLOR_HOVERED), DEFAULT_BORDER); + private static final Border NON_RESIZE_BORDER_SELECTED = BorderFactory.createCompositeBorder(ROUNDED_BORDER, + DEFAULT_BORDER); private static final Border NON_RESIZE_BORDER = BorderFactory.createRoundedBorder(MINI_THICKNESS, MINI_THICKNESS, MINI_THICKNESS, MINI_THICKNESS, null, COLOR_SELECTED.darker()); @@ -28,6 +35,12 @@ return getBorder(_state, true); } + public Border getBorderInGroup(ObjectState _state) { + return DEFAULT_BORDER; +// if (_state.isHovered()) { return ROUNDED_BORDER; } +// return EMPTY_BORDER; + } + public Border getBorder(ObjectState _state, boolean resizable) { if (resizable) { if (_state.isHovered()) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -7,6 +7,7 @@ import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; +import org.fudaa.ebli.visuallibrary.actions.EbliAlignWithMoveStrategyProvider; import org.fudaa.ebli.visuallibrary.tree.EbliJXTreeTableCellRenderer; import org.jdesktop.swingx.JXTreeTable; import org.jdesktop.swingx.decorator.HighlighterFactory; @@ -14,6 +15,8 @@ import org.netbeans.api.visual.action.WidgetAction; import org.netbeans.api.visual.model.ObjectSceneEventType; import org.netbeans.api.visual.widget.Widget; +import org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider; +import org.netbeans.modules.visual.action.SingleLayerAlignWithWidgetCollector; import com.memoire.bu.BuMenuBar; import com.memoire.bu.BuToolBar; @@ -41,10 +44,12 @@ public EbliSceneController(EbliScene _scene) { scene_ = _scene; + SingleLayerAlignWithWidgetCollector widgetCollector = new SingleLayerAlignWithWidgetCollector(scene_.getVisu(), + false); + EbliAlignWithMoveStrategyProvider sp = new EbliAlignWithMoveStrategyProvider(widgetCollector, scene_ + .getInteractionLayer(), ActionFactory.createDefaultAlignWithMoveDecorator(), false); + alignWithMoveAction = ActionFactory.createMoveAction(sp, sp); - alignWithMoveAction = ActionFactory.createAlignWithMoveAction(scene_.getVisu(), scene_.getInteractionLayer(), - ActionFactory.createDefaultAlignWithMoveDecorator(), false); - alignWithResizeAction = ActionFactory.createAlignWithResizeAction(scene_.getVisu(), scene_.getInteractionLayer(), ActionFactory.createDefaultAlignWithMoveDecorator(), false); @@ -58,6 +63,10 @@ } + public boolean isEditable() { + return false; + } + public void addEditListener(EbliWidgetEditModeListener _l) { listeners_.add(_l); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -1,6 +1,7 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Color; +import java.awt.Cursor; import java.awt.Font; import java.awt.Point; import java.beans.PropertyChangeListener; @@ -22,6 +23,7 @@ import org.fudaa.ebli.visuallibrary.actions.CommandeUndoRedoGraphicalProperties; import org.fudaa.ebli.visuallibrary.actions.WidgetConfigure; import org.fudaa.ebli.visuallibrary.animation.EbliWidgetAnimatedItem; +import org.netbeans.api.visual.border.Border; import org.netbeans.api.visual.model.ObjectState; import org.netbeans.api.visual.widget.Widget; @@ -101,7 +103,11 @@ // -- creation du controller par defaut --// if (controllerDefaut) controller_ = new EbliWidgetController(this); + } + @Override + protected Cursor getCursorAt(Point _localLocation) { + return EbliWidgetCursorProvider.getCursor(this, _localLocation); } public void addPropertyChangeListener(final String _key, final PropertyChangeListener _l) { @@ -205,13 +211,12 @@ public List<EbliWidgetAnimatedItem> getAnimatedItems() { return null; } - - public EbliWidget getIntern(){ + + public EbliWidget getIntern() { return this; } - - - public boolean isAnimatedItemAlive(String _id){ + + public boolean isAnimatedItemAlive(String _id) { return false; } @@ -252,7 +257,7 @@ } - protected EbliWidget getGroup() { + public EbliWidget getGroup() { Widget parent = getParentWidget(); while (parent != getScene() && parent != null) { if (parent instanceof EbliWidget && ((EbliWidget) parent).isGroup) { return ((EbliWidget) parent); } @@ -360,12 +365,17 @@ } @Override - public void notifyStateChanged(final ObjectState previousState, final ObjectState newState) { + public void notifyStateChanged(final ObjectState _previousState, final ObjectState _newState) { if (!useBorder_) { return; } - setBorder(((EbliLookFeel) getScene().getLookFeel()).getBorder(newState, getController().canResize_)); + EbliLookFeel lookFeel = (EbliLookFeel) getScene().getLookFeel(); + final EbliWidget parent = getGroup(); - if (newState.isHovered() && parent != null) { - parent.setBorder(getBorder()); + if (parent != null) { +// System.err.println("parent not null"+ toString()); + setBorder(lookFeel.getBorderInGroup(_newState)); + parent.setBorder(lookFeel.getBorder(_newState, parent.getController().canResize_)); + } else { + setBorder(lookFeel.getBorder(_newState, getController().canResize_)); } } @@ -390,7 +400,15 @@ public void setController(final EbliWidgetController controller_) { this.controller_ = controller_; + } + /** + * @return le parent direct si de type bordure, sinon this. + */ + public EbliWidget getParentBordure() { + Widget parent = getParentWidget(); + if (parent instanceof EbliWidgetBordureSingle) return (EbliWidget) parent; + return this; } public void setFormeFont(final Font newFont) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -34,6 +34,11 @@ public EbliAnimatedInterface getAnimatedInterface() { return getIntern().getAnimatedInterface(); } + + + public EbliWidget getParentBordure(){ + return this; + } @Override public List<EbliWidgetAnimatedItem> getAnimatedItems() { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -40,6 +40,13 @@ public class EbliWidgetController implements EbliWidgetControllerInterface { /** + * @param _isEditable the isEditable to set + */ + public void setEditable(boolean _isEditable) { + isEditable = _isEditable; + } + + /** * action de la widget recuperable et eventuellement supprimable */ WidgetAction actionMove_; @@ -55,15 +62,22 @@ protected PopupMenuProvider providerPopup_ = null; protected EbliWidget widget_; + + boolean isEditable; public EbliWidgetController(EbliWidget widget_) { this(widget_, true, true, true); - } + + public EbliWidgetController(EbliWidget _widget, boolean _canMove, boolean _canResize) { this(_widget, _canMove, _canResize, true); } + + public boolean isEditable() { + return isEditable; + } public EbliWidgetController(EbliWidget widget_, boolean canMove, boolean canResize, boolean canDuplicate) { @@ -139,14 +153,15 @@ // -- si la widget a une bordure c'est la bordure que l on masque --// - EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); - if (n.getCreator().getBordure() != null) { - n.getCreator().getBordure().setVisible(false); - cmd_.addCmd(new CommandMasquer(n.getCreator().getBordure())); - } else { - widget_.setVisible(false); - cmd_.addCmd(new CommandMasquer(widget_)); - } + // EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); + // if (n.getCreator().getBordure() != null) { + // n.getCreator().getBordure().setVisible(false); + // cmd_.addCmd(new CommandMasquer(n.getCreator().getBordure())); + // } else { + EbliWidget toHide = widget_.getParentBordure(); + toHide.setVisible(false); + cmd_.addCmd(new CommandMasquer(toHide)); + // } widget_.getEbliScene().refresh(); } @@ -394,6 +409,17 @@ } + public void removeActionResize() { + widget_.getActions().removeAction(actionMove_); + canResize_ = false; + } + + public void replaceActionResize() { + if (actionResize_ != null) widget_.getActions().addAction(actionResize_); + canResize_ = true; + + } + public WidgetAction getActionMove() { return actionMove_; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerInterface.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerInterface.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerInterface.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -11,16 +11,17 @@ /** * @author deniger - * */ public interface EbliWidgetControllerInterface { - public abstract BuMenuBar getMenubarComponent(); + BuMenuBar getMenubarComponent(); - public abstract JComponent getOverviewComponent(); + JComponent getOverviewComponent(); - public abstract BuToolBar getToolbarComponent(); + BuToolBar getToolbarComponent(); - public abstract JComponent getTracableComponent(); + JComponent getTracableComponent(); + boolean isEditable(); + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -15,6 +15,7 @@ */ EbliNode duplicate(EbliNode _nodeAdupliquer); - EbliWidgetWithBordure getBordure(); + //FIXME pas de reference vers la widget creer: un creator peut etre utiliser pour plusieurs widget ! +// EbliWidgetWithBordure getBordure(); } Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCursorProvider.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCursorProvider.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCursorProvider.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -0,0 +1,51 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ebli.visuallibrary; + +import java.awt.Cursor; +import java.awt.Point; + +import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.action.ResizeControlPointResolver; +import org.netbeans.api.visual.action.ResizeProvider.ControlPoint; +import org.netbeans.api.visual.widget.Widget; + +/** + * @author deniger + */ +public class EbliWidgetCursorProvider { + + private final static ResizeControlPointResolver controlPointResolver = ActionFactory + .createDefaultResizeControlPointResolver(); + + private static ControlPoint getControlPoint(Widget _widget, Point _localLocation) { + return controlPointResolver.resolveControlPoint(_widget, _localLocation); + } + + public static Cursor getCursor(EbliWidget _widget, Point _localLocation) { + if (!_widget.isEnabled() || _widget.getController() == null) + return Cursor.getDefaultCursor(); + if (_widget.getController().canResize_) { + ControlPoint controlPoint = getControlPoint(_widget, _localLocation); + if (controlPoint != null) { + int type = Cursor.SE_RESIZE_CURSOR; + if (controlPoint == ControlPoint.TOP_CENTER) type = Cursor.N_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.TOP_LEFT) type = Cursor.NW_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.TOP_RIGHT) type = Cursor.NE_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.CENTER_LEFT) type = Cursor.W_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.CENTER_RIGHT) type = Cursor.E_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.BOTTOM_CENTER) type = Cursor.S_RESIZE_CURSOR; + else if (controlPoint == ControlPoint.BOTTOM_LEFT) type = Cursor.SW_RESIZE_CURSOR; + return Cursor.getPredefinedCursor(type); + } + } + if (_widget.getController().isEditable() && _widget.getClientArea().contains(_localLocation)) { return Cursor + .getPredefinedCursor(Cursor.TEXT_CURSOR); } + if (_widget.getController().canMove_) return Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR); + return Cursor.getDefaultCursor(); + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -18,35 +18,35 @@ public class EbliWidgetTextEditor extends EbliWidget implements InplaceEditorProvider<BuPanel> { - - // editeur de texte CtuluHtmlEditorPanel editorPane_ = new CtuluHtmlEditorPanel(); - // ComponentWidget widget; + // ComponentWidget widget; BuPanel conteneur = null; // LabelWidget intern_; ComponentWidget intern_; - + JLabel contenuHTML_ = new JLabel(); - + public EbliWidgetTextEditor(EbliScene scene, CtuluHtmlEditorPanel content) { super(scene, false); editorPane_ = content; intern_ = new ComponentWidget(scene, contenuHTML_); - + contenuHTML_.setText(content.getDocumentText()); // -- ajout en interne du label d affichage --// this.addChild(intern_); - + // -- creation de l action pour editor --// WidgetAction editorAction = ActionFactory.createInplaceEditorAction(this); // -- ajout de l action au widget correspondant --// this.getActions().addAction(editorAction); - - setController(new EbliWidgetControllerMenuOnly(this)); + EbliWidgetControllerMenuOnly controller = new EbliWidgetControllerMenuOnly(this); + controller.setEditable(true); + setController(controller); + } // protected void paintWidget() { @@ -60,54 +60,51 @@ /** * Methode qui redessine l edition de texte proprement. * - * @param text - * de l editeur html + * @param text de l editeur html * @param g */ -// public void decoupeEcriture(String text, Graphics2D g) { -// -// int espaceLignes = 10; -// -// if(text==null || text.length()==0) -// return; -// -// Rectangle rec = getClientArea(); -// int indiceDep=0; -// int espaceAffichable = Math.min((int) (rec.width / 5), text.length()); -// -// for (int i = 0; indiceDep + espaceAffichable < text.length(); i++) { -// g.drawString(text.substring(indiceDep, indiceDep + espaceAffichable), rec.x, rec.y + i * espaceLignes); -// indiceDep = indiceDep + espaceAffichable; -// -// } -// -// -// } - - + // public void decoupeEcriture(String text, Graphics2D g) { + // + // int espaceLignes = 10; + // + // if(text==null || text.length()==0) + // return; + // + // Rectangle rec = getClientArea(); + // int indiceDep=0; + // int espaceAffichable = Math.min((int) (rec.width / 5), text.length()); + // + // for (int i = 0; indiceDep + espaceAffichable < text.length(); i++) { + // g.drawString(text.substring(indiceDep, indiceDep + espaceAffichable), rec.x, rec.y + i * espaceLignes); + // indiceDep = indiceDep + espaceAffichable; + // + // } + // + // + // } + public BuPanel createEditorComponent( org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget) { - //--creation du panel ekitcore - if(conteneur==null){ - conteneur=new BuPanel(new BuBorderLayout()); + // --creation du panel ekitcore + if (conteneur == null) { + conteneur = new BuPanel(new BuBorderLayout()); Rectangle rec = getClientArea(); editorPane_.setSize(rec.width, rec.height); - editorPane_.setPreferredSize(new Dimension(rec.width, rec.height)); + editorPane_.setPreferredSize(new Dimension(rec.width, rec.height)); conteneur.setPreferredSize(new Dimension(rec.width, rec.height)); conteneur.setMaximumSize(new Dimension(rec.width, rec.height)); conteneur.setMinimumSize(new Dimension(rec.width, rec.height)); conteneur.add(editorPane_, BuBorderLayout.CENTER); conteneur.add(editorPane_.getToolBar(true), BuBorderLayout.NORTH); conteneur.add(editorPane_.getMenuBar()); - + } // -- on masque l affichage du widgetcomponent --// contenuHTML_.setText(""); return conteneur; - } public EnumSet<org.netbeans.api.visual.action.InplaceEditorProvider.ExpansionDirection> getExpansionDirections( @@ -123,20 +120,19 @@ public void notifyClosing(org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget, BuPanel editor, boolean commit) { - + // -- mise a jour de intern avec le contenu du ekitcore --// - + contenuHTML_.setText(editorPane_.getDocumentText()); intern_.repaint(); intern_.revalidate(); this.repaint(); getEbliScene().refresh(); // intern_.setLabel(label.getText()); - + } public void notifyOpened(org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - Widget widget, BuPanel editor) { - } + Widget widget, BuPanel editor) {} } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextLabel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextLabel.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextLabel.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -14,67 +14,64 @@ /** * Legende Widget qui permet de construire des rectangles avec du texte * - * @author Adrien Hadoux - * TODO a generaliser avec autre chose qu'un LabelWidget + * @author Adrien Hadoux TODO a generaliser avec autre chose qu'un LabelWidget */ -public class EbliWidgetTextLabel extends EbliWidget implements - TextFieldInplaceEditor { +public class EbliWidgetTextLabel extends EbliWidget implements TextFieldInplaceEditor { - LabelWidget intern; - Insets inGaps_; - int largeurBorder = 15; - int espaceInterieur = 5; + LabelWidget intern; + Insets inGaps_; + int largeurBorder = 15; + int espaceInterieur = 5; - - public Font fontForme; - - /** - * @param _scene - */ - public EbliWidgetTextLabel(EbliScene _scene, String label) { - super(_scene, false); + public Font fontForme; + + /** + * @param _scene + */ + public EbliWidgetTextLabel(EbliScene _scene, String label) { + super(_scene, false); // inGaps_ = new Insets(largeurBorder + espaceInterieur, largeurBorder // + espaceInterieur, largeurBorder + espaceInterieur, // largeurBorder + espaceInterieur); - // Ce layout permet de placer le texte - - // setLayout(new OverlayLayoutGap(inGaps_)); - - intern = new LabelWidget(_scene); - intern.setVerticalAlignment(VerticalAlignment.CENTER); - intern.setAlignment(Alignment.CENTER); - intern.setFont(getFormeFont()); - - intern.setLabel(label); - - //-- layout du texte --// - addChild(intern); + // Ce layout permet de placer le texte - // -- ajouter l option de remplacer le text dans le label --// + // setLayout(new OverlayLayoutGap(inGaps_)); - // -- creation de l action --// - WidgetAction editorAction = ActionFactory - .createInplaceEditorAction(this); + intern = new LabelWidget(_scene); + intern.setVerticalAlignment(VerticalAlignment.CENTER); + intern.setAlignment(Alignment.CENTER); + intern.setFont(getFormeFont()); - - - // -- ajout de l action au label correspondant --// + intern.setLabel(label); + + // -- layout du texte --// + addChild(intern); + + // -- ajouter l option de remplacer le text dans le label --// + + // -- creation de l action --// + WidgetAction editorAction = ActionFactory.createInplaceEditorAction(this); + + // -- ajout de l action au label correspondant --// this.getActions().addAction(editorAction); - // intern.getActions().addAction(ActionFactory.createResizeAction()); + // intern.getActions().addAction(ActionFactory.createResizeAction()); - // setEnabled(false); + // setEnabled(false); // -- ajout du controller special sans actions, juste le menu --/ - setController(new EbliWidgetControllerMenuOnly(this)); - } + EbliWidgetControllerMenuOnly controller = new EbliWidgetControllerMenuOnly(this); + controller.setEditable(true); + setController(controller); - public void majLabel(String label) { - // intern.setForeground(); - intern.setLabel(label); - revalidate(); - } + } + public void majLabel(String label) { + // intern.setForeground(); + intern.setLabel(label); + revalidate(); + } + // @Override // protected Rectangle calculateClientArea() { // // Rectangle res = intern.getPreferredBounds(); @@ -83,42 +80,33 @@ // // + res.width, 2 * (largeurBorder + espaceInterieur) + res.height); // } - protected void paintWidget() { - - // -- mise a jour de la fonte que si il y a eu une modification --// - if (intern.getFont() != getFormeFont()) - intern.setFont(getFormeFont()); + protected void paintWidget() { - if (intern.getForeground() != getColorContour()) - intern.setForeground(getColorContour()); + // -- mise a jour de la fonte que si il y a eu une modification --// + if (intern.getFont() != getFormeFont()) intern.setFont(getFormeFont()); - - - - - - } + if (intern.getForeground() != getColorContour()) intern.setForeground(getColorContour()); - public String getText(Widget widget) { - - + } + + public String getText(Widget widget) { + return this.intern.getLabel(); - } + } - public boolean isEnabled(Widget widget) { - // TODO Auto-generated method stub - return true; - } + public boolean isEnabled(Widget widget) { + // TODO Auto-generated method stub + return true; + } - public void setText(Widget widget, String text) { - + public void setText(Widget widget, String text) { + this.intern.setLabel(text); revalidate(); - } - - - public boolean canRotate() { + } + + public boolean canRotate() { return false; } @@ -137,12 +125,5 @@ public boolean canFont() { return true; } - - - - - - - } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliAlignWithMoveStrategyProvider.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliAlignWithMoveStrategyProvider.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliAlignWithMoveStrategyProvider.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -0,0 +1,101 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ebli.visuallibrary.actions; + +import java.awt.Point; + +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.netbeans.api.visual.action.AlignWithMoveDecorator; +import org.netbeans.api.visual.action.AlignWithWidgetCollector; +import org.netbeans.api.visual.action.MoveProvider; +import org.netbeans.api.visual.action.MoveStrategy; +import org.netbeans.api.visual.widget.LayerWidget; +import org.netbeans.api.visual.widget.Widget; +import org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider; + +/** + * @author deniger + */ +public class EbliAlignWithMoveStrategyProvider implements MoveStrategy, MoveProvider { + + final AlignWithMoveStrategyProvider alignProvider_; + + public EbliAlignWithMoveStrategyProvider(AlignWithWidgetCollector collector, LayerWidget interractionLayer, + AlignWithMoveDecorator decorator, boolean outerBounds) { + alignProvider_ = new AlignWithMoveStrategyProvider(collector, interractionLayer, decorator, outerBounds); + } + + /** + * @param _widget + * @return + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#getOriginalLocation(org.netbeans.api.visual.widget.Widget) + */ + public Point getOriginalLocation(Widget _widget) { + return getWidgetToMove(_widget).getPreferredLocation(); + } + + /** + * @see org.netbeans.modules.visual.action.AlignWithSupport#hide() + */ + public void hide() { + alignProvider_.hide(); + } + + /** + * @param _widget + * @param _originalLocation + * @param _suggestedLocation + * @return + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#locationSuggested(org.netbeans.api.visual.widget.Widget, + * java.awt.Point, java.awt.Point) + */ + public Point locationSuggested(Widget _widget, Point _originalLocation, Point _suggestedLocation) { + return alignProvider_.locationSuggested(getWidgetToMove(_widget), _originalLocation, _suggestedLocation); + } + + /** + * @param _widget + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#movementFinished(org.netbeans.api.visual.widget.Widget) + */ + public void movementFinished(Widget _widget) { + alignProvider_.movementFinished(getWidgetToMove(_widget)); + } + + /** + * @param _widget + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#movementStarted(org.netbeans.api.visual.widget.Widget) + */ + public void movementStarted(Widget _widget) { + alignProvider_.movementStarted(getWidgetToMove(_widget)); + } + + /** + * @param _widget + * @param _location + * @see org.netbeans.modules.visual.action.AlignWithMoveStrategyProvider#setNewLocation(org.netbeans.api.visual.widget.Widget, + * java.awt.Point) + */ + public void setNewLocation(Widget _widget, Point _location) { + getWidgetToMove(_widget).setPreferredLocation(_location); + } + + /** + * @see org.netbeans.modules.visual.action.AlignWithSupport#show() + */ + public void show() { + alignProvider_.show(); + } + + /** + * @param widget + */ + public static EbliWidget getWidgetToMove(Widget widget) { + EbliWidget w = (EbliWidget) widget; + EbliWidget group = w.getGroup(); + if (group != null) { return group; } + return w; + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -27,6 +27,8 @@ import org.fudaa.ebli.visuallibrary.layout.GroupLayout; import org.netbeans.api.visual.widget.Widget; +import com.memoire.bu.BuInsets; + /** * @author deniger */ @@ -73,7 +75,7 @@ } int w = max.x - min.x; int h = max.y - min.y; - Insets b = parent.getBorder().getInsets(); + Insets b = BuInsets.INSETS0000;//parent.getBorder().getInsets(); // System.err.println(b); Rectangle bounds = new Rectangle(-b.left, -b.top, w + b.left + b.right, h + b.top + b.bottom); @@ -86,7 +88,7 @@ Rectangle widgetBounds = findWidget.getBounds(); Rectangle rec = findWidget.convertLocalToScene(widgetBounds); EbliWidget ew = (EbliWidget) findWidget; - ew.getController().removeActionResizeAndMove(); + ew.getController().removeActionResize(); // scene_.removeNode((EbliNode) object); findWidget.removeFromParent(); int dx = rec.x - min.x; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -44,7 +44,7 @@ // Set cs = new HashSet(); // for (final Iterator iterator = selectedObjects.iterator(); iterator.hasNext();) { EbliWidget w = (EbliWidget) _scene.findWidget(_n); - if (!w.isGroup()) return; + if (w==null || !w.isGroup()) return; List<Widget> children = new ArrayList<Widget>(w.getChildren()); for (Widget widget : children) { Point p = widget.getLocation(); @@ -59,7 +59,7 @@ _n.setPreferedSize(widget.getPreferredSize()); // widget.setPreferredLocation(toScene); _scene.addNode(n).setPreferredLocation(toScene); - n.getWidget().getController().replaceActionResizeAndMove(); + n.getWidget().getController().replaceActionResize(); } _scene.removeNode(_n); // } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -25,7 +25,6 @@ import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; -import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliComponentFactory; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BSelecteurListComboBox; @@ -65,7 +64,7 @@ BuMenuBar menuCalque_; JComponent panelTreeCalque_; - public boolean alreadyCreate_; + BuToolBar toolbarCalque_; EbliWidgetVueCalque widgetCalque_; @@ -80,6 +79,14 @@ } + /** + * + */ + public boolean isEditable() { + return true; + + } + public void addActionSpecifiques() { editorAction_ = new EbliActionEditorOneClick<BuPanel>(widgetCalque_); @@ -113,8 +120,6 @@ @Override public void postActionDuplication(final EbliNode node, final EbliNode duplique) { - - // -- il faut verifier que les le node a bien une legende sinon on n ajoute // pas de legende pour le dupliqu\xE9 --// EbliWidgetControllerCalque controllerDuDuplique = null; @@ -127,11 +132,11 @@ controllerDuDuplique.setDescription(getDescription()); - // -- construction des actions sans passer par la frame fille --// + // -- construction des actions sans passer par la frame fille --// controllerDuDuplique.widgetCalque_.calquePanel_.getController().buildActions(); - + } - + public boolean hasLegende() { return widget_.getEbliScene().isObject(getNodeLegende()); } @@ -207,30 +212,31 @@ public void actionPerformed(final ActionEvent e) { // -- si la widget a une bordure c'est la bordure que l on masque --// - EbliWidget widgetUndo1 = null; - EbliWidget widgetUndo2 = null; + EbliWidget widgetUndo1 = widget_.getParentBordure(); + EbliWidget widgetUndo2 = widgetCalque_.nodeLegende.getWidget().getParentBordure(); - final EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); - if (n.getCreator().getBordure() != null) { - // -- on masque le calque --// - n.getCreator().getBordure().setVisible(false); + // final EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); + // if (n.getCreator().getBordure() != null) { + // // -- on masque le calque --// + // n.getCreator().getBordure().setVisible(false); + // + // widgetUndo1 = n.getCreator().getBordure(); + // + // } else { + // + widgetUndo1.setVisible(false); + // widgetUndo1 = widget_; - widgetUndo1 = n.getCreator().getBordure(); + // } - } else { - widget_.setVisible(false); - widgetUndo1 = widget_; - - } - // -- on masque sa legende associee --// - if (widgetCalque_.nodeLegende.getCreator().getBordure() != null) { - widgetCalque_.nodeLegende.getCreator().getBordure().setVisible(false); - widgetUndo2 = widgetCalque_.nodeLegende.getCreator().getBordure(); - } else { - widgetCalque_.nodeLegende.getWidget().setVisible(false); - widgetUndo2 = widgetCalque_.nodeLegende.getWidget(); - } + // if (widgetCalque_.nodeLegende.getCreator().getBordure() != null) { + // widgetCalque_.nodeLegende.getCreator().getBordure().setVisible(false); + // widgetUndo2 = widgetCalque_.nodeLegende.getCreator().getBordure(); + // } else { + // widgetCalque_.nodeLegende.getWidget().setVisible(false); + widgetUndo2.setVisible(false); + // } // -- creation des comamndes undo/redo pour le masquage --// final ArrayList<EbliWidget> listeWidget = new ArrayList<EbliWidget>(); @@ -282,7 +288,7 @@ editorAction_.openEditor(widgetCalque_); } - + public void ouvrirEditeur() { editorAction_.openEditor(widgetCalque_); } @@ -290,7 +296,6 @@ public void fermerEditeur() { editorAction_.closeEditor(true); } - public ZEbliCalquesPanel getVisuPanel() { return widgetCalque_.calquePanel_; @@ -340,7 +345,7 @@ // info.setAvailable(true); // JComponent jc = info; final Collection<EbliActionPaletteAbstract> acts = getVisuPanel().getController().getTabPaletteAction(); - + if (!CtuluLibArray.isEmpty(acts)) { final BuTabbedPane tb = new BuTabbedPane(); for (final EbliActionPaletteAbstract pals : acts) { @@ -367,8 +372,6 @@ return panelTreeCalque_; } - - /** * Obtient la toolbar specifique au calque * Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -15,27 +15,28 @@ * controller specifique aux legendes. gere * * @author genesis - * */ public class EbliWidgetControllerLegendeCalque extends EbliWidgetControllerMenuOnly { - public EbliWidgetControllerLegendeCalque(EbliWidget widget_) { + public EbliWidgetControllerLegendeCalque(final EbliWidget widget_) { super(widget_); } - protected void buildPopupMenu(JPopupMenu _menu) { + @Override + protected void buildPopupMenu(final JPopupMenu _menu) { constructPopupMenuSpecifique(_menu); // -- creation du menu commun a tous les widgets constructPopupMenuBase(_menu); } - private void constructPopupMenuSpecifique(JPopupMenu _popup) { - JMenuItem menuItem = new JMenuItem(EbliResource.EBLI.getString("Editer la l\xE9gende")); + private void constructPopupMenuSpecifique(final JPopupMenu _popup) { + + final JMenuItem menuItem = new JMenuItem(EbliResource.EBLI.getString("Editer la l\xE9gende")); _popup.add(menuItem, 0); menuItem.setIcon(CtuluResource.CTULU.getIcon("crystal_editer")); menuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(final ActionEvent e) { MenuEditer(); @@ -43,16 +44,18 @@ }); } + @Override + public boolean isEditable() { + return true; + } - - /** * Mise au premier plan de la widget et edition. Sert beaucoup pour la fusion */ public void MenuEditer() { - // -- executer l action d edition --// + // -- executer l action d edition --// ((EbliWidgetCalqueLegende) getWidget()).editorAction_.openEditor(getWidget()); } - + } 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 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -75,7 +75,12 @@ addActionSpecifiques(); } + + public boolean isEditable() { + return true; + } + public void addActionSpecifiques() { editorAction_ = new EbliActionEditorOneClick<BuPanel>((EbliWidgetGraphe) widget_); // -- ajout de l action au widget correspondant --// @@ -159,30 +164,31 @@ public void actionPerformed(ActionEvent e) { // -- si la widget a une bordure c'est la bordure que l on masque --// - EbliWidget widgetUndo1 = null; - EbliWidget widgetUndo2 = null; + EbliWidget widgetUndo1 = widget_.getParentBordure(); + EbliWidget widgetUndo2 = widgetGraphe_.getNodeLegende().getWidget().getParentBordure(); - EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); - if (n.getCreator().getBordure() != null) { - // -- on masque le calque --// - n.getCreator().getBordure().setVisible(false); + // EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); + // if (n.getCreator().getBordure() != null) { + // // -- on masque le calque --// + // n.getCreator().getBordure().setVisible(false); + // + // widgetUndo1 = n.getCreator().getBordure(); + // + // } else { + widgetUndo1.setVisible(false); + // widgetUndo1 = widget_; - widgetUndo1 = n.getCreator().getBordure(); + // } - } else { - widget_.setVisible(false); - widgetUndo1 = widget_; - - } - // -- on masque sa legende associee --// - if (widgetGraphe_.getNodeLegende().getCreator().getBordure() != null) { - widgetGraphe_.getNodeLegende().getCreator().getBordure().setVisible(false); - widgetUndo2 = widgetGraphe_.getNodeLegende().getCreator().getBordure(); - } else { - widgetGraphe_.getNodeLegende().getWidget().setVisible(false); - widgetUndo2 = widgetGraphe_.getNodeLegende().getWidget(); - } + // if (widgetGraphe_.getNodeLegende().getCreator().getBordure() != null) { + // widgetGraphe_.getNodeLegende().getCreator().getBordure().setVisible(false); + // widgetUndo2 = widgetGraphe_.getNodeLegende().getCreator().getBordure(); + // } else { + // widgetGraphe_.getNodeLegende().getWidget().setVisible(false); + // + widgetUndo2.setVisible(false); + // } // -- creation des comamndes undo/redo pour le masquage --// ArrayList<EbliWidget> listeWidget = new ArrayList<EbliWidget>(); @@ -345,8 +351,7 @@ // paneGlobal.setTopComponent(getGraphePanel().getInfoPanel()); // paneGlobal.setBottomComponent(new JScrollPane(tree)); - panelTreeGraphe_ = new JScrollPane(tree); - ;// paneGlobal; + panelTreeGraphe_ = new JScrollPane(tree);;// paneGlobal; } return panelTreeGraphe_; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java 2008-09-29 15:43:55 UTC (rev 4006) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java 2008-09-29 21:20:15 UTC (rev 4007) @@ -222,7 +222,7 @@ getScene().getCmdMng().addCmd(new CtuluCommand() { public void undo() { - + // -- degroupe et desynchronise le tout --// EbliWidgetUngroupAction.degroupObjectsFromFusion(getScene(), fusion); } @@ -246,10 +246,10 @@ // -- il faut des gaps suffisants pour deplacer la widget et avoir le menu // du groupe --// - Insets insetLayout = new Insets(30, 30, 30, 30); + // Insets insetLayout = new Insets(30, 30, 30, 30); // parent.setLayout(new OverlayLayout()); - parent.setLayout(new OverlayLayoutGap(insetLayout)); + parent.setLayout(new OverlayLayoutGap(new Insets(0, 0, 0, 0))); Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); Point max = new Point(-Integer.MAX_VALUE, -Integer.MAX_VALUE); @@ -271,8 +271,8 @@ // int h = max.y - min.y; // Insets b = parent.getBorder().getInsets(); - sizeMax.width += 2 * insetLayout.left; - sizeMax.height += 2 * insetLayout.bottom; + // sizeMax.width += 2 * insetLayout.left; + // sizeMax.height += 2 * insetLayout.bottom; parent.setPreferredBounds(sizeMax); parent.setPreferredSize(new Dimension(sizeMax.width, sizeMax.height)); @@ -290,7 +290,7 @@ } else if (vue.getViewBoite() != null) { boite.ajuste(vue.getViewBoite()); } - ew.getController().removeActionResizeAndMove(); + ew.getController().removeActionResize(); findWidget.removeFromParent(); // int dx = rec.x - min.x; @@ -316,11 +316,10 @@ node.setTitle(EbliLib.getS("Fusion calquess")); node.setCreator(creator); parent.setController(new EbliWidgetControllerForGroup(parent, true)); - - //-- synchronisation des sondes des fusions --// + + // -- synchronisation des sondes des fusions --// parent.synchroniseSondeFusion(); - - + scene_.addNode(node); if (pn != null && boite != null) { pn.getVueCalque().changeRepere(pn, boite, 0, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-03 15:33:15
|
Revision: 4031 http://fudaa.svn.sourceforge.net/fudaa/?rev=4031&view=rev Author: hadouxad Date: 2008-10-03 15:32:59 +0000 (Fri, 03 Oct 2008) Log Message: ----------- 1) Cr?\195?\169ation de toutes les ihm d'import scop et des algos de cr?\195?\169ation des evolutionRegulieres. Il ne manque plus que tu cr?\195?\169er et donne le bon target en entr?\195?\169e et le tour est jou?\195?\169! 2)D?\195?\169but d'algorithme sur les lignes de courant, il manque des choses car je n'ai pas saisi toutes les nuances je pense Uniformisation des points sur le segment saisi. 3)Cr?\195?\169ation de l'interface et de l'action qui lance le calcul des lignes de courant, a peaufiner, notamment pour la saisie des points. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance.jar branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java 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/TrPostDialogLigneCourants.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -26,12 +26,17 @@ import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.LookAndFeel; +import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; import javax.swing.plaf.IconUIResource; import javax.swing.plaf.metal.MetalTheme; +import org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel; + + + import com.memoire.fu.FuFactoryInteger; import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; @@ -110,6 +115,19 @@ else if (lnfname.equals("ASPECT_GTK")) lnfclass = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; else if (lnfname.equals("ASPECT_KUNSTSTOFF")) lnfclass = "com.incors.plaf.kunststoff.KunststoffLookAndFeel"; else if (lnfname.equals("ASPECT_LIQUID")) lnfclass = "com.birosoft.liquid.LiquidLookAndFeel"; +// else if (lnfname.equals("ASPECT_SUBSTANCE")){ +// lnfclass = "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"; +// +// try { +// UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"); +// forced = false; +// } catch (Exception ex) { +// FuLog.error("BPR: could not set substance theme", ex); +// } +// +// +// } + else if (lnfname.equals("ASPECT_MAC")) { FuLib.setSystemProperty("os.name", "Mac OS"); lnfclass = "com.sun.java.swing.plaf.mac.MacLookAndFeel"; Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -402,6 +402,13 @@ } + public int getVariablePosition(String nomVar){ + for(int i=0;i<getNbVariables();i++) + if(getVariable(i).equals(nomVar)) + return i; + return -1; + } + public void addValueForVariableAtSeparator(double value, int indexVariable, String nameSeparator) { ArrayList<Double> listeValueOfVar = getListValueForVariableForSeparator(nameSeparator, indexVariable); // if (listeValueOfVar == null) @@ -436,6 +443,9 @@ ArrayList<Double> listeValueOfVar = getListValueForVariableForSeparator(separator, i); if (i != 0) ligneBrochette += " "; + if(listeValueOfVar.size()<=indiceValue) + ligneBrochette += KEY.SYMBOL_VALUE_UNDEFINED; + else if (listeValueOfVar.get(indiceValue) != KEY.VALUE_UNDEFINED) ligneBrochette += listeValueOfVar.get(indiceValue); else Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -0,0 +1,13 @@ +package org.fudaa.ebli.courbe; + + +/** + * Classe qui r\xE9cup\xE8re les donn\xE9es courbes d'un graphe et enregistre les parametres + * @author Adrien Hadoux + * + */ +public class GraphePersist { + + + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -21,6 +21,7 @@ import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; +import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.ListSelectionModel; import javax.swing.filechooser.FileFilter; @@ -388,12 +389,32 @@ } /** + * donne la description du fonctionnement de l'import gene specifique + * @return + */ + public String getDescriptionImportGENE(){ + switch(comBoChoixTypeGraphe_.getSelectedIndex()){ + case 0: return "<html><body>"+TrResource.getS("S\xE9lectionnez des couples variable/valeurs num\xE9riques de s\xE9parateur. <br /> Cliquez sur ajouter pour le prendre en compte. On peut ajouter plusieurs couples.<br /> Chaque couple g\xE9n\xE9rera une courbe en prenant les valeurs num\xE9riques du s\xE9parateur choisi.")+"</body></html> "; + case 1: return "<html><body>"+TrResource.getS("S\xE9lectionner toutes les variables voulues ainsi q'une plage de d\xE9part et une plage de fin.<br /> Cela g\xE9n\xE9rera une courbe par variables. Chaque courbe prendra pour Y une interpolation par rapport au x choisi. <br />Il y aura donc autant de couples (x,y) que de s\xE9parateurs dans l'intervalle d\xE9but/fin choisi.")+"</body></html> "; + case 2: return TrResource.getS("S\xE9lectionner une variable et une plage de valeur num\xE9rique pour repr\xE9senter les valeurs de X. Idem pour Y."); + + } + return ""; + + } + + /** * Creation du panel scopGene pour choisir ses parametres * @return */ JPanel buildPanelScopeGENE(){ + final JPanel content2=new JPanel(new BorderLayout()); + content2.add(comBoChoixTypeGraphe_,BorderLayout.NORTH); final JPanel content=new JPanel(new BorderLayout()); - content.add(comBoChoixTypeGraphe_,BorderLayout.NORTH); + content2.add(content,BorderLayout.CENTER); + final JLabel description=new JLabel(getDescriptionImportGENE()); + + content.add(description,BorderLayout.NORTH); final JPanel container=new JPanel(layoutParamGene); content.add(container,BorderLayout.CENTER); comBoChoixTypeGraphe_.setAction(new AbstractAction(){ @@ -403,6 +424,7 @@ //layoutParamGene.next(container); // content.revalidate(); // container.revalidate(); + description.setText(getDescriptionImportGENE()); } }); @@ -416,7 +438,6 @@ listeVar[i-1]=dataG().getVariable(i); listVariablesGENE_=new JList(listeVar); listVariablesGENE_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listVariablesGENE_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); //-- creation de la liste des separators --// listeVar=new String[dataG().getNbSeparator()]; @@ -425,21 +446,26 @@ listeVar[i]=dataG().getSeparator(i); listSeparator_=new JList(listeVar); listSeparator_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparator_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Valeurs num\xE9riques du s\xE9parateur de bloc"))); - + //-- panel reserv\xE9 aux profils spatiaux --// JPanel paramProfils=new JPanel(new BorderLayout()); container.add(paramProfils, TrResource.getS("Profil Spatial")); JPanel choixVar=new JPanel(new GridLayout(1,2)); - choixVar.add(listVariablesGENE_); - choixVar.add(listSeparator_); + JScrollPane pane=new JScrollPane(listVariablesGENE_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); + choixVar.add(pane); + pane=new JScrollPane(listSeparator_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Valeurs num\xE9riques du s\xE9parateur de bloc"))); + + choixVar.add(pane); paramProfils.add(choixVar,BorderLayout.NORTH); //--panel du milieu: liste de couples VAR/SEPARATOR --// modelCoupleSpatiauxGENE_=new DefaultListModel(); listCoupleSpatiauxGENE_=new JList(modelCoupleSpatiauxGENE_); - listCoupleSpatiauxGENE_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Liste des couples variable/separateur"))); - paramProfils.add(listCoupleSpatiauxGENE_,BorderLayout.CENTER); + pane=new JScrollPane(listCoupleSpatiauxGENE_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Liste des couples variable/separateur"))); + paramProfils.add(pane,BorderLayout.CENTER); //-- boutons du bas d'ajout/supression dans la liste --// BuButton ajouter=new BuButton(FudaaResource.FUDAA.getIcon("crystal_ajouter"), TrResource.getS("Ajouter")); ajouter.addActionListener(new ActionListener(){ @@ -485,25 +511,29 @@ listeVar[i-1]=dataG().getVariable(i); listVariablesGENE2_=new JList(listeVar); listVariablesGENE2_.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - listVariablesGENE2_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); listeVar=new String[dataG().getNbSeparator()]; for(int i=0;i<dataG().getNbSeparator();i++) listeVar[i]=dataG().getSeparator(i); listSeparatorDebPlage_=new JList(listeVar); listSeparatorDebPlage_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparatorDebPlage_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage d\xE9part du s\xE9parateur de bloc"))); listSeparatorDebPlage_.setSelectedIndex(0); listSeparatorFinPlage_=new JList(listeVar); listSeparatorFinPlage_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparatorFinPlage_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage fin du s\xE9parateur de bloc"))); listSeparatorFinPlage_.setSelectedIndex(listSeparatorDebPlage_.getModel().getSize()-1); JPanel listData=new JPanel(new GridLayout(1,2)); JPanel listData2=new JPanel(new GridLayout(2,1)); - listData.add(listVariablesGENE2_); + pane=new JScrollPane(listVariablesGENE2_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); + + listData.add(pane); listData.add(listData2); - listData2.add(listSeparatorDebPlage_); - listData2.add(listSeparatorFinPlage_); + pane=new JScrollPane(listSeparatorDebPlage_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage d\xE9part du s\xE9parateur de bloc"))); + listData2.add(pane); + pane=new JScrollPane(listSeparatorFinPlage_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage fin du s\xE9parateur de bloc"))); + listData2.add(pane); paramTempo.add(listData,BorderLayout.CENTER); //textField contenant le x choisi @@ -529,10 +559,8 @@ listeVar[i-1]=dataG().getVariable(i); listVariablesGENECorrlX_=new JList(listeVar); listVariablesGENECorrlX_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listVariablesGENECorrlX_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection la variable pour l'axe X"))); listVariablesGENECorrlY_=new JList(listeVar); listVariablesGENECorrlY_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listVariablesGENECorrlY_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection la variable pour l'axe Y"))); listeVar=new String[dataG().getNbSeparator()]; @@ -540,20 +568,26 @@ listeVar[i]=dataG().getSeparator(i); listSeparatorCorrel1_=new JList(listeVar); listSeparatorCorrel1_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparatorCorrel1_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage associ\xE9e \xE0 la variable X"))); listSeparatorCorrel1_.setSelectedIndex(0); listSeparatorCorrel2_=new JList(listeVar); listSeparatorCorrel2_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparatorCorrel2_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage associ\xE9e \xE0 la variable Y"))); listSeparatorCorrel2_.setSelectedIndex(0); - paramCorrel.add(listVariablesGENECorrlX_); - paramCorrel.add(listSeparatorCorrel1_); - paramCorrel.add(listVariablesGENECorrlY_); - paramCorrel.add(listSeparatorCorrel2_); + pane=new JScrollPane(listVariablesGENECorrlX_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection la variable pour l'axe X"))); + paramCorrel.add(pane); + pane=new JScrollPane(listSeparatorCorrel1_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage associ\xE9e \xE0 la variable X"))); + paramCorrel.add(pane); + pane=new JScrollPane(listVariablesGENECorrlY_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection la variable pour l'axe Y"))); + paramCorrel.add(pane); + pane=new JScrollPane(listSeparatorCorrel2_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage associ\xE9e \xE0 la variable Y"))); + paramCorrel.add(pane); - return content; + return content2; } JPanel buildPanelParametresImportation(){ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -65,37 +65,46 @@ EGGraphe graphe_ = data.getGraphe(); EGCourbe[] listeChoixUser = data.getCourbes(); - //-- on ajoute un pas de temps qui decrit le graphe --// - String keyPDt="X=contenu graphe"; - structure_.addSeparator(keyPDt); + //--on ajoute tous les x donn\xE9s de la courbe= UNION DE TOUTES LES COURBES--// - final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); - for (int i = listeChoixUser.length - 1; i >= 0; i--) { - final EGCourbe c = listeChoixUser[i]; - for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { - final double x = c.getModel().getX(j); - // if ( (h.containsPoint(x))) { - // -- on ajoute le x pour les variables x si il n existe pas deja --// - structure_.insertNewX(x,keyPDt); - // } - } +// final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); +// for (int i = listeChoixUser.length - 1; i >= 0; i--) { +// final EGCourbe c = listeChoixUser[i]; +// for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { +// final double x = c.getModel().getX(j); +// // if ( (h.containsPoint(x))) { +// // -- on ajoute le x pour les variables x si il n existe pas deja --// +// structure_.insertNewX(x,keyPDt); +// // } +// } +// } + + //on recherche toutes les variables pr\xE9sentes dans le graphe + for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { + final EGObject ci = graphe_.getModel().getEGObject(i); + if (ci instanceof EGGroup) { + EGGroup groupe = (EGGroup) ci; + structure_.addVariable(groupe.getTitle()); + + } } - //-- ON INSERE LES Y CORRESPONDANTS POUR CHAQUE VARIABLES--// + + + + + //-- ON Cree un separator pour chaque courbe de chaque variables--// for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { final EGObject ci = graphe_.getModel().getEGObject(i); if (ci instanceof EGGroup) { EGGroup groupe = (EGGroup) ci; - boolean hasAlreadyRegistered=false; - - for (int k = 0; k < groupe.getChildCount(); k++) { EGCourbeChild courbe = groupe.getCourbeAt(k); - + boolean selected = false; for (int j = 0; !selected && j < listeChoixUser.length; j++) if (listeChoixUser[j] == courbe) @@ -103,39 +112,43 @@ if (selected) { - // -- il y a au moins une courbe selectionnee pour la variable, on - // va donc enregistrer la variable dans la structure - if (!hasAlreadyRegistered) { - hasAlreadyRegistered = true; - structure_.addVariable(groupe.getTitle()); - //ACHTUNG IL FAUT AJOUTER CETTE LISTE QUI PERMETTRA AU VARIABLE D INITIALISER LEUR DATA. - structure_.getListeVarForSeparator(keyPDt).add(new ArrayList<Double>()); - } + //-- on ajoute un pas de temps qui decrit le graphe --// + String keyPDt="X= "+groupe.getTitle()+": "+courbe.getTitle(); + structure_.addSeparator(keyPDt); + + + // --ajout d toutes les valeurs X et Y--/ + for(int g = 0; g < courbe.getModel().getNbValues(); g++) { + + //on ajoute le x + structure_.insertNewX(courbe.getModel().getX(g), keyPDt); + //on ajoute le y associ\xE9 a la bonne variable + int variableEnCours=structure_.getVariablePosition(groupe.getTitle()); + structure_.addValueForVariableAtSeparator(courbe.getModel().getY(g),variableEnCours , keyPDt); - // --ajout des valeurs pour chaque X--/ - for (int g = 0; g < structure_.getAllX(keyPDt).size(); g++) { - //-- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis --// - double x = structure_.getX(g,keyPDt); + +// //-- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis --// +// double x = structure_.getX(g,keyPDt); +// +// //-- on v\xE9rifie que le x existe pour la courbe actuelle --// +// boolean xExistForCourbe = false; +// int emplacementYcorrespondant = -1; +// for (int l = 0; !xExistForCourbe && l < courbe.getModel().getNbValues(); l++) { +// if (courbe.getModel().getX(l) == x) { +// xExistForCourbe = true; +// emplacementYcorrespondant = l; +// } +// } - //-- on v\xE9rifie que le x existe pour la courbe actuelle --// - boolean xExistForCourbe = false; - int emplacementYcorrespondant = -1; - for (int l = 0; !xExistForCourbe && l < courbe.getModel().getNbValues(); l++) { - if (courbe.getModel().getX(l) == x) { - xExistForCourbe = true; - emplacementYcorrespondant = l; - } - } - //double yInterpole = courbe.interpol(x); // -- si le x existe dans la courbe alors on inscrit son y // correspondant pour la bonne variable--// - if (xExistForCourbe) - structure_.addValueForVariableAtSeparator(courbe.getModel().getY(emplacementYcorrespondant), structure_.getNbVariables()-1, keyPDt); - else - // -- on enregistre une valeure foireuse. - structure_.addValueForVariableAtSeparator(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables()-1, keyPDt); +// if (xExistForCourbe) +// structure_.addValueForVariableAtSeparator(courbe.getModel().getY(emplacementYcorrespondant), structure_.getNbVariables()-1, keyPDt); +// else +// // -- on enregistre une valeure foireuse. +// structure_.addValueForVariableAtSeparator(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables()-1, keyPDt); } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -7,7 +7,7 @@ import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; import org.fudaa.fudaa.tr.post.TrPostDialogBilan; -import org.fudaa.fudaa.tr.post.TrPostDialogCurrentLine; +import org.fudaa.fudaa.tr.post.TrPostDialogLigneCourants; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; @@ -15,11 +15,12 @@ // final MvProfileTarget src_; TrPostProjet projet_; - + TrPostVisuPanel calque_; - public TrPostActionLigneCourants(TrPostProjet projet) { - super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); + public TrPostActionLigneCourants(TrPostProjet projet, TrPostVisuPanel panel) { + super(MvResource.getS("Calcul des lignes de courants/trajectoires"), MvResource.MV.getIcon("profile"), "BILAN"); projet_=projet; + calque_=panel; } @@ -28,7 +29,7 @@ public void actionPerformed(final ActionEvent _e) { // -- creation du wizard depusi le calque --// - new TrPostDialogCurrentLine(projet_,projet_.getImpl()); + new TrPostDialogLigneCourants(projet_,projet_.getImpl(),calque_); } Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -1,198 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import java.awt.Point; -import java.util.ArrayList; - -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.dodico.ef.EfData; -import org.fudaa.dodico.ef.EfGridData; -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.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.h2d.type.H2dVariableType; -import org.fudaa.ebli.geometrie.GrPoint; -import org.fudaa.ebli.geometrie.GrPolygone; -import org.fudaa.fudaa.tr.common.TrResource; - - -/** - * Algorithme de Calcul les lignes de courants - * @author Adrien Hadoux - * - */ -public class TrComputeCurrentLine implements EfLineIntersectionParent{ - - -/** - * data - */ -final TrPostSource data_; - -/** - * pour interpoler les valeur - */ -final EfInterpolator interpolator_; - -ProgressionInterface prog_; - -/** - * Liste des intersections r\xE9sultats - */ -ArrayList<EfLineIntersection> listeIntersection_=null; - - -public TrComputeCurrentLine(TrPostSource data_) { - super(); - this.data_ = data_; - this.interpolator_ = data_.getInterpolator(); -} - -public void progression(String desc, int completionRate){ - if(prog_==null) - return; - prog_.setDesc(TrResource.getS(desc)); - prog_.setProgression(5); - -} -/** - * Methode appel\xE9e par l'interface de calcul des lignes de courant. - * @param init point de depart - * @param dureeIntegration duree totale de l'integration en secondes - * @param indicePdt indice du pas de temps - * @param finesse coefficient de finesse double - * @param variable la variable a utiliser - * @param prog l'interface de progression, peut etre null - * @return - */ -public ArrayList<EfLineIntersection> computeLine(GrPoint init, double dureeIntegration, int indicePdt,double finesse ,H2dVariableType variable, ProgressionInterface prog){ - prog_=prog; - //on init le temps total avec l'indice du pas de temps fourni au depart - double tempsTotal=data_.getTimeStep(indicePdt); - double oldTempsTotal; - boolean inactif=false; - - - - - while(!inactif && tempsTotal<=dureeIntegration){ - oldTempsTotal=tempsTotal; - - //etape 1 \xE9l\xE9ment englobant de init - progression("Recherche \xE9l\xE9ment englobant",5); - int eltEnglob=elementEnglobant(init); - if(eltEnglob !=-1){ - //creation de la premiere intersection - EfLineIntersection.ItemMesh intersection=new EfLineIntersection.ItemMesh(eltEnglob,init.x_,init.y_); - //recup des datas - EfData dataX=data_.getData(variable, indicePdt); - double vx=intersection.getDistanceFrom(init.x_, init.y_); - double vy=intersection.getValueBadInterpolation(dataX); - - //calcul des distances avec son voisinage - EfNeighborMesh voisinage=EfNeighborMesh.compute(data_.getGrid(), prog_); - double distanceMaxEntrePoints=0; - int[] listeEltVoisins=null; - int voisinChoisi=0; - //cas sur un noeud - if(intersection.isNodeIntersection()){ - int nbVoisins=voisinage.getNbNeighborMeshes(eltEnglob); - listeEltVoisins=new int[nbVoisins]; - for(int i=0;i<nbVoisins;i++){ - //On calcule la distance avec lequel de ces points??? - listeEltVoisins[i] =voisinage.getNeighborMesh(eltEnglob, i); - } - - }else { - //comment faire en fudaa pour les autres cas??? - } - - //calcul de la distance max - if(listeEltVoisins!=null && listeEltVoisins.length>0) - voisinChoisi=listeEltVoisins[0]; - for(int i=0;i<listeEltVoisins.length;i++){ - int eltVoisin=listeEltVoisins[i]; - // comment je fais pour avoir les coordonn\xE9es x et y du point eltVoisin??? - double x=0 ;//a remplacer par les coordonn\xE9es de eltVoisin - double y=0; - double distance=Math.sqrt((init.x_-x)*(init.x_-x) + (init.y_-y)*(init.y_-y) ); - if(distanceMaxEntrePoints>distance){ - - //ACHTUNG!! VERIFIER QUE LE t+ deltaT<dureeIntegration si on choisit cette distance - if(vy!=0 && (tempsTotal+ distance/vy<=dureeIntegration)){ - distanceMaxEntrePoints=distance; - voisinChoisi=eltVoisin; - } - } - } - - //on calcul le nouveau temps total - if(vy !=0) - tempsTotal+=distanceMaxEntrePoints/vy; - - - - - - - - } - //on verifie que l'on n'est pas inactif - if(oldTempsTotal==tempsTotal) - inactif=true; - } - - return listeIntersection_; -} - - - - -/** - * Recherche l'\xE9l\xE9lment englobant pour un point donn\xE9 - * @param _prReel - * @param grid - * @return - */ -public int elementEnglobant(final GrPoint _prReel) { - 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; - } - -@Override -public void buildNeighbor(ProgressionInterface _prog) { - // TODO Auto-generated method stub - -} - -@Override -public EfGridInterface getGrid() { - // TODO Auto-generated method stub - return data_.getGrid(); -} - -@Override -public EfGridDataInterpolator getGridData() { - // TODO Auto-generated method stub - return null; -} - -@Override -public EfNeighborMesh getNeighbor() { - // TODO Auto-generated method stub - return null; -} - - - -} Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java (from rev 4025, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -0,0 +1,353 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.Point; +import java.util.ArrayList; + +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.ef.EfData; +import org.fudaa.dodico.ef.EfGridData; +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.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.h2d.type.H2dVariableType; +import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.ebli.geometrie.GrPolygone; +import org.fudaa.fudaa.tr.common.TrResource; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.PrecisionModel; + + +/** + * Algorithme de Calcul les lignes de courants + * @author Adrien Hadoux + * + */ +public class TrComputeLigneCourantTrajectoire implements EfLineIntersectionParent{ + + + /** + * data + */ + TrPostVisuPanel calque_; + final TrPostSource data_; + + /** + * pour interpoler les valeur + */ + final EfInterpolator interpolator_; + + + final EfLineIntersectorActivity lineIntersect_; + ProgressionInterface prog_; + + + ArrayList<GrPoint> listePointsARepartir_=new ArrayList<GrPoint>(); + + /** + * Liste des intersections r\xE9sultats + */ + ArrayList<EfLineIntersection> listeIntersection_=null; + + + public TrComputeLigneCourantTrajectoire(TrPostVisuPanel calque) { + super(); + calque_=calque; + this.data_ =calque.getSource(); + this.interpolator_ = data_.getInterpolator(); + this.lineIntersect_ = new EfLineIntersectorActivity(data_); + } + + + + /** + * Methode qui permet de repartir uniformement un nombre d points nb sur un segment. + * @param point1 extremites 1 du segment + * @param point2 extremite 2 du segment + * @param nbPointsARepartir nombre entier de points a repartir + * @return la liste des points repartis + */ + public static ArrayList<GrPoint> repartirUniformementPointsSurSegment(GrPoint point1, GrPoint point2, int nbPointsARepartir){ + + //on calcul leur droite d'equation + double coeff=0; + if(point1.x_-point2.x_!=0) + coeff=(point1.y_-point2.y_)/(point1.x_-point2.x_); + double ordonneeOrigine=point1.y_-coeff*point1.x_; + + + + int nbPoints=nbPointsARepartir; + if(nbPoints<2) + //on en met au moins 2 qui seront les extremites + nbPoints=2; + + + //on part du principe que le point 1 est le plus a gauche (abscisse plus petite) + if(point1.x_>point2.x_){ + GrPoint temp=new GrPoint(); + temp.initialiseAvec(point1); + point1.initialiseAvec(point2); + point2.initialiseAvec(temp); + } + + double distanceToAddEachPoint=Math.sqrt((point1.y_-point2.y_)*(point1.y_-point2.y_)+ (point1.x_-point2.x_)*(point1.x_-point2.x_))/nbPoints; + + ArrayList<GrPoint> listePointsARepartir=new ArrayList<GrPoint>(nbPoints); + + //ajout du point 1 dans la liste + listePointsARepartir.add(point1); + + // ajout des nbPoints-2 autre points + for(int i=0;i<nbPoints-2;i++){ + if(point1.x_-point2.x_!=0){ + double x=point1.x_+distanceToAddEachPoint*(i+1); + double y=coeff*x+ordonneeOrigine; + GrPoint newpoint=new GrPoint(x,y,0); + listePointsARepartir.add(newpoint); + } + else{ + //car droite perpendiculaire a l axe des x + double x=point1.x_; + double y=Math.min(point1.y_,point2.y_)+distanceToAddEachPoint*(i+1); + GrPoint newpoint=new GrPoint(x,y,0); + listePointsARepartir.add(newpoint); + } + } + + //ajout du point autre extremite + listePointsARepartir.add(point2); + + return listePointsARepartir; + } + + + + + public void progression(String desc, int completionRate){ + if(prog_==null) + return; + prog_.setDesc(TrResource.getS(desc)); + prog_.setProgression(5); + + } + /** + * Methode appel\xE9e par l'interface de calcul des lignes de courant. + * @param init point de depart + * @param dureeIntegration duree totale de l'integration en secondes + * @param indicePdt indice du pas de temps + * @param finesse coefficient de finesse double + * @param variable la variable a utiliser + * @param prog l'interface de progression, peut etre null + * @return + */ + public ArrayList<EfLineIntersection> computeLigneCourant(GrPoint extrem1segment,GrPoint extrem2segment, int nbPointsARepartirUniformement, double dureeIntegration, int indicePdt,double finesse ,H2dVariableType variable, ProgressionInterface prog){ + prog_=prog; + + + //on repartit les points uniform\xE9ment sur le segment + listePointsARepartir_=repartirUniformementPointsSurSegment(extrem1segment, extrem2segment, nbPointsARepartirUniformement); + + //test de l'algo avec le premier point + GrPoint 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 + GrPoint pointCourant=init; + //element sur lequel on se situe a l'iteration i + int elementCourant; + //intersection courante + EfLineIntersection intersectionCourante; + //donn\xE9es r\xE9cup\xE9r\xE9es fixe pour les lignes de courants + EfData dataX; + + //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 + dataX=data_.getData(variable, indicePdt); + + + + //-- Algo principal --// + + if(elementCourant !=-1){ + + while(!termine && tempsTotal<=dureeIntegration){ + 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_); + double vitesseY=intersectionCourante.getValueBadInterpolation(dataX); + + + //calcul des distances avec son voisinage + progression("Calcul des distances avec le voisinage",10); + EfNeighborMesh voisinage=EfNeighborMesh.compute(data_.getGrid(), prog_); + double distanceMaxEntrePoints=0; + int[] listeEltVoisins=null; + int voisinChoisi=0; + //cas sur un noeud + 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??? + listeEltVoisins[i] =voisinage.getNeighborMesh(elementCourant, i); + } + + }else { + //comment faire en fudaa pour les autres cas??? + //cas des arretes + + + } + + + + + //calcul de la distance max + if(listeEltVoisins!=null && listeEltVoisins.length>0) + voisinChoisi=listeEltVoisins[0]; + for(int i=0;i<listeEltVoisins.length;i++){ + int eltVoisin=listeEltVoisins[i]; + + // coordonn\xE9es de l'\xE9l\xE9ment voisin + double x= getCoordonnees(eltVoisin).x_; + double y=getCoordonnees(eltVoisin).y_; + 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 && (tempsTotal+ distance/vitesseY<=dureeIntegration)){ + distanceMaxEntrePoints=distance; + voisinChoisi=eltVoisin; + } + } + } + + + + //on calcul le nouveau temps total + if(vitesseY !=0) + tempsTotal+=distanceMaxEntrePoints/vitesseY; + + //on verifie que l'on n'est pas inactif + if(oldTempsTotal==tempsTotal ){ + termine=true; + }else{ + + //on a ondc un segment form\xE9 par element courant vers element choisi + GrPoint pointchoisi=new GrPoint(data_.getGrid().getCoor(voisinChoisi).x,data_.getGrid().getCoor(voisinChoisi).y,0); + + //recherche des intersection entre les points + Coordinate[] listeCoor=new Coordinate[2]; + listeCoor[0]=new Coordinate(pointCourant.x_,pointCourant.y_); + listeCoor[1]=new Coordinate(pointchoisi.x_,pointchoisi.y_); + + LineString ligne=new LineString(listeCoor,new PrecisionModel(),0); + progression("Recherche des intersections",50); + 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(0); + + // 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 + * @param element + * @return + */ + GrPoint getCoordonnees(int element){ + GrPoint point =new GrPoint(); + calque_.getIsoLayer().getIsoModel().point(element, point); + return point; + } + + + /** + * Recherche l'\xE9l\xE9lment englobant pour un point donn\xE9 + * @param _prReel + * @param grid + * @return + */ + public int elementEnglobant(final GrPoint _prReel) { + 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; + } + + @Override + public void buildNeighbor(ProgressionInterface _prog) { + // TODO Auto-generated method stub + + } + + @Override + public EfGridInterface getGrid() { + // TODO Auto-generated method stub + return data_.getGrid(); + } + + @Override + public EfGridDataInterpolator getGridData() { + // TODO Auto-generated method stub + return null; + } + + @Override + public EfNeighborMesh getNeighbor() { + // TODO Auto-generated method stub + return null; + } + + + + } Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java ___________________________________________________________________ Added: svn:mergeinfo + Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -1,392 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.util.ArrayList; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.DefaultListModel; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTree; -import javax.swing.ListModel; -import javax.swing.ListSelectionModel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableModel; - -import org.fudaa.ctulu.CtuluAnalyze; -import org.fudaa.ctulu.CtuluLib; -import org.fudaa.ctulu.CtuluListSelection; -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.ctulu.gui.CtuluLibSwing; -import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; -import org.fudaa.dodico.ef.EfComputeVolumeSeuil; -import org.fudaa.dodico.ef.EfData; -import org.fudaa.dodico.ef.EfDataIntegrale; -import org.fudaa.dodico.ef.EfFilter; -import org.fudaa.dodico.ef.EfFilterSelectedElement; -import org.fudaa.dodico.h2d.type.H2dVariableType; -import org.fudaa.ebli.calque.ZCalqueLigneBrisee; -import org.fudaa.ebli.calque.find.CalqueFindCourbeTreeModel; -import org.fudaa.ebli.commun.EbliSelectionMode; -import org.fudaa.ebli.geometrie.GrPoint; -import org.fudaa.ebli.ressource.EbliResource; -import org.fudaa.fudaa.commun.FudaaLib; -import org.fudaa.fudaa.meshviewer.layer.MvElementLayer; -import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; -import org.fudaa.fudaa.tr.common.TrResource; - -import com.memoire.bu.BuCharValidator; -import com.memoire.bu.BuStringValidator; -import com.memoire.bu.BuTextField; -import com.memoire.bu.BuValueValidator; -import com.vividsolutions.jts.geom.LinearRing; - -public class TrPostDialogCurrentLine { -/** - * booleen qui indique si le wizard a \xE9t\xE9t lanc\xE9 depuis un calque - */ - - -ArrayList<TrPostSource> source_; -TrPostCommonImplementation impl_; -TrComputeCurrentLine algoCalcul_; - -// donnees graphiques -JDialog dialog_; - -// variables et pdt -private JPanel panelVariables_; -ListModel modelVariables_; -JList listVar_; -ListModel modelPdt_; -JList listPdt_; - -// finesse et duree et point -private JPanel panelSeuil_; -BuTextField finesse_ = new BuTextField(5); -BuTextField duree_ = new BuTextField(5); -BuTextField x_ = new BuTextField(5); -BuTextField y_ = new BuTextField(5); - -// results -JPanel panelResults_; -JLabel results_; -JButton ajouter_ = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); -DefaultTableModel modelResult_; - -/** - * Constructeur reserv\xE9 au calques - * - * @param _builderParams - * @param _calque - * @param _modelGraphe - * @param _panelVariables - * @param _source - */ -public TrPostDialogCurrentLine(TrPostProjet projet,TrPostCommonImplementation impl) { - impl_ = impl; - source_ = projet.listeSrc_; - modelVariables_ = source_.get(0).getNewVarListModel(); - modelPdt_ = source_.get(0).getNewTimeListModel(); - - // -- construction de la dialog --// - buildDialog(); -} - - - - - - - -private JPanel buildresults() { - JPanel conteneur = new JPanel(new BorderLayout()); - - JPanel content = new JPanel(new FlowLayout(FlowLayout.CENTER)); - - results_ = new JLabel(""); - content.add(ajouter_); - // content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); - content.add(results_); - - conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("R\xE9sultats"))); - - // -- action relatives aux resultats --// - ajouter_.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent _e) { - if (controleDataOk()) { - computeResults(); - } - } - - }); - - modelResult_ = new DefaultTableModel(); - - JTable tableauRes = new JTable(modelResult_); - conteneur.add(tableauRes.getTableHeader(), BorderLayout.NORTH); - conteneur.add(tableauRes, BorderLayout.CENTER); - conteneur.add(content, BorderLayout.SOUTH); - return conteneur; -} - -public boolean controleDataOk() { - - - if (finesse_.getText().equals("")) { - impl_.error(TrResource.getS("La finesse doit \xEAtre d\xE9fini par un r\xE9el ")); - return false; - } - if (duree_.getText().equals("")) { - impl_.error(TrResource.getS("La dur\xE9e doit \xEAtre d\xE9fini par un r\xE9el en secondes ")); - return false; - } - if (x_.getText().equals("")) { - impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); - return false; - } - if (y_.getText().equals("")) { - impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); - return false; - } - if (listVar_.getSelectedIndex() == -1) { - impl_.error(TrResource.getS("Il faut choisir une variable")); - return false; - } - if (listPdt_.getSelectedIndex() == -1) { - impl_.error(TrResource.getS("Il faut choisir un pas de temps")); - return false; - } - return true; -} - -/** - * retourne la variable selectionnee - * - * @return - */ -protected H2dVariableType getSelectedVariable() { - - return (H2dVariableType) modelVariables_.getElementAt(listVar_.getSelectedIndex()); -} - -/** - * retourne l indice du pas de temps. - * - * @return - */ -protected int getSelectedTimeStep() { - return listPdt_.getSelectedIndex(); -} - -JList listeSources_; -DefaultListModel modelSources_; -private JPanel buildSources() { - JPanel conteneur = new JPanel(new BorderLayout()); - JPanel content = new JPanel(new GridLayout(1, 2)); - modelSources_=new DefaultListModel(); - for(TrPostSource source:source_) - modelSources_.addElement(source.getFile().getPath()); - listeSources_ = new JList(modelSources_); - listeSources_.setSelectedIndex(0); - listeSources_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - content.add(new JScrollPane(listeSources_)); - content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix du source"))); - conteneur.add(content, BorderLayout.CENTER); - - listeSources_.addListSelectionListener(new ListSelectionListener(){ - - @Override - public void valueChanged(ListSelectionEvent e) { - //reconstruction des models de var et de pdt - if(listeSources_.getSelectedIndex()!=-1){ - modelVariables_ = source_.get(listeSources_.getSelectedIndex()).getNewVarListModel(); - modelPdt_ = source_.get(listeSources_.getSelectedIndex()).getNewTimeListModel(); - listPdt_.setModel(modelPdt_); - listVar_.setModel(modelVariables_); - } - } - - }); - - return content; - } - - -private JPanel buildVariables() { - JPanel conteneur = new JPanel(new BorderLayout()); - JPanel content = new JPanel(new GridLayout(1, 2)); - listVar_ = new JList(modelVariables_); - listVar_.setSelectedIndex(0); - listPdt_ = new JList(modelPdt_); - listPdt_.setSelectedIndex(0); - listVar_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listPdt_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - content.add(new JScrollPane(listVar_)); - content.add(new JScrollPane(listPdt_)); - content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix des variables et pas de temps"))); - conteneur.add(content, BorderLayout.CENTER); - conteneur.add(new JLabel(TrResource.getS("Veuillez s\xE9lectionner la variable et pas de temps")), BorderLayout.NORTH); - return content; -} - - -private JPanel buildParams() { - finesse_.setCharValidator(BuCharValidator.FLOAT); - finesse_.setStringValidator(BuStringValidator.FLOAT); - finesse_.setValueValidator(BuValueValidator.FLOAT); - duree_.setCharValidator(BuCharValidator.FLOAT); - duree_.setStringValidator(BuStringValidator.FLOAT); - duree_.setValueValidator(BuValueValidator.FLOAT); - - x_.setCharValidator(BuCharValidator.FLOAT); - x_.setStringValidator(BuStringValidator.FLOAT); - x_.setValueValidator(BuValueValidator.FLOAT); - - y_.setCharValidator(BuCharValidator.FLOAT); - y_.setStringValidator(BuStringValidator.FLOAT); - y_.setValueValidator(BuValueValidator.FLOAT); - - JPanel conteneur = new JPanel(new GridLayout(2,1)); - conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de la finesse et dur\xE9e"))); - JPanel conteneur1 = new JPanel(new FlowLayout(FlowLayout.CENTER)); - conteneur1.add(new JLabel(TrResource.getS("Finesse:"))); - conteneur1.add(finesse_); - conteneur1.add(new JLabel(TrResource.getS("Dur\xE9e d'int\xE9gration:"))); - conteneur1.add(duree_); - JPanel conteneur2 = new JPanel(new FlowLayout(FlowLayout.CENTER)); - conteneur2.add(new JLabel(TrResource.getS("Point de d\xE9part:"))); - conteneur2.add(x_); - conteneur2.add(new JLabel(TrResource.getS("-"))); - conteneur2.add(y_); - conteneur.add(conteneur1); - conteneur.add(conteneur2); - - - return conteneur; - } - -/** - * Creation du panel graphique. - * - * @return - */ -JPanel panelSources_; -public Box buildContent() { - - Box content = Box.createVerticalBox(); - -//-- panel des sources --// - if(panelSources_==null) - panelSources_=buildSources(); - content.add(panelSources_); - - // -- panel des variables --// - if (panelVariables_ == null) panelVariables_ = buildVariables(); - content.add(panelVariables_); - - // -- panelSeuil - if (panelSeuil_ == null) panelSeuil_ = buildParams(); - content.add(panelSeuil_); - - // -- panel des resultats --// - if (panelResults_ == null) panelResults_ = buildresults(); - content.add(panelResults_); - - return content; -} - -public void buildDialog() { - - // CtuluUIDialog ui_ = new - // CtuluUIDialog(listeWidgetCalque_.get(0).getCalqueController - // ().getVisuPanel()); - - final Frame f = CtuluLibSwing.getFrameAncestorHelper(impl_.getCurrentInternalFrame()); - dialog_ = new JDialog(f); - - dialog_.addWindowListener(new WindowAdapter() { - public void windowClosed(WindowEvent _e) { - // on desactive l action de suivi sur le graphe - dialog_ = null; - } - - public void windowClosing(WindowEvent _e) { - dialog_ = null; - } - }); - - dialog_.setModal(true); - dialog_.pack(); - dialog_.setTitle(getTitle()); - JPanel container = new JPanel(new BorderLayout()); - container.add(buildContent(), BorderLayout.CENTER); - container.add(new JLabel("<html> <body><b><center>" + getTitle() + "</center></b> </body></html>"), - BorderLayout.NORTH); - dialog_.setContentPane(container); - dialog_.setSize(400, 450); - dialog_.setLocationRelativeTo(CtuluLibSwing.getFrameAncestor(impl_.getCurrentInternalFrame())); - dialog_.setVisible(true); - -} - -public String getTitle() { - return TrResource.getS("Lignes de courants"); - -} - - -protected double getFinesse() { - return Double.parseDouble(finesse_.getText()); -} - -protected double getX() { - return Double.parseDouble(x_.getText()); - } -protected double getY() { - return Double.parseDouble(y_.getText()); - } - - -protected double getDuree() { - return Double.parseDouble(duree_.getText()); - } -/** - * Methode qui realise les calculs d'int\xE9grale par rapport aux donn\xE9es - */ -private void computeResults() { - - new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan")) { - public void act() { - final ProgressionInterface prog = getMainStateReceiver(); - - - //creqtion de l algo - algoCalcul_=new TrComputeCurrentLine(source_.get(listeSources_.getSelectedIndex())); - GrPoint point =new GrPoint(getX(),getY(),0); - algoCalcul_.computeLine(point, getDuree(), getSelectedTimeStep(), getFinesse(), getSelectedVariable(), null); - - // -- mise a jour du tableau de res --// - modelResult_.fireTableDataChanged(); - impl_.unsetMainMessage(); - impl_.unsetMainProgression(); - } - }.start(); -} - -} Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java (from rev 4025, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -0,0 +1,474 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.ArrayList; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.DefaultListModel; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTree; +import javax.swing.ListModel; +import javax.swing.ListSelectionModel; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; + +import org.fudaa.ctulu.CtuluAnalyze; +import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.CtuluListSelection; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; +import org.fudaa.dodico.ef.EfComputeVolumeSeuil; +import org.fudaa.dodico.ef.EfData; +import org.fudaa.dodico.ef.EfDataIntegrale; +import org.fudaa.dodico.ef.EfFilter; +import org.fudaa.dodico.ef.EfFilterSelectedElement; +import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.ebli.calque.ZCalqueLigneBrisee; +import org.fudaa.ebli.calque.find.CalqueFindCourbeTreeModel; +import org.fudaa.ebli.commun.EbliSelectionMode; +import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.fudaa.commun.FudaaLib; +import org.fudaa.fudaa.meshviewer.layer.MvElementLayer; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; +import org.fudaa.fudaa.tr.common.TrResource; + +import com.memoire.bu.BuCharValidator; +import com.memoire.bu.BuStringValidator; +import com.memoire.bu.BuTextField; +import com.memoire.bu.BuValueValidator; +import com.vividsolutions.jts.geom.LinearRing; + +public class TrPostDialogLigneCourants { + /** + * booleen qui indique si le wizard a \xE9t\xE9t lanc\xE9 depuis un calque + */ + + + //ArrayList<TrPostSource> source_; + TrPostVisuPanel calque_; + TrPostSource source_; + TrPostCommonImplementation impl_; + TrComputeLigneCourantTrajectoire algoCalcul_; + +// donnees graphiques + JDialog dialog_; + + +// choix mode + JComboBox choixMode_=new JComboBox(new String[]{"Lignes de courant","Trajectoires"}); + + +// choix segment + BuTextField x_ = new BuTextField(5); + BuTextField y_ = new BuTextField(5); + BuTextField x2_ = new BuTextField(5); + BuTextField y2_ = new BuTextField(5); + BuTextField nbPoints_ = new BuTextField(5); + + +// variables et pdt + private JPanel panelVariables_; + ListModel modelVariables_; + JList listVar_; + ListModel modelPdt_; + JList listPdt_; + +// finesse et duree et point + private JPanel panelSeuil_; + BuTextField finesse_ = new BuTextField(5); + BuTextField duree_ = new BuTextField(5); + + +// results + JPanel panelResults_; + JLabel results_; + JButton ajouter_ = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); + DefaultTableModel modelResult_; + + /** + * Constructeur reserv\xE9 au calques + * + * @param _builderParams + * @param _calque + * @param _modelGraphe + * @param _panelVariables + * @param _source + */ + public TrPostDialogLigneCourants(TrPostProjet projet,TrPostCommonImplementation impl,TrPostVisuPanel calque) { + impl_ = impl; + calque_=calque; + source_ = calque.getSource(); + modelVariables_ = source_.getNewVarListModel(); + modelPdt_ = source_.getNewTimeListModel(); + + // -- construction de la dialog --// + buildDialog(); + } + + + + + + + + private JPanel buildresults() { + JPanel conteneur = new JPanel(new BorderLayout()); + + JPanel content = new JPanel(new FlowLayout(FlowLayout.CENTER)); + + results_ = new JLabel(""); + content.add(ajouter_); + // content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); + content.add(results_); + + conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("R\xE9sultats"))); + + // -- action relatives aux resultats --// + ajouter_.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent _e) { + if (controleDataOk()) { + computeResults(); + } + } + + }); + + modelResult_ = new DefaultTableModel(); + + JTable tableauRes = new JTable(modelResult_); + conteneur.add(tableauRes.getTableHeader(), BorderLayout.NORTH); + conteneur.add(tableauRes, BorderLayout.CENTER); + conteneur.add(content, BorderLayout.SOUTH); + return conteneur; + } + + public boolean controleDataOk() { + + + if (finesse_.getText().equals("")) { + impl_.error(TrResource.getS("La finesse doit \xEAtre d\xE9fini par un r\xE9el ")); + return false; + } + if (duree_.getText().equals("")) { + impl_.error(TrResource.getS("La dur\xE9e doit \xEAtre d\xE9fini par un r\xE9el en secondes ")); + return false; + } + if (x_.getText().equals("")) { + impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); + return false; + } + if (nbPoints_.getText().equals("")) { + impl_.error(TrResource.getS("Le nombre de points \xE0 r\xE9partir manquant")); + return false; + } + if (y_.getText().equals("")) { + impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); + return false; + } + if (x2_.getText().equals("")) { + impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); + return false; + } + if (y2_.getText().equals("")) { + impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); + return false; + } + + if (listVar_.getSelectedIndex() == -1) { + impl_.error(TrResource.getS("Il faut choisir une variable")); + return false; + } + if (listPdt_.getSelectedIndex() == -1) { + impl_.error(TrResource.getS("Il faut choisir un pas de temps")); + return false; + } + + if(getNbPoints()<2){ + nbPoints_.setText(""+2); + } + + return true; + } + + /** + * retourne la variable selectionnee + * + * @return + */ + protected H2dVariableType getSelectedVariable() { +... [truncated message content] |
From: <de...@us...> - 2008-10-05 22:05:37
|
Revision: 4034 http://fudaa.svn.sourceforge.net/fudaa/?rev=4034&view=rev Author: deniger Date: 2008-10-05 22:05:30 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersection.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.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/TrPostCourbeAddPointsAction.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/TrPostCourbeBuilder.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/TrPostDialogLigneCourants.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/TrPostWizardCourbeTemporelle.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -26,17 +26,12 @@ import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; import javax.swing.plaf.IconUIResource; import javax.swing.plaf.metal.MetalTheme; -import org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel; - - - import com.memoire.fu.FuFactoryInteger; import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -9,7 +9,6 @@ import com.vividsolutions.jts.geom.*; - /** * @author Fred Deniger * @version $Id: GISGeometryFactory.java,v 1.10 2007-04-20 16:20:17 deniger Exp $ @@ -26,15 +25,15 @@ super(new PrecisionModel(10E6), 0, new GISCoordinateSequenceFactory()); } - public Point createPoint(final Coordinate _coordinate){ + public Point createPoint(final Coordinate _coordinate) { return new GISPoint(_coordinate); } - public Point createPoint(final double _x,final double _y,final double _z){ + public Point createPoint(final double _x, final double _y, final double _z) { return new GISPoint(_x, _y, _z); } - public CoordinateSequence createLinearRingDefaultSequence(){ + public CoordinateSequence createLinearRingDefaultSequence() { final CoordinateSequence seq = getCoordinateSequenceFactory().create(4, 2); seq.setOrdinate(0, 0, 0); seq.setOrdinate(0, 1, 0); @@ -46,10 +45,8 @@ seq.setOrdinate(3, 1, 0); return seq; } - - - public GISPolygone createLinearRing(final double _xMin,final double _xMax,final double _yMin,final double _yMax){ + public GISPolygone createLinearRing(final double _xMin, final double _xMax, final double _yMin, final double _yMax) { final CoordinateSequence seq = getCoordinateSequenceFactory().create(5, 2); seq.setOrdinate(0, 0, _xMin); seq.setOrdinate(0, 1, _yMin); @@ -64,36 +61,39 @@ return (GISPolygone) createLinearRing(seq); } - public Point createPoint(final CoordinateSequence _coordinates){ + public Point createPoint(final CoordinateSequence _coordinates) { return createPoint(_coordinates.getCoordinate(0)); } - public LinearRing createLinearRing(final Coordinate[] _coordinates){ + public LinearRing createLinearRing(final Coordinate[] _coordinates) { return new GISPolygone(getCoordinateSequenceFactory().create(_coordinates)); } - public LinearRing createLinearRingImmutable(final Coordinate[] _coordinates){ + public GISPolyligne createSegment(final double _x1, final double _y1, final double _x2, final double _y2) { + final CoordinateSequence seq = getCoordinateSequenceFactory().create(2, 2); + seq.setOrdinate(0, 0, _x1); + seq.setOrdinate(0, 1, _y1); + seq.setOrdinate(1, 0, _x2); + seq.setOrdinate(1, 1, _y2); + return (GISPolyligne) createLineString(seq); + } + + public LinearRing createLinearRingImmutable(final Coordinate[] _coordinates) { return new GISPolygone(((GISCoordinateSequenceFactory) getCoordinateSequenceFactory()) .createImmutable(_coordinates)); } - public LinearRing createLinearRing(final CoordinateSequence _coordinates){ + public LinearRing createLinearRing(final CoordinateSequence _coordinates) { return new GISPolygone(_coordinates); } - public LinearRing transformToLinearRing(final LineString _s){ - if(_s==null) { - return null; - } - if (_s instanceof LinearRing) { - return (LinearRing) _s; - } - if (_s.isClosed()) { - return createLinearRing(_s.getCoordinateSequence()); - } + public LinearRing transformToLinearRing(final LineString _s) { + if (_s == null) { return null; } + if (_s instanceof LinearRing) { return (LinearRing) _s; } + if (_s.isClosed()) { return createLinearRing(_s.getCoordinateSequence()); } final CoordinateSequence seq = _s.getCoordinateSequence(); - final CoordinateSequence newSeq = GISGeometryFactory.INSTANCE.getCoordinateSequenceFactory().create( - seq.size() + 1, 3); + final CoordinateSequence newSeq = GISGeometryFactory.INSTANCE.getCoordinateSequenceFactory().create(seq.size() + 1, + 3); final int oldSize = seq.size(); for (int i = oldSize - 1; i >= 0; i--) { newSeq.setOrdinate(i, 0, seq.getX(i)); @@ -104,26 +104,24 @@ return createLinearRing(newSeq); } - public LineString createLineString(final Coordinate[] _coordinates){ + public LineString createLineString(final Coordinate[] _coordinates) { return new GISPolyligne(getCoordinateSequenceFactory().create(_coordinates)); } - public LineString createLineString(final CoordinateSequence _coordinates){ + public LineString createLineString(final CoordinateSequence _coordinates) { return new GISPolyligne(_coordinates); } - public LineString createLineStringNiveau(final CoordinateSequence _coordinates){ + public LineString createLineStringNiveau(final CoordinateSequence _coordinates) { return new GISPolyligneNiveau(_coordinates); } - public LinearRing createLinearRingNiveau(final CoordinateSequence _coordinates){ + public LinearRing createLinearRingNiveau(final CoordinateSequence _coordinates) { return new GISPolygoneNiveau(_coordinates); } - public MultiPoint createMultiPoint(final Coordinate[] _coordinates){ - if (_coordinates == null) { - return null; - } + public MultiPoint createMultiPoint(final Coordinate[] _coordinates) { + if (_coordinates == null) { return null; } final int n = _coordinates.length; final GISPoint[] pt = new GISPoint[_coordinates.length]; for (int i = 0; i < n; i++) { @@ -132,27 +130,25 @@ return new GISMultiPoint(pt); } - public MultiPoint createMultiPoint(final Point[] _point){ + public MultiPoint createMultiPoint(final Point[] _point) { return new GISMultiPoint(_point); } - public GeometryCollection createGeometryCollection(final Geometry[] _geometries){ + public GeometryCollection createGeometryCollection(final Geometry[] _geometries) { return super.createGeometryCollection(_geometries); } - public MultiLineString createMultiLineString(final LineString[] _lineStrings){ + public MultiLineString createMultiLineString(final LineString[] _lineStrings) { return new GISMultiPolyligne(_lineStrings); } - public MultiPoint createMultiPoint(final CoordinateSequence _coordinates){ - if (_coordinates == null) { - return null; - } + public MultiPoint createMultiPoint(final CoordinateSequence _coordinates) { + if (_coordinates == null) { return null; } final int n = _coordinates.size(); final GISPoint[] pt = new GISPoint[n]; for (int i = 0; i < n; i++) { - pt[i] = (GISPoint) createPoint(_coordinates.getX(i), _coordinates.getY(i), _coordinates - .getOrdinate(i, CoordinateSequence.Z)); + pt[i] = (GISPoint) createPoint(_coordinates.getX(i), _coordinates.getY(i), _coordinates.getOrdinate(i, + CoordinateSequence.Z)); } return new GISMultiPoint(pt); } @@ -160,30 +156,26 @@ /** * Renvoie un GISPolygone si non vide. */ - public Geometry toGeometry(final Envelope _envelope){ - if (_envelope.isNull()) { - return createPoint((CoordinateSequence) null); - } - if (_envelope.getMinX() == _envelope.getMaxX() && _envelope.getMinY() == _envelope.getMaxY()) { - return createPoint(new Coordinate(_envelope.getMinX(), _envelope.getMinY())); - } - return createLinearRing(new Coordinate[] { - new Coordinate(_envelope.getMinX(), _envelope.getMinY()), + public Geometry toGeometry(final Envelope _envelope) { + if (_envelope.isNull()) { return createPoint((CoordinateSequence) null); } + if (_envelope.getMinX() == _envelope.getMaxX() && _envelope.getMinY() == _envelope.getMaxY()) { return createPoint(new Coordinate( + _envelope.getMinX(), _envelope.getMinY())); } + return createLinearRing(new Coordinate[] { new Coordinate(_envelope.getMinX(), _envelope.getMinY()), new Coordinate(_envelope.getMaxX(), _envelope.getMinY()), new Coordinate(_envelope.getMaxX(), _envelope.getMaxY()), new Coordinate(_envelope.getMinX(), _envelope.getMaxY()), - new Coordinate(_envelope.getMinX(), _envelope.getMinY())}); + new Coordinate(_envelope.getMinX(), _envelope.getMinY()) }); } - public Polygon createPolygon(final LinearRing _shell,final LinearRing[] _holes){ + public Polygon createPolygon(final LinearRing _shell, final LinearRing[] _holes) { return new GISPolygoneWithHole(_shell, _holes); } - public MultiPolygon createMultiPolygon(final Polygon[] _polygons){ + public MultiPolygon createMultiPolygon(final Polygon[] _polygons) { return super.createMultiPolygon(_polygons); } - public Geometry createGeometry(final Geometry _g){ + public Geometry createGeometry(final Geometry _g) { return super.createGeometry(_g); } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -29,9 +29,7 @@ public class EfNeighborMesh { public static EfNeighborMesh compute(final EfGridInterface _grid, final ProgressionInterface _prog) { - if (_grid == null) { - return null; - } + if (_grid == null) { return null; } final ProgressionUpdater up = new ProgressionUpdater(_prog); up.majProgessionStateOnly(DodicoLib.getS("Recherche des mailles voisines")); final int nbPt = _grid.getPtsNb(); @@ -120,12 +118,8 @@ public int[] getAdjacentMeshes(final int _idxPt1, final int _idxPt2) { final TIntHashSet set = new TIntHashSet(neighbor_[_idxPt1]); set.retainAll(neighbor_[_idxPt2]); - if (set.size() > 2) { - throw new IllegalStateException("maillage non conforme"); - } - if (set.size() == 1) { - return new int[] { set.iterator().next(), -1 }; - } + if (set.size() > 2) { throw new IllegalStateException("maillage non conforme"); } + if (set.size() == 1) { return new int[] { set.iterator().next(), -1 }; } return set.toArray(); } @@ -133,23 +127,15 @@ public int getAdjacentMeshes(final int _idxPt1, final int _idxPt2, final int _idxEltToAvoid) { final TIntHashSet set = new TIntHashSet(neighbor_[_idxPt1]); set.retainAll(neighbor_[_idxPt2]); - if (set.size() > 2) { - throw new IllegalStateException("maillage non conforme"); - } + if (set.size() > 2) { throw new IllegalStateException("maillage non conforme"); } final TIntIterator it = set.iterator(); - if (!it.hasNext()) { - return -1; - } + if (!it.hasNext()) { return -1; } int first = it.next(); - if (first != _idxEltToAvoid) { - return first; - } + if (first != _idxEltToAvoid) { return first; } if (it.hasNext()) { first = it.next(); - if (first != _idxEltToAvoid) { - return first; - } + if (first != _idxEltToAvoid) { return first; } } return -1; @@ -176,8 +162,7 @@ public double getAverageForNode(final CtuluVariable _var, final int _idxPt, final int _tIdx, final EfData _dataElement, EfGridData _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, _datas, _vects); + if (_vects.isVect(_var)) { return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, _datas, _vects); } return getAverageForNodeDanger(_idxPt, _dataElement); @@ -185,9 +170,8 @@ public double getAverageForNode(final CtuluVariable _var, final int _idxPt, final int _tIdx, final EfData _dataElement, EfGridDataInterpolator _datas) { - if (_datas.getInterpolator().getVect().isVect(_var)) { - return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, _datas.getGridData(), _datas.getInterpolator() - .getVect()); + if (_datas.getInterpolator().getVect().isVect(_var)) { return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, + _datas.getGridData(), _datas.getInterpolator().getVect()); } return getAverageForNodeDanger(_idxPt, _dataElement); @@ -206,25 +190,19 @@ public double getAverageForNode(final CtuluVariable _var, final int _idxPt, InterpolationSupportValuesMultiI _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getAverageForVect(_var, _idxPt, _datas.getValues(_var), _datas, _vects); - } + if (_vects.isVect(_var)) { return getAverageForVect(_var, _idxPt, _datas.getValues(_var), _datas, _vects); } return getAverageForNodeDanger(_idxPt, _datas.getValues(_var)); } public double getAverageForNode(final CtuluVariable _var, final int _idxPt, CtuluCollectionDouble _data, InterpolationSupportValuesMultiI _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getAverageForVect(_var, _idxPt, _data, _datas, _vects); - } + if (_vects.isVect(_var)) { return getAverageForVect(_var, _idxPt, _data, _datas, _vects); } return getAverageForNodeDanger(_idxPt, _data); } public EfDataNode getDataNode(final CtuluVariable _var, final CtuluCollectionDouble _data, InterpolationSupportValuesMultiI _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getDataNodeVecteur(_var, _data, _datas, _vects); - } + if (_vects.isVect(_var)) { return getDataNodeVecteur(_var, _data, _datas, _vects); } return getDataNodeSimple(_data); } @@ -241,9 +219,7 @@ public EfDataNode getDataNode(final CtuluVariable _var, InterpolationSupportValuesMultiI _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getDataNodeVecteur(_var, _datas.getValues(_var), _datas, _vects); - } + if (_vects.isVect(_var)) { return getDataNodeVecteur(_var, _datas.getValues(_var), _datas, _vects); } return getDataNodeSimple(_datas.getValues(_var)); } @@ -259,4 +235,13 @@ public int getNeighborMesh(final int _idxPt, final int _idxMesh) { return neighbor_[_idxPt][_idxMesh]; } + + /** + * @param _idxPt l'indice du noeud + * @param _idxMeshes la liste des indices des \xE9l\xE9ments a remplir + */ + public void fillWithAdjacentMeshes(final int _idxPt, TIntHashSet _idxMeshes) { + _idxMeshes.addAll(neighbor_[_idxPt]); + + } } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersection.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersection.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersection.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -7,6 +7,8 @@ */ package org.fudaa.dodico.ef.operation; +import gnu.trove.TIntHashSet; + import java.io.IOException; import java.util.Collection; @@ -18,11 +20,127 @@ 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.EfInterpolator; public abstract class EfLineIntersection implements EfLineIntersectionI { + /** + * Definie une intersection sur une arete. + * + * @author fred deniger + * @version $Id: EfLineIntersection.java,v 1.5 2007-06-13 12:55:42 deniger Exp $ + */ + public final static class ItemEdge extends EfLineIntersection { + + int[] adjacentMesh_; + final int i1_; + final int i2_; + final double x_; + final double y_; + + public ItemEdge(final int _i1, final int _i2, final double _x, double _y) { + super(); + i1_ = _i1; + i2_ = _i2; + x_ = _x; + y_ = _y; + } + + @Override + public void fillWithAdjacentMeshes(TIntHashSet _idxMeshes) { + buildAdjacentMeshes(); + if (adjacentMesh_[0] >= 0) _idxMeshes.add(adjacentMesh_[0]); + if (adjacentMesh_[1] >= 0) _idxMeshes.add(adjacentMesh_[1]); + + } + + private double getD1() { + return 1 / CtuluLibGeometrie.getDistance(x_, y_, parent_.getGrid().getPtX(i1_), parent_.getGrid().getPtY(i1_)); + } + + private double getD2() { + return 1 / CtuluLibGeometrie.getDistance(x_, y_, parent_.getGrid().getPtX(i2_), parent_.getGrid().getPtY(i2_)); + } + + public int getI1() { + return i1_; + } + + public int getI2() { + return i2_; + } + + public double getValue(CtuluVariable _var, int _tIdx) { + if (parent_ == null) throw new IllegalAccessError("pas de parent"); + EfGridDataInterpolator data = parent_.getGridData(); + try { + if (data.getGridData().isElementVar(_var)) { + + buildAdjacentMeshes(); + if (adjacentMesh_[1] < 0) return data.getGridData().getData(_var, _tIdx, adjacentMesh_[0]); + return data.getInterpolator().getMidValue(adjacentMesh_[0], adjacentMesh_[1], _var, _tIdx); + } + + double d1 = getD1(); + double d2 = getD2(); + return data.getInterpolator().getValue(i1_, i2_, d1 / (d1 + d2), d2 / (d1 + d2), _var, _tIdx); + } catch (IllegalAccessError _evt) { + FuLog.error(_evt); + + } catch (IOException _evt) { + FuLog.error(_evt); + + } + return 0; + } + + private void buildAdjacentMeshes() { + parent_.buildNeighbor(null); + if (adjacentMesh_ == null) adjacentMesh_ = parent_.getNeighbor().getAdjacentMeshes(i1_, i2_); + } + + public double getValueBadInterpolation(EfData _d) { + if (_d.isElementData()) { + + buildAdjacentMeshes(); + if (adjacentMesh_[1] < 0) return _d.getValue(adjacentMesh_[0]); + return (_d.getValue(adjacentMesh_[0]) + _d.getValue(adjacentMesh_[1])) / 2D; + } + + double d1 = getD1(); + double d2 = getD2(); + return (d1 * _d.getValue(i1_) + d2 * _d.getValue(i2_)) / (d1 + d2); + } + + public double getX() { + return x_; + } + + public double getY() { + return y_; + } + + public boolean isEdgeIntersection() { + return true; + } + + public int isMeshIntersection() { + return -1; + } + + public boolean isOnSameEfObject(EfLineIntersectionI _other) { + if (_other == null) return false; + if (_other.isEdgeIntersection()) { + ItemEdge edge = (ItemEdge) _other; + return (edge.i1_ == i1_ && edge.i2_ == i2_) || (edge.i1_ == i2_ && edge.i2_ == i1_); + } + return false; + } + + } + static class ItemInitial { int ielt_ = -1; @@ -55,9 +173,7 @@ // priorit\xE9 // au point issu du profil - if (item2_ == null && item1_.isNodeIntersection() && !item1_.isAPointProfileIntersection()) { - return; - } + if (item2_ == null && item1_.isNodeIntersection() && !item1_.isAPointProfileIntersection()) { return; } if (item2_ != null && item2_.isAPointProfileIntersection()) { if (_dest.contains(item2_)) _dest.remove(item2_); @@ -148,109 +264,6 @@ } /** - * Definie une intersection sur une arete. - * - * @author fred deniger - * @version $Id: EfLineIntersection.java,v 1.5 2007-06-13 12:55:42 deniger Exp $ - */ - public final static class ItemEdge extends EfLineIntersection { - - int[] adjacentMesh_; - final int i1_; - final int i2_; - final double x_; - final double y_; - - public ItemEdge(final int _i1, final int _i2, final double _x, double _y) { - super(); - i1_ = _i1; - i2_ = _i2; - x_ = _x; - y_ = _y; - } - - public int getI1() { - return i1_; - } - - public int getI2() { - return i2_; - } - - public boolean isOnSameEfObject(EfLineIntersectionI _other) { - if (_other == null) return false; - if (_other.isEdgeIntersection()) { - ItemEdge edge = (ItemEdge) _other; - return (edge.i1_ == i1_ && edge.i2_ == i2_) || (edge.i1_ == i2_ && edge.i2_ == i1_); - } - return false; - } - - public double getValue(CtuluVariable _var, int _tIdx) { - if (parent_ == null) throw new IllegalAccessError("pas de parent"); - EfGridDataInterpolator data = parent_.getGridData(); - try { - if (data.getGridData().isElementVar(_var)) { - - parent_.buildNeighbor(null); - if (adjacentMesh_ == null) adjacentMesh_ = parent_.getNeighbor().getAdjacentMeshes(i1_, i2_); - if (adjacentMesh_[1] < 0) return data.getGridData().getData(_var, _tIdx, adjacentMesh_[0]); - return data.getInterpolator().getMidValue(adjacentMesh_[0], adjacentMesh_[1], _var, _tIdx); - } - - double d1 = getD1(); - double d2 = getD2(); - return data.getInterpolator().getValue(i1_, i2_, d1 / (d1 + d2), d2 / (d1 + d2), _var, _tIdx); - } catch (IllegalAccessError _evt) { - FuLog.error(_evt); - - } catch (IOException _evt) { - FuLog.error(_evt); - - } - return 0; - } - - public double getValueBadInterpolation(EfData _d) { - if (_d.isElementData()) { - parent_.buildNeighbor(null); - if (adjacentMesh_ == null) adjacentMesh_ = parent_.getNeighbor().getAdjacentMeshes(i1_, i2_); - if (adjacentMesh_[1] < 0) return _d.getValue(adjacentMesh_[0]); - return (_d.getValue(adjacentMesh_[0]) + _d.getValue(adjacentMesh_[1])) / 2D; - } - - double d1 = getD1(); - double d2 = getD2(); - return (d1 * _d.getValue(i1_) + d2 * _d.getValue(i2_)) / (d1 + d2); - } - - private double getD2() { - return 1 / CtuluLibGeometrie.getDistance(x_, y_, parent_.getGrid().getPtX(i2_), parent_.getGrid().getPtY(i2_)); - } - - private double getD1() { - return 1 / CtuluLibGeometrie.getDistance(x_, y_, parent_.getGrid().getPtX(i1_), parent_.getGrid().getPtY(i1_)); - } - - public double getX() { - return x_; - } - - public double getY() { - return y_; - } - - public boolean isEdgeIntersection() { - return true; - } - - public int isMeshIntersection() { - return -1; - } - - } - - /** * Une intersection definie sur un \xE9l\xE9ment: utilise pour Rubar et pour un point a interpoler. * * @author fred deniger @@ -270,12 +283,10 @@ } - public boolean isOnSameEfObject(EfLineIntersectionI _other) { - if (_other != null && !_other.isRealIntersection() && !_other.isNodeIntersection()) { - return isMeshIntersection() == _other.isMeshIntersection(); + @Override + public void fillWithAdjacentMeshes(TIntHashSet _idxMeshes) { + _idxMeshes.add(ielt_); - } - return false; } public ItemMesh(final ItemInitial _init) { @@ -321,6 +332,14 @@ return ielt_; } + public boolean isOnSameEfObject(EfLineIntersectionI _other) { + if (_other != null && !_other.isRealIntersection() && !_other.isNodeIntersection()) { return isMeshIntersection() == _other + .isMeshIntersection(); + + } + return false; + } + public boolean isRealIntersection() { return ielt_ >= 0; } @@ -342,18 +361,6 @@ ptIdx_ = _ptIdx; } - public boolean isOnSameEfObject(EfLineIntersectionI _other) { - if (_other == null) return false; - if (_other.isNodeIntersection()) { - return ((ItemNode) _other).ptIdx_ == ptIdx_; - } - return false; - } - - public String toString() { - return getClass().getName() + " " + ptIdx_; - } - public double getValue(CtuluVariable _var, int _tIdx) { EfGridDataInterpolator data = parent_.getGridData(); try { @@ -373,6 +380,14 @@ return 0; } + @Override + public void fillWithAdjacentMeshes(TIntHashSet _idxMeshes) { + // on construit au cas ou... + getParent().buildNeighbor(null); + getParent().getNeighbor().fillWithAdjacentMeshes(ptIdx_, _idxMeshes); + + } + public double getValueBadInterpolation(EfData _d) { if (_d.isElementData()) { parent_.buildNeighbor(null); @@ -406,6 +421,16 @@ return ptIdx_ == _ptIdx; } + public boolean isOnSameEfObject(EfLineIntersectionI _other) { + if (_other == null) return false; + if (_other.isNodeIntersection()) { return ((ItemNode) _other).ptIdx_ == ptIdx_; } + return false; + } + + public String toString() { + return getClass().getName() + " " + ptIdx_; + } + } /** @@ -417,6 +442,7 @@ public final static class ItemNoIntersect extends EfLineIntersection { final double x_; + final double y_; public ItemNoIntersect(final double _x, final double _y) { @@ -425,8 +451,10 @@ y_ = _y; } - public boolean isOnSameEfObject(EfLineIntersectionI _other) { - return false; + @Override + public void fillWithAdjacentMeshes(TIntHashSet _idxMeshes) { + // ne renvoie rien + } public double getValue(CtuluVariable _var, int _tIdx) { @@ -449,6 +477,10 @@ return -1; } + public boolean isOnSameEfObject(EfLineIntersectionI _other) { + return false; + } + public boolean isRealIntersection() { return false; } @@ -461,6 +493,15 @@ protected EfLineIntersection() {} + /** + * Remplit la set avec les indices de tous les \xE9l\xE9mnents adjacents. Si l'intersection est dans un \xE9l\xE9ment seul + * l'indice de l'\xE9l\xE9ment est renvoye. + * + * @param _idxMeshes ne doit pas etre vide et sera rempli avec les indices de tous les \xE9l\xE9ments adjacents \xE0 cette + * intersection. + */ + public abstract void fillWithAdjacentMeshes(TIntHashSet _idxMeshes); + public double getD2From(double _x, double _y) { return CtuluLibGeometrie.getD2(getX(), getY(), _x, _y); } @@ -473,14 +514,20 @@ return parent_; } - public boolean isEdgeIntersection() { - return false; - } + /** + * @param _d les donn\xE9es en accord avec le maillage (meme nombre de point) + * @return la valeur non interpol\xE9e correction + */ + public abstract double getValueBadInterpolation(EfData _d); public boolean isAPointProfileIntersection() { return extremiteIntersect_; } + public boolean isEdgeIntersection() { + return false; + } + public boolean isNodeIntersection() { return false; } @@ -489,18 +536,12 @@ return false; } - /** - * @param _d les donn\xE9es en accord avec le maillage (meme nombre de point) - * @return la valeur non interpol\xE9e correction - */ - public abstract double getValueBadInterpolation(EfData _d); + public abstract boolean isOnSameEfObject(EfLineIntersectionI _other); public boolean isRealIntersection() { return true; } - public abstract boolean isOnSameEfObject(EfLineIntersectionI _other); - public void setParent(EfLineIntersectionParent _parent) { parent_ = _parent; } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -106,6 +106,14 @@ return _c.getFriction(); } }; + + public static final H2dVariableType SANS = new H2dVariableType(H2dResource.getS("Sans"), null, "sans") { + + public double getValue(final H2dVariableTypeContainer _c) { + return 0; + } + }; + public static final H2dVariableType COEF_DIFFUSION = new H2dVariableType(H2dResource.getS("Coefficient diffusion"), null, "dif") { @@ -450,9 +458,7 @@ */ public static H2dVariableType getVarFromShortName(final String _shortName, final Map _shortNameVarCreated) { final H2dVariableType t = (H2dVariableType) shortNameVar.get(_shortName); - if (t == null && _shortNameVarCreated != null) { - return (H2dVariableType) _shortNameVarCreated.get(_shortName); - } + if (t == null && _shortNameVarCreated != null) { return (H2dVariableType) _shortNameVarCreated.get(_shortName); } return t; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -122,7 +122,7 @@ * a utiliser pour les formats scope * */ - void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog); +// void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog); public boolean isSpatial(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -9,24 +9,19 @@ import java.io.File; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import javax.swing.AbstractAction; -import javax.swing.AbstractListModel; import javax.swing.BorderFactory; import javax.swing.DefaultListModel; -import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.JTextField; import javax.swing.ListSelectionModel; import javax.swing.filechooser.FileFilter; -import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibArray; @@ -38,20 +33,13 @@ import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.dodico.mesure.EvolutionReguliere; -import org.fudaa.dodico.reflux.io.CLTransitoireFileFormat; -import org.fudaa.dodico.reflux.io.CrbFileFormat; -import org.fudaa.dodico.rubar.io.RubarCLIFileFormat; -import org.fudaa.dodico.rubar.io.RubarTARFileFormat; import org.fudaa.dodico.telemac.io.ScopeGENEFileFormat; import org.fudaa.dodico.telemac.io.ScopeSFileFormat; import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.dodico.telemac.io.ScopeTFileFormat; -import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.fudaa.commun.FudaaLib; -import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; -import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporterScope; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.impl.FudaaGuiLib; import org.fudaa.fudaa.ressource.FudaaResource; @@ -61,7 +49,6 @@ import com.memoire.bu.BuButtonPanel; import com.memoire.bu.BuCharValidator; import com.memoire.bu.BuFileFilter; -import com.memoire.bu.BuIcon; import com.memoire.bu.BuResource; import com.memoire.bu.BuStringValidator; import com.memoire.bu.BuTextField; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -462,8 +462,6 @@ fireGlobalChanged(); } - public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { - } public boolean isSpatial() { return false; 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-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -253,7 +253,7 @@ /** - * Recherche le point qui peut contenir la sonde pour bien initialiser la var. + * Recherche l'\xE9l\xE9ment qui peut contenir la sonde pour bien initialiser la var. * * @param _prReel * @param grid Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddPointsAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddPointsAction.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddPointsAction.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -39,23 +39,24 @@ addNewPoints(impl_, panel_, model_); } - public static void addNewPoints(final FudaaCommonImplementation _impl, final TrPostVisuPanel _panel, final EGGraphe _model) { + public static void addNewPoints(final FudaaCommonImplementation _impl, final TrPostVisuPanel _panel, + final EGGraphe _model) { if (_panel.isSelectionOkForEvolution()) { final int[] idx = _panel.getSelectionForEvolution(); - startImportIdx(_impl, _model, idx); + startImportIdx(_impl, _panel.getSource(),_model, idx); } else if (_panel.isSelectionOkForEvolutionSonde()) { final TrPostInterpolatePoint pt = _panel.getInterpolePointForEvol(); - startImportInterpolate(_impl, _model, pt); + startImportInterpolate(_impl, _panel.getSource(), _model, pt); } } - public static void startImportInterpolate(final FudaaCommonImplementation _impl, final EGGraphe _model, - final TrPostInterpolatePoint _pt) { + public static void startImportInterpolate(final FudaaCommonImplementation _impl, final TrPostSource _src, + final EGGraphe _model, final TrPostInterpolatePoint _pt) { new CtuluTaskOperationGUI(_impl, TrResource.getS("Courbes temporelles")) { public void act() { final TrPostCourbeTreeModel model = (TrPostCourbeTreeModel) _model.getModel(); - model.addPoints(_pt, _model.getCmd(), new ProgressionBuAdapter(this), null); + model.addPoints(_src, _pt, _model.getCmd(), new ProgressionBuAdapter(this), null); BuLib.invokeLater(new Runnable() { public void run() { @@ -67,12 +68,13 @@ }.start(); } - public static void startImportIdx(final FudaaCommonImplementation _impl, final EGGraphe _model, final int[] _idx) { + public static void startImportIdx(final FudaaCommonImplementation _impl, final TrPostSource _src, + final EGGraphe _model, final int[] _idx) { new CtuluTaskOperationGUI(_impl, TrResource.getS("Courbes temporelles")) { public void act() { final TrPostCourbeTreeModel model = (TrPostCourbeTreeModel) _model.getModel(); - model.addPoints(_idx, _model.getCmd(), new ProgressionBuAdapter(this), null); + model.addPoints(_src, _idx, _model.getCmd(), new ProgressionBuAdapter(this), null); BuLib.invokeLater(new Runnable() { public void run() { 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 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -24,6 +24,7 @@ import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.h2d.type.H2dVariableType; 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; @@ -47,7 +48,7 @@ model_ = _model; } - + public static Object[] select(final Object[] _init, final String _title, final Component _parent) { Arrays.sort(_init, FuComparator.STRING_COMPARATOR); final BuList l = CtuluLibSwing.createBuList(_init); @@ -56,15 +57,20 @@ pn.setBorder(BuBorders.EMPTY3333); pn.add(new BuLabel(CtuluLib.getS("S\xE9lectionner les variables \xE0 ajouter")), BuBorderLayout.NORTH); pn.add(new BuScrollPane(l)); - if (CtuluDialogPanel.isOkResponse(pn.afficheModale(_parent, _title))) { - return l.getSelectedValues(); - } + if (CtuluDialogPanel.isOkResponse(pn.afficheModale(_parent, _title))) { return l.getSelectedValues(); } return null; } public void actionPerformed(final ActionEvent _e) { final TrPostCourbeTreeModel model = (TrPostCourbeTreeModel) model_.getModel(); - final Set var = new HashSet(Arrays.asList(model.src_.getAllVariablesNonVec())); + EGCourbe selectedComponent = model_.getSelectedComponent(); + TrPostSource src = null; + if (selectedComponent != null && selectedComponent.getModel() instanceof TrPostCourbeModel) { + src = ((TrPostCourbeModel) selectedComponent.getModel()).getSource(); + } + if (src == null) return; + final TrPostSource finalSrc = src; + final Set var = new HashSet(Arrays.asList(src.getAllVariablesNonVec())); var.removeAll(model.varSupported_); final H2dVariableType[] vars = (H2dVariableType[]) var.toArray(new H2dVariableType[var.size()]); final Object[] selected = select(vars, (String) getValue(Action.NAME), impl_.getFrame()); @@ -72,7 +78,7 @@ new CtuluTaskOperationGUI(impl_, (String) getValue(Action.NAME)) { public void act() { - model.addVariables(Arrays.asList(selected), new ProgressionBuAdapter(this), model_.getCmd()); + model.addVariables(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/TrPostCourbeBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -28,15 +28,13 @@ public final class TrPostCourbeBuilder { private TrPostCourbeBuilder() {} - public static TrPostCourbeTreeModel build(TrPostProjet projet, final TrPostSource _src, final int[] _tidx, - final H2dVariableType[] _vars, final int[] _idxPtArray, final ProgressionInterface _prog) { + public static TrPostCourbeTreeModel build(TrPostProjet _proj, final TrPostSource _src, final H2dVariableType[] _vars, + final int[] _idxPtArray, final ProgressionInterface _prog) { if (_prog != null) { _prog.setDesc(TrResource.getS("Construction des courbes")); } - final TrPostCourbeTreeModel treeModel = new TrPostCourbeTreeModel(projet.impl_, _src, /* - * _tidx, - */_idxPtArray, _vars, projet); - treeModel.addAllCourbes(_prog, null); + final TrPostCourbeTreeModel treeModel = new TrPostCourbeTreeModel(_idxPtArray, _vars, _proj); + treeModel.addAllCourbes(_src, _prog, null); return treeModel; } @@ -63,7 +61,7 @@ } final TrPostCourbeTreeModel treeModel = new TrPostCourbeTreeModel(projet.impl_, _src, _tidx, _idxPtArray, _vars, projet); - treeModel.addAllCourbes(_prog, null); + treeModel.addAllCourbes(_src, _prog, null); return treeModel; } @@ -85,7 +83,7 @@ } final TrPostCourbeTreeModel treeModel = new TrPostCourbeTreeModel(projet.impl_, _src, _tidx, _idxPtArray, _vars, projet); - treeModel.addAllCourbes(_prog, null); + treeModel.addAllCourbes(_src, _prog, null); return treeModel; } 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 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -7,6 +7,7 @@ */ package org.fudaa.fudaa.tr.post; +import java.io.IOException; import java.util.Set; import org.fudaa.ctulu.CtuluCommandContainer; @@ -26,52 +27,50 @@ */ public abstract class TrPostCourbeModel extends FudaaCourbeTimeModel { - /** + * @return the source + */ + public TrPostSource getSource() { + return source_; + } + + /** * source utilisee par la courbe */ public TrPostSource source_; - + public final static class Interpolated extends TrPostCourbeModel { final TrPostInterpolatePoint ptIdx_; - - - /** * @param _ptIdx * @param _varIdx * @param _timeIdx */ - public Interpolated(TrPostSource _src, final TrPostInterpolatePoint _ptIdx, final H2dVariableType _varIdx, - final double[] _timeIdx) { - super(_src, _varIdx, _timeIdx); + public Interpolated(TrPostSource _src, final TrPostInterpolatePoint _ptIdx, final H2dVariableType _varIdx) { + super(_src, _varIdx, _src.getTime().getTimeListModel().getTimesInSec()); ptIdx_ = _ptIdx; } - - @Override public double getPtX() { return ptIdx_.getX(); } - - @Override public double getPtY() { return ptIdx_.getY(); } - - - protected void updateY(final int _timeIdx, H2dVariableType _var) { - final EfData data = source_.getData(_var, _timeIdx); - if (data == null) { - FuLog.warning("TRP: data is null for " + _var); + protected void updateY() { + for (int i = 0; i < y_.length; i++) { + final EfData data = source_.getData(var_, i); + if (data == null) { + FuLog.warning("TRP: data is null for " + var_); + super.y_[i] = ptIdx_.getInterpolateValue(getVar(), data, i, source_); + } } - super.y_[_timeIdx] = ptIdx_.getInterpolateValue(getVar(), data, _timeIdx, source_); } public TrPostInterpolatePoint getInterpolatePt() { @@ -102,27 +101,37 @@ ptIdx_ = _ptIdx; } - protected void updateY(final int _timeIdx, H2dVariableType _var) { - - final EfData data = source_.getData(_var, _timeIdx); - if (data == null) { - FuLog.warning("TRP: data is null for " + _var); + protected void updateY() { + for (int i = 0; i < y_.length; i++) { + // final EfData data = source_.getData(var_, i); + // if (data == null) { + // FuLog.warning("TRP: data is null for " + var_); + try { + super.y_[i] = source_.getData(var_, i, ptIdx_); + } catch (IOException e) { + FuLog.error(e); + } + // } } - super.y_[_timeIdx] = data.getValue(ptIdx_); + // final EfData data = source_.getData(_var, _timeIdx); + // if (data == null) { + // FuLog.warning("TRP: data is null for " + _var); + // } + // super.y_[_timeIdx] = data.getValue(ptIdx_); } - - @Override public double getPtX() { // FIXME RUBAR - return source_.getGrid().getPtX(ptIdx_); + return source_.isElementVar(getVar()) ? source_.getGrid().getCentreXElement(ptIdx_) : source_.getGrid().getPtX( + ptIdx_); } @Override public double getPtY() { - return source_.getGrid().getPtY(ptIdx_); + return source_.isElementVar(getVar()) ? source_.getGrid().getCentreYElement(ptIdx_) : source_.getGrid().getPtY( + ptIdx_); } public int getPtIdx() { @@ -139,10 +148,11 @@ } - public static EGCourbeChild buildCourbeModel(final H2dVariableType _var, final int _idxPt, final double[] _ts, - final EGGroup _group, final TrPostSource _src) { - final TrPostCourbeModel model = new TrPostCourbeModel.Node(_src, _idxPt, _var, _ts); - + public static EGCourbeChild buildCourbeModel(final H2dVariableType _var, final int _idxPt, final EGGroup _group, + final TrPostSource _src) { + final TrPostCourbeModel model = new TrPostCourbeModel.Node(_src, _idxPt, _var, _src.getTime().getTimeListModel() + .getTimesInSec()); + final EGCourbeChild courbe = new FudaaCourbeTime(_group, model, _src.getNewTimeListModel()); _group.addEGComponent(courbe); courbe.getModel().setTitle(courbe.getModel().getTitle() + CtuluLibString.ESPACE + (_idxPt + 1)); @@ -150,8 +160,8 @@ } public static EGCourbeChild buildCourbeModel(final H2dVariableType _var, final TrPostInterpolatePoint _idxPt, - final double[] _ts, final EGGroup _group, final TrPostSource _src) { - final TrPostCourbeModel model = new TrPostCourbeModel.Interpolated(_src, _idxPt, _var, _ts); + final EGGroup _group, final TrPostSource _src) { + final TrPostCourbeModel model = new TrPostCourbeModel.Interpolated(_src, _idxPt, _var); final EGCourbeChild courbe = new FudaaCourbeTime(_group, model, _src.getNewTimeListModel()); _group.addEGComponent(courbe); courbe.getModel().setTitle( @@ -160,7 +170,7 @@ return courbe; } - private H2dVariableType var_; + H2dVariableType var_; public TrPostCourbeModel(TrPostSource _src, final H2dVariableType _varIdx, final double[] _timeIdx) { super(_timeIdx); @@ -185,7 +195,7 @@ return false; } - protected abstract void updateY(final int _timeIdx, H2dVariableType _var); + protected abstract void updateY(); public String getTitle() { return nom_ == null ? var_.getName() : nom_; @@ -194,7 +204,7 @@ public final H2dVariableType getVar() { return var_; } - + public abstract double getPtX(); public abstract double getPtY(); 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-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -23,11 +23,14 @@ import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandComposite; import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluCommandManager; 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.dodico.mesure.EvolutionReguliere; +import org.fudaa.dodico.mesure.EvolutionReguliereInterface; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; @@ -35,7 +38,10 @@ import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; +import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import com.memoire.bu.BuDialogChoice; @@ -43,156 +49,95 @@ import com.memoire.fu.FuComparator; import com.memoire.fu.FuEmptyArrays; -public class TrPostCourbeTreeModel extends EGGrapheTreeModel implements TrPostTimeContentListener { +public class TrPostCourbeTreeModel extends EGGrapheTreeModel implements TrPostTimeContentListener, Target { - private final boolean isAllTimeStep_; - final FudaaCommonImplementation impl_; - // private int[] tidx_; - - private EGGroup updating_; - Set intepolPt_; - public Set getIntepolPt() { - return intepolPt_; - } + private final boolean isAllTimeStep_; int[] objIdx_; - public int[] getObjIdx() { - return objIdx_; - } + // private int[] tidx_; - // les sources devront etre affectees au CourbeModel - final TrPostSource src_; + TrPostProjet projet_; - double[] timeSteps_; + private EGGroup updating_; final Map varGroup_; Set varSupported_; - TrPostProjet projet_; - - public Set getVarSupported() { - return varSupported_; - } - /** * NE PAS UTILISER POUR L'INSTANT SAUVEGARDE. */ protected TrPostCourbeTreeModel() { - src_ = null; + // src_ = null; varGroup_ = new HashMap(); impl_ = null; isAllTimeStep_ = true; } - /** - * @param _src - */ - public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src/* - * , - * final - * int - * [ - * ] - * _timeIdx - */, - final H2dVariableType[] _vars, TrPostProjet _projet) { - src_ = _src; - varGroup_ = new HashMap(); - // tidx_ = _timeIdx; - // Arrays.sort(tidx_); - objIdx_ = FuEmptyArrays.INT0; - intepolPt_ = new HashSet(); - varSupported_ = new HashSet(Arrays.asList(_vars)); - impl_ = _impl; - isAllTimeStep_ = true;// tidx_.length == _src.getNbTimeStep(); - projet_ = _projet; - } + // les sources devront etre affectees au CourbeModel + // final TrPostSource src_; - public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src,/* - * final - * int - * [ - * ] - * _timeIdx - * , - */ - final int[] _objIdx, final H2dVariableType[] _vars, TrPostProjet _projet) { - this(_impl, _src/* , _timeIdx */, _vars, _projet); - objIdx_ = _objIdx; - Arrays.sort(objIdx_); - } + // double[] timeSteps_; public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src, final int[] _timeIdx, final TrPostInterpolatePoint _interpol, final H2dVariableType[] _vars, TrPostProjet _projet) { - this(_impl, _src/* , _timeIdx */, _vars, _projet); + this(_vars, _projet); intepolPt_.add(_interpol); } /** - * Constructeur permettant de creer un treemodel avec plusieurs point - * interpol\xE9s + * Constructeur permettant de creer un treemodel avec plusieurs point interpol\xE9s * * @param _impl * @param _src * @param _timeIdx - * @param _interpol - * : le tableau de points interpoles + * @param _interpol : le tableau de points interpoles * @param _vars * @param _projet - * * @author Adrien Hadoux */ public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src, final int[] _timeIdx, final TrPostInterpolatePoint[] _interpol, final H2dVariableType[] _vars, TrPostProjet _projet) { - this(_impl, _src/* , _timeIdx */, _vars, _projet); - + this(_vars, _projet); + for (int i = 0; i < _interpol.length; i++) intepolPt_.add(_interpol[i]); } - - private void buildUpdating() { - if (updating_ == null) { - updating_ = new EGGroup(); - updating_.setTitle(TrResource.getS("Mise \xE0 jour")); - } + + /** + * @param _src + */ + public TrPostCourbeTreeModel(final H2dVariableType[] _vars, TrPostProjet _projet) { + // src_ = _src; + varGroup_ = new HashMap(); + // tidx_ = _timeIdx; + // Arrays.sort(tidx_); + objIdx_ = FuEmptyArrays.INT0; + intepolPt_ = new HashSet(); + varSupported_ = new HashSet(Arrays.asList(_vars)); + impl_ = projet_.getImpl(); + isAllTimeStep_ = true;// tidx_.length == _src.getNbTimeStep(); + projet_ = _projet; } - public void updateTimeStep(final int[] _idx, final ProgressionInterface _prog) { - if (!isAllTimeStep()) { - return; - } - // if (CtuluLibArray.isEmpty(_idx)) { - // return; - // } - timeSteps_ = null; - // tidx_ = _idx; - buildTimeSteps(); - final EGCourbe[] cs = getCourbes(); - - if (cs != null) { - final TrPostCourbeModel[] model = new TrPostCourbeModel[cs.length]; - for (int i = cs.length - 1; i >= 0; i--) { - model[i] = (TrPostCourbeModel) cs[i].getModel(); - model[i].setY(null); - model[i].setTidx(timeSteps_); - } - updateCurves(model, _prog); - fireCourbeContentChanged(null); - } + public TrPostCourbeTreeModel(final int[] _objIdx, final H2dVariableType[] _vars, TrPostProjet _projet) { + this(/* _src , _timeIdx */_vars, _projet); + objIdx_ = _objIdx; + Arrays.sort(objIdx_); } - protected void addAllCourbes(final ProgressionInterface _prog, final CtuluCommandContainer _cmd) { - buildTimeSteps(); + protected void addAllCourbes(TrPostSource _src, final ProgressionInterface _prog, final CtuluCommandContainer _cmd) { + // buildTimeSteps(); startUpdating(); final List modelToUpdate = new ArrayList(); final List courbeToMem = _cmd == null ? null : new ArrayList(); final List groupToMem = _cmd == null ? null : new ArrayList(); + // double[] timesInSec = _src.getTime().getTimeListModel().getTimesInSec(); for (final Iterator it = varSupported_.iterator(); it.hasNext();) { final H2dVariableType t = (H2dVariableType) it.next(); final EGGroup g = getGroupFor(t); @@ -201,7 +146,8 @@ final int idx = objIdx_[i]; final TrPostCourbeModel c = containsCourbeFor(t, g, idx); if (c == null) { - final EGCourbeChild courbe = TrPostCourbeModel.buildCourbeModel(t, idx, timeSteps_, g, src_); + + final EGCourbeChild courbe = TrPostCourbeModel.buildCourbeModel(t, idx, g, _src); if (courbeToMem != null) { courbeToMem.add(courbe); groupToMem.add(g); @@ -215,7 +161,7 @@ final TrPostInterpolatePoint element = (TrPostInterpolatePoint) iter.next(); final TrPostCourbeModel c = containsCourbeFor(t, g, element); if (c == null) { - final EGCourbeChild courbe = TrPostCourbeModel.buildCourbeModel(t, element, timeSteps_, g, src_); + final EGCourbeChild courbe = TrPostCourbeModel.buildCourbeModel(t, element, g, _src); if (courbeToMem != null) { courbeToMem.add(courbe); groupToMem.add(g); @@ -236,236 +182,18 @@ } - protected void addVariables(final List _var, final ProgressionInterface _prog, final CtuluCommandContainer _cmd) { - buildTimeSteps(); - startUpdating(); - //fusion graphes - _var.removeAll(varSupported_); - final int nbPt = objIdx_.length; - final TrPostCourbeModel[] model = new TrPostCourbeModel[_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], timeSteps_, 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(); - final EGCourbeChild c = TrPostCourbeModel.buildCourbeModel(var, element, timeSteps_, g, src_); - courbeToMem.add(c); - groupToMem.add(... [truncated message content] |
From: <had...@us...> - 2008-10-06 19:32:24
|
Revision: 4038 http://fudaa.svn.sourceforge.net/fudaa/?rev=4038&view=rev Author: hadouxad Date: 2008-10-06 19:31:22 +0000 (Mon, 06 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/.classpath.defaults branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java branches/Prepro-0.92-SNAPSHOT/ebli/.project.defaults branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeListener.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 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/TrPostCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/.classpath.defaults =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/.classpath.defaults 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/.classpath.defaults 2008-10-06 19:31:22 UTC (rev 4038) @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> + <classpathentry excluding="**/EditorJext.java|com/memoire/vacvs/" kind="src" path="src"/> <classpathentry kind="src" path="test"/> <classpathentry exported="true" kind="lib" path="lib/calendarbean.jar"/> Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -110,18 +110,18 @@ else if (lnfname.equals("ASPECT_GTK")) lnfclass = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; else if (lnfname.equals("ASPECT_KUNSTSTOFF")) lnfclass = "com.incors.plaf.kunststoff.KunststoffLookAndFeel"; else if (lnfname.equals("ASPECT_LIQUID")) lnfclass = "com.birosoft.liquid.LiquidLookAndFeel"; -// else if (lnfname.equals("ASPECT_SUBSTANCE")){ -// lnfclass = "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"; -// -// try { -// UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"); -// forced = false; -// } catch (Exception ex) { -// FuLog.error("BPR: could not set substance theme", ex); -// } -// -// -// } + // else if (lnfname.equals("ASPECT_SUBSTANCE")) { + // lnfclass = "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"; + // + // try { + // UIManager.setLookAndFeel( + // "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"); + // forced = false; + // } catch (Exception ex) { + // FuLog.error("BPR: could not set substance theme", ex); + // } + // + // } else if (lnfname.equals("ASPECT_MAC")) { FuLib.setSystemProperty("os.name", "Mac OS"); Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -10,10 +10,7 @@ import org.fudaa.ctulu.CtuluVariable; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; -import org.fudaa.dodico.all.SeuilClient; import org.fudaa.dodico.commun.DodicoLib; -import org.fudaa.dodico.ef.EfComputeVolume.ForMeshData; -import org.fudaa.dodico.ef.EfComputeVolume.ForNodeData; import com.memoire.fu.FuLog; @@ -68,7 +65,7 @@ for (int k = 0; k < list.size(); k++) { s += _grid.getAire(list.getQuick(k)); } - double d = s * (_h.getValue(ipt) - seuil_) / 3D; + double d = s * (_h.getValue(ipt)) / 3D - seuil_;// TODO a verifier if (d >= 0) resi.zonePlus_ += d; else resi.zoneMoins_ -= d; } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -46,9 +46,9 @@ for (int i = 0; i < Math.min(lx.length, ly.length)-1; i++) { double x = lx[i]; - double x2=lx[i+1]; + double x2= lx[i+1]; double y = ly[i]; - double y2 = ly[i+1]; + double y2= ly[i+1]; double ySeuil1=a*x+b; double ySeuil2=a*x2+b; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/.project.defaults =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/.project.defaults 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/.project.defaults 2008-10-06 19:31:22 UTC (rev 4038) @@ -5,6 +5,7 @@ <projects> <project>ctulu</project> </projects> + <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -46,9 +46,9 @@ listeners_.remove(_l); } - public void notifySondeListener(final MouseEvent _e) { + public void notifySondeListener(final GrPoint pt) { for (ZCalqueSondeListener l : listeners_) - l.notifySondeMoved(this, _e); + l.notifySondeMoved(this, pt); } @@ -62,11 +62,12 @@ public void mouseDragged(final MouseEvent _e){ if (target_ != null && !isGele()){ final GrPoint pt=new GrPoint(_e.getX(),_e.getY(),0); + // final GrPoint clone = new GrPoint(pt); pt.autoApplique(((BCalque)target_).getVersReel()); target_.changeSonde(pt); // -- notify aux sondeListener --// - notifySondeListener(_e); + notifySondeListener(pt); } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeListener.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeListener.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeListener.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -1,6 +1,6 @@ package org.fudaa.ebli.calque; -import java.awt.event.MouseEvent; +import org.fudaa.ebli.geometrie.GrPoint; /** * Interface pour les listener sur les calqueSondeInteraction. En particulier @@ -13,7 +13,7 @@ public interface ZCalqueSondeListener { - public void notifySondeMoved(final ZCalqueSondeInteraction activator, final MouseEvent _e); + public void notifySondeMoved(final ZCalqueSondeInteraction activator, final GrPoint _e); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -2,7 +2,6 @@ import java.awt.BorderLayout; import java.awt.Frame; -import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; @@ -31,6 +30,8 @@ import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode; import org.jdesktop.swingx.treetable.DefaultTreeTableModel; +import com.memoire.fu.FuLog; + /** * Manager sp\xE9ciale fusion. Elle contient plusieurs sonde ( de tous les calques * de la fusion). Lors de sa mise a jour, met a jour les sonde de tous les @@ -96,7 +97,7 @@ * lorsque c'est appel\xE9, met a jour les sondes pour tous les autre * zcalquesondeInteraction. */ - public void notifySondeMoved(ZCalqueSondeInteraction _activator, MouseEvent _e) { + public void notifySondeMoved(ZCalqueSondeInteraction _activator, GrPoint _e) { if (structureModel_ == null) structureModel_ = constructStructureModel(); @@ -106,8 +107,11 @@ ZCalqueSondeInteraction sondeInteraction=listeSondeInteractions_.get(i); if (/* sondeInteraction != _activator && */sondeInteraction.getTarget() != null) { // -- on recupere le point et on met a jour les sondes --// - final GrPoint pt = new GrPoint(_e.getX(), _e.getY(), 0); - pt.autoApplique(((BCalque) sondeInteraction.getTarget()).getVersReel()); + final GrPoint pt = new GrPoint(_e);// new GrPoint(_e.getX(), _e.getY(), + // 0); + FuLog.debug("Le point du notify synchroniser est " + pt); + // pt.autoApplique(((BCalque) + // sondeInteraction.getTarget()).getVersReel()); // -- on replace la sonde des autres calques --// ZCalqueSondeInterface objet = sondeInteraction.getTarget(); objet.setSondeEnable(true); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -13,7 +13,6 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ebli.animation.EbliAnimatedInterface; -import org.fudaa.ebli.animation.EbliAnimationAdapterInterface; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BConfigurableComposite; import org.fudaa.ebli.controle.BConfigurableInterface; @@ -23,7 +22,6 @@ import org.fudaa.ebli.visuallibrary.actions.CommandeUndoRedoGraphicalProperties; import org.fudaa.ebli.visuallibrary.actions.WidgetConfigure; import org.fudaa.ebli.visuallibrary.animation.EbliWidgetAnimatedItem; -import org.netbeans.api.visual.border.Border; import org.netbeans.api.visual.model.ObjectState; import org.netbeans.api.visual.widget.Widget; @@ -34,6 +32,7 @@ */ public class EbliWidget extends Widget implements BSelecteurTargetInterface, EbliWidgetInterface<EbliWidgetController> { + public final static String TYPEWIDGET = "CLASSIQUE"; public final static String COLORCONTOUR = "ColorContour"; public final static String COLORFOND = "colorFond"; Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -0,0 +1,84 @@ +package org.fudaa.ebli.visuallibrary.persist; + +import java.util.Iterator; + +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Classe qui se charge de sauvegarder le contenu de la ebliScene. + * + * @author Adrien Hadoux + * + */ +public class EbliScenePersist { + + + public final static String PROPERTIES = "Properties"; + + + /** + * Scene dont le contenu est a sauvegarder + */ + EbliScene scene_; + + /** + * titre associ\xE9 a la scene. Peut etre le titre de la frame qui affiche le + * layout par exemple + */ + String title_; + + + + public EbliScenePersist(EbliScene _scene, String _title) { + super(); + scene_ = _scene; + title_ = _title; + } + + /** + * genere le document qui contient le contenu de la scene. + * + * @return + */ + public Document createDescriptorScene(ProgressionInterface prog) { + // creation du document + Document document = ManagerWidgetPersist.createDocument(); + if (document == null) + return null; + + // creation du root avec pour id le titre la frame + Element rootEle = document.createElement(title_); + document.appendChild(rootEle); + + // -- creation des proprietes graphiques de la scene --// + Element propertiesEle = document.createElement(PROPERTIES); + + + // TODO properties.... a faire + rootEle.appendChild(propertiesEle); + + + // -- liste des widgets On cree des objets sans contenus qui decrivent les + // widgets + Iterator<EbliNode> it = (Iterator<EbliNode>) scene_.getObjects().iterator(); + + while (it.hasNext()) { + EbliNode node = it.next(); + // mise a jour infos + prog.setDesc(EbliResource.EBLI.getString("Insertion de la frame ") + node.getTitle()); + + Element widgetEle = new EbliWidgetpersist(node).createDescriptorWidget(document, prog); + rootEle.appendChild(widgetEle); + } + return document; + } + + + + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -0,0 +1,74 @@ +package org.fudaa.ebli.visuallibrary.persist; + +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Classe qui g\xE8re la sauvegarde des widgets. + * + * @author Adrien Hadoux + * + */ +public class EbliWidgetpersist { + + public final static String BALISEPROPERTIES = "Properties"; + public final static String BALISEWIDGET = "FRAME"; + public final static String TYPE = "Type"; + + // widget construire/sauvegarder + EbliWidget widget_; + + // node correspondant + EbliNode node_; + + /** + * true si le widget a une bordure EbliWidgetBordure. + */ + boolean hasBordure_ = false; + + + + + public EbliWidgetpersist(EbliNode _node) { + super(); + node_ = _node; + + if(_node.getWidget() instanceof EbliWidgetBordureSingle){ + widget_ = (EbliWidget) _node.getWidget().getChildren().get(0); + hasBordure_=true; + } + else + widget_ = _node.getWidget(); + } + + /** + * Genere un element + * + * @param document + * @param prog + * @return + */ + public Element createDescriptorWidget(Document document, ProgressionInterface prog) { + + // element plus haut niveau balise + Element rootEle = document.createElement(BALISEWIDGET); + + // -- creation du type de widget --// + rootEle.setAttribute(TYPE, widget_.TYPEWIDGET); + + //-- creation des proprietes graphiques --// + Element propertiesEle = document.createElement(BALISEPROPERTIES); + // TODO proprietes graphiques + rootEle.appendChild(propertiesEle); + + + + + return rootEle; + } + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -0,0 +1,292 @@ +package org.fudaa.ebli.visuallibrary.persist; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JFileChooser; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gui.CtuluFileChooser; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import com.memoire.fu.FuLog; +import com.sun.org.apache.xml.internal.serialize.OutputFormat; +import com.sun.org.apache.xml.internal.serialize.XMLSerializer; + +/** + * Manager qui g\xE8re la sauvegarde de plusieurs layout au sein d'un fichier xml. + * Gere le repertoire contenant l'ensemble des donn\xE9es. + * + * @author Adrien Hadoux + * + */ +public class ManagerWidgetPersist { + + /** + * Utilis\xE9 pour l'extension de tous les fichiers, repertoire et ficheirs + * inclus. + */ + public final static String DEFAULT_EXTENSION = ".POST"; + + /** + * Peut etre modifi\xE9 par l'appli appelabt si l'on veut une extension + * diff\xE9rente + */ + public static String EXTENSION = DEFAULT_EXTENSION; + + /** + * Fichier qui d\xE9crit tous les contenu layout sauvegard\xE9s Et noms des balises + * importantes + */ + public final static String INFOSCENE = "InfoLayout" + EXTENSION; + public final static String BALISESCENES = "Layout list"; + + /** + * Fichier qui d\xE9crit int\xE9gralement le contenu d'une scene + */ + public final static String DESCRIPTORSCENE = "DescriptorLayout"; + + /** + * Fichier qui d\xE9crit tous les fichiers sources(m\xE9tiers) sauvegard\xE9s + */ + public final static String DESCRIPTORSOURCE = "descriptorSources" + EXTENSION; + public final static String BALISESOURCES = "Sources list"; + + /** + * Nom du projet. Creation du projet sous un repertoire nomProjet.EXTENSION + */ + String nomProjet_; + + ProgressionInterface prog_; + File projet_; + + CtuluUI ui_; + + /** + * La liste des fichiers ouverts dans le projet. Si ils existent. + */ + List<File> listeFichiersProjets; + + /** + * La liste des coules (layouts, string) a sauvegarder. Le string peut etre el + * titre de la frame qui contient le ebli par exemple. + */ + Map<String, EbliScene> listeLayout_; + + public ManagerWidgetPersist(List<File> _listeFichiersProjets, String _nomProjet, CtuluUI ui) { + super(); + listeFichiersProjets = _listeFichiersProjets; + nomProjet_ = _nomProjet; + ui_ = ui; + prog_ = ui_.getMainProgression(); + } + + /** + * Cr\xE9\xE9 le repertoire contenant tous les fichiers de donn\xE9es. Base pour la + * cr\xE9ation des donn\xE9es. + */ + public boolean createPersistDirectory() { + // -- creation d un chooser --// + final CtuluFileChooser fileChooser = new CtuluFileChooser(true); + fileChooser.setDialogTitle(EbliResource.EBLI.getString("S\xE9lectionnez l'emplacement de votre r\xE9pertoire") + " " + + nomProjet_ + EXTENSION); + fileChooser.setAcceptAllFileFilterUsed(false); + int reponse = fileChooser.showOpenDialog(CtuluLibSwing.getFrameAncestor(ui_.getParentComponent())); + if (reponse == JFileChooser.APPROVE_OPTION) { + File conteneurProjet = fileChooser.getSelectedFile(); + if (conteneurProjet.isDirectory()) { + projet_ = new File(conteneurProjet.getAbsoluteFile() + nomProjet_ + EXTENSION); + // creation du repertoire global contenant toutes les donn\xE9es + if (projet_.mkdir()) { + return true; + } else { + ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le r\xE9pertoire")); + return false; + } + + } else { + ui_.error(EbliResource.EBLI.getString("La cible doit \xEAtre un r\xE9pertoire")); + return false; + } + } else + return false; + } + + /** + * Fichier qui cree le fichier qui indique les diff\xE9rents fichiers layout a + * lire. Cela permettra pour la lecture de proposer de charger ou non certains + * layout + * + * @return + */ + public Document createDescriptorScenes() { + // creation du document + Document document = createDocument(); + if (document == null) + return null; + + // creation du root + Element rootEle = document.createElement(BALISESCENES); + document.appendChild(rootEle); + // On cree des objets sans contenus qui decrivent simplement les fichiers + // scenes + Iterator<String> it = listeLayout_.keySet().iterator(); + int cpt = 1; + while (it.hasNext()) { + it.next(); + // contient le path absolu vers le fichier qui decrit le layout + Element sceneEle = document.createElement(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + + EXTENSION); + rootEle.appendChild(sceneEle); + } + return document; + } + + /** + * Methode qui tente de sauvegarder tous les fichier en s\xE9maphore: Soit tout + * les fichiers li\xE9s entre eux sont sauvegard\xE9s, soit les fichier li\xE9s ne le + * sont pas(destruction si n\xE9cessaire) + * + * @return + */ + public boolean saveProject() { + try { + progression("Cr\xE9ation du r\xE9pertoire", 10); + // -- etape 1 creation du repertoire global --// + if (createPersistDirectory()) { + OutputFormat format; + File file; + XMLSerializer serializer; + Document docXml; + + // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts + progression("Cr\xE9ation du fichier descripteur de sources", 15); + file = new File(projet_.getAbsolutePath() + File.separator + INFOSCENE); + docXml = createDescriptorSource(); + if (docXml == null) { + ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de sources")); + return false; + } + format = new OutputFormat(docXml); + format.setIndenting(true); + serializer = new XMLSerializer(new FileOutputStream(file), format); + serializer.serialize(docXml); + + // -- etape 3 sauvegarde des ebliscene unitairement --// + progression("Cr\xE9ation des fichiers layout", 20); + Iterator<String> it = listeLayout_.keySet().iterator(); + int cpt = 1; + while (it.hasNext()) { + String title = it.next(); + EbliScene scene = listeLayout_.get(title); + progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listeLayout_.size()); + file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); + docXml = (new EbliScenePersist(scene, title)).createDescriptorScene(prog_); + if (docXml == null) { + ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de layout " + cpt)); + } else { + format = new OutputFormat(docXml); + format.setIndenting(true); + serializer = new XMLSerializer(new FileOutputStream(file), format); + serializer.serialize(docXml); + cpt++; + } + + } + + // -- etape finale: Si tout s'est bien pass\xE9, sauvegarde du fichier de + // descriptions des + // layout + progression("Cr\xE9ation du descripteur de layout", 90); + file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSOURCE); + docXml = createDescriptorScenes(); + if (docXml == null) { + ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de layout")); + return false; + } + format = new OutputFormat(docXml); + format.setIndenting(true); + serializer = new XMLSerializer(new FileOutputStream(file), format); + serializer.serialize(docXml); + + progression("", 100); + return true; + + } + return false; + } catch (IOException ie) { + ie.printStackTrace(); + return false; + } + + } + + /** + * Methode qui g\xE9n\xE8re le fichier contenant toutes les sources ouverts. + * + * @return + */ + public Document createDescriptorSource() { + // creation du document + Document document = createDocument(); + if (document == null) + return null; + // creation du root + Element rootEle = document.createElement(BALISESOURCES); + document.appendChild(rootEle); + // On cree des objets sans contenus qui decrivent simplement les fichiers + // scenes + Iterator<File> it = listeFichiersProjets.iterator(); + while (it.hasNext()) { + File f = it.next(); + Element sceneEle = document.createElement(f.getAbsolutePath()); + rootEle.appendChild(sceneEle); + } + return document; + } + + public void progression(String title, int progression) { + if (prog_ == null || title == null || progression > 100) + return; + if (progression == 100) { + prog_.setProgression(0); + prog_.setDesc(""); + return; + } + prog_.setDesc(EbliResource.EBLI.getString(title)); + prog_.setProgression(progression); + } + + /** + * Genere un document type dom + * + * @return Document + */ + public static Document createDocument() { + // get an instance of factory + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + try { + // get an instance of builder + DocumentBuilder db = dbf.newDocumentBuilder(); + // create an instance of DOM + Document dom = db.newDocument(); + return dom; + } catch (ParserConfigurationException pce) { + FuLog.debug("Error while trying to instantiate DocumentBuilder " + pce); + return null; + } + } + +} 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-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -3,16 +3,16 @@ import gnu.trove.TIntHashSet; import gnu.trove.TIntIterator; -import java.awt.Point; 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.ProgressionInterface; +import org.fudaa.ctulu.gis.GISGeometryFactory; import org.fudaa.dodico.ef.EfData; import org.fudaa.dodico.ef.EfElement; -import org.fudaa.dodico.ef.EfGridData; import org.fudaa.dodico.ef.EfGridInterface; import org.fudaa.dodico.ef.EfNeighborMesh; import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; @@ -24,14 +24,11 @@ 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.h2d.type.H2dVariableType; import org.fudaa.ebli.geometrie.GrPoint; -import org.fudaa.ebli.geometrie.GrPolygone; import org.fudaa.fudaa.tr.common.TrResource; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.PrecisionModel; /** * Algorithme de Calcul les lignes de courants TODO mettre la classe dans EF il y a la classe qui est charge de faire le @@ -39,7 +36,7 @@ * * @author Adrien Hadoux */ -public class TrComputeLigneCourantTrajectoire implements EfLineIntersectionParent { +public class TrComputeLigneCourantTrajectoire implements EfLineIntersectionParent, CtuluActivity { /** * data @@ -199,7 +196,20 @@ if (elementCourant != -1) { TIntHashSet elementsAdjacent=new TIntHashSet(); - while (!termine && tempsTotal <= dureeIntegration) {//FIXME faux comparaison d'une duree et d'un temps. En fait la duree initiale (tempsTotal) vaut zero + 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; @@ -261,30 +271,60 @@ //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++) { - int eltVoisin = listeEltVoisins[i]; + if (listeEltVoisins != null && listeEltVoisins.length > 0) + voisinChoisi = listeEltVoisins[0];// pourquoi le + // premier ? + for (int i = 0; i < listeEltVoisins.length; i++) { + 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 - // 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 && (tempsTotal + distance / vitesseY <= 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; @@ -294,13 +334,18 @@ GrPoint pointchoisi = new GrPoint(data_.getGrid().getCoor(voisinChoisi).x, data_.getGrid().getCoor( voisinChoisi).y, 0); - // recherche des intersection entre les points - Coordinate[] listeCoor = new Coordinate[2]; - listeCoor[0] = new Coordinate(pointCourant.x, pointCourant.y);//FIXME non on recherche le point le plus eloigne pour savoir sur combien de temps on doit bouge + // 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 + // LineString ligne = new LineString(listeCoor, new + // PrecisionModel(),0); + + // utilse GISGeometryFactory.createSegment + LineString ligne = GISGeometryFactory.INSTANCE.createSegment(pointCourant.x, pointCourant.y, + pointchoisi.x_, + pointchoisi.y_); progression("Recherche des intersections", 50); EfLineIntersectionsResultsMng res = lineIntersect_.computeForMeshes(ligne, prog_); @@ -308,16 +353,24 @@ // particules est sortie du maillage, le calcul s'arrete termine = true; } else { + + + + } // recuperationde la nouvelle intersection aui devien courante - intersectionCourante = res.getFoundIntersect(0);//Je crois qu'il faut prendre l'intersection 1 car la 0 est le point de d\xE9part + 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 } @@ -374,4 +427,11 @@ return voisinage_; } + + /** + * fonction appel\xE9e en cas de stop de thread + */ + public void stop() { + } + } 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 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -64,6 +64,7 @@ } protected void updateY() { + createY(); for (int i = 0; i < y_.length; i++) { final EfData data = source_.getData(var_, i); if (data == null) { @@ -102,6 +103,7 @@ } protected void updateY() { + createY(); for (int i = 0; i < y_.length; i++) { // final EfData data = source_.getData(var_, i); // if (data == null) { @@ -221,4 +223,10 @@ return true; } + protected void createY() { + if (y_ == null || y_.length != this.source_.getNbTimeStep()) { + y_ = new double[source_.getNbTimeStep()]; + } + } + } \ 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 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -120,9 +120,10 @@ objIdx_ = FuEmptyArrays.INT0; intepolPt_ = new HashSet(); varSupported_ = new HashSet(Arrays.asList(_vars)); + projet_ = _projet; impl_ = projet_.getImpl(); isAllTimeStep_ = true;// tidx_.length == _src.getNbTimeStep(); - projet_ = _projet; + } public TrPostCourbeTreeModel(final int[] _objIdx, final H2dVariableType[] _vars, TrPostProjet _projet) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-07 17:53:38
|
Revision: 4045 http://fudaa.svn.sourceforge.net/fudaa/?rev=4045&view=rev Author: hadouxad Date: 2008-10-07 17:53:30 +0000 (Tue, 07 Oct 2008) Log Message: ----------- Finalisation import scopeGene - Cr?\195?\169er le m?\195?\170me syst?\195?\168me de target pour le mvprofileTreeModel: g?\195?\168re l'import scope pour la variable SANS - Gestion ?\195?\169galement de la cr?\195?\169ation de widget graphe et ajout du panel de choix (cr?\195?\169ation graphe ou importer dans graphe existant) dans le wizard. Refactorisation de code - ranger les actions trpost dans un package action - ranger les actions persist dans un package persist - ranger les classe fenetre,dialog et wizard specifiques au trpost dans un package dialogSpec Gestion des sauvegardes - gestion des propri?\195?\169t?\195?\169s graphiques - mise en place de la persistance des datas via les creator (creation de methode persist et setData pour la serail/deserial des donn?\195?\169es) - Sauvegarde correcte de tous les fichiers dans le repertoire - mise en place dans le post de la fonctionnalit?\195?\169 pour la sauvegarde Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFillePanel.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/common/TrPostActionLigneCourants.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayer.java 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/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/TrPostInterpolatePoint.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/lib/xpp3_min-1.1.4c.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/xstream-1.3.jar branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/ 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/TrPostActionAddPointFromWidgetCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionAddPointFromWidgetCalque2.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionChangeSceneForWidget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionChooseAndCreateCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionDuplicate.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/actions/TrPostActionFusionGraphes.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/actions/TrPostActionRemoveSrc.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/dialogSpec/ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostDialogBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostDialogCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostDialogLigneCourants.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/TrPostWizardCreateScope.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 branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque2.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionBilan.java 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/TrPostActionController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionDuplicate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionGraphes.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionOpenSrc.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/TrPostCourbeAddPointsAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProfileAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVolumeAction.java 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/TrPostWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardProfilSpatial.java Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/xpp3_min-1.1.4c.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/xstream-1.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -32,7 +32,7 @@ */ public class EbliWidget extends Widget implements BSelecteurTargetInterface, EbliWidgetInterface<EbliWidgetController> { - public final static String TYPEWIDGET = "CLASSIQUE"; + public final static String COLORCONTOUR = "ColorContour"; public final static String COLORFOND = "colorFond"; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,21 +1,32 @@ package org.fudaa.ebli.visuallibrary; +import java.util.Map; +import org.w3c.dom.Element; + + public interface EbliWidgetCreator { EbliWidget create(EbliScene _scene); - // FIXME a mettre dans le EbliNode - // EbliWidget getWidget(); + /** - * Duplication de l ebliNode en fonction de son creator. - * - * @param options - * @return - */ + * Duplication de l ebliNode en fonction de son creator. + */ EbliNode duplicate(EbliNode _nodeAdupliquer); //FIXME pas de reference vers la widget creer: un creator peut etre utiliser pour plusieurs widget ! // EbliWidgetWithBordure getBordure(); + + /** + * Methode qui permet d'injecter les datas dans le creator pour la persistence + */ + void setData(Object data); + + /** + * Methode qui permet de recuperer les datas et de les inserer dans l'element. + */ + void PersistData(Element elt, Map parameters); + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,7 +1,10 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.util.Map; +import org.w3c.dom.Element; + public class EbliWidgetCreatorDblFleche implements EbliWidgetCreator { @@ -55,5 +58,17 @@ public EbliWidgetWithBordure getBordure() { return null; } + + @Override + public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + + } + + @Override + public void setData(Object data) { + // TODO Auto-generated method stub + + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,7 +1,10 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.util.Map; +import org.w3c.dom.Element; + public class EbliWidgetCreatorFleche implements EbliWidgetCreator { int orientation; @@ -54,6 +57,18 @@ public EbliWidgetWithBordure getBordure() { return null; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub +} + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -2,7 +2,10 @@ import java.awt.Image; import java.awt.Point; +import java.util.Map; +import org.w3c.dom.Element; + /** * Creator de la widget image. * @@ -12,12 +15,14 @@ public class EbliWidgetCreatorImage implements EbliWidgetCreator { Image image_; + String pathImage_; // EbliWidgetImage res; EbliWidgetWithBordure res; - public EbliWidgetCreatorImage(Image g) { + public EbliWidgetCreatorImage(Image g, String path) { super(); + pathImage_=path; this.image_ = g; } @@ -45,7 +50,7 @@ EbliNode duplique = new EbliNodeDefault(); - duplique.setCreator(new EbliWidgetCreatorImage(getG())); + duplique.setCreator(new EbliWidgetCreatorImage(getG(),pathImage_)); duplique.setTitle(_nodeAdupliquer.getTitle()); // recopie des tailles @@ -61,5 +66,17 @@ public EbliWidgetWithBordure getBordure() { return res; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + elt.setAttribute("CONTENT", pathImage_); +} + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,8 +1,10 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.util.Map; import org.fudaa.ebli.visuallibrary.creator.ShapeCreator; +import org.w3c.dom.Element; /** * Creator pour les objets graphiques de type shape. @@ -71,6 +73,22 @@ public EbliWidgetWithBordure getBordure() { return null; } + + + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub +} + + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,8 +1,13 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Map; import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; +import org.w3c.dom.Element; /** * creator Editeur de texte widget. @@ -16,6 +21,7 @@ // EbliWidgetTextEditor res; EbliWidgetWithBordure res; + static int Idcontenu=1; public EbliWidgetCreatorTextEditor(CtuluHtmlEditorPanel g) { super(); @@ -64,4 +70,31 @@ public EbliWidgetWithBordure getBordure() { return res; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + //ecriture du contenu html dans ce fichier + FileWriter writer; + try { + + File contenu=new File((String)parameters.get("path")+File.separator+"contenu"+(Idcontenu++)); + writer = new FileWriter(contenu); + + writer.write(editorPane_.getDocumentText()); + writer.close(); + elt.setAttribute("CONTENT", contenu.getAbsolutePath()); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,9 +1,12 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.util.Map; +import org.w3c.dom.Element; + public class EbliWidgetCreatorTextLabel implements EbliWidgetCreator { String label_; @@ -54,6 +57,18 @@ public EbliWidgetWithBordure getBordure() { return res; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub +} +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -4,7 +4,10 @@ */ package org.fudaa.ebli.visuallibrary; +import java.util.Map; + import org.netbeans.api.visual.widget.Widget; +import org.w3c.dom.Element; /** * Creator permettant de cr\xE9er un groupe de widget simple. @@ -44,4 +47,16 @@ public void setW(EbliWidget w) { this.w = w; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + +} + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -38,7 +38,7 @@ // -- creation de la widget et ajout dans la scene --// EbliNodeDefault nodeImage = new EbliNodeDefault(); nodeImage.setTitle(" " + chooser.getSelectedFile()); - nodeImage.setCreator(new EbliWidgetCreatorImage(img)); + nodeImage.setCreator(new EbliWidgetCreatorImage(img,chooser.getSelectedFile().getAbsolutePath())); nodeImage.setPreferedSize(new Dimension(200, 200)); nodeImage.setPreferedLocation(new Point(270, 225)); scene_.addNode(nodeImage); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,6 +1,7 @@ package org.fudaa.ebli.visuallibrary.calque; import java.awt.Font; +import java.util.Map; import org.fudaa.ebli.calque.BCalqueLegendePanel; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -9,6 +10,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; /** * Creator pour les legendes des calques @@ -59,4 +61,16 @@ return res; } +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -14,6 +14,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; public class EbliWidgetCreatorVueCalque implements EbliWidgetCreator { @@ -109,4 +110,16 @@ this.calque_ = calque; } +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,6 +1,7 @@ package org.fudaa.ebli.visuallibrary.graphe; import java.awt.Point; +import java.util.Map; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.courbe.EGFillePanel; @@ -12,6 +13,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; /** * interface qui permet de creer un widget @@ -97,4 +99,16 @@ return res; } +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,5 +1,7 @@ package org.fudaa.ebli.visuallibrary.graphe; +import java.util.Map; + import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; @@ -7,6 +9,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; public class EbliWidgetCreatorLegende implements EbliWidgetCreator { @@ -43,5 +46,17 @@ public EbliWidgetWithBordure getBordure() { return res; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,5 +1,6 @@ package org.fudaa.ebli.visuallibrary.persist; +import java.awt.Paint; import java.util.Iterator; import org.fudaa.ctulu.ProgressionInterface; @@ -9,6 +10,8 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.anotherbigidea.flash.structs.Color; + /** * Classe qui se charge de sauvegarder le contenu de la ebliScene. * @@ -18,9 +21,11 @@ public class EbliScenePersist { - public final static String PROPERTIES = "Properties"; + public final static String PROPERTIES = "PROPERTIES"; + public final static String TITLE="TITLE"; + public final static String BACKGROUND="BACKGROUND"; + - /** * Scene dont le contenu est a sauvegarder */ @@ -45,21 +50,26 @@ * * @return */ - public Document createDescriptorScene(ProgressionInterface prog) { + public Document createDescriptorScene(ProgressionInterface prog,String baliseLayout,String path) { // creation du document Document document = ManagerWidgetPersist.createDocument(); if (document == null) return null; // creation du root avec pour id le titre la frame - Element rootEle = document.createElement(title_); + Element rootEle = document.createElement(baliseLayout); document.appendChild(rootEle); + rootEle.setAttribute(TITLE, title_); + + // -- creation des proprietes graphiques de la scene --// Element propertiesEle = document.createElement(PROPERTIES); - // TODO properties.... a faire + propertiesEle.setAttribute(BACKGROUND, ((java.awt.Color)scene_.getBackground()).toString()); + + rootEle.appendChild(propertiesEle); @@ -72,7 +82,7 @@ // mise a jour infos prog.setDesc(EbliResource.EBLI.getString("Insertion de la frame ") + node.getTitle()); - Element widgetEle = new EbliWidgetpersist(node).createDescriptorWidget(document, prog); + Element widgetEle = new EbliWidgetpersist(node).createDescriptorWidget(document, prog,path); rootEle.appendChild(widgetEle); } return document; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,5 +1,7 @@ package org.fudaa.ebli.visuallibrary.persist; +import java.util.HashMap; + import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliWidget; @@ -7,6 +9,9 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; + /** * Classe qui g\xE8re la sauvegarde des widgets. * @@ -15,10 +20,23 @@ */ public class EbliWidgetpersist { - public final static String BALISEPROPERTIES = "Properties"; + public final static String BALISEPROPERTIES = "PROPERTIES"; public final static String BALISEWIDGET = "FRAME"; - public final static String TYPE = "Type"; + public final static String TYPE = "TYPE"; + public final static String TITLE="TITLE"; + public final static String BACKGROUND="BACKGROUND"; + public final static String FOREGROUND="BACKGROUND"; + public final static String ROTATION="BACKGROUND"; + public final static String FONT="BACKGROUND"; + public final static String LIGNEMODEL="LIGNEMODEL"; + public final static String HEIGHT="HEIGHT"; + public final static String WIDTH="WIDTH"; + public final static String X="X"; + public final static String Y="Y"; + + public final static String BALISEDATA="DATA"; + // widget construire/sauvegarder EbliWidget widget_; @@ -52,22 +70,49 @@ * @param prog * @return */ - public Element createDescriptorWidget(Document document, ProgressionInterface prog) { + public Element createDescriptorWidget(Document document, ProgressionInterface prog, String path) { // element plus haut niveau balise Element rootEle = document.createElement(BALISEWIDGET); // -- creation du type de widget --// - rootEle.setAttribute(TYPE, widget_.TYPEWIDGET); + rootEle.setAttribute("TITLE", node_.getTitle()); + rootEle.setAttribute(TYPE, node_.getCreator().getClass().toString()); + //-- creation des proprietes graphiques --// Element propertiesEle = document.createElement(BALISEPROPERTIES); // TODO proprietes graphiques + if(widget_.getColorFond() !=null) + propertiesEle.setAttribute(BACKGROUND, widget_.getColorFond().toString()); + if(widget_.getColorContour() !=null) + propertiesEle.setAttribute(FOREGROUND, widget_.getColorContour().toString()); + if(widget_.getFormeFont() !=null) + propertiesEle.setAttribute(FONT, widget_.getFormeFont().toString()); + + propertiesEle.setAttribute(ROTATION, ""+widget_.getRotation()); + if(widget_.getTraceLigneModel()!=null) + propertiesEle.setAttribute(LIGNEMODEL, widget_.getTraceLigneModel().toString()); + if(widget_.getBounds() !=null){ + propertiesEle.setAttribute(WIDTH, ""+widget_.getBounds().width); + propertiesEle.setAttribute(HEIGHT, ""+widget_.getBounds().height); + } + if(widget_.getLocation() !=null){ + propertiesEle.setAttribute(X, ""+widget_.getLocation().x); + propertiesEle.setAttribute(Y, ""+widget_.getLocation().y); + } rootEle.appendChild(propertiesEle); + //-- creation des datas associ\xE9es --// + HashMap<String, Object> parametres=new HashMap<String, Object>(); + parametres.put("path", path); + Element dataEle = document.createElement(BALISEDATA); + node_.getCreator().PersistData(dataEle,parametres); + + rootEle.appendChild(dataEle); return rootEle; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -3,6 +3,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -33,97 +34,18 @@ * */ public class ManagerWidgetPersist { + - /** - * Utilis\xE9 pour l'extension de tous les fichiers, repertoire et ficheirs - * inclus. - */ - public final static String DEFAULT_EXTENSION = ".POST"; + + - /** - * Peut etre modifi\xE9 par l'appli appelabt si l'on veut une extension - * diff\xE9rente - */ - public static String EXTENSION = DEFAULT_EXTENSION; - - /** - * Fichier qui d\xE9crit tous les contenu layout sauvegard\xE9s Et noms des balises - * importantes - */ - public final static String INFOSCENE = "InfoLayout" + EXTENSION; - public final static String BALISESCENES = "Layout list"; - - /** - * Fichier qui d\xE9crit int\xE9gralement le contenu d'une scene - */ - public final static String DESCRIPTORSCENE = "DescriptorLayout"; - - /** - * Fichier qui d\xE9crit tous les fichiers sources(m\xE9tiers) sauvegard\xE9s - */ - public final static String DESCRIPTORSOURCE = "descriptorSources" + EXTENSION; - public final static String BALISESOURCES = "Sources list"; - - /** - * Nom du projet. Creation du projet sous un repertoire nomProjet.EXTENSION - */ - String nomProjet_; - - ProgressionInterface prog_; - File projet_; - - CtuluUI ui_; - - /** - * La liste des fichiers ouverts dans le projet. Si ils existent. - */ - List<File> listeFichiersProjets; - - /** - * La liste des coules (layouts, string) a sauvegarder. Le string peut etre el - * titre de la frame qui contient le ebli par exemple. - */ - Map<String, EbliScene> listeLayout_; - - public ManagerWidgetPersist(List<File> _listeFichiersProjets, String _nomProjet, CtuluUI ui) { + public ManagerWidgetPersist() { super(); - listeFichiersProjets = _listeFichiersProjets; - nomProjet_ = _nomProjet; - ui_ = ui; - prog_ = ui_.getMainProgression(); + } - /** - * Cr\xE9\xE9 le repertoire contenant tous les fichiers de donn\xE9es. Base pour la - * cr\xE9ation des donn\xE9es. - */ - public boolean createPersistDirectory() { - // -- creation d un chooser --// - final CtuluFileChooser fileChooser = new CtuluFileChooser(true); - fileChooser.setDialogTitle(EbliResource.EBLI.getString("S\xE9lectionnez l'emplacement de votre r\xE9pertoire") + " " - + nomProjet_ + EXTENSION); - fileChooser.setAcceptAllFileFilterUsed(false); - int reponse = fileChooser.showOpenDialog(CtuluLibSwing.getFrameAncestor(ui_.getParentComponent())); - if (reponse == JFileChooser.APPROVE_OPTION) { - File conteneurProjet = fileChooser.getSelectedFile(); - if (conteneurProjet.isDirectory()) { - projet_ = new File(conteneurProjet.getAbsoluteFile() + nomProjet_ + EXTENSION); - // creation du repertoire global contenant toutes les donn\xE9es - if (projet_.mkdir()) { - return true; - } else { - ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le r\xE9pertoire")); - return false; - } + - } else { - ui_.error(EbliResource.EBLI.getString("La cible doit \xEAtre un r\xE9pertoire")); - return false; - } - } else - return false; - } - /** * Fichier qui cree le fichier qui indique les diff\xE9rents fichiers layout a * lire. Cela permettra pour la lecture de proposer de charger ou non certains @@ -131,145 +53,34 @@ * * @return */ - public Document createDescriptorScenes() { - // creation du document - Document document = createDocument(); - if (document == null) - return null; - + public static Document createDescriptorScenes(Document document, ArrayList<String> titles,String path, String baliseScene, String descriptorScene,String extension, String attribute) { + // creation du root - Element rootEle = document.createElement(BALISESCENES); + Element rootEle = document.createElement(baliseScene); document.appendChild(rootEle); // On cree des objets sans contenus qui decrivent simplement les fichiers // scenes - Iterator<String> it = listeLayout_.keySet().iterator(); + Iterator<String> it = titles.iterator(); int cpt = 1; while (it.hasNext()) { it.next(); // contient le path absolu vers le fichier qui decrit le layout - Element sceneEle = document.createElement(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt - + EXTENSION); - rootEle.appendChild(sceneEle); + rootEle.setAttribute(attribute+cpt, path + File.separator + descriptorScene + (cpt++) + + extension); +// Element sceneEle = document.createElement(path + File.separator + descriptorScene + cpt +// + extension); +// rootEle.appendChild(sceneEle); } return document; } - /** - * Methode qui tente de sauvegarder tous les fichier en s\xE9maphore: Soit tout - * les fichiers li\xE9s entre eux sont sauvegard\xE9s, soit les fichier li\xE9s ne le - * sont pas(destruction si n\xE9cessaire) - * - * @return - */ - public boolean saveProject() { - try { - progression("Cr\xE9ation du r\xE9pertoire", 10); - // -- etape 1 creation du repertoire global --// - if (createPersistDirectory()) { - OutputFormat format; - File file; - XMLSerializer serializer; - Document docXml; + - // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts - progression("Cr\xE9ation du fichier descripteur de sources", 15); - file = new File(projet_.getAbsolutePath() + File.separator + INFOSCENE); - docXml = createDescriptorSource(); - if (docXml == null) { - ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de sources")); - return false; - } - format = new OutputFormat(docXml); - format.setIndenting(true); - serializer = new XMLSerializer(new FileOutputStream(file), format); - serializer.serialize(docXml); + - // -- etape 3 sauvegarde des ebliscene unitairement --// - progression("Cr\xE9ation des fichiers layout", 20); - Iterator<String> it = listeLayout_.keySet().iterator(); - int cpt = 1; - while (it.hasNext()) { - String title = it.next(); - EbliScene scene = listeLayout_.get(title); - progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listeLayout_.size()); - file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); - docXml = (new EbliScenePersist(scene, title)).createDescriptorScene(prog_); - if (docXml == null) { - ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de layout " + cpt)); - } else { - format = new OutputFormat(docXml); - format.setIndenting(true); - serializer = new XMLSerializer(new FileOutputStream(file), format); - serializer.serialize(docXml); - cpt++; - } + - } - - // -- etape finale: Si tout s'est bien pass\xE9, sauvegarde du fichier de - // descriptions des - // layout - progression("Cr\xE9ation du descripteur de layout", 90); - file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSOURCE); - docXml = createDescriptorScenes(); - if (docXml == null) { - ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de layout")); - return false; - } - format = new OutputFormat(docXml); - format.setIndenting(true); - serializer = new XMLSerializer(new FileOutputStream(file), format); - serializer.serialize(docXml); - - progression("", 100); - return true; - - } - return false; - } catch (IOException ie) { - ie.printStackTrace(); - return false; - } - - } - /** - * Methode qui g\xE9n\xE8re le fichier contenant toutes les sources ouverts. - * - * @return - */ - public Document createDescriptorSource() { - // creation du document - Document document = createDocument(); - if (document == null) - return null; - // creation du root - Element rootEle = document.createElement(BALISESOURCES); - document.appendChild(rootEle); - // On cree des objets sans contenus qui decrivent simplement les fichiers - // scenes - Iterator<File> it = listeFichiersProjets.iterator(); - while (it.hasNext()) { - File f = it.next(); - Element sceneEle = document.createElement(f.getAbsolutePath()); - rootEle.appendChild(sceneEle); - } - return document; - } - - public void progression(String title, int progression) { - if (prog_ == null || title == null || progression > 100) - return; - if (progression == 100) { - prog_.setProgression(0); - prog_.setDesc(""); - return; - } - prog_.setDesc(EbliResource.EBLI.getString(title)); - prog_.setProgression(progression); - } - - /** * Genere un document type dom * * @return Document Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -116,7 +116,7 @@ public FudaaCourbeWizardImportScope(FudaaCommonImplementation impl,FudaaCourbeImporter.Target target) { super(); - + target_=target; impl_=impl; } @@ -136,9 +136,9 @@ return new JLabel(TrResource.getS("Erreur. Veuillez choisir un fichier valide")); } - if(panelParametres_==null) - panelParametres_=buildPanelParametresImportation(); - return panelParametres_; +// if(panelParametres_==null) +// panelParametres_=buildPanelParametresImportation(); + return buildPanelParametresImportation(); } } @@ -153,7 +153,18 @@ @Override public String getStepText() { - return null; + String r = null; + + switch (current_) { + case 0: + + break; + case 1: + + break; + + } + return r; } ScopeStructure.SorT dataST(){ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFillePanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFillePanel.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFillePanel.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -51,6 +51,7 @@ import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.ressource.FudaaResource; +import org.fudaa.fudaa.tr.common.TrLib; /** * @author fred deniger @@ -281,6 +282,10 @@ final MvProfileCourbeGroup gri = new MvProfileCourbeGroup(_var); final EGAxeVertical yi = new EGAxeVertical(); yi.setTitre(_var.toString()); + if (_var == H2dVariableType.SANS) { + yi.setTitre(TrLib.getString("Import")); + } + yi.setUnite(_var.getCommonUnit()); gri.setAxeY(yi); return gri; 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 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -37,6 +37,8 @@ import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsMng; import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.dodico.mesure.EvolutionReguliere; +import org.fudaa.dodico.mesure.EvolutionReguliereInterface; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; @@ -44,7 +46,10 @@ import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGObject; + +import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; @@ -58,7 +63,7 @@ * @version $Id: MvProfileTreeModel.java,v 1.12 2007-06-13 14:46:13 deniger Exp * $ */ -public class MvProfileTreeModel extends EGGrapheTreeModel { +public class MvProfileTreeModel extends EGGrapheTreeModel implements Target { FudaaCourbeTimeListModel timeModel_; EfLineIntersectionsResultsMng resNode_; EfLineIntersectionsResultsBuilder builderNode_; @@ -606,4 +611,34 @@ protected void setPaletteGrid(final MvProfileGridPalette _paletteGrid) { paletteGrid_ = _paletteGrid; } + +@Override +public void importCourbes(EvolutionReguliereInterface[] _crb, + CtuluCommandManager _mng, ProgressionInterface _prog) { + // TODO Auto-generated method stub + + if (_crb == null) return; + EGGroup gr = getGroup(H2dVariableType.SANS,true); + List<EGCourbeChild> childs = new ArrayList<EGCourbeChild>(_crb.length); + for (int i = 0; i < _crb.length; i++) { + EGCourbeChild child = new EGCourbeChild(gr, new FudaaCourbeModel(new EvolutionReguliere(_crb[i]))); + childs.add(child); + gr.addEGComponent(child); + } + + if (_mng != null) { + _mng.addCmd(new CommandAddCourbesMulti((EGCourbeChild[]) childs.toArray(new EGCourbeChild[childs.size()]), + new EGGroup[] { gr })); + } + fireStructureChanged(); + + + } + +@Override +public boolean isSpatial() { + // TODO Auto-generated method stub + return true; +} +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -6,8 +6,8 @@ import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; -import org.fudaa.fudaa.tr.post.TrPostDialogBilan; -import org.fudaa.fudaa.tr.post.TrPostDialogLigneCourants; +import org.fudaa.fudaa.tr.post.dialogSpec.*; + import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayer.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayer.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -47,7 +47,7 @@ timeUpdated(); } - protected TrIsoModel getIsoModel() { + public TrIsoModel getIsoModel() { return (TrIsoModel) modele_; } Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,42 +0,0 @@ -/* - * @creation 18 avr. 07 - * @modification $Date: 2007-04-30 14:22:38 $ - * @license GNU General Public License 2 - * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail de...@fu... - */ -package org.fudaa.fudaa.tr.post; - -import java.awt.event.ActionEvent; - -import com.memoire.bu.BuWizardDialog; - -import org.fudaa.ebli.commun.EbliActionSimple; - -import org.fudaa.fudaa.tr.common.TrResource; - -/** - * temporaire pour tester. - * - * @author fred deniger - * @version $Id: TrIsoLineAction.java,v 1.2 2007-04-30 14:22:38 deniger Exp $ - */ -public class TrIsoLineAction extends EbliActionSimple { - - final TrPostVisuPanel dest_; - final TrPostProjet project_; - - public TrIsoLineAction(final TrPostVisuPanel _dest) { - super(TrResource.getS("Rechercher les isolignes"), null, "FIND_ISOS"); - dest_ = _dest; - project_ = dest_.projet_; - } - - public void actionPerformed(final ActionEvent _e) { - final BuWizardDialog dialog = new BuWizardDialog(dest_.getImpl().getFrame(), new TrIsoLineWizard(dest_)); - dialog.pack(); - dialog.setModal(true); - dialog.setLocationRelativeTo(dest_.getImpl().getFrame()); - dialog.show(); - } -} Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,440 +0,0 @@ -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.image.BufferedImage; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.DefaultListModel; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; - -import org.fudaa.ctulu.CtuluCommandContainer; -import org.fudaa.ctulu.CtuluResource; -import org.fudaa.ctulu.image.CtuluLibImage; -import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; -import org.fudaa.ebli.courbe.EGGraphe; -import org.fudaa.ebli.courbe.EGGrapheModel; -import org.fudaa.ebli.ressource.EbliResource; -import org.fudaa.ebli.visuallibrary.EbliNode; -import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionSimple; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; -import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; -import org.fudaa.ebli.visuallibrary.graphe.GrapheCellRenderer; -import org.fudaa.fudaa.meshviewer.profile.MvProfileBuilderFromTree; -import org.fudaa.fudaa.meshviewer.profile.MvProfileCoteTester; -import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; -import org.fudaa.fudaa.tr.common.TrResource; - -import com.memoire.bu.BuDialogError; - -/** - * Action qui: - recupere la liste des calques potentiels - recupere la liste des graphes potentiels - propose a l - * utilisateur une interface combo pour choisir le calque cible - propose a l utilisateur une interface jlist pour - * choisir le(s) graphe(s) cible(s) realise la moulinette - * - * @author Adrien Hadoux - */ -@SuppressWarnings("serial") -public abstract class TrPostActionAddPointFromWidgetCalque extends EbliWidgetActionSimple { - - /** - * Action specialisee pour les courbes temporelles. NE propose que les widget graphes qui respectent les donnees - * temporelles - * - * @author Adrien Hadoux - */ - public static class Temporel extends TrPostActionAddPointFromWidgetCalque { - - public Temporel(EbliScene _scene, TrPostCommonImplementation _impl) { - super(_scene, _impl); - } - - @Override - public void setTitleForFrame() { - frame_.setTitle(TrResource.TR.getString("Ajout des points du calques dans les \xE9volutions temporels")); - } - - @Override - public boolean isCorrectGraph(EGGrapheModel _model) { - // -- ATTENTION ICI ON AJOUTE JUSTE POUR LES COUURBE TEMPORELLE --// - return (_model instanceof TrPostCourbeTreeModel); - - } - - @Override - public void executeAction(TrPostCommonImplementation _impl, EGGraphe _graphe, TrPostVisuPanel _calque) { - (new TrPostCourbeAddPointsAction(impl_, _graphe, _calque)).actionPerformed(new ActionEvent(_calque, 0, - "ADDPOINTWIDGET")); - } - - @Override - protected void createNewGraphe(TrPostVisuPanel _calqueChoisi) { - - // -- creation auto d un nouveau graphe widget avec courbe temporelle - _calqueChoisi.addEvolutionFor(); - } - - @Override - public void setToolTip() { - this.setDefaultToolTip(TrResource.getS("Ajoute aux graphes selectionn\xE9s les points s\xE9lectionn\xE9es du calque")); - } - - } - - /** - * Action specialisee pour les courbes spatiales. NE propose que les widget graphes qui respectent les donnees - * patiales - * - * @author Adrien Hadoux - */ - public static class Spatial extends TrPostActionAddPointFromWidgetCalque { - - public Spatial(EbliScene _scene, TrPostCommonImplementation _impl) { - super(_scene, _impl); - } - - @Override - public void setTitleForFrame() { - frame_.setTitle(TrResource.TR.getString("Ajout des points du calques dans les courbes spatiales")); - } - - @Override - public boolean isCorrectGraph(EGGrapheModel _model) { - // -- ATTENTION ICI ON AJOUTE JUSTE POUR LES COURBE TEMPORELLE --// - return (_model instanceof MvProfileTreeModel); - - } - - @Override - public void executeAction(TrPostCommonImplementation _impl, EGGraphe _graphe, TrPostVisuPanel _calque) { - - /** - * @see TrPostWizardProfilSpatiaux.java pour savoir comment fusionenr une courbe spatiale dans un graphe existant. - * methode doTask() - */ - - } - - @Override - protected void createNewGraphe(TrPostVisuPanel _calqueChoisi) { - - // creation automatique d un graphe avec les spatiales poru le calque - // vhoisi - - new MvProfileBuilderFromTree(TrPostProfileAction.createProfileAdapter(_calqueChoisi), impl_, - ((ZCalqueAffichageDonneesInterface) _calqueChoisi.getArbreCalqueModel().getSelectedCalque()) - .getSelectedLine(), _calqueChoisi, new MvProfileCoteTester()).start(); - - } - - String[] formattageDonnees(TrPostProjet _projet) { - - 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; - } - - @Override - public void setToolTip() { - this.setDefaultToolTip(TrResource.getS("Ajoute aux graphes selectionn\xE9s les courbes s\xE9lectionn\xE9es du calque ")); - } - - } - - CtuluCommandContainer cmd_; - TrPostCommonImplementation impl_; - - JComboBox boxCalques_; - JList jlisteGraphesChoix; - JList jlisteGraphesSelections; - - JButton validation, select, unselect, creationNewGraphe, quitter; - JDialog frame_; - DefaultListModel modelGraphesPossibles; - DefaultListModel modelGraphesChoisis; - ArrayList<TrPostVisuPanel> listeCalquesPossibles; - ArrayList<EGGraphe> listeGraphesPossibles; - ArrayList<EGGraphe> listeGraphesChoisis; - ArrayList<JLabel> listeObjetsCalques; - - public TrPostActionAddPointFromWidgetCalque(EbliScene _scene, TrPostCommonImplementation _impl) { - super(_scene, TrResource.getS("Ajout des points du calque"), CtuluResource.CTULU.getIcon("cible"), "ADDPOINTWIDGET"); - - cmd_ = _scene.getCmdMng(); - impl_ = _impl; - putValue(NAME, "Arri\xE8re plan"); - - setToolTip(); - - } - - public abstract void setToolTip(); - - public void actionPerformed(ActionEvent e) { - - if (e.getSource() == select) { - if (jlisteGraphesChoix.getSelectedIndex() != -1) { - int indice = jlisteGraphesChoix.getSelectedIndex(); - EGGraphe graphe = listeGraphesPossibles.get(indice); - JLabel title = (JLabel) modelGraphesPossibles.getElementAt(indice); - modelGraphesChoisis.addElement(title); - listeGraphesChoisis.add(graphe); - modelGraphesPossibles.removeElementAt(indice); - listeGraphesPossibles.remove(indice); - } - } else if (e.getSource() == unselect) { - if (jlisteGraphesSelections.getSelectedIndex() != -1) { - int indice = jlisteGraphesSelections.getSelectedIndex(); - EGGraphe graphe = listeGraphesChoisis.get(indice); - JLabel title = (JLabel) modelGraphesChoisis.getElementAt(indice); - modelGraphesPossibles.addElement(title); - listeGraphesPossibles.add(graphe); - modelGraphesChoisis.removeElementAt(indice); - listeGraphesChoisis.remove(indice); - } - } else if (e.getSource() == validation) { - // validation de l action - if (listeGraphesChoisis.size() == 0) { - new BuDialogError(impl_.getApp(), impl_.getInformationsSoftware(), TrResource - .getS("Il doit y avoir au moins un graphe s\xE9lectionn\xE9.")).activate(); - return; - } - - TrPostVisuPanel calqueChoisi = (TrPostVisuPanel) listeCalquesPossibles.get(boxCalques_.getSelectedIndex()); - - // -- on applique l'action \xE0 chaque widget graphe --// - for (int i = 0; i < listeGraphesChoisis.size(); i++) { - EGGraphe graphe = listeGraphesChoisis.get(i); - - // -- execution de l action pour le graphe selectionne --// - executeAction(impl_, graphe, calqueChoisi); - - } - scene_.refresh(); - - } else if (e.getSource() == quitter) { - frame_.dispose(); - - } else if (e.getSource() == creationNewGraphe) { - - // -- creation d un nouveau graphe --// - if (boxCalques_ != null) { - TrPostVisuPanel calqueChoisi = (TrPostVisuPanel) listeCalquesPossibles.get(boxCalques_.getSelectedIndex()); - - // -- methode appelee qui doit creer un graphe avec la selection --// - createNewGraphe(calqueChoisi); - } else { - createNewGraphe(listeCalquesPossibles.get(0)); - } - // -- on doit remettre a jour les infos --// - // frame_.dispose(); - // rechercheGrapheAndCalque(); - - } else { - rechercheGrapheAndCalque(); - - // -- affichage de al dialog --// - constructDialog().setVisible(true); - } - - } - - protected abstract void createNewGraphe(TrPostVisuPanel _calqueChoisi); - - public abstract void executeAction(TrPostCommonImplementation _impl, EGGraphe _graphe, TrPostVisuPanel _calque); - - private void rechercheGrapheAndCalque() { - Map params = new HashMap(); - CtuluLibImage.setCompatibleImageAsked(params); - // -- recuperation de la liste des nodes de la scene --// - Set<EbliNode> listeNode = (Set<EbliNode>) scene_.getObjects(); - modelGraphesP... [truncated message content] |
From: <had...@us...> - 2008-10-08 17:44:57
|
Revision: 4048 http://fudaa.svn.sourceforge.net/fudaa/?rev=4048&view=rev Author: hadouxad Date: 2008-10-08 17:44:48 +0000 (Wed, 08 Oct 2008) Log Message: ----------- Gestion des chargement/sauvegarde serialization xml des ebliWidgets!!! Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 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/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/actions/TrPostActionFusionCalques.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -4,6 +4,8 @@ import java.awt.Point; import java.util.Map; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; + public interface EbliNode { String getTitle(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -4,6 +4,8 @@ import java.awt.Point; import java.util.Map; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; + public class EbliNodeDefault implements EbliNode { EbliWidgetCreator creator; Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,32 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.util.Map; - -import org.w3c.dom.Element; - - -public interface EbliWidgetCreator { - - EbliWidget create(EbliScene _scene); - - - /** - * Duplication de l ebliNode en fonction de son creator. - */ - EbliNode duplicate(EbliNode _nodeAdupliquer); - - //FIXME pas de reference vers la widget creer: un creator peut etre utiliser pour plusieurs widget ! -// EbliWidgetWithBordure getBordure(); - - - /** - * Methode qui permet d'injecter les datas dans le creator pour la persistence - */ - void setData(Object data); - - /** - * Methode qui permet de recuperer les datas et de les inserer dans l'element. - */ - void PersistData(Element elt, Map parameters); - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,74 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.util.Map; - -import org.w3c.dom.Element; - -public class EbliWidgetCreatorDblFleche implements EbliWidgetCreator { - - - int orientation; - - EbliWidgetDBLFleche res; - - public EbliWidgetCreatorDblFleche(int orientation) { - super(); - this.orientation = orientation; - - } - - public int getG() { - return orientation; - } - - public void setG(int orientation) { - this.orientation = orientation; - } - - public EbliWidget create(EbliScene _scene) { - res= new EbliWidgetDBLFleche(_scene, orientation); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorDblFleche(getG())); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - public EbliWidgetWithBordure getBordure() { - return null; - } - - @Override - public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - - } - - @Override - public void setData(Object data) { - // TODO Auto-generated method stub - - } - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,74 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.util.Map; - -import org.w3c.dom.Element; - -public class EbliWidgetCreatorFleche implements EbliWidgetCreator { - - int orientation; - - EbliWidgetFleche res; - - public EbliWidgetCreatorFleche(int orientation) { - super(); - this.orientation = orientation; - - } - - public int getG() { - return orientation; - } - - public void setG(int orientation) { - this.orientation = orientation; - } - - public EbliWidget create(EbliScene _scene) { - res= new EbliWidgetFleche(_scene, orientation); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorFleche(orientation)); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - public EbliWidgetWithBordure getBordure() { - return null; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} - - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,82 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Image; -import java.awt.Point; -import java.util.Map; - -import org.w3c.dom.Element; - -/** - * Creator de la widget image. - * - * @author Adrien Hadoux - * - */ -public class EbliWidgetCreatorImage implements EbliWidgetCreator { - - Image image_; - String pathImage_; - // EbliWidgetImage res; - EbliWidgetWithBordure res; - - - public EbliWidgetCreatorImage(Image g, String path) { - super(); - pathImage_=path; - this.image_ = g; - } - - public Image getG() { - return image_; - } - - public void setG(Image g) { - this.image_ = g; - } - - public EbliWidget create(EbliScene _scene) { - - res = new EbliWidgetBordureSingle(new EbliWidgetImage(_scene, getG())); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorImage(getG(),pathImage_)); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - public EbliWidgetWithBordure getBordure() { - return res; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - elt.setAttribute("CONTENT", pathImage_); -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,94 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.util.Map; - -import org.fudaa.ebli.visuallibrary.creator.ShapeCreator; -import org.w3c.dom.Element; - -/** - * Creator pour les objets graphiques de type shape. - * @author Adrien Hadoux - * - */ -public class EbliWidgetCreatorShape implements EbliWidgetCreator { - - - EbliWidgetShape res; - - /** - * Le type de l objet a creer. - */ - ShapeCreator typeObject_; - - public ShapeCreator getTypeObject_() { - return typeObject_; - } - - - - public void setTypeObject_(ShapeCreator typeObject_) { - this.typeObject_ = typeObject_; - } - - - - public EbliWidgetCreatorShape(ShapeCreator _typeObject ) { - super(); - - typeObject_=_typeObject; - } - - - - public EbliWidget create(EbliScene _scene) { - res= new EbliWidgetShape(_scene,typeObject_ ,null); - - return res; - } - - public EbliWidget getWidget() { - return res; - } - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorShape(getTypeObject_())); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - - - public EbliWidgetWithBordure getBordure() { - return null; - } - - - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} - - - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} - - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,100 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Map; - -import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; -import org.w3c.dom.Element; - -/** - * creator Editeur de texte widget. - * - * @author Adrien Hadoux - * - */ -public class EbliWidgetCreatorTextEditor implements EbliWidgetCreator { - - CtuluHtmlEditorPanel editorPane_; - // EbliWidgetTextEditor res; - EbliWidgetWithBordure res; - - static int Idcontenu=1; - - public EbliWidgetCreatorTextEditor(CtuluHtmlEditorPanel g) { - super(); - this.editorPane_ = g; - } - - public CtuluHtmlEditorPanel getG() { - return editorPane_; - } - - public void setG(CtuluHtmlEditorPanel g) { - this.editorPane_ = g; - } - - public EbliWidget create(EbliScene _scene) { - - res = new EbliWidgetBordureSingle(new EbliWidgetTextEditor(_scene, getG())); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - CtuluHtmlEditorPanel editor=new CtuluHtmlEditorPanel(); - editor.setDocumentText(getG().getDocumentText()); - duplique.setCreator(new EbliWidgetCreatorTextEditor(editor)); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - - public EbliWidgetWithBordure getBordure() { - return res; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - //ecriture du contenu html dans ce fichier - FileWriter writer; - try { - - File contenu=new File((String)parameters.get("path")+File.separator+"contenu"+(Idcontenu++)); - writer = new FileWriter(contenu); - - writer.write(editorPane_.getDocumentText()); - writer.close(); - elt.setAttribute("CONTENT", contenu.getAbsolutePath()); - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,74 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.util.Map; - -import org.w3c.dom.Element; - - - -public class EbliWidgetCreatorTextLabel implements EbliWidgetCreator { - - String label_; - // EbliWidgetRectangle res; - EbliWidgetWithBordure res; - public EbliWidgetCreatorTextLabel(String g) { - super(); - this.label_ = g; - } - - public String getG() { - return label_; - } - - public void setG(String g) { - this.label_ = g; - } - - public EbliWidget create(EbliScene _scene) { - res = new EbliWidgetBordureSingle(new EbliWidgetTextLabel(_scene, getG())); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorTextLabel(getG())); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - public EbliWidgetWithBordure getBordure() { - return res; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} - - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,62 +0,0 @@ -/** - * Licence GPL - * Copyright Genesis - */ -package org.fudaa.ebli.visuallibrary; - -import java.util.Map; - -import org.netbeans.api.visual.widget.Widget; -import org.w3c.dom.Element; - -/** - * Creator permettant de cr\xE9er un groupe de widget simple. - * - * @author deniger - */ -public class EbliWidgetGroupCreator implements EbliWidgetCreator { - - EbliWidget w; - - public EbliWidget create(EbliScene _scene) { - return w; - } - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - return null; - } - - public EbliWidgetWithBordure getBordure() { - return null; - } - - /** - * @return the w - */ - public Widget getW() { - return w; - } - - public EbliWidget getWidget() { - return w; - } - - /** - * @param w the w to set - */ - public void setW(EbliWidget w) { - this.w = w; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} -} \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -9,7 +9,7 @@ import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorImage; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorImage; import com.memoire.bu.BuFileChooser; import com.memoire.bu.BuResource; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -8,7 +8,7 @@ import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorTextEditor; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorTextEditor; import com.memoire.bu.BuResource; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -23,7 +23,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerForGroup; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly; -import org.fudaa.ebli.visuallibrary.EbliWidgetGroupCreator; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetGroupCreator; import org.fudaa.ebli.visuallibrary.layout.GroupLayout; import org.netbeans.api.visual.widget.Widget; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -3,13 +3,15 @@ import java.awt.Font; import java.util.Map; +import org.fudaa.ebli.calque.BCalqueAffichage; +import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.calque.BCalqueLegendePanel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; /** @@ -32,6 +34,10 @@ // modelTreeCalque_ = model; } + public EbliWidgetCreatorLegende(){ + + } + public BCalqueLegendePanel getG() { return g; } @@ -62,15 +68,20 @@ } @Override -public void PersistData(Element elt, Map parameters) { +public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - + return null; } @Override -public void setData(Object data) { +public void setPersistData(Object data, Map parameters) { // TODO Auto-generated method stub - + if(data==null) + g=new BCalqueLegendePanel(new BCalqueLegende(),"empty"); + else + g=(BCalqueLegendePanel) data; } + + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -12,8 +12,8 @@ import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; public class EbliWidgetCreatorVueCalque implements EbliWidgetCreator { @@ -29,7 +29,9 @@ public EbliWidgetCreatorVueCalque(ZEbliCalquesPanel calque) { this(calque, null); } - + public EbliWidgetCreatorVueCalque(){ + + } public EbliWidgetCreatorVueCalque(ZEbliCalquesPanel calque, GrBoite _initZoom) { super(); this.calque_ = calque; @@ -111,15 +113,18 @@ } @Override -public void PersistData(Element elt, Map parameters) { +public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - + return null; } @Override -public void setData(Object data) { +public void setPersistData(Object data, Map parameters) { // TODO Auto-generated method stub - + if(data==null) + calque_=new ZEbliCalquesPanel(null); } + + } Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,37 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.w3c.dom.Element; + + +public interface EbliWidgetCreator { + + + + EbliWidget create(EbliScene _scene); + + + /** + * Duplication de l ebliNode en fonction de son creator. + */ + EbliNode duplicate(EbliNode _nodeAdupliquer); + + //FIXME pas de reference vers la widget creer: un creator peut etre utiliser pour plusieurs widget ! +// EbliWidgetWithBordure getBordure(); + + + /** + * Methode qui permet d'injecter les datas dans le creator pour la persistence + */ + public void setPersistData(Object data,Map parameters); + + /** + * Methode qui permet de recuperer les datas specifiques du creator + */ + public Object getPersistData(Map parameters); + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,39 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import javax.swing.LookAndFeel; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + + +/** + * Classe qui se charge de de loader la bonne classes en fonction du string passer en param + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorClassLoader { + + + /** + * Retourne une classe qui implemente EbliWidgetCreator + * sinon retourne null + * @param className + * @return + * @throws ClassNotFoundException + * @throws InstantiationException + * @throws IllegalAccessException + */ + public static EbliWidgetCreator forName(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException{ + EbliWidgetCreator creator=null; + if(className.startsWith("class ")); + className=className.substring("class ".length()); + Class myclass =Class.forName(className, true, Thread.currentThread(). + getContextClassLoader()); + Object myCreator=myclass.newInstance(); + + + if(myCreator instanceof EbliWidgetCreator) + return (EbliWidgetCreator)myCreator; + else return null; + } + +} Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,86 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetDBLFleche; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +public class EbliWidgetCreatorDblFleche implements EbliWidgetCreator { + + + int orientation; + + EbliWidgetDBLFleche res; + + public EbliWidgetCreatorDblFleche(int orientation) { + super(); + this.orientation = orientation; + + } + + public EbliWidgetCreatorDblFleche(){ + + } + + public int getG() { + return orientation; + } + + public void setG(int orientation) { + this.orientation = orientation; + } + + public EbliWidget create(EbliScene _scene) { + res= new EbliWidgetDBLFleche(_scene, orientation); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorDblFleche(getG())); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + public EbliWidgetWithBordure getBordure() { + return null; + } + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + + } + + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,82 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetFleche; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +public class EbliWidgetCreatorFleche implements EbliWidgetCreator { + + int orientation; + + EbliWidgetFleche res; + + public EbliWidgetCreatorFleche(int orientation) { + super(); + this.orientation = orientation; + + } + public EbliWidgetCreatorFleche(){ + + } + public int getG() { + return orientation; + } + + public void setG(int orientation) { + this.orientation = orientation; + } + + public EbliWidget create(EbliScene _scene) { + res= new EbliWidgetFleche(_scene, orientation); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorFleche(orientation)); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + public EbliWidgetWithBordure getBordure() { + return null; + } + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + + } + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,106 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Image; +import java.awt.Point; +import java.awt.Toolkit; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.fudaa.ebli.visuallibrary.EbliWidgetImage; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +import sun.awt.image.ToolkitImage; + +/** + * Creator de la widget image. + * + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorImage implements EbliWidgetCreator { + + Image image_; + String pathImage_; + // EbliWidgetImage res; + EbliWidgetWithBordure res; + + + public EbliWidgetCreatorImage(Image g, String path) { + super(); + pathImage_=path; + this.image_ = g; + } + + + public EbliWidgetCreatorImage(){ + + } + + public Image getG() { + return image_; + } + + public void setG(Image g) { + this.image_ = g; + } + + public EbliWidget create(EbliScene _scene) { + + res = new EbliWidgetBordureSingle(new EbliWidgetImage(_scene, getG())); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorImage(getG(),pathImage_)); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + public EbliWidgetWithBordure getBordure() { + return res; + } + + + +@Override +public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return pathImage_; +} + +@Override +public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + if(data==null) + return; + pathImage_=(String)data; + + //chargement de l'image + if(pathImage_!=null){ + image_=Toolkit.getDefaultToolkit().getImage(pathImage_); + } +} + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java ___________________________________________________________________ Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,100 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetShape; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +/** + * Creator pour les objets graphiques de type shape. + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorShape implements EbliWidgetCreator { + + + EbliWidgetShape res; + + /** + * Le type de l objet a creer. + */ + ShapeCreator typeObject_; + + public ShapeCreator getTypeObject_() { + return typeObject_; + } + + + + public void setTypeObject_(ShapeCreator typeObject_) { + this.typeObject_ = typeObject_; + } + + + + public EbliWidgetCreatorShape(ShapeCreator _typeObject ) { + super(); + + typeObject_=_typeObject; + } + + public EbliWidgetCreatorShape() { + + } + + public EbliWidget create(EbliScene _scene) { + res= new EbliWidgetShape(_scene,typeObject_ ,null); + + return res; + } + + public EbliWidget getWidget() { + return res; + } + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorShape(getTypeObject_())); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + + + public EbliWidgetWithBordure getBordure() { + return null; + } + + + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + if(data==null) + typeObject_=new ShapeCreatorCircle(); + } + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java ___________________________________________________________________ Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,139 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Map; + +import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.fudaa.ebli.visuallibrary.EbliWidgetTextEditor; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +/** + * creator Editeur de texte widget. + * + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorTextEditor implements EbliWidgetCreator { + + CtuluHtmlEditorPanel editorPane_; + // EbliWidgetTextEditor res; + EbliWidgetWithBordure res; + + static int Idcontenu=1; + + public EbliWidgetCreatorTextEditor(CtuluHtmlEditorPanel g) { + super(); + this.editorPane_ = g; + } + + public EbliWidgetCreatorTextEditor(){ + + } + + public CtuluHtmlEditorPanel getG() { + return editorPane_; + } + + public void setG(CtuluHtmlEditorPanel g) { + this.editorPane_ = g; + } + + public EbliWidget create(EbliScene _scene) { + + res = new EbliWidgetBordureSingle(new EbliWidgetTextEditor(_scene, getG())); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + CtuluHtmlEditorPanel editor=new CtuluHtmlEditorPanel(); + editor.setDocumentText(getG().getDocumentText()); + duplique.setCreator(new EbliWidgetCreatorTextEditor(editor)); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + + public EbliWidgetWithBordure getBordure() { + return res; + } + + + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + //ecriture du contenu html dans ce fichier + FileWriter writer; + try { + String path=(String)parameters.get("path"); + if(path !=null){ + File contenu=new File(path+File.separator+"contenu"+(Idcontenu++)+".html"); + writer = new FileWriter(contenu); + writer.write(editorPane_.getDocumentText()); + writer.close(); + return contenu.getAbsolutePath(); + } + return null; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + } + + @Override + public void setPersistData(Object data, Map parameters) { + editorPane_=new CtuluHtmlEditorPanel(); + + if(data==null) + return; + // TODO Auto-generated method stub + + try { + File contenu=new File((String)data); + InputStream ips=new FileInputStream(contenu); + InputStreamReader ipsr=new InputStreamReader(ips); + BufferedReader br=new BufferedReader(ipsr); + StringBuffer contentHTML=new StringBuffer(""); + String ligne; + while ((ligne=br.readLine())!=null) + contentHTML.append(ligne); + br.close(); + editorPane_.setDocumentText(contentHTML.toString()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } + } +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java ___________________________________________________________________ Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,84 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.fudaa.ebli.visuallibrary.EbliWidgetTextLabel; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + + + +public class EbliWidgetCreatorTextLabel implements EbliWidgetCreator { + + String label_; + // EbliWidgetRectangle res; + EbliWidgetWithBordure res; + public EbliWidgetCreatorTextLabel(String g) { + super(); + this.label_ = g; + } + public EbliWidgetCreatorTextLabel(){ + + } + public String getG() { + return label_; + } + + public void setG(String g) { + this.label_ = g; + } + + public EbliWidget create(EbliScene _scene) { + res = new EbliWidgetBordureSingle(new EbliWidgetTextLabel(_scene, getG())); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorTextLabel(getG())); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + public EbliWidgetWithBordure getBordure() { + return res; + } + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + if(data==null) + label_=""; + } + + +} Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,66 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ebli.visuallibrary.creator; + +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.netbeans.api.visual.widget.Widget; +import org.w3c.dom.Element; + +/** + * Creator permettant de cr\xE9er un groupe de widget simple. + * + * @author deniger + */ +public class EbliWidgetGroupCreator implements EbliWidgetCreator { + + EbliWidget w; + + public EbliWidget create(EbliScene _scene) { + return w; + } + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + return null; + } + + public EbliWidgetWithBordure getBordure() { + return null; + } + + /** + * @return the w + */ + public Widget getW() { + return w; + } + + public EbliWidget getWidget() { + return w; + } + + /** + * @param w the w to set + */ + public void setW(EbliWidget w) { + this.w = w; + } + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + + } +} \ No newline at end of file Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java ___________________________________________________________________ Added: svn:mergeinfo + Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -6,13 +6,16 @@ import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheModel; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; /** @@ -55,6 +58,10 @@ } + public EbliWidgetCreatorGraphe(){ + + } + public EbliWidgetCreatorGraphe(EGFillePanel _pn) { super(); this.pn_ = _pn; @@ -99,16 +106,21 @@ return res; } -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + EGGrapheModel modele; + if(data==null) + modele=new EGGrapheTreeModel(); + else + modele=(EGGrapheModel) data; + pn_=new EGFillePanel(new EGGraphe(modele)); + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -3,12 +3,13 @@ import java.util.Map; import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; public class EbliWidgetCreatorLegende implements EbliWidgetCreator { @@ -21,6 +22,10 @@ this.g = g; } + public EbliWidgetCreatorLegende(){ + + } + public EGGraphe getG() { return g; } @@ -47,16 +52,17 @@ return res; } -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } -@Override -public void setData(Object data) { - // TODO Auto-generated method stub + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + if(data==null) + g=new EGGraphe(new EGGrapheTreeModel()); + } } - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,94 +0,0 @@ -package org.fudaa.ebli.visuallibrary.persist; - -import java.awt.Paint; -import java.util.Iterator; - -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.ebli.ressource.EbliResource; -import org.fudaa.ebli.visuallibrary.EbliNode; -import org.fudaa.ebli.visuallibrary.EbliScene; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import com.anotherbigidea.flash.structs.Color; - -/** - * Classe qui se charge de sauvegarder le contenu de la ebliScene. - * - * @author Adrien Hadoux - * - */ -public class EbliScenePersist { - - - public final static String PROPERTIES = "PROPERTIES"; - public final static String TITLE="TITLE"; - public final static String BACKGROUND="BACKGROUND"; - - - /** - * Scene dont le contenu est a sauvegarder - */ - EbliScene scene_; - - /** - * titre associ\xE9 a la scene. Peut etre le titre de la frame qui affiche le - * layout par exemple - */ - String title_; - - - - public EbliScenePersist(EbliScene _scene, String _title) { - super(); - scene_ = _scene; - title_ = _title; - } - - /** - * genere le document qui contient le contenu de la scene. - * - * @return - */ - public Document createDescriptorScene(ProgressionInterface prog,String baliseLayout,String path) { - // creation du document - Document document = ManagerWidgetPersist.createDocument(); - if (document == null) - return null; - - // creation du root avec pour id le titre la frame - Element rootEle = document.createElement(baliseLayout); - document.appendChild(rootEle); - - rootEle.setAttribute(TITLE, title_); - - - // -- creation des proprietes graphiques de la scene --// - Element propertiesEle = document.createElement(PROPERTIES); - - - propertiesEle.setAttribute(BACKGROUND, ((java.awt.Color)scene_.getBackground()).toString()); - - - rootEle.appendChild(propertiesEle); - - - // -- liste des widgets On cree des objets sans contenus qui decrivent les - // widgets - Iterator<EbliNode> it = (Iterator<EbliNode>) scene_.getObjects().iterator(); - - while (it.hasNext()) { - EbliNode node = it.next(); - // mise a jour infos - prog.setDesc(EbliResource.EBLI.getString("Insertion de la frame ") + node.getTitle()); - - Element widgetEle = new EbliWidgetpersist(node).createDescriptorWidget(document, prog,path); - rootEle.appendChild(widgetEle); - } - return document; - } - - - - -} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,113 @@ +package org.fudaa.ebli.visuallibrary.persist; + +import java.awt.Color; +import java.awt.Dimension; + +import org.fudaa.ebli.visuallibrary.EbliScene; + +import com.sun.j3d.loaders.vrml97.impl.Background; + + +/** + * Classe utilis\xE9e par d\xE9faut pour la serialization xml avec xstream + * @author Adrien Hadoux + * + */ +public class EbliSceneSerializeXml { + +String title; +Color background; +int nbFrames; +int width; +int height; + +public EbliSceneSerializeXml(EbliScene scene,String title){ + + fillInfoWith(scene,title); + +} + + +private void fillInfoWith(EbliScene scene,String title){ + this.title=title; + this.background=(Color) scene.getBackground(); + this.nbFrames=scene.getObjects().size(); + if(scene.getView() !=null){ + this.width=scene.getView().getSize().width; + this.height=scene.getView().getSize().height; + } +} + + +/**... [truncated message content] |
From: <had...@us...> - 2008-10-09 17:33:57
|
Revision: 4049 http://fudaa.svn.sourceforge.net/fudaa/?rev=4049&view=rev Author: hadouxad Date: 2008-10-09 17:33:43 +0000 (Thu, 09 Oct 2008) Log Message: ----------- - gestion annuler/ajouter projet au projet actuel - Prise en compte des positions et des tailles - des widget - de la trpostlayoutfille - Gestion des objets shape: propri?\195?\169t?\195?\169s sauvegard?\195?\169es correctement - Sauvegarde du caract?\195?\168re visible ou non de la widget - Sauvegarde du caract?\195?\168re s?\195?\169lectionn?\195?\169 ou non de la widget - Sauvegarde de la superposition des widgets dans le layout - Sauvegarde des objets persistants correpsondant au graphe dans un repertoire - conception atomique (EggroupPersit,EgcourbePersit, egAxePersist) - Un fichier de sauvegarde par courbe - Un complet qui contient tous les groupes - Gestion des relations 1:N groupe:courbe (l'id du groupe est stock?\195?\169 dans le fichier courbe) Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java 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/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 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/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.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/EGGroupPersist.java Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,20 @@ +package org.fudaa.ebli.courbe; + + +/** + * Classe persistante des axe horizontaux + * @author Adrien Hadoux + * + */ +public class EGAxeHorizontalPersist { + + public EGAxeHorizontalPersist(EGAxeHorizontal axeX) { + // TODO Auto-generated constructor stub + fillInfoWith(axeX); + } + + private void fillInfoWith(EGAxeHorizontal axeX ){ + + } + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,20 @@ +package org.fudaa.ebli.courbe; + + +/** + * Classe persistante des axe verticaux + * @author Adrien Hadoux + * + */ +public class EGAxeVerticalPersist { + + public EGAxeVerticalPersist(EGAxeVertical axeY) { + // TODO Auto-generated constructor stub + fillInfoWith(axeY); + } + + private void fillInfoWith(EGAxeVertical axeY ){ + + } + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,49 @@ +package org.fudaa.ebli.courbe; + +/** + * Classe persistante de la courbe + * @author Adrien Hadoux + * + */ +public class EGCourbePersist { + + String title_; + int Idgroup; + + public EGCourbePersist(EGCourbe courbe, int IdGroup) { + + fillInfoWith(courbe,IdGroup); + } + + + + private void fillInfoWith(EGCourbe courbe,int idgroupe){ + this.Idgroup=idgroupe; + title_=courbe.getTitle(); + + } + + + + public String getTitle_() { + return title_; + } + + + + public void setTitle_(String title_) { + this.title_ = title_; + } + + + + public int getIdgroup() { + return Idgroup; + } + + + + public void setIdgroup(int idgroup) { + Idgroup = idgroup; + } +} Added: 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 (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,137 @@ +package org.fudaa.ebli.courbe; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.util.List; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.persist.EbliSceneSerializeXml; +import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; +import com.thoughtworks.xstream.persistence.FileStreamStrategy; +import com.thoughtworks.xstream.persistence.StreamStrategy; +import com.thoughtworks.xstream.persistence.XmlArrayList; + +/** + * Classe qui se charge de rendre persistant les donn\xE9es des graphes en xml. + * @author Adrien Hadoux + * + */ +public class EGGraphePersist { + + /** + * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et + * model... + */ + String directoryPath_; + + EGGraphe grapheTopersist; + + private XStream parser_; + + private static String MAINFILE="descriptorGraphe.xml"; + private static String COURBEDIRECTORY="courbes"; + + public EGGraphePersist(String directoryPath_, EGGraphe grapheTopersist,Map parameters) throws IOException { + super(); + this.directoryPath_ = directoryPath_; + this.grapheTopersist = grapheTopersist; + + savePersitGrapheXml(parameters); + } + + + + /** + * Recupere le parser adequat. + * @return + */ + private XStream getParser(){ + if(parser_==null) + parser_=initXmlParser(); + return parser_; + } + + /** + * Init le parser avec les alias adequats. + * @return + */ + private XStream initXmlParser(){ + XStream xstream = new XStream(new DomDriver()); + //-- creation des alias pour que ce soit + parlant dans le xml file --// + xstream.alias("Groupe", EGGroupPersist.class); + xstream.alias("AxeX", EGAxeHorizontalPersist.class); + xstream.alias("AxeY", EGAxeVerticalPersist.class); + xstream.alias("Courbe", EGCourbePersist.class); + + return xstream; + } + + + /** + * Enrtegistre le graphe au format persistant xml. + * @param parameters des parametres supplementaires utiles. + * @throws IOException + */ + private void savePersitGrapheXml(Map parameters) throws IOException{ + + String mainfile=directoryPath_+File.separator+MAINFILE; + //-- outputstream du xstream pour enregistrement des diff\xE9rents groupes--// + ObjectOutputStream out = getParser().createObjectOutputStream(new FileWriter(mainfile)); + //-- enregistrement des courbes --// + // strategy pour la liste xml: aun fichier par courbe. + File fichierCourbes=new File(directoryPath_+File.separator+COURBEDIRECTORY); + if(fichierCourbes.mkdir()){ + StreamStrategy strategy = new FileStreamStrategy(fichierCourbes); + // creates the list of curves: + List<EGCourbePersist> list = new XmlArrayList(strategy); + + + for(int i=0;i<grapheTopersist.getModel().getNbEGObject();i++){ + + EGObject objet=grapheTopersist.getModel().getEGObject(i); + + if(objet instanceof EGGroup){ + EGGroup groupe=(EGGroup) objet; + out.writeObject(new EGGroupPersist(groupe)); + + for(int k=0;k<groupe.getEGChilds().length;k++){ + if(groupe.getEGChilds()[k] instanceof EGCourbe){ + //-- ajout de la courbe persitante dans un fichier avec pour groupee le i eme + list.add(new EGCourbePersist((EGCourbe) groupe.getEGChilds()[k],i)); + } + } + }else + if(objet instanceof EGCourbe){ + //le groupe d appartenance est -1 + list.add(new EGCourbePersist((EGCourbe) objet,-1)); + } + } + } + out.close(); + + } + + public String getDirectoryPath_() { + return directoryPath_; + } + + public void setDirectoryPath_(String directoryPath_) { + this.directoryPath_ = directoryPath_; + } + + public EGGraphe getGrapheTopersist() { + return grapheTopersist; + } + + public void setGrapheTopersist(EGGraphe grapheTopersist) { + this.grapheTopersist = grapheTopersist; + } + + + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,32 @@ +package org.fudaa.ebli.courbe; + +import java.util.ArrayList; + +/** + * Classe persistante xml du eggroup + * @author Adrien Hadoux + * + */ +public class EGGroupPersist { + + String title_; + EGAxeHorizontalPersist axeX; + EGAxeVerticalPersist axeY; + + +public EGGroupPersist(EGGroup group) { + super(); + fillInfoWith(group); + +} + +private void fillInfoWith(EGGroup groupe){ + title_=groupe.getTitle(); + axeX=new EGAxeHorizontalPersist(groupe.getAxeX()); + axeY=new EGAxeVerticalPersist(groupe.getAxeY()); + + +} + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -50,7 +50,7 @@ /** * L'identifiant unique du widget */ - private final String id_; + private String id_; boolean isGroup; boolean isInEditMode_ = false; @@ -491,4 +491,12 @@ useBorder_ = _useBorder; } +public String getId_() { + return id_; +} + +public void setId_(String id_) { + this.id_ = id_; +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -217,12 +217,12 @@ * * @return EbliNode cree ajoute a la scene. */ - public EbliNode createLegende(Point _location, EbliScene _scene) { + public EbliNode createLegende(Point _location, EbliScene _scene,String id) { setScene(_scene); EbliNodeDefault def = new EbliNodeDefault(); def.setPreferedLocation(_location); // def.setPreferedSize(new Dimension(150, 250)); - def.setCreator(new EbliWidgetCreatorLegende(legendePanel_)); + def.setCreator(new EbliWidgetCreatorLegende(legendePanel_,id)); def.setTitle("L\xE9gende calque"); // TODO non stable _scene.addNode(def); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -162,7 +162,7 @@ if (widget_.getBounds() != null && widget_.getPreferredLocation() != null) { positionLegende.x = widget_.getPreferredLocation().x + widget_.getBounds().width + 20; positionLegende.y = widget_.getPreferredLocation().y; - setNodeLegende(legendeWidget_.createLegende(positionLegende, widget_.getEbliScene())); + setNodeLegende(legendeWidget_.createLegende(positionLegende, widget_.getEbliScene(),widget_.getId())); } widget_.getEbliScene().refresh(); } else if (getNodeLegende().hasWidget()) Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -12,6 +12,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; +import org.netbeans.api.visual.widget.Widget; import org.w3c.dom.Element; /** @@ -23,14 +24,18 @@ BCalqueLegendePanel g; // EbliWidget res; - + /** + * L'id de la widget qui a declench\xE9 la legende + */ + private String IdPossessor_; EbliWidgetWithBordure res; // BArbreCalqueModel modelTreeCalque_; - public EbliWidgetCreatorLegende(BCalqueLegendePanel g/* , BArbreCalqueModel model */) { + public EbliWidgetCreatorLegende(BCalqueLegendePanel g,String id/* , BArbreCalqueModel model */) { super(); this.g = g; + IdPossessor_=id; // modelTreeCalque_ = model; } @@ -70,7 +75,8 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + //-- pour le moment on se contente juste de rejouer la legende --// + return IdPossessor_; } @Override @@ -78,8 +84,27 @@ // TODO Auto-generated method stub if(data==null) g=new BCalqueLegendePanel(new BCalqueLegende(),"empty"); - else - g=(BCalqueLegendePanel) data; + else{ + String idCalque=(String) data; + + EbliScene scene=(EbliScene) parameters.get("scene"); + //-- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --// + for(Widget widget: scene.getLayerVisu().getChildren()){ + EbliWidget candidat=null; + if(widget instanceof EbliWidgetBordureSingle) + candidat=((EbliWidgetBordureSingle) widget).getIntern(); + else + candidat=(EbliWidget) widget; + + if(candidat.getId().equals(idCalque)){ + //--on a le bon, on rejoue la legende --// + ((EbliWidgetControllerCalque)candidat.getController()).ajoutLegende(); + return; + } + } + } + + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -48,7 +48,7 @@ positionLegende.x = _dest.getLocation().x + _dest.getIntern().getPreferredSize().width + 5; positionLegende.y = _dest.getPreferredLocation().y; EbliWidgetVueCalque vue = (EbliWidgetVueCalque) _dest.getIntern(); - vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene()); + vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene(),getBordure().getIntern().getId()); ((EbliWidgetControllerCalque) vue.getController()).setLegendeWidget(_legende); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -86,7 +86,7 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + return typeObject_; } @Override @@ -94,6 +94,9 @@ // TODO Auto-generated method stub if(data==null) typeObject_=new ShapeCreatorCircle(); + else{ + typeObject_=(ShapeCreator) data; + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -63,14 +63,13 @@ return duplique; } - public EbliWidgetWithBordure getBordure() { - return res; + public EbliWidgetWithBordure getBordure() { return res; } @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + return label_; } @Override @@ -78,6 +77,7 @@ // TODO Auto-generated method stub if(data==null) label_=""; + label_=(String) data; } 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 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -34,6 +34,7 @@ import org.fudaa.ebli.visuallibrary.actions.CommandMasquer; import org.fudaa.ebli.visuallibrary.actions.CommandSupprimer; import org.fudaa.ebli.visuallibrary.actions.EbliActionEditorOneClick; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import com.memoire.bu.BuMenuBar; import com.memoire.bu.BuPanel; @@ -223,9 +224,10 @@ // -- non de la legende --// widgetGraphe_.getNodeLegende().setTitle("L\xE9gende " + (indiceLegende++)); - - widgetGraphe_.getNodeLegende().setCreator( - new EbliWidgetCreatorLegende(((EbliWidgetGraphe) widget_).getGraphe())); + + EbliWidgetCreatorLegende creator= new EbliWidgetCreatorLegende(((EbliWidgetGraphe) widget_).getGraphe(),widget_.getId()); + + widgetGraphe_.getNodeLegende().setCreator( creator ); widgetGraphe_.getNodeLegende().setPreferedLocation(positionLegende); widget_.getEbliScene().addNode(widgetGraphe_.getNodeLegende()); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -1,12 +1,15 @@ package org.fudaa.ebli.visuallibrary.graphe; import java.awt.Point; +import java.io.File; +import java.io.IOException; import java.util.Map; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheModel; +import org.fudaa.ebli.courbe.EGGraphePersist; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -109,8 +112,21 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + //-- generation d'un identifiant unique pour le repertoire du graphe --// + String pathUnique=parameters.get("path")+File.separator+"Graph"+res.getIntern().getId(); + + //- sauvegarde du contenu de l eggraphe dans un repertoire a part --// + try { + File createRep=new File(pathUnique); + if( createRep.mkdir()) + new EGGraphePersist(pathUnique,getGraphe(),parameters); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } + + return pathUnique; + } @Override public void setPersistData(Object data, Map parameters) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -2,6 +2,8 @@ import java.util.Map; +import org.fudaa.ebli.calque.BCalqueLegende; +import org.fudaa.ebli.calque.BCalqueLegendePanel; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -9,7 +11,9 @@ import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerCalque; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; +import org.netbeans.api.visual.widget.Widget; import org.w3c.dom.Element; public class EbliWidgetCreatorLegende implements EbliWidgetCreator { @@ -17,9 +21,11 @@ EGGraphe g; // EbliWidget res; EbliWidgetWithBordure res; - public EbliWidgetCreatorLegende(EGGraphe g) { + private String IdPossessor_; + public EbliWidgetCreatorLegende(EGGraphe g,String id) { super(); this.g = g; + IdPossessor_=id; } public EbliWidgetCreatorLegende(){ @@ -55,14 +61,35 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + return IdPossessor_; } - @Override + public void setPersistData(Object data, Map parameters) { - // TODO Auto-generated method stub - if(data==null) - g=new EGGraphe(new EGGrapheTreeModel()); - } + // TODO Auto-generated method stub + if(data==null) + g=new EGGraphe(new EGGrapheTreeModel()); + else{ + String idGraphe=(String) data; + + EbliScene scene=(EbliScene) parameters.get("scene"); + //-- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --// + for(Widget widget: scene.getLayerVisu().getChildren()){ + EbliWidget candidat=null; + if(widget instanceof EbliWidgetBordureSingle) + candidat=((EbliWidgetBordureSingle) widget).getIntern(); + else + candidat=(EbliWidget) widget; + + if(candidat.getId().equals(idGraphe)){ + //--on a le bon, on rejoue la legende --// + ((EbliWidgetControllerGraphe)candidat.getController()).ajoutLegende(); + return; + } + } + } + + + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -2,12 +2,14 @@ import java.awt.Color; import java.awt.Dimension; +import java.awt.Point; import org.fudaa.ebli.visuallibrary.EbliScene; import com.sun.j3d.loaders.vrml97.impl.Background; + /** * Classe utilis\xE9e par d\xE9faut pour la serialization xml avec xstream * @author Adrien Hadoux @@ -18,23 +20,32 @@ String title; Color background; int nbFrames; + +//dimensiosn de la frame int width; int height; -public EbliSceneSerializeXml(EbliScene scene,String title){ +//position de la frame ou autre +int x; +int y; + + +public EbliSceneSerializeXml(EbliScene scene,String title,Dimension dimensionFrame,Point location){ - fillInfoWith(scene,title); + fillInfoWith(scene,title,dimensionFrame,location); } -private void fillInfoWith(EbliScene scene,String title){ +private void fillInfoWith(EbliScene scene,String title,Dimension dimensionFrame,Point location){ this.title=title; this.background=(Color) scene.getBackground(); this.nbFrames=scene.getObjects().size(); if(scene.getView() !=null){ - this.width=scene.getView().getSize().width; - this.height=scene.getView().getSize().height; + this.width=dimensionFrame.width; + this.height=dimensionFrame.height; + this.x=location.x; + this.y=location.y; } } @@ -109,5 +120,25 @@ } +public int getX() { + return x; +} + +public void setX(int x) { + this.x = x; } + + +public int getY() { + return y; +} + + +public void setY(int y) { + this.y = y; +} + + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -17,6 +17,7 @@ import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorClassLoader; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape; +import org.netbeans.api.visual.widget.Widget; import org.w3c.dom.Element; /** @@ -26,6 +27,11 @@ */ public class EbliWidgetSerializeXml { + /** + * Important: l'id de la widget pour avoir des references . + */ + String Id; + String title; /** * L'instance de la classe creator @@ -54,10 +60,13 @@ boolean bordure; - - //-- datas : objet g\xE9r\xE9 par le creator, inconnu poru cette classe --// + boolean isVisible; + + boolean isSelected; + + //-- datas : objet g\xE9r\xE9 par le creator, inconnu pour cette classe --// Object data; - + public EbliWidgetSerializeXml(EbliNode node,Map parameters) { fillInfoWith(node,parameters); @@ -66,46 +75,60 @@ } private void fillInfoWith(EbliNode node,Map parameters){ - EbliWidget widget_; + EbliWidget widget; if(node.getWidget() instanceof EbliWidgetBordureSingle){ - widget_ = (EbliWidget) node.getWidget().getChildren().get(0); + widget = (EbliWidget) node.getWidget().getChildren().get(0); this.bordure=true; } else{ - widget_ = node.getWidget(); + widget = node.getWidget(); this.bordure=false; } - + this.Id=widget.getId(); this.title = node.getTitle(); this.type = node.getCreator().getClass().toString(); - if(widget_.getColorFond() !=null) + if(widget.getColorFond() !=null) this.bacckground = node.getWidget().getColorFond(); - if(widget_.getColorContour() !=null) - this.foreground = widget_.getColorContour(); - if(widget_.getFormeFont() !=null) - this.font = widget_.getFormeFont(); - this.rotation = widget_.getRotation(); - if(widget_.getTraceLigneModel()!=null){ - this.epaisseurTrait = widget_.getTraceLigneModel().getEpaisseur(); - this.typeTrait = widget_.getTraceLigneModel().getTypeTrait(); - this.colorModel=widget_.getTraceLigneModel().getCouleur(); + if(widget.getColorContour() !=null) + this.foreground = widget.getColorContour(); + if(widget.getFormeFont() !=null) + this.font = widget.getFormeFont(); + this.rotation = widget.getRotation(); + if(widget.getTraceLigneModel()!=null){ + this.epaisseurTrait = widget.getTraceLigneModel().getEpaisseur(); + this.typeTrait = widget.getTraceLigneModel().getTypeTrait(); + this.colorModel=widget.getTraceLigneModel().getCouleur(); } - if(widget_.getBounds() !=null){ - this.width = widget_.getBounds().width; - this.height = widget_.getBounds().height; + + + //--cas particulier, si widget non visible les dimension bonnes sont celles du parent preferredbounds--// + if(!widget.getParentBordure().isVisible()){ + if(widget.getParentBordure().getPreferredBounds() !=null){ + this.width = widget.getParentBordure().getPreferredBounds().width; + this.height = widget.getParentBordure().getPreferredBounds().height; + } + }else + if(widget.getParentBordure().getBounds() !=null){ + this.width = widget.getParentBordure().getBounds().width; + this.height = widget.getParentBordure().getBounds().height; + } + + if( widget.getParentBordure().getPreferredLocation()!=null){ + this.x =widget.getParentBordure().getPreferredLocation().x; + this.y = widget.getParentBordure().getPreferredLocation().y; } - if(widget_.getLocation() !=null){ - this.x =widget_.getLocation().x; - this.y = widget_.getLocation().y; - } - + + this.isVisible=widget.getParentBordure().isVisible(); + this.isSelected=widget.getEbliScene().getSelectedObjects().contains(node); + + //-- datas --// this.data=node.getCreator().getPersistData(parameters); } - + /** * Genere la widget, le creator et le node correspondant * ajoute le tout dans la scene et regle les parametres graphiques. @@ -118,19 +141,24 @@ EbliNode newNode=new EbliNodeDefault(); newNode.setTitle(title); newNode.setPreferedLocation(new Point(x,y)); - newNode.setPreferedSize(new Dimension(width,height)); - + if(width>0 && height>0) + newNode.setPreferedSize(new Dimension(width,height)); + else + newNode.setPreferedSize(new Dimension(200,200)); //-- creation du creator specicalis\xE9 --// //EbliWidgetCreator creator= (EbliWidgetCreator) EbliWidgetCreatorShape.class.forName(type).newInstance(); EbliWidgetCreator creator= EbliWidgetCreatorClassLoader.forName(type); - + //-- creation des datas --// creator.setPersistData(data, parameters); - + newNode.setCreator(creator); - + //-- ajout du node dans la scene --// scene.addNode(newNode); + + //-- recuperation du precedent Id, tres important poru les references --// + newNode.getWidget().setId_(this.Id); //--remplissage des proprietes graphiques --// newNode.getWidget().setColorFond(bacckground); @@ -139,11 +167,12 @@ newNode.getWidget().setRotation(rotation); TraceLigneModel model=new TraceLigneModel(typeTrait,epaisseurTrait,colorModel); newNode.getWidget().setTraceLigneModel(model); - - + newNode.getWidget().getParentBordure().setVisible(isVisible); + + return newNode; } - + public String getTitle() { return title; } @@ -256,6 +285,38 @@ this.data = data; } + public Color getColorModel() { + return colorModel; + } + public void setColorModel(Color colorModel) { + this.colorModel = colorModel; + } + public boolean isVisible() { + return isVisible; + } + + public void setVisible(boolean isVisible) { + this.isVisible = isVisible; + } + + public boolean isSelected() { + return isSelected; + } + + public void setSelected(boolean isSelected) { + this.isSelected = isSelected; + } + + public String getId() { + return Id; + } + + public void setId(String id) { + Id = id; + } + + + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -192,7 +192,7 @@ // -- creation d un noeud legende --// EbliNodeDefault nodeLegende = new EbliNodeDefault(); nodeLegende.setTitle("Legende"); - nodeLegende.setCreator(new EbliWidgetCreatorLegende(g)); + nodeLegende.setCreator(new EbliWidgetCreatorLegende(g,"")); nodeLegende.setPreferedSize(new Dimension(100, 100)); nodeLegende.setPreferedLocation(new Point(4, 270)); scene.addNode(nodeLegende); 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 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -157,6 +157,9 @@ if ("OUVRIR".equals(com)) { // -- ouverture d un nouveau projet --// 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(); } 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-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -23,6 +23,7 @@ import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGFillePanel; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidgetController; @@ -117,6 +118,7 @@ public TrPostLayoutFille(final TrPostProjet _projet) { super(); setTitle(TrResource.getS("vue 2D")); + setFrameIcon(EbliResource.EBLI.getToolIcon("lissage")); previousTitleFrame = getTitle(); projet_ = _projet; // creation de la scene EBLI 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-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -250,7 +250,7 @@ // -- ajout du rectangle --// final EbliNodeDefault nodeLegende = new EbliNodeDefault(); nodeLegende.setTitle("Legende calque"); - nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0))); + nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0),"x")); 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-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -7,6 +7,7 @@ */ package org.fudaa.fudaa.tr.post; +import java.awt.Component; import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; @@ -359,7 +360,8 @@ } public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) { - if (_src != null) ajouterSource(_src); + if (_src != null) + ajouterSource(_src); // -- creation de la frame de gestion multi projet --// filleProjetctManager_ = new TrPostProjetsManagerFille(this); @@ -379,7 +381,8 @@ listeSrc_.add(_src); // -- ajout du menu correspondant uniquement a partir de la 2eme --// - if (listeSrc_.size() > 1) construitMenuPostSpecifiqueSource(_src); + // if (listeSrc_.size()>1 || (menuPost_!=null &&)) + construitMenuPostSpecifiqueSource(_src); } else { // -- messqge d erreur: le fichier est deja ouvert --// @@ -389,6 +392,7 @@ } + /** * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. * @@ -440,7 +444,7 @@ listeSrc_.remove(src); // --recuperation du menu simul --// - final BuMenu menuSimul = listeMenuProjets_.get(n); + final BuMenu menuSimul = getlisteMenuProjets_().get(n); // --on retire les menus correspondants --// // for (int i = 0; i < listeSousMenuProjets_.get(n).size(); i++) { @@ -453,8 +457,8 @@ // -- on retire de la liste des menus le menusimul et la liste des sous // menus --// - listeMenuProjets_.remove(n); - listeSousMenuProjets_.remove(n); + getlisteMenuProjets_().remove(n); + getlisteSousMenuProjets_().remove(n); // -- mise a jour de la barre des menus --// impl_.getMainMenuBar().revalidate(); @@ -522,11 +526,11 @@ + (listeSrc_.size())); // -- ajout du menu au menu post --// - menuPost_.add(menuSimul); + getMenuPost().add(menuSimul); // -- sauvegarde d une trace du menu dans la liste pour une suppression // ulterieure --// - listeMenuProjets_.add(menuSimul); + getlisteMenuProjets_().add(menuSimul); final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>(); @@ -563,7 +567,7 @@ _src.addSpecificItemInMainMenu(menuSimul, getImpl()); // -- ajout de la sous liste de menus pour la garder en memoire --// - listeSousMenuProjets_.add(listSousMenus); + getlisteSousMenuProjets_().add(listSousMenus); } } @@ -599,27 +603,39 @@ // menubar.add(menuLayout_, 2); // // } + + public BuMenu getMenuPost(){ + if(menuPost_==null) + menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); + return menuPost_; + } + /** * Creation par defaut du menu post de l interface. Cette methdoe est appelee une seule dfois au moment de la creation * de l impl. */ public void setMenuPost() { final BuMenuBar menubar = impl_.getMainMenuBar(); + + Component comp=null; + if(getMenuPost().getMenuComponentCount()>0){ + comp= getMenuPost().getMenuComponent(0); + //getMenuPost().remove(0); + } + + getMenuPost().setIcon(null); + getMenuPost().setName("mnPost"); - menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); - menuPost_.setIcon(null); - menuPost_.setName("mnPost"); + menubar.add(getMenuPost(), 2); - menubar.add(menuPost_, 2); - - menuPost_.addSeparator(TrResource.getS("Layout")); + getMenuPost().addSeparator(TrResource.getS("Layout")); // -- ajout de l action de creation du calque --// - // menuPost_.add(new TrPostActionChooseAndCreateCalque(this)); - menuPost_.addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); - menuPost_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", CtuluResource.CTULU + // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this)); + getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); + getMenuPost().addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", CtuluResource.CTULU .getIcon("crystal_ajouter"), new ActionListener() { public void actionPerformed(final ActionEvent _e) { @@ -628,7 +644,7 @@ } }); - menuPost_.addSeparator(TrResource.getS("Gestion")); + getMenuPost().addSeparator(TrResource.getS("Gestion")); // -- ajout de l action de gestion des simus dans post --// final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); item.addActionListener(new ActionListener() { @@ -646,17 +662,33 @@ } }); - menuPost_.add(item); - menuPost_.addSeparator("Liste des Fichiers r\xE9sultats"); + getMenuPost().add(item); + getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats"); // -- init de la liste des menus --// - listeMenuProjets_ = new ArrayList<BuMenu>(); + - listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); + // -- construction par defaut du premier menu de simulation --// - construitMenuPostSpecifiqueSource(getSource(0)); + // construitMenuPostSpecifiqueSource(getSource(0)); + if(comp!=null){ + getMenuPost().add(comp); + } + } + + public List<BuMenu> getlisteMenuProjets_(){ + if(listeMenuProjets_==null) + listeMenuProjets_ = new ArrayList<BuMenu>(); + return listeMenuProjets_; + } + + public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_(){ + if(listeSousMenuProjets_==null) + listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); + return listeSousMenuProjets_; + } /** * calcul les extrema en fonction de la source proposee * @@ -943,10 +975,10 @@ // return; // } else { // i indique le numero de la simulation - for (int i = 0; i < listeSousMenuProjets_.size(); i++) { + for (int i = 0; i < getlisteSousMenuProjets_().size(); i++) { // --recuperation de la liste des sousmenu de la simulation i --// - final ArrayList<BuMenuItem> listeSousMenus = listeSousMenuProjets_.get(i); + final ArrayList<BuMenuItem> listeSousMenus = getlisteSousMenuProjets_().get(i); final TrPostSource source = getSource(i); // -- on recherche si l action provient d un des fils --// for (int j = 0; j < listeSousMenus.size(); j++) { @@ -1292,7 +1324,7 @@ final TrPostLayoutFille newLayoutFille = new TrPostLayoutFille(this); newLayoutFille.setTitle(newLayoutFille.getTitle() + " N\xB0 " + (++idx)); - newLayoutFille.setFrameIcon(EbliResource.EBLI.getToolIcon("lissage")); + // addFillesLayout(newLayoutFille); impl_.addInternalFrame(newLayoutFille); } 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-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -394,6 +394,9 @@ public TrPostSource getSource() { return source_; } + + + /** * @return the suiviPanel 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-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -1,5 +1,7 @@ package org.fudaa.fudaa.tr.post.persist; +import java.awt.Dimension; +import java.awt.Point; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; @@ -9,9 +11,11 @@ import java.io.ObjectOutputStream; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; import javax.swing.JFileChooser; import javax.swing.JInternalFrame; @@ -30,10 +34,12 @@ import org.fudaa.ebli.visuallibrary.persist.ManagerWidgetPersist; import org.fudaa.fudaa.tr.common.TrLib; 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.TrPostMultiSourceActivator; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostSource; +import org.netbeans.api.visual.widget.Widget; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -94,7 +100,7 @@ ProgressionInterface prog_; File projet_; - CtuluUI ui_; + TrPostCommonImplementation ui_; public TrPostPersistenceManager(TrPostProjet projet) { @@ -139,12 +145,17 @@ if (reponse == JFileChooser.APPROVE_OPTION) { File conteneurProjet = fileChooser.getSelectedFile(); - if(projet_==null || projet_!=conteneurProjet) - projet_ = new File(conteneurProjet.getAbsoluteFile() + EXTENSION); + if(projet_==null || !projet_.equals(conteneurProjet)) + projet_ = new File(GetExtensionName(conteneurProjet.getAbsolutePath())); // creation du repertoire global contenant toutes les donn\xE9es if (projet_.mkdir()) { return true; - } else { + } else + + if(projet_.isDirectory()){ + return true; + }else + { ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le r\xE9pertoire")); return false; } @@ -153,6 +164,19 @@ } else return false; } + + /** + * Retourne un nom avec extension + * @param name + * @return + */ + public String GetExtensionName(String name){ + + if(name.contains(EXTENSION)){ + return name; + }else + return name+EXTENSION; + } /** * Charge le repertoire contenant tous les fichiers @@ -276,9 +300,10 @@ }else{ File f = new File(path); // -- tentative de chargement du source dans le multi-projet --// + multiProjectActivator.active(f, trprojet_.impl_); // -- notify aux observers --// - trprojet_.notifyObservers(); + //trprojet_.notifyObservers(); } @@ -337,6 +362,8 @@ progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listFilles.size()); file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); //-- sauvegarde du persitant --// + parametres.put("dimensions", fille.getSize()); + parametres.put("location", fille.getLocation()); savePersitSceneXml(scene,title,file,parametres); cpt++; @@ -397,9 +424,8 @@ TrPostLayoutFille postFrame=new TrPostLayoutFille(trprojet_); //-- sauvegarde du persitant --// try { + trprojet_.getImpl().addInternalFrame(postFrame); loadPersitSceneXml(file,postFrame,parametres); - - trprojet_.getImpl().addInternalFrame(postFrame); } catch (InstantiationException e) { // TODO Auto-generated catch block ui_.error(TrResource.getS("Erreur dans le chargement du layout. Chargement annul\xE9 pour le fichier ")+fichier); @@ -413,6 +439,9 @@ progression("", 100); ui_.message(TrResource.getS("Chargement termin\xE9"), TrResource.getS("Chargement termin\xE9 avec succ\xE8s"), false); + + + return true; } @@ -461,16 +490,18 @@ //-- g\xE9n\xE9ration du xml pour la scene --// - out.writeObject(new EbliSceneSerializeXml(scene,title)); + out.writeObject(new EbliSceneSerializeXml(scene,title,(Dimension) parametres.get("dimensions"),(Point) parametres.get("location"))); //-- g\xE9n\xE9ration du xml pour les eblinode/widgets --// - - Iterator<EbliNode> it=(Iterator<EbliNode>) scene.getObjects().iterator(); + //-- ACHTUNG!!! IL FAUT RECUPERER LES OBJETS VIA CHILDREN POUR PRESERVER L ORDRE DE SUPERPOSITION!!! --// + Iterator<Widget> it= scene.getLayerVisu().getChildren().iterator(); while(it.hasNext()){ - EbliNode node=it.next(); + Widget widget=it.next(); + EbliNode node=(EbliNode) scene.findObject(widget); //ecriture de l objet - out.writeObject(new EbliWidgetSerializeXml(node,parametres)); + if(node !=null) + out.writeObject(new EbliWidgetSerializeXml(node,parametres)); } @@ -496,6 +527,7 @@ // HashMap<String, Object> parametres=new HashMap<String, Object>(); // parametres.put("path", file.getAbsolutePath()); EbliScene scenToUpdate=fille.getScene(); + parametres.put("scene",scenToUpdate); //-- inputstream du xstream --// ObjectInputStream in = getParser().createObjectInputStream(new FileReader(file)); @@ -509,9 +541,11 @@ if(sceneXml.getWidth()>0 && sceneXml.getHeight()>0) fille.setSize(sceneXml.getWidth(),sceneXml.getHeight()); fille.setTitle(sceneXml.getTitle()); + fille.setLocation(sceneXml.getX(),sceneXml.getY()); + //-- preparation de la liste de selection des frames dans le layout --// + final Set<Object> listeNodeSelect = new HashSet<Object>(); - //-- r\xE9cup\xE9ration via xml des eblinode/widgets --// for(int i=0;i<sceneXml.getNbFrames();i++){ @@ -519,14 +553,21 @@ EbliWidgetSerializeXml widgetXml = (EbliWidgetSerializeXml)in.readObject(); //generation de la widget dans la scene - widgetXml.generateWidgetInScene(parametres, scenToUpdate); + EbliNode node=widgetXml.generateWidgetInScene(parametres, scenToUpdate); + + if(widgetXml.isSelected()) + listeNodeSelect.add(node); } in.close(); + + //-- on ajoute les noeuds selectionnes a ebliScene --// + scenToUpdate.setSelectedObjects(listeNodeSelect); + // mise a jour de la scene + scenToUpdate.refresh(); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-10 17:14:43
|
Revision: 4053 http://fudaa.svn.sourceforge.net/fudaa/?rev=4053&view=rev Author: hadouxad Date: 2008-10-10 17:14:30 +0000 (Fri, 10 Oct 2008) Log Message: ----------- - Gestion de la persistance des graphes Termin?\195?\169! - les courbes - la classe du type de model (spatial, temporelle ou n'importe quoi d autre, g?\195?\169r?\195?\169) - les import scope marchent aussi - Les propri?\195?\169t?\195?\169s graphiques - les axes - les groupes - le r?\195?\169ajustement des zooms - Gestion plus elaboree des id de widget: -cr?\195?\169ation d une classe CtuluLibGenerator fournisseur officielle de l'?\195?\169quipe de layout qui -emp?\195?\170che les doublons, ce qui pourrait etre problematique - Le g?\195?\169n?\195?\169rateur utilise une loi de congruence lin?\195?\169aire avec des methodes sympa (gestion de blckliste, eviter des doublons...), ca pourra etre utilis?\195?\169 pour fudaa. - Gestion des groupes: reconstruction des groupes auto - Les widget persistantes ont un attribut idgroup (relation 1:N) - Les widgets groupes sont serializes a la fin du fichier layout; traitement particulier: on a pas besoin de les rejouer, seulement de leur propri?\195?\169t?\195?\169s (nm du groupe, location, dimensions) - Le syst?\195?\168me sera conserve pour les fusions de calques - Refactorisation des Gestion des groupes et bordures - Methodes simplifi?\195?\169e dans ebliwidget pour mieux g?\195?\169rer le tout. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.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/EGGrapheTreeModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.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/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/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroup.java Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -0,0 +1,147 @@ +package org.fudaa.ctulu; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Random; + +import com.memoire.fu.FuLog; + +/** + * Generateur d'Id uniques en singleton. + * Gere des contraintes (id ajout\xE9s, retir\xE9s) + * afin d'\xE9viter des doublons. + * + * Gen\xE8re des nombres comprise entre 0 et MAX-1. + * + * @author Adrien Hadoux + * + */ +public class CtuluLibGenerator { + + private static CtuluLibGenerator generator_; + + /** + * Tous les nombres seront inf\xE9rieurs a Max-1 + */ + private static long MAX=65535; + + /** + * Pour avoir toujours la meme sequence, il suffit de mettre le mode debug a true, + * cela initialisera toujours la seed de la mme facon. + * Pratique pour tester + */ + private boolean modeDebug=false; + + //Random randomizer_; + + /** + * Blacklist des elements a ne pas generer. + */ + List<Long> constraints_; + + /** + * Le dernier nombre g\xE9n\xE9r\xE9 r\xE9inject\xE9 dans la formule + */ + long old; + + /** + * a-1 doit \xEAtre un multiple de p, pour tout p nombre premier diviseur de MAX + */ + long a_=25; + + /** + * c et MAX doivent \xEAtre premiers entre eux + * + */ + long c_=16; + + private CtuluLibGenerator(){ + constraints_=new ArrayList<Long>(); + //getPseudoAleatoire(); + old=initSeed(); + } + + /** + * Initialise la graine avec l'heure actuelle. + * @return + */ + private long initSeed(){ + if(modeDebug) + return 0; + return Calendar.getInstance().getTimeInMillis(); + } + +// private Random getPseudoAleatoire(){ +// if(randomizer_==null) +// randomizer_=new Random(initSeed()); +// return randomizer_; +// } + + + public long useCongruenceLineaireGenerateur(){ + old= (a_*old + c_)% MAX; + return old; + } + + /** + * Accesseur du singleton. + * @return + */ + public static CtuluLibGenerator getInstance(){ + if(generator_==null) + generator_=new CtuluLibGenerator(); + return generator_; + } + + + /** + * Donne un id unique + * @return + */ + public long deliverUniqueId(){ + Long id; + do{ + id=new Long(useCongruenceLineaireGenerateur()); + } + while(constraints_.contains(id)); + addConstraint(id); + FuLog.warning("Generation ID="+id); + return id; + } + + /** + * version string + * @return + */ + public String deliverUniqueStringId(){ + + return ""+deliverUniqueId(); + } + /** + * Clear la liste des contraintes + */ + public void clear(){ + constraints_=new ArrayList<Long>(); + } + + + public void addConstraint(long val){ + constraints_.add(val); + } + public void addConstraint(String value){ + long val=Long.parseLong(value); + constraints_.add(val); + } + public void addConstraint(List<Long> list){ + constraints_.addAll(list); + } + + public void removeConstraint(long val){ + constraints_.remove(new Long(val)); + } + public void removeConstraint(String value){ + long val=Long.parseLong(value); + constraints_.remove(new Long(val)); + } +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -1,20 +1,57 @@ package org.fudaa.ebli.courbe; +import java.awt.Color; +import java.awt.Font; +import org.fudaa.ebli.trace.TraceLigne; + + /** * Classe persistante des axe horizontaux * @author Adrien Hadoux * */ public class EGAxeHorizontalPersist { - + String titre; + boolean titreVisible = true; + String unite; + boolean visible; + Font font; + boolean graduations; + TraceLigne grille; + boolean isIteratorUptodate; + Color lineColor; + public EGAxeHorizontalPersist(EGAxeHorizontal axeX) { // TODO Auto-generated constructor stub fillInfoWith(axeX); } private void fillInfoWith(EGAxeHorizontal axeX ){ + this.titre = axeX.titre_; + this.titreVisible = axeX.titreVisible_; + this.unite = axeX.unite_; + this.visible = axeX.visible_; + this.font = axeX.font_; + this.graduations = axeX.graduations_; + this.grille = axeX.grille_; + this.isIteratorUptodate = axeX.isIteratorUptodate_; + this.lineColor = axeX.lineColor_; } + + public EGAxeHorizontal generateAxe(){ + EGAxeHorizontal axeX=new EGAxeHorizontal(); + axeX.titre_ = this.titre; + axeX.titreVisible_ = this.titreVisible; + axeX.unite_ = this.unite; + axeX.visible_ = this.visible; + axeX.font_ = this.font; + axeX.graduations_ = this.graduations; + axeX.grille_ = this.grille; + axeX.isIteratorUptodate_ = this.isIteratorUptodate; + axeX.lineColor_ = this.lineColor; + return axeX; + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -1,20 +1,69 @@ package org.fudaa.ebli.courbe; +import java.awt.Color; +import java.awt.Font; +import org.fudaa.ebli.trace.TraceLigne; + + /** * Classe persistante des axe verticaux * @author Adrien Hadoux * */ public class EGAxeVerticalPersist { + boolean droite; + boolean titreVertical; + boolean titreVerticalDroite; + String titre; + boolean titreVisible = true; + String unite; + boolean visible; + Font font; + boolean graduations; + TraceLigne grille; + boolean isIteratorUptodate; + Color lineColor; + + public EGAxeVerticalPersist(EGAxeVertical axeY) { // TODO Auto-generated constructor stub fillInfoWith(axeY); } private void fillInfoWith(EGAxeVertical axeY ){ - + this.droite = axeY.droite_; + this.titreVertical = axeY.titreVertical_; + this.titreVerticalDroite = axeY.titreVerticalDroite_; + this.titre = axeY.titre_; + this.titreVisible = axeY.titreVisible_; + this.unite = axeY.unite_; + this.visible = axeY.visible_; + this.font = axeY.font_; + this.graduations = axeY.graduations_; + this.grille = axeY.grille_; + this.isIteratorUptodate = axeY.isIteratorUptodate_; + this.lineColor = axeY.lineColor_; } + + + public EGAxeVertical generateAxe(){ + EGAxeVertical axeY=new EGAxeVertical(); + axeY.droite_ = this.droite; + axeY.titreVertical_ = this.titreVertical; + axeY.titreVerticalDroite_ = this.titreVerticalDroite; + axeY.titre_ = this.titre; + axeY.titreVisible_ = this.titreVisible; + axeY.unite_ = this.unite; + axeY.visible_ = this.visible; + axeY.font_ = this.font; + axeY.graduations_ = this.graduations; + axeY.grille_ = this.grille; + axeY.isIteratorUptodate_ = this.isIteratorUptodate; + axeY.lineColor_ = this.lineColor; + return axeY; + } + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -860,6 +860,14 @@ public String toString() { return getTitle(); } + +public TraceBox getTbox_() { + return tbox_; +} + +public void setTbox_(TraceBox tbox_) { + this.tbox_ = tbox_; +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -122,4 +122,8 @@ return duplic; } +public EGGroup getParent_() { + return parent_; +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -1,5 +1,8 @@ package org.fudaa.ebli.courbe; +import org.fudaa.ebli.trace.TraceBox; +import org.fudaa.ebli.trace.TraceLigneModel; + /** * Classe persistante de la courbe * @author Adrien Hadoux @@ -9,40 +12,81 @@ String title_; int Idgroup; - - public EGCourbePersist(EGCourbe courbe, int IdGroup) { - + ///-- les min et max sont purement informatifs --// + double Xmin; + double Xmax; + double Ymin; + double Ymax; + + double[] abscisses; + double[] ordonnees; + + //-- proprietes graphiques --// + TraceBox tracebox; + TraceLigneModel lineModel_; + TraceLigneModel tLigneMarqueur_; + + public EGCourbePersist(EGCourbeChild courbe, int IdGroup) { fillInfoWith(courbe,IdGroup); } - - - private void fillInfoWith(EGCourbe courbe,int idgroupe){ + private void fillInfoWith(EGCourbeChild courbe,int idgroupe){ this.Idgroup=idgroupe; title_=courbe.getTitle(); + Xmin = courbe.getModel().getXMin(); + Xmax = courbe.getModel().getXMax(); + Ymin = courbe.getModel().getYMin(); + Ymax = courbe.getModel().getYMax(); + this.abscisses = new double[courbe.getModel().getNbValues()]; + this.ordonnees = new double[courbe.getModel().getNbValues()]; + for(int i=0;i<courbe.getModel().getNbValues();i++){ + this.abscisses[i]=courbe.getModel().getX(i); + this.ordonnees[i]=courbe.getModel().getY(i); + } + //graphiques + if(courbe.getTbox_()!=null) + tracebox=courbe.getTbox_(); + if(courbe.getLigneModel()!=null) + lineModel_=courbe.getLigneModel(); + if(courbe.getMarkLigneModel()!=null) + tLigneMarqueur_=courbe.getMarkLigneModel(); + + } + /** + * Generate the proper curve in the appropriate group. + * @param groupe + * @return + */ +public EGCourbeChild generateCourbe(EGGroup groupe){ + EGModel model=new EGCourbeModelDefault(abscisses,ordonnees); + EGCourbeChild courbe=new EGCourbeChild(groupe,model); + courbe.setTitle(title_); + + //graphiques + if(tracebox!=null) + courbe.setTbox_(tracebox); + if(lineModel_!=null) + courbe.setLigneType(lineModel_); + if(tLigneMarqueur_!=null) + courbe.setLigneMark(tLigneMarqueur_); + + return courbe; +} + public String getTitle_() { return title_; } - - - public void setTitle_(String title_) { this.title_ = title_; } - - - public int getIdgroup() { return Idgroup; } - - - public void setIdgroup(int idgroup) { Idgroup = idgroup; } 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 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -1,9 +1,13 @@ package org.fudaa.ebli.courbe; import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; +import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -29,23 +33,20 @@ */ String directoryPath_; - EGGraphe grapheTopersist; + private XStream parser_; private static String MAINFILE="descriptorGraphe.xml"; private static String COURBEDIRECTORY="courbes"; - public EGGraphePersist(String directoryPath_, EGGraphe grapheTopersist,Map parameters) throws IOException { - super(); + + public EGGraphePersist(String directoryPath_, Map parameters) throws IOException { this.directoryPath_ = directoryPath_; - this.grapheTopersist = grapheTopersist; + } - savePersitGrapheXml(parameters); - } - /** * Recupere le parser adequat. * @return @@ -71,67 +72,174 @@ return xstream; } + /** + * Retour,e le repertoire qui contient les courbes + * @return + */ + private File getDirectoryCurves(){ + return new File(directoryPath_+File.separator+COURBEDIRECTORY); + } + + /** + * Retourne le path vers le fiochier principal des courbes + * @return + */ + private String getMainFilePath(){ + return directoryPath_+File.separator+MAINFILE; + } /** + * Retourne la liste persistante des fichiers + * @return + */ + List<EGCourbePersist> getPersitantCurvesList(){ + return new XmlArrayList( new FileStreamStrategy(getDirectoryCurves())); + } + + /** * Enrtegistre le graphe au format persistant xml. * @param parameters des parametres supplementaires utiles. * @throws IOException */ - private void savePersitGrapheXml(Map parameters) throws IOException{ - - String mainfile=directoryPath_+File.separator+MAINFILE; + public void savePersitGrapheXml(EGGraphe grapheTopersist) throws IOException{ + String mainfile=getMainFilePath(); //-- outputstream du xstream pour enregistrement des diff\xE9rents groupes--// ObjectOutputStream out = getParser().createObjectOutputStream(new FileWriter(mainfile)); //-- enregistrement des courbes --// // strategy pour la liste xml: aun fichier par courbe. - File fichierCourbes=new File(directoryPath_+File.separator+COURBEDIRECTORY); + File fichierCourbes=getDirectoryCurves(); if(fichierCourbes.mkdir()){ StreamStrategy strategy = new FileStreamStrategy(fichierCourbes); // creates the list of curves: - List<EGCourbePersist> list = new XmlArrayList(strategy); - - + List<EGCourbePersist> list = getPersitantCurvesList(); + List<EGGroupPersist> listeGroupePersistance=new ArrayList<EGGroupPersist>(grapheTopersist.getModel().getNbEGObject()); + for(int i=0;i<grapheTopersist.getModel().getNbEGObject();i++){ - EGObject objet=grapheTopersist.getModel().getEGObject(i); - if(objet instanceof EGGroup){ EGGroup groupe=(EGGroup) objet; - out.writeObject(new EGGroupPersist(groupe)); - + listeGroupePersistance.add(new EGGroupPersist(groupe)); for(int k=0;k<groupe.getEGChilds().length;k++){ - if(groupe.getEGChilds()[k] instanceof EGCourbe){ + if(groupe.getEGChilds()[k] instanceof EGCourbeChild){ //-- ajout de la courbe persitante dans un fichier avec pour groupee le i eme - list.add(new EGCourbePersist((EGCourbe) groupe.getEGChilds()[k],i)); + list.add(new EGCourbePersist((EGCourbeChild) groupe.getEGChilds()[k],i)); } } }else - if(objet instanceof EGCourbe){ + if(objet instanceof EGCourbeChild){ //le groupe d appartenance est -1 - list.add(new EGCourbePersist((EGCourbe) objet,-1)); + list.add(new EGCourbePersist((EGCourbeChild) objet,-1)); } } + + //--on enregistre des infos bidons pour l'utilisateur --// + String nbCurves="Nombre courbes: "+grapheTopersist.getModel().getCourbes().length; + out.writeObject(nbCurves); + String minMAx="MinX: "+grapheTopersist.getXMin()+" MaxX: "+grapheTopersist.getXMax(); + out.writeObject(minMAx); + //-- FIN BIDON --// + + //--on enregistre l'axe des x --// + out.writeObject(new EGAxeHorizontalPersist(grapheTopersist.getModel().getAxeX())); + + //-- on enregistre le type de model du graphe --// + String model=grapheTopersist.getModel().getClass().toString(); + out.writeObject(model); + //--on ecrit le nombre de groupes --// + int nbGroups=listeGroupePersistance.size(); + out.writeInt(nbGroups); + //-- on ecrit la liste des groupes --// + for(EGGroupPersist gp:listeGroupePersistance){ + out.writeObject(gp); + } } out.close(); - } - public String getDirectoryPath_() { - return directoryPath_; + /** + * Genere une instance de model par rapport au model serializ\xE9. + * Renvoie forc\xE9ment une class implements EGGrapheTreeModel sinon null + * @param className + * @return + * @throws ClassNotFoundException + * @throws InstantiationException + * @throws IllegalAccessException + */ + public EGGrapheTreeModel generateModelInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException{ + if(className.startsWith("class ")); + className=className.substring("class ".length()); + Class myclass =Class.forName(className, true, Thread.currentThread(). + getContextClassLoader()); + Object myModel=myclass.newInstance(); + if(myModel instanceof EGGrapheTreeModel) + return (EGGrapheTreeModel)myModel; + return null; + } - - public void setDirectoryPath_(String directoryPath_) { - this.directoryPath_ = directoryPath_; + + + /** + * Methode qui genere le eggraphe a partir des donn\xE9es persistantes. + * @return + * @throws IOException + * @throws FileNotFoundException + * @throws ClassNotFoundException + * @throws IllegalAccessException + * @throws InstantiationException + */ + public EGGraphe loadPersitGrapheXml() throws FileNotFoundException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException{ + EGGraphe graphe=null; + String mainfile=getMainFilePath(); + File fichierCourbes=getDirectoryCurves(); + if(fichierCourbes.isDirectory()){ + //-- outputstream du xstream pour chargement des diff\xE9rents groupes--// + ObjectInputStream in = getParser().createObjectInputStream(new FileReader(mainfile)); + //--lecture biddon --// + in.readObject(); + in.readObject(); + + //- Etape 1: lecture de l'axe --// + EGAxeHorizontal axeX= ((EGAxeHorizontalPersist)in.readObject()).generateAxe(); + + //- Etape 2: lecture du modele --// + String modelName=(String) in.readObject(); + EGGrapheTreeModel model= generateModelInstance(modelName); + model.setAxeX(axeX); + + //-- Etape 3: on ajoute tous nos amis les groupes --// + int nbGroups=in.readInt(); + for(int i=0;i<nbGroups;i++){ + //-- lecture du groupe --// + EGGroup newGroup=((EGGroupPersist)in.readObject()).generateGroupe(); + //ajout du groupe + model.add(newGroup); + } + //-- Etape 4: lecture des courbes --// + // get the persitant list of curves: + List<EGCourbePersist> listeCourbesPersistantes = getPersitantCurvesList(); + for(EGCourbePersist cbPersist:listeCourbesPersistantes){ + EGGroup container=model.getGroup(cbPersist.Idgroup); + EGCourbeChild newCurve=cbPersist.generateCourbe(container); + container.addEGComponent(newCurve); + } + + in.close(); + + //-- Etape finale: creation du graphe --// + graphe=new EGGraphe(model); + graphe.transformer_.setXAxe(axeX); + //ajustement des courbes en fonction du groupe 0 + for(int t=0;t<nbGroups;t++) + graphe.setZoomAdaptedFor(model.getGroup(t)); + //mise a jour des b\xE9b\xE9s + model.fireStructureChanged(); + } + return graphe; } + + + - public EGGraphe getGrapheTopersist() { - return grapheTopersist; - } - public void setGrapheTopersist(EGGraphe grapheTopersist) { - this.grapheTopersist = grapheTopersist; - } - - } 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 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -206,9 +206,9 @@ } } - static class GrapheTreeNode implements Icon, EGParent.TreeNodes { + public static class GrapheTreeNode implements Icon, EGParent.TreeNodes { - List components_ = new ArrayList(); + public List components_ = new ArrayList(); EGParent.Tree dispatcher_; public GrapheTreeNode() { @@ -223,7 +223,7 @@ return dispatcher_; } - protected EGGroup getGroup(final int _i) { + public EGGroup getGroup(final int _i) { return (EGGroup) components_.get(_i); } @@ -1116,4 +1116,12 @@ return duplic; } +public TreeSelectionModel getSelectionModel_() { + return selectionModel_; +} + +public void setSelectionModel_(TreeSelectionModel selectionModel_) { + this.selectionModel_ = selectionModel_; +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -9,11 +9,11 @@ */ public class EGGroupPersist { - String title_; - EGAxeHorizontalPersist axeX; + String title; + EGAxeVerticalPersist axeY; + boolean isVisible; - public EGGroupPersist(EGGroup group) { super(); fillInfoWith(group); @@ -21,11 +21,23 @@ } private void fillInfoWith(EGGroup groupe){ - title_=groupe.getTitle(); - axeX=new EGAxeHorizontalPersist(groupe.getAxeX()); + title=groupe.getTitle(); + axeY=new EGAxeVerticalPersist(groupe.getAxeY()); + isVisible=groupe.isVisible_; +} + +public EGGroup generateGroupe(){ + EGGroup groupe=new EGGroup(); + EGAxeVertical axe=axeY.generateAxe(); + groupe.setAxeY(axe); + //on ajuste l'axe par rapport au groupe pour que ce soit joli tout plein! + //axe.ajusteFor(groupe); + groupe.setTitle(title); + groupe.isVisible_=isVisible; + return groupe; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -11,6 +11,7 @@ import java.util.Set; import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.CtuluLibGenerator; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.image.CtuluImageProducer; import org.fudaa.ctulu.image.CtuluLibImage; @@ -31,7 +32,8 @@ int idx_ = 0; protected String generateId() { - return CtuluLibString.getString(idx_++); + // return CtuluLibString.getString(idx_++); + return CtuluLibGenerator.getInstance().deliverUniqueStringId(); } public EbliWidget findById(final String _id) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -243,6 +243,8 @@ */}; } + + public EbliWidgetController getController() { return controller_; } @@ -266,9 +268,12 @@ } /** + * Retourne systematiquement l id de la widget qui contient les infos. + * La bordure redirige son id, il n'est pas necessaire de retnir l id pour cette widget sans importance. * @return the idst */ public String getId() { + return id_; } @@ -491,12 +496,33 @@ useBorder_ = _useBorder; } -public String getId_() { - return id_; -} + public void setId_(String id_) { this.id_ = id_; } + +/** + * Methode qui retourne vrai si la widget est group\xE9e. + * @return + */ +public boolean isGrouped(){ + + if(this.getParentBordure().getParentWidget() instanceof EbliWidgetGroup) + return true; + return false; +} + +/** + * Renvoie l'id du group ou l'id NOGROUP si la widget ne fais pas partie d un groupe. + * @return + */ +public String getIdOfGroup(){ + if(isGrouped()) + return ((EbliWidget)this.getParentBordure().getParentWidget()).getId(); + else return EbliWidgetGroup.NOGROUP; +} + + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -35,6 +35,13 @@ return getIntern().getAnimatedInterface(); } + public String getId() { + + return intern_.getId(); + } + public void setId_(String id_) { + intern_.setId_(id_); + } public EbliWidget getParentBordure(){ return this; Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroup.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroup.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroup.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -0,0 +1,18 @@ +package org.fudaa.ebli.visuallibrary; + + +/** + * Widget qui a pour but de grouper plusieurs sous widget. + * @author Adrien Hadoux + * + */ +public class EbliWidgetGroup extends EbliWidget{ + + public final static String NOGROUP="N/A"; + + public EbliWidgetGroup(EbliScene scene) { + super(scene); + // TODO Auto-generated constructor stub + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -23,6 +23,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerForGroup; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetGroupCreator; import org.fudaa.ebli.visuallibrary.layout.GroupLayout; import org.netbeans.api.visual.widget.Widget; @@ -42,7 +43,18 @@ public void actionPerformed(ActionEvent e) { final Set selectedObjects = new HashSet(scene_.getSelectedObjects()); if (!selectedObjects.isEmpty()) { - final EbliNode n = groupWidgets(selectedObjects); + performGroup(selectedObjects); + } + + } + + /** + * Methode qui realise le groupage des ebliNodes. + * @param _selectedObjects + * @return + */ + public EbliNode performGroup(final Set _selectedObjects){ + final EbliNode n = groupWidgets(_selectedObjects); getScene().getCmdMng().addCmd(new CtuluCommand() { public void undo() { @@ -51,15 +63,14 @@ } public void redo() { - groupWidgets(selectedObjects); + groupWidgets(_selectedObjects); } }); - } - + return n; } private EbliNode groupWidgets(final Set _selectedObjects) { - EbliWidget parent = new EbliWidget(scene_); + EbliWidgetGroup parent = new EbliWidgetGroup(scene_); // parent.setController(new EbliWidgetControllerMenuOnly(parent)); parent.setLayout(new GroupLayout()); Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -97,7 +97,7 @@ try { String path=(String)parameters.get("path"); if(path !=null){ - File contenu=new File(path+File.separator+"contenu"+(Idcontenu++)+".html"); + File contenu=new File(path+File.separator+"contenu"+parameters.get("nodeName")+getWidget().getId()+".html"); writer = new FileWriter(contenu); writer.write(editorPane_.getDocumentText()); writer.close(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -2,6 +2,7 @@ import java.awt.Point; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.Map; @@ -21,6 +22,9 @@ import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; +import com.hexidec.ekit.FudaaAlignAction; +import com.memoire.fu.FuLib; + /** * interface qui permet de creer un widget * @@ -113,13 +117,13 @@ public Object getPersistData(Map parameters) { // TODO Auto-generated method stub //-- generation d'un identifiant unique pour le repertoire du graphe --// - String pathUnique=parameters.get("path")+File.separator+"Graph"+res.getIntern().getId(); + String pathUnique=parameters.get("pathGraphes")+File.separator+FuLib.clean(File.separator+parameters.get("nodeName"))+res.getIntern().getId(); //- sauvegarde du contenu de l eggraphe dans un repertoire a part --// try { File createRep=new File(pathUnique); if( createRep.mkdir()) - new EGGraphePersist(pathUnique,getGraphe(),parameters); + new EGGraphePersist(pathUnique,parameters).savePersitGrapheXml(getGraphe()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -134,9 +138,29 @@ EGGrapheModel modele; if(data==null) modele=new EGGrapheTreeModel(); - else - modele=(EGGrapheModel) data; - pn_=new EGFillePanel(new EGGraphe(modele)); + else{ + String pathGraphe=(String) data; + + try { + pn_=new EGFillePanel(new EGGraphePersist(pathGraphe,parameters).loadPersitGrapheXml()); + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InstantiationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -4,7 +4,12 @@ import java.awt.Dimension; import java.awt.Point; +import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetFusionCalques; import com.sun.j3d.loaders.vrml97.impl.Background; @@ -40,7 +45,7 @@ private void fillInfoWith(EbliScene scene,String title,Dimension dimensionFrame,Point location){ this.title=title; this.background=(Color) scene.getBackground(); - this.nbFrames=scene.getObjects().size(); + this.nbFrames=countFrameToSave(scene); if(scene.getView() !=null){ this.width=dimensionFrame.width; this.height=dimensionFrame.height; @@ -49,6 +54,16 @@ } } +private int countFrameToSave(EbliScene scene){ + int cpt=0; + for(Object node:scene.getObjects()){ + if(node instanceof EbliNode){ + if(!(((EbliNode)node).getWidget() instanceof EbliWidgetGroup) && !(((EbliNode)node).getWidget() instanceof EbliWidgetFusionCalques)) + cpt++; + } + } +return cpt; +} /** * Methode qui configurer la scene avec les infos r\xE9cup\xE9r\xE9es Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -8,12 +8,14 @@ import javax.swing.UIManager; +import org.fudaa.ctulu.CtuluLibGenerator; import org.fudaa.ebli.trace.TraceLigneModel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorClassLoader; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape; @@ -27,6 +29,8 @@ */ public class EbliWidgetSerializeXml { + + /** * Important: l'id de la widget pour avoir des references . */ @@ -64,6 +68,11 @@ boolean isSelected; + /** + * L'id de la widget groupe si il y a lieu. + */ + String IdGroup=EbliWidgetGroup.NOGROUP; + //-- datas : objet g\xE9r\xE9 par le creator, inconnu pour cette classe --// Object data; @@ -87,17 +96,17 @@ this.Id=widget.getId(); this.title = node.getTitle(); this.type = node.getCreator().getClass().toString(); - if(widget.getColorFond() !=null) - this.bacckground = node.getWidget().getColorFond(); - if(widget.getColorContour() !=null) - this.foreground = widget.getColorContour(); - if(widget.getFormeFont() !=null) - this.font = widget.getFormeFont(); - this.rotation = widget.getRotation(); - if(widget.getTraceLigneModel()!=null){ - this.epaisseurTrait = widget.getTraceLigneModel().getEpaisseur(); - this.typeTrait = widget.getTraceLigneModel().getTypeTrait(); - this.colorModel=widget.getTraceLigneModel().getCouleur(); + if(widget.getParentBordure().getColorFond() !=null) + this.bacckground = node.getWidget().getParentBordure().getColorFond(); + if(widget.getParentBordure().getColorContour() !=null) + this.foreground = widget.getParentBordure().getColorContour(); + if(widget.getParentBordure().getFormeFont() !=null) + this.font = widget.getParentBordure().getFormeFont(); + this.rotation = widget.getParentBordure().getRotation(); + if(widget.getParentBordure().getTraceLigneModel()!=null){ + this.epaisseurTrait = widget.getParentBordure().getTraceLigneModel().getEpaisseur(); + this.typeTrait = widget.getParentBordure().getTraceLigneModel().getTypeTrait(); + this.colorModel=widget.getParentBordure().getTraceLigneModel().getCouleur(); } @@ -121,9 +130,11 @@ this.isVisible=widget.getParentBordure().isVisible(); this.isSelected=widget.getEbliScene().getSelectedObjects().contains(node); + this.IdGroup=widget.getIdOfGroup(); + - //-- datas --// + parameters.put("nodeName", node.getTitle()); this.data=node.getCreator().getPersistData(parameters); } @@ -157,9 +168,14 @@ //-- ajout du node dans la scene --// scene.addNode(newNode); + + //-- recuperation du precedent Id, tres important poru les references --// + CtuluLibGenerator.getInstance().removeConstraint(newNode.getWidget().getId()); newNode.getWidget().setId_(this.Id); + CtuluLibGenerator.getInstance().addConstraint(this.Id); + //--remplissage des proprietes graphiques --// newNode.getWidget().setColorFond(bacckground); newNode.getWidget().setFormeFont(font); @@ -317,6 +333,14 @@ Id = id; } + public String getIdGroup() { + return IdGroup; + } + public void setIdGroup(String idGroup) { + IdGroup = idGroup; + } + + } 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 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -43,15 +43,19 @@ 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; import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGObject; +import org.fudaa.ebli.courbe.EGGrapheTreeModel.GrapheTreeNode; import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; +import org.fudaa.fudaa.tr.post.TrPostCourbeTreeModel; import com.memoire.bu.BuLib; import com.memoire.bu.BuResource; @@ -72,7 +76,7 @@ final EfLineIntersectionsCorrectionTester tester_; - public final MvProfileTarget target_; + public MvProfileTarget target_; public MvProfileTreeModel(final MvProfileTarget _target, final EfLineIntersectionsCorrectionTester _tester) { super(); @@ -87,7 +91,16 @@ tester_ = _model.tester_; target_ = _model.target_; } + + /** + * ACHTUNG! Constructuer uniquement utilis\xE9 pour la serialization des graphes!! + * Il faut imp\xE9rativement initialiser la variable target_ avec un ProfilDapter apres coup avec le trpostsource qui convient */ + public MvProfileTreeModel(){ + tester_=new MvProfileCoteTester(); + + } + public void setNodesResults(final EfLineIntersectionsResultsMng _resNode, EfLineIntersectionsResultsBuilder _builderNode) { resNode_ = _resNode; @@ -636,9 +649,34 @@ } +public EGGrapheModel duplicate(EGGrapheDuplicator _duplicator) { + MvProfileTreeModel duplic = new MvProfileTreeModel(); + duplic.setAxeX(this.getAxeX().duplicate()); + + duplic.getSelectionModel().setSelectionMode(this.getSelectionModel().getSelectionMode()); + + GrapheTreeNode root=this.getGrapheTreeNode(); + GrapheTreeNode rootDuplique=duplic.getGrapheTreeNode(); + + for (int i = 0; i < root.components_.size(); i++) { + + // -- ajout du groupe duplique --// + duplic.add(root.getGroup(i).duplicate(_duplicator)); + + } + + + return duplic; + } + + @Override public boolean isSpatial() { // TODO Auto-generated method stub return true; } + +public void setTarget_(MvProfileTarget target_) { + this.target_ = target_; } +} 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-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -36,8 +36,10 @@ import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; import org.fudaa.ebli.courbe.EGGrapheDuplicator; +import org.fudaa.ebli.courbe.EGGrapheModel; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.courbe.EGGrapheTreeModel.GrapheTreeNode; import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; @@ -873,5 +875,25 @@ fireCourbeContentChanged(null); // } } + + public EGGrapheModel duplicate(EGGrapheDuplicator _duplicator) { + TrPostCourbeTreeModel duplic = new TrPostCourbeTreeModel(); + duplic.setAxeX(this.getAxeX().duplicate()); + + duplic.getSelectionModel().setSelectionMode(this.getSelectionModel().getSelectionMode()); + + GrapheTreeNode root=this.getGrapheTreeNode(); + GrapheTreeNode rootDuplique=duplic.getGrapheTreeNode(); + + for (int i = 0; i < root.components_.size(); i++) { + // -- ajout du groupe duplique --// + duplic.add(root.getGroup(i).duplicate(_duplicator)); + + } + + + return duplic; + } + } 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-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -582,6 +582,7 @@ } //-- ajout de l'importation dans les courbes de l'action --// + //if( creator.getGraphe().getModel() instanceof Target) listeActions.add( new TrPostWizardImportScope.ImportAction(projet_,(Target) creator.getGraphe().getModel())); //--ajout des actions import export format scope --// 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-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -27,7 +27,9 @@ import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetGroupAction; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.ebli.visuallibrary.persist.EbliSceneSerializeXml; import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml; @@ -43,6 +45,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.memoire.fu.FuLog; import com.sun.org.apache.xml.internal.serialize.OutputFormat; import com.sun.org.apache.xml.internal.serialize.XMLSerializer; import com.thoughtworks.xstream.XStream; @@ -336,23 +339,43 @@ * @return */ public boolean saveProject() { + HashMap<String, Object> parametres=new HashMap<String, Object>(); try { progression("Cr\xE9ation du r\xE9pertoire", 10); // -- etape 1 creation du repertoire global --// if (savePersistDirectory()) { + + File file; - // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts + // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts progression("Cr\xE9ation du fichier descripteur de sources", 15); file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSOURCE); saveSource(file); - + //-- etape 2.5: creation du repertoire des graphe et calques --// + String pathGraphes=projet_.getAbsolutePath() + File.separator +"Graphes"; + try{ + new File(pathGraphes).mkdir(); + }catch(Exception e){ + //pas grave on continue + FuLog.debug("Le repertoire des graphes existe deja"); + } + String pathCalques=projet_.getAbsolutePath() + File.separator +"Calques"; + try{ + new File(pathCalques).mkdir(); + }catch(Exception e){ + //pas grave on continue + FuLog.debug("Le repertoire des calques existe deja"); + } + // -- etape 3 sauvegarde des ebliscene unitairement --// progression("Cr\xE9ation des fichiers layout", 20); + //-- creation des params pour les datas --// - HashMap<String, Object> parametres=new HashMap<String, Object>(); parametres.put("path", projet_.getAbsolutePath()); - + parametres.put("pathGraphes",pathGraphes); + parametres.put("pathCalques",pathCalques); + int cpt = 1; List<TrPostLayoutFille> listFilles=trprojet_.impl_.getAllLayoutFille(); for(TrPostLayoutFille fille:listFilles){ @@ -496,15 +519,40 @@ //-- g\xE9n\xE9ration du xml pour les eblinode/widgets --// //-- ACHTUNG!!! IL FAUT RECUPERER LES OBJETS VIA CHILDREN POUR PRESERVER L ORDRE DE SUPERPOSITION!!! --// Iterator<Widget> it= scene.getLayerVisu().getChildren().iterator(); + + //-- creation d une liste particuliere pour les groupes--// + List<EbliWidgetSerializeXml> listeGroupes=new ArrayList<EbliWidgetSerializeXml>(); + while(it.hasNext()){ Widget widget=it.next(); + EbliNode nodeGroupe=(EbliNode) scene.findObject(widget); + //ecriture de l objet + if(nodeGroupe !=null) + listeGroupes.add(new EbliWidgetSerializeXml(nodeGroupe,parametres)); + + if(widget instanceof EbliWidgetGroup){ + //-- cas widget group, il faut recuper ses child car on se fout du groupe --// + for(Widget child:widget.getChildren()) { + EbliNode node=(EbliNode) scene.findObject(child); + //ecriture de l objet + if(node !=null) + out.writeObject(new EbliWidgetSerializeXml(node,parametres)); + } + + }else{ EbliNode node=(EbliNode) scene.findObject(widget); //ecriture de l objet if(node !=null) out.writeObject(new EbliWidgetSerializeXml(node,parametres)); + } + } + //-- ecriture des groupes --// + out.writeInt(listeGroupes.size()); + for(EbliWidgetSerializeXml serializeGroupe:listeGroupes){ + out.writeObject(serializeGroupe); } - + out.close(); @@ -523,9 +571,7 @@ * @throws InstantiationException */ private void loadPersitSceneXml(File file, TrPostLayoutFille fille, Map parametres) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException{ -// //-- creation des params pour les datas --// -// HashMap<String, Object> parametres=new HashMap<String, Object>(); -// parametres.put("path", file.getAbsolutePath()); + EbliScene scenToUpdate=fille.getScene(); parametres.put("scene",scenToUpdate); @@ -546,22 +592,67 @@ //-- preparation de la liste de selection des frames dans le layout --// final Set<Object> listeNodeSelect = new HashSet<Object>(); + //-- preparation d'une structure interm\xE9diaire pour optimiser --// + //-- la complexit\xE9 de calcul des groupes (passer en complexit\xE9 lin\xE9aire) --// + HashMap<String, HashSet<Object>> listeGroupToPerform=new HashMap<String, HashSet<Object>>(); + //-- r\xE9cup\xE9ration via xml des eblinode/widgets --// for(int i=0;i<sceneXml.getNbFrames();i++){ - + //lecture xml de l objet EbliWidgetSerializeXml widgetXml = (EbliWidgetSerializeXml)in.readObject(); //generation de la widget dans la scene EbliNode node=widgetXml.generateWidgetInScene(parametres, scenToUpdate); + //ajout des noeuds a ajouter dans la selection if(widgetXml.isSelected()) listeNodeSelect.add(node); + + //ajout de la creation d'un groupe + if(!widgetXml.getIdGroup().equals(EbliWidgetGroup.NOGROUP)){ + //il y a un group a prendre en compte d'id + String idGroup=widgetXml.getIdGroup(); + if(listeGroupToPerform.get(idGroup)==null){ + //on init + listeGroupToPerform.put(idGroup, new HashSet<Object>()); + } + //on ajoute l'objet node pour la widget + listeGroupToPerform.get(idGroup).add(node); + } + + } + + //-- lecture des groupes --// + //-- ecriture des groupes --// + int nbGroups=in.readInt(); + HashMap<String,EbliWidgetSerializeXml> listeGroupes=new HashMap<String,EbliWidgetSerializeXml>(); + + for( int i=0;i<nbGroups;i++){ + EbliWidgetSerializeXml group=(EbliWidgetSerializeXml) in.readObject(); + listeGroupes.put(group.getId(),group); } - + + in.close(); - + scenToUpdate.refresh(); + //-- on s'occupe de grouper l'ensemble des widgets --// + for(String idGroup:listeGroupToPerform.keySet()){ + //--l'idGroup est jetable, on ne le sauvegarde pas --// + HashSet<Object> listeToGroup=listeGroupToPerform.get(idGroup); + EbliNode nodeGroup=new EbliWidgetGroupAction(scenToUpdate).performGroup(listeToGroup); + + //-- on met a jour le ebliNode avec les infos du groupe sauv\xE9 --// + EbliWidgetSerializeXml infoGroup=listeGroupes.get(idGroup); + if(infoGroup!=null){ + nodeGroup.setTitle(infoGroup.getTitle()); + nodeGroup.getWidget().setPreferredLocation(new Point(infoGroup.getX(),infoGroup.getY())); + nodeGroup.getWidget().setPreferredSize(new Dimension(infoGroup.getWidth(),infoGroup.getHeight())); + + + } + } //-- on ajoute les noeuds selectionnes a ebliScene --// scenToUpdate.setSelectedObjects(listeNodeSelect); // mise a jour de la scene This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-13 08:19:40
|
Revision: 4055 http://fudaa.svn.sourceforge.net/fudaa/?rev=4055&view=rev Author: hadouxad Date: 2008-10-13 08:15:09 +0000 (Mon, 13 Oct 2008) Log Message: ----------- MAJ Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java 2008-10-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -24,7 +24,7 @@ /** * Tous les nombres seront inf\xE9rieurs a Max-1 */ - private static long MAX=65535; + private long max=65535; /** * Pour avoir toujours la meme sequence, il suffit de mettre le mode debug a true, @@ -80,7 +80,7 @@ public long useCongruenceLineaireGenerateur(){ - old= (a_*old + c_)% MAX; + old= (a_*old + c_)% max; return old; } @@ -100,13 +100,19 @@ * @return */ public long deliverUniqueId(){ + int nbTentatives=0; Long id; do{ + nbTentatives++; + if(nbTentatives>max-1){ + clear(); + } + id=new Long(useCongruenceLineaireGenerateur()); } while(constraints_.contains(id)); addConstraint(id); - FuLog.warning("Generation ID="+id); + return id; } @@ -144,4 +150,12 @@ long val=Long.parseLong(value); constraints_.remove(new Long(val)); } + + public long getMax() { + return max; + } + + public void setMax(long max) { + this.max = max; + } } Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -0,0 +1,95 @@ +package org.fudaa.ctulu; + +import java.io.File; +/** + * Classe qui permet de faire le m\xE9nage dans un repertoire. + * On fournit le repertoire cible. + * le thread supprime le contenu du repertoire (tous les fichiers du repertoire.) + * @author Adrien Hadoux + * + */ +public class CtuluRemoveContentDirectory { + + + public File[] listing; + + public File Finit; + + /** + * Methode statique a appeler pour effacer recursivemetn le contenu d un repertoire + * @param file + */ + public static void contentDirectoryRemover(File file){ + new CtuluRemoveContentDirectory (file).demarrerSupression(); + } + + + public CtuluRemoveContentDirectory(File Finit) { + // on recupere le parametre + this.Finit = Finit; + + } + + + + + public void demarrerSupression() { + // on verifie si c'est un repertoire ..... + if (Finit.isDirectory()) { + // si s'en est un on liste son contenu + listing = Finit.listFiles(); + + + // tant qu'il y a des sous repertoires .... + while (listing.length > 0) { + // poiur chaque sous repertoire ... + for (int i = 0; i < listing.length; i++) { + // ...on verifie si c'est des fichier ... + if (listing[i].isFile()) { + // ... si ca en est on les supprime + boolean b = listing[i].delete(); + // on verifie si tout c'est bien passe + System.out.println("suppession de :" + listing[i] + ":" + + b); + } + // si c'est un repertoire on demare une methode... +// else{ +// // on demare la methode +// removeDirectoryContentRecursivly(listing[i]); +// } + } + } + + } + + + } + + + + private void removeDirectoryContentRecursivly(File ToDel) { + + File[] listing2 = ToDel.listFiles(); + + if(listing2==null || listing2.length==0) + return; + for (int i= 0;i<listing2.length; i++) { + // ...verifie si c'est un fichier + if (listing2[i].isFile()) { + // on le supprime et on verifie que c'est bon + boolean b = listing2[i].delete(); + + } + // sinon c'est un repertoire + else { + // on applique de nouveau la methode sur le repertoire + removeDirectoryContentRecursivly(listing2[i]); + } + } + } + + + + + +} Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-10-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -563,10 +563,10 @@ List<Double> listeX=getListValueForVariableForSeparator(getSeparator(separatorX), varX+1); List<Double> listeY=getListValueForVariableForSeparator(getSeparator(separatorY), varY+1); - double[] tabX = new double[listeX.size()]; - double[] tabY = new double[listeY.size()]; + double[] tabX = new double[Math.min(listeX.size(), listeY.size())]; + double[] tabY = new double[Math.min(listeX.size(), listeY.size())]; - for (int j = 0; j < listeX.size(); j++) { + for (int j = 0; j < Math.min(listeX.size(), listeY.size()); j++) { tabX[j] = listeX.get(j); tabY[j] = listeY.get(j); 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 2008-10-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -8,9 +8,11 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.Map; +import org.fudaa.ctulu.CtuluRemoveContentDirectory; import org.fudaa.ebli.visuallibrary.persist.EbliSceneSerializeXml; import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml; @@ -96,7 +98,16 @@ return new XmlArrayList( new FileStreamStrategy(getDirectoryCurves())); } + /** + * Methode qui nettoie le contenu des datas + */ + private void clearDatas(List<EGCourbePersist> list ){ + CtuluRemoveContentDirectory.contentDirectoryRemover(getDirectoryCurves()); + + } + + /** * Enrtegistre le graphe au format persistant xml. * @param parameters des parametres supplementaires utiles. * @throws IOException @@ -108,13 +119,14 @@ //-- enregistrement des courbes --// // strategy pour la liste xml: aun fichier par courbe. File fichierCourbes=getDirectoryCurves(); - if(fichierCourbes.mkdir()){ - StreamStrategy strategy = new FileStreamStrategy(fichierCourbes); + if(fichierCourbes.mkdir() || fichierCourbes.isDirectory() ){ + //StreamStrategy strategy = new FileStreamStrategy(fichierCourbes); // creates the list of curves: - List<EGCourbePersist> list = getPersitantCurvesList(); + List<EGCourbePersist> list = new ArrayList<EGCourbePersist>(); + clearDatas(list); List<EGGroupPersist> listeGroupePersistance=new ArrayList<EGGroupPersist>(grapheTopersist.getModel().getNbEGObject()); - - for(int i=0;i<grapheTopersist.getModel().getNbEGObject();i++){ + int nbEgObjects=grapheTopersist.getModel().getNbEGObject(); + for(int i=0;i<nbEgObjects;i++){ EGObject objet=grapheTopersist.getModel().getEGObject(i); if(objet instanceof EGGroup){ EGGroup groupe=(EGGroup) objet; @@ -131,7 +143,8 @@ list.add(new EGCourbePersist((EGCourbeChild) objet,-1)); } } - + List<EGCourbePersist> listPersitante = getPersitantCurvesList(); + listPersitante.addAll(list); //--on enregistre des infos bidons pour l'utilisateur --// String nbCurves="Nombre courbes: "+grapheTopersist.getModel().getCourbes().length; out.writeObject(nbCurves); Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java 2008-10-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -1,13 +0,0 @@ -package org.fudaa.ebli.courbe; - - -/** - * Classe qui r\xE9cup\xE8re les donn\xE9es courbes d'un graphe et enregistre les parametres - * @author Adrien Hadoux - * - */ -public class GraphePersist { - - - -} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-10-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -306,5 +306,24 @@ public EbliWidgetJXTreeTableModel getTreeModel() { return treeModel_; } - + + /** + * Methode qui retourne l'ebliNode correspondant a l id de widget. + * Retourne null sinon. + * @param id + * @return + */ + public EbliNode findByWidgetId(String id) + { + + for(Object objet:this.getObjects()){ + if(objet instanceof EbliNode){ + EbliNode cible=(EbliNode)objet; + if(cible.getWidget().getId().equals(id)) + return cible; + } + } + return null; + + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -25,6 +25,8 @@ import org.netbeans.api.visual.model.ObjectState; import org.netbeans.api.visual.widget.Widget; +import com.memoire.fu.FuLog; + /** * Widget version EBLI * @@ -70,6 +72,7 @@ public EbliWidget(final EbliScene scene) { super(scene); id_ = scene.generateId(); + FuLog.warning("Generation frame ID="+id_); setScene(scene); // -- remplisage de la map de propriete grahiques --// Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -20,6 +20,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; +import org.fudaa.ebli.visuallibrary.persist.ManagerWidgetPersist; import org.w3c.dom.Element; import com.hexidec.ekit.FudaaAlignAction; @@ -117,12 +118,12 @@ public Object getPersistData(Map parameters) { // TODO Auto-generated method stub //-- generation d'un identifiant unique pour le repertoire du graphe --// - String pathUnique=parameters.get("pathGraphes")+File.separator+FuLib.clean(File.separator+parameters.get("nodeName"))+res.getIntern().getId(); - + // String pathUnique=parameters.get("pathGraphes")+File.separator+FuLib.clean(File.separator+parameters.get("nodeName"))+res.getIntern().getId(); + String pathUnique=ManagerWidgetPersist.generateGraphPath((String)parameters.get("pathGraphes"), res.getEbliScene().findByWidgetId(res.getId())); //- sauvegarde du contenu de l eggraphe dans un repertoire a part --// try { File createRep=new File(pathUnique); - if( createRep.mkdir()) + if( createRep.mkdir() || createRep.isDirectory()) new EGGraphePersist(pathUnique,parameters).savePersitGrapheXml(getGraphe()); } catch (IOException e) { // TODO Auto-generated catch block Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -13,6 +13,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerCalque; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; +import org.fudaa.ebli.visuallibrary.persist.ManagerWidgetPersist; import org.netbeans.api.visual.widget.Widget; import org.w3c.dom.Element; @@ -21,11 +22,11 @@ EGGraphe g; // EbliWidget res; EbliWidgetWithBordure res; - private String IdPossessor_; + private String idPossessor_; public EbliWidgetCreatorLegende(EGGraphe g,String id) { super(); this.g = g; - IdPossessor_=id; + idPossessor_=id; } public EbliWidgetCreatorLegende(){ @@ -61,7 +62,8 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return IdPossessor_; + + return idPossessor_; } @@ -69,26 +71,45 @@ // TODO Auto-generated method stub if(data==null) g=new EGGraphe(new EGGrapheTreeModel()); +// else{ +// String idGraphe=(String) data; +// +// EbliScene scene=(EbliScene) parameters.get("scene"); +// //-- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --// +// for(Widget widget: scene.getLayerVisu().getChildren()){ +// EbliWidget candidat=null; +// if(widget instanceof EbliWidgetBordureSingle) +// candidat=((EbliWidgetBordureSingle) widget).getIntern(); +// else +// candidat=(EbliWidget) widget; +// +// if(candidat.getId().equals(idGraphe)){ +// //--on a le bon, on rejoue la legende --// +// ((EbliWidgetControllerGraphe)candidat.getController()).ajoutLegende(); +// return; +// } +// } +// } else{ - String idGraphe=(String) data; - - EbliScene scene=(EbliScene) parameters.get("scene"); - //-- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --// - for(Widget widget: scene.getLayerVisu().getChildren()){ - EbliWidget candidat=null; - if(widget instanceof EbliWidgetBordureSingle) - candidat=((EbliWidgetBordureSingle) widget).getIntern(); + //--recuperation de l'id du graphe parent--// + if(data instanceof String){ + idPossessor_=(String) data; + + //-- recuperation du node graphe--// + EbliNode nodeGraphe=((EbliScene) parameters.get("scene")).findByWidgetId(idPossessor_); + + if(nodeGraphe!=null && nodeGraphe.getCreator() instanceof EbliWidgetControllerGraphe){ + //-- on recupere le graphe --// + g=((EbliWidgetControllerGraphe)nodeGraphe.getCreator()).getGraphe(); + } else - candidat=(EbliWidget) widget; + g=new EGGraphe(new EGGrapheTreeModel()); - if(candidat.getId().equals(idGraphe)){ - //--on a le bon, on rejoue la legende --// - ((EbliWidgetControllerGraphe)candidat.getController()).ajoutLegende(); - return; - } + } + else + g=new EGGraphe(new EGGrapheTreeModel()); } - } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -18,10 +18,12 @@ import org.fudaa.ctulu.gui.CtuluFileChooser; import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; import com.sun.org.apache.xml.internal.serialize.OutputFormat; import com.sun.org.apache.xml.internal.serialize.XMLSerializer; @@ -36,68 +38,22 @@ public class ManagerWidgetPersist { - - - - public ManagerWidgetPersist() { - super(); - + /** + * Methode qui genere le path vers le graphe. + * + * @return + */ + public static String generateGraphPath(String path, EbliNode nodeGraphe){ + + return path+File.separator+File.separator+FuLib.clean(nodeGraphe.getTitle())+nodeGraphe.getWidget().getId(); + } - - - - /** - * Fichier qui cree le fichier qui indique les diff\xE9rents fichiers layout a - * lire. Cela permettra pour la lecture de proposer de charger ou non certains - * layout - * - * @return - */ - public static Document createDescriptorScenes(Document document, ArrayList<String> titles,String path, String baliseScene, String descriptorScene,String extension, String attribute) { - // creation du root - Element rootEle = document.createElement(baliseScene); - document.appendChild(rootEle); - // On cree des objets sans contenus qui decrivent simplement les fichiers - // scenes - Iterator<String> it = titles.iterator(); - int cpt = 1; - while (it.hasNext()) { - it.next(); - // contient le path absolu vers le fichier qui decrit le layout - rootEle.setAttribute(attribute+cpt, path + File.separator + descriptorScene + (cpt++) - + extension); -// Element sceneEle = document.createElement(path + File.separator + descriptorScene + cpt -// + extension); -// rootEle.appendChild(sceneEle); - } - return document; - } - + - /** - * Genere un document type dom - * - * @return Document - */ - public static Document createDocument() { - // get an instance of factory - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - try { - // get an instance of builder - DocumentBuilder db = dbf.newDocumentBuilder(); - // create an instance of DOM - Document dom = db.newDocument(); - return dom; - } catch (ParserConfigurationException pce) { - FuLog.debug("Error while trying to instantiate DocumentBuilder " + pce); - return null; - } - } - } 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-12 14:20:03 UTC (rev 4054) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-13 08:15:09 UTC (rev 4055) @@ -387,6 +387,7 @@ //-- sauvegarde du persitant --// parametres.put("dimensions", fille.getSize()); parametres.put("location", fille.getLocation()); + parametres.put("scene", scene); savePersitSceneXml(scene,title,file,parametres); cpt++; @@ -525,14 +526,16 @@ while(it.hasNext()){ Widget widget=it.next(); - EbliNode nodeGroupe=(EbliNode) scene.findObject(widget); - //ecriture de l objet - if(nodeGroupe !=null) - listeGroupes.add(new EbliWidgetSerializeXml(nodeGroupe,parametres)); + if(widget instanceof EbliWidgetGroup){ - //-- cas widget group, il faut recuper ses child car on se fout du groupe --// - for(Widget child:widget.getChildren()) { + //-- cas widget group, il faut recuper ses child --// + EbliNode nodeGroupe=(EbliNode) scene.findObject(widget); + //ecriture de l objet + if(nodeGroupe !=null) + listeGroupes.add(new EbliWidgetSerializeXml(nodeGroupe,parametres)); + + for(Widget child:widget.getChildren()) { EbliNode node=(EbliNode) scene.findObject(child); //ecriture de l objet if(node !=null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-13 17:18:26
|
Revision: 4056 http://fudaa.svn.sourceforge.net/fudaa/?rev=4056&view=rev Author: hadouxad Date: 2008-10-13 17:18:22 +0000 (Mon, 13 Oct 2008) Log Message: ----------- - Refactorisation des .close dans les finally - G?\195?\169rer la liste des noms des nodes dans un fichier a part (couples Id/nom tr?\195?\168s clair et facilement modifiable par un non informaticien) tous les noms de tous les nodes de tous les layout sont dans le meme fichier pour simplifier la recherche - Sauvegarde/chargement des variables user (modif des methodes savein de trpostuservar...) - Gestion des l?\195?\169gendes des graphes ok! recr?\195?\169e les bonens legendes avec els bonens modifs et bonens dimensions -G?\195?\169rer les ?\195?\169crasements de donn?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 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 2008-10-13 08:15:09 UTC (rev 4055) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-13 17:18:22 UTC (rev 4056) @@ -94,8 +94,11 @@ * Retourne la liste persistante des fichiers * @return */ - List<EGCourbePersist> getPersitantCurvesList(){ - return new XmlArrayList( new FileStreamStrategy(getDirectoryCurves())); + List<EGCourbePersist> getPersitantCurvesList(boolean init){ + List<EGCourbePersist> listPersitante=new XmlArrayList(new FileStreamStrategy(getDirectoryCurves())); + if(init) + clearDatas(listPersitante); + return listPersitante; } @@ -103,7 +106,11 @@ * Methode qui nettoie le contenu des datas */ private void clearDatas(List<EGCourbePersist> list ){ - CtuluRemoveContentDirectory.contentDirectoryRemover(getDirectoryCurves()); + //CtuluRemoveContentDirectory.contentDirectoryRemover(getDirectoryCurves()); + if(list==null) + return; + while(list.size()!=0) + list.remove(0); } @@ -122,8 +129,8 @@ if(fichierCourbes.mkdir() || fichierCourbes.isDirectory() ){ //StreamStrategy strategy = new FileStreamStrategy(fichierCourbes); // creates the list of curves: - List<EGCourbePersist> list = new ArrayList<EGCourbePersist>(); - clearDatas(list); + List<EGCourbePersist> listPersitante = getPersitantCurvesList(true); + List<EGGroupPersist> listeGroupePersistance=new ArrayList<EGGroupPersist>(grapheTopersist.getModel().getNbEGObject()); int nbEgObjects=grapheTopersist.getModel().getNbEGObject(); for(int i=0;i<nbEgObjects;i++){ @@ -134,17 +141,17 @@ for(int k=0;k<groupe.getEGChilds().length;k++){ if(groupe.getEGChilds()[k] instanceof EGCourbeChild){ //-- ajout de la courbe persitante dans un fichier avec pour groupee le i eme - list.add(new EGCourbePersist((EGCourbeChild) groupe.getEGChilds()[k],i)); + listPersitante.add(new EGCourbePersist((EGCourbeChild) groupe.getEGChilds()[k],i)); } } }else if(objet instanceof EGCourbeChild){ //le groupe d appartenance est -1 - list.add(new EGCourbePersist((EGCourbeChild) objet,-1)); + listPersitante.add(new EGCourbePersist((EGCourbeChild) objet,-1)); } } - List<EGCourbePersist> listPersitante = getPersitantCurvesList(); - listPersitante.addAll(list); + //List<EGCourbePersist> listPersitante = getPersitantCurvesList(); + //listPersitante.addAll(list); //--on enregistre des infos bidons pour l'utilisateur --// String nbCurves="Nombre courbes: "+grapheTopersist.getModel().getCourbes().length; out.writeObject(nbCurves); @@ -229,7 +236,7 @@ } //-- Etape 4: lecture des courbes --// // get the persitant list of curves: - List<EGCourbePersist> listeCourbesPersistantes = getPersitantCurvesList(); + List<EGCourbePersist> listeCourbesPersistantes = getPersitantCurvesList(false); for(EGCourbePersist cbPersist:listeCourbesPersistantes){ EGGroup container=model.getGroup(cbPersist.Idgroup); EGCourbeChild newCurve=cbPersist.generateCourbe(container); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-13 08:15:09 UTC (rev 4055) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-13 17:18:22 UTC (rev 4056) @@ -98,9 +98,9 @@ //-- recuperation du node graphe--// EbliNode nodeGraphe=((EbliScene) parameters.get("scene")).findByWidgetId(idPossessor_); - if(nodeGraphe!=null && nodeGraphe.getCreator() instanceof EbliWidgetControllerGraphe){ + if(nodeGraphe!=null && nodeGraphe.getCreator() instanceof EbliWidgetCreatorGraphe){ //-- on recupere le graphe --// - g=((EbliWidgetControllerGraphe)nodeGraphe.getCreator()).getGraphe(); + g=((EbliWidgetCreatorGraphe)nodeGraphe.getCreator()).getGraphe(); } else g=new EGGraphe(new EGGrapheTreeModel()); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-13 08:15:09 UTC (rev 4055) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-13 17:18:22 UTC (rev 4056) @@ -6,8 +6,6 @@ import java.awt.Point; import java.util.Map; -import javax.swing.UIManager; - import org.fudaa.ctulu.CtuluLibGenerator; import org.fudaa.ebli.trace.TraceLigneModel; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -18,9 +16,6 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorClassLoader; -import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape; -import org.netbeans.api.visual.widget.Widget; -import org.w3c.dom.Element; /** * Classe utilisation pour la serialization des donn\xE9es widget @@ -29,8 +24,19 @@ */ public class EbliWidgetSerializeXml { + public static class CoupleNomId { + public String id; + public String nom; + + public CoupleNomId(String _nom, String _id) { + super(); + nom = _nom; + id = _id; + } + + + } - /** * Important: l'id de la widget pour avoir des references . */ @@ -150,7 +156,7 @@ */ public EbliNode generateWidgetInScene(Map parameters, EbliScene scene) throws InstantiationException, IllegalAccessException, ClassNotFoundException{ EbliNode newNode=new EbliNodeDefault(); - newNode.setTitle(title); + newNode.setTitle((String) parameters.get("nodeName")); newNode.setPreferedLocation(new Point(x,y)); if(width>0 && height>0) newNode.setPreferedSize(new Dimension(width,height)); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java 2008-10-13 08:15:09 UTC (rev 4055) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java 2008-10-13 17:18:22 UTC (rev 4056) @@ -164,6 +164,71 @@ _db.commit(); } + /** + * Sauvegarde toutes les variabels du projet dans un objet TrPostUserVariableSaver + * @param _src + * @param _prog + * @return + */ + public static TrPostUserVariableSaver saveIn(final TrPostSourceAbstract _src,final ProgressionInterface _prog) { + if ( _src == null) { + return null; + } + + final TrPostUserVariableSaver save = new TrPostUserVariableSaver(); + save.g_ = _src.getGravity().getValue(); + + if (_src.varUserCreateData_ != null) { + final Map map = new HashMap(_src.varUserCreateData_); + // on enleve les variables import\xE9es + final Set varToRemove = new HashSet(); + for (final Iterator it = map.entrySet().iterator(); it.hasNext();) { + final Map.Entry e = (Map.Entry) it.next(); + final TrPostDataCreated created = (TrPostDataCreated) e.getValue(); + final H2dVariableType var = (H2dVariableTypeCreated) e.getKey(); + // pas de sauvegarde possible ou non basee sur une expression + if (!created.isExpr() && created.createSaver() == null) { + varToRemove.add(var); + varToRemove.addAll(TrPostDataCreatedExpr.getAllVarDependingOn(var, _src)); + } + } + if (Fu.DEBUG && FuLog.isDebug()) { + FuLog.debug("vars enlevees\n" + CtuluLibString.arrayToString(varToRemove.toArray())); + } + map.keySet().removeAll(varToRemove); + final Map exprVar = new HashMap(map.size()); + final Map otherVar = new HashMap(map.size()); + for (final Iterator it = map.entrySet().iterator(); it.hasNext();) { + final Map.Entry e = (Map.Entry) it.next(); + final TrPostDataCreated data = ((TrPostDataCreated) e.getValue()); + if (data.isExpr()) { + exprVar.put(e.getKey(), data); + } else { + otherVar.put(e.getKey(), data); + } + } + + save.varCreated_ = new H2dVariableTypeCreated[exprVar.size()]; + save.expr_ = new String[exprVar.size()]; + int idx = 0; + for (final Iterator it = exprVar.entrySet().iterator(); it.hasNext();) { + final Map.Entry e = (Map.Entry) it.next(); + save.varCreated_[idx] = (H2dVariableTypeCreated) e.getKey(); + save.expr_[idx++] = ((TrPostDataCreatedExpr) e.getValue()).getFormule(); + } + save.varCreatedSimple_ = new H2dVariableTypeCreated[otherVar.size()]; + save.saver_ = new TrPostDataCreatedSaver[otherVar.size()]; + for (final Iterator it = otherVar.entrySet().iterator(); it.hasNext();) { + final Map.Entry e = (Map.Entry) it.next(); + save.varCreatedSimple_[idx] = (H2dVariableTypeCreated) e.getKey(); + save.saver_[idx++] = ((TrPostDataCreated) e.getValue()).createSaver(); + } + + } + return save; + } + + public static void fillWithForbidden(final Collection _var, final Set _forbiddenName, final Set _forbiddenShort) { for (final Iterator iter = _var.iterator(); iter.hasNext();) { final H2dVariableType element = (H2dVariableType) iter.next(); 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-13 08:15:09 UTC (rev 4055) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-13 17:18:22 UTC (rev 4056) @@ -3,7 +3,7 @@ import java.awt.Dimension; import java.awt.Point; import java.io.File; -import java.io.FileOutputStream; +import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; @@ -20,20 +20,18 @@ import javax.swing.JFileChooser; import javax.swing.JInternalFrame; -import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluFileChooser; import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ebli.courbe.EGCourbePersist; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; - import org.fudaa.ebli.visuallibrary.actions.EbliWidgetGroupAction; -import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.ebli.visuallibrary.persist.EbliSceneSerializeXml; import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml; -import org.fudaa.ebli.visuallibrary.persist.ManagerWidgetPersist; +import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml.CoupleNomId; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; @@ -41,15 +39,15 @@ import org.fudaa.fudaa.tr.post.TrPostMultiSourceActivator; 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.TrPostUserVariableSaver; import org.netbeans.api.visual.widget.Widget; -import org.w3c.dom.Document; -import org.w3c.dom.Element; import com.memoire.fu.FuLog; -import com.sun.org.apache.xml.internal.serialize.OutputFormat; -import com.sun.org.apache.xml.internal.serialize.XMLSerializer; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.DomDriver; +import com.thoughtworks.xstream.persistence.FileStreamStrategy; +import com.thoughtworks.xstream.persistence.XmlArrayList; /** * Manager qui se charge de donner les noms standart des balises, @@ -62,606 +60,875 @@ public class TrPostPersistenceManager { - /** - * Utilis\xE9 pour l'extension de tous les fichiers, repertoire et ficheirs - * inclus. - */ - public final static String DEFAULT_EXTENSION = ".POST"; - /** - * Peut etre modifi\xE9 par l'appli appelabt si l'on veut une extension - * diff\xE9rente - */ - public static String EXTENSION = DEFAULT_EXTENSION; - /** - * Fichier qui d\xE9crit tous les contenu layout sauvegard\xE9s Et noms des balises - * importantes - */ - public final static String INFOSCENE = "InfoLayout" + EXTENSION; - public final static String BALISESCENES = "LayoutList"; + /** + * Utilis\xE9 pour l'extension de tous les fichiers, repertoire et ficheirs + * inclus. + */ + public final static String DEFAULT_EXTENSION = ".POST"; + /** + * Peut etre modifi\xE9 par l'appli appelabt si l'on veut une extension + * diff\xE9rente + */ + public static String EXTENSION = DEFAULT_EXTENSION; + /** + * Fichier qui d\xE9crit tous les contenu layout sauvegard\xE9s Et noms des balises + * importantes + */ + public final static String INFOSCENE = "InfoLayout" + EXTENSION; + public final static String BALISESCENES = "LayoutList"; - /** - * Fichier qui d\xE9crit int\xE9gralement le contenu d'une scene - */ - public final static String DESCRIPTORSCENE = "layout"; - public static String ATTRIBUTESCENE="LAYOUT"; + /** + * Fichier qui d\xE9crit int\xE9gralement le contenu d'une scene + */ + public final static String DESCRIPTORSCENE = "layout"; + public static String ATTRIBUTESCENE = "LAYOUT"; - /** - * Attributs pour le ficheirs des sources - */ - public final static String DESCRIPTORSOURCE = "sources" + EXTENSION; - public final static String BALISESOURCES = "SourcesList"; - public static String ATTRIBUTESOURCE="FICHIER"; + /** + * Attributs pour le ficheirs des sources + */ + public final static String DESCRIPTORSOURCE = "sources" + EXTENSION; + public final static String BALISESOURCES = "SourcesList"; + public static String ATTRIBUTESOURCE = "FICHIER"; + public final static String FileWidgetNames = "FramesNames"; + /** + * Le projet a persiter + */ + TrPostProjet trprojet_; - /** - * Le projet a persiter - */ - TrPostProjet trprojet_; + /** + * Nom du projet. Creation du projet sous un repertoire nomProjet.EXTENSION + */ - /** - * Nom du projet. Creation du projet sous un repertoire nomProjet.EXTENSION - */ + ProgressionInterface prog_; + File projet_; + TrPostCommonImplementation ui_; - ProgressionInterface prog_; - File projet_; - TrPostCommonImplementation ui_; + public TrPostPersistenceManager(TrPostProjet projet) { + super(); + trprojet_ = projet; + ui_ = projet.impl_; + prog_ = ui_.getMainProgression(); + } - public TrPostPersistenceManager(TrPostProjet projet) { - super(); - trprojet_=projet; - ui_ = projet.impl_; - prog_ = ui_.getMainProgression(); - - } + public void progression(String title, int progression) { + if (prog_ == null || title == null || progression > 100) + return; + if (progression == 100) { + prog_.setProgression(0); + prog_.setDesc(""); + return; + } + prog_.setDesc(EbliResource.EBLI.getString(title)); + prog_.setProgression(progression); + } + /** + * Cr\xE9\xE9 le repertoire contenant tous les fichiers de donn\xE9es. Base pour la + * cr\xE9ation des donn\xE9es. + */ + public boolean savePersistDirectory() { + // -- creation d un chooser --// + final CtuluFileChooser fileChooser = new CtuluFileChooser(true); + fileChooser.setDialogTitle(EbliResource.EBLI.getString("S\xE9lectionnez l'emplacement de votre projet")); + fileChooser.setAcceptAllFileFilterUsed(false); + fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + // -- init avec les param noms projet et autre --// + if (projet_ != null) { + fileChooser.setSelectedFile(projet_); + } - public void progression(String title, int progression) { - if (prog_ == null || title == null || progression > 100) - return; - if (progression == 100) { - prog_.setProgression(0); - prog_.setDesc(""); - return; - } - prog_.setDesc(EbliResource.EBLI.getString(title)); - prog_.setProgression(progression); - } + int reponse = fileChooser.showSaveDialog(CtuluLibSwing.getFrameAncestor(ui_.getParentComponent())); + if (reponse == JFileChooser.APPROVE_OPTION) { + File conteneurProjet = fileChooser.getSelectedFile(); - /** - * Cr\xE9\xE9 le repertoire contenant tous les fichiers de donn\xE9es. Base pour la - * cr\xE9ation des donn\xE9es. - */ - public boolean savePersistDirectory() { - // -- creation d un chooser --// - final CtuluFileChooser fileChooser = new CtuluFileChooser(true); - fileChooser.setDialogTitle(EbliResource.EBLI.getString("S\xE9lectionnez l'emplacement de votre projet")); - fileChooser.setAcceptAllFileFilterUsed(false); - fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - //-- init avec les param noms projet et autre --// - if(projet_!=null){ - fileChooser.setSelectedFile(projet_); + if (projet_ == null || !projet_.equals(conteneurProjet)) + projet_ = new File(GetExtensionName(conteneurProjet.getAbsolutePath())); + // creation du repertoire global contenant toutes les donn\xE9es + if (projet_.mkdir()) { + return true; + } else - } + if (projet_.isDirectory()) { + return true; + } else { + ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le r\xE9pertoire")); + return false; + } - int reponse = fileChooser.showSaveDialog(CtuluLibSwing.getFrameAncestor(ui_.getParentComponent())); - if (reponse == JFileChooser.APPROVE_OPTION) { - File conteneurProjet = fileChooser.getSelectedFile(); - - if(projet_==null || !projet_.equals(conteneurProjet)) - projet_ = new File(GetExtensionName(conteneurProjet.getAbsolutePath())); - // creation du repertoire global contenant toutes les donn\xE9es - if (projet_.mkdir()) { - return true; - } else - - if(projet_.isDirectory()){ - return true; - }else - { - ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le r\xE9pertoire")); - return false; - } + } else + return false; + } - - } else - return false; - } + /** + * Retourne un nom avec extension + * + * @param name + * @return + */ + public String GetExtensionName(String name) { + + if (name.contains(EXTENSION)) { + return name; + } else + return name + EXTENSION; + } + + /** + * Charge le repertoire contenant tous les fichiers + * + * @return + */ + public boolean loadPersistDirectory() { + // -- creation d un chooser --// + final CtuluFileChooser fileChooser = new CtuluFileChooser(true); + fileChooser.setDialogTitle(EbliResource.EBLI.getString("S\xE9lectionnez l'emplacement de votre projet")); + fileChooser.setAcceptAllFileFilterUsed(false); + fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + + // -- init avec les param noms projet et autre --// + if (projet_ != null) { + fileChooser.setSelectedFile(projet_); + + } + + int reponse = fileChooser.showOpenDialog(CtuluLibSwing.getFrameAncestor(ui_.getParentComponent())); + if (reponse == JFileChooser.APPROVE_OPTION) { + projet_ = fileChooser.getSelectedFile(); + // creation du repertoire global contenant toutes les donn\xE9es + if (projet_.isDirectory()) { + return true; + } else { + ui_.error(EbliResource.EBLI.getString("Impossible de charger le r\xE9pertoire")); + return false; + } + } else + return false; + } + + /** + * Fichier qui cree le fichier qui indique les diff\xE9rents fichiers layout a + * lire. Cela permettra pour la lecture de proposer de charger ou non certains + * layout + * + * @return + * @throws IOException + */ + public void saveDescriptorScenes(File file) { + // -- outputstream du xstream --// + ObjectOutputStream out=null; + try { + out = getParser().createObjectOutputStream(new FileWriter(file)); - /** - * Retourne un nom avec extension - * @param name - * @return - */ - public String GetExtensionName(String name){ - - if(name.contains(EXTENSION)){ - return name; - }else - return name+EXTENSION; + // -- g\xE9n\xE9ration du xml pour la scene --// + int nbFichiersToGenrate = trprojet_.impl_.getAllLayoutFille().size(); + out.writeInt(nbFichiersToGenrate); + for (int i = 0; i < nbFichiersToGenrate; i++) { + // creation du fichier de desciption des scenes + String nomFichierLayout = projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + (i + 1) + EXTENSION; + out.writeObject(nomFichierLayout); + } + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } + finally{ + try { + out.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(true); + } + } + + } - /** - * Charge le repertoire contenant tous les fichiers - * @return - */ - public boolean loadPersistDirectory() { - // -- creation d un chooser --// - final CtuluFileChooser fileChooser = new CtuluFileChooser(true); - fileChooser.setDialogTitle(EbliResource.EBLI.getString("S\xE9lectionnez l'emplacement de votre projet")); - fileChooser.setAcceptAllFileFilterUsed(false); - fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - //-- init avec les param noms projet et autre --// - if(projet_!=null){ - fileChooser.setSelectedFile(projet_); + /** + * Lis les fichiers des layouts a utiliser. + * + * @param file + * @return + * @throws IOException + * @throws ClassNotFoundException + */ + public List<String> loadDescriptorScenes(File file) { + // -- outputstream du xstream --// + List<String> listeFiles = new ArrayList<String>(); + ObjectInputStream in=null; + try { + in = getParser().createObjectInputStream(new FileReader(file)); + + // -- g\xE9n\xE9ration du xml pour la scene --// + int nbFichiersToGenrate = in.readInt(); + + for (int i = 0; i < nbFichiersToGenrate; i++) { + // creation du fichier de desciption des scenes + String nomFichierLayout = (String) in.readObject(); + listeFiles.add(nomFichierLayout); + } + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(false); + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(false); + } + finally{ + try { + in.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(false); } - - int reponse = fileChooser.showOpenDialog(CtuluLibSwing.getFrameAncestor(ui_.getParentComponent())); - if (reponse == JFileChooser.APPROVE_OPTION) { - projet_ = fileChooser.getSelectedFile(); - // creation du repertoire global contenant toutes les donn\xE9es - if (projet_.isDirectory()) { - return true; - } else { - ui_.error(EbliResource.EBLI.getString("Impossible de charger le r\xE9pertoire")); - return false; - } - } else - return false; } + + return listeFiles; + } - /** - * Fichier qui cree le fichier qui indique les diff\xE9rents fichiers layout a - * lire. Cela permettra pour la lecture de proposer de charger ou non certains - * layout - * - * @return - * @throws IOException - */ - public void saveDescriptorScenes(File file) throws IOException { - //-- outputstream du xstream --// - ObjectOutputStream out = getParser().createObjectOutputStream(new FileWriter(file)); - //-- g\xE9n\xE9ration du xml pour la scene --// - int nbFichiersToGenrate=trprojet_.impl_.getAllLayoutFille().size(); - out.writeInt(nbFichiersToGenrate); - for(int i=0;i<nbFichiersToGenrate;i++){ - //creation du fichier de desciption des scenes - String nomFichierLayout=projet_.getAbsolutePath()+File.separator+DESCRIPTORSCENE+(i+1)+EXTENSION; - out.writeObject(nomFichierLayout); - } - out.close(); + + /** + * Recuperation de la liste des variables. + * @param init: si on veut ecraser (sauvegarder) mettre le booleen a true. + * @param path + * @return + */ + List<TrPostUserVariableSaver> getPersitantVariablesList(String path,boolean init){ + + List<TrPostUserVariableSaver> liste=new XmlArrayList( new FileStreamStrategy(new File(path))); + + if(init) + clearDatas(liste); + + return liste; } - - - /** - * Lis les fichiers des layouts a utiliser. - * @param file - * @return - * @throws IOException - * @throws ClassNotFoundException - */ - public List<String> loadDescriptorScenes(File file) throws IOException, ClassNotFoundException { - //-- outputstream du xstream --// - ObjectInputStream in = getParser().createObjectInputStream(new FileReader(file)); - //-- g\xE9n\xE9ration du xml pour la scene --// - int nbFichiersToGenrate=in.readInt(); - List<String> listeFiles=new ArrayList<String>(nbFichiersToGenrate); + private void clearDatas( List<TrPostUserVariableSaver> list ){ + //CtuluRemoveContentDirectory.contentDirectoryRemover(getDirectoryCurves()); + if(list==null) + return; + while(list.size()!=0) + list.remove(0); - for(int i=0;i<nbFichiersToGenrate;i++){ - //creation du fichier de desciption des scenes - String nomFichierLayout=(String) in.readObject(); - listeFiles.add(nomFichierLayout); - } - in.close(); - return listeFiles; } - - /** - * Methode qui g\xE9n\xE8re le fichier contenant toutes les sources ouverts. - * - * @return - * @throws IOException - */ + + /** + * Methode qui g\xE9n\xE8re le fichier contenant toutes les sources ouverts. + * + * @return + * @throws IOException + */ - public void saveSource(File file) throws IOException { - //-- outputstream du xstream --// - ObjectOutputStream out = getParser().createObjectOutputStream(new FileWriter(file)); - //-- g\xE9n\xE9ration du xml pour la scene --// + public void saveSourceAndVariables(File file, String pathVariables) { + // -- outputstream du xstream --// + ObjectOutputStream out =null; + // -- g\xE9n\xE9ration du xml pour la scene --// + try { + out = getParser().createObjectOutputStream(new FileWriter(file)); out.writeInt(trprojet_.listeSrc_.size()); - + + List<TrPostUserVariableSaver>listeVar= getPersitantVariablesList(pathVariables,true); Iterator<TrPostSource> it = trprojet_.listeSrc_.iterator(); - - while (it.hasNext()) { - File f = it.next().getFile(); - out.writeObject(f.getAbsolutePath()); - } + + while (it.hasNext()) { + TrPostSource src=it.next(); + File f = src.getFile(); + out.writeObject(f.getAbsolutePath()); + + //-- sauveagrde de la variable correspondante --// + TrPostUserVariableSaver var=TrPostUserVariableSaver.saveIn((TrPostSourceAbstract) src, null); + listeVar.add(var); + } + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(true); + }finally{ + try { out.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(true); } + } + } - /** - * Methode qui ouvre tous les sources et ouvre le trpostProjets correspondants - * @param file - * @throws IOException - * @throws ClassNotFoundException - */ - public void loadSource(File file) throws IOException, ClassNotFoundException { - //-- outputstream du xstream --// - ObjectInputStream in = getParser().createObjectInputStream(new FileReader(file)); - - TrPostMultiSourceActivator multiProjectActivator=new TrPostMultiSourceActivator(trprojet_); - - //-- lecture nb sources pour les sources --// - int nbSources=in.readInt(); - for(int i=0;i<nbSources;i++) { - String path=(String) in.readObject(); - if(path!=null){ - 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.")); - }else{ - File f = new File(path); - // -- tentative de chargement du source dans le multi-projet --// - - multiProjectActivator.active(f, trprojet_.impl_); - // -- notify aux observers --// - //trprojet_.notifyObservers(); - - - } - } - } - in.close(); - } + /** + * Methode qui ouvre tous les sources et ouvre le trpostProjets correspondants + * + * @param file + * @throws IOException + * @throws ClassNotFoundException + */ + public void loadSourceAndVariables(File file,String pathVariables) { + // -- outputstream du xstream --// + ObjectInputStream in=null; + try { + in = getParser().createObjectInputStream(new FileReader(file)); - - /** - * Methode qui peut etre appel\xE9e pour nettoyer le projet - */ - public void clearProject(){ - int n=0; - List<TrPostSource> liste=new ArrayList<TrPostSource>(); - for(TrPostSource src:trprojet_.listeSrc_) - liste.add(src); - for(TrPostSource src:liste) - trprojet_.removeSource(src, n); - for(JInternalFrame frame:trprojet_.getImpl().getAllInternalFrames()){ - frame.dispose(); - } - } - - /** - * Methode qui tente de sauvegarder tous les fichiers: Soit tout - * les fichiers li\xE9s entre eux sont sauvegard\xE9s, soit les fichier li\xE9s ne le - * sont pas(destruction si n\xE9cessaire) - * - * @return - */ - public boolean saveProject() { - HashMap<String, Object> parametres=new HashMap<String, Object>(); - try { - progression("Cr\xE9ation du r\xE9pertoire", 10); - // -- etape 1 creation du repertoire global --// - if (savePersistDirectory()) { - - - File file; - // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts - progression("Cr\xE9ation du fichier descripteur de sources", 15); - file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSOURCE); - saveSource(file); - - //-- etape 2.5: creation du repertoire des graphe et calques --// - String pathGraphes=projet_.getAbsolutePath() + File.separator +"Graphes"; - try{ - new File(pathGraphes).mkdir(); - }catch(Exception e){ - //pas grave on continue - FuLog.debug("Le repertoire des graphes existe deja"); - } - String pathCalques=projet_.getAbsolutePath() + File.separator +"Calques"; - try{ - new File(pathCalques).mkdir(); - }catch(Exception e){ - //pas grave on continue - FuLog.debug("Le repertoire des calques existe deja"); - } - - // -- etape 3 sauvegarde des ebliscene unitairement --// - progression("Cr\xE9ation des fichiers layout", 20); - - //-- creation des params pour les datas --// - parametres.put("path", projet_.getAbsolutePath()); - parametres.put("pathGraphes",pathGraphes); - parametres.put("pathCalques",pathCalques); - - int cpt = 1; - List<TrPostLayoutFille> listFilles=trprojet_.impl_.getAllLayoutFille(); - for(TrPostLayoutFille fille:listFilles){ - String title = fille.getTitle(); - EbliScene scene = fille.getScene(); - if(listFilles.size()!=0) - progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listFilles.size()); - file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); - //-- sauvegarde du persitant --// - parametres.put("dimensions", fille.getSize()); - parametres.put("location", fille.getLocation()); - parametres.put("scene", scene); - savePersitSceneXml(scene,title,file,parametres); - cpt++; + //-- recuperation du multiSourceActivator--// + TrPostMultiSourceActivator multiProjectActivator = new TrPostMultiSourceActivator(trprojet_); - } + //-- recuperation de la listed es variables persistantes --// + List<TrPostUserVariableSaver>listeVar= getPersitantVariablesList(pathVariables,false); + + // -- lecture nb sources pour les sources --// + int nbSources = in.readInt(); + for (int i = 0; i < nbSources; i++) { + String path = (String) in.readObject(); + if (path != null) { + 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.")); + } else { + File f = new File(path); + // -- tentative de chargement du source dans le multi-projet --// - // -- etape finale: sauvegarde du fichier de descriptions des layout --// - progression("Cr\xE9ation du descripteur de layout", 90); - file = new File(projet_.getAbsolutePath() + File.separator + INFOSCENE); - saveDescriptorScenes(file); - progression("", 100); - ui_.message(TrResource.getS("Sauvegarde termin\xE9e"), TrResource.getS("Sauvegarde termin\xE9e avec succ\xE8s"), false); - return true; + multiProjectActivator.active(f, trprojet_.impl_); + // -- notify aux observers --// + // trprojet_.notifyObservers(); - } - return false; - } catch (IOException ie) { - ie.printStackTrace(); - ui_.error(TrResource.getS("Erreur dans la sauvegarde du projet")); - return false; - } + } + } + } + + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(false); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(false); + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(false); + }finally{ + try { + in.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(false); } + } + } - /** - * Methode qui charge le projet,l'ensemble des sources et toutes les widgets dans les layouts. - * @return - */ - public boolean loadProject() { - try { - progression("Lecture du r\xE9pertoire", 10); - // -- etape 1 lecture du repertoire global --// - if (loadPersistDirectory()) { - File file; - // -- 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 + DESCRIPTORSOURCE); - loadSource(file); - - // -- etape finale: sauvegarde du fichier de descriptions des layout --// - progression("Cr\xE9ation du descripteur de layout", 20); - file = new File(projet_.getAbsolutePath() + File.separator + INFOSCENE); - List<String> listeFichiers=loadDescriptorScenes(file); - // -- etape finale chargement des ebliscene unitairement --// - progression("Cr\xE9ation des fichiers layout", 30); - //-- creation des params pour les datas --// - HashMap<String, Object> parametres=new HashMap<String, Object>(); - parametres.put("path", projet_.getAbsolutePath()); + /** + * Methode qui peut etre appel\xE9e pour nettoyer le projet + */ + public void clearProject() { + int n = 0; + List<TrPostSource> liste = new ArrayList<TrPostSource>(); + for (TrPostSource src : trprojet_.listeSrc_) + liste.add(src); + for (TrPostSource src : liste) + trprojet_.removeSource(src, n); + for (JInternalFrame frame : trprojet_.getImpl().getAllInternalFrames()) { + frame.dispose(); + } + } - int cpt = 1; - - for(String fichier:listeFichiers){ - file = new File(fichier); - if(listeFichiers.size()!=0) - progression("chargement du fichier " + fichier, 30 + 70 / listeFichiers.size()); - - //-- creation de la trpostlayoutFille --// - TrPostLayoutFille postFrame=new TrPostLayoutFille(trprojet_); - //-- sauvegarde du persitant --// - try { - trprojet_.getImpl().addInternalFrame(postFrame); - loadPersitSceneXml(file,postFrame,parametres); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - ui_.error(TrResource.getS("Erreur dans le chargement du layout. Chargement annul\xE9 pour le fichier ")+fichier); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - ui_.error(TrResource.getS("Erreur dans le chargement du layout. Chargement annul\xE9 pour le fichier ")+fichier); - } + /** + * Methode qui tente de sauvegarder tous les fichiers: Soit tout les fichiers + * li\xE9s entre eux sont sauvegard\xE9s, soit les fichier li\xE9s ne le sont + * pas(destruction si n\xE9cessaire) + * + * @return + */ + public boolean saveProject() { + HashMap<String, Object> parametres = new HashMap<String, Object>(); + + + + progression("Cr\xE9ation du r\xE9pertoire", 10); + // -- etape 1 creation du repertoire global --// + if (savePersistDirectory()) { - } + // -- etape 0: creation du repertoire des graphe et calques --// + String pathGraphes = projet_.getAbsolutePath() + File.separator + "Graphes"; + try { + new File(pathGraphes).mkdir(); + } catch (Exception e) { + // pas grave on continue + FuLog.debug("Le repertoire des graphes existe deja"); + } + String pathCalques = projet_.getAbsolutePath() + File.separator + "Calques"; + try { + new File(pathCalques).mkdir(); + } catch (Exception e) { + // pas grave on continue + FuLog.debug("Le repertoire des calques existe deja"); + } + String pathVariables = projet_.getAbsolutePath() + File.separator + "Variables"; + try { + new File(pathVariables).mkdir(); + } catch (Exception e) { + // pas grave on continue + FuLog.debug("Le repertoire des variables existe deja"); + } + File file; + // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts + progression("Cr\xE9ation du fichier descripteur de sources", 15); + file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSOURCE); + saveSourceAndVariables(file,pathVariables); - - progression("", 100); - ui_.message(TrResource.getS("Chargement termin\xE9"), TrResource.getS("Chargement termin\xE9 avec succ\xE8s"), false); - - - - return true; + - } - return false; - } catch (IOException ie) { - ie.printStackTrace(); - ui_.error(TrResource.getS("Erreur dans la sauvegarde du projet")); - return false; - }catch (ClassNotFoundException ie) { - ie.printStackTrace(); - ui_.error(TrResource.getS("Erreur dans la sauvegarde du projet")); - return false; - } + // -- etape 3 sauvegarde des ebliscene unitairement --// + progression("Cr\xE9ation des fichiers layout", 20); - } + // -- creation des params pour les datas --// + parametres.put("path", projet_.getAbsolutePath()); + parametres.put("pathGraphes", pathGraphes); + parametres.put("pathCalques", pathCalques); + // -- creation de la list des noms des widgets + List<EbliWidgetSerializeXml.CoupleNomId> listeNomsComposants = new ArrayList<CoupleNomId>(); + + int cpt = 1; + List<TrPostLayoutFille> listFilles = trprojet_.impl_.getAllLayoutFille(); + for (TrPostLayoutFille fille : listFilles) { + String title = fille.getTitle(); + EbliScene scene = fille.getScene(); + if (listFilles.size() != 0) + progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listFilles.size()); + file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); + // -- sauvegarde du persitant --// + parametres.put("dimensions", fille.getSize()); + parametres.put("location", fille.getLocation()); + parametres.put("scene", scene); + savePersitSceneXml(scene, title, file, parametres, listeNomsComposants); + cpt++; + + } + + // -- etap 4 ecriture du fichier des noms --// + file = new File(projet_.getAbsolutePath() + File.separator + FileWidgetNames); + sauverNomsFrames(file, listeNomsComposants); + + // -- etape finale: sauvegarde du fichier de descriptions des layout + // --// + progression("Cr\xE9ation du descripteur de layout", 90); + file = new File(projet_.getAbsolutePath() + File.separator + INFOSCENE); + saveDescriptorScenes(file); + progression("", 100); + ui_.message(TrResource.getS("Sauvegarde termin\xE9e"), TrResource.getS("Sauvegarde termin\xE9e avec succ\xE8s"), false); + return true; + + } + return false; + + + } + + public void messageError(boolean save){ + if(save) + ui_.error(TrResource.getS("Erreur dans la sauvegarde du projet")); + else + ui_.error(TrResource.getS("Erreur dans le chargement du projet")); + } + + /** + * methode qui sauvegarde tous les noms des widgets dans un meme fichier + * facile d acces. + * + * @param file + * @param liste + */ + public void sauverNomsFrames(File file, List<EbliWidgetSerializeXml.CoupleNomId> liste) { + // -- outputstream du xstream --// + ObjectOutputStream out = null; + try { + out = getParser().createObjectOutputStream(new FileWriter(file)); + out.writeObject(liste); + } catch (IOException e) { + e.printStackTrace(); + } + finally { + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + messageError(true); + } + + } + + } + + + /** + * methode qui sauvegarde tous les noms des widgets dans un meme fichier + * facile d acces. + * + * @param file + * @param liste + */ + public List<EbliWidgetSerializeXml.CoupleNomId> loadNomsFrames(File file) { + List<EbliWidgetSerializeXml.CoupleNomId> liste = null; + // -- outputstream du xstream --// + ObjectInputStream out = null; + try { + out = getParser().createObjectInputStream(new FileReader(file)); + liste = (List<CoupleNomId>) out.readObject(); + } catch (IOException e) { + e.printStackTrace(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } finally { + try { + out.close(); + return liste; + } catch (IOException e) { + e.printStackTrace(); + messageError(false); + } + + } + return null; + } + + /** + * Methode qui charge le projet,l'ensemble des sources et toutes les widgets + * dans les layouts. + * + * @return + */ + public boolean loadProject() { + + progression("Lecture du r\xE9pertoire", 10); + // -- etape 1 lecture du repertoire global --// + if (loadPersistDirectory()) { + File file; + String pathVariables = projet_.getAbsolutePath() + File.separator + "Variables"; + try { + new File(pathVariables).mkdir(); + } catch (Exception e) { + // pas grave on continue + FuLog.debug("Le repertoire des variables existe deja"); + } + + + // -- 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 + DESCRIPTORSOURCE); + loadSourceAndVariables(file,pathVariables); + + // -- etape 3: sauvegarde du fichier de descriptions des layout + // --// + progression("Cr\xE9ation du descripteur de layout", 20); + file = new File(projet_.getAbsolutePath() + File.separator + INFOSCENE); + List<String> listeFichiers = loadDescriptorScenes(file); + + // -- etape 4 chargement des ebliscene unitairement --// + progression("Cr\xE9ation des fichiers layout", 30); + // -- creation des params pour les datas --// + HashMap<String, Object> parametres = new HashMap<String, Object>(); + parametres.put("path", projet_.getAbsolutePath()); + + + // -- etape 5 lecture de la liste des couples nomsfRAME /ID --// + file=new File(projet_.getAbsolutePath() + File.separator +FileWidgetNames); + List<EbliWidgetSerializeXml.CoupleNomId> listeCouplesNoms = loadNomsFrames(file); + + int cpt = 1; + + for (String fichier : listeFichiers) { + file = new File(fichier); + if (listeFichiers.size() != 0) + progression("chargement du fichier " + fichier, 30 + 70 / listeFichiers.size()); + + // -- creation de la trpostlayoutFille --// + TrPostLayoutFille postFrame = new TrPostLayoutFille(trprojet_); + // -- sauvegarde du persitant --// + + trprojet_.getImpl().addInternalFrame(postFrame); + loadPersitSceneXml(file, postFrame, parametres, listeCouplesNoms); + + + } + + + progression("", 100); + ui_.message(TrResource.getS("Chargement termin\xE9"), TrResource.getS("Chargement termin\xE9 avec succ\xE8s"), false); + + + + return true; + + } + return false; + + + } + + + + private XStream parser_; + + private XStream getParser() { + if (parser_ == null) + parser_ = initXmlParser(); + return parser_; + } + + /** + * Init le parser avec les alias adequats. + * + * @return + */ + private XStream initXmlParser() { + XStream xstream = new XStream(new DomDriver()); + // -- creation des alias pour que ce soit + parlant dans le xml file --// + xstream.alias("LAYOUT", EbliSceneSerializeXml.class); + xstream.alias("FRAME", EbliWidgetSerializeXml.class); + xstream.alias("FRAMESNAMES", EbliWidgetSerializeXml.CoupleNomId.class); + return xstream; + } + + /** + * Utilise xstream pour serializer les parametres scene, widget + * + * @throws IOException + */ + private void savePersitSceneXml(EbliScene scene, String title, File file, Map parametres, + List<EbliWidgetSerializeXml.CoupleNomId> listeNomsComposants) { + + // -- outputstream du xstream --// + ObjectOutputStream out=null; + try { + out = getParser().createObjectOutputStream(new FileWriter(file)); - - private XStream parser_; - - private XStream getParser(){ - if(parser_==null) - parser_=initXmlParser(); - return parser_; + + // -- g\xE9n\xE9ration du xml pour la scene --// + out.writeObject(new EbliSceneSerializeXml(scene, title, (Dimension) parametres.get("dimensions"), + (Point) parametres.get("location"))); + + // -- g\xE9n\xE9ration du xml pour les eblinode/widgets --// + // -- ACHTUNG!!! IL FAUT RECUPERER LES OBJETS VIA CHILDREN POUR PRESERVER L + // ORDRE DE SUPERPOSITION!!! --// + Iterator<Widget> it = scene.getLayerVisu().getChildren().iterator(); + + // -- creation d une liste particuliere pour les groupes--// + List<EbliWidgetSerializeXml> listeGroupes = new ArrayList<EbliWidgetSerializeXml>(); + + while (it.hasNext()) { + Widget widget = it.next(); + + if (widget instanceof EbliWidgetGroup) { + // -- cas widget group, il faut recuper ses child --// + EbliNode nodeGroupe = (EbliNode) scene.findObject(widget); + // ecriture de l objet + if (nodeGroupe != null) + listeGroupes.add(new EbliWidgetSerializeXml(nodeGroupe, parametres)); + + for (Widget child : widget.getChildren()) { + EbliNode node = (EbliNode) scene.findObject(child); + // ecriture de l objet + if (node != null) + + out.writeObject(new EbliWidgetSerializeXml(node, parametres)); + listeNomsComposants.add(new EbliWidgetSerializeXml.CoupleNomId(node.getTitle(), node.getWidget().getId())); + } + + } else { + EbliNode node = (EbliNode) scene.findObject(widget); + // ecriture de l objet + if (node != null) + out.writeObject(new EbliWidgetSerializeXml(node, parametres)); + listeNomsComposants.add(new EbliWidgetSerializeXml.CoupleNomId(node.getTitle(), node.getWidget().getId())); + } + } + + // -- ecriture des groupes --// + out.writeInt(listeGroupes.size()); + for (EbliWidgetSerializeXml serializeGroupe : listeGroupes) { + out.writeObject(serializeGroupe); + } + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(true); + }finally{ + try { + out.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + messageError(true); } - /** - * Init le parser avec les alias adequats. - * @return - */ - private XStream initXmlParser(){ - XStream xstream = new XStream(new DomDriver()); - //-- creation des alias pour que ce soit + parlant dans le xml file --// - xstream.alias("LAYOUT", EbliSceneSerializeXml.class); - xstream.alias("FRAME", EbliWidgetSerializeXml.class); - return xstream; } - /** - * Utilise xstream pour serializer les parametres scene, widget - * @throws IOException - */ - private void savePersitSceneXml(EbliScene scene,String title,File file, Map parametres) throws IOException{ + } - //-- outputstream du xstream --// - ObjectOutputStream out = getParser().createObjectOutputStream(new FileWriter(file)); + /** + * Methode qui retourne le nom correspondant de la widget + * + * @param listeCouplesNoms + * @param idWidget + * @return + */ + public String getNodeName( List<EbliWidgetSerializeXml.CoupleNomId> listeCouplesNoms, String idWidget) { + for (CoupleNomId couple : listeCouplesNoms) { + if (couple.id.equals(idWidget)) + return couple.nom; + } + return ""; + } + + /** + * Methode qui recupere les infos de la scene et la reconstruit a partir de + * celle vierge fourni en param d'entr\xE9e. + * + * @param file + * le fichier qui contient les infos xml + * @param scenToUpdate + * la scene a remplir avec les infos des fichiers xml + * @throws IOException + * @throws ClassNotFoundException + * @throws IllegalAccessException + * @throws InstantiationException + */ + private void loadPersitSceneXml(File file, TrPostLayoutFille fille, Map parametres, + List<EbliWidgetSerializeXml.CoupleNomId> listeCouplesNoms) { - //-- g\xE9n\xE9ration du xml pour la scene --// - out.writeObject(new EbliSceneSerializeXml(scene,title,(Dimension) parametres.get("dimensions"),(Point) parametres.get("location"))); + EbliScene scenToUpdate = fille.getScene(); + parametres.put("scene", scenToUpdate); + // -- inputstream du xstream --// + ObjectInputStream in = null; + try { + in = getParser().createObjectInputStream(new FileReader(file)); + - //-- g\xE9n\xE9ration du xml pour les eblinode/widgets --// - //-- ACHTUNG!!! IL FAUT RECUPERER LES OBJETS VIA CHILDREN POUR PRESERVER L ORDRE DE SUPERPOSITION!!! --// - Iterator<Widget> it= scene.getLayerVisu().getChildren().iterator(); - - //-- creation d une liste particuliere pour les groupes--// - List<EbliWidgetSerializeXml> listeGroupes=new ArrayList<EbliWidgetSerializeXml>(); - - while(it.hasNext()){ - Widget widget=it.next(); - - - if(widget instanceof EbliWidgetGroup){ - //-- cas widget group, il faut recuper ses child --// - EbliNode nodeGroupe=(EbliNode) scene.findObject(widget); - //ecriture de l objet - if(nodeGroupe !=null) - listeGroupes.add(new EbliWidgetSerializeXml(nodeGroupe,parametres)); - - for(Widget child:widget.getChildren()) { - EbliNode node=(EbliNode) scene.findObject(child); - //ecriture de l objet - if(node !=null) - out.writeObject(new EbliWidgetSerializeXml(node,parametres)); - } - - }else{ - EbliNode node=(EbliNode) scene.findObject(widget); - //ecriture de l objet - if(node !=null) - out.writeObject(new EbliWidgetSerializeXml(node,parametres)); - } - } + // -- r\xE9cup\xE9ration de la scene xml --// + EbliSceneSerializeXml sceneXml = (EbliSceneSerializeXml) in.readObject(); - //-- ecriture des groupes --// - out.writeInt(listeGroupes.size()); - for(EbliWidgetSerializeXml serializeGroupe:listeGroupes){ - out.writeObject(serializeGroupe); - } - - out.close(); + // mise a jour des infos + sceneXml.configureSceneWith(scenToUpdate); + if (sceneXml.getWidth() > 0 && sceneXml.getHeight() > 0) + fille.setSize(sceneXml.getWidth(), sceneXml.getHeight()); + fille.setTitle(sceneXml.getTitle()); + fille.setLocation(sceneXml.getX(), sceneXml.getY()); + // -- preparation de la liste de selection des frames dans le layout --// + final Set<Object> listeNodeSelect = new HashSet<Object>(); - + // -- preparation d'une structure interm\xE9diaire pour optimiser --// + // -- la complexit\xE9 de calcul des groupes (passer en complexit\xE9 lin\xE9aire) + // --// + HashMap<String, HashSet<Object>> listeGroupToPerform = new HashMap<String, HashSet<Object>>(); - } + // -- r\xE9cup\xE9ration via xml des eblinode/widgets --// + for (int i = 0; i < sceneXml.getNbFrames(); i++) { + // lecture xml de l objet + EbliWidgetSerializeXml widgetXml = (EbliWidgetSerializeXml) in.readObject(); - /** - * Methode qui recupere les infos de la scene et la reconstruit a partir de celle vierge fourni en param d'entr\xE9e. - * @param file le fichier qui contient les infos xml - * @param scenToUpdate la scene a remplir avec les infos des fichiers xml - * @throws IOException - * @throws ClassNotFoundException - * @throws IllegalAccessException - * @throws InstantiationException - */ - private void loadPersitSceneXml(File file, TrPostLayoutFille fille, Map parametres) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException{ - - EbliScene scenToUpdate=fille.getScene(); - parametres.put("scene",scenToUpdate); - - //-- inputstream du xstream --// - ObjectInputStream in = getParser().createObjectInputStream(new FileReader(file)); + // generation de la widget dans la scene + parametres.put("nodeName", getNodeName(listeCouplesNoms, widgetXml.getId())); + EbliNode node = widgetXml.generateWidgetInScene(parametres, scenToUpdate); + + // ajout des noeuds a ajouter dans la selection + if (widgetXml.isSelected()) + listeNodeSelect.add(node); + // ajout de la creation d'un groupe + if (!widgetXml.getIdGroup().equals(EbliWidgetGroup.NOGROUP)) { + // il y a un group a prendre en compte d'id + String idGroup = widgetXml.getIdGroup(); + if (listeGroupToPerform.get(idGroup) == null) { + // on init + listeGroupToPerform.put(idGroup, new HashSet<Object>()); + } + // on ajoute l'objet node pour la widget + listeGroupToPerform.get(idGroup).add(node); + } - //-- r\xE9cup\xE9ration de la scene xml --// - EbliSceneSerializeXml sceneXml = (EbliSceneSerializeXml)in.readObject(); + } - //mise a jour des infos - sceneXml.configureSceneWith(scenToUpdate); - if(sceneXml.getWidth()>0 && sceneXml.getHeight()>0) - fille.setSize(sceneXml.getWidth(),sceneXml.getHeight()); - fille.setTitle(sceneXml.getTitle()); - fille.setLocation(sceneXml.getX(),sceneXml.getY()); - - //-- preparation de la liste de selection des frames dans le layout --// - final Set<Object> listeNodeSelect = new HashSet<Object>(); - - //-- preparation d'une structure interm\xE9diaire pour optimiser --// - //-- la complexit\xE9 de calcul des groupes (passer en complexit\xE9 lin\xE9aire) --// - HashMap<String, HashSet<Object>> listeGroupToPerform=new HashMap<String, HashSet<Object>>(); - - //-- r\xE9cup\xE9ration via xml des eblinode/widgets --// - for(int i=0;i<sceneXml.getNbFrames();i++){ - - //lecture xml de l objet - EbliWidgetSerializeXml widgetXml = (EbliWidgetSerializeXml)in.readObject(); - //generation de la widget dans la scene - EbliNode node=widgetXml.generateWidgetInScene(parametres, scenToUpdate); - - //ajout des noeuds a ajouter dans la selection - if(widgetXml.isSelected()) - listeNodeSelect.add(node); - - //ajout de la creation d'un groupe - if(!widgetXml.getIdGroup().equals(EbliWidgetGroup.NOGROUP)){ - //il y a un group a prendre en compte d'id - String idGroup=widgetXml.getIdGroup(); - if(listeGroupToPerform.get(idGroup)==null){ - //on init - listeGroupToPerform.put(idGroup, new HashSet<Object>()); - } - //on ajoute l'objet node pour la widget - listeGroupToPerform.get(idGroup).add(node); - } - - } + // -- lecture des groupes --// + // -- ecriture des groupes --// + int nbGroups = in.readInt(); + HashMap<String, EbliWidgetSerializeXml> listeGroupes = new HashMap<String, EbliWidgetSerializeXml>(); - - //-- lecture des groupes --// - //-- ecriture des groupes --// - int nbGroups=in.readInt(); - HashMap<String,EbliWidgetSerializeXml> listeGroupes=new HashMap<String,EbliWidgetSerializeXml>(); - - for( int i=0;i<nbGroups;i++){ - EbliWidgetSerializeXml group=(EbliWidgetSerializeXml) in.readObject(); - listeGroupes.put(group.getId(),group); - } - - - in.close(); - scenToUpdate.refresh(); - //-- on s'occupe de grouper l'ensemble des widgets --// - for(String idGroup:listeGroupToPerform.keySet()){ - //--l'idGroup est jetable, on ne le sauvegarde pas --// - HashSet<Object> listeToGroup=listeGroupToPerform.get(idGroup); - EbliNode nodeGroup=new EbliWidgetGroupAction(scenToUpdate).performGroup(listeToGroup); - - //-- on met a jour le ebliNode avec les infos du groupe sauv\xE9 --// - EbliWidgetSerializeXml infoGroup=listeGroupes.get(idGroup); - if(infoGroup!=null){ - nodeGroup.setTitle(infoGroup.getTitle()); - nodeGroup.getWidget().setPreferredLocation(new Point(infoGroup.getX(),infoGroup.getY())); - nodeGroup.getWidget().setPreferredSize(new Dimension(infoGroup.getWidth(),infoGroup.getHeight())); - - - } - } - //-- on ajoute les noeuds selectionnes a ebliScene --// - scenToUpdate.setSelectedObjects(listeNodeSelect); - // mise a jour de la scene - scenToUpdate.refresh(); + for (int i = 0; i < nbGroups; i++) { + EbliWidgetSerializeXml group = (EbliWidgetSerializeXml) in.readObject(); + listeGroupes.put(group.getId(), group); + } + + scenToUpdate.refresh(); + // -- on s'occupe de grouper l'ensemble des widgets --// + for (String idGroup : listeGroupToPerform.keySet()) { + // --l'idGroup est jetable, on ne le sauvegarde pas --// + HashSet<Object> listeToGroup = listeGroupToPerform.get(idGroup); + EbliNode... [truncated message content] |
From: <had...@us...> - 2008-10-14 15:20:25
|
Revision: 4058 http://fudaa.svn.sourceforge.net/fudaa/?rev=4058&view=rev Author: hadouxad Date: 2008-10-14 15:20:01 +0000 (Tue, 14 Oct 2008) Log Message: ----------- - Persistance des variables user par projet trpostsource - Test unitaires: les variables sont bien enregistr?\195?\169es et recharg?\195?\169es dans les projets. - Cr?\195?\169ation d'un r?\195?\169pertoire a part pour les texte - Refactorisation de la persistance .POST - cr?\195?\169ation de fileFormat - cr?\195?\169ation de filefilter - Gestion du chargement depuis le superviseur - Fichier setup.Post inclus dans le r?\195?\169pertoire du projet qu'il faut cliquer pour charger le projet. - Gestion des filters sp?\195?\169cifiques pour les post layouts - Icone informe pour le fichier setup.post qu'il est executable - Mise en place Enregistrement/chargement des donn?\195?\169es sp?\195?\169cifiques des graphes m?\195?\169tier du post: - gestion poru le trpostcourbeTreeModel - gestion pour le mvprofilecourbeTreemodel - refactorisation du mvprofiletreemodel: - recuperation de la ligne qui a servi a construire le graphe dans le MvProfileBuilder. - Mise en place de la sauvegarde du zeblicalquePanel. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsMng.java branches/Prepro-0.92-SNAPSHOT/dodico/test/org/fudaa/dodico/ef/TestJLineIntersection.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/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.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/TrLauncherDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrLauncher.java 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/TrPostCourbeTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreationPanel.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/TrPostUserVariableSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostDialogBilan.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/persist/TrPostFileFilter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFormat.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -13,6 +13,7 @@ import com.memoire.fu.Fu; import com.memoire.fu.FuLog; +import com.vividsolutions.jts.geom.LineString; import org.fudaa.ctulu.ProgressionInterface; @@ -26,11 +27,16 @@ final EfLineIntersectionsCorrectionTester tester_; final TIntObjectHashMap pool_ = new TIntObjectHashMap(20); - public EfLineIntersectionsResultsBuilder(final EfLineIntersectionsResultsI _res, + + private final LineString initLine_; + + + public EfLineIntersectionsResultsBuilder(final LineString initLine,final EfLineIntersectionsResultsI _res, final EfLineIntersectionsCorrectionTester _tester) { super(); res_ = _res; tester_ = _tester; + initLine_=initLine; } public boolean isPresentInPool(int _tIdx) { @@ -63,4 +69,8 @@ public EfLineIntersectionsResultsI getInitRes() { return res_; } + +public LineString getInitLine_() { + return initLine_; } +} Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsMng.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsMng.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsMng.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -105,6 +105,10 @@ final boolean forMesh_; final EfGridDataInterpolator grid_; + + /** + * La ligne initialement utilis\xE9e poru g\xE9n\xE9rer la courbe depuis le calque. + */ final LineString initLine_; final boolean isInit_; final BitSet isOut_; @@ -145,7 +149,7 @@ } public EfLineIntersectionsResultsBuilder createBuilder(EfLineIntersectionsCorrectionTester _tester) { - return new EfLineIntersectionsResultsBuilder(getDefaultRes(), _tester); + return new EfLineIntersectionsResultsBuilder(initLine_,getDefaultRes(), _tester); } public EfLineIntersectionsResultsMng extract(final int _i1, final int _i2) { Modified: branches/Prepro-0.92-SNAPSHOT/dodico/test/org/fudaa/dodico/ef/TestJLineIntersection.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/test/org/fudaa/dodico/ef/TestJLineIntersection.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/dodico/test/org/fudaa/dodico/ef/TestJLineIntersection.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -101,12 +101,12 @@ private void testForCorrector(EfLineIntersectionsResultsI _mng) { - EfLineIntersectionsResultsBuilder builder = new EfLineIntersectionsResultsBuilder(_mng, null); + EfLineIntersectionsResultsBuilder builder = new EfLineIntersectionsResultsBuilder(null,_mng, null); EfLineIntersectionsResultsI res = builder.createResults(0, null); assertNotNull(res); assertTrue(_mng == res); - builder = new EfLineIntersectionsResultsBuilder(_mng, new DefaultTester()); + builder = new EfLineIntersectionsResultsBuilder(null,_mng, new DefaultTester()); res = builder.createResults(0, null); assertNotNull(res); assertFalse(_mng == res); 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 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -157,5 +157,24 @@ * @param _duplicator TODO */ public EGGrapheModel duplicate(EGGrapheDuplicator _duplicator); + + + + /** + * Retourne les donn\xE9es persistantes sp\xE9cifique du graphe model. + * Est utile pour les graphes de haut niveau m\xE9tier + * Ces donn\xE9es pourront etre facilement serializee par un parser xml, bdd, ou texte + * @return + */ + public Object getSpecificPersitDatas(); + + + /** + * Insere les donn\xE9es sp\xE9cifiques persistantes dans le modele. + *Ces donn\xE9es proviennent de fichier de sauvegardes (xml,texte,bdd...) + * @return + */ + public void setSpecificPersitDatas(Object sepcPersitData); + } \ 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 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -40,6 +40,7 @@ private XStream parser_; private static String MAINFILE="descriptorGraphe.xml"; + private static String SPECIFIQUEFILE="specificDatas.xml"; private static String COURBEDIRECTORY="courbes"; @@ -90,7 +91,16 @@ return directoryPath_+File.separator+MAINFILE; } + /** + * Retourne le chemin vers le fichier de datats specifiques. + * @return + */ + private String getSpecifiqueDataFilePath(){ + return directoryPath_+File.separator+SPECIFIQUEFILE; + } + + /** * Retourne la liste persistante des fichiers * @return */ @@ -119,10 +129,13 @@ * @param parameters des parametres supplementaires utiles. * @throws IOException */ - public void savePersitGrapheXml(EGGraphe grapheTopersist) throws IOException{ + public void savePersitGrapheXml(EGGraphe grapheTopersist) { String mainfile=getMainFilePath(); //-- outputstream du xstream pour enregistrement des diff\xE9rents groupes--// - ObjectOutputStream out = getParser().createObjectOutputStream(new FileWriter(mainfile)); + ObjectOutputStream out=null; + try { + out = getParser().createObjectOutputStream(new FileWriter(mainfile)); + //-- enregistrement des courbes --// // strategy pour la liste xml: aun fichier par courbe. File fichierCourbes=getDirectoryCurves(); @@ -173,7 +186,39 @@ out.writeObject(gp); } } - out.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally{ + try { + out.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + //-- on enregistre les donn\xE9es specifiques en fonction du type de grapheModel --// + Object specifiquesDatas=grapheTopersist.getModel().getSpecificPersitDatas(); + if(specifiquesDatas ==null ) + return; + try { + out = getParser().createObjectOutputStream(new FileWriter(new File(getSpecifiqueDataFilePath()))); + out.writeObject(specifiquesDatas); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally{ + try { + out.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } /** 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 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -799,4 +799,16 @@ return duplic; } +@Override +public Object getSpecificPersitDatas() { + // TODO Auto-generated method stub + return null; +} + +@Override +public void setSpecificPersitDatas(Object sepcPersitData) { + // TODO Auto-generated method stub + +} + } \ 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 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -1124,4 +1124,16 @@ this.selectionModel_ = selectionModel_; } +@Override +public Object getSpecificPersitDatas() { + // TODO Auto-generated method stub + return null; +} + +@Override +public void setSpecificPersitDatas(Object sepcPersitData) { + // TODO Auto-generated method stub + +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -2,10 +2,13 @@ import java.awt.Dimension; import java.awt.Point; +import java.io.File; +import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.fudaa.ebli.calque.ZEbliCalquesPanel; +import org.fudaa.ebli.courbe.EGGraphePersist; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; @@ -14,6 +17,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; +import org.fudaa.ebli.visuallibrary.persist.ManagerWidgetPersist; import org.w3c.dom.Element; public class EbliWidgetCreatorVueCalque implements EbliWidgetCreator { @@ -115,7 +119,19 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + //-- generation d'un identifiant unique pour le repertoire du graphe --// + // String pathUnique=parameters.get("pathGraphes")+File.separator+FuLib.clean(File.separator+parameters.get("nodeName"))+res.getIntern().getId(); + String pathUnique=ManagerWidgetPersist.generateCalquePath((String)parameters.get("pathCalques"), res.getEbliScene().findByWidgetId(res.getId())); + //- sauvegarde du contenu de l eggraphe dans un repertoire a part --// + + File createRep=new File(pathUnique); + if( createRep.mkdir() || createRep.isDirectory()){ + // (new FudaaFilleVisuPersistence(getCalque())).saveZEbliCalquesPanelIn + } + + + + return pathUnique; } @Override Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -95,7 +95,7 @@ //ecriture du contenu html dans ce fichier FileWriter writer; try { - String path=(String)parameters.get("path"); + String path=(String)parameters.get("pathTexte"); if(path !=null){ File contenu=new File(path+File.separator+"contenu"+parameters.get("nodeName")+getWidget().getId()+".html"); writer = new FileWriter(contenu); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -136,7 +136,7 @@ @Override public void setPersistData(Object data, Map parameters) { // TODO Auto-generated method stub - EGGrapheModel modele; + EGGrapheModel modele=null; if(data==null) modele=new EGGrapheTreeModel(); else{ Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -49,9 +49,18 @@ } +/** + * Genere un path vers l objetc calque + * @param path + * @param nodeCalque + * @return + */ + public static String generateCalquePath(String path, EbliNode nodeCalque){ + + return path+File.separator+File.separator+FuLib.clean(nodeCalque.getTitle())+nodeCalque.getWidget().getId(); + + } - - Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -24,6 +24,7 @@ import org.fudaa.ebli.calque.BCalquePersistenceGroupe; import org.fudaa.ebli.calque.BCalqueSaverInterface; import org.fudaa.ebli.calque.BGroupeCalque; +import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.calque.ZEbliFilleCalques; import org.fudaa.ebli.geometrie.GrBoite; @@ -32,16 +33,54 @@ * @version $Id: FudaaFilleVisuPersistence.java,v 1.9 2007-06-20 12:23:38 deniger Exp $ */ public class FudaaFilleVisuPersistence implements FudaaSavable { - - final ZEbliFilleCalques visu_; + + ZEbliFilleCalques visu_; String rep_ = "data"; - + /** + * Cas ou l'on veut sauvegarder directement un calquePanel + */ + ZEbliCalquesPanel calquepanel_; + + /** + * constructeur reserv\xE9 au ZEbliFilleCalques + * @param _visu + */ public FudaaFilleVisuPersistence(final ZEbliFilleCalques _visu) { super(); FudaaSaveLib.configureDb4o(); visu_ = _visu; } + + /** + * constructeur reserv\xE9 au ZEbliCalquesPanel + * @param _visu + */ + public FudaaFilleVisuPersistence(final ZEbliCalquesPanel _visu) { + super(); + FudaaSaveLib.configureDb4o(); + calquepanel_ = _visu; + } + /** + * Methode utilisee pour sauvegarder le zeblicalquepanel. + * @param _writer + * @param _prog + */ + public void saveZEbliCalquesPanelIn(final FudaaSaveZipWriter _writer, final ProgressionInterface _prog) { + try { + final BGroupeCalque donneesCalque = calquepanel_.getDonneesCalque(); + _writer.createDir(rep_, donneesCalque.getTousCalques().length + 1); + final BCalquePersistenceGroupe persistenceMng = donneesCalque.getGroupePersistenceMng(); + persistenceMng.setTop(true); + commitData(_writer.getDb(), persistenceMng.saveIn(donneesCalque, _writer, rep_ + '/', rep_), _prog); + } catch (final IOException _evt) { + FuLog.error(_evt); + + } + } + + + public void saveIn(final FudaaSaveZipWriter _writer, final ProgressionInterface _prog) { try { final BGroupeCalque donneesCalque = visu_.getDonneesCalque(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -83,8 +83,13 @@ public final CtuluUI ui_; + /** + * La ligne originelle qui a servie a creer lea courbe + */ + private final LineString initLine_; + public MvProfileBuilder(final MvProfileTarget _data, final ZEbliCalquesPanel _panel, - EfLineIntersectionsCorrectionTester _tester) { + EfLineIntersectionsCorrectionTester _tester,final LineString _selected) { super(); data_ = _data; panel_ = _panel; @@ -93,6 +98,7 @@ act_ = new EfLineIntersectorActivity(data_.getData(), data_.getInterpolator()); ui_ = panel_.getCtuluUI(); timeModel_ = _data.getTimeModel(); + initLine_=_selected; } MvExportChooseVarAndTime createVarTimeChooser(final String _help) { @@ -455,7 +461,8 @@ public EfLineIntersectionsResultsBuilder getMeshesResultBuilder(final ProgressionInterface _prog) { EfLineIntersectionsResultsMng meshes = getMeshResultsMng(_prog); - if (meshesResultBuilder_ == null) meshesResultBuilder_ = new EfLineIntersectionsResultsBuilder(meshes + + if (meshesResultBuilder_ == null) meshesResultBuilder_ = new EfLineIntersectionsResultsBuilder(initLine_,meshes .getDefaultRes(), tester_); return meshesResultBuilder_; } @@ -467,7 +474,7 @@ public EfLineIntersectionsResultsBuilder getNodeResultBuilder(final ProgressionInterface _prog) { EfLineIntersectionsResultsMng nodes = getNodeResultsMng(_prog); - if (nodesResultBuilder_ == null) nodesResultBuilder_ = new EfLineIntersectionsResultsBuilder(nodes.getDefaultRes(), + if (nodesResultBuilder_ == null) nodesResultBuilder_ = new EfLineIntersectionsResultsBuilder(initLine_,nodes.getDefaultRes(), tester_); return nodesResultBuilder_; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -26,7 +26,7 @@ public MvProfileBuilderFromLine(final MvProfileTarget _data, final CtuluUI _ui, final LineString _line, final ZEbliCalquesPanel _panel, EfLineIntersectionsCorrectionTester _tester) { - super(_data, _panel, _tester); + super(_data, _panel, _tester,_line); selectedLine_ = _line; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -73,7 +73,7 @@ public MvProfileBuilderFromTree(final MvProfileTarget _data, final CtuluUI _ui, final LineString _selected, final ZEbliCalquesPanel _panel, EfLineIntersectionsCorrectionTester _tester) { - super(_data, _panel, _tester); + super(_data, _panel, _tester,_selected); lineTreeModel_ = new CalqueFindCourbeTreeModel(null, _panel.getDonneesCalque()); initSelected_ = _selected; calque_ = _panel; 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 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -553,8 +553,8 @@ builderMesh_ = null; resNode_ = _newRes; resMesh_ = _newResMesh; - if (resNode_ != null) builderNode_ = new EfLineIntersectionsResultsBuilder(resNode_.getDefaultRes(), tester_); - if (resMesh_ != null) builderMesh_ = new EfLineIntersectionsResultsBuilder(resMesh_.getDefaultRes(), tester_); + if (resNode_ != null) builderNode_ = new EfLineIntersectionsResultsBuilder(_newRes.getInitLine(),resNode_.getDefaultRes(), tester_); + if (resMesh_ != null) builderMesh_ = new EfLineIntersectionsResultsBuilder(_newRes.getInitLine(),resMesh_.getDefaultRes(), tester_); if (paletteGrid_ != null) { BuLib.invokeLater(new Runnable() { public void run() { @@ -679,4 +679,18 @@ public void setTarget_(MvProfileTarget target_) { this.target_ = target_; } + + +@Override +public Object getSpecificPersitDatas() { + // TODO Auto-generated method stub + return "JE suis une courbe de profile spatial de la mort"; } + +@Override +public void setSpecificPersitDatas(Object sepcPersitData) { + // TODO Auto-generated method stub + super.setSpecificPersitDatas(sepcPersitData); +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -58,6 +58,7 @@ import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrPreferences; import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.reflux.TrRefluxImplHelper; import org.fudaa.fudaa.tr.rubar.TrRubarImplHelper; import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper; @@ -423,6 +424,41 @@ mesh.cmdOuvrirFile(_f); } + + /** + * Methode appelee pour generer le trpost avec le ficheir de layout ouvert. + */ + public TrPostImplementation openLayoutPost(final File _f) { + final TrPostImplementation alreadyOpened = findPostWithOpenedFile(_f); + if (alreadyOpened != null) { + alreadyOpened.setMainErrorAndClear(TrLib.getMessageAlreadyOpen(_f)); + alreadyOpened.getFrame().setVisible(true); + alreadyOpened.getFrame().setState(Frame.NORMAL); + alreadyOpened.getFrame().requestFocus(); + // pour Rubar +// alreadyOpened.getCurrentProject().activate(_f); + return alreadyOpened; + + } + + final TrPostImplementation post = (TrPostImplementation) launch(null, TrLauncherDefault.this, + new TrPostImplementation()); + BuLib.invokeLater(new Runnable() { + + public void run() { + if (_f != null) { + + post.cmdOuvrirLayoutFile(_f); + } + } + + }); + + return post; + + } + + public TrPostImplementation openPost(final File _f) { final TrPostImplementation alreadyOpened = findPostWithOpenedFile(_f); if (alreadyOpened != null) { @@ -436,6 +472,7 @@ } + final TrPostImplementation post = (TrPostImplementation) launch(null, TrLauncherDefault.this, new TrPostImplementation()); BuLib.invokeLater(new Runnable() { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -44,6 +44,8 @@ import org.fudaa.fudaa.ressource.FudaaResource; import org.fudaa.fudaa.tr.TrEditorImplementation; import org.fudaa.fudaa.tr.post.TrPostAnalyze; +import org.fudaa.fudaa.tr.post.persist.TrPostFileFilter; +import org.fudaa.fudaa.tr.post.persist.TrPostFileFormat; import org.fudaa.fudaa.tr.rubar.TrRubarImplHelper; import org.fudaa.fudaa.tr.telemac.TrMatisseConvertGUI; @@ -467,6 +469,16 @@ } return res; } +// if (getFileFilterFor(TrPostFileFormat.getInstance()).accept(null, name)) { +// final String res = TrResource.getS("Projet Post"); +// if (_lb == null) { +// //launcher_.ouvrirHydEditor(FileFormatSoftware.RUBAR_IS.name, _file); +// } else { +// _lb.setIcon(getFileFilterFor(TrPostFileFormat.getInstance()).getIcon()); +// } +// return res; +// } + return null; } @@ -484,6 +496,26 @@ return null; } + /** + * Methode appelee pour ouvrir un fichier layout + * @param _f + * @param _lb + * @return + */ + protected String ouvrirPostLayout(final VfsFile _f, final AbstractButton _lb) { + //--si le format est du type *.POST + if (isPostLayoutFormat(_f)) { + final String res = TrResource.getPostName(); + if (_lb == null) { + launcher_.openLayoutPost(_f); + } else { + _lb.setIcon(TrResource.getPostIcon()); + } + return res; + } + return null; + } + protected String ouvrirPost(final VfsFile _f, final AbstractButton _lb) { if (isPostFormat(_f)) { final String res = TrResource.getPostName(); @@ -513,6 +545,14 @@ if (res != null) { return res; } + + //-- tentative ouverture fichier type layout --// + res = ouvrirPostLayout(_f, _lb); + if (res != null) { + return res; + } + + final String name = _f.getName(); if (getTxtFileFilter().accept(null, name)) { if (_lb != null) { @@ -779,6 +819,15 @@ } /** + * Retourne true si il s'agit d'un format layout + * @param _file + * @return + */ + public boolean isPostLayoutFormat(final File _file) { + return TrPostFileFormat.getInstance().createFileFilter().accept(_file); + } + + /** * @param _file le fichier a tester * @return true si supporte par l'editeur */ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -27,6 +27,7 @@ import org.fudaa.dodico.telemac.io.SerafinFileFormat; import org.fudaa.dodico.trigrid.TrigridFileFormat; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; +import org.fudaa.fudaa.tr.post.persist.TrPostFileFormat; import org.fudaa.fudaa.tr.reflux.TrRefluxImplHelper; import org.fudaa.fudaa.tr.rubar.TrRubarImplHelper; import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper; @@ -74,6 +75,8 @@ r.add(DunesFileFormat.getInstance()); } r.add(SerafinFileFormat.getInstance()); + + return getArray(r); } @@ -170,6 +173,8 @@ r.add(RefluxRefondeSolutionFileFormat.getInstance()); r.add(SerafinFileFormat.getInstance()); } + + return getArray(r); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -114,6 +114,9 @@ if (mng_.isPostFormat(_file)) { return TrResource.getPostIcon(); } + if (mng_.isPostLayoutFormat(_file)) { + return TrResource.getPostIcon(); + } if (mng_.getTxtFileFilter().accept(_file)) { return BuResource.BU.getToolIcon("texte"); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrLauncher.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrLauncher.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrLauncher.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -47,7 +47,13 @@ */ TrPostImplementation openPost(File _f); + /** + * @param _f le fichier layout a ouvrir dans la fenetre de post. + */ + TrPostImplementation openLayoutPost(File _f); + + /** * @param _f le fichier a ouvrir dans la fenetre de visu de maillage. */ void openMeshView(File _f); 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 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -108,6 +108,7 @@ BuLib.invokeNowOrLater(new Runnable() { public void run() { setEnabledForAction("ENREGISTRER", true); + setEnabledForAction("ENREGISTRERSOUS", true); setEnabledForAction("IMPORTER", true); setEnabledForAction(getImportResultsAct(), true); setEnabledForAction("IMPORT_PROJECT", true); @@ -163,7 +164,7 @@ if(reponse==JOptionPane.OK_OPTION){ c_.getManager().clearProject(); } - c_.getManager().loadProject(); + c_.getManager().loadProject(false,null); } else @@ -182,11 +183,23 @@ //c_.save(TrPostCommonImplementation.this, createProgressionInterface(this)); //-- enregistrement sauce widget --// - c_.getManager().saveProject(); + c_.getManager().saveProject(false); } }.start(); - } + }else if ("ENREGISTRERSOUS".equals(com) && c_ != null) { + new CtuluTaskOperationGUI(this, TrResource.getS("Enregistrement Sous")) { + + 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(); // } @@ -202,7 +215,35 @@ 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); + } + }); + + } + public void cmdOuvrirFile(final File _f) { final TrPostCommonImplementation alreadyOpen = getLauncher().findPostWithOpenedFile(_f); if (alreadyOpen == null) { @@ -213,4 +254,6 @@ } } + + } \ 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 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -54,8 +54,10 @@ public class TrPostCourbeTreeModel extends EGGrapheTreeModel implements TrPostTimeContentListener, Target { - final FudaaCommonImplementation impl_; + +final FudaaCommonImplementation impl_; + Set intepolPt_; private final boolean isAllTimeStep_; @@ -895,5 +897,17 @@ return duplic; } + + @Override + public Object getSpecificPersitDatas() { + // TODO Auto-generated method stub + return "JE suis une courbe de profile temporel de la mort"; + } + @Override + public void setSpecificPersitDatas(Object sepcPersitData) { + // TODO Auto-generated method stub + super.setSpecificPersitDatas(sepcPersitData); + } + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreationPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreationPanel.java 2008-10-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreationPanel.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -583,8 +583,8 @@ JDialog dial = CtuluLibSwing.createDialogOnActiveWindow(TrLib.getString("G\xE9rer les variables")); dial.setContentPane(pn); JMenu tb = new JMenu(TrLib.getString("Edition")); - tb.add(new CtuluCommandAction.Undo(cmd)); - tb.add(new CtuluCommandAction.Redo(cmd)); +// tb.add(new CtuluCommandAction.Undo(cmd)); +// tb.add(new CtuluCommandAction.Redo(cmd)); JMenuBar bar = new JMenuBar(); bar.add(tb); dial.setJMenuBar(bar); @@ -594,6 +594,7 @@ } }; BuLib.invokeNow(r); + } 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-14 15:02:06 UTC (rev 4057) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-14 15:20:01 UTC (rev 4058) @@ -95,1238 +95,1235 @@ */ private TrPostPersistenceManager manager_; - + public TrPostPersistenceManager getManager(){ if(manager_==null) - manager_=new TrPostPersistenceManager(this); - + manager_=new TrPostPersistenceManager(this); + return manager_; } - - private class TimeContentUpdater implements ListDataListener { - protected TimeContentUpdater() { + private class TimeContentUpdater implements ListDataListener { - } + protected TimeContentUpdater() { - protected void updateAll() { - // TODO a revoir - // if (fille_ != null && fille_.isVisible()) { - // if (CtuluLibMessage.DEBUG) { - // CtuluLibMessage.debug("update fill time format"); - // } - // final TrPostVisuPanel panel = (TrPostVisuPanel) fille_.getVisuPanel(); - // final BCalque[] cqs = panel.getDonneesCalque().getCalques(); - // for (int i = cqs.length - 1; i >= 0; i--) { - // final BCalque calque = cqs[i]; - // if (calque instanceof TrPostFlecheLayer) { - // ((TrPostFlecheLayer) calque).timeStepFormatChanged(); - // } else if (calque instanceof TrIsoLayerDefault) { - // ((TrIsoLayerDefault) calque).timeStepFormatChanged(); - // } - // } - // final TrPostFlecheLayer flecheLayer = panel.getFlecheLayer(); - // if (flecheLayer != null) { - // flecheLayer.timeStepFormatChanged(); - // } - // final TrIsoLayer liso = panel.getIsoLayer(); - // if (liso != null && liso.isVisible()) { - // liso.timeStepFormatChanged(); - // } - // if (!fille_.getArbreCalqueModel().getTreeSelectionModel().isSelectionEmpty()) { - // final TreePath[] path = fille_.getArbreCalqueModel().getTreeSelectionModel().getSelectionPaths(); - // fille_.getArbreCalqueModel().getTreeSelectionModel().clearSelection(); - // fille_.getArbreCalqueModel().getTreeSelectionModel().setSelectionPaths(path); - // } - // } - setProjectModified(); - } + } - public void contentsChanged(final ListDataEvent _event) { - updateAll(); - } + protected void updateAll() { + // TODO a revoir + // if (fille_ != null && fille_.isVisible()) { + // if (CtuluLibMessage.DEBUG) { + // CtuluLibMessage.debug("update fill time format"); + // } + // final TrPostVisuPanel panel = (TrPostVisuPanel) fille_.getVisuPanel(); + // final BCalque[] cqs = panel.getDonneesCalque().getCalques(); + // for (int i = cqs.length - 1; i >= 0; i--) { + // final BCalque calque = cqs[i]; + // if (calque instanceof TrPostFlecheLayer) { + // ((TrPostFlecheLayer) calque).timeStepFormatChanged(); + // } else if (calque instanceof TrIsoLayerDefault) { + // ((TrIsoLayerDefault) calque).timeStepFormatChanged(); + // } + // } + // final TrPostFlecheLayer flecheLayer = panel.getFlecheLayer(); + // if (flecheLayer != null) { + // flecheLayer.timeStepFormatChanged(); + // } + // final TrIsoLayer liso = panel.getIsoLayer(); + // if (liso != null && liso.isVisible()) { + // liso.timeStepFormatChanged(); + // } + // if (!fille_.getArbreCalqueModel().getTreeSelectionModel().isSelectionEmpty()) { + // final TreePath[] path = fille_.getArbreCalqueModel().getTreeSelectionModel().getSelectionPaths(); + // fille_.getArbreCalqueModel().getTreeSelectionModel().clearSelection(); + // fille_.getArbreCalqueModel().getTreeSelectionModel().setSelectionPaths(path); + // } + // } + setProjectModified(); + } - public void intervalAdded(final ListDataEvent _event) { - updateAll(); - } + public void contentsChanged(final ListDataEvent _event) { + updateAll(); + } - public void intervalRemoved(final ListDataEvent _event) { - updateAll(); - } - } + public void intervalAdded(final ListDataEvent _event) { + updateAll(); + } - class ModifyObserver implements Observer { + public void intervalRemoved(final ListDataEvent _event) { + updateAll(); + } + } - private boolean isModified_; + class ModifyObserver implements Observer { - protected void clearModified() { - isModified_ = false; - updateFrameState(); - } + private boolean isModified_; - protected void updateFrameState() { - if (impl_ != null) { - impl_.setEnabledForAction("ENREGISTRER", isModified_); - changedMainFrameState(); - } - } + protected void clearModified() { + isModified_ = false; + updateFrameState(); + } - public boolean isModified() { - return isModified_; - } + protected void updateFrameState() { + if (impl_ != null) { + impl_.setEnabledForAction("ENREGISTRER", isModified_); + impl_.setEnabledForAction("ENREGISTRERSOUS", isModified_); + changedMainFrameState(); + } + } - public void setModified() { - isModified_ = true; - updateFrameState(); - } + public boolean isModified() { + return isModified_; + } - public void update(final Observable _o, final Object _arg) { - setModified(); - } + public void setModified() { + isModified_ = true; + updateFrameState(); + } - } + public void update(final Observable _o, final Object _arg) { + setModified(); + } - class VariableListener implements TrPostDataListener { + } - public void dataAdded(final boolean _isFleche) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataAdded(_isFleche); - } - } - } - setProjectModified(); - } + class VariableListener implements TrPostDataListener { - public void dataChanged(final H2dVariableType _old, final H2dVariableType _new, final boolean _contentChanged, - final boolean _isFleche, final Set _varDepending) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataChanged(_old, _new, _contentChanged, _isFleche, _varDepending); - } - } - } - setProjectModified(); - } + public void dataAdded(final boolean _isFleche) { + if (impl_ == null) { return; } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataAdded(_isFleche); + } + } + } + setProjectModified(); + } - public void dataRemoved(final H2dVariableType[] _vars, final boolean _isFleche) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataRemoved(_vars, _isFleche); - } - } - } - setProjectModified(); - } + public void dataChanged(final H2dVariableType _old, final H2dVariableType _new, final boolean _contentChanged, + final boolean _isFleche, final Set _varDepending) { + if (impl_ == null) { return; } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataChanged(_old, _new, _contentChanged, _isFleche, _varDepending); + } + } + } + setProjectModified(); + } - } + public void dataRemoved(final H2dVariableType[] _vars, final boolean _isFleche) { + if (impl_ == null) { return; } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataRemoved(_vars, _isFleche); + } + } + } + setProjectModified(); + } - // transient TrPostFille fille_; - // - // /** - // * Fenetre fille qui contient le layout scene. Cette fenetre remplace petit a petit fille_ - // */ - // // protected transient TrPostLayoutFille filleLayout_; - // ArrayList<TrPostLayoutFille> listeFillesLayout = new ArrayList<TrPostLayoutFille>(); + } - /** - * liste des noeuds pour gerer le cut/copy/paste avec en + le undo/redo - */ - // liste des noeuds copies - Set<EbliNode> nodesCopyied = null; - // liste des noeuuds coupes - Set<EbliNode> nodesCutted = null; + // transient TrPostFille fille_; + // + // /** + // * Fenetre fille qui contient le layout scene. Cette fenetre remplace petit a petit fille_ + // */ + // // protected transient TrPostLayoutFille filleLayout_; + // ArrayList<TrPostLayoutFille> listeFillesLayout = new ArrayList<TrPostLayoutFille>(); - // /** - // *ajout une fillelayout a la liste des frame layout - // * - // * @param _fille - // */ - // public void addFillesLayout(TrPostLayoutFille _fille) { - // listeFillesLayout.add(_fille); - // } + /** + * liste des noeuds pour gerer le cut/copy/paste avec en + le undo/redo + */ + // liste des noeuds copies + Set<EbliNode> nodesCopyied = null; + // liste des noeuuds coupes + Set<EbliNode> nodesCutted = null; - // /** - // * retourne la frame layout en cours d utilisation par le user. sinon retourne la premiere fille. IMPORTANT: il faut - // * passer par cette methode pour etre root\xE9 vers la bonne scene en cours de manip. - // * - // * @return - // */ - // public TrPostLayoutFille getSelectedFilleLayout() { - // for (Iterator<TrPostLayoutFille> it = listeFillesLayout.iterator(); it.hasNext();) { - // TrPostLayoutFille fille = it.next(); - // if (fille.isSelected()) return fille; - // } - // // sinon retourne la premier frame - // return listeFillesLayout.get(0); - // } + // /** + // *ajout une fillelayout a la liste des frame layout + // * + // * @param _fille + // */ + // public void addFillesLayout(TrPostLayoutFille _fille) { + // listeFillesLayout.add(_fille); + // } - /** - * internalframe qui gere les multiProjets - */ - public TrPostProjetsManagerFille filleProjetctManager_; + // /** + // * retourne la frame layout en cours d utilisation par le user. sinon retourne la premiere fille. IMPORTANT: il faut + // * passer par cette methode pour etre root\xE9 vers la bonne scene en cours de manip. + // * + // * @return + // */ + // public TrPostLayoutFille getSelectedFilleLayout() { + // for (Iterator<TrPostLayoutFille> it = listeFillesLayout.iterator(); it.hasNext();) { + // TrPostLayoutFille fille = it.next(); + // if (fille.isSelected()) return fille; + // } + // // sinon retourne la premier frame + // return listeFillesLayout.get(0); + // } - /** - * Le menu du post qui contient tout les sous menus des projets - */ - BuMenu menuPost_; - BuMenu menuLayout_ = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER");; - List<BuMenu> listeMenuProjets_; + /** + * internalframe qui gere les multiProjets + */ + public TrPostProjetsManagerFille filleProjetctManager_; - List<ArrayList<BuMenuItem>> listeSousMenuProjets_; + /** + * Le menu du post qui contient tout les sous menus des projets + */ + BuMenu menuPost_; + BuMenu menuLayout_ = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER");; + List<BuMenu> listeMenuProjets_; - /** - * Observable custom reserv\xE9 aux modifs apport\xE9es a la liste des src. - * - * @author Adrien Hadoux - */ - class observableSupport extends Observable { - @Override - public void notifyObservers() { - this.setChanged(); - super.notifyObservers(); - } + List<ArrayList<BuMenuItem>> listeSousMenuProjets_; - @Override - public void notifyObservers(final Object arg) { - this.setChanged(); - super.notifyObservers(arg); - } + /** + * Observable custom reserv\xE9 aux modifs apport\xE9es a la liste des src. + * + * @author Adrien Hadoux + */ + class observableSupport extends Observable { + @Override + public void notifyObservers() { + this.setChanged(); + super.notifyObservers(); + } - } + @Override + public void notifyObservers(final Object arg) { + this.setChanged(); + super.notifyObservers(arg); + } - - private observableSupport observable; + } - public observableSupport getObservable() { - if (observable == null) observable = new observableSupport(); - return observable; - } - public void notifyObservers() { - // getObservable().setChanged(); + private observableSupport observable; - getObservable().notifyObservers(); + public observableSupport getObservable() { + if (observable == null) observable = new observableSupport(); + return observable; + } - } + public void notifyObservers() { + // getObservable().setChanged(); - transient int idxFilleG_; + getObservable().notifyObservers(); - public transient TrPostCommonImplementation impl_; + } - ModifyObserver modifyState_ = new ModifyObserver(); + transient int idxFilleG_; - /** - * Donnees courantes du trpost. - */ - // transient TrPostSource src_; - /** - * liste des sources pour le multiProjet. - */ - public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>(); + public transient TrPostCommonImplementation impl_; - transient TimeContentUpdater timeUpdater_; + ModifyObserver modifyState_ = new ModifyObserver(); - public TrPostProjet(final TrPostCommonImplementation _impl) { - this(null, _impl); + /** + * Donnees courantes du trpost. + */ + // transient TrPostSource src_; + /** + * liste des sources pour le multiProjet. + */ + public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>(); - } + transient TimeContentUpdater timeUpdater_; - public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) { - if (_src != null) - ajouterSource(_src); + public TrPostProjet(final TrPostCommonImplementation _impl) { + this(null, _impl); - // -- creation de la frame de gestion multi projet --// - filleProjetctManager_ = new TrPostProjetsManagerFille(this); - impl_ = _impl; + } - } + public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) { + if (_src != null) + ajouterSource(_src); - /** - * Permet d ajouter une source dans le projet afin de gerer le multi source. On doit toujorus passer par cette methode - * pour ajouter une source. - * - * @param _src - */ - public void ajouterSource(final TrPostSource _src) { - _src.addVariableListener(new VariableListener()); - if (_src.getFile() == null || !isSourceLoaded(_src.getFile().getAbsolutePath())) { - listeSrc_.add(_src); + // -- creation de la frame de gestion multi projet --// + filleProjetctManager_ = new TrPostProjetsManagerFille(this); + impl_ = _impl; - // -- ajout du menu correspondant uniquement a partir de la 2eme --// - // if (listeSrc_.size()>1 || (menuPost_!=null &&)) - construitMenuPostSpecifiqueSource(_src); + } - } else { - // -- messqge d erreur: le fichier est deja ouvert --// - new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), "Le fichier est deja ouvert.").activate(); + /** + * Permet d ajouter une source dans le projet afin de gerer le multi source. On doit toujorus passer par cette methode + * pour ajouter une source. + * + * @param _src + */ + public void ajouterSource(final TrPostSource _src) { + _src.addVariableListener(new VariableListener()); + if (_src.getFile() == null || !isSourceLoaded(_src.getFile().getAbsolutePath())) { + listeSrc_.add(_src); - } + // -- ajout du menu correspondant uniquement a partir de la 2eme --// + // if (listeSrc_.size()>1 || (menuPost_!=null &&)) + construitMenuPostSpecifiqueSource(_src); - } + } else { + // -- messqge d erreur: le fichier est deja ouvert --// + new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), "Le fichier est deja ouvert.").activate(); + } - /** - * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. - * - * @param _file : path absolu du fichier - * @return - */ - public TrPostSource findSource(final String _file) { + } - for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { - final TrPostSource src = it.next(); - if (src.getFile().getAbsolutePath().equals(_file)) return src; - } - return null; - } + /** + * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. + * + * @param _file : path absolu du fichier + * @return + */ + public TrPostSource findSource(final String _file) { - /** - * indique si il existe une source portant le nom du fichier en param. - * - * @param _file : path absolu du fichier - * @return - */ - public boolean isSourceLoaded(final String _file) { - if (findSource(_file) == null) return false; - return true; - } + for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { + final TrPostSource src = it.next(); + if (src.getFile().getAbsolutePath().equals(_file)) return src; + } - // /** - // * methode qui change la source courante et retourne true si la source existe bien, false sinon - // * - // * @param _file : path absolu du fichier - // * @return - // */ - // public boolean changeSource(final TrPostSource _src) { - // - // src_ = _src; - // - // return true; - // } + return null; + } - /** - * Methode de suppression de la source - * - * @param src : TrPostSource, retourne true si la suppression a bien ete effectuee. - */ - public boolean removeSource(final TrPostSource src, final int n) { + /** + * indique si il existe une source portant le nom du fichier en param. + * + * @param _file : path absolu du fichier + * @return + */ + public boolean isSourceLoaded(final String _file) { + if (findSource(_file) == null) return false; + return true; + } - if (isSourceLoaded(src.getFile().getAbsolutePath())) { - listeSrc_.remove(src); + // /** + // * methode qui change la source courante et retourne true si la source existe bien, false sinon + // * + // * @param _file : path absolu du fichier + // * @return + // */ + // public boolean changeSource(final TrPostSource _src) { + // + // src_ = _src; + // + // return true; + // } - // --recuperation du menu simul --// - final BuMenu menuSimul = getlisteMenuProjets_().get(n); + /** + * Methode de suppression de la source + * + * @param src : TrPostSource, retourne true si la suppression a bien ete effectuee. + */ + public boolean removeSource(final TrPostSource src, final int n) { - // --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); - // } + if (isSourceLoaded(src.getFile().getAbsolutePath())) { + listeSrc_.remove(src); - // -- on retire le menuSimul de la liste --// - menuPost_.remove(menuSimul); + // --recuperation du menu simul --// + final BuMenu menuSimul = getlisteMenuProjets_().get(n); - // -- on retire de la liste des menus le menusimul et la liste des sous - // menus --// - getlisteMenuProjets_().remove(n); - getlisteSousMenuProjets_().remove(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); + // } - // -- mise a jour de la barre des menus --// - impl_.getMainMenuBar().revalidate(); + // -- on retire le menuSimul de la liste --// + menuPost_.remove(menuSimul); - return true; - } else { - // -- messqg... [truncated message content] |
From: <de...@us...> - 2008-10-14 21:47:17
|
Revision: 4060 http://fudaa.svn.sourceforge.net/fudaa/?rev=4060&view=rev Author: deniger Date: 2008-10-14 21:47:04 +0000 (Tue, 14 Oct 2008) Log Message: ----------- mise en forme Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeSurfacePainterConfigure.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGDialog.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFilleSimple.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFilleTree.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/EGGroupPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGInteractionDeplacementPoint.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGInteractionSelection.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGPaletteInfo.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGSimplificationAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableGraphePanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTransfoLib.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTreeCellRenderer.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGVue.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/DefaultObjectSceneListener.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliLookFeel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetComponent.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerActionOnly.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerForGroup.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerMenuOnly.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCursorProvider.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetDBLFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetEditModeListener.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroup.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetImage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetSynchroniser.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandBringToFront.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandMasquer.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandMove.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandRetaillage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandSupprimer.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoBloque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoCreation.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoCut.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoPaste.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeBringToBack.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeChangeWidgetScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeDuplicate.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeUndoRedoGraphicalProperties.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliActionEditorOneClick.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliAlignWithMoveStrategyProvider.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionAlign.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionConfigure.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionFont.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageHorizontal.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageVertical.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionSimple.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/WidgetConfigure.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/animation/EbliWidgetAnimAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/animation/EbliWidgetAnimTreeNode.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/animation/EbliWidgetAnimateTreeTableModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/animation/EbliWidgetAnimatedItem.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/animation/EbliWidgetAnimationComposition.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetPlage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorCircle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorEllipse.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorRectangle.java 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/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGrapheController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetLine.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetTitle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheTreeCellRenderer.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManager.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManagerOLD.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/layout/GroupLayout.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/layout/OverlayLayoutGap.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliJXTreeTableCellRenderer.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTreeTableModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetTreeTableNode.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/MvActModifyDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/MvActView.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/MvControlResult.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/MvControllerSrc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/MvLayerGrid.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/MvParentInterface.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/MvResource.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/MvSelectionNodeOrEltData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/action/MvItemActionsPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvCheckElementLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvCheckElementModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvCheckLayerGroup.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvCheckNodeLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvCheckNodeModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvControlAngle.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvControlArea.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvControlElementOrientation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvControlElementResult.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvControlItemUI.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvControlNodeResult.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvControlOverstressed.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvControlPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExport4T3.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportActAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportActDataStoreSrc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportActGrid.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportActInterface.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportActSerafin.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportActX3D.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportAdaptI.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportChooseVarAndTime.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportCorEleBthGridAct.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportDecorator.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportDecoratorEltData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportDecoratorNodeData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportDecoratorTranslation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportFactory.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportFilterBuilderInterface.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportFilterBuilderSelectedElt.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportFilterBuilderSelectedPoint.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportFilterBuilderSimple.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportFilterBuilderTime.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportPanelFilter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportPanelFilterDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportRubarTaskSkeleton.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportSerafinFormatAdapter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportSourceFilterActivity.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportSrcTimeAdapter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportT6Activity.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportT6T3Activity.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportTaskSkeleton.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportToNodeDataActivity.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportToT3Activity.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/export/MvExportX3D.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/filter/MvFilterSelectedElement.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/filter/MvFilterSelectedNode.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/impl/MvActCheckDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/impl/MvActLoadDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/impl/MvInternalFrame.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MVFindActionFrontierPt.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MVFlecheLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvEdgeNumberLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvElementLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvElementNumberLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvFindActionNodeElt.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvFindComponentFrontierPt.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvFrontierLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvFrontierLayerAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvFrontierPointLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvFrontierPolygonLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvGridLayerGroup.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvIsoElementPainter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvIsoPaintersLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvNodeLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvNodeNumberLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/Mv3DFrontierData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvEdgeModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvElementModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvElementModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvExpressionSupplierDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvExpressionSupplierElement.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvExpressionSupplierFrNode.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvExpressionSupplierNode.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvFlecheModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvFrontierModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvFrontierModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvInfoDelegate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvInfoDelegateAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvIsoPainterComparator.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvIsoPainterDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvIsoPainterFond.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvIsoPainterNone.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvNodeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvNodeModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvNumberDelegate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/model/MvNumberLayerI.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/modify/MvModifyItemUI.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/modify/MvModifyPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/persistence/MvFrontiere3DPersistence.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/MvProfileAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.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/MvProfileCoteTester.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbe.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeGroup.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeInterface.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeModelInterface.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeTime.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFillePanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFlowrateFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFlowrateVolumeBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileGridPalette.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileLayerModelForCourbe.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeFille.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/meshviewer/profile/MvVolumeAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvVolumePanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/Tr.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrChainePreferencePanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrEditorImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrInvocationHandler.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrMeshImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrPostImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrProjectManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrSingleMainPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrSoftUpdater.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrSupervisor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrSupervisorImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrUncaughtExceptionHandler.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/Tr3DBathy.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/Tr3DCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/Tr3DFactory.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/Tr3DImage.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/Tr3DInitialiser.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrBugCommentGenerator.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCommonImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeComboBoxRenderer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeComboboxModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeUseAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeUseCounter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeUseFinder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeUseFinderAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeUseResultsAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrEvolutionManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrExecBatchPreferencesPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrExplorer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrGrapheSimpleTimeFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrGrapheTreeTimeFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImplHelperAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImplementationEditorAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrLauncher.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrLib.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrParametres.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPreferences.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrProjectDispatcherListener.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrProjectImportPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrProjectPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrProjetCommon.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrResource.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrRubarCourbeTarageUseFinder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrRubarCourbeUseFinder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrRubarCourbeUseResults.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrSuffixeDocListener.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrAreteExprSupplier.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBcBoundaryBlockModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBcBoundaryBlockModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBcBoundaryLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBcBoundaryLayerAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBcBoundaryLegendPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBcBoundaryMiddleModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBcBoundaryMiddleModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBcLayerGroup.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBcPointModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBordTraceLigneData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrBoundaryLineEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrExpressionSupplierForData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrFilleVisu.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrFindActionFrontierPt.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrGisProjectEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrIconeInput.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrIconeOutput.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrInfoSenderDelegate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrInfoSenderH2dDelegate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrIsoPainter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrIsoPainterElement.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrLayerMulti.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrRefluxBcBoundaryMiddleLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrRubarAreteEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSIZone.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSaisiePoint.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiFlecheModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiInterpolAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiNodeLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiNodeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanEditorPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayerProperties.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfileSplitter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSiZoneOperation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrSolutionInitModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrValuesEditorBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVarTableModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanelEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/export/TrExportFactory.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/export/TrExportFilterItemHauteur.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/export/TrExportFilterItemHauteurAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/export/TrExportFilterItemHauteurTime.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/export/TrExportPanelFilterFactory.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/export/TrExportRefluxSovAct.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/export/TrExportRefluxSovAdapter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/export/TrExportRubarDonneesBrutesAdapter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/export/TrExportRubarInxCoxAct.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/persistence/TrPostFlecheLayerPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/persistence/TrPostIsoLayerPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/persistence/TrSiPlanLayerPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/persistence/TrSiProfilLayerPersistence.java 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/TrFrontierLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerConfigure.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/TrIsoLayerSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAdder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizard.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizardListValue.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoModelAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoModelEltDataAdapter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostAnalyze.java 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/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/TrPostCourbeFille.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/TrPostCourbeRemoveVariableAction.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/TrPostDataCreated.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedConstant.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedCstTime.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedCstTimeSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedExpr.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedFroud.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedImport.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedMoins.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/TrPostDataCreatedNorme3D.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedPlus.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedRubarBathy.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedRubarVitesse.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreatedStatistic.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreationActions.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreationFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreationPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataEditCommonPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataEditCstPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataEditExprPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataEditStatisticPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataInfoDoc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataMinMaxGlobalItem.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataUserVarModel.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/TrPostExprDataSupplier.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostExprFlecheSupplier.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFilterConfigure.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFilterDefaultValuePanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFilterHauteur.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFilterHauteurElement.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFilterHauteurEnvRubar.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFilterHauteurPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFilterLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFilterSelecteur.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFilterVarPanel.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/TrPostFlecheLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheLayerSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostImportProjetTableModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInfoDelegate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspector.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorPanelBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorReaderReflux.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorReaderRubar.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorReaderSerafin.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMinMaxTableModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMinPaletteTableModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostModelInterface.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostPaletteTime.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProfileFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjectCompPanel.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/TrPostProjetChooser.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetCompTimeStepPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarBcEdgeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarEdgeFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarEdgeTreeFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarEdgesResults.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarEnvFlecheContent.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarEnvModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarFmtModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLiminFilleSimple.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLiminFilleTree.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/TrPostRubarLoader.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarOuvrageModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarSpecificAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.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/TrPostSourceBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceComparator.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceOneTimeStep.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReflux.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceRubarMaxContainer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceRubarNodeBathyAdapter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceRubarZFN.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceSerafin.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceTelemac3D.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTimeFmtPanel.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/TrPostTimeModelSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostValueTableModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelRubar.java 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/TrPostActionAddPointFromWidgetCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionAddPointFromWidgetCalque2.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionChangeSceneForWidget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionChooseAndCreateCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionDuplicate.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/actions/TrPostActionFusionGraphes.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/actions/TrPostActionRemoveSrc.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/dialogSpec/TrPostDialogBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostDialogCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostDialogLigneCourants.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/TrPostWizardCreateScope.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 branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFilter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFormat.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/save/TrPostProjetSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrBcNodeLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxAppliManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxBcNodeLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxBoundaryEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxBoundaryMiddleLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxCourbeUseFinder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxCourbeUseResult.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxElementModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxExecPreferencesPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxFilleProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxForceEnableAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxImplHelper.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxInfoSenderDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxNormaleModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxParametres.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxProjectDispatcherListener.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxProjectFactory.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxPropEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxRadiationVentPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxTimeStepsEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxValueEditorPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxVisuPanelModelListener.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarAppliManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarApportIsoPainter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarAreteLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarAreteModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarAreteModelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarAreteModelProject.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarBcAreteDefaultModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarBcAreteLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarCINLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarDonneesBrutesLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarDonneesBrutesLayerGroup.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarDonneesBrutesNuageLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarElementEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarElementModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarElementSIModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarEvolutionManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarExecPreferencesPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileBrutesState.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileBrutesStateNuage.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileState.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateAPP.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateCIN.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateCLI.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateDAT.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateDIF.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateDTR.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateFRT.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateListener.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateMAI.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateMng.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateOUV.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStatePAR.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFileStateTAR.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFilleProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarFlowrateGroupEditorPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarGridLayerGroup.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarImplHelper.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarInfoSenderDelegate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarLimniModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarLimniSaisie.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarNewProjectPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageConfiguration.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageEditorFactory.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageEditorPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageLayerModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvragePaletteIdentifier.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageSaisie.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarParallelogrammeTableModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarParameters.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarProject.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarProjectDispatcherListener.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarProjectFactory.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarProjectReloader.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarRegularGridEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarSIEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarSILayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarVisuPanelModelListener.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrMatisseConvertGUI.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemac2dParametres.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemac2dProject.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacAppliManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBcBoundaryBlockLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBcPointLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBcPointModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryBlockLayer.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/TrTelemacBoundaryEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryGrapheSimpleModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryPtsEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryVariableEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCommunParametres.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCommunProjectListener.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCommunProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCulvertEndEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacDefaultPropertiesEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacDurationEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacExecPreferencesPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacFindBoundary.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacFrontierNumberIterator.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacFrontierNumberIteratorAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacImplHelper.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacInfoSenderDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacMatisseExec.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/o... [truncated message content] |
From: <had...@us...> - 2008-10-15 17:36:25
|
Revision: 4067 http://fudaa.svn.sourceforge.net/fudaa/?rev=4067&view=rev Author: hadouxad Date: 2008-10-15 17:32:24 +0000 (Wed, 15 Oct 2008) Log Message: ----------- Persistance des calques 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/calque/ZebliCalquePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersist.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueSaver.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 2008-10-15 09:50:47 UTC (rev 4066) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -77,7 +77,7 @@ * @author Guillaume Desnoix , Axel von Arnim, Fred deniger */ public class ZEbliCalquesPanel extends BuPanel implements EbliFilleCalquesInterface, BCalqueContextuelListener, - CtuluImageProducer, BCalqueSaverTargetInterface, EbliFindable, ActionListener, ZebliCalqueSaver { + CtuluImageProducer, BCalqueSaverTargetInterface, EbliFindable, ActionListener { protected class AnimAdapter extends EbliAnimationSourceAbstract { @@ -271,6 +271,14 @@ BuMenu[] specificMenus_; + /** + * NE JAMAIS UTILISER CE CONSTRUCTEUR!!! + * RESERVE POUR LA SERIALIZATION DES DONNEES. + */ + public ZEbliCalquesPanel(){ + + } + public ZEbliCalquesPanel(final CtuluUI _ui) { this(null, new ZEbliCalquePanelController(_ui)); } @@ -905,12 +913,19 @@ return null; } - public void loadCalque(File f, Map params) { - return; - } + - public void saveCalque(File _f) { - + /** + * retourne l'interface correspondante au niveauy m\xE9tier du calque. + * DOIT ETRE OVERRIDE par ses classes h\xE9riti\xE8res pour g\xE9rer la persistance des donn\xE9es. + * + * @param _f + * @return + */ + public ZebliCalqueDataPersitant getPersistantSaver() { + return null; } + + } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -0,0 +1,28 @@ +package org.fudaa.ebli.calque; + +import java.util.Map; + + + +/** + * Interface definissant les datas persistantes du calque. + * Les classes qui impl\xE9mentent cette interface doivent etre SERIALIZABLE!!!! + * @author Adrien Hadoux + * + */ +public interface ZebliCalqueDataPersitant { + + /** + * Remplir les infos du calque correspondant + * @param panel + */ + public void fillInfoWith(ZEbliCalquesPanel panel); + + /** + * Methode qui genere le calque panel a partir des donn\xE9es + * @param parameters + * @return + */ + public ZEbliCalquesPanel generateCalquePanel(Map parameters); + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java 2008-10-15 09:50:47 UTC (rev 4066) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -1,10 +1,15 @@ package org.fudaa.ebli.calque; import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.util.Map; import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroupPersist; import com.thoughtworks.xstream.XStream; @@ -21,108 +26,201 @@ */ public class ZebliCalquePersist { - /** - * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et - * model... - */ - String directoryPath_; - Map parameters_; - + /** + * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et + * model... + */ + String directoryPath_; + Map parameters_; - private XStream parser_; - private static String MAINFILE = "descriptorCalque"; - private static String SPECIFIQUEFILE="specificDatas.xml"; - + private XStream parser_; + private static String MAINFILE = "descriptorCalque.xml"; + private static String DATA = "datas.xml"; + private static String SPECIFIQUEFILE="specificDatas.xml"; - public ZebliCalquePersist(String directoryPath_, Map parameters) throws IOException { - this.directoryPath_ = directoryPath_; - parameters_ = parameters; - } + public ZebliCalquePersist(String directoryPath_, Map parameters) throws IOException { + this.directoryPath_ = directoryPath_; + parameters_ = parameters; + } - /** - * Recupere le parser adequat. - * @return - */ - private XStream getParser(){ - if(parser_==null) - parser_=initXmlParser(); - return parser_; - } - /** - * Init le parser avec les alias adequats. - * @return - */ - private XStream initXmlParser(){ - XStream xstream = new XStream(new DomDriver()); - //-- creation des alias pour que ce soit + parlant dans le xml file --// - xstream.alias("Groupe", EGGroupPersist.class); - - return xstream; - } - - /** - * Retourne le path vers le fiochier principal des courbes - * @return - */ - private String getMainFilePath(){ - return directoryPath_+File.separator+MAINFILE; - } + /** + * Recupere le parser adequat. + * @return + */ + private XStream getParser(){ + if(parser_==null) + parser_=initXmlParser(); + return parser_; + } - - /** - * Retourne le chemin vers le fichier de datats specifiques. - * @return - */ - private String getSpecifiqueDataFilePath(){ - return directoryPath_+File.separator+SPECIFIQUEFILE; - } + /** + * Init le parser avec les alias adequats. + * @return + */ + private XStream initXmlParser(){ + XStream xstream = new XStream(new DomDriver()); + //-- creation des alias pour que ce soit + parlant dans le xml file --// + xstream.alias("Groupe", EGGroupPersist.class); - /** - * Enrtegistre le calque au format persistant xml. - * - * @param parameters - * des parametres supplementaires utiles. - * @throws IOException - */ - public void savePersitCalqueXml(ZEbliCalquesPanel panelTopersist) { - - // -- etape 1: on sauvegarde les datas du panel au format zip dans le main - // path principale --// - panelTopersist.saveCalque(new File(getMainFilePath())); - - // -- etape 2: data specifiques --// - - // on sauvegarde l'instance de la classe zebli pour pouvoir la rejouer par - // la suite - - } + return xstream; + } - /** - * Methode qui remplit le panel fournit en parametre avec les donn\xE9es - * sauvegardees. - * - * @param panelToFill - */ - public ZEbliCalquesPanel loadPersitCalqueXml(CtuluUI ui) { + /** + * Path vers els datas classique du calque + * @return + */ + private String getDataFilePath(){ + return directoryPath_+File.separator+DATA; + } - // -- Init: on init la creation du zeblicalquePanel avec l'ui - ZEbliCalquesPanel newPanel = new ZEbliCalquesPanel(ui); - - // -- etape 1 on lit les donn\xE9es sp\xE9cifiques pour conn\xE2itre le type d'objet - // \xE0 cr\xE9er --// - // -- etape 2: on lit les donn\xE9es zip et on remplit dans le calque - // pr\xE9alablement cr\xE9\xE9 - newPanel.loadCalque(new File(getMainFilePath()), parameters_); - - return newPanel; - } - - + /** + * Retourne le path vers le fiochier principal des courbes + * @return + */ + private String getMainFilePath(){ + return directoryPath_+File.separator+MAINFILE; + } + + + /** + * Retourne le chemin vers le fichier de datats specifiques. + * @return + */ + private String getSpecifiqueDataFilePath(){ + return directoryPath_+File.separator+SPECIFIQUEFILE; + } + + /** + * Enrtegistre le calque au format persistant xml. + * + * @param parameters + * des parametres supplementaires utiles. + * @throws IOException + */ + public void savePersitCalqueXml(ZEbliCalquesPanel panelTopersist) { + ObjectOutputStream out=null; + // -- etape 1: on sauvegarde les datasPersistantes du panel au format zip dans le main + // path principale --// + ZebliCalqueDataPersitant dataPersistantes= panelTopersist.getPersistantSaver(); + dataPersistantes.fillInfoWith(panelTopersist); + try { + out = getParser().createObjectOutputStream(new FileWriter(new File(getSpecifiqueDataFilePath()))); + out.writeObject(dataPersistantes); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally{ + try { + out.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + //-- etape 2: on sauvegarde le type de zeblicalquePanel dans le fichier general --// +// try { +// out = getParser().createObjectOutputStream(new FileWriter(new File(getMainFilePath()))); +// +// //-- donneees bidon --// +// //-- on enregistre le nb de pages --// +// out.writeInt(panelTopersist.getNumberOfPages()); +// //-- fin donn\xE9es bidons --// +// +// //-- on enregistre le type de calque --// +// out.writeObject(panelTopersist.getClass().toString()); +// +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// finally{ +// try { +// out.close(); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + + + + + } + + + public ZEbliCalquesPanel generateCalqueInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException{ + if(className.startsWith("class ")) + className=className.substring("class ".length()); + Class myclass =Class.forName(className, true, Thread.currentThread(). + getContextClassLoader()); + Object myModel=myclass.newInstance(); + if(myModel instanceof ZEbliCalquesPanel) + return (ZEbliCalquesPanel)myModel; + return null; + + } + + + /** + * Methode qui remplit le panel fournit en parametre avec les donn\xE9es + * sauvegardees. + * + * @param panelToFill + */ + public ZEbliCalquesPanel loadPersitCalqueXml( Map param) { + ObjectInputStream in=null; + ZEbliCalquesPanel veritablePanel=null; + + try { + // -- Init: on lit les donn\xE9es sp\xE9cifiques pour avoir la bonne classe zeblicalquepanel --// + //in=getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); + + //donnee bidon + //in.readInt(); + //-- lire le type de classe du calque--// + //String className=(String) in.readObject(); + + //-- on creer le type d'objet lu + //ZEbliCalquesPanel panelUseAsStatic; + + //panelUseAsStatic = generateCalqueInstance(className); + + //-- etape 1: on lit les donn\xE9es sp\xE9cifiques pour avoir la data persistantes + in=getParser().createObjectInputStream(new FileReader(new File(getSpecifiqueDataFilePath()))); + ZebliCalqueDataPersitant dataPersistantes= (ZebliCalqueDataPersitant) in.readObject(); + + //-- etape 2 on creer l'obejt calque correspondant a partir des datas persitantes + veritablePanel=dataPersistantes.generateCalquePanel(param); + + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally{ + try { + in.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + return veritablePanel; + } + + } Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueSaver.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueSaver.java 2008-10-15 09:50:47 UTC (rev 4066) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueSaver.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -1,35 +0,0 @@ -package org.fudaa.ebli.calque; - -import java.io.File; -import java.util.Map; - - -/** - * Interface utilis\xE9e par le ZebliCalquePanel poru gerer sa persistance - * - * @author Adrien Hadoux - * - */ -public interface ZebliCalqueSaver { - - /** - * Methode qui permet de sauver un calque dans le fichier sp\xE9cifi\xE9. Cette - * methode doit etre overrid\xE9 a haut niveau (Fudaa) dans les classes - * h\xE9riti\xE8res de zebliCalquePanel - * - * @param f - */ - public void saveCalque(File f); - - /** - * Methode qui permet de charger un un calque a partir des donn\xE9es de ce - * fichier. Cette methode doit etre overrid\xE9 a haut niveau (Fudaa) dans les - * classes h\xE9riti\xE8res de zebliCalquePanel - * - * @param f - * @return - */ - public void loadCalque(File f, Map params); - - -} 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 2008-10-15 09:50:47 UTC (rev 4066) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -225,7 +225,7 @@ * @throws IllegalAccessException */ public EGGrapheTreeModel generateModelInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException{ - if(className.startsWith("class ")); + if(className.startsWith("class ")) className=className.substring("class ".length()); Class myclass =Class.forName(className, true, Thread.currentThread(). getContextClassLoader()); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-15 09:50:47 UTC (rev 4066) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -150,7 +150,7 @@ String pathCalque = (String) data; try { - calque_ = (new ZebliCalquePersist(pathCalque, parameters)).loadPersitCalqueXml((CtuluUI) parameters.get("ui")); + calque_ = (new ZebliCalquePersist(pathCalque, parameters)).loadPersitCalqueXml(parameters ); } catch (FileNotFoundException e) { // TODO Auto-generated catch block Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java 2008-10-15 09:50:47 UTC (rev 4066) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -169,6 +169,14 @@ private BuMenu edgeDisplayTools_; /** + * NE JAMAIS UTILISER CE CONSTRUCTEUR!!! + * RESERVE POUR LA SERIALIZATION DES DONNEES. + */ + protected MvVisuPanel(){ + super(); + } + + /** * @param _impl l'implementation parente */ public MvVisuPanel(final FSigVisuPanelController _controller, final FudaaCommonImplementation _impl) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java 2008-10-15 09:50:47 UTC (rev 4066) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -61,7 +61,19 @@ protected final FudaaCommonImplementation impl_; + + /** + * NE JAMAIS UTILISER CE CONSTRUCTEUR!!! + * RESERVE POUR LA SERIALIZATION DES DONNEES. + */ + protected FSigVisuPanel(){ + super(); + mng_=null; + impl_=null; + } + + /** * @param _impl l'implementation parente */ public FSigVisuPanel(final FudaaCommonImplementation _impl) { @@ -223,35 +235,7 @@ getController().updateInfoComponent(); } - /** - * Methode qui permet de charger un calque fsigVisuPanel - */ - public void loadCalque(File f, Map params) { - - - try { - (new FudaaFilleVisuPersistence(this, getImpl())).restore(getImpl(), new FudaaSaveZipLoader(f), getImpl() - .getMainProgression()); - } catch (IOException e) { - e.printStackTrace(); - } - - - } - - /** - * Sauvegarde le calque au for\xE9at zip. - */ - public void saveCalque(File _f) { - - try { - (new FudaaFilleVisuPersistence(this, getImpl())).saveIn(new FudaaSaveZipWriter(_f), getImpl() - .getMainProgression()); - } catch (IOException e) { - e.printStackTrace(); - } - - } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanel.java 2008-10-15 09:50:47 UTC (rev 4066) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanel.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -41,6 +41,16 @@ */ public abstract class TrVisuPanel extends MvVisuPanel implements CtuluExportDataInterface, CtuluImageImporter { + + + /** + * NE JAMAIS UTILISER CE CONSTRUCTEUR!!! + * RESERVE POUR LA SERIALIZATION DES DONNEES. + */ + protected TrVisuPanel(){ + super(); + } + /** * @param _impl l'implementation parente */ @@ -48,6 +58,8 @@ super(_controller, _impl); } + + public TrVisuPanel(final FudaaCommonImplementation _impl) { super(_impl); } 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-15 09:50:47 UTC (rev 4066) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-15 17:32:24 UTC (rev 4067) @@ -90,1222 +90,1224 @@ */ public class TrPostProjet implements ActionListener { - /** - * Manager de sauvegarder/charghement des donn\xE9es - */ - private TrPostPersistenceManager manager_; + /** + * Manager de sauvegarder/charghement des donn\xE9es + */ + private TrPostPersistenceManager manager_; - public TrPostPersistenceManager getManager() { - if (manager_ == null) manager_ = new TrPostPersistenceManager(this); + public TrPostPersistenceManager getManager() { + if (manager_ == null) manager_ = new TrPostPersistenceManager(this); - return manager_; - } + return manager_; + } - private class TimeContentUpdater implements ListDataListener { + private class TimeContentUpdater implements ListDataListener { - protected TimeContentUpdater() { + protected TimeContentUpdater() { - } + } - protected void updateAll() { - // TODO a revoir - // if (fille_ != null && fille_.isVisible()) { - // if (CtuluLibMessage.DEBUG) { - // CtuluLibMessage.debug("update fill time format"); - // } - // final TrPostVisuPanel panel = (TrPostVisuPanel) fille_.getVisuPanel(); - // final BCalque[] cqs = panel.getDonneesCalque().getCalques(); - // for (int i = cqs.length - 1; i >= 0; i--) { - // final BCalque calque = cqs[i]; - // if (calque instanceof TrPostFlecheLayer) { - // ((TrPostFlecheLayer) calque).timeStepFormatChanged(); - // } else if (calque instanceof TrIsoLayerDefault) { - // ((TrIsoLayerDefault) calque).timeStepFormatChanged(); - // } - // } - // final TrPostFlecheLayer flecheLayer = panel.getFlecheLayer(); - // if (flecheLayer != null) { - // flecheLayer.timeStepFormatChanged(); - // } - // final TrIsoLayer liso = panel.getIsoLayer(); - // if (liso != null && liso.isVisible()) { - // liso.timeStepFormatChanged(); - // } - // if (!fille_.getArbreCalqueModel().getTreeSelectionModel().isSelectionEmpty()) { - // final TreePath[] path = fille_.getArbreCalqueModel().getTreeSelectionModel().getSelectionPaths(); - // fille_.getArbreCalqueModel().getTreeSelectionModel().clearSelection(); - // fille_.getArbreCalqueModel().getTreeSelectionModel().setSelectionPaths(path); - // } - // } - setProjectModified(); - } + protected void updateAll() { + // TODO a revoir + // if (fille_ != null && fille_.isVisible()) { + // if (CtuluLibMessage.DEBUG) { + // CtuluLibMessage.debug("update fill time format"); + // } + // final TrPostVisuPanel panel = (TrPostVisuPanel) fille_.getVisuPanel(); + // final BCalque[] cqs = panel.getDonneesCalque().getCalques(); + // for (int i = cqs.length - 1; i >= 0; i--) { + // final BCalque calque = cqs[i]; + // if (calque instanceof TrPostFlecheLayer) { + // ((TrPostFlecheLayer) calque).timeStepFormatChanged(); + // } else if (calque instanceof TrIsoLayerDefault) { + // ((TrIsoLayerDefault) calque).timeStepFormatChanged(); + // } + // } + // final TrPostFlecheLayer flecheLayer = panel.getFlecheLayer(); + // if (flecheLayer != null) { + // flecheLayer.timeStepFormatChanged(); + // } + // final TrIsoLayer liso = panel.getIsoLayer(); + // if (liso != null && liso.isVisible()) { + // liso.timeStepFormatChanged(); + // } + // if (!fille_.getArbreCalqueModel().getTreeSelectionModel().isSelectionEmpty()) { + // final TreePath[] path = fille_.getArbreCalqueModel().getTreeSelectionModel().getSelectionPaths(); + // fille_.getArbreCalqueModel().getTreeSelectionModel().clearSelection(); + // fille_.getArbreCalqueModel().getTreeSelectionModel().setSelectionPaths(path); + // } + // } + setProjectModified(); + } - public void contentsChanged(final ListDataEvent _event) { - updateAll(); - } + public void contentsChanged(final ListDataEvent _event) { + updateAll(); + } - public void intervalAdded(final ListDataEvent _event) { - updateAll(); - } + public void intervalAdded(final ListDataEvent _event) { + updateAll(); + } - public void intervalRemoved(final ListDataEvent _event) { - updateAll(); - } - } + public void intervalRemoved(final ListDataEvent _event) { + updateAll(); + } + } - class ModifyObserver implements Observer { + class ModifyObserver implements Observer { - private boolean isModified_; + private boolean isModified_; - protected void clearModified() { - isModified_ = false; - updateFrameState(); - } + protected void clearModified() { + isModified_ = false; + updateFrameState(); + } - protected void updateFrameState() { - if (impl_ != null) { - impl_.setEnabledForAction("ENREGISTRER", isModified_); - impl_.setEnabledForAction("ENREGISTRERSOUS", isModified_); - changedMainFrameState(); - } - } + protected void updateFrameState() { + if (impl_ != null) { + impl_.setEnabledForAction("ENREGISTRER", isModified_); + impl_.setEnabledForAction("ENREGISTRERSOUS", isModified_); + changedMainFrameState(); + } + } - public boolean isModified() { - return isModified_; - } + public boolean isModified() { + return isModified_; + } - public void setModified() { - isModified_ = true; - updateFrameState(); - } + public void setModified() { + isModified_ = true; + updateFrameState(); + } - public void update(final Observable _o, final Object _arg) { - setModified(); - } + public void update(final Observable _o, final Object _arg) { + setModified(); + } - } + } - class VariableListener implements TrPostDataListener { + class VariableListener implements TrPostDataListener { - public void dataAdded(final boolean _isFleche) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataAdded(_isFleche); - } - } - } - setProjectModified(); - } + public void dataAdded(final boolean _isFleche) { + if (impl_ == null) { return; } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataAdded(_isFleche); + } + } + } + setProjectModified(); + } - public void dataChanged(final H2dVariableType _old, final H2dVariableType _new, final boolean _contentChanged, - final boolean _isFleche, final Set _varDepending) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataChanged(_old, _new, _contentChanged, _isFleche, _varDepending); - } - } - } - setProjectModified(); - } + public void dataChanged(final H2dVariableType _old, final H2dVariableType _new, final boolean _contentChanged, + final boolean _isFleche, final Set _varDepending) { + if (impl_ == null) { return; } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataChanged(_old, _new, _contentChanged, _isFleche, _varDepending); + } + } + } + setProjectModified(); + } - public void dataRemoved(final H2dVariableType[] _vars, final boolean _isFleche) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataRemoved(_vars, _isFleche); - } - } - } - setProjectModified(); - } + public void dataRemoved(final H2dVariableType[] _vars, final boolean _isFleche) { + if (impl_ == null) { return; } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataRemoved(_vars, _isFleche); + } + } + } + setProjectModified(); + } - } + } - // transient TrPostFille fille_; - // - // /** - // * Fenetre fille qui contient le layout scene. Cette fenetre remplace petit a petit fille_ - // */ - // // protected transient TrPostLayoutFille filleLayout_; - // ArrayList<TrPostLayoutFille> listeFillesLayout = new ArrayList<TrPostLayoutFille>(); + // transient TrPostFille fille_; + // + // /** + // * Fenetre fille qui contient le layout scene. Cette fenetre remplace petit a petit fille_ + // */ + // // protected transient TrPostLayoutFille filleLayout_; + // ArrayList<TrPostLayoutFille> listeFillesLayout = new ArrayList<TrPostLayoutFille>(); - /** - * liste des noeuds pour gerer le cut/copy/paste avec en + le undo/redo - */ - // liste des noeuds copies - Set<EbliNode> nodesCopyied = null; - // liste des noeuuds coupes - Set<EbliNode> nodesCutted = null; + /** + * liste des noeuds pour gerer le cut/copy/paste avec en + le undo/redo + */ + // liste des noeuds copies + Set<EbliNode> nodesCopyied = null; + // liste des noeuuds coupes + Set<EbliNode> nodesCutted = null; - // /** - // *ajout une fillelayout a la liste des frame layout - // * - // * @param _fille - // */ - // public void addFillesLayout(TrPostLayoutFille _fille) { - // listeFillesLayout.add(_fille); - // } + // /** + // *ajout une fillelayout a la liste des frame layout + // * + // * @param _fille + // */ + // public void addFillesLayout(TrPostLayoutFille _fille) { + // listeFillesLayout.add(_fille); + // } - // /** - // * retourne la frame layout en cours d utilisation par le user. sinon retourne la premiere fille. IMPORTANT: il faut - // * passer par cette methode pour etre root\xE9 vers la bonne scene en cours de manip. - // * - // * @return - // */ - // public TrPostLayoutFille getSelectedFilleLayout() { - // for (Iterator<TrPostLayoutFille> it = listeFillesLayout.iterator(); it.hasNext();) { - // TrPostLayoutFille fille = it.next(); - // if (fille.isSelected()) return fille; - // } - // // sinon retourne la premier frame - // return listeFillesLayout.get(0); - // } + // /** + // * retourne la frame layout en cours d utilisation par le user. sinon retourne la premiere fille. IMPORTANT: il faut + // * passer par cette methode pour etre root\xE9 vers la bonne scene en cours de manip. + // * + // * @return + // */ + // public TrPostLayoutFille getSelectedFilleLayout() { + // for (Iterator<TrPostLayoutFille> it = listeFillesLayout.iterator(); it.hasNext();) { + // TrPostLayoutFille fille = it.next(); + // if (fille.isSelected()) return fille; + // } + // // sinon retourne la premier frame + // return listeFillesLayout.get(0); + // } - /** - * internalframe qui gere les multiProjets - */ - public TrPostProjetsManagerFille filleProjetctManager_; + /** + * internalframe qui gere les multiProjets + */ + public TrPostProjetsManagerFille filleProjetctManager_; - /** - * Le menu du post qui contient tout les sous menus des projets - */ - BuMenu menuPost_; - BuMenu menuLayout_ = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER");; - List<BuMenu> listeMenuProjets_; + /** + * Le menu du post qui contient tout les sous menus des projets + */ + BuMenu menuPost_; + BuMenu menuLayout_ = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER");; + List<BuMenu> listeMenuProjets_; - List<ArrayList<BuMenuItem>> listeSousMenuProjets_; + List<ArrayList<BuMenuItem>> listeSousMenuProjets_; - /** - * Observable custom reserv\xE9 aux modifs apport\xE9es a la liste des src. - * - * @author Adrien Hadoux - */ - class observableSupport extends Observable { - @Override - public void notifyObservers() { - this.setChanged(); - super.notifyObservers(); - } + /** + * Observable custom reserv\xE9 aux modifs apport\xE9es a la liste des src. + * + * @author Adrien Hadoux + */ + class observableSupport extends Observable { + @Override + public void notifyObservers() { + this.setChanged(); + super.notifyObservers(); + } - @Override - public void notifyObservers(final Object arg) { - this.setChanged(); - super.notifyObservers(arg); - } + @Override + public void notifyObservers(final Object arg) { + this.setChanged(); + super.notifyObservers(arg); + } - } + } - private observableSupport observable; + private observableSupport observable; - public observableSupport getObservable() { - if (observable == null) observable = new observableSupport(); - return observable; - } + public observableSupport getObservable() { + if (observable == null) observable = new observableSupport(); + return observable; + } - public void notifyObservers() { - // getObservable().setChanged(); + public void notifyObservers() { + // getObservable().setChanged(); - getObservable().notifyObservers(); + getObservable().notifyObservers(); - } + } - transient int idxFilleG_; + transient int idxFilleG_; - public transient TrPostCommonImplementation impl_; + public transient TrPostCommonImplementation impl_; - ModifyObserver modifyState_ = new ModifyObserver(); + ModifyObserver modifyState_ = new ModifyObserver(); - /** - * Donnees courantes du trpost. - */ - // transient TrPostSource src_; - /** - * liste des sources pour le multiProjet. - */ - public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>(); + /** + * Donnees courantes du trpost. + */ + // transient TrPostSource src_; + /** + * liste des sources pour le multiProjet. + */ + public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>(); - transient TimeContentUpdater timeUpdater_; + transient TimeContentUpdater timeUpdater_; - public TrPostProjet(final TrPostCommonImplementation _impl) { - this(null, _impl); + public TrPostProjet(final TrPostCommonImplementation _impl) { + this(null, _impl); - } + } - public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) { - if (_src != null) ajouterSource(_src); + public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) { + if (_src != null) ajouterSource(_src); - // -- creation de la frame de gestion multi projet --// - filleProjetctManager_ = new TrPostProjetsManagerFille(this); - impl_ = _impl; + // -- creation de la frame de gestion multi projet --// + filleProjetctManager_ = new TrPostProjetsManagerFille(this); + impl_ = _impl; - } + } - /** - * Permet d ajouter une source dans le projet afin de gerer le multi source. On doit toujorus passer par cette methode - * pour ajouter une source. - * - * @param _src - */ - public void ajouterSource(final TrPostSource _src) { - _src.addVariableListener(new VariableListener()); - if (_src.getFile() == null || !isSourceLoaded(_src.getFile().getAbsolutePath())) { - listeSrc_.add(_src); + /** + * Permet d ajouter une source dans le projet afin de gerer le multi source. On doit toujorus passer par cette methode + * pour ajouter une source. + * + * @param _src + */ + public void ajouterSource(final TrPostSource _src) { + _src.addVariableListener(new VariableListener()); + if (_src.getFile() == null || !isSourceLoaded(_src.getFile().getAbsolutePath())) { + listeSrc_.add(_src); - // -- ajout du menu correspondant uniquement a partir de la 2eme --// - // if (listeSrc_.size()>1 || (menuPost_!=null &&)) - construitMenuPostSpecifiqueSource(_src); + // -- ajout du menu correspondant uniquement a partir de la 2eme --// + // if (listeSrc_.size()>1 || (menuPost_!=null &&)) + construitMenuPostSpecifiqueSource(_src); - } else { - // -- messqge d erreur: le fichier est deja ouvert --// - new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), "Le fichier est deja ouvert.").activate(); + } else { + // -- messqge d erreur: le fichier est deja ouvert --// + new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), "Le fichier est deja ouvert.").activate(); - } + } - } + } - /** - * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. - * - * @param _file : path absolu du fichier - * @return - */ - public TrPostSource findSource(final String _file) { + /** + * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. + * + * @param _file : path absolu du fichier + * @return + */ + public TrPostSource findSource(final String _file) { - for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { - final TrPostSource src = it.next(); - if (src.getFile().getAbsolutePath().equals(_file)) return src; - } + for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { + final TrPostSource src = it.next(); + if (src.getFile().getAbsolutePath().equals(_file)) return src; + } - return null; - } + return null; + } - /** - * indique si il existe une source portant le nom du fichier en param. - * - * @param _file : path absolu du fichier - * @return - */ - public boolean isSourceLoaded(final String _file) { - if (findSource(_file) == null) return false; - return true; - } + /** + * indique si il existe une source portant le nom du fichier en param. + * + * @param _file : path absolu du fichier + * @return + */ + public boolean isSourceLoaded(final String _file) { + if (findSource(_file) == null) return false; + return true; + } - // /** - // * methode qui change la source courante et retourne true si la source existe bien, false sinon - // * - // * @param _file : path absolu du fichier - // * @return - // */ - // public boolean changeSource(final TrPostSource _src) { - // - // src_ = _src; - // - // return true; - // } + // /** + // * methode qui change la source courante et retourne true si la source existe bien, false sinon + // * + // * @param _file : path absolu du fichier + // * @return + // */ + // public boolean changeSource(final TrPostSource _src) { + // + // src_ = _src; + // + // return true; + // } - /** - * Methode de suppression de la source - * - * @param src : TrPostSource, retourne true si la suppression a bien ete effectuee. - */ - public boolean removeSource(final TrPostSource src, final int n) { + /** + * Methode de suppression de la source + * + * @param src : TrPostSource, retourne true si la suppression a bien ete effectuee. + */ + public boolean removeSource(final TrPostSource src, final int n) { - if (isSourceLoaded(src.getFile().getAbsolutePath())) { - listeSrc_.remove(src); + if (isSourceLoaded(src.getFile().getAbsolutePath())) { + listeSrc_.remove(src); - // --recuperation du menu simul --// - final BuMenu menuSimul = getlisteMenuProjets_().get(n); + // --recuperation du menu simul --// + final BuMenu menuSimul = getlisteMenuProjets_().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 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 le menuSimul de la liste --// + menuPost_.remove(menuSimul); - // -- on retire de la liste des menus le menusimul et la liste des sous - // menus --// - getlisteMenuProjets_().remove(n); - getlisteSousMenuProjets_().remove(n); + // -- on retire de la liste des menus le menusimul et la liste des sous + // menus --// + getlisteMenuProjets_().remove(n); + getlisteSousMenuProjets_().remove(n); - // -- mise a jour de la barre des menus --// - impl_.getMainMenuBar().revalidate(); + // -- mise a jour de la barre des menus --// + impl_.getMainMenuBar().revalidate(); - return true; - } else { - // -- messqge d erreur: le fichier est deja ouvert --// - new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), - "Impossible de supprimer ce fichier de la liste.").activate(); + return true; + } else { + // -- messqge d erreur: le fichier est deja ouvert --// + new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), + "Impossible de supprimer ce fichier de la liste.").activate(); - return false; - } + return false; + } - } + } - /** - * methode qui formatte les infos de la source - * - * @param _src - * @return - */ - public String formatInfoSource(final TrPostSource _src) { - // --ajout dans la liste des titres --// - return formatName(_src.getTitle()) + " | Fichier: " + formatFichier(_src.getFile()); - } + /** + * methode qui formatte les infos de la source + * + * @param _src + * @return + */ + public String formatInfoSource(final TrPostSource _src) { + // --ajout dans la liste des titres --// + return formatName(_src.getTitle()) + " | Fichier: " + formatFichier(_src.getFile()); + } - public String formatFichier(final File file) { - if (file == null) return ""; - final String nomFichier = file.getAbsolutePath(); - // int position = nomFichier.lastIndexOf(File.separator) + 1; - // if (position != -1) { - // nomFichier = nomFichier.substring(position); - // } - // position = nomFichier.lastIndexOf(CtuluLibString.DOT); - // if (position != -1) { - // nomFichier = nomFichier.substring(0, position); - // } - // FuLog.warning("nom du fichier: " + nomFichier); - return nomFichier; - } + public String formatFichier(final File file) { + if (file == null) return ""; + final String nomFichier = file.getAbsolutePath(); + // int position = nomFichier.lastIndexOf(File.separator) + 1; + // if (position != -1) { + // nomFichier = nomFichier.substring(position); + // } + // position = nomFichier.lastIndexOf(CtuluLibString.DOT); + // if (position != -1) { + // nomFichier = nomFichier.substring(0, position); + // } + // FuLog.warning("nom du fichier: " + nomFichier); + return nomFichier; + } - /** - * formatte le titre - * - * @param file - * @return - */ - public String formatName(String title) { - // --suppression des trop long espaces du titre --// + /** + * formatte le titre + * + * @param file + * @return + */ + public String formatName(String title) { + // --suppression des trop long espaces du titre --// - title = title.replaceAll(" ", ""); + title = title.replaceAll(" ", ""); - return title; - } + return title; + } - /** - * Construit un menu specifique a la source choisie. A chaque fois que l on ajoute une source au projet, il faut - * ajouter un menu sp\xE9cifique. - * - * @param _src - */ - public void construitMenuPostSpecifiqueSource(final TrPostSource _src) { + /** + * Construit un menu specifique a la source choisie. A chaque fois que l on ajoute une source au projet, il faut + * ajouter un menu sp\xE9cifique. + * + * @param _src + */ + public void construitMenuPostSpecifiqueSource(final TrPostSource _src) { - final BuMenu menuSimul = new BuMenu((listeSrc_.size()) + ". " + formatFichier(_src.getFile()), "SIMULATION" - + (listeSrc_.size())); + final BuMenu menuSimul = new BuMenu((listeSrc_.size()) + ". " + formatFichier(_src.getFile()), "SIMULATION" + + (listeSrc_.size())); - // -- ajout du menu au menu post --// - getMenuPost().add(menuSimul); + // -- ajout du menu au menu post --// + getMenuPost().add(menuSimul); - // -- sauvegarde d une trace du menu dans la liste pour une suppression - // ulterieure --// - getlisteMenuProjets_().add(menuSimul); + // -- sauvegarde d une trace du menu dans la liste pour une suppression + // ulterieure --// + getlisteMenuProjets_().add(menuSimul); - final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>(); + final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>(); - final BuIcon ic = BuResource.BU.getIcon("aucun"); + final BuIcon ic = BuResource.BU.getIcon("aucun"); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."), "COMPUTE_EXTREMA", ic, TrPostProjet.this)); - listSousMenus.add(menuSimul.addMenuItem(CtuluLib.getS("Editer les variables..."), "VARIABLES", ic, - TrPostProjet.this)); - menuSimul.addSeparator(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Palettes de couleurs"), "PALETTE_DEFAULT", ic, - TrPostProjet.this)); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Formater/modifier les pas de temps..."), "TIME_FORMAT", - ic, TrPostProjet.this)); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."), "COMPUTE_EXTREMA", ic, TrPostProjet.this)); + listSousMenus.add(menuSimul.addMenuItem(CtuluLib.getS("Editer les variables..."), "VARIABLES", ic, + TrPostProjet.this)); + menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Palettes de couleurs"), "PALETTE_DEFAULT", ic, + TrPostProjet.this)); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Formater/modifier les pas de temps..."), "TIME_FORMAT", + ic, TrPostProjet.this)); - menuSimul.addSeparator(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer..."), "COMPARE", ic, TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Comparer les r\xE9sultats avec ceux d'un autre projet")); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter..."), "PROJECT", ic, TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent")); - if (_src != null && _src.isInspectable()) { - menuSimul.addSeparator(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Rafra\xEEchir les r\xE9sultats"), "MAJ_DATA", ic, - TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Les fichiers de r\xE9sultats seront relus")); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Rafra\xEEchir automatiquement"), "MAJ_DATA_ALWAYS", ic, - TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Les fichiers sont surveill\xE9s p\xE9riodiquement")); - menuSimul.addSeparator(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"), "EXPORTDATA", TrPostProjet.this)); - _src.addSpecificItemInMainMenu(menuSimul, getImpl()); + menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer..."), "COMPARE", ic, TrPostProjet.this)); + listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + TrResource.getS("Comparer les r\xE9sultats avec ceux d'un autre projet")); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter..."), "PROJECT", ic, TrPostProjet.this)); + listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + TrResource.getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent")); + if (_src != null && _src.isInspectable()) { + menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Rafra\xEEchir les r\xE9sultats"), "MAJ_DATA", ic, + TrPostProjet.this)); + listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + TrResource.getS("Les fichiers de r\xE9sultats seront relus")); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Rafra\xEEchir automatiquement"), "MAJ_DATA_ALWAYS", ic, + TrPostProjet.this)); + listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + TrResource.getS("Les fichiers sont surveill\xE9s p\xE9riodiquement")); + menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"), "EXPORTDATA", TrPostProjet.this)); + _src.addSpecificItemInMainMenu(menuSimul, getImpl()); - // -- ajout de la sous liste de menus pour la garder en memoire --// - getlisteSousMenuProjets_().add(listSousMenus); + // -- ajout de la sous liste de menus pour la garder en memoire --// + getlisteSousMenuProjets_().add(listSousMenus); - } - } + } + } - /** - * Construit le menu Layout. Cette methode doit etre appelee une seule fois - */ - // public void setMenuLayout() { - // //filleLayout_.controller_.construitMenuMultiScenes(impl_.getMainMenuBar()); - // final BuMenuBar menubar = impl_.getMainMenuBar(); - // // -- creation du menu principal des scenes a cote de post --// - // - // menuLayout_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), - // "AJOUTFRAME", CtuluResource.CTULU - // .getIcon("crystal_ajouter"), getSelectedFilleLayout().controller_); - // /* - // * - // * menu.addMenuItem(TrResource.getS(("Ajouter un layout dans la vue")), - // * "AJOUTLAYOUT", CtuluResource.CTULU .getIcon("crystal_ajouter"), - // * filleLayout_.controller_); - // * menu.addMenuItem(TrResource.getS(("Retirer un layout de la vue")), - // * "RETIRELAYOUT", CtuluResource.CTULU .getIcon("crystal_enlever"), - // * filleLayout_.controller_); menu.addSeparator("Layouts"); - // * menu.addSubMenu(filleLayout_.controller_.menuScenes_, true); - // */ - // // ajout a cote de menu post - // // menuLayout_.addSeparator(TrResource.getS("Liste des fen\xEAtres")); - // // menuLayout_.addMenuItem(TrResource.getS(("Layout ")) + - // // listeFillesLayout.size(), "FILLELAYOUT" - // // + (listeFillesLayout.size() - 1), null, this); - // // - // - // menubar.add(menuLayout_, 2); - // - // } - public BuMenu getMenuPost() { - if (menuPost_ == null) menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); - return menuPost_; - } + /** + * Construit le menu Layout. Cette methode doit etre appelee une seule fois + */ + // public void setMenuLayout() { + // //filleLayout_.controller_.construitMenuMultiScenes(impl_.getMainMenuBar()); + // final BuMenuBar menubar = impl_.getMainMenuBar(); + // // -- creation du menu principal des scenes a cote de post --// + // + // menuLayout_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), + // "AJOUTFRAME", CtuluResource.CTULU + // .getIcon("crystal_ajouter"), getSelectedFilleLayout().controller_); + // /* + // * + // * menu.addMenuItem(TrResource.getS(("Ajouter un layout dans la vue")), + // * "AJOUTLAYOUT", CtuluResource.CTULU .getIcon("crystal_ajouter"), + // * filleLayout_.controller_); + // * menu.addMenuItem(TrResource.getS(("Retirer un layout de la vue")), + // * "RETIRELAYOUT", CtuluResource.CTULU .getIcon("crystal_enlever"), + // * filleLayout_.controller_); menu.addSeparator("Layouts"); + // * menu.addSubMenu(filleLayout_.controller_.menuScenes_, true); + // */ + // // ajout a cote de menu post + // // menuLayout_.addSeparator(TrResource.getS("Liste des fen\xEAtres")); + // // menuLayout_.addMenuItem(TrResource.getS(("Layout ")) + + // // listeFillesLayout.size(), "FILLELAYOUT" + // // + (listeFillesLayout.size() - 1), null, this); + // // + // + // menubar.add(menuLayout_, 2); + // + // } + public BuMenu getMenuPost() { + if (menuPost_ == null) menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); + return menuPost_; + } - /** - * Creation par defaut du menu post de l interface. Cette methdoe est appelee une seule dfois au moment de la creation - * de l impl. - */ - public void setMenuPost() { - final BuMenuBar menubar = impl_.getMainMenuBar(); + /** + * Creation par defaut du menu post de l interface. Cette methdoe est appelee une seule dfois au moment de la creation + * de l impl. + */ + public void setMenuPost() { + final BuMenuBar menubar = impl_.getMainMenuBar(); - Component comp = null; - if (getMenuPost().getMenuComponentCount() > 0) { - comp = getMenuPost().getMenuComponent(0); - // getMenuPost().remove(0); - } + Component comp = null; + if (getMenuPost().getMenuComponentCount() > 0) { + comp = getMenuPost().getMenuComponent(0); + // getMenuPost().remove(0); + } - getMenuPost().setIcon(null); - getMenuPost().setName("mnPost"); + getMenuPost().setIcon(null); + getMenuPost().setName("mnPost"); - menubar.add(getMenuPost(), 2); + menubar.add(getMenuPost(), 2); - getMenuPost().addSeparator(TrResource.getS("Layout")); - // -- ajout de l action de creation du calque --// - // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this)); - getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); - getMenuPost().addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", - CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { + getMenuPost().addSeparator(TrResource.getS("Layout")); + // -- ajout de l action de creation du calque --// + // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this)); + getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); + getMenuPost().addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", + CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { - public void actionPerformed(final ActionEvent _e) { - createNewLayoutFrame(); + public void actionPerformed(final ActionEvent _e) { + createNewLayoutFrame(); - } - }); + } + }); - getMenuPost().addSeparator(TrResource.getS("Gestion")); - // -- ajout de l action de gestion des simus dans post --// - final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); - item.addActionListener(new ActionListener() { + getMenuPost().addSeparator(TrResource.getS("Gestion")); + // -- ajout de l action de gestion des simus dans post --// + final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); + item.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent e) { - // -- affichage de la fenetre de gestion multi projet --// + public void actionPerformed(final ActionEvent e) { + // -- affichage de la fenetre de gestion multi projet --// - if (!filleProjetctManager_.isVisible()) { - filleProjetctManager_.setSize(filleProjetctManager_.getSize().width, - filleProjetctManager_.getSize().height / 2); + if (!filleProjetctManager_.isVisible()) { + filleProjetctManager_.setSize(filleProjetctManager_.getSize().width, + filleProjetctManager_.getSize().height / 2); - impl_.addInternalFrame(filleProjetctManager_); - } + impl_.addInternalFrame(filleProjetctManager_); + } - } + } - }); - getMenuPost().add(item); - getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats"); - // -- init de la liste des menus --// + }); + getMenuPost().add(item); + getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats"); + // -- init de la liste des menus --// - // -- construction par defaut du premier menu de simulation --// - // construitMenuPostSpecifiqueSource(getSource(0)); + // -- construction par defaut du premier menu de simulation --// + // construitMenuPostSpecifiqueSource(getSource(0)); - if (comp != null) { - getMenuPost().add(comp); - } + if (comp != null) { + getMenuPost().add(comp); + } - } + } - public List<BuMenu> getlisteMenuProjets_() { - if (listeMenuProjets_ == null) listeMenuProjets_ = new ArrayList<BuMenu>(); - return listeMenuProjets_; - } + public List<BuMenu> getlisteMenuProjets_() { + if (listeMenuProjets_ == null) listeMenuProjets_ = new ArrayList<BuMenu>(); + return listeMenuProjets_; + } - public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_() { - if (listeSousMenuProjets_ == null) listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); - return listeSousMenuProjets_; - } + public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_() { + if (listeSousMenuProjets_ == null) listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); + return listeSousMenuProjets_; + } - /** - * calcul les extrema en fonction de la source proposee - * - * @param indiceSource_ - */ - private void showExtremum(final int indiceSource_) { - final JTable table = TrPostMinMaxTableModel.createTableFor(getSource(indiceSource_)); - final TrPostMinMaxTableModel model = (TrPostMinMaxTableModel) table.getModel(); - final CtuluDialogPanel panel = new CtuluDialogPanel(); - final CtuluDialog dial = new CtuluDialog(getImpl().getFrame(), panel); - final BuButton btCalcul = new BuButton(TrResource.getS("Calcul des extrema")); - dial.setTitle(btCalcul.getText()); - btCalcul.setActionCommand("EXTREMUM"); - panel.setLayout(new BuHorizontalLayout(3, false, false)); - final BuPanel center = new BuPanel(); - center.setLayout(new BuBorderLayout(2, 2, true, true)); - final BuScrollPane scroll = new BuScrollPane(table); - scroll.setPreferredHeight((int) (table.getPreferredSize().height * 1.3)); - center.add(scroll, BuBorderLayout.CENTER); - center.add(model.createInfoPanel(table), BuBorderLayout.SOUTH); - panel.add(center); - btCalcul.setAlignmentX(1f); - btCalcul.setAlignmentY(0f); - panel.add(btCalcul); + /** + * calcul les extrema en fonction de la source proposee + * + * @param indiceSource_ + */ + private void showExtremum(final int indiceSource_) { + final JTable table = TrPostMinMaxTableModel.createTableFor(getSource(indiceSource_)); + final TrPostMinMaxTableModel model = (TrPostMinMaxTableModel) table.getModel(); + final CtuluDialogPanel panel = new CtuluDialogPanel(); + final CtuluDialog dial = new CtuluDialog(getImpl().getFrame(), panel); + final BuButton btCalcul = new BuButton(TrResource.getS("Calcul des extrema")); + dial.setTitle(btCalcul.getText()); + btCalcul.setActionCommand("EXTREMUM"); + panel.setLayout(new BuHorizontalLayout(3, false, false)); + final BuPanel center = new BuPanel(); + center.setLayout(new BuBorderLayout(2, 2, true, true)); + final BuScrollPane scroll = new BuScrollPane(table); + scroll.setPreferredHeight((int) (table.getPreferredSize().height * 1.3)); + center.add(scroll, BuBorderLayout.CENTER); + center.add(model.createInfoPanel(table), BuBorderLayout.SOUTH); + panel.add(center)... [truncated message content] |
From: <had...@us...> - 2008-10-15 17:57:37
|
Revision: 4069 http://fudaa.svn.sourceforge.net/fudaa/?rev=4069&view=rev Author: hadouxad Date: 2008-10-15 17:54:53 +0000 (Wed, 15 Oct 2008) Log Message: ----------- - Icone sp?\195?\169cifique browser projet layout Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrResource.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal16_browser.png branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal24_browser.png Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal16_browser.png =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal16_browser.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal24_browser.png =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal24_browser.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java 2008-10-15 17:46:32 UTC (rev 4068) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java 2008-10-15 17:54:53 UTC (rev 4069) @@ -542,7 +542,7 @@ if (_lb == null) { launcher_.openLayoutPost(_f); } else { - _lb.setIcon(TrResource.getPostIcon()); + _lb.setIcon(TrResource.getPostLayoutIcon()); } return res; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java 2008-10-15 17:46:32 UTC (rev 4068) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java 2008-10-15 17:54:53 UTC (rev 4069) @@ -109,7 +109,7 @@ return TrResource.getMeshIcon(); } if (mng_.isPostFormat(_file)) { return TrResource.getPostIcon(); } - if (mng_.isPostLayoutFormat(_file)) { return TrResource.getPostIcon(); } + if (mng_.isPostLayoutFormat(_file)) { return TrResource.getPostLayoutIcon(); } if (mng_.getTxtFileFilter().accept(_file)) { return BuResource.BU.getToolIcon("texte"); } } return super.getIcon(_file); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrResource.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrResource.java 2008-10-15 17:46:32 UTC (rev 4068) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrResource.java 2008-10-15 17:54:53 UTC (rev 4069) @@ -58,6 +58,10 @@ return TrResource.TR.getIcon("prepro-post"); } + public static BuIcon getPostLayoutIcon() { + return TrResource.TR.getIcon("crystal16_browser.png"); + } + public static String getPostName() { return TrResource.getS("Post"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-15 18:13:48
|
Revision: 4068 http://fudaa.svn.sourceforge.net/fudaa/?rev=4068&view=rev Author: hadouxad Date: 2008-10-15 17:46:32 +0000 (Wed, 15 Oct 2008) Log Message: ----------- Persistance des calques Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.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 2008-10-15 17:32:24 UTC (rev 4067) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-10-15 17:46:32 UTC (rev 4068) @@ -271,13 +271,6 @@ BuMenu[] specificMenus_; - /** - * NE JAMAIS UTILISER CE CONSTRUCTEUR!!! - * RESERVE POUR LA SERIALIZATION DES DONNEES. - */ - public ZEbliCalquesPanel(){ - - } public ZEbliCalquesPanel(final CtuluUI _ui) { this(null, new ZEbliCalquePanelController(_ui)); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java 2008-10-15 17:32:24 UTC (rev 4067) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java 2008-10-15 17:46:32 UTC (rev 4068) @@ -168,14 +168,8 @@ private BuMenu edgeDisplayTools_; - /** - * NE JAMAIS UTILISER CE CONSTRUCTEUR!!! - * RESERVE POUR LA SERIALIZATION DES DONNEES. - */ - protected MvVisuPanel(){ - super(); - } + /** * @param _impl l'implementation parente */ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java 2008-10-15 17:32:24 UTC (rev 4067) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java 2008-10-15 17:46:32 UTC (rev 4068) @@ -63,16 +63,8 @@ - /** - * NE JAMAIS UTILISER CE CONSTRUCTEUR!!! - * RESERVE POUR LA SERIALIZATION DES DONNEES. - */ - protected FSigVisuPanel(){ - super(); - mng_=null; - impl_=null; - } + /** * @param _impl l'implementation parente */ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanel.java 2008-10-15 17:32:24 UTC (rev 4067) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanel.java 2008-10-15 17:46:32 UTC (rev 4068) @@ -43,14 +43,8 @@ - /** - * NE JAMAIS UTILISER CE CONSTRUCTEUR!!! - * RESERVE POUR LA SERIALIZATION DES DONNEES. - */ - protected TrVisuPanel(){ - super(); - } + /** * @param _impl l'implementation parente */ 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-15 17:32:24 UTC (rev 4067) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-10-15 17:46:32 UTC (rev 4068) @@ -161,17 +161,9 @@ final JComponent suiviPanel_; - /** - * NE JAMAIS UTILISER CE CONSTRUCTEUR!!! - * RESERVE POUR LA SERIALIZATION DES DONNEES. - */ - public TrPostVisuPanel(){ - super(); - source_=null; - suiviPanel_=null; - } + public TrPostVisuPanel(final TrPostCommonImplementation _impl, final TrPostProjet _projet, final BCalqueLegende _leg, final TrPostSource _src) { this(_impl, _projet, false, _leg, _src); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-10-15 22:33:37
|
Revision: 4070 http://fudaa.svn.sourceforge.net/fudaa/?rev=4070&view=rev Author: deniger Date: 2008-10-15 22:33:24 +0000 (Wed, 15 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluArkSaver.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliFilleCalques.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSavable.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLib.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjectPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjetDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigFilleDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrProjetCommon.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrFilleVisu.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/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCommunParametres.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCommunProjet.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluSavable.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistenceManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistenceManagerData.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersist.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluArkSaver.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluArkSaver.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluArkSaver.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -11,6 +11,8 @@ import java.io.IOException; import java.io.OutputStream; +import com.db4o.ObjectContainer; + /** * Une interface pour les classes permettant de sauvegarder des donn\xE9es dans une archive. Base sur le mode de * fonctionnement des Zip, tar Pour ajouter une entre dans le saver, il faut faire <code> @@ -65,4 +67,9 @@ */ File getDestDir(); + /** + * @return la base de donn\xE9es utilise pour sauver les props graphiques + */ + ObjectContainer getDb() throws IOException; + } Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluSavable.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluSavable.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluSavable.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -0,0 +1,20 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ctulu; + + +import com.db4o.ObjectContainer; + +/** + * @author deniger + * + */ +public interface CtuluSavable { + + public abstract void saveIn(ObjectContainer _db, ProgressionInterface _prog); + + public abstract void saveIn(CtuluArkSaver _writer, ProgressionInterface _prog); + +} \ No newline at end of file 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 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -21,7 +21,6 @@ import java.awt.image.BufferedImage; import java.awt.print.PageFormat; import java.awt.print.Printable; -import java.io.File; import java.util.Map; import javax.swing.Action; @@ -271,7 +270,6 @@ BuMenu[] specificMenus_; - public ZEbliCalquesPanel(final CtuluUI _ui) { this(null, new ZEbliCalquePanelController(_ui)); } @@ -799,6 +797,10 @@ public final void setModeVisible(final boolean _b) { mode_.setVisible(_b); } + + public ZEbliCalquesPanelPersistenceManager getPersistenceManager() { + return null; + } public void unsetCalqueInteractionActif(final BCalqueInteraction _b) { controller_.unsetCalqueInteractionActif(_b); @@ -906,19 +908,5 @@ return null; } - - /** - * retourne l'interface correspondante au niveauy m\xE9tier du calque. - * DOIT ETRE OVERRIDE par ses classes h\xE9riti\xE8res pour g\xE9rer la persistance des donn\xE9es. - * - * @param _f - * @return - */ - public ZebliCalqueDataPersitant getPersistantSaver() { - return null; - } - - - } \ No newline at end of file Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java (from rev 4069, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -0,0 +1,162 @@ +package org.fudaa.ebli.calque; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Map; + +import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGGroupPersist; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; + +/** + * Classe qui gere les diff\xE9rents fichiers pour la persistance du calque. Doit recevoir en parametre le path du + * repertoire dans lequel sera sauvegard\xE9 le calque. + * + * @author Adrien Hadoux + */ +public abstract class ZEbliCalquesPanelPersistenceManager { + + /** + * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et model... + */ + String directoryPath_; + Map parameters_; + + private XStream parser_; + + private static String MAINFILE = "descriptorCalque.xml"; + private static String DATA = "datas.xml"; + private static String SPECIFIQUEFILE = "specificDatas.xml"; + + public ZEbliCalquesPanelPersistenceManager() {} + + /** + * Recupere le parser adequat. + * + * @return + */ + private XStream getParser() { + if (parser_ == null) parser_ = initXmlParser(); + return parser_; + } + + /** + * Init le parser avec les alias adequats. + * + * @return + */ + private XStream initXmlParser() { + XStream xstream = new XStream(new DomDriver()); + // -- creation des alias pour que ce soit + parlant dans le xml file --// + xstream.alias("Groupe", EGGroupPersist.class); + + return xstream; + } + + /** + * Path vers els datas classique du calque + * + * @return + */ + private String getDataFilePath() { + return directoryPath_ + File.separator + DATA; + } + + /** + * Retourne le path vers le fiochier principal des courbes + * + * @return + */ + private String getMainFilePath() { + return directoryPath_ + File.separator + MAINFILE; + } + + /** + * Retourne le chemin vers le fichier de datats specifiques. + * + * @return + */ + private String getSpecifiqueDataFilePath() { + return directoryPath_ + File.separator + SPECIFIQUEFILE; + } + + /** + * Enrtegistre le calque au format persistant xml. + * + * @param parameters des parametres supplementaires utiles. + * @throws IOException + */ + public abstract void savePersitCalqueXml(ZEbliCalquesPanel panelTopersist, File _dir, Map params) ; + + // } + // } + + // TODO il faut generer la classe du persistencemanager + public ZEbliCalquesPanel generateCalqueInstance(String className) throws ClassNotFoundException, + InstantiationException, IllegalAccessException { + if (className.startsWith("class ")) className = className.substring("class ".length()); + Class myclass = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); + Object myModel = myclass.newInstance(); + if (myModel instanceof ZEbliCalquesPanel) return (ZEbliCalquesPanel) myModel; + return null; + + } + + /** + * Methode qui remplit le panel fournit en parametre avec les donn\xE9es sauvegardees. + * + * @param panelToFill + */ + public abstract ZEbliCalquesPanel loadPersitCalqueXml(Map param, File _dir) ; +// { +// return null; + // ObjectInputStream in = null; + // ZEbliCalquesPanel veritablePanel = null; + // + // try { + // // -- Init: on lit les donn\xE9es sp\xE9cifiques pour avoir la bonne classe zeblicalquepanel --// + // // in=getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); + // + // // donnee bidon + // // in.readInt(); + // // -- lire le type de classe du calque--// + // // String className=(String) in.readObject(); + // + // // -- on creer le type d'objet lu + // // ZEbliCalquesPanel panelUseAsStatic; + // + // // panelUseAsStatic = generateCalqueInstance(className); + // + // // -- etape 1: on lit les donn\xE9es sp\xE9cifiques pour avoir la data persistantes + // in = getParser().createObjectInputStream(new FileReader(new File(getSpecifiqueDataFilePath()))); + // ZebliCalqueDataPersitant dataPersistantes = (ZebliCalqueDataPersitant) in.readObject(); + // + // // -- etape 2 on creer l'obejt calque correspondant a partir des datas persitantes + // veritablePanel = dataPersistantes.generateCalquePanel(param); + // + // } catch (ClassNotFoundException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } catch (IOException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } finally { + // try { + // in.close(); + // } catch (IOException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + // } + // + // return veritablePanel; +// } + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java ___________________________________________________________________ Added: svn:mergeinfo + Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliFilleCalques.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliFilleCalques.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliFilleCalques.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -10,6 +10,7 @@ import java.awt.Graphics; import java.awt.image.BufferedImage; import java.awt.print.PageFormat; +import java.io.File; import java.util.List; import java.util.Map; @@ -18,27 +19,26 @@ import javax.swing.JMenu; import javax.swing.event.InternalFrameEvent; -import com.memoire.bu.BuCommonInterface; -import com.memoire.bu.BuDesktop; -import com.memoire.bu.BuInformationsDocument; -import com.memoire.bu.BuMenu; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluSelectionInterface; import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.gui.CtuluFilleWithComponent; import org.fudaa.ctulu.image.CtuluImageProducer; - import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.commun.EbliPreferences; import org.fudaa.ebli.impression.EbliFilleImprimable; import org.fudaa.ebli.ressource.EbliResource; +import com.memoire.bu.BuCommonInterface; +import com.memoire.bu.BuDesktop; +import com.memoire.bu.BuInformationsDocument; +import com.memoire.bu.BuMenu; +import com.memoire.fu.FuLog; + /** * Fenetre d'affichage de calques contenant des services de base. (position souris, zoom fenetre, selection, - * transformations spatiales). Il est possible d'ajouter des boutons grace aux methodes <code>addButtonGroup</code>. - * Par defaut, 3 groupes de boutons sont proposes : selection, standard et navigation. Ils peuvent etre supprimes ou + * transformations spatiales). Il est possible d'ajouter des boutons grace aux methodes <code>addButtonGroup</code>. Par + * defaut, 3 groupes de boutons sont proposes : selection, standard et navigation. Ils peuvent etre supprimes ou * modifies avec les methodes remove * * @version $Id: ZEbliFilleCalques.java,v 1.64 2007-05-04 13:49:43 deniger Exp $ @@ -101,7 +101,6 @@ pack(); } - protected void addCalque(final BCalque _b, final boolean _enPremier) { pn_.addCalque(_b, _enPremier); @@ -113,8 +112,6 @@ fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ACTIVATED); } - - /** * Modifie la propriete <code>enable</code> de tous les boutons du groupe selection. * @@ -184,8 +181,8 @@ } /* *//** - * @return le menu contextuel a utiliser - */ + * @return le menu contextuel a utiliser + */ /* * public JPopupMenu getCmdsContextuelles() { return null; } */ @@ -243,9 +240,7 @@ l.toArray(specificTools_); pn_.updateKeyMap(this); } - if (specificTools_ == null) { - return null; - } + if (specificTools_ == null) { return null; } final JComponent[] r = new JComponent[specificTools_.length]; System.arraycopy(specificTools_, 0, r, 0, r.length); return r; @@ -278,7 +273,7 @@ public void majComponent(final Object _o) { if (_o instanceof BArbreCalque) { final BArbreCalque arbre = (BArbreCalque) _o; - + arbre.setModel(getArbreCalqueModel()); } else { FuLog.error("ECA: not a bcalque"); @@ -294,7 +289,7 @@ } public BufferedImage produceImage(final int _w, final int _h, final Map _params) { - return pn_.produceImage(_w,_h, _params); + return pn_.produceImage(_w, _h, _params); } public void replace() {} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -1,28 +0,0 @@ -package org.fudaa.ebli.calque; - -import java.util.Map; - - - -/** - * Interface definissant les datas persistantes du calque. - * Les classes qui impl\xE9mentent cette interface doivent etre SERIALIZABLE!!!! - * @author Adrien Hadoux - * - */ -public interface ZebliCalqueDataPersitant { - - /** - * Remplir les infos du calque correspondant - * @param panel - */ - public void fillInfoWith(ZEbliCalquesPanel panel); - - /** - * Methode qui genere le calque panel a partir des donn\xE9es - * @param parameters - * @return - */ - public ZEbliCalquesPanel generateCalquePanel(Map parameters); - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -1,226 +0,0 @@ -package org.fudaa.ebli.calque; - -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.Map; - -import org.fudaa.ctulu.CtuluUI; -import org.fudaa.ebli.courbe.EGGrapheTreeModel; -import org.fudaa.ebli.courbe.EGGroupPersist; - -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.io.xml.DomDriver; - - -/** - * Classe qui gere les diff\xE9rents fichiers pour la persistance du calque. Doit - * recevoir en parametre le path du repertoire dans lequel sera sauvegard\xE9 le - * calque. - * - * @author Adrien Hadoux - * - */ -public class ZebliCalquePersist { - - /** - * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et - * model... - */ - String directoryPath_; - Map parameters_; - - - private XStream parser_; - - private static String MAINFILE = "descriptorCalque.xml"; - private static String DATA = "datas.xml"; - private static String SPECIFIQUEFILE="specificDatas.xml"; - - - - public ZebliCalquePersist(String directoryPath_, Map parameters) throws IOException { - this.directoryPath_ = directoryPath_; - parameters_ = parameters; - } - - - - /** - * Recupere le parser adequat. - * @return - */ - private XStream getParser(){ - if(parser_==null) - parser_=initXmlParser(); - return parser_; - } - - /** - * Init le parser avec les alias adequats. - * @return - */ - private XStream initXmlParser(){ - XStream xstream = new XStream(new DomDriver()); - //-- creation des alias pour que ce soit + parlant dans le xml file --// - xstream.alias("Groupe", EGGroupPersist.class); - - return xstream; - } - - /** - * Path vers els datas classique du calque - * @return - */ - private String getDataFilePath(){ - return directoryPath_+File.separator+DATA; - } - - - /** - * Retourne le path vers le fiochier principal des courbes - * @return - */ - private String getMainFilePath(){ - return directoryPath_+File.separator+MAINFILE; - } - - - /** - * Retourne le chemin vers le fichier de datats specifiques. - * @return - */ - private String getSpecifiqueDataFilePath(){ - return directoryPath_+File.separator+SPECIFIQUEFILE; - } - - /** - * Enrtegistre le calque au format persistant xml. - * - * @param parameters - * des parametres supplementaires utiles. - * @throws IOException - */ - public void savePersitCalqueXml(ZEbliCalquesPanel panelTopersist) { - ObjectOutputStream out=null; - // -- etape 1: on sauvegarde les datasPersistantes du panel au format zip dans le main - // path principale --// - ZebliCalqueDataPersitant dataPersistantes= panelTopersist.getPersistantSaver(); - dataPersistantes.fillInfoWith(panelTopersist); - try { - out = getParser().createObjectOutputStream(new FileWriter(new File(getSpecifiqueDataFilePath()))); - out.writeObject(dataPersistantes); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - finally{ - try { - out.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - //-- etape 2: on sauvegarde le type de zeblicalquePanel dans le fichier general --// -// try { -// out = getParser().createObjectOutputStream(new FileWriter(new File(getMainFilePath()))); -// -// //-- donneees bidon --// -// //-- on enregistre le nb de pages --// -// out.writeInt(panelTopersist.getNumberOfPages()); -// //-- fin donn\xE9es bidons --// -// -// //-- on enregistre le type de calque --// -// out.writeObject(panelTopersist.getClass().toString()); -// -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// finally{ -// try { -// out.close(); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// } - - - - - - } - - - public ZEbliCalquesPanel generateCalqueInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException{ - if(className.startsWith("class ")) - className=className.substring("class ".length()); - Class myclass =Class.forName(className, true, Thread.currentThread(). - getContextClassLoader()); - Object myModel=myclass.newInstance(); - if(myModel instanceof ZEbliCalquesPanel) - return (ZEbliCalquesPanel)myModel; - return null; - - } - - - /** - * Methode qui remplit le panel fournit en parametre avec les donn\xE9es - * sauvegardees. - * - * @param panelToFill - */ - public ZEbliCalquesPanel loadPersitCalqueXml( Map param) { - ObjectInputStream in=null; - ZEbliCalquesPanel veritablePanel=null; - - try { - // -- Init: on lit les donn\xE9es sp\xE9cifiques pour avoir la bonne classe zeblicalquepanel --// - //in=getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); - - //donnee bidon - //in.readInt(); - //-- lire le type de classe du calque--// - //String className=(String) in.readObject(); - - //-- on creer le type d'objet lu - //ZEbliCalquesPanel panelUseAsStatic; - - //panelUseAsStatic = generateCalqueInstance(className); - - //-- etape 1: on lit les donn\xE9es sp\xE9cifiques pour avoir la data persistantes - in=getParser().createObjectInputStream(new FileReader(new File(getSpecifiqueDataFilePath()))); - ZebliCalqueDataPersitant dataPersistantes= (ZebliCalqueDataPersitant) in.readObject(); - - //-- etape 2 on creer l'obejt calque correspondant a partir des datas persitantes - veritablePanel=dataPersistantes.generateCalquePanel(param); - - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - finally{ - try { - in.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - return veritablePanel; - } - - -} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -8,9 +8,7 @@ import java.util.HashMap; import java.util.Map; -import org.fudaa.ctulu.CtuluUI; import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.calque.ZebliCalquePersist; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; @@ -34,9 +32,11 @@ public EbliWidgetCreatorVueCalque(ZEbliCalquesPanel calque) { this(calque, null); } + public EbliWidgetCreatorVueCalque() { - + } + public EbliWidgetCreatorVueCalque(ZEbliCalquesPanel calque, GrBoite _initZoom) { super(); this.calque_ = calque; @@ -117,7 +117,6 @@ this.calque_ = calque; } - public Object getPersistData(Map parameters) { // TODO Auto-generated method stub // -- generation d'un identifiant unique pour le repertoire du graphe --// @@ -131,11 +130,8 @@ File createRep = new File(pathUnique); if (createRep.mkdir() || createRep.isDirectory()) { // (new FudaaFilleVisuPersistence(getCalque())).saveZEbliCalquesPanelIn - try { - (new ZebliCalquePersist(pathUnique, parameters)).savePersitCalqueXml(getCalque()); - } catch (IOException e) { - e.printStackTrace(); - } + getCalque().getPersistenceManager().savePersitCalqueXml(getCalque(), createRep, parameters); +// new ZebliCalquePersist(pathUnique, parameters).savePersitCalqueXml(getCalque()); } @@ -143,25 +139,23 @@ } public void setPersistData(Object data, Map parameters) { - // TODO Auto-generated method stub - if (data == null) - calque_ = new ZEbliCalquesPanel(null); + //comment on recupere le dossier ? + //il faut reconstruire le PersistenceManager par reflexion et c'est lui qui produire le ZEbliCalquesPanel + if (data == null) calque_ = new ZEbliCalquesPanel(null); else { String pathCalque = (String) data; - try { - calque_ = (new ZebliCalquePersist(pathCalque, parameters)).loadPersitCalqueXml(parameters ); - - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } +// try { +//// calque_ = (new ZebliCalquePersist(pathCalque, parameters)).loadPersitCalqueXml(parameters); +// +// } catch (FileNotFoundException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } } } - - } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -9,6 +9,7 @@ import java.io.IOException; +import org.fudaa.ctulu.CtuluArkSaver; import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ebli.calque.BCalque; @@ -85,7 +86,7 @@ - public void saveIn(final FudaaSaveZipWriter _writer, final ProgressionInterface _prog) { + public void saveIn(final CtuluArkSaver _writer, final ProgressionInterface _prog) { try { final BGroupeCalque donneesCalque = visu_.getDonneesCalque(); _writer.createDir(rep_, donneesCalque.getTousCalques().length + 1); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSavable.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSavable.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSavable.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -7,19 +7,16 @@ */ package org.fudaa.fudaa.commun.save; -import com.db4o.ObjectContainer; +import org.fudaa.ctulu.CtuluSavable; -import org.fudaa.ctulu.ProgressionInterface; + /** * Une interface a implementer pour les composants persistants (stockables sur fichiers projet). + * * @author bmarchan * @version $Id: FudaaSavable.java,v 1.3 2008-01-10 09:58:20 bmarchan Exp $ */ -public interface FudaaSavable { +public interface FudaaSavable extends CtuluSavable { - void saveIn(ObjectContainer _db, ProgressionInterface _prog); - - void saveIn(FudaaSaveZipWriter _writer, ProgressionInterface _prog); - } Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -1,168 +0,0 @@ -/* - * @creation 30 ao\xFBt 06 - * @modification $Date: 2007-05-04 13:58:09 $ - * @license GNU General Public License 2 - * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail de...@fu... - */ -package org.fudaa.fudaa.commun.save; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Map; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; - -import com.db4o.Db4o; -import com.db4o.ObjectContainer; - -import org.fudaa.ctulu.CtuluArkSaver; -import org.fudaa.ctulu.CtuluLibFile; -import org.fudaa.ctulu.CtuluLibString; - -/** - * @author fred deniger - * @version $Id: FudaaSaveZipWriter.java,v 1.4 2007-05-04 13:58:09 deniger Exp $ - */ -public class FudaaSaveZipWriter implements CtuluArkSaver { - - public class DirZipEntry { - int idx_; - final String name_; - final int nbDigits_; - - /** - * @param _name le nom du dossier a inserer dans le zip - * @param _nbEntry le nombre d'entrees pr\xE9vues y compris les dossiers - */ - public DirZipEntry(final String _name, final int _nbEntry) { - super(); - name_ = _name; - nbDigits_ = Integer.toString(_nbEntry).length() + 1; - } - - /** - * @param _entry l'entree a ajouter - * @return name_+"/"+_entry - */ - public String getEntryName(final String _entry) { - return name_ + '/' + _entry; - } - - /** - * @return un nouvelle identifiant - */ - public String getNextId() { - return CtuluLibString.adjustSizeBefore(nbDigits_, Integer.toString(++idx_), '0') + '-'; - } - - } - ObjectContainer cont_; - File dbFile_; - final File f_; - - public static String getIdFromEntry(final String _entry) { - if (_entry == null) { - return null; - } - final int idx = _entry.indexOf('-'); - if (idx >= 0) { - return _entry.substring(0, idx + 1); - } - return null; - } - Map nameDirZip_; - - final ZipOutputStream zipOut_; - - public FudaaSaveZipWriter(final File _f) throws IOException { - super(); - f_ = _f; - zipOut_ = new ZipOutputStream(new FileOutputStream(f_)); - zipOut_.setLevel(8); - } - - public File getDestDir() { - return f_.getParentFile(); - } - - public void close() throws IOException { - if (zipOut_ != null) { - if (dbFile_ != null && cont_ != null) { - cont_.close(); - final ZipEntry entry = new ZipEntry(getDbEntryName()); - entry.setComment("Donnees concernant le style et les calculs interm\xE9diaires"); - zipOut_.putNextEntry(entry); - CtuluLibFile.copyStream(new FileInputStream(dbFile_), zipOut_, true, false); - zipOut_.closeEntry(); - dbFile_.delete(); - } - zipOut_.close(); - } - } - - public boolean isDirCreated(final String _name) { - return (nameDirZip_ != null) && nameDirZip_.containsKey(_name); - } - - public void createDir(final String _dirName, final int _nbEntry) { - createDirZipEntry(_dirName, _nbEntry); - - } - - public String getNextIdForDir(final String _dir) { - final DirZipEntry entry = getDirZipEntry(_dir); - return entry == null ? null : entry.getNextId(); - } - - public void startEntry(final String _entryName) throws IOException { - zipOut_.putNextEntry(new ZipEntry(_entryName)); - - } - - public DirZipEntry createDirZipEntry(final String _name, final int _nbEntry) { - if (nameDirZip_ == null) { - nameDirZip_ = new HashMap(); - } else if (nameDirZip_.containsKey(_name)) { - throw new IllegalAccessError("ebtry is already created"); - } - final DirZipEntry res = new DirZipEntry(_name, _nbEntry); - nameDirZip_.put(_name, res); - return res; - } - - public boolean isDbCreated() { - return cont_ != null; - } - - public ObjectContainer getDb() throws IOException { - if (cont_ == null) { - dbFile_ = File.createTempFile("fudaa.project", ".db"); - if (dbFile_ != null) { - FudaaSaveLib.configureDb4o(); - cont_ = Db4o.openFile(dbFile_.getAbsolutePath()); - } - } - return cont_; - } - - public static String getDbEntryName() { - return "project.db"; - } - - public OutputStream getOutStream() { - return zipOut_; - } - - public DirZipEntry getDirZipEntry(final String _name) { - return (nameDirZip_ == null) ? null : (DirZipEntry) nameDirZip_.get(_name); - } - - public static String getProjectDescEntryName() { - return "project.desc.xml"; - } -} Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -0,0 +1,168 @@ +/* + * @creation 30 ao\xFBt 06 + * @modification $Date: 2007-05-04 13:58:09 $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.fudaa.commun.save; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import com.db4o.Db4o; +import com.db4o.ObjectContainer; + +import org.fudaa.ctulu.CtuluArkSaver; +import org.fudaa.ctulu.CtuluLibFile; +import org.fudaa.ctulu.CtuluLibString; + +/** + * @author fred deniger + * @version $Id: FudaaSaveZipWriter.java,v 1.4 2007-05-04 13:58:09 deniger Exp $ + */ +public class FudaaSaveZipWriter implements CtuluArkSaver { + + public class DirZipEntry { + int idx_; + final String name_; + final int nbDigits_; + + /** + * @param _name le nom du dossier a inserer dans le zip + * @param _nbEntry le nombre d'entrees pr\xE9vues y compris les dossiers + */ + public DirZipEntry(final String _name, final int _nbEntry) { + super(); + name_ = _name; + nbDigits_ = Integer.toString(_nbEntry).length() + 1; + } + + /** + * @param _entry l'entree a ajouter + * @return name_+"/"+_entry + */ + public String getEntryName(final String _entry) { + return name_ + '/' + _entry; + } + + /** + * @return un nouvelle identifiant + */ + public String getNextId() { + return CtuluLibString.adjustSizeBefore(nbDigits_, Integer.toString(++idx_), '0') + '-'; + } + + } + ObjectContainer cont_; + File dbFile_; + final File f_; + + public static String getIdFromEntry(final String _entry) { + if (_entry == null) { + return null; + } + final int idx = _entry.indexOf('-'); + if (idx >= 0) { + return _entry.substring(0, idx + 1); + } + return null; + } + Map nameDirZip_; + + final ZipOutputStream zipOut_; + + public FudaaSaveZipWriter(final File _f) throws IOException { + super(); + f_ = _f; + zipOut_ = new ZipOutputStream(new FileOutputStream(f_)); + zipOut_.setLevel(8); + } + + public File getDestDir() { + return f_.getParentFile(); + } + + public void close() throws IOException { + if (zipOut_ != null) { + if (dbFile_ != null && cont_ != null) { + cont_.close(); + final ZipEntry entry = new ZipEntry(getDbEntryName()); + entry.setComment("Donnees concernant le style et les calculs interm\xE9diaires"); + zipOut_.putNextEntry(entry); + CtuluLibFile.copyStream(new FileInputStream(dbFile_), zipOut_, true, false); + zipOut_.closeEntry(); + dbFile_.delete(); + } + zipOut_.close(); + } + } + + public boolean isDirCreated(final String _name) { + return (nameDirZip_ != null) && nameDirZip_.containsKey(_name); + } + + public void createDir(final String _dirName, final int _nbEntry) { + createDirZipEntry(_dirName, _nbEntry); + + } + + public String getNextIdForDir(final String _dir) { + final DirZipEntry entry = getDirZipEntry(_dir); + return entry == null ? null : entry.getNextId(); + } + + public void startEntry(final String _entryName) throws IOException { + zipOut_.putNextEntry(new ZipEntry(_entryName)); + + } + + public DirZipEntry createDirZipEntry(final String _name, final int _nbEntry) { + if (nameDirZip_ == null) { + nameDirZip_ = new HashMap(); + } else if (nameDirZip_.containsKey(_name)) { + throw new IllegalAccessError("ebtry is already created"); + } + final DirZipEntry res = new DirZipEntry(_name, _nbEntry); + nameDirZip_.put(_name, res); + return res; + } + + public boolean isDbCreated() { + return cont_ != null; + } + + public ObjectContainer getDb() throws IOException { + if (cont_ == null) { + dbFile_ = File.createTempFile("fudaa.project", ".db"); + if (dbFile_ != null) { + FudaaSaveLib.configureDb4o(); + cont_ = Db4o.openFile(dbFile_.getAbsolutePath()); + } + } + return cont_; + } + + public static String getDbEntryName() { + return "project.db"; + } + + public OutputStream getOutStream() { + return zipOut_; + } + + public DirZipEntry getDirZipEntry(final String _name) { + return (nameDirZip_ == null) ? null : (DirZipEntry) nameDirZip_.get(_name); + } + + public static String getProjectDescEntryName() { + return "project.desc.xml"; + } +} Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java ___________________________________________________________________ Added: svn:mergeinfo + Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLib.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLib.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLib.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -15,9 +15,9 @@ import org.fudaa.ctulu.CtuluLibFile; import org.fudaa.ebli.calque.ZCalqueSelectionInteractionAbstract; - import org.fudaa.fudaa.commun.save.FudaaSaveZipWriter; + /** * Classe fourre tout d'utilitaires. * @author Fred Deniger Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjectPersistence.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjectPersistence.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjectPersistence.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -20,6 +20,7 @@ import org.fudaa.ctulu.CtuluLibFile; import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.CtuluSavable; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; @@ -83,11 +84,11 @@ for (int i = iframes.length - 1; i >= 0; i--) { if (iframes[i] instanceof FudaaSavable && !compSaved.contains(iframes[i])) { compSaved.add(iframes[i]); - ((FudaaSavable) iframes[i]).saveIn(writer, _prog); + ((CtuluSavable) iframes[i]).saveIn(writer, _prog); } } } - final FudaaSavable[] compToSave = _proj.getSavableComponent(); + final CtuluSavable[] compToSave = _proj.getSavableComponent(); if (compToSave != null) { for (int i = compToSave.length - 1; i >= 0; i--) { if (compToSave[i] != null && !compSaved.contains(compToSave[i])) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjet.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjet.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjet.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -11,11 +11,11 @@ import com.memoire.bu.BuInformationsDocument; +import org.fudaa.ctulu.CtuluSavable; import org.fudaa.dodico.fichiers.FileFormatSoftware; import org.fudaa.fudaa.commun.FudaaProjectInterface; import org.fudaa.fudaa.commun.FudaaProjetStateInterface; -import org.fudaa.fudaa.commun.save.FudaaSavable; /** * @author fred deniger @@ -26,7 +26,7 @@ /** * @return les composants qui doivent etre sauvegard\xE9s */ - FudaaSavable[] getSavableComponent(); + CtuluSavable[] getSavableComponent(); /** * @return la version soft, version et langage utilise Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjetDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjetDefault.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjetDefault.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -15,13 +15,13 @@ import com.memoire.bu.BuInformationsDocument; +import org.fudaa.ctulu.CtuluSavable; import org.fudaa.dodico.fichiers.FileFormatSoftware; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.FudaaProjectStateFrameListener; import org.fudaa.fudaa.commun.FudaaProjetStateDefault; import org.fudaa.fudaa.commun.FudaaProjetStateInterface; -import org.fudaa.fudaa.commun.save.FudaaSavable; /** * Fudaa-Modeleur : Une implementation de l'interface projet. @@ -65,7 +65,7 @@ opening_ = _b; } - public FudaaSavable[] getSavableComponent() { + public CtuluSavable[] getSavableComponent() { return null; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigFilleDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigFilleDefault.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigFilleDefault.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -13,6 +13,7 @@ import com.memoire.bu.BuUndoRedoInterface; +import org.fudaa.ctulu.CtuluArkSaver; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluExportDataInterface; import org.fudaa.ctulu.CtuluUI; @@ -26,7 +27,6 @@ import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.save.FudaaFilleVisuPersistence; import org.fudaa.fudaa.commun.save.FudaaSavable; -import org.fudaa.fudaa.commun.save.FudaaSaveZipWriter; import org.fudaa.fudaa.sig.FSigResource; import org.fudaa.fudaa.sig.FSigVisuPanelDefault; @@ -44,7 +44,7 @@ setPreferredSize(new Dimension(500, 400)); } - public void saveIn(final FudaaSaveZipWriter _writer, final ProgressionInterface _prog) { + public void saveIn(final CtuluArkSaver _writer, final ProgressionInterface _prog) { new FudaaFilleVisuPersistence(this).saveIn(_writer, _prog); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -17,9 +17,11 @@ import javax.swing.JComponent; +import org.fudaa.ctulu.CtuluArkSaver; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluUndoRedoInterface; +import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ebli.calque.BArbreCalque; import org.fudaa.ebli.calque.BGroupeCalque; import org.fudaa.ebli.calque.ZCalqueGrille; @@ -36,6 +38,7 @@ import org.fudaa.fudaa.commun.save.FudaaSaveZipWriter; import org.fudaa.fudaa.sig.FSigAttibuteTypeManager; +import com.db4o.ObjectContainer; import com.memoire.bu.BuMenu; /** @@ -44,6 +47,10 @@ */ public abstract class FSigVisuPanel extends ZEbliCalquesPanel implements CtuluUndoRedoInterface { + + + + private final CtuluCommandManager mng_; FSigAttibuteTypeManager attMng_; @@ -226,7 +233,6 @@ public final void updateInfoComponent() { getController().updateInfoComponent(); } - Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrProjetCommon.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrProjetCommon.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrProjetCommon.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -27,6 +27,7 @@ import org.fudaa.ctulu.CtuluHtmlWriter; import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.CtuluSavable; import org.fudaa.ctulu.CtuluTaskDelegate; import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.ProgressionInterface; @@ -50,7 +51,6 @@ import org.fudaa.fudaa.commun.courbe.FudaaGrapheTimeAnimatedVisuPanel; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.projet.FudaaProjetInformationPanel; -import org.fudaa.fudaa.commun.save.FudaaSavable; import org.fudaa.fudaa.fdico.FDicoProjectState; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.MvSelectionNodeOrEltData; @@ -327,8 +327,8 @@ return getTrParams().getH2dParametres().getMaillage(); } - public FudaaSavable[] getSavableComponent() { - return new FudaaSavable[] { visu_ }; + public CtuluSavable[] getSavableComponent() { + return new CtuluSavable[] { visu_ }; } public File getSaveFile() { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrFilleVisu.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrFilleVisu.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrFilleVisu.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -11,6 +11,7 @@ import javax.swing.Action; import javax.swing.JMenu; +import org.fudaa.ctulu.CtuluArkSaver; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluExportDataInterface; import org.fudaa.ctulu.CtuluHtmlWriter; @@ -30,7 +31,6 @@ import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.save.FudaaFilleVisuPersistence; import org.fudaa.fudaa.commun.save.FudaaSavable; -import org.fudaa.fudaa.commun.save.FudaaSaveZipWriter; import org.fudaa.fudaa.tr.common.TrFilleVisuInterface; import org.fudaa.fudaa.tr.common.TrResource; @@ -232,7 +232,7 @@ @Override public void replace() {} - public void saveIn(final FudaaSaveZipWriter _writer, final ProgressionInterface _prog) { + public void saveIn(final CtuluArkSaver _writer, final ProgressionInterface _prog) { new FudaaFilleVisuPersistence(this).saveIn(_writer, _prog); } 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-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -27,6 +27,7 @@ import javax.swing.ListModel; import org.fudaa.ctulu.CtuluAnalyze; +import org.fudaa.ctulu.CtuluArkSaver; import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluExpr; @@ -57,7 +58,6 @@ import org.fudaa.ebli.palette.BPaletteInfo.InfoData; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; import org.fudaa.fudaa.commun.save.FudaaSaveLib; -import org.fudaa.fudaa.commun.save.FudaaSaveZipWriter; import org.fudaa.fudaa.tr.common.TrPreferences; import org.fudaa.fudaa.tr.common.TrResource; import org.nfunk.jep.Variable; @@ -1278,7 +1278,7 @@ } } - public void saveIn(final FudaaSaveZipWriter _writer, final ProgressionInterface _prog) { + public void saveIn(final CtuluArkSaver _writer, final ProgressionInterface _prog) { try { saveIn(_writer.getDb(), _prog); } catch (final IOException _evt) { 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-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -8,8 +8,6 @@ package org.fudaa.fudaa.tr.post; import java.awt.event.ActionEvent; -import java.io.File; -import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Set; @@ -37,8 +35,7 @@ import org.fudaa.ebli.calque.ZCalqueSondeInteraction; import org.fudaa.ebli.calque.ZCalqueSondeInterface; import org.fudaa.ebli.calque.ZEbliCalquePanelController; -import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.calque.ZebliCalqueDataPersitant; +import org.fudaa.ebli.calque.ZEbliCalquesPanelPersistenceManager; import org.fudaa.ebli.calque.action.CalqueActionSonde; import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; import org.fudaa.ebli.calque.action.EbliCalqueActionVariableChooser; @@ -48,9 +45,6 @@ import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; -import org.fudaa.fudaa.commun.save.FudaaFilleVisuPersistence; -import org.fudaa.fudaa.commun.save.FudaaSaveZipLoader; -import org.fudaa.fudaa.commun.save.FudaaSaveZipWriter; import org.fudaa.fudaa.meshviewer.MvSelectionNodeOrEltData; import org.fudaa.fudaa.meshviewer.export.MvExportFactory; import org.fudaa.fudaa.meshviewer.layer.MvFrontierLayerAbstract; @@ -74,6 +68,11 @@ @SuppressWarnings("serial") public class TrPostVisuPanel extends TrVisuPanel implements TrPostDataListener, EbliAnimatedInterface { + @Override + public ZEbliCalquesPanelPersistenceManager getPersistenceManager() { + return new TrPostVisuPanelPersistenceManager(); + } + private class EvolutionAction extends EbliActionSimple { boolean rubar_; @@ -151,7 +150,6 @@ protected TrPostProjet projet_; - public boolean simplifiedInit; /** * Tres important!!! c'est la source utilisee par le trpostvisupanel. Il est automatiquement plac\xE9 en param du @@ -161,9 +159,6 @@ final JComponent suiviPanel_; - - - public TrPostVisuPanel(final TrPostCommonImplementation _impl, final TrPostProjet _projet, final BCalqueLegende _leg, final TrPostSource _src) { this(_impl, _projet, false, _leg, _src); @@ -193,7 +188,7 @@ isoLayer_ = buildIsoLayer(); final EbliActionInterface[] action = new EbliActionInterface[] { addActionEvolutionFor(getSource().isRubar()), new TrIsoLineAction(this) }; - simplifiedInit=_simplified; + simplifiedInit = _simplified; if (!_simplified) { final TrPostFlecheLayer fleche = new TrPostFlecheLayer(source_); fleche.setVisible(false); @@ -221,8 +216,6 @@ } - - protected EbliActionInterface addActionEvolutionFor(final boolean _rubar) { return new EvolutionAction(_rubar); } @@ -512,13 +505,5 @@ public TrPostProjet getProjet_() { return projet_; } - - - - - public ZebliCalqueDataPersitant getPersistantSaver() { - return new TrPostVisuPanelPersist(); - } - } \ No newline at end of file Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersist.java 2008-10-15 17:54:53 UTC (rev 4069) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersist.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -1,95 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import java.io.File; -import java.util.Map; - -import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.calque.ZebliCalqueDataPersitant; -import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; - -/** - * Version persistante du trpostVisuPanel. - * Peut etre sauvegard\xE9, a partir d'un trpostvisupanel et permet de sauvegarder un autre trpostvisupanel - * @author Adrien Hadoux - * - */ -public class TrPostVisuPanelPersist implements ZebliCalqueDataPersitant{ - - /** - * Chemin de la source utilis\xE9e poru g\xE9n\xE9rer le calque - */ - String pathSource; - - boolean simplified; - - - TrPostVisuPanelPersist(){ - - } - - /** - * Remplit les infos persistantes avec celel du trpostvisupanel - * @param panel - */ - public void fillInfoWith(ZEbliCalquesPanel p){ - TrPostVisuPanel panel= (TrPostVisuPanel) p; - simplified=panel.simplifiedInit; - pathSource=panel.getSource().getFile().getAbsolutePath(); - - //-- sauvegarde complete accessoire --// -// try { -// (new FudaaFilleVisuPersistence(this, getImpl())).saveIn(new FudaaSaveZipWriter(_f), getImpl() -// .getMainProgression()); -// } catch (IOException e) { -// e.printStackTrace(); -// } - - - } - - - /** - * Methode qui reconstruit le trpostvisupanel a partir des donn\xE9es persistantes. - * @param parameters - * @return - */ - public ZEbliCalquesPanel generateCalquePanel(Map parameters){ - - TrPostProjet projet=(TrPostProjet) parameters.get("TrPostProjet"); - - if(projet==null) - return null; - - //-- etape 1: recherche du source qui contient le path donn\xE9 --// - TrPostSource src=projet.findSource(pathSource); - - //-- etape 2 si source pas trouv\xE9, chargement du source --// - if(src==null){ - TrPostMultiSourceActivator activator=new TrPostMultiSourceActivator(projet); - activator.active(new File(pathSource),projet.getImpl()); - } - - //-- etape 3: creation du legende adapter --// - final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter((EbliScene) parameters.get("scene"), null); - - - //-- etape 3: creation du panel --// - if(src==null)return null; - - TrPostVisuPanel newPanel=new TrPostVisuPanel(projet.getImpl(),projet,legendeCalque,src); - - - - //-- accessoire: restorer les donn\xE9es --// -// try { -// (new FudaaFilleVisuPersistence(panel, panel.getImpl())).restore(panel.getImpl(), new FudaaSaveZipLoader(f), panel.getImpl() -// .getMainProgression()); -// } catch (IOException e) { -// e.printStackTrace(); -// } - - return newPanel; - } - -} Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistenceManager.java (from rev 4069, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersist.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistenceManager.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistenceManager.java 2008-10-15 22:33:24 UTC (rev 4070) @@ -0,0 +1,115 @@ +package org.fudaa.fudaa.tr.post; + +import java.io.File; +import java.io.IOException; +import java.util.Map; + +import org.fudaa.ctulu.CtuluArkSaver; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ebli.calque.ZEbliCalquesPanel; +import org.fudaa.ebli.calque.ZEbliCalquesPanelPersistenceManager; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; +import org.fudaa.fudaa.commun.save.FudaaFilleVisuPersistence; +import org.fudaa.fudaa.commun.save.FudaaSaveZipWriter; + +import com.db4o.ObjectContainer; + +/** + * Version persistante du trpostVisuPanel. Peut etre sauvegard\xE9, a partir d'un trpostvisupanel et permet de sauvegarder + * un autre trpostvisupanel + * + * @author Adrien Hadoux + */ +public class TrPostVisuPanelPersistenceManager extends ZEbliCalquesPanelPersistenceManager { + + + + File dist_; + + TrPostVisuPanelPersistenceManager() {} + +// /** +// * Remplit les infos persistantes avec celel du trpostvisupanel +// * +// * @param panel +// */ +// public void fillInfoWith(ZEbliCalquesPanel p) { +// TrPostVisuPanel panel = (TrPostVisuPanel) p; +// data_.simplified = panel.simplifiedInit; +// data_.pathSource = panel.getSource().getFile().getAbsolutePath(); +// try { +// p.saveIn(new FudaaSaveZipWriter(dist_), p.getCtuluUI().getMainProgression()); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// +// } +// +// /** +// * Methode qui reconstruit le trpostvisupanel a partir des donn\xE9es persistantes. +// * +// * @param parameters +// * @return +// */ +// public ZEbliCalquesPanel generateCalquePanel(Map parameters) { +// +// TrPostProjet projet = (TrPostProjet) parameters.get("TrPostProjet"); +// +// if (projet == null) return null; +// +// // -- etape 1: recherche du source qui contient le path donn\xE9 --// +// TrPostSource src = projet.findSource(data_.pathSource); +// +// // -- etape 2 si source pas trouv\xE9, chargement du source --// +// if (src == null) { +// TrPostMultiSourceActivator activator = new TrPostMultiSourceActivator(projet); +// activator.active(new File(data_.pathSource), projet.getImpl()); +// } +// +// // -- etape 3: creation du legende adapter --// +// final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter( +// (EbliScene) parameters.get("scene"), null); +// +// // -- etape 3: creation du panel --// +// if (src == null) return null; +// +// TrPostVisuPanel newPanel = new TrPostVisuPanel(projet.getImpl(), projet, legendeCalque, src); +// +// // -- accessoire: restorer les donn\xE9es --// +// // try { +// // (new FudaaFilleVisuPersistence(panel, panel.getImpl())).restore(panel.getImpl(), new FudaaSaveZipLoader(f), +// // panel.getImpl() +// // .getMainProgression()); +// // } catch (IOException e) { +// // e.printStackTrace(); +// // } +// +// return newPanel; +// } + + @Override + public ZEbliCalquesPanel loadPersitCalqueXml(Map _param, File _dir) { + //il faut recuperer la source et construire le TrPOstVisuPanel normalemet + //pour les donn\xE9es, il faut s'inspirer de FudaaFilleVisuPersistence.restore + return null; + } + + @Override + public void savePersitCalqueXml(ZEbliCalquesPanel _panelTopersist, File _dir, Map _params) { + //TODO il faut persister les datas + TrPostVisuPanelPersistenceManagerData data= new TrPostVisuPanelPersistenceManagerData(); + //TODO ici il faudrait sauvegarder un identifiant de source comme ce doit etre le cas pour les graphes + data.pathSource=((TrPostVisuPanel)_panelTopersist).getSource().getFile().getAbsolutePath(); + //sauvegarder les datas avec xstream + //les donnees + try { + new FudaaFilleVisuPersistence(_panelTopersist, _panelTopersist.getCtuluUI()).saveIn(new FudaaSaveZipWriter(_dir), + _panelTopersist.getCtuluUI().getMainProgression()); + } catch (IOException e) { + e.printStackTrace(); + } + + } + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistenceManager.java ___________________________________________________________________ Added: svn:mergeinfo + Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistenceManagerData.java =================================================================== --- bran... [truncated message content] |
From: <de...@us...> - 2008-10-16 20:33:37
|
Revision: 4076 http://fudaa.svn.sourceforge.net/fudaa/?rev=4076&view=rev Author: deniger Date: 2008-10-16 20:33:27 +0000 (Thu, 16 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipLoader.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModelPersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanelEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/mv/TestProfile.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistantData.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -3,10 +3,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.List; -import java.util.Random; -import com.memoire.fu.FuLog; - /** * Generateur d'Id uniques en singleton. * Gere des contraintes (id ajout\xE9s, retir\xE9s) 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 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -802,7 +802,7 @@ * Retourne les donn\xE9es persistantes. * @return */ - public ZebliCalqueDataPersitant getPersistenceManager() { + public ZEbliCalquesPanelPersistManager getPersistenceManager() { return null; } Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistManager.java (from rev 4075, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistManager.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistManager.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -0,0 +1,36 @@ +package org.fudaa.ebli.calque; + +import java.io.File; +import java.util.Map; + +/** + * Interface des datas persistantes du calques. + * Sont enregistrees dans un ficheir xml. + * Doivent etre serializables. + * Propose les methodes de construction du calque et de sauvegarde des donn\xE9es. + * @author Adrien Hadoux + * + */ +public interface ZEbliCalquesPanelPersistManager { + + /** + * Remplit l'interface avec les donn\xE9es. + * @param p + */ + public void fillInfoWith(ZEbliCalquesPanel p,File dirGeneralData); + + /** + * Permet de generer le calque coprrespondant aux donnees persistantes. + * @param parameters + * @return + */ + public ZEbliCalquesPanel generateCalquePanel(Map parameters,File dirGeneralData); + + /** + * Methode utilisee pour recuperer un nom plus 'comprehensible' + * A utiliser dans le cas d'une serialization xml de la classe: on donne ainsi un nom plus coh\xE9rent a la balise au lieu du nom de classe. + * @return + */ + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistManager.java ___________________________________________________________________ Added: svn:mergeinfo + Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -1,36 +0,0 @@ -package org.fudaa.ebli.calque; - -import java.io.File; -import java.util.Map; - -/** - * Interface des datas persistantes du calques. - * Sont enregistrees dans un ficheir xml. - * Doivent etre serializables. - * Propose les methodes de construction du calque et de sauvegarde des donn\xE9es. - * @author Adrien Hadoux - * - */ -public interface ZebliCalqueDataPersitant { - - /** - * Remplit l'interface avec les donn\xE9es. - * @param p - */ - public void fillInfoWith(ZEbliCalquesPanel p,File dirGeneralData); - - /** - * Permet de generer le calque coprrespondant aux donnees persistantes. - * @param parameters - * @return - */ - public ZEbliCalquesPanel generateCalquePanel(Map parameters,File dirGeneralData); - - /** - * Methode utilisee pour recuperer un nom plus 'comprehensible' - * A utiliser dans le cas d'une serialization xml de la classe: on donne ainsi un nom plus coh\xE9rent a la balise au lieu du nom de classe. - * @return - */ - - -} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -8,10 +8,6 @@ import java.io.ObjectOutputStream; import java.util.Map; -import org.fudaa.ctulu.CtuluUI; -import org.fudaa.ebli.courbe.EGGrapheTreeModel; -import org.fudaa.ebli.courbe.EGGroupPersist; - import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.DomDriver; @@ -107,9 +103,11 @@ out = getParser().createObjectOutputStream(new FileWriter(new File(getMainFilePath()))); //-- recuperation des datats persistantes specifiques au panel --// - ZebliCalqueDataPersitant dataPersistantes = panelTopersist.getPersistenceManager(); + ZEbliCalquesPanelPersistManager dataPersistantes = panelTopersist.getPersistenceManager(); //-- enregistrement des don\xE9nes sp\xE9cifiques du calque -// + //TODO je prefere que fillInfoWith renvoie un objet et de donnees et c'est ce dernier qui est sauve + //dans le out, il suffit d'ecrire la nom de classe du persistManager dataPersistantes.fillInfoWith(panelTopersist,new File(getSpecifiqueDataFilePath())); //-- sauvegarde de la classe dataPersistantes dans le fichier specifiqueData @@ -131,16 +129,16 @@ // TODO il faut generer la classe du persistencemanager - public ZEbliCalquesPanel generateCalqueInstance(String className) throws ClassNotFoundException, - InstantiationException, IllegalAccessException { - if (className.startsWith("class ")) className = className.substring("class ".length()); - Class myclass = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); - Object myModel = myclass.newInstance(); - if (myModel instanceof ZEbliCalquesPanel) return (ZEbliCalquesPanel) myModel; - return null; +// public ZEbliCalquesPanel generateCalqueInstance(String className) throws ClassNotFoundException, +// InstantiationException, IllegalAccessException { +// if (className.startsWith("class ")) className = className.substring("class ".length()); +// Class myclass = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); +// Object myModel = myclass.newInstance(); +// if (myModel instanceof ZEbliCalquesPanel) return (ZEbliCalquesPanel) myModel; +// return null; +// +// } - } - /** * Methode qui remplit le panel fournit en parametre avec les donn\xE9es sauvegardees. * @@ -168,7 +166,7 @@ // -- etape 1: on lit les donn\xE9es sp\xE9cifiques pour avoir la data persistantes in = getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); - ZebliCalqueDataPersitant dataPersistantes = (ZebliCalqueDataPersitant) in.readObject(); + ZEbliCalquesPanelPersistManager dataPersistantes = (ZEbliCalquesPanelPersistManager) in.readObject(); // -- etape 2 on creer l'obejt calque correspondant a partir des datas persitantes veritablePanel = dataPersistantes.generateCalquePanel(param,new File(getSpecifiqueDataFilePath())); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -10,7 +10,6 @@ import java.io.IOException; import org.fudaa.ctulu.CtuluArkSaver; -import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ebli.calque.BCalque; import org.fudaa.ebli.calque.BCalquePersistenceGroupe; @@ -33,38 +32,42 @@ * @version $Id: FudaaFilleVisuPersistence.java,v 1.9 2007-06-20 12:23:38 deniger Exp $ */ public class FudaaFilleVisuPersistence implements FudaaSavable { - - ZEbliFilleCalques visu_; + + ZEbliCalquesPanel visu_; String rep_ = "data"; + + // /** + // * Cas ou l'on veut sauvegarder directement un calquePanel + // */ + // ZEbliCalquesPanel calquepanel_; + /** - * Cas ou l'on veut sauvegarder directement un calquePanel - */ - ZEbliCalquesPanel calquepanel_; - - /** * constructeur reserv\xE9 au ZEbliFilleCalques + * * @param _visu */ public FudaaFilleVisuPersistence(final ZEbliFilleCalques _visu) { super(); FudaaSaveLib.configureDb4o(); - visu_ = _visu; + visu_ = _visu.getVisuPanel(); } - + /** * constructeur reserv\xE9 au ZEbliCalquesPanel + * * @param _calque */ - public FudaaFilleVisuPersistence(final ZEbliCalquesPanel _calque, CtuluUI ui) { - super(); - FudaaSaveLib.configureDb4o(); - ZEbliFilleCalques fille = new ZEbliFilleCalques(ui, _calque.getGcDonnees()); - calquepanel_ = _calque; - visu_ = fille; - } + public FudaaFilleVisuPersistence(final ZEbliCalquesPanel _calque) { + super(); + FudaaSaveLib.configureDb4o(); + // ZEbliFilleCalques fille = new ZEbliFilleCalques(ui, _calque.getGcDonnees()); + // calquepanel_ = _calque; + visu_ = _calque; + } /** * Methode utilisee pour sauvegarder le zeblicalquepanel. + * * @param _writer * @param _prog */ @@ -84,8 +87,6 @@ // } // } - - public void saveIn(final CtuluArkSaver _writer, final ProgressionInterface _prog) { try { final BGroupeCalque donneesCalque = visu_.getDonneesCalque(); @@ -131,7 +132,7 @@ saveData.ptMaxY_ = b.e_.y_; saveData.ptMinX_ = b.o_.x_; saveData.ptMinY_ = b.o_.y_; - saveData.legendUI_ = visu_.getVisuPanel().getCqLegend().saveUIProperties(); + saveData.legendUI_ = visu_.getCqLegend().saveUIProperties(); final BCalque selectedLayers = visu_.getCalqueActif(); if (selectedLayers != null) { saveData.selectedLayer_ = selectedLayers.getName(); @@ -149,7 +150,7 @@ saveData == null ? null : saveData.props_); final BCalquePersistenceGroupe persistenceMng = parent.getGroupePersistenceMng(); persistenceMng.setTop(true); - persistenceMng.restoreFrom(adapter, visu_.getVisuPanel(), parent, rep_ + '/', null, _prog); + persistenceMng.restoreFrom(adapter, visu_, parent, rep_ + '/', null, _prog); return restoreFille(saveData, _impl, parent); } catch (final RuntimeException _evt) { FuLog.error(_evt); @@ -167,7 +168,7 @@ if (saveData.props_ != null) { final BCalquePersistenceGroupe gr = new BCalquePersistenceGroupe(); gr.setTop(true); - gr.restore(saveData.props_, visu_.getVisuPanel(), parent, _prog); + gr.restore(saveData.props_, visu_, parent, _prog); } return restoreFille(saveData, _impl, parent); } catch (final RuntimeException _evt) { @@ -202,8 +203,8 @@ b.ajuste(_saveData.ptMinX_, _saveData.ptMinY_, 0); visu_.getVueCalque().changeRepere(visu_, b); } - if (_saveData.legendUI_ != null && visu_.getVisuPanel().getCqLegend() != null) { - visu_.getVisuPanel().getCqLegend().initFrom(_saveData.legendUI_); + if (_saveData.legendUI_ != null && visu_.getCqLegend() != null) { + visu_.getCqLegend().initFrom(_saveData.legendUI_); } } }; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipLoader.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipLoader.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipLoader.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -20,14 +20,13 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import org.fudaa.ctulu.CtuluLibFile; + import com.db4o.Db4o; import com.db4o.ObjectContainer; - import com.memoire.fu.FuEmptyArrays; import com.memoire.fu.FuLog; -import org.fudaa.ctulu.CtuluLibFile; - /** * @author fred deniger * @version $Id: FudaaSaveZipLoader.java,v 1.4 2007-01-08 15:38:19 deniger Exp $ @@ -59,6 +58,15 @@ m_.put(_key, _value); } + public void safeClose() { + try { + close(); + } catch (final IOException _evt) { + FuLog.error(_evt); + + } + } + public String getOption(final String _key) { return m_ == null ? null : (String) m_.get(_key); } @@ -115,9 +123,7 @@ public InputStream getInputStream(final String _entry) { try { final ZipEntry entry = file_.getEntry(_entry); - if (entry == null) { - return null; - } + if (entry == null) { return null; } return file_.getInputStream(entry); } catch (final IOException _evt) { FuLog.error(_evt); @@ -128,9 +134,7 @@ public InputStream getReader(final String _parentDir, final String _entryName) { try { final ZipEntry entry = file_.getEntry(_parentDir + _entryName); - if (entry == null) { - return null; - } + if (entry == null) { return null; } return file_.getInputStream(entry); } catch (final IOException _evt) { FuLog.error(_evt); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaSaveZipWriter.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -19,6 +19,7 @@ import com.db4o.Db4o; import com.db4o.ObjectContainer; +import com.memoire.fu.FuLog; import org.fudaa.ctulu.CtuluArkSaver; import org.fudaa.ctulu.CtuluLibFile; @@ -61,20 +62,18 @@ } } + ObjectContainer cont_; File dbFile_; final File f_; public static String getIdFromEntry(final String _entry) { - if (_entry == null) { - return null; - } + if (_entry == null) { return null; } final int idx = _entry.indexOf('-'); - if (idx >= 0) { - return _entry.substring(0, idx + 1); - } + if (idx >= 0) { return _entry.substring(0, idx + 1); } return null; } + Map nameDirZip_; final ZipOutputStream zipOut_; @@ -105,6 +104,15 @@ } } + public void safeClose() { + try { + close(); + } catch (final IOException _evt) { + FuLog.error(_evt); + + } + } + public boolean isDirCreated(final String _name) { return (nameDirZip_ != null) && nameDirZip_.containsKey(_name); } @@ -127,9 +135,7 @@ public DirZipEntry createDirZipEntry(final String _name, final int _nbEntry) { if (nameDirZip_ == null) { nameDirZip_ = new HashMap(); - } else if (nameDirZip_.containsKey(_name)) { - throw new IllegalAccessError("ebtry is already created"); - } + } else if (nameDirZip_.containsKey(_name)) { throw new IllegalAccessError("ebtry is already created"); } final DirZipEntry res = new DirZipEntry(_name, _nbEntry); nameDirZip_.put(_name, res); return res; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -42,8 +42,7 @@ void profilPanelCreated(MvProfileFillePanel _panel, ProgressionInterface _prog, String _title); /** - * Get data trpostsource. - * @return + * TODO a enlever car ne doit pas dependre de Tr */ TrPostSource getDataSource(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModelPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModelPersist.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModelPersist.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -2,8 +2,6 @@ import java.util.Map; -import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsBuilder; -import org.fudaa.fudaa.tr.post.TrPostCourbeTreeModel; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.actions.TrPostProfileAction; @@ -55,7 +53,9 @@ } } - + /** + * TODO a enlever car ne doit pas dependre de Tr + */ /** * Methode qui remplit cetet classe a partir du modele fourni en entree. */ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanelEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanelEditor.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanelEditor.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -442,7 +442,6 @@ - @Override public TrPostSource getDataSource() { // TODO Auto-generated method stub return null; 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-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -35,7 +35,7 @@ import org.fudaa.ebli.calque.ZCalqueSondeInteraction; import org.fudaa.ebli.calque.ZCalqueSondeInterface; import org.fudaa.ebli.calque.ZEbliCalquePanelController; -import org.fudaa.ebli.calque.ZebliCalqueDataPersitant; +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; @@ -70,8 +70,8 @@ public class TrPostVisuPanel extends TrVisuPanel implements TrPostDataListener, EbliAnimatedInterface { @Override - public ZebliCalqueDataPersitant getPersistenceManager() { - return new TrPostVisuPanelPersistantData(); + public ZEbliCalquesPanelPersistManager getPersistenceManager() { + return new TrPostVisuPanelPersistManager(); } private class EvolutionAction extends EbliActionSimple { Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java (from rev 4075, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistantData.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -0,0 +1,198 @@ +package org.fudaa.fudaa.tr.post; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Map; + +import org.fudaa.ctulu.CtuluArkSaver; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ebli.calque.ZEbliCalquesPanel; +import org.fudaa.ebli.calque.ZebliCalquePersist; +import org.fudaa.ebli.calque.ZEbliCalquesPanelPersistManager; +import org.fudaa.ebli.courbe.EGGroupPersist; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; +import org.fudaa.fudaa.commun.save.FudaaFilleVisuPersistence; +import org.fudaa.fudaa.commun.save.FudaaSaveZipLoader; +import org.fudaa.fudaa.commun.save.FudaaSaveZipWriter; + +import com.db4o.ObjectContainer; +import com.memoire.fu.FuLog; +import com.thoughtworks.xstream.XStream; + +/** + * Version persistante du trpostVisuPanel. Peut etre sauvegard\xE9, a partir d'un trpostvisupanel et permet de sauvegarder + * un autre trpostvisupanel + * + * @author Adrien Hadoux + */ +public class TrPostVisuPanelPersistManager implements ZEbliCalquesPanelPersistManager +/* extends ZEbliCalquesPanelPersistenceManager */{ + + // -- Donnees qui vont etre persistees et enregistree telles qu'elle --// + + boolean simplified; + String idSource; + + TrPostVisuPanelPersistManager() { + + } + + // /** + // * Remplit les infos persistantes avec celle du trpostvisupanel + // * + // * @param panel + // */ + public void fillInfoWith(ZEbliCalquesPanel p, File dirGeneralData) { + TrPostVisuPanel panel = (TrPostVisuPanel) p; + simplified = panel.simplifiedInit; + idSource = panel.getSource().getId(); + + // //-- etape 2: on sauvegarde les donnees --// + FudaaSaveZipWriter writer = null; + try { + dirGeneralData.mkdirs(); + writer = new FudaaSaveZipWriter(new File(dirGeneralData, "calques.zip")); + new FudaaFilleVisuPersistence(panel).saveIn(writer, panel.getCtuluUI().getMainProgression()); + } catch (IOException e) { + FuLog.error(e); + } finally { + if (writer != null) { + writer.safeClose(); + } + } + + } + + /** + * Methode qui reconstruit le trpostvisupanel a partir des donn\xE9es persistantes. + * + * @param parameters + * @return + */ + public ZEbliCalquesPanel generateCalquePanel(Map parameters, File dirGeneralData) { + + TrPostProjet projet = (TrPostProjet) parameters.get("TrPostProjet"); + + if (projet == null) return null; + + // -- etape 1: recherche du source qui contient le path donn\xE9 --// + TrPostSource src = projet.findSourceById(idSource); + + // -- etape 2 si source pas trouv\xE9, chargement du source --// + if (src == null) { + // TrPostMultiSourceActivator activator = new TrPostMultiSourceActivator(projet); + // activator.active(new File(idSource), projet.getImpl()); + return null; + } + + // -- etape 3: creation du legende adapter --// + final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter( + (EbliScene) parameters.get("scene"), null); + + // -- etape 3: creation du panel --// + if (src == null) return null; + + TrPostVisuPanel newPanel = new TrPostVisuPanel(projet.getImpl(), projet, legendeCalque, src); + + // -- restorer les donn\xE9es --// + FudaaSaveZipLoader loader = null; + try { + loader = new FudaaSaveZipLoader(new File(dirGeneralData, "calques.zip")); + (new FudaaFilleVisuPersistence(newPanel)).restore(newPanel.getImpl(), loader, newPanel.getImpl() + .getMainProgression()); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (loader != null) loader.safeClose(); + } + + return newPanel; + } + + // @Override + // public ZEbliCalquesPanel loadPersitCalqueXml(Map _param, File _dir) { + // + // + // //-- recuperation des donn\xE9es serializees xml --// + // + // + // TrPostProjet projet = (TrPostProjet) _param.get("TrPostProjet"); + // + // if (projet == null) return null; + // + // // -- etape 1: recherche du source qui contient le path donn\xE9 --// + // TrPostSource src = projet.findSource(data_.pathSource); + // + // // -- etape 2 si source pas trouv\xE9, chargement du source --// + // if (src == null) { + // TrPostMultiSourceActivator activator = new TrPostMultiSourceActivator(projet); + // activator.active(new File(data_.pathSource), projet.getImpl()); + // } + // + // // -- etape 3: creation du legende adapter --// + // final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter( + // (EbliScene) _param.get("scene"), null); + // + // // -- etape 3: creation du panel --// + // if (src == null) return null; + // + // TrPostVisuPanel newPanel = new TrPostVisuPanel(projet.getImpl(), projet, legendeCalque, src); + // + // // -- accessoire: restorer les donn\xE9es --// + // // try { + // // (new FudaaFilleVisuPersistence(panel, panel.getImpl())).restore(panel.getImpl(), new FudaaSaveZipLoader(f), + // // panel.getImpl() + // // .getMainProgression()); + // // } catch (IOException e) { + // // e.printStackTrace(); + // // } + // + // return newPanel; + // + // + // } + // + // @Override + // public void savePersitCalqueXml(ZEbliCalquesPanel _panelTopersist, File _dir, Map _params) { + // //TODO il faut persister les datas + // TrPostVisuPanelPersistenceManagerData data= new TrPostVisuPanelPersistenceManagerData(); + // //TODO ici il faudrait sauvegarder un identifiant de source comme ce doit etre le cas pour les graphes + // data.pathSource=((TrPostVisuPanel)_panelTopersist).getSource().getFile().getAbsolutePath(); + // //sauvegarder les datas avec xstream + // ObjectOutputStream out = null; + // + // + // try{ + // out=getParser().createObjectOutputStream(new FileWriter(new File(getMainFilePath()))); + // //-- ecriture de l'obejt data --// + // out.writeObject(data); + // + // } catch (IOException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + // finally{ + // try { + // out.close(); + // } catch (IOException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + // } + // + // + // //-- etape 2: on sauvegarde les donnees --// + // try { + // new FudaaFilleVisuPersistence(_panelTopersist, _panelTopersist.getCtuluUI()).saveIn(new FudaaSaveZipWriter(_dir), + // _panelTopersist.getCtuluUI().getMainProgression()); + // } catch (IOException e) { + // e.printStackTrace(); + // } + // + // } + +} Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistantData.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistantData.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistantData.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -1,201 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.Map; - -import org.fudaa.ctulu.CtuluArkSaver; -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.calque.ZebliCalquePersist; -import org.fudaa.ebli.calque.ZebliCalqueDataPersitant; -import org.fudaa.ebli.courbe.EGGroupPersist; -import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; -import org.fudaa.fudaa.commun.save.FudaaFilleVisuPersistence; -import org.fudaa.fudaa.commun.save.FudaaSaveZipLoader; -import org.fudaa.fudaa.commun.save.FudaaSaveZipWriter; - -import com.db4o.ObjectContainer; -import com.thoughtworks.xstream.XStream; - -/** - * Version persistante du trpostVisuPanel. Peut etre sauvegard\xE9, a partir d'un trpostvisupanel et permet de sauvegarder - * un autre trpostvisupanel - * - * @author Adrien Hadoux - */ -public class TrPostVisuPanelPersistantData implements ZebliCalqueDataPersitant -/*extends ZEbliCalquesPanelPersistenceManager*/ { - - - //-- Donnees qui vont etre persistees et enregistree telles qu'elle --// - - boolean simplified; - String idSource; - - - - TrPostVisuPanelPersistantData() { - - } - - - - -// /** -// * Remplit les infos persistantes avec celle du trpostvisupanel -// * -// * @param panel -// */ - public void fillInfoWith(ZEbliCalquesPanel p, File dirGeneralData) { - TrPostVisuPanel panel = (TrPostVisuPanel) p; - simplified = panel.simplifiedInit; - idSource = panel.getSource().getId(); - -// //-- etape 2: on sauvegarde les donnees --// - try { - new FudaaFilleVisuPersistence(panel, panel.getCtuluUI()).saveIn(new FudaaSaveZipWriter(dirGeneralData), - panel.getCtuluUI().getMainProgression()); - } catch (IOException e) { - e.printStackTrace(); - } - - } - - - - /** - * Methode qui reconstruit le trpostvisupanel a partir des donn\xE9es persistantes. - * - * @param parameters - * @return - */ - public ZEbliCalquesPanel generateCalquePanel(Map parameters,File dirGeneralData) { - - TrPostProjet projet = (TrPostProjet) parameters.get("TrPostProjet"); - - if (projet == null) return null; - - // -- etape 1: recherche du source qui contient le path donn\xE9 --// - TrPostSource src = projet.findSourceById(idSource); - - // -- etape 2 si source pas trouv\xE9, chargement du source --// - if (src == null) { -// TrPostMultiSourceActivator activator = new TrPostMultiSourceActivator(projet); -// activator.active(new File(idSource), projet.getImpl()); - return null; - } - - // -- etape 3: creation du legende adapter --// - final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter( - (EbliScene) parameters.get("scene"), null); - - // -- etape 3: creation du panel --// - if (src == null) return null; - - TrPostVisuPanel newPanel = new TrPostVisuPanel(projet.getImpl(), projet, legendeCalque, src); - - //-- restorer les donn\xE9es --// - try { - (new FudaaFilleVisuPersistence(newPanel, newPanel.getImpl())).restore(newPanel.getImpl(), new FudaaSaveZipLoader(dirGeneralData), - newPanel.getImpl() - .getMainProgression()); - } catch (IOException e) { - e.printStackTrace(); - } - - return newPanel; - } - - - - - - -// @Override -// public ZEbliCalquesPanel loadPersitCalqueXml(Map _param, File _dir) { -// -// -// //-- recuperation des donn\xE9es serializees xml --// -// -// -// TrPostProjet projet = (TrPostProjet) _param.get("TrPostProjet"); -// -// if (projet == null) return null; -// -// // -- etape 1: recherche du source qui contient le path donn\xE9 --// -// TrPostSource src = projet.findSource(data_.pathSource); -// -// // -- etape 2 si source pas trouv\xE9, chargement du source --// -// if (src == null) { -// TrPostMultiSourceActivator activator = new TrPostMultiSourceActivator(projet); -// activator.active(new File(data_.pathSource), projet.getImpl()); -// } -// -// // -- etape 3: creation du legende adapter --// -// final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter( -// (EbliScene) _param.get("scene"), null); -// -// // -- etape 3: creation du panel --// -// if (src == null) return null; -// -// TrPostVisuPanel newPanel = new TrPostVisuPanel(projet.getImpl(), projet, legendeCalque, src); -// -// // -- accessoire: restorer les donn\xE9es --// -// // try { -// // (new FudaaFilleVisuPersistence(panel, panel.getImpl())).restore(panel.getImpl(), new FudaaSaveZipLoader(f), -// // panel.getImpl() -// // .getMainProgression()); -// // } catch (IOException e) { -// // e.printStackTrace(); -// // } -// -// return newPanel; -// -// -// } -// -// @Override -// public void savePersitCalqueXml(ZEbliCalquesPanel _panelTopersist, File _dir, Map _params) { -// //TODO il faut persister les datas -// TrPostVisuPanelPersistenceManagerData data= new TrPostVisuPanelPersistenceManagerData(); -// //TODO ici il faudrait sauvegarder un identifiant de source comme ce doit etre le cas pour les graphes -// data.pathSource=((TrPostVisuPanel)_panelTopersist).getSource().getFile().getAbsolutePath(); -// //sauvegarder les datas avec xstream -// ObjectOutputStream out = null; -// -// -// try{ -// out=getParser().createObjectOutputStream(new FileWriter(new File(getMainFilePath()))); -// //-- ecriture de l'obejt data --// -// out.writeObject(data); -// -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// finally{ -// try { -// out.close(); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// } -// -// -// //-- etape 2: on sauvegarde les donnees --// -// try { -// new FudaaFilleVisuPersistence(_panelTopersist, _panelTopersist.getCtuluUI()).saveIn(new FudaaSaveZipWriter(_dir), -// _panelTopersist.getCtuluUI().getMainProgression()); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// -// } - -} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/mv/TestProfile.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/mv/TestProfile.java 2008-10-16 18:57:07 UTC (rev 4075) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/mv/TestProfile.java 2008-10-16 20:33:27 UTC (rev 4076) @@ -48,6 +48,10 @@ private TestProfile() {} protected static class ProfileTarget implements MvProfileTarget { + public TrPostSource getDataSource() { + return null; + } + final TrPostSource src_; EGDialog d_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-16 18:57:14
|
Revision: 4075 http://fudaa.svn.sourceforge.net/fudaa/?rev=4075&view=rev Author: hadouxad Date: 2008-10-16 18:57:07 +0000 (Thu, 16 Oct 2008) Log Message: ----------- - Fichier central de source cr?\195?\169e qui lie ID source/path source - V?\195?\169ritable notion d'id: -les id une fois fourni sont acquis pour toute la dur?\195?\169e de vie de la widget., idem pour les sources - Gestion intelligente des id des sources: affectation sur la demande et recopiage de l'id dans le cas de persistance - De m?\195?\170me que pour les Ebliwidget: - Les moulinettes pour les graphes sp?\195?\169cifiques sont termin?\195?\169es et fonctionnent NICKEL!! - enregistrement des donn?\195?\169es sp?\195?\169cifiques - variables - Points de pas de temsp - Points interpol?\195?\169s - Ligne de d?\195?\169part linestring poru les mvprofie - Gestion des id pour la sauvegarde du calque/ et du graphe - Gestion de la suppression des sources: supprime les widget linked to the source(cf mail de ce matin). TrPostScene. removeAllWidgetLinkedToSrc(Trpostsource) - Ajout des images poru les actions cubatures, bilan et lignes de courant - remise en place des moulinettes chargement/sauvegarde calque Toujours le m?\195?\170me probl?\195?\168me du restore: arrive a ?\195?\169crire mais ne parvient pas a lire le fichier sauver avec restore... Classe TrPostVisuPanelPersistantData LIGNE 103 (new FudaaFilleVisuPersistence(newPanel, newPanel.getImpl())).restore(newPanel.getImpl(), new FudaaSaveZipLoader(dirGeneralData), newPanel.getImpl() SI ON LA COMMENTE CA RECHARGE BIEN LE CALQUE. Probleme du zipFile qui n'arrive pas a vourir le fichier enregistr?\195?\169 par saveIn.... 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/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/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.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/common/TrPostActionLigneCourants.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrVisuPanelEditor.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/TrPostLayoutPanelController.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/TrPostScene.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/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionCubature.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/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal_calc1.png branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal_calc2.png branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal_oscilloscope.png branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModelPersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModelPersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistantData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistenceManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistenceManagerData.java Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal_calc1.png =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal_calc1.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal_calc2.png =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal_calc2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal_oscilloscope.png =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/crystal_oscilloscope.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream 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 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -797,8 +797,12 @@ public final void setModeVisible(final boolean _b) { mode_.setVisible(_b); } - - public ZEbliCalquesPanelPersistenceManager getPersistenceManager() { + + /** + * Retourne les donn\xE9es persistantes. + * @return + */ + public ZebliCalqueDataPersitant getPersistenceManager() { return null; } Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -1,162 +0,0 @@ -package org.fudaa.ebli.calque; - -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.Map; - -import org.fudaa.ctulu.CtuluUI; -import org.fudaa.ebli.courbe.EGGrapheTreeModel; -import org.fudaa.ebli.courbe.EGGroupPersist; - -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.io.xml.DomDriver; - -/** - * Classe qui gere les diff\xE9rents fichiers pour la persistance du calque. Doit recevoir en parametre le path du - * repertoire dans lequel sera sauvegard\xE9 le calque. - * - * @author Adrien Hadoux - */ -public abstract class ZEbliCalquesPanelPersistenceManager { - - /** - * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et model... - */ - String directoryPath_; - Map parameters_; - - private XStream parser_; - - private static String MAINFILE = "descriptorCalque.xml"; - private static String DATA = "datas.xml"; - private static String SPECIFIQUEFILE = "specificDatas.xml"; - - public ZEbliCalquesPanelPersistenceManager() {} - - /** - * Recupere le parser adequat. - * - * @return - */ - private XStream getParser() { - if (parser_ == null) parser_ = initXmlParser(); - return parser_; - } - - /** - * Init le parser avec les alias adequats. - * - * @return - */ - private XStream initXmlParser() { - XStream xstream = new XStream(new DomDriver()); - // -- creation des alias pour que ce soit + parlant dans le xml file --// - xstream.alias("Groupe", EGGroupPersist.class); - - return xstream; - } - - /** - * Path vers els datas classique du calque - * - * @return - */ - private String getDataFilePath() { - return directoryPath_ + File.separator + DATA; - } - - /** - * Retourne le path vers le fiochier principal des courbes - * - * @return - */ - private String getMainFilePath() { - return directoryPath_ + File.separator + MAINFILE; - } - - /** - * Retourne le chemin vers le fichier de datats specifiques. - * - * @return - */ - private String getSpecifiqueDataFilePath() { - return directoryPath_ + File.separator + SPECIFIQUEFILE; - } - - /** - * Enrtegistre le calque au format persistant xml. - * - * @param parameters des parametres supplementaires utiles. - * @throws IOException - */ - public abstract void savePersitCalqueXml(ZEbliCalquesPanel panelTopersist, File _dir, Map params) ; - - // } - // } - - // TODO il faut generer la classe du persistencemanager - public ZEbliCalquesPanel generateCalqueInstance(String className) throws ClassNotFoundException, - InstantiationException, IllegalAccessException { - if (className.startsWith("class ")) className = className.substring("class ".length()); - Class myclass = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); - Object myModel = myclass.newInstance(); - if (myModel instanceof ZEbliCalquesPanel) return (ZEbliCalquesPanel) myModel; - return null; - - } - - /** - * Methode qui remplit le panel fournit en parametre avec les donn\xE9es sauvegardees. - * - * @param panelToFill - */ - public abstract ZEbliCalquesPanel loadPersitCalqueXml(Map param, File _dir) ; -// { -// return null; - // ObjectInputStream in = null; - // ZEbliCalquesPanel veritablePanel = null; - // - // try { - // // -- Init: on lit les donn\xE9es sp\xE9cifiques pour avoir la bonne classe zeblicalquepanel --// - // // in=getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); - // - // // donnee bidon - // // in.readInt(); - // // -- lire le type de classe du calque--// - // // String className=(String) in.readObject(); - // - // // -- on creer le type d'objet lu - // // ZEbliCalquesPanel panelUseAsStatic; - // - // // panelUseAsStatic = generateCalqueInstance(className); - // - // // -- etape 1: on lit les donn\xE9es sp\xE9cifiques pour avoir la data persistantes - // in = getParser().createObjectInputStream(new FileReader(new File(getSpecifiqueDataFilePath()))); - // ZebliCalqueDataPersitant dataPersistantes = (ZebliCalqueDataPersitant) in.readObject(); - // - // // -- etape 2 on creer l'obejt calque correspondant a partir des datas persitantes - // veritablePanel = dataPersistantes.generateCalquePanel(param); - // - // } catch (ClassNotFoundException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } catch (IOException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } finally { - // try { - // in.close(); - // } catch (IOException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } - // } - // - // return veritablePanel; -// } - -} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalqueDataPersitant.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -0,0 +1,36 @@ +package org.fudaa.ebli.calque; + +import java.io.File; +import java.util.Map; + +/** + * Interface des datas persistantes du calques. + * Sont enregistrees dans un ficheir xml. + * Doivent etre serializables. + * Propose les methodes de construction du calque et de sauvegarde des donn\xE9es. + * @author Adrien Hadoux + * + */ +public interface ZebliCalqueDataPersitant { + + /** + * Remplit l'interface avec les donn\xE9es. + * @param p + */ + public void fillInfoWith(ZEbliCalquesPanel p,File dirGeneralData); + + /** + * Permet de generer le calque coprrespondant aux donnees persistantes. + * @param parameters + * @return + */ + public ZEbliCalquesPanel generateCalquePanel(Map parameters,File dirGeneralData); + + /** + * Methode utilisee pour recuperer un nom plus 'comprehensible' + * A utiliser dans le cas d'une serialization xml de la classe: on donne ainsi un nom plus coh\xE9rent a la balise au lieu du nom de classe. + * @return + */ + + +} Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java (from rev 4070, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanelPersistenceManager.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -0,0 +1,194 @@ +package org.fudaa.ebli.calque; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Map; + +import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGGroupPersist; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; + +/** + * Classe qui gere les diff\xE9rents fichiers pour la persistance du calque. Doit recevoir en parametre le path du + * repertoire dans lequel sera sauvegard\xE9 le calque. + * + * @author Adrien Hadoux + */ +public class ZebliCalquePersist { + + /** + * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et model... + */ + protected String directoryPath_; + + protected XStream parser_; + +/** + * Fichier principal qui contient une instance de la classe ZEbliCalquesPanelPersistenceManager + */ + private static String MAINFILE = "descriptorCalque.xml"; + private static String DATA = "datas.xml"; + private static String SPECIFIQUEFILE = "specificDatas"; + + public ZebliCalquePersist(String directoryPath) { + directoryPath_=directoryPath; + } + + /** + * Recupere le parser adequat. + * + * @return + */ + protected XStream getParser() { + if (parser_ == null) parser_ = initXmlParser(); + return parser_; + } + + /** + * Init le parser avec les alias adequats. + * + * @return + */ + protected XStream initXmlParser() { + XStream xstream = new XStream(new DomDriver()); + // -- creation des alias pour que ce soit + parlant dans le xml file --// + + + + return xstream; + } + + + + /** + * Path vers els datas classique du calque + * + * @return + */ + protected String getDataFilePath() { + return directoryPath_ + File.separator + DATA; + } + + /** + * Retourne le path vers le fiochier principal des courbes + * + * @return + */ + protected String getMainFilePath() { + return directoryPath_ + File.separator + MAINFILE; + } + + /** + * Retourne le chemin vers le fichier de datats specifiques. + * + * @return + */ + protected String getSpecifiqueDataFilePath() { + return directoryPath_ + File.separator + SPECIFIQUEFILE; + } + + /** + * Enrtegistre le calque au format persistant xml. + * + * @param parameters des parametres supplementaires utiles. + * @throws IOException + */ + public void savePersitCalqueXml(ZEbliCalquesPanel panelTopersist, Map params) { + + ObjectOutputStream out = null; + try { + out = getParser().createObjectOutputStream(new FileWriter(new File(getMainFilePath()))); + + //-- recuperation des datats persistantes specifiques au panel --// + ZebliCalqueDataPersitant dataPersistantes = panelTopersist.getPersistenceManager(); + + //-- enregistrement des don\xE9nes sp\xE9cifiques du calque -// + dataPersistantes.fillInfoWith(panelTopersist,new File(getSpecifiqueDataFilePath())); + + //-- sauvegarde de la classe dataPersistantes dans le fichier specifiqueData + out.writeObject(dataPersistantes); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } finally { + try { + out.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + + + // TODO il faut generer la classe du persistencemanager + public ZEbliCalquesPanel generateCalqueInstance(String className) throws ClassNotFoundException, + InstantiationException, IllegalAccessException { + if (className.startsWith("class ")) className = className.substring("class ".length()); + Class myclass = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); + Object myModel = myclass.newInstance(); + if (myModel instanceof ZEbliCalquesPanel) return (ZEbliCalquesPanel) myModel; + return null; + + } + + /** + * Methode qui remplit le panel fournit en parametre avec les donn\xE9es sauvegardees. + * + * @param panelToFill + */ + public ZEbliCalquesPanel loadPersitCalqueXml(Map param) + { + + ObjectInputStream in = null; + ZEbliCalquesPanel veritablePanel = null; + + try { + // -- Init: on lit les donn\xE9es sp\xE9cifiques pour avoir la bonne classe zeblicalquepanel --// + // in=getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); + + // donnee bidon + // in.readInt(); + // -- lire le type de classe du calque--// + // String className=(String) in.readObject(); + + // -- on creer le type d'objet lu + // ZEbliCalquesPanel panelUseAsStatic; + + // panelUseAsStatic = generateCalqueInstance(className); + + // -- etape 1: on lit les donn\xE9es sp\xE9cifiques pour avoir la data persistantes + in = getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); + ZebliCalqueDataPersitant dataPersistantes = (ZebliCalqueDataPersitant) in.readObject(); + + // -- etape 2 on creer l'obejt calque correspondant a partir des datas persitantes + veritablePanel = dataPersistantes.generateCalquePanel(param,new File(getSpecifiqueDataFilePath())); + + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } finally { + try { + in.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + return veritablePanel; + } + +} 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 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -8,6 +8,7 @@ package org.fudaa.ebli.courbe; import java.awt.Component; +import java.util.Map; import javax.swing.JComboBox; @@ -166,7 +167,7 @@ * Ces donn\xE9es pourront etre facilement serializee par un parser xml, bdd, ou texte * @return */ - public Object getSpecificPersitDatas(); + public Object getSpecificPersitDatas(Map Params); /** @@ -174,7 +175,7 @@ *Ces donn\xE9es proviennent de fichier de sauvegardes (xml,texte,bdd...) * @return */ - public void setSpecificPersitDatas(Object sepcPersitData); + public void setSpecificPersitDatas(Object sepcPersitData,Map Params); } \ 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 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -38,7 +38,7 @@ private static String COURBEDIRECTORY="courbes"; - public EGGraphePersist(String directoryPath_, Map parameters) throws IOException { + public EGGraphePersist(String directoryPath_) throws IOException { this.directoryPath_ = directoryPath_; } @@ -123,7 +123,7 @@ * @param parameters des parametres supplementaires utiles. * @throws IOException */ - public void savePersitGrapheXml(EGGraphe grapheTopersist) { + public void savePersitGrapheXml(EGGraphe grapheTopersist,Map parameters) { String mainfile=getMainFilePath(); //-- outputstream du xstream pour enregistrement des diff\xE9rents groupes--// ObjectOutputStream out=null; @@ -194,7 +194,7 @@ } //-- on enregistre les donn\xE9es specifiques en fonction du type de grapheModel --// - Object specifiquesDatas=grapheTopersist.getModel().getSpecificPersitDatas(); + Object specifiquesDatas=grapheTopersist.getModel().getSpecificPersitDatas(parameters); if(specifiquesDatas ==null ) return; try { @@ -246,7 +246,7 @@ * @throws IllegalAccessException * @throws InstantiationException */ - public EGGraphe loadPersitGrapheXml() throws FileNotFoundException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException{ + public EGGraphe loadPersitGrapheXml(Map parameters) throws FileNotFoundException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException{ EGGraphe graphe=null; String mainfile=getMainFilePath(); File fichierCourbes=getDirectoryCurves(); @@ -293,6 +293,35 @@ //mise a jour des b\xE9b\xE9s model.fireStructureChanged(); } + + + //-- on charge les donn\xE9es specifiques en fonction du type de grapheModel --// + ObjectInputStream in=null; + try { + //-- inputstream du xstream pour chargement des diff\xE9rents groupes--// + in = getParser().createObjectInputStream(new FileReader(new File(getSpecifiqueDataFilePath()))); + + //-- lecture des donn\xE9es specifiques --// + Object specifiquesDatas=in.readObject(); + + //-- remplissage du modele avec les donn\xE9es persistantes --// + graphe.getModel().setSpecificPersitDatas(specifiquesDatas, parameters); + + + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally{ + try { + in.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return graphe; } 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 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -15,6 +15,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import java.util.Map; import javax.swing.AbstractListModel; import javax.swing.ComboBoxModel; @@ -799,12 +800,12 @@ return duplic; } -public Object getSpecificPersitDatas() { +public Object getSpecificPersitDatas(Map parameters) { // TODO Auto-generated method stub return null; } -public void setSpecificPersitDatas(Object sepcPersitData) { +public void setSpecificPersitDatas(Object sepcPersitData,Map parameters) { // TODO Auto-generated method stub } 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 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -1124,11 +1124,11 @@ this.selectionModel_ = selectionModel_; } -public Object getSpecificPersitDatas() { - return null; +public Object getSpecificPersitDatas(Map Params) { + return "mod\xE8le g\xE9n\xE8rique"; } -public void setSpecificPersitDatas(Object sepcPersitData) { +public void setSpecificPersitDatas(Object sepcPersitData,Map Params) { } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -9,6 +9,7 @@ import java.util.Map; import org.fudaa.ebli.calque.ZEbliCalquesPanel; +import org.fudaa.ebli.calque.ZebliCalquePersist; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; @@ -130,8 +131,8 @@ File createRep = new File(pathUnique); if (createRep.mkdir() || createRep.isDirectory()) { // (new FudaaFilleVisuPersistence(getCalque())).saveZEbliCalquesPanelIn - getCalque().getPersistenceManager().savePersitCalqueXml(getCalque(), createRep, parameters); -// new ZebliCalquePersist(pathUnique, parameters).savePersitCalqueXml(getCalque()); + // getCalque().getPersistenceManager().savePersitCalqueXml(getCalque(), createRep, parameters); + (new ZebliCalquePersist(pathUnique)).savePersitCalqueXml(getCalque(),parameters); } @@ -145,16 +146,7 @@ else { String pathCalque = (String) data; -// try { -//// calque_ = (new ZebliCalquePersist(pathCalque, parameters)).loadPersitCalqueXml(parameters); -// -// } catch (FileNotFoundException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } + calque_ = (new ZebliCalquePersist(pathCalque)).loadPersitCalqueXml(parameters); } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -119,8 +119,8 @@ // - sauvegarde du contenu de l eggraphe dans un repertoire a part --// try { final File createRep = new File(pathUnique); - if (createRep.mkdir() || createRep.isDirectory()) new EGGraphePersist(pathUnique, parameters) - .savePersitGrapheXml(getGraphe()); + if (createRep.mkdir() || createRep.isDirectory()) new EGGraphePersist(pathUnique) + .savePersitGrapheXml(getGraphe(),parameters); } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -137,7 +137,7 @@ final String pathGraphe = (String) data; try { - pn_ = new EGFillePanel(new EGGraphePersist(pathGraphe, parameters).loadPersitGrapheXml()); + pn_ = new EGFillePanel(new EGGraphePersist(pathGraphe).loadPersitGrapheXml(parameters)); } catch (final Exception e) { FuLog.error(e); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -12,6 +12,7 @@ import org.fudaa.dodico.ef.EfGridData; import org.fudaa.dodico.ef.interpolation.EfInterpolator; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; +import org.fudaa.fudaa.tr.post.TrPostSource; /** * Une interface donnant tout ce qui est n\xE9cessaire \xE0 la g\xE9n\xE9ral de profil spatial. @@ -39,5 +40,11 @@ FudaaCourbeTimeListModel getTimeModel(); void profilPanelCreated(MvProfileFillePanel _panel, ProgressionInterface _prog, String _title); + + /** + * Get data trpostsource. + * @return + */ + TrPostSource getDataSource(); } 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 2008-10-16 14:58:47 UTC (rev 4074) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-10-16 18:57:07 UTC (rev 4075) @@ -14,6 +14,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Set; import javax.swing.tree.TreePath; @@ -34,6 +35,7 @@ import org.fudaa.dodico.ef.operation.EfLineIntersection; import org.fudaa.dodico.ef.operation.EfLineIntersectionsCorrectionTester; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsBuilder; +import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsDefault; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsMng; import org.fudaa.dodico.h2d.type.H2dVariableType; @@ -53,7 +55,11 @@ import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; +import org.fudaa.fudaa.tr.post.TrPostProjet; +import org.fudaa.fudaa.tr.post.TrPostSource; +import org.fudaa.fudaa.tr.post.actions.TrPostProfileAction; + import com.memoire.bu.BuLib; import com.memoire.bu.BuResource; import com.vividsolutions.jts.geom.Coordinate; @@ -64,628 +70,649 @@ * @version $Id: MvProfileTreeModel.java,v 1.12 2007-06-13 14:46:13 deniger Exp $ */ public class MvProfileTreeModel extends EGGrapheTreeModel implements Target { - FudaaCourbeTimeListModel timeModel_; - EfLineIntersectionsResultsMng resNode_; - EfLineIntersectionsResultsBuilder builderNode_; - EfLineIntersectionsResultsBuilder builderMesh_; - EfLineIntersectionsResultsMng resMesh_; + FudaaCourbeTimeListModel timeModel_; + EfLineIntersectionsResultsMng resNode_; + EfLineIntersectionsResultsBuilder builderNode_; + EfLineIntersectionsResultsBuilder builderMesh_; + EfLineIntersectionsResultsMng resMesh_; - final EfLineIntersectionsCorrectionTester tester_; - public MvProfileTarget target_; + EfLineIntersectionsCorrectionTester tester_; + + /** + * Ligne initialement utilis\xE9e pour la creation de la courbe + */ + LineString initLineNode; + LineString initLineMesh; + + + public MvProfileTarget target_; - public MvProfileTreeModel(final MvProfileTarget _target, final EfLineIntersectionsCorrectionTester _tester) { - super(); - timeModel_ = _target.getTimeModel(); - tester_ = _tester; - target_ = _target; - } + public MvProfileTreeModel(final MvProfileTarget _target, final EfLineIntersectionsCorrectionTester _tester) { + super(); + timeModel_ = _target.getTimeModel(); + tester_ = _tester; + target_ = _target; + } - public MvProfileTreeModel(final MvProfileTreeModel _model) { - super(); - timeModel_ = _model.target_.getTimeModel(); - tester_ = _model.tester_; - target_ = _model.target_; - } + public MvProfileTreeModel(final MvProfileTreeModel _model) { + super(); + timeModel_ = _model.target_.getTimeModel(); + tester_ = _model.tester_; + target_ = _model.target_; + } - /** - * ACHTUNG! Constructuer uniquement utilis\xE9 pour la serialization des graphes!! Il faut imp\xE9rativement initialiser la - * variable target_ avec un ProfilDapter apres coup avec le trpostsource qui convient - */ - public MvProfileTreeModel() { - tester_ = new MvProfileCoteTester(); + /** + * ACHTUNG! Constructuer uniquement utilis\xE9 pour la serialization des graphes!! Il faut imp\xE9rativement initialiser la + * variable target_ avec un ProfilDapter apres coup avec le trpostsource qui convient + */ + public MvProfileTreeModel() { + tester_ = new MvProfileCoteTester(); - } + } - public void setNodesResults(final EfLineIntersectionsResultsMng _resNode, - final EfLineIntersectionsResultsBuilder _builderNode) { - resNode_ = _resNode; - builderNode_ = _builderNode; - } + public void setNodesResults(final EfLineIntersectionsResultsMng _resNode, + final EfLineIntersectionsResultsBuilder _builderNode) { + resNode_ = _resNode; + builderNode_ = _builderNode; + if(builderNode_!=null ) + initLineNode=builderNode_.getInitLine_(); + + + } - public EfLineIntersectionsResultsBuilder getBuilderFor(final CtuluVariable _v) { - return target_.getData().isElementVar(_v) ? builderMesh_ : builderNode_; - } + public EfLineIntersectionsResultsBuilder getBuilderFor(final CtuluVariable _v) { + return target_.getData().isElementVar(_v) ? builderMesh_ : builderNode_; + } - public void setMeshesResults(final EfLineIntersectionsResultsMng _resMeshes, - final EfLineIntersectionsResultsBuilder _builderMeshes) { - resMesh_ = _resMeshes; - builderMesh_ = _builderMeshes; + public void setMeshesResults(final EfLineIntersectionsResultsMng _resMeshes, + final EfLineIntersectionsResultsBuilder _builderMeshes) { + resMesh_ = _resMeshes; + builderMesh_ = _builderMeshes; + if(builderMesh_!=null ) + initLineMesh=builderMesh_.getInitLine_(); - } + } - public EfLineIntersectionsResultsMng getResMesh() { - return resMesh_; - } + public EfLineIntersectionsResultsMng getResMesh() { + return resMesh_; + } - public H2dVariableType[] getVariables() { + public H2dVariableType[] getVariables() { - final List values = getShownVar(); + final List values = getShownVar(); - return null; - } + return null; + } - @Override - public boolean isStructureModifiable() { - return true; - } + @Override + public boolean isStructureModifiable() { + return true; + } - public void updateTimeStep(final int[] _idx, final ProgressionInterface _prog) { - blockEvents_ = true; - final FudaaCourbeTimeListModel newModel = target_.getTimeModel(); + public void updateTimeStep(final int[] _idx, final ProgressionInterface _prog) { + blockEvents_ = true; + final FudaaCourbeTimeListModel newModel = target_.getTimeModel(); - if (newModel != null) { - final boolean structureChanged = newModel.getSize() != timeModel_.getSize(); - // timeModel_.updateFrom(newModel); - if (structureChanged) { - timeModel_.fireStructureChanged(); - } else { - timeModel_.fireContentChanged(); - } - blockEvents_ = false; - BuLib.invokeLater(new Runnable() { + if (newModel != null) { + final boolean structureChanged = newModel.getSize() != timeModel_.getSize(); + // timeModel_.updateFrom(newModel); + if (structureChanged) { + timeModel_.fireStructureChanged(); + } else { + timeModel_.fireContentChanged(); + } + blockEvents_ = false; + BuLib.invokeLater(new Runnable() { - public void run() { - fireCourbeContentChanged(null, true); - if (structureChanged) { - final EGObject[] cs = getSelectedObjects(); - if (cs != null) { - for (int i = 0; i < cs.length; i++) { + public void run() { + fireCourbeContentChanged(null, true); + if (structureChanged) { + final EGObject[] cs = getSelectedObjects(); + if (cs != null) { + for (int i = 0; i < cs.length; i++) { - if (cs[i] instanceof MvProfileCourbeTime) { - ((MvProfileCourbeTime) cs[i]).selection_.setSelectionInterval(timeModel_.getSize() - 1, timeModel_ - .getSize() - 1); - } - } - } - } - } + if (cs[i] instanceof MvProfileCourbeTime) { + ((MvProfileCourbeTime) cs[i]).selection_.setSelectionInterval(timeModel_.getSize() - 1, timeModel_ + .getSize() - 1); + } + } + } + } + } - }); - } + }); + } - } + } - MvProfileGridPalette paletteGrid_; + MvProfileGridPalette paletteGrid_; - public EfLineIntersectionsResultsI[] getDefaultRes() { - return new EfLineIntersectionsResultsI[] { resNode_ == null ? null : resNode_.getDefaultRes(), - resMesh_ == null ? null : resMesh_.getDefaultRes() }; - } + public EfLineIntersectionsResultsI[] getDefaultRes() { + return new EfLineIntersectionsResultsI[] { resNode_ == null ? null : resNode_.getDefaultRes(), + resMesh_ == null ? null : resMesh_.getDefaultRes() }; + } - public static LineString createLineString(final EfLineIntersectionsResultsMng _res) { - if (_res == null) { return null; } - return createLineString(_res.getDefaultRes()); - } + public static LineString createLineString(final EfLineIntersectionsResultsMng _res) { + if (_res == null) { return null; } + return createLineString(_res.getDefaultRes()); + } - private static LineString createLineString(final EfLineIntersectionsResultsI _res) { - final Coordinate[] cs = new Coordinate[_res.getNbIntersect()]; - for (int i = cs.length - 1; i >= 0; i--) { - final EfLineIntersection intersect = _res.getIntersect(i); - cs[i] = new Coordinate(intersect.getX(), intersect.getY()); - } - return GISGeometryFactory.INSTANCE.createLineString(cs); - } + private static LineString createLineString(final EfLineIntersectionsResultsI _res) { + final Coordinate[] cs = new Coordinate[_res.getNbIntersect()]; + for (int i = cs.length - 1; i >= 0; i--) { + final EfLineIntersection intersect = _res.getIntersect(i); + cs[i] = new Coordinate(intersect.getX(), intersect.getY()); + } + return GISGeometryFactory.INSTANCE.createLineString(cs); + } - /** - * Recherche le bon groupe pour les profils spatiaux. peut creer le groupe si booleen est a true. - * - * @param _v - * @param _create - * @return - */ - public MvProfileCourbeGroup getGroup(final CtuluVariable _v, final boolean _create) { - for (int i = getNbEGObject() - 1; i >= 0; i--) { - final EGGroup g = getGroup(i); - if ((g instanceof MvProfileCourbeGroup) && ((MvProfileCourbeGroup) g).getVar() == _v) { return (MvProfileCourbeGroup) g; } - } - if (_create) { - final MvProfileCourbeGroup g = MvProfileFillePanel.createGroupFor(_v); - super.add(g); - return g; - } - return null; + /** + * Recherche le bon groupe pour les profils spatiaux. peut creer le groupe si booleen est a true. + * + * @param _v + * @param _create + * @return + */ + public MvProfileCourbeGroup getGroup(final CtuluVariable _v, final boolean _create) { + for (int i = getNbEGObject() - 1; i >= 0; i--) { + final EGGroup g = getGroup(i); + if ((g instanceof MvProfileCourbeGroup) && ((MvProfileCourbeGroup) g).getVar() == _v) { return (MvProfileCourbeGroup) g; } + } + if (_create) { + final MvProfileCourbeGroup g = MvProfileFillePanel.createGroupFor(_v); + super.add(g); + return g; + } + return null; - } + } - @Override - public boolean canDeleteCourbes() { - return true; - } + @Override + public boolean canDeleteCourbes() { + return true; + } - @Override - public void duplicateCourbe(final CtuluCommandManager _mng, final EGCourbe _c) { - if (!(_c instanceof MvProfileCourbeTime)) { return; } - super.duplicateCourbe(_mng, _c); - } + @Override + public void duplicateCourbe(final CtuluCommandManager _mng, final EGCourbe _c) { + if (!(_c instanceof MvProfileCourbeTime)) { return; } + super.duplicateCourbe(_mng, _c); + } - @Override - protected EGCourbeChild duplicateCourbe(final EGCourbeChild _c) { - return ((MvProfileCourbeTime) _c).duplicate(); - } + @Override + protected EGCourbeChild duplicateCourbe(final EGCourbeChild _c) { + return ((MvProfileCourbeTime) _c).duplicate(); + } - @Override - public boolean canAddCourbe() { - return true; - } + @Override + public boolean canAddCourbe() { + return true; + } - public boolean canComputeFlowrate() { - final boolean isVarContained = target_.getData().isDefined(H2dVariableType.HAUTEUR_EAU) - && target_.getData().isDefined(H2dVariableType.VITESSE_U) - && target_.getData().isDefined(H2dVariableType.VITESSE_V); - if (isVarContained) { - final boolean elt = target_.getData().isElementVar(H2dVariableType.HAUTEUR_EAU); - if (target_.getData().isElementVar(H2dVariableType.VITESSE_U) != elt) { return false; } - if (target_.getData().isElementVar(H2dVariableType.VITESSE_V) != elt) { return false; } - if (elt && resMesh_ == null) { return false; } - if (!elt && resNode_ == null) { return false; } - } - return true; - } + public boolean canComputeFlowrate() { + final boolean isVarContained = target_.getData().isDefined(H2dVariableType.HAUTEUR_EAU) + && target_.getData().isDefined(H2dVariableType.VITESSE_U) + && target_.getData().isDefined(H2dVariableType.VITESSE_V); + if (isVarContained) { + final boolean elt = target_.getData().isElementVar(H2dVariableType.HAUTEUR_EAU); + if (target_.getData().isElementVar(H2dVariableType.VITESSE_U) != elt) { return false; } + if (target_.getData().isElementVar(H2dVariableType.VITESSE_V) != elt) { return false; } + if (elt && resMesh_ == null) { return false; } + if (!elt && resNode_ == null) { return false; } + } + return true; + } - /** - * retourne la liste des variables du graphe. - * - * @return - */ - public List getShownVar() { - final List res = new ArrayList(getNbEGObject() - 1); - for (int i = getNbEGObject() - 1; i >= 0; i--) { - final EGGroup g = getGroup(i); - if (g.getChildCount() > 0 && (g instanceof MvProfileCourbeGroup)) { - res.add(((MvProfileCourbeGroup) g).getVar()); - } - } - return res; + /** + * retourne la liste des variables du graphe. + * + * @return + */ + public List getShownVar() { + final List res = new ArrayList(getNbEGObject() - 1); + for (int i = getNbEGObject() - 1; i >= 0; i--) { + final EGGroup g = getGroup(i); + if (g.getChildCount() > 0 && (g instanceof MvProfileCourbeGroup)) { + res.add(((MvProfileCourbeGroup) g).getVar()); + } + } + return res; - } + } - public void addNewCourbe(final CtuluCommandManager _cmd, final Component _c, final EGGraphe _graphe, final CtuluUI _ui) { - final MvProfileCourbeGroup groupBathy = getGroup(H2dVariableType.BATHYMETRIE, false); - final MvProfileCourbeGroup groupCote = getGroup(H2dVariableType.COTE_EAU, false); - final boolean mustUseSameAxe = groupBathy == null || groupCote == null; - CtuluVariable[] vars = target_.getVars(); - if (timeModel_ == null) { - final List l = new ArrayList(Arrays.asList(vars)); - l.removeAll(getShownVar()); - vars = (CtuluVariable[]) l.toArray(new CtuluVariable[l.size()]); + public void addNewCourbe(final CtuluCommandManager _cmd, final Component _c, final EGGraphe _graphe, final CtuluUI _ui) { + final MvProfileCourbeGroup groupBathy = getGroup(H2dVariableType.BATHYMETRIE, false); + final MvProfileCourbeGroup groupCote = getGroup(H2dVariableType.COTE_EAU, false); + final boolean mustUseSameAxe = groupBathy == null || groupCote == null; + CtuluVariable[] vars = target_.getVars(); + if (timeModel_ == null) { + final List l = new ArrayList(Arrays.asList(vars)); + l.removeAll(getShownVar()); + vars = (CtuluVariable[]) l.toArray(new CtuluVariable[l.size()]); - } - final MvExportChooseVarAndTime res = new MvExportChooseVarAndTime(CtuluLibSwing.createListModel(vars), timeModel_, - null); - if (timeModel_ != null) { - final int i = timeModel_.getSize() - 1; - res.getTimeSelectionModel().setSelectionInterval(i, i); - } - if (res.afficheModaleOk(_c)) { - new CtuluRunnable(BuResource.BU.getString("Ajouter"), _ui) { - @Override - public boolean run(final ProgressionInterface _proj) { - addNewCourbes(_graphe, mustUseSameAxe, res, _proj); - return true; - }; - }.run(); + } + final MvExportChooseVarAndTime res = new MvExportChooseVarAndTime(CtuluLibSwing.createListModel(vars), timeModel_, + null); + if (timeModel_ != null) { + final int i = timeModel_.getSize() - 1; + res.getTimeSelectionModel().setSelectionInterval(i, i); + } + if (res.afficheModaleOk(_c)) { + new CtuluRunnable(BuResource.BU.getString("Ajouter"), _ui) { + @Override + public boolean run(final ProgressionInterface _proj) { + addNewCourbes(_graphe, mustUseSameAxe, res, _proj); + return true; + }; + }.run(); - } + } - } + } - void addNewCourbes(final EGGraphe _graphe, final boolean _mustUseSameAxe, final MvExportChooseVarAndTime _res, - final ProgressionInterface _prog) { + void addNewCourbes(final EGGraphe _graphe, final boolean _mustUseSameAxe, final MvExportChooseVarAndTime _res, + final ProgressionInterface _prog) { - final CtuluVariable[] var = _res.getSelectedVar(); - final boolean mustUseSameAxe = _mustUseSameAxe - && (CtuluLibArray.containsObject(var, H2dVariableType.BATHYMETRIE) || CtuluLibArray.containsObject(var, - H2dVariableType.COTE_EAU)); - if (CtuluLibArray.isEmpty(var)) { return; } - int[] ts = _res.getSelectedTimeStepIdx(); - if (ts == null) { - if (timeModel_ != null) { return; } - ts = new int[0]; - } - final boolean isTime = timeModel_ != null; - for (int i = 0; i < var.length; i++) { - final MvProfileCourbeGroup g = getGroup(var[i], true); - final Color c = MvProfileFillePanel.getColorFor(i + 1, var[i]); - final EfLineIntersectionsResultsBuilder results = getBuilderFor(var[i]); - EGCourbeChild child; - for (int t = 0; t < ts.length; t++) { - final MVProfileCourbeModel model = new MVProfileCourbeModel(var[i], target_.getData(), ts[t], results, _prog); - if (isTime) { - model.setTitle(var[i].toString() + CtuluLibString.ESPACE + timeModel_.getElementAt(ts[t])); - child = new MvProfileCourbeTime(g, model, timeModel_); - } else { - child = new MvProfileCourbe(g, model); - } - final EGCourbeChild childFinal = child; - EventQueue.invokeLater(new Runnable() { - public void run() { - childFinal.setAspectContour(c); - g.addEGComponent(childFinal); + final CtuluVariable[] var = _res.getSelectedVar(); + final boolean mustUseSameAxe = _mustUseSameAxe + && (CtuluLibArray.containsObject(var, H2dVariableType.BATHYMETRIE) || CtuluLibArray.containsObject(var, + H2dVariableType.COTE_EAU)); + if (CtuluLibArray.isEmpty(var)) { return; } + int[] ts = _res.getSelectedTimeStepIdx(); + if (ts == null) { + if (timeModel_ != null) { return; } + ts = new int[0]; + } + final boolean isTime = timeModel_ != null; + for (int i = 0; i < var.length; i++) { + final MvProfileCourbeGroup g = getGroup(var[i], true); + final Color c = MvProfileFillePanel.getColorFor(i + 1, var[i]); + final EfLineIntersectionsResultsBuilder results = getBuilderFor(var[i]); + EGCourbeChild child; + for (int t = 0; t < ts.length; t++) { + final MVProfileCourbeModel model = new MVProfileCourbeModel(var[i], target_.getData(), ts[t], results, _prog); + if (isTime) { + model.setTitle(var[i].toString() + CtuluLibString.ESPACE + timeModel_.getElementAt(ts[t])); + child = new MvProfileCourbeTime(g, model, timeModel_); + } else { + child = new MvProfileCourbe(g, model); + } + final EGCourbeChild childFinal = child; + EventQueue.invokeLater(new Runnable() { + public void run() { + childFinal.setAspectContour(c); + g.addEGComponent(childFinal); - } + } - }); + }); - } - } - finishCreation(_graphe, mustUseSameAxe); - } + } + } + finishCreation(_graphe, mustUseSameAxe); + } - private void finishCreation(final EGGraphe _graphe, final boolean _mustUseSameAxe) { - EventQueue.invokeLater(new Runnable() { - public void run() { - final TreePath[] old = getSelectionModel().getSelectionPaths(); - fireStructureChanged(); - if (old != null) { - getSelectionModel().setSelectionPaths(old); - } - final EGGroup groupBathy = getGroup(H2dVariableType.BATHYMETRIE, false); - final EGGroup groupCote = getGroup(H2dVariableType.COTE_EAU, false); - if (_mustUseSameAxe && groupBathy != null && groupCote != null) { - _graphe.useOneAxe(new EGAxeVertical[] { groupBathy.getAxeY(), groupCote.getAxeY() }, "Z", null); - } - } - }); - } + private void finishCreation(final EGGraphe _graphe, final boolean _mustUseSameAxe) { + EventQueue.invokeLater(new Runnable() { + public void run() { + final TreePath[] old = getSelectionModel().getSelectionPaths(); + fireStructureChanged(); + if (old != null) { + getSelectionModel().setSelectionPaths(old); + } + final EGGroup groupBathy = getGroup(H2dVariableType.BATHYMETRIE, false); + final EGGroup groupCote = getGroup(H2dVariableType.COTE_EAU, false); + if (_mustUseSameAxe && groupBathy != null && groupCote != null) { + _graphe.useOneAxe(new EGAxeVertical[] { groupBathy.getAxeY(), groupCote.getAxeY() }, "Z", null); + } + } + }); + } - public boolean containsTime() { - return timeModel_ != null; - } + public boolean containsTime() { + return timeModel_ != null; + } - public FudaaCourbeTimeListModel getTimeModel() { - return timeModel_; - } + public FudaaCourbeTimeListModel getTimeModel() { + return timeModel_; + } - public boolean isOutRemoved() { - if (resNode_ != null) { return resNode_.isOutRemoved(); } - return resMesh_.isOutRemoved(); - } + public boolean isOutRemoved() { + if (resNode_ != null) { return resNode_.isOutRemoved(); } + return resMesh_.isOutRemoved(); + } - public boolean isInit() { - if (resNode_ != null) { return resNode_.isInit(); } - return resMesh_.isInit(); - } + public boolean isInit() { + if (resNode_ != null) { return resNode_.isInit(); } + return resMesh_.isInit(); + } - private class UndoRes implements CtuluCommand { - final EfLineIntersectionsResultsMng old_; - final EfLineIntersectionsResultsMng oldMesh_; - final EfLineIntersectionsResultsMng new_; - final EfLineIntersectionsResultsMng newMesh_; - final CtuluUI ui_; + private class UndoRes implements CtuluCommand { + final EfLineIntersectionsResultsMng old_; + final EfLineIntersectionsResultsMng oldMesh_; + final EfLineIntersectionsResultsMng new_; + final EfLineIntersectionsResultsMng newMesh_; + final CtuluUI ui_; - public UndoRes(final EfLineIntersectionsResultsMng _old, final EfLineIntersectionsResultsMng _new, - final EfLineIntersectionsResultsMng _oldMesh, final EfLineIntersectionsResultsMng _newMesh, final CtuluUI _ui) { - super(); - old_ = _old; - ui_ = _ui; - new_ = _new; - oldMesh_ = _oldMesh; - newMesh_ = _newMesh; - } + public UndoRes(final EfLineIntersectionsResultsMng _old, final EfLineIntersectionsResultsMng _new, + final EfLineIntersectionsResultsMng _oldMesh, final EfLineIntersectionsResultsMng _newMesh, final CtuluUI _ui) { + super(); + old_ = _old; + ui_ = _ui; + new_ = _new; + oldMesh_ = _oldMesh; + newMesh_ = _newMesh; + } - public void redo() { - setRes(old_, oldMesh_, ui_); + public void redo() { + setRes(old_, oldMesh_, ui_); - } + } - public void undo() { - setRes(new_, newMesh_, ui_); + public void undo() { + setRes(new_, newMesh_, ui_); - } + } - } + } - protected void sendMessage(final int _nbPointRemoved, final CtuluUI _ui) { - _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("{0} point(s) enlev\xE9(s)", CtuluLibString - .getString(_nbPointRemoved)), true); - } + protected void sendMessage(final int _nbPointRemoved, final CtuluUI _ui) { + _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("{0} point(s) enlev\xE9(s)", CtuluLibString + .getString(_nbPointRemoved)), true); + } - public void inverse(final CtuluCommandContainer _cmd, final CtuluUI _ui) { - final EfLineIntersectionsResultsMng newRes = resNode_ == null ? null : resNode_.inversion(); - final EfLineIntersectionsResultsMng newResMesh = resMesh_ == null ? null : resMesh_.inversion(); - if (_cmd != null) { - _cmd.addCmd(new UndoRes(resNode_, newRes, resMesh_, newResMesh, _ui)); - } - setRes(newRes, newResMesh, _ui); - _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("inversion r\xE9ussie"), true); - } + public void inverse(final CtuluCommandContainer _cmd, final CtuluUI _ui) { + final EfLineIntersectionsResultsMng newRes = resNode_ == null ? null : resNode_.inversion(); + final EfLineIntersectionsResultsMng newResMesh = resMesh_ == null ? null : resMesh_.inversion(); + if (_cmd != null) { + _cmd.addCmd(new UndoRes(resNode_, newRes, resMesh_, newResMesh, _ui)); + } + setRes(newRes, newResMesh, _ui); + _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("inversion r\xE9ussie"), true); + } - public void removeExtPoint(final CtuluCommandContainer _cmd, final CtuluUI _ui) { - if (isOutRemoved()) { - sendMessage(0, _ui); - return; - } - final EfLineIntersectionsResultsMng newRes = resNode_ == null ? null : resNode_.removeExt(); - final EfLineIntersectionsResultsMng newResMesh = resMesh_ == null ? null : resMesh_.removeExt(); - if ((newResMesh == resMesh_) && (newRes == resNode_)) { - sendMessage(0, _ui); - } else { - if (_cmd != null) { - _cmd.addCmd(new UndoRes(resNode_, newRes, resMesh_, newResMesh, _ui)); - } - setRes(newRes, newResMesh, _ui); - _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("extraction r\xE9ussie"), true); - } + public void removeExtPoint(final CtuluCommandContainer _cmd, final CtuluUI _ui) { + if (isOutRemoved()) { + sendMessage(0, _ui); + return; + } + final EfLineIntersectionsResultsMng newRes = resNode_ == null ? null : resNode_.removeExt(); + final EfLineIntersectionsResultsMng newResMesh = resMesh_ == null ? null : resMesh_.removeExt(); + if ((newResMesh == resMesh_) && (newRes == resNode_)) { + sendMessage(0, _ui); + } else { + if (_cmd != null) { + _cmd.addCmd(new UndoRes(resNode_, newRes, resMesh_, newResMesh, _ui)); + } + setRes(newRes, newResMesh, _ui); + _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("extraction r\xE9ussie"), true); + } - } + } - public void extractFrom(final CtuluCommandContainer _cmd, final CtuluUI _ui, final int _i1, final int _i2) { - if (_i1 < _i2) { - final EfLineIntersectionsResultsMng newRes = resNode_ == null ? null : resNode_.extract(_i1, _i2); - final EfLineIntersectionsResultsMng newResMesh = resMesh_ == null ? null : resMesh_.extract(_i1, _i2); - if ((newResMesh == resMesh_) && (newRes == resNode_)) { - _ui.error(CtuluLibString.EMPTY_STRING, MvResource.getS("Nombre de points insuffisants"), true); - } else { - if (_cmd != null) { - _cmd.addCmd(new UndoRes(resNode_, newRes, resMesh_, newResMesh, _ui)); - } - setRes(newRes, newResMesh, _ui); - _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("extraction r\xE9ussie"), true); - } + public void extractFrom(final CtuluCommandContainer _cmd, final CtuluUI _ui, final int _i1, final int _i2) { + if (_i1 < _i2) { + final EfLineIntersectionsResultsMng newRes = resNode_ == null ? null : resNode_.extract(_i1, _i2); + final EfLineIntersectionsResultsMng newResMesh = resMesh_ == null ? null : resMesh_.extract(_i1, _i2); + if ((newResMesh == resMesh_) && (newRes == resNode_)) { + _ui.error(CtuluLibString.EMPTY_STRING, MvResource.getS("Nombre de points insuffisants"), true); + } else { + if (_cmd != null) { + _cmd.addCmd(new UndoRes(resNode_, newRes, resMesh_, newResMesh, _ui)); + } + setRes(newRes, newResMesh, _ui); + _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("extraction r\xE9ussie"), true); + } - } - } + } + } - public void reinitRes(final CtuluCommandContainer _cmd, final CtuluUI _ui) { - if (isInit()) { return; } - final CtuluTaskDelegate task = _ui.createTask(DodicoLib.getS("Recherche intersections")); - task.start(new Runnable() { + public void reinitRes(final CtuluCommandContainer _cmd, final CtuluUI _ui) { + if (isInit()) { return; } + final CtuluTaskDelegate task = _ui.createTask(DodicoLib.getS("Recherche intersections")); + task.start(new Runnable() { - public void run() { - final EfLineIntersectionsResultsMng newResultsNode = resNode_ == null ? null : resNode_.restoreInit(task - .getStateReceiver()); - final EfLineIntersectionsResultsMng newResultsMesh = resMesh_ == null ? null : resMesh_.restoreInit(task - .getStateReceiver()); - if ((newResultsMesh != resMesh_) || (newResultsNode != resNode_)) { - if (_cmd != null) { - _cmd.addCmd(new UndoRes(resNode_, newResultsNode, resMesh_, newResultsMesh, _ui)); - } - setRes(newResultsNode, newResultsMesh, _ui); - _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("Initialisation r\xE9ussie"), true); - } + public void run() { + final EfLineIntersectionsResultsMng newResultsNode = resNode_ == null ? null : resNode_.restoreInit(task + .getStateReceiver()); + final EfLineIntersectionsResultsMng newResultsMesh = resMesh_ == null ? null : resMesh_.restoreInit(task + .getStateReceiver()); + if ((newResultsMesh != resMesh_) || (newResultsNode != resNode_)) { + if (_cmd != null) { + _cmd.addCmd(new UndoRes(resNode_, newResultsNode, resMesh_, newResultsMesh, _ui)); + } + setRes(newResultsNode, newResultsMesh, _ui); + _ui.message(CtuluLibString.EMPTY_STRING, MvResource.getS("Initialisation r\xE9ussie"), true); + } - } + } - }); + }); - } + } - public void varRemoved(final CtuluVariable[] _var) { - if (_var != null) { - for (int i = _var.length - 1; i >= 0; i--) { - final EGGroup g = getGroup(_var[i], false); - ... [truncated message content] |
From: <had...@us...> - 2008-10-17 17:12:37
|
Revision: 4081 http://fudaa.svn.sourceforge.net/fudaa/?rev=4081&view=rev Author: hadouxad Date: 2008-10-17 17:12:25 +0000 (Fri, 17 Oct 2008) Log Message: ----------- - Meilleure gestion des id des sources: plus coh?\195?\169rent, g?\195?\169r?\195?\169 par le trpostprojet, ajoute le nom du fichier r?\195?\169sultat a la var al?\195?\169atoire - Gestion des groupes et fusion des calques. Les 2 sont bien g?\195?\169r?\195?\169es - Gestion du nettoyage du r?\195?\169pertoire de sauvegarde poru les ?\195?\169crasements de sauvegarde avec donn?\195?\169es diff?\195?\169rentes. - Gestion de plusieurs l?\195?\169gendes pour un seul calque - Gestion de la persistance des l?\195?\169gendes calques - Plus gros travail fourni que pour les graphes - Enregistrement du type de calque dont la l?\195?\169gende est construite Le chargement des l?\195?\169gendes est foireux pour le moment.... Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.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/meshviewer/profile/MvProfileTreeModelPersist.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/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/TrPostScene.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/actions/TrPostActionFusionCalques.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetGroupSerializeXml.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -4,6 +4,8 @@ import java.util.Calendar; import java.util.List; +import com.memoire.fu.FuLib; + /** * Generateur d'Id uniques en singleton. * Gere des contraintes (id ajout\xE9s, retir\xE9s) @@ -121,6 +123,12 @@ return ""+deliverUniqueId(); } + + public String deliverUniqueStringId(String name){ + + return FuLib.clean(name)+deliverUniqueId(); + } + /** * Clear la liste des contraintes */ Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -40,8 +40,7 @@ listing = Finit.listFiles(); - // tant qu'il y a des sous repertoires .... - while (listing.length > 0) { + // poiur chaque sous repertoire ... for (int i = 0; i < listing.length; i++) { // ...on verifie si c'est des fichier ... @@ -53,12 +52,13 @@ + b); } // si c'est un repertoire on demare une methode... -// else{ -// // on demare la methode -// removeDirectoryContentRecursivly(listing[i]); -// } + else{ + // on demare la methode + removeDirectoryContentRecursivly(listing[i]); + listing[i].delete(); + } } - } + } @@ -86,6 +86,10 @@ removeDirectoryContentRecursivly(listing2[i]); } } + + //-- on finit par supprimer le directory, sinon loop infinie garantie! --// + ToDel.delete(); + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -12,6 +12,7 @@ import javax.swing.JPanel; import org.fudaa.ebli.calque.BArbreCalqueModel; +import org.fudaa.ebli.calque.BCalque; import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.calque.BCalqueLegendePanel; import org.fudaa.ebli.palette.BPalettePlageInterface; @@ -39,196 +40,196 @@ @SuppressWarnings("serial") public class CalqueLegendeWidgetAdapter extends BCalqueLegende { - /** - * Mananger statique qui se charge de creer \xE9a widget associee au calque. - * - * @param _calqueLegende le panel legende qui sera recopie version widget - * @param _scene la scene - * @return la widfget de la legende. - */ - public static EbliWidgetCalqueLegende updateLegendeWidget(final EbliWidgetCalqueLegende _widgetLegende, - final BCalqueLegendePanel _calqueLegende, final EbliScene _scene) { + /** + * Mananger statique qui se charge de creer \xE9a widget associee au calque. + * + * @param _calqueLegende le panel legende qui sera recopie version widget + * @param _scene la scene + * @return la widfget de la legende. + */ + public static EbliWidgetCalqueLegende updateLegendeWidget(final EbliWidgetCalqueLegende _widgetLegende, + final BCalqueLegendePanel _calqueLegende, final EbliScene _scene) { - // --creation de la widget conteneur --// - BPalettePlageInterface listeplages = null; - // widgetLegende_ = new WidgetCalqueLegende(_scene, false, model, - // _calqueLegende); - _widgetLegende.setLayout(new FlowLayout(true, SerialAlignment.CENTER, 5)); - _widgetLegende.setBorder(BorderFactory.createEmptyBorder(10)); + // --creation de la widget conteneur --// + BPalettePlageInterface listeplages = null; + // widgetLegende_ = new WidgetCalqueLegende(_scene, false, model, + // _calqueLegende); + _widgetLegende.setLayout(new FlowLayout(true, SerialAlignment.CENTER, 5)); + _widgetLegende.setBorder(BorderFactory.createEmptyBorder(10)); - if (_calqueLegende != null) { - final Component[] listeC = _calqueLegende.getComponents(); + if (_calqueLegende != null) { + final Component[] listeC = _calqueLegende.getComponents(); - for (int i = 0; i < listeC.length; i++) { - final Component c = listeC[i]; - if (c instanceof JLabel) { + for (int i = 0; i < listeC.length; i++) { + final Component c = listeC[i]; + if (c instanceof JLabel) { - final LabelWidget titre = new LabelWidget(_scene); - titre.setAlignment(Alignment.CENTER); - titre.setVerticalAlignment(VerticalAlignment.CENTER); - titre.setLabel(((JLabel) c).getText()); - titre.setEnabled(true); - titre.setFont(c.getFont()); - _widgetLegende.addChild(titre); - } + final LabelWidget titre = new LabelWidget(_scene); + titre.setAlignment(Alignment.CENTER); + titre.setVerticalAlignment(VerticalAlignment.CENTER); + titre.setLabel(((JLabel) c).getText()); + titre.setEnabled(true); + titre.setFont(c.getFont()); + _widgetLegende.addChild(titre); + } - if (c instanceof BPalettePlageLegende) { + if (c instanceof BPalettePlageLegende) { - final BPalettePlageLegende pal = (BPalettePlageLegende) c; + final BPalettePlageLegende pal = (BPalettePlageLegende) c; - // --recuperation de la liste des plages --// - listeplages = pal.getModel(); + // --recuperation de la liste des plages --// + listeplages = pal.getModel(); + if(listeplages!=null){ + // --creation du titre --// + LabelWidget titre = new LabelWidget(_scene); + titre.setAlignment(Alignment.CENTER); + titre.setVerticalAlignment(VerticalAlignment.CENTER); + titre.setLabel(listeplages.getTitre()); + titre.setFont(pal.getFont()); + titre.setEnabled(true); + _widgetLegende.addChild(titre); + final LabelWidget sstitre = new LabelWidget(_scene); + sstitre.setAlignment(Alignment.CENTER); + titre.setFont(pal.getFont()); + sstitre.setVerticalAlignment(VerticalAlignment.CENTER); + sstitre.setLabel(listeplages.getSousTitre()); + sstitre.setEnabled(true); + _widgetLegende.addChild(sstitre); + final Widget ws = new Widget(_scene); + ws.setLayout(new FlowLayout(true, SerialAlignment.LEFT_TOP, 5)); + if (listeplages.getNbPlages() != 0) { + for (int j = 0; j < listeplages.getNbPlages(); j++) { - // --creation du titre --// - LabelWidget titre = new LabelWidget(_scene); - titre.setAlignment(Alignment.CENTER); - titre.setVerticalAlignment(VerticalAlignment.CENTER); - titre.setLabel(listeplages.getTitre()); - titre.setFont(pal.getFont()); - titre.setEnabled(true); - _widgetLegende.addChild(titre); - final LabelWidget sstitre = new LabelWidget(_scene); - sstitre.setAlignment(Alignment.CENTER); - titre.setFont(pal.getFont()); - sstitre.setVerticalAlignment(VerticalAlignment.CENTER); - sstitre.setLabel(listeplages.getSousTitre()); - sstitre.setEnabled(true); - _widgetLegende.addChild(sstitre); - final Widget ws = new Widget(_scene); - ws.setLayout(new FlowLayout(true, SerialAlignment.LEFT_TOP, 5)); - if (listeplages.getNbPlages() != 0) { - for (int j = 0; j < listeplages.getNbPlages(); j++) { + final BPlageInterface plage = listeplages.getPlageInterface(j); - final BPlageInterface plage = listeplages.getPlageInterface(j); + // -- ajout d'une widget plage --// + final EbliWidgetPlage lw = new EbliWidgetPlage(_scene, plage, null); - // -- ajout d'une widget plage --// - final EbliWidgetPlage lw = new EbliWidgetPlage(_scene, plage, null); + lw.setUseBorder(false); + lw.setEnabled(true); - lw.setUseBorder(false); - lw.setEnabled(true); + ws.addChild(lw); - ws.addChild(lw); + } + } else { + // liste des plages est vide il s agit d une autre legende + final Component[] lcomp = pal.getComponents(); + for (int j = 0; j < lcomp.length; j++) { + final Component co = lcomp[j]; - } - } else { - // liste des plages est vide il s agit d une autre legende - final Component[] lcomp = pal.getComponents(); - for (int j = 0; j < lcomp.length; j++) { - final Component co = lcomp[j]; + if (co instanceof JPanel) { + final JPanel panel = (JPanel) co; - if (co instanceof JPanel) { - final JPanel panel = (JPanel) co; + for (int k = 0; k < panel.getComponents().length; k++) { - for (int k = 0; k < panel.getComponents().length; k++) { + if (panel.getComponents()[k] instanceof JLabel) { + titre = new LabelWidget(_scene); + titre.setAlignment(Alignment.CENTER); + titre.setVerticalAlignment(VerticalAlignment.CENTER); + titre.setLabel(((JLabel) panel.getComponents()[k]).getText()); + titre.setEnabled(true); + ws.addChild(titre); + } else if (panel.getComponents()[k] instanceof JList) { + final JList jlst = (JList) panel.getComponents()[k]; + for (int g = 0; g < jlst.getModel().getSize(); g++) { + titre = new LabelWidget(_scene); + titre.setAlignment(Alignment.CENTER); + titre.setVerticalAlignment(VerticalAlignment.CENTER); + titre.setLabel((String) jlst.getModel().getElementAt(g)); + titre.setEnabled(true); + ws.addChild(titre); + } - if (panel.getComponents()[k] instanceof JLabel) { - titre = new LabelWidget(_scene); - titre.setAlignment(Alignment.CENTER); - titre.setVerticalAlignment(VerticalAlignment.CENTER); - titre.setLabel(((JLabel) panel.getComponents()[k]).getText()); - titre.setEnabled(true); - ws.addChild(titre); - } else if (panel.getComponents()[k] instanceof JList) { - final JList jlst = (JList) panel.getComponents()[k]; - for (int g = 0; g < jlst.getModel().getSize(); g++) { - titre = new LabelWidget(_scene); - titre.setAlignment(Alignment.CENTER); - titre.setVerticalAlignment(VerticalAlignment.CENTER); - titre.setLabel((String) jlst.getModel().getElementAt(g)); - titre.setEnabled(true); - ws.addChild(titre); - } + } - } + } - } + } - } + } - } + } + _widgetLegende.addChild(ws); + _widgetLegende.setLegendsWidget(ws); + }//fin du if listeplage==null + } + } - } - _widgetLegende.addChild(ws); - _widgetLegende.setLegendsWidget(ws); - } + _widgetLegende.setController(new EbliWidgetControllerLegendeCalque(_widgetLegende)); - } + // -- prendre en compte le resize automatique --// + _widgetLegende.getEbliScene().refresh(); + // _widgetLegende.setFormeFont(new Font("Helvetica", Font.PLAIN, 10)); - _widgetLegende.setController(new EbliWidgetControllerLegendeCalque(_widgetLegende)); + return _widgetLegende; + } else { + FuLog.warning("createLegendeWidget retourne widget null"); + return null; + } + } - // -- prendre en compte le resize automatique --// - _widgetLegende.getEbliScene().refresh(); - // _widgetLegende.setFormeFont(new Font("Helvetica", Font.PLAIN, 10)); + // public static Dimension createSizeForWidget(int _nbLibelles) { + // return new Dimension(WIDTH_LEGENDE + MAX_BORDURE, _nbLibelles * (LENGHT_PER_LEGENDE + MAX_BORDURE / 2)); + // } - return _widgetLegende; - } else { - FuLog.warning("createLegendeWidget retourne widget null"); - return null; - } - } + public static void reconstructWidget(EbliWidgetCalqueLegende widgetLegende_, + final BCalqueLegendePanel _calqueLegende, final EbliScene _scene/* , BArbreCalqueModel model */) { - // public static Dimension createSizeForWidget(int _nbLibelles) { - // return new Dimension(WIDTH_LEGENDE + MAX_BORDURE, _nbLibelles * (LENGHT_PER_LEGENDE + MAX_BORDURE / 2)); - // } + final EbliWidgetWithBordure parent = (EbliWidgetWithBordure) widgetLegende_.getParentWidget(); - public static void reconstructWidget(EbliWidgetCalqueLegende widgetLegende_, - final BCalqueLegendePanel _calqueLegende, final EbliScene _scene/* , BArbreCalqueModel model */) { + widgetLegende_ = updateLegendeWidget(widgetLegende_, _calqueLegende, _scene); - final EbliWidgetWithBordure parent = (EbliWidgetWithBordure) widgetLegende_.getParentWidget(); + parent.repaint(); - widgetLegende_ = updateLegendeWidget(widgetLegende_, _calqueLegende, _scene); + } - parent.repaint(); + BCalqueLegendePanel legendePanel_; - } + EbliScene scene_; - BCalqueLegendePanel legendePanel_; + public EbliScene getScene() { + return scene_; + } - EbliScene scene_; + public void setScene(final EbliScene _scene) { + scene_ = _scene; + } - public EbliScene getScene() { - return scene_; - } + public CalqueLegendeWidgetAdapter(final EbliScene _scene, final BArbreCalqueModel model) { + super(); + scene_ = _scene; + // modelTreeCalque_ = model; - public void setScene(final EbliScene _scene) { - scene_ = _scene; - } + } - public CalqueLegendeWidgetAdapter(final EbliScene _scene, final BArbreCalqueModel model) { - super(); - scene_ = _scene; - // modelTreeCalque_ = model; + /** + * override de calqueLegende qui recupere le panel legende associe + */ + @Override + protected void addLegendToPanel(final BCalqueLegendePanel _pnLeg) { - } + legendePanel_ = _pnLeg; - /** - * override de calqueLegende qui recupere le panel legende associe - */ - @Override - protected void addLegendToPanel(final BCalqueLegendePanel _pnLeg) { + // createLegende(); + } - legendePanel_ = _pnLeg; + /** + * cree la legende en widget. + * + * @return EbliNode cree ajoute a la scene. + */ + public EbliNode createLegende(final Point _location, final EbliScene _scene, final String id,BCalque calqueCible) { + setScene(_scene); + final EbliNodeDefault def = new EbliNodeDefault(); + def.setPreferedLocation(_location); + // def.setPreferedSize(new Dimension(150, 250)); + def.setCreator(new EbliWidgetCreatorLegende(legendePanel_, id,calqueCible)); + def.setTitle("L\xE9gende calque"); + // TODO non stable + _scene.addNode(def); + _scene.refresh(); - // createLegende(); - } + return def; + } - /** - * cree la legende en widget. - * - * @return EbliNode cree ajoute a la scene. - */ - public EbliNode createLegende(final Point _location, final EbliScene _scene, final String id) { - setScene(_scene); - final EbliNodeDefault def = new EbliNodeDefault(); - def.setPreferedLocation(_location); - // def.setPreferedSize(new Dimension(150, 250)); - def.setCreator(new EbliWidgetCreatorLegende(legendePanel_, id)); - def.setTitle("L\xE9gende calque"); - // TODO non stable - _scene.addNode(def); - _scene.refresh(); - - return def; - } - } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -5,8 +5,10 @@ import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import javax.swing.JComponent; import javax.swing.JLabel; @@ -20,6 +22,8 @@ import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ebli.calque.BArbreCalque; +import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BCalqueAffichage; import org.fudaa.ebli.calque.BCalquePaletteInfo; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; @@ -60,8 +64,12 @@ /** * widget de la legende */ - CalqueLegendeWidgetAdapter legendeWidget_; + //CalqueLegendeWidgetAdapter legendeWidget_; + Map<BCalque,CalqueLegendeWidgetAdapter> legendeWidget_=new HashMap<BCalque, CalqueLegendeWidgetAdapter>(); + + + BuMenuBar menuCalque_; JComponent panelTreeCalque_; @@ -153,23 +161,34 @@ // final Point nouvellePosition = new Point((widget_.getLocation().x), (int) (widget_.getLocation().y + widget_ // .getBounds().height * 1.2)); - if (!hasLegende()) { +// if (!hasLegende()) { - if (this.legendeWidget_ == null) { - legendeWidget_ = (CalqueLegendeWidgetAdapter) widgetCalque_.calquePanel_.getCqLegend(); - } + + BCalque calqueActif=widgetCalque_.calquePanel_.getCalqueActif(); + if(calqueActif!=null && calqueActif instanceof BCalqueAffichage){ + if (this.legendeWidget_.get(calqueActif) == null) { + //legendeWidget_ = (CalqueLegendeWidgetAdapter) widgetCalque_.calquePanel_.getCqLegend(); + legendeWidget_.put(widgetCalque_.calquePanel_.getCalqueActif(), (CalqueLegendeWidgetAdapter) widgetCalque_.calquePanel_.getCqLegend()); + + + CalqueLegendeWidgetAdapter legendeAdapter=this.legendeWidget_.get(calqueActif); + // -- creation de la legende final Point positionLegende = new Point(); if (widget_.getBounds() != null && widget_.getPreferredLocation() != null) { positionLegende.x = widget_.getPreferredLocation().x + widget_.getBounds().width + 20; positionLegende.y = widget_.getPreferredLocation().y; - setNodeLegende(legendeWidget_.createLegende(positionLegende, widget_.getEbliScene(), widget_.getId())); + setNodeLegende(legendeAdapter.createLegende(positionLegende, widget_.getEbliScene(), widget_.getId(),calqueActif)); } widget_.getEbliScene().refresh(); - } else if (getNodeLegende().hasWidget()) - // -- cas ou la legende existe mais est cach\xE9e --// - getNodeLegende().getWidget().setVisible(true); + } + } +// } else if (getNodeLegende().hasWidget()) +// // -- cas ou la legende existe mais est cach\xE9e --// +// getNodeLegende().getWidget().setVisible(true); + + // GrapheWidget.this.addChild(widgetLegende); } } @@ -305,8 +324,10 @@ return widgetCalque_.calquePanel_; } - public CalqueLegendeWidgetAdapter getLegendeWidget() { - return legendeWidget_; + public CalqueLegendeWidgetAdapter getLegendeWidget(BCalque calqueSelectionne) { + if(calqueSelectionne==null) + return null; + return legendeWidget_.get(calqueSelectionne); } /** @@ -440,8 +461,8 @@ return labelTrace_; } - public void setLegendeWidget(final CalqueLegendeWidgetAdapter _legendeWidget) { - this.legendeWidget_ = _legendeWidget; + public void setLegendeWidget(final CalqueLegendeWidgetAdapter _legendeWidget,BCalque calqueActif) { + this.legendeWidget_.put(calqueActif, _legendeWidget); } @Override Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -3,8 +3,11 @@ import java.awt.Font; import java.util.Map; +import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BCalqueAffichage; import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.calque.BCalqueLegendePanel; +import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; @@ -13,6 +16,8 @@ import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.netbeans.api.visual.widget.Widget; +import com.sun.corba.se.spi.legacy.connection.GetEndPointInfoAgainException; + /** * Creator pour les legendes des calques * @@ -20,81 +25,114 @@ */ public class EbliWidgetCreatorLegende implements EbliWidgetCreator { - BCalqueLegendePanel g; - // EbliWidget res; - /** - * L'id de la widget qui a declench\xE9 la legende - */ - private String IdPossessor_; - EbliWidgetWithBordure res; + BCalqueLegendePanel g; - // BArbreCalqueModel modelTreeCalque_; + /** + * La cible de la llegende. + * Ce calque appartient au panelde calque. + * Cela permet de g\xE9n\xE9rer une legende par calque + */ + BCalque calqueCible_; + // EbliWidget res; + /** + * L'id de la widget qui a declench\xE9 la legende + */ + private String IdPossessor_; + EbliWidgetWithBordure res; - public EbliWidgetCreatorLegende(final BCalqueLegendePanel g, final String id/* , BArbreCalqueModel model */) { - super(); - this.g = g; - IdPossessor_ = id; - // modelTreeCalque_ = model; - } + // BArbreCalqueModel modelTreeCalque_; - public EbliWidgetCreatorLegende() { + public EbliWidgetCreatorLegende(final BCalqueLegendePanel g, final String id,BCalque calqueCible) { + super(); + this.g = g; + IdPossessor_ = id; + calqueCible_=calqueCible; + // modelTreeCalque_ = model; + } - } + public EbliWidgetCreatorLegende() { - public BCalqueLegendePanel getG() { - return g; - } + } - public void setG(final BCalqueLegendePanel g) { - this.g = g; - } + public BCalqueLegendePanel getG() { + return g; + } - public EbliWidget create(final EbliScene _scene) { - final EbliWidgetCalqueLegende widgetLegende = CalqueLegendeWidgetAdapter.updateLegendeWidget( - new EbliWidgetCalqueLegende(_scene, false, g), g, _scene); - res = new EbliWidgetBordureSingle(widgetLegende, true, true); - widgetLegende.setFormeFont(new Font("Helvetica", Font.PLAIN, 10)); - widgetLegende.updateFont(widgetLegende.getFormeFont()); - return res; - } + public void setG(final BCalqueLegendePanel g) { + this.g = g; + } - public EbliWidget getWidget() { - return res; - } + public EbliWidget create(final EbliScene _scene) { + final EbliWidgetCalqueLegende widgetLegende = CalqueLegendeWidgetAdapter.updateLegendeWidget( + new EbliWidgetCalqueLegende(_scene, false, g), g, _scene); + res = new EbliWidgetBordureSingle(widgetLegende, true, true); + widgetLegende.setFormeFont(new Font("Helvetica", Font.PLAIN, 10)); + widgetLegende.updateFont(widgetLegende.getFormeFont()); + return res; + } - public EbliNode duplicate(final EbliNode _nodeAdupliquer) { - return null; - } + public EbliWidget getWidget() { + return res; + } - public EbliWidgetWithBordure getBordure() { - return res; - } + public EbliNode duplicate(final EbliNode _nodeAdupliquer) { + return null; + } - public Object getPersistData(final Map parameters) { - // -- pour le moment on se contente juste de rejouer la legende --// - return IdPossessor_; - } + public EbliWidgetWithBordure getBordure() { + return res; + } - public void setPersistData(final Object data, final Map parameters) { - if (data == null) g = new BCalqueLegendePanel(new BCalqueLegende(), "empty"); - else { - final String idCalque = (String) data; + public static class CoupleData{ + public String idPosessor; + public int indiceCalqueCible=0; + } - final EbliScene scene = (EbliScene) parameters.get("scene"); - // -- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --// - for (final Widget widget : scene.getLayerVisu().getChildren()) { - EbliWidget candidat = null; - if (widget instanceof EbliWidgetBordureSingle) candidat = ((EbliWidgetBordureSingle) widget).getIntern(); - else candidat = (EbliWidget) widget; + public Object getPersistData(final Map parameters) { + CoupleData data=new CoupleData(); + //-- on recupere l'indice du calque de la legende --// + data.idPosessor=IdPossessor_; - if (candidat.getId().equals(idCalque)) { - // --on a le bon, on rejoue la legende --// - ((EbliWidgetControllerCalque) candidat.getController()).ajoutLegende(); - return; - } - } - } + //-- recuperation du calque --// + EbliWidget widget=getWidget().getEbliScene().findById(IdPossessor_); + if(widget !=null && widget.getController() instanceof EbliWidgetControllerCalque){ + ZEbliCalquesPanel calque=((EbliWidgetControllerCalque) widget.getController()).getVisuPanel(); - } + data.indiceCalqueCible= calque.getArbreCalqueModel().getIndexOfChild(calque.getArbreCalqueModel().getRoot(), calqueCible_); + } + + return data; + } + + + public void setPersistData(final Object data, final Map parameters) { + if (data == null) g = new BCalqueLegendePanel(new BCalqueLegende(), "empty"); + else { + CoupleData datas=(CoupleData) data; + if(data !=null){ + String idCalque = (String) datas.idPosessor; + int indexCalque=datas.indiceCalqueCible; + + if(idCalque!=null){ + final EbliScene scene = (EbliScene) parameters.get("scene"); + // -- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --// + //-- recuperation du calque --// + EbliWidget widget=scene.findById(IdPossessor_); + if(widget !=null && widget.getController() instanceof EbliWidgetControllerCalque){ + ZEbliCalquesPanel calque=((EbliWidgetControllerCalque) widget.getController()).getVisuPanel(); + + //-- recuperation du bon calque --// + calqueCible_= (BCalque) calque.getArbreCalqueModel().getChild(calque.getArbreCalqueModel().getRoot(), indexCalque); + IdPossessor_=idCalque; + g=new BCalqueLegendePanel((BCalqueAffichage) calqueCible_,calqueCible_.getTitle()); + } + + + } + } + } + + } + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -54,8 +54,8 @@ positionLegende.x = _dest.getLocation().x + _dest.getIntern().getPreferredSize().width + 5; positionLegende.y = _dest.getPreferredLocation().y; EbliWidgetVueCalque vue = (EbliWidgetVueCalque) _dest.getIntern(); - vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene(), getBordure().getIntern().getId()); - ((EbliWidgetControllerCalque) vue.getController()).setLegendeWidget(_legende); + vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene(), getBordure().getIntern().getId(),calque_.getCalqueActif()); + ((EbliWidgetControllerCalque) vue.getController()).setLegendeWidget(_legende,calque_.getCalqueActif()); } public EbliWidget create(EbliScene _scene) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -12,6 +12,7 @@ import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; import org.netbeans.api.visual.widget.Widget; /** @@ -19,7 +20,7 @@ * * @author Adrien Hadoux */ -public final class EbliWidgetFusionCalques extends EbliWidget implements PropertyChangeListener { +public final class EbliWidgetFusionCalques extends EbliWidgetGroup implements PropertyChangeListener { public final ArrayList<EbliWidgetVueCalque> listeWidgetCalque_ = new ArrayList<EbliWidgetVueCalque>(); Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetGroupSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetGroupSerializeXml.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetGroupSerializeXml.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -0,0 +1,49 @@ +package org.fudaa.ebli.visuallibrary.persist; + +import java.awt.Dimension; +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; + +/** + * Classe utilisation pour la serialization des donn\xE9es widget groupes + * + * @author Adrien Hadoux + */ +public class EbliWidgetGroupSerializeXml extends EbliWidgetSerializeXml{ + + /** + * Indique si le groupe est une fusion ou pas + */ + boolean isFusion; + + public EbliWidgetGroupSerializeXml(EbliNode node, Map parameters,boolean isFusion) { + super(node, parameters); + // TODO Auto-generated constructor stub + this.isFusion=isFusion; + } + + + + /** + * Methode qui met a jour les infos du groupe. + * Pour des raisons de conception, ce groupe ne se cr\xE9e pas \xE0 ce niveau, car il est sp\xE9cialis\xE9 (peut etre groupe classique, ou groupe de calque ou autre. + * @param nodeGroup + */ + public void updateGroup(EbliNode nodeGroup){ + nodeGroup.setTitle(getTitle()); + nodeGroup.getWidget().setPreferredLocation(new Point(getX(), getY())); + nodeGroup.getWidget().setPreferredSize(new Dimension(getWidth(), getHeight())); + } + + public boolean isFusion() { + return isFusion; + } + + public void setFusion(boolean isFusion) { + this.isFusion = isFusion; + } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -87,7 +87,7 @@ } - private void fillInfoWith(final EbliNode node, final Map parameters) { + protected void fillInfoWith(final EbliNode node, final Map parameters) { EbliWidget widget; if (node.getWidget() instanceof EbliWidgetBordureSingle) { widget = (EbliWidget) node.getWidget().getChildren().get(0); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTarget.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -40,10 +40,5 @@ FudaaCourbeTimeListModel getTimeModel(); void profilPanelCreated(MvProfileFillePanel _panel, ProgressionInterface _prog, String _title); - - /** - * TODO a enlever car ne doit pas dependre de Tr - */ - TrPostSource getDataSource(); } 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 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -684,6 +684,9 @@ } + //-- duplication du target --// + duplic.target_=this.target_; + return duplic; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModelPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModelPersist.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModelPersist.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -19,15 +19,15 @@ public class MvProfileTreeModelPersist { public String type; - + public String idSource; - + LineString initLineNode; LineString initLineMesh; - + public MvProfileTreeModelPersist(){} - - + + /** * Methode qui remplit le model en param d'entr\xE9es avec les datas de cette classe. * @param model @@ -37,33 +37,38 @@ model.tester_=new MvProfileCoteTester(); model.initLineNode=initLineNode; model.initLineMesh=initLineMesh; - - + + //-- donnees specifiques propres au projet charg\xE9 --// TrPostProjet projet=(TrPostProjet) param.get("TrPostProjet"); if(projet!=null){ - TrPostSource src=projet.findSourceById(this.idSource); - if(src!=null){ - //-- creation du mvprofiletarget --// - model.target_=TrPostProfileAction.createProfileAdapter(src, projet) ; - model.timeModel_ = model.target_.getTimeModel(); + if(this.idSource!=null){ + TrPostSource src=projet.findSourceById(this.idSource); + if(src!=null){ + //-- creation du mvprofiletarget --// + model.target_=TrPostProfileAction.createProfileAdapter(src, projet) ; + model.timeModel_ = model.target_.getTimeModel(); + + } } - + + } } - } - - /** - * TODO a enlever car ne doit pas dependre de Tr - */ + /** + * TODO a enlever car ne doit pas dependre de Tr + */ + /** * Methode qui remplit cetet classe a partir du modele fourni en entree. */ public void fillDataWithModel(MvProfileTreeModel model){ type="Courbe spatiale"; //-- recuperer la source du mvprofile --// - TrPostSource src=model.target_.getDataSource(); - idSource=src.getId(); + if(model.target_.getData() instanceof TrPostSource){ + TrPostSource src=(TrPostSource) model.target_.getData(); + idSource=src.getId(); + } initLineNode=model.initLineNode; initLineMesh=model.initLineMesh; } 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-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -250,7 +250,7 @@ // -- ajout du rectangle --// final EbliNodeDefault nodeLegende = new EbliNodeDefault(); nodeLegende.setTitle("Legende calque"); - nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0), "x")); + nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0), "x",null)); 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/TrPostMultiSourceActivator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -106,7 +106,14 @@ public void active(final File _f, final TrPostCommonImplementation _impl){ - active(_f,_impl,CtuluLibGenerator.getInstance().deliverUniqueStringId()); + + String uniqueId; + if(_impl.c_!=null) + uniqueId=_impl.c_.deliverSourceId(_f.getName()); + else + uniqueId=CtuluLibGenerator.getInstance().deliverUniqueStringId(); + + active(_f,_impl,uniqueId); } /** 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-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -33,6 +33,7 @@ import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.CtuluLibGenerator; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ctulu.CtuluTaskDelegate; @@ -1249,7 +1250,30 @@ else return null; } + /** + * Genere et affecte a la source l'id. + * @param src + * @return + */ + public String deliverSourceId(TrPostSource src){ + if(src.getId()==null){ + String uniqueId=CtuluLibGenerator.getInstance().deliverUniqueStringId(src.getFile().getName()); + src.setId(uniqueId); + } + return src.getId(); + + } + /** + * genere uniquement l id. + * @param name + * @return + */ + public String deliverSourceId(String name){ + String uniqueId=CtuluLibGenerator.getInstance().deliverUniqueStringId(name); + + return uniqueId; + } public boolean isModified() { return modifyState_.isModified(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -104,10 +104,13 @@ EGGraphe graphe=((EbliWidgetCreatorGraphe)node.getCreator()).getGraphe(); if(graphe.getModel() instanceof MvProfileTreeModel){ MvProfileTreeModel model=(MvProfileTreeModel) graphe.getModel() ; - if(model.target_.getDataSource()!=null && model.target_.getDataSource()==src) + if(model.target_.getData() !=null && model.target_.getData() instanceof TrPostSource){ + TrPostSource sourceGraphe=(TrPostSource) model.target_.getData(); + if(sourceGraphe==src) //-- on degage cette widget --// listTodelete.add(node); } + } } } } 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-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -1409,13 +1409,13 @@ } private String id_; - protected String generateId() { - return CtuluLibGenerator.getInstance().deliverUniqueStringId(); - } +// protected String generateId() { +// return CtuluLibGenerator.getInstance().deliverUniqueStringId(); +// } 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/actions/TrPostActionFusionCalques.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java 2008-10-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -11,6 +11,7 @@ import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -38,6 +39,7 @@ import org.fudaa.ebli.visuallibrary.EbliLookFeel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerForGroup; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionSimple; @@ -101,6 +103,20 @@ ((EbliWidgetControllerCalque) widgetCalque_.getController()).hasAlreadyFusion = true; } } + + + /** + * Constructeur minimaliste qui r\xE9alise directement la fusion sans passer par un \xE9v\xE8nement. + * Il faut appeler la methode performGroupFusion avec la liste des claques a fusionner + * @param scene + * @param projet + */ + public TrPostActionFusionCalques(final EbliScene scene, final TrPostProjet projet){ + super(scene, TrResource.getS("Fusion avec un autre calque"), CtuluResource.CTULU.getIcon("cible"), + "ADDPOINTWIDGET"); + projet_ = projet; + } + /** * remplissage de la combo avec les graphes disponibles et compatibles @@ -193,7 +209,7 @@ } /** - * Methode qui: merge le graphe choisi dans la combo avec el ndoe actuel degage le node choisi de la scene remet a + * 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 */ private void mergeCalques() { @@ -220,22 +236,11 @@ // // public void act() { // final ProgressionInterface prog = new ProgressionBuAdapter(this); - final EbliNode fusion = groupWidgetsFusion(listeToMerge); + performGroupFusion(listeToMerge); + + - // -- undo/redo --// - getScene().getCmdMng().addCmd(new CtuluCommand() { - public void undo() { - - // -- degroupe et desynchronise le tout --// - EbliWidgetUngroupAction.degroupObjectsFromFusion(getScene(), fusion); - } - - public void redo() { - groupWidgetsFusion(listeToMerge); - } - }); - // } // }.start(); // ; @@ -245,7 +250,28 @@ } - private EbliNode groupWidgetsFusion(final ArrayList<EbliNode> _selectedObjects) { + + public EbliNode performGroupFusion(final Collection listeToMerge) { + final EbliNode fusion = groupWidgetsFusion(listeToMerge); + + // -- undo/redo --// + getScene().getCmdMng().addCmd(new CtuluCommand() { + + public void undo() { + + // -- degroupe et desynchronise le tout --// + EbliWidgetUngroupAction.degroupObjectsFromFusion(getScene(), fusion); + } + + public void redo() { + groupWidgetsFusion(listeToMerge); + } + }); + + return fusion; + } + + private EbliNode groupWidgetsFusion(final Collection<EbliNode> _selectedObjects) { final EbliWidgetFusionCalques parent = new EbliWidgetFusionCalques(scene_); // -- il faut des gaps suffisants pour deplacer la widget et avoir le menu 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-17 16:14:29 UTC (rev 4080) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-17 17:12:25 UTC (rev 4081) @@ -21,6 +21,7 @@ import javax.swing.JInternalFrame; import org.fudaa.ctulu.CtuluAnalyze; +import org.fudaa.ctulu.CtuluRemoveContentDirectory; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluFileChooser; import org.fudaa.ctulu.gui.CtuluLibSwing; @@ -30,7 +31,9 @@ import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetGroupAction; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetFusionCalques; import org.fudaa.ebli.visuallibrary.persist.EbliSceneSerializeXml; +import org.fudaa.ebli.visuallibrary.persist.EbliWidgetGroupSerializeXml; import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml; import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml.CoupleNomId; import org.fudaa.fudaa.tr.common.TrLib; @@ -42,6 +45,7 @@ import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.TrPostSourceAbstract; import org.fudaa.fudaa.tr.post.TrPostUserVariableSaver; +import org.fudaa.fudaa.tr.post.actions.TrPostActionFusionCalques; import org.netbeans.api.visual.widget.Widget; import com.memoire.fu.FuLog; @@ -440,6 +444,7 @@ final TrPostSource src = it.next(); final File f = src.getFile(); //out.writeObject(f.getAbsolutePath()); + trprojet_.deliverSourceId(src); listeCouplesIdSources.add(new TrPostSourcePersist(src)); // -- sauveagrde de la variable correspondante --// final TrPostUserVariableSaver var = TrPostUserVariableSaver.saveIn((TrPostSourceAbstract) src, null); @@ -579,14 +584,26 @@ // -- etape 1: creation du repertoire des graphe et calques --// final String pathGraphes = projet_.getAbsolutePath() + File.separator + "Graphes"; try { - new File(pathGraphes).mkdir(); + File fichierGraphes=new File(pathGraphes); + if(fichierGraphes.isDirectory()){ + //-- on le nettoie --// + CtuluRemoveContentDirectory.contentDirectoryRemover(fichierGraphes); + + }else + fichierGraphes.mkdir(); } catch (final Exception e) { // pas grave on continue FuLog.debug("Le repertoire des graphes existe deja"); } final String pathCalques = projet_.getAbsolutePath() + File.separator + "Calques"; try { - new File(pathCalques).mkdir(); + File fichierCalques=new File(pathCalques); + if(fichierCalques.isDirectory()){ + //-- on le nettoie --// + CtuluRemoveContentDirectory.contentDirectoryRemover(fichierCalques); + + }else + fichierCalques.mkdir(); } catch (final Exception e) { // pas grave on continue FuLog.debug("Le repertoire des calques existe deja"); @@ -600,7 +617,13 @@ } final String pathText = projet_.getAbsolutePath() + File.separator + "Textes"; try { - new File(pathText).mkdir(); + File fichierText=new File(pathText); + if(fichierText.isDirectory()){ + //-- on le nettoie --// + CtuluRemoveContentDirectory.contentDirectoryRemover(fichierText); + + }else + fichierText.mkdir(); } catch (final Exception e) { // pas grave on continue FuLog.debug("Le repertoire des textes existe deja"); @@ -810,6 +833,7 @@ // -- creation des alias pour que ce soit + parlant dans le xml file --// xstream.alias("LAYOUT", EbliSceneSerializeXml.class); xstream.alias("FRAME", EbliWidgetSerializeXml.class); + xstream.alias("GROUPE", EbliWidgetGroupSerializeXml.class); xstream.alias("FRAMESNAME", EbliWidgetSerializeXml.CoupleNomId.class); xstream.alias("SOURCE", TrPostSourcePersist.class); return xstream; @@ -838,16 +862,16 @@ final Iterator<Widget> it = scene.getLayerVisu().getChildren().iterator(); // -- creation d une liste particuliere pour les groupes--// - final List<EbliWidgetSerializeXml> listeGroupes = new ArrayList<EbliWidgetSerializeXml>(); + final List<EbliWidgetGroupSerializeXml> listeGroupes = new ArrayList<EbliWidgetGroupSerializeXml>(); while (it.hasNext()) { final Widget widget = it.next(); - if (widget instanceof EbliWidgetGroup) { + if (widget instanceof EbliWidgetGroup /*|| widget instanceof EbliWidgetFusionCalques*/) { // -- cas widget group, il faut recuper ses child --// final EbliNode nodeGroupe = (EbliNode) scene.findObject(widget); // ecriture de l objet - if (nodeGroupe != null) listeGroupes.add(new EbliWidgetSerializeXml(nodeGroupe, parametres)); + if (nodeGroupe != null) listeGroupes.add(new EbliWidgetGroupSerializeXml(nodeGroupe, parametres,( widget instanceof EbliWidgetFusionCalques))); for (final Widget child : widget.getChildren()) { final EbliNode node = (EbliNode) scene.findObject(child); @@ -868,7 +892,7 @@ // -- ecriture des groupes --// out.writeInt(listeGroupes.size()); - for (final EbliWidgetSerializeXml serializeGroupe : listeGroupes) { + for (final EbliWidgetGroupSerializeXml serializeGroupe : listeGroupes) { out.writeObject(serializeGroupe); } @@ -971,10 +995,10 @@ // -- lecture des groupes --// // -- ecriture des groupes --// final int nbGroups = in.readInt(); - final HashMap<String, EbliWidgetSerializeXml> listeGroupes = new HashMap<String, EbliWidgetSerializeXml>(); + final HashMap<String, EbliWidgetGroupSerializeXml> listeGroupes = new HashMap<String, EbliWidgetGroupSerializeXml>(); for (int i = 0; i < nbGroups; i++) { - final EbliWidgetSerializeXml group = (EbliWidgetSerializeXml) in.readObject(); + final EbliWidgetGroupSerializeXml group = (EbliWidgetGroupSerializeXml) in.readObject(); listeGroupes.put(group.getId(), group); } @@ -983,17 +1007,21 @@ for (final String idGroup : listeGroupToPerform.keySet()) { // --l'idGroup est jetable, on ne le sauvegarde pas --// final HashSet<Object> listeToGroup = listeGroupToPerform.get(idGroup); - final EbliNode nodeGroup = new EbliWidgetGroupAction(scenToUpdate).performGroup(listeToGroup); + EbliNode nodeGroup =null; // -- on met a jour le ebliNode avec les infos du groupe sauv\xE9 --// - final EbliWidgetSerializeXml infoGroup = listeGroupes.get(idGroup); + final EbliWidgetGroupSerializeXml infoGroup = listeGroupes.get(idGroup); + if(!infoGroup.isFusion()) + nodeGroup= new EbliWidgetGroupAction(scenToUpdate).performGroup(listeToGroup); + else + nodeGroup= new TrPostActionFusionCalques(scenToUpdate,trprojet_).performGroupFusion(listeToGroup); + if (infoGroup != null) { - nodeGroup.setTitle(infoGroup.getTitle()); - nodeGroup.getWidget().setPreferredLocation(new Point(infoGroup.getX(), infoGroup.getY())); - nodeGroup.getWidget().setPreferredSize(new Dimension(infoGroup.getWidth(), infoGroup.getHeight())); + infoGroup.updateGroup(nodeGroup); } } + // -- on ajoute les noeuds selectionnes a ebliScene --// scenToUpdate.setSelectedObjects(listeNodeSelect); // mise a jour de la scene This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-20 16:32:09
|
Revision: 4084 http://fudaa.svn.sourceforge.net/fudaa/?rev=4084&view=rev Author: hadouxad Date: 2008-10-20 16:31:59 +0000 (Mon, 20 Oct 2008) Log Message: ----------- l?\195?\169gende calques sauvegarde - Persistance des l?\195?\169gendes fonctionne - On peut enregistrer une l?\195?\169gende par calque de type calqueAffichage - Modif structure des sauvegardes de projet - Tous les fichiers layouts sont enregistr?\195?\169s dans un r?\195?\169pertoire layoutN.POST - A l'int?\195?\169rieur sont contenus les dossier graphes,calques et texte - Enregistrement des path relatif pour tout sauf pour les sources (path abosolu vers les fichier de r?\195?\169sultats) - Refactorisation du syst?\195?\168me de sauvegarde des variables: les fichiers portent un nom parlant du source ID. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.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/persist/TrPostPersistenceManager.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-20 13:23:25 UTC (rev 4083) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-20 16:31:59 UTC (rev 4084) @@ -99,6 +99,8 @@ ZEbliCalquesPanel calque=((EbliWidgetControllerCalque) widget.getController()).getVisuPanel(); data.indiceCalqueCible= calque.getArbreCalqueModel().getIndexOfChild(calque.getArbreCalqueModel().getRoot(), calqueCible_); + if(data.indiceCalqueCible==-1) + data.indiceCalqueCible=0; } @@ -118,14 +120,16 @@ final EbliScene scene = (EbliScene) parameters.get("scene"); // -- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --// //-- recuperation du calque --// - EbliWidget widget=scene.findById(IdPossessor_); + EbliWidget widget=scene.findById(idCalque); if(widget !=null && widget.getController() instanceof EbliWidgetControllerCalque){ ZEbliCalquesPanel calque=((EbliWidgetControllerCalque) widget.getController()).getVisuPanel(); //-- recuperation du bon calque --// calqueCible_= (BCalque) calque.getArbreCalqueModel().getChild(calque.getArbreCalqueModel().getRoot(), indexCalque); IdPossessor_=idCalque; - g=new BCalqueLegendePanel((BCalqueAffichage) calqueCible_,calqueCible_.getTitle()); + //g=new BCalqueLegendePanel((BCalqueAffichage) calqueCible_,calqueCible_.getTitle()); + BCalqueLegendePanel legendePanel=((CalqueLegendeWidgetAdapter)calque.getCqLegend()).legendePanel_; + g=legendePanel; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-20 13:23:25 UTC (rev 4083) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-20 16:31:59 UTC (rev 4084) @@ -8,6 +8,7 @@ import java.util.HashMap; import java.util.Map; +import org.fudaa.ctulu.CtuluLibFile; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.calque.ZebliCalquePersist; import org.fudaa.ebli.geometrie.GrBoite; @@ -135,8 +136,8 @@ (new ZebliCalquePersist(pathUnique)).savePersitCalqueXml(getCalque(),parameters); } - - return pathUnique; + String pathRelative=CtuluLibFile.getRelativeFile(new File(pathUnique), new File((String)parameters.get("pathLayout")), 4); + return pathRelative; } public void setPersistData(Object data, Map parameters) { @@ -144,7 +145,7 @@ //il faut reconstruire le PersistenceManager par reflexion et c'est lui qui produire le ZEbliCalquesPanel if (data == null) calque_ = new ZEbliCalquesPanel(null); else { - String pathCalque = (String) data; + String pathCalque = (String)parameters.get("pathLayout")+File.separator+(String) data; calque_ = (new ZebliCalquePersist(pathCalque)).loadPersitCalqueXml(parameters); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-20 13:23:25 UTC (rev 4083) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-20 16:31:59 UTC (rev 4084) @@ -10,6 +10,7 @@ import java.io.InputStreamReader; import java.util.Map; +import org.fudaa.ctulu.CtuluLibFile; import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; @@ -94,7 +95,10 @@ writer = new FileWriter(contenu); writer.write(editorPane_.getDocumentText()); writer.close(); - return contenu.getAbsolutePath(); + + String pathRelative=CtuluLibFile.getRelativeFile(contenu, new File((String)parameters.get("pathLayout")), 4); + + return pathRelative; } return null; } catch (final IOException e) { @@ -109,7 +113,7 @@ if (data == null) return; try { - final File contenu = new File((String) data); + final File contenu = new File((String)parameters.get("pathLayout")+File.separator+(String) data); final InputStream ips = new FileInputStream(contenu); final InputStreamReader ipsr = new InputStreamReader(ips); final BufferedReader br = new BufferedReader(ipsr); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-20 13:23:25 UTC (rev 4083) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-20 16:31:59 UTC (rev 4084) @@ -5,6 +5,7 @@ import java.io.IOException; import java.util.Map; +import org.fudaa.ctulu.CtuluLibFile; import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheModel; @@ -125,8 +126,8 @@ // TODO Auto-generated catch block e.printStackTrace(); } - - return pathUnique; + String pathRelative=CtuluLibFile.getRelativeFile(new File(pathUnique), new File((String)parameters.get("pathLayout")), 4); + return pathRelative; } public void setPersistData(final Object data, final Map parameters) { @@ -134,7 +135,7 @@ EGGrapheModel modele = null; if (data == null) modele = new EGGrapheTreeModel(); else { - final String pathGraphe = (String) data; + final String pathGraphe = (String)parameters.get("pathLayout")+File.separator+(String) data; try { pn_ = new EGFillePanel(new EGGraphePersist(pathGraphe).loadPersitGrapheXml(parameters)); 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-10-20 13:23:25 UTC (rev 4083) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-10-20 16:31:59 UTC (rev 4084) @@ -83,7 +83,7 @@ JComponent right_; JComponent[] tools_; - String previousTitleFrame = getTitle(); + public String previousTitleFrame = getTitle(); /** * Toolbar modifiable qui se met a jour selon la selection de la widget. */ 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-20 13:23:25 UTC (rev 4083) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-20 16:31:59 UTC (rev 4084) @@ -21,6 +21,7 @@ import javax.swing.JInternalFrame; import org.fudaa.ctulu.CtuluAnalyze; +import org.fudaa.ctulu.CtuluLibFile; import org.fudaa.ctulu.CtuluRemoveContentDirectory; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluFileChooser; @@ -92,7 +93,7 @@ public final static String DESCRIPTORSOURCE = "sources" + EXTENSION; public final static String BALISESOURCES = "SourcesList"; public static String ATTRIBUTESOURCE = "FICHIER"; - public final static String FileWidgetNames = "FramesNames"; + public final static String FileWidgetNames = "FramesNames"+ EXTENSION; /** * Le projet a persiter */ @@ -298,9 +299,10 @@ final int nbFichiersToGenrate = trprojet_.impl_.getAllLayoutFille().size(); out.writeInt(nbFichiersToGenrate); for (int i = 0; i < nbFichiersToGenrate; i++) { - // creation du fichier de desciption des scenes - final String nomFichierLayout = projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + (i + 1) - + EXTENSION; + // creation du fichier de desciption des scenes dans le repertoire de meme nom. + final String nomFichierLayout =/* projet_.getAbsolutePath() + File.separator +*/ DESCRIPTORSCENE + (i + 1) + + EXTENSION+ File.separator + DESCRIPTORSCENE + (i + 1) + EXTENSION; + out.writeObject(nomFichierLayout); } @@ -338,8 +340,11 @@ final int nbFichiersToGenrate = in.readInt(); for (int i = 0; i < nbFichiersToGenrate; i++) { - // creation du fichier de desciption des scenes - final String nomFichierLayout = (String) in.readObject(); + + //-- recuperation du path relatif vers le fichier de la scene --// + String pathRelatif=(String) in.readObject(); + // creation du fichier de desciption des scenes + final String nomFichierLayout = projet_.getAbsolutePath()+File.separator+pathRelatif; listeFiles.add(nomFichierLayout); } } catch (final FileNotFoundException e) { @@ -582,53 +587,18 @@ if (savePersistDirectory(saveAs)) { // -- etape 1: creation du repertoire des graphe et calques --// - final String pathGraphes = projet_.getAbsolutePath() + File.separator + "Graphes"; - try { - File fichierGraphes=new File(pathGraphes); - if(fichierGraphes.isDirectory()){ - //-- on le nettoie --// - CtuluRemoveContentDirectory.contentDirectoryRemover(fichierGraphes); - - }else - fichierGraphes.mkdir(); - } catch (final Exception e) { - // pas grave on continue - FuLog.debug("Le repertoire des graphes existe deja"); - } - final String pathCalques = projet_.getAbsolutePath() + File.separator + "Calques"; - try { - File fichierCalques=new File(pathCalques); - if(fichierCalques.isDirectory()){ - //-- on le nettoie --// - CtuluRemoveContentDirectory.contentDirectoryRemover(fichierCalques); - - }else - fichierCalques.mkdir(); - } catch (final Exception e) { - // pas grave on continue - FuLog.debug("Le repertoire des calques existe deja"); - } - final String pathVariables = projet_.getAbsolutePath() + File.separator + "Variables"; - try { - new File(pathVariables).mkdir(); - } catch (final Exception e) { - // pas grave on continue - FuLog.debug("Le repertoire des variables existe deja"); - } - final String pathText = projet_.getAbsolutePath() + File.separator + "Textes"; - try { - File fichierText=new File(pathText); - if(fichierText.isDirectory()){ - //-- on le nettoie --// - CtuluRemoveContentDirectory.contentDirectoryRemover(fichierText); - - }else - fichierText.mkdir(); - } catch (final Exception e) { - // pas grave on continue - FuLog.debug("Le repertoire des textes existe deja"); - } - + final String pathVariables = projet_.getAbsolutePath() + File.separator + "Variables"; + try { + new File(pathVariables).mkdir(); + } catch (final Exception e) { + // pas grave on continue + FuLog.debug("Le repertoire des variables existe deja"); + } + + + + + // -- sauvegarde du projet setup --// saveSetup(projet_.getAbsolutePath()); @@ -641,18 +611,15 @@ // -- etape 3 sauvegarde des ebliscene unitairement --// progression("Cr\xE9ation des fichiers layout", 20); - // -- creation des params pour les datas --// - parametres.put("path", projet_.getAbsolutePath()); - parametres.put("pathGraphes", pathGraphes); - parametres.put("pathCalques", pathCalques); - parametres.put("pathTexte", pathText); + // -- creation de la list des noms des widgets final List<EbliWidgetSerializeXml.CoupleNomId> listeNomsComposants = new ArrayList<CoupleNomId>(); int cpt = 1; final List<TrPostLayoutFille> listFilles = trprojet_.impl_.getAllLayoutFille(); for (final TrPostLayoutFille fille : listFilles) { - final String title = fille.getTitle(); + //-- on ne recupere le getTitle de la frame pour eviter le cas : je recup le titre du path du ficheir resultata si je suis en mode edit de graphe ou calque.... --// + final String title = fille.previousTitleFrame; final EbliScene scene = fille.getScene(); if (listFilles.size() != 0) progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listFilles.size()); file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); @@ -660,7 +627,7 @@ parametres.put("dimensions", fille.getSize()); parametres.put("location", fille.getLocation()); parametres.put("scene", scene); - savePersitSceneXml(scene, title, file, parametres, listeNomsComposants); + savePersitSceneXml(scene, title, file, parametres, listeNomsComposants,cpt); cpt++; } @@ -788,7 +755,7 @@ file = new File(projet_.getAbsolutePath() + File.separator + FileWidgetNames); final List<EbliWidgetSerializeXml.CoupleNomId> listeCouplesNoms = loadNomsFrames(file); - final int cpt = 1; + int cpt = 1; for (final String fichier : listeFichiers) { file = new File(fichier); @@ -799,7 +766,8 @@ // -- sauvegarde du persitant --// trprojet_.getImpl().addInternalFrame(postFrame); - loadPersitSceneXml(file, postFrame, parametres, listeCouplesNoms); + String nomRepertoireLayout=DESCRIPTORSCENE + (cpt++) + EXTENSION; + loadPersitSceneXml(file, postFrame, parametres, listeCouplesNoms,nomRepertoireLayout); } // -- etape 6; lecture des variables --// @@ -839,14 +807,76 @@ return xstream; } + + private void fillMapWithDataPath(final Map parametres,String repertoireLayout){ + final String pathGraphes = projet_.getAbsolutePath()+ File.separator +repertoireLayout+ File.separator + "Graphes"; + try { + File fichierGraphes=new File(pathGraphes); + if(fichierGraphes.isDirectory()){ + //-- on le nettoie --// + CtuluRemoveContentDirectory.contentDirectoryRemover(fichierGraphes); + + }else + fichierGraphes.mkdir(); + } catch (final Exception e) { + // pas grave on continue + FuLog.debug("Le repertoire des graphes existe deja"); + } + final String pathCalques = projet_.getAbsolutePath()+ File.separator+repertoireLayout + File.separator + "Calques"; + try { + File fichierCalques=new File(pathCalques); + if(fichierCalques.isDirectory()){ + //-- on le nettoie --// + CtuluRemoveContentDirectory.contentDirectoryRemover(fichierCalques); + + }else + fichierCalques.mkdir(); + } catch (final Exception e) { + // pas grave on continue + FuLog.debug("Le repertoire des calques existe deja"); + } + + final String pathText = projet_.getAbsolutePath()+ File.separator+repertoireLayout+ File.separator + "Textes"; + try { + File fichierText=new File(pathText); + if(fichierText.isDirectory()){ + //-- on le nettoie --// + CtuluRemoveContentDirectory.contentDirectoryRemover(fichierText); + + }else + fichierText.mkdir(); + } catch (final Exception e) { + // pas grave on continue + FuLog.debug("Le repertoire des textes existe deja"); + } + // -- creation des params pour les datas --// + parametres.put("path", projet_.getAbsolutePath()); + parametres.put("pathLayout", projet_.getAbsolutePath()+ File.separator +repertoireLayout); + parametres.put("pathGraphes", pathGraphes); + parametres.put("pathCalques", pathCalques); + parametres.put("pathTexte", pathText); + + } + + /** * Utilise xstream pour serializer les parametres scene, widget * * @throws IOException */ - private void savePersitSceneXml(final EbliScene scene, final String title, final File file, final Map parametres, - final List<EbliWidgetSerializeXml.CoupleNomId> listeNomsComposants) { + private void savePersitSceneXml(final EbliScene scene, final String title, File file, final Map parametres, + final List<EbliWidgetSerializeXml.CoupleNomId> listeNomsComposants,int cpt) { + + //-- creation du repertoire du layout layoutN.POST--// + file.mkdir(); + + //-- remplissage de la map avec les r\xE9pertoires calques/graphes/textes --// + fillMapWithDataPath(parametres,DESCRIPTORSCENE + cpt + EXTENSION); + + //-- mise en place du fichier decrivant le contenu du layout --// + file=new File(file.getAbsolutePath()+ File.separator + DESCRIPTORSCENE + cpt + EXTENSION); + // -- outputstream du xstream --// ObjectOutputStream out = null; try { @@ -938,11 +968,12 @@ * @throws InstantiationException */ private void loadPersitSceneXml(final File file, final TrPostLayoutFille fille, final Map parametres, - final List<EbliWidgetSerializeXml.CoupleNomId> listeCouplesNoms) { + final List<EbliWidgetSerializeXml.CoupleNomId> listeCouplesNoms,String repertoireLayout) { final EbliScene scenToUpdate = fille.getScene(); parametres.put("scene", scenToUpdate); - + parametres.put("pathLayout", projet_.getAbsolutePath()+ File.separator +repertoireLayout); + // -- inputstream du xstream --// ObjectInputStream in = null; try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-21 15:38:09
|
Revision: 4088 http://fudaa.svn.sourceforge.net/fudaa/?rev=4088&view=rev Author: hadouxad Date: 2008-10-21 15:38:05 +0000 (Tue, 21 Oct 2008) Log Message: ----------- - Gestion des path relatifs et absolu du setup.POST ce qui permet de d?\195?\169placer le r?\195?\169pertoire projet ou l'on souhaite! cela fonctionne toujours! - Gestion des noms explicites pour les variables - Correction bug: cas ou les l?\195?\169gendes sont enregistr?\195?\169es dans le fichier xml avant les calques/graphes, ca plantait car les l?\195?\169gendes ont besoin des graphes/calques pour se construire - Tests sous linux ok - Proposition de sauvegarde lors de la fermeture du logiciel Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 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/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/VariablesStreamStrategy.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-21 12:36:25 UTC (rev 4087) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-21 15:38:05 UTC (rev 4088) @@ -14,6 +14,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorLegende; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorClassLoader; @@ -182,6 +183,23 @@ return newNode; } + + public boolean isLinked(){ + String className=type; + if(type==null) + return true; + if (className.startsWith("class ")) ; + className = className.substring("class ".length()); + + if( className.equals(EbliWidgetCreatorLegende.class.getName())) + return true; + else + if( className.equals(org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorLegende.class.getName())) + return true; + return false; + + } + public String getTitle() { return title; } 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 2008-10-21 12:36:25 UTC (rev 4087) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-10-21 15:38:05 UTC (rev 4088) @@ -122,14 +122,17 @@ public boolean saveAndCloseProjet(final ProgressionInterface _interface) { if (c_ != null) { - if (c_.isModified()) { - final int i = CtuluLibDialog.confirmExitIfProjectisModified(getFrame()); - if (i == JOptionPane.CANCEL_OPTION) { - return false; - } else if (i != JOptionPane.NO_OPTION) { - c_.save(this, _interface); + + // -- 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() { @@ -143,6 +146,9 @@ } }); } + + + return true; } 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-21 12:36:25 UTC (rev 4087) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-21 15:38:05 UTC (rev 4088) @@ -81,6 +81,7 @@ import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuTable; import com.memoire.bu.BuVerticalLayout; +import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; /** @@ -1259,6 +1260,16 @@ if(src.getId()==null){ String uniqueId=CtuluLibGenerator.getInstance().deliverUniqueStringId(src.getFile().getName()); src.setId(uniqueId); + }else{ + + //-- on teste si l'id de base est 'parlant' => contient le nom du ficheir --// + String nameFormate=FuLib.clean(src.getFile().getName()); + String id=src.getId(); + if(!id.startsWith(nameFormate)){ + String uniqueId=CtuluLibGenerator.getInstance().deliverUniqueStringId(src.getFile().getName()); + src.setId(uniqueId); + } + } return src.getId(); 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-21 12:36:25 UTC (rev 4087) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-21 15:38:05 UTC (rev 4088) @@ -219,8 +219,10 @@ in = getParser().createObjectInputStream(new FileReader(fichierSetup)); // -- Recuperation du path du projet --// - final String pathProjet = (String) in.readObject(); - if (pathProjet == null) { + final String pathRelatifProjet = (String) in.readObject(); + final String pathAbsoluProjet = (String) in.readObject(); + + if (pathRelatifProjet == null) { try { in.close(); return false; @@ -230,7 +232,15 @@ messageError(false); } } - projet_ = new File(pathProjet); + + //-- tetative de recollage du path relatif avec le path du fichier du chooser --// + File fichierDirectory=CtuluLibFile.getAbsolutePathnameTo(fichierSetup, new File(pathRelatifProjet)); + + if(fichierDirectory!=null && fichierDirectory.canRead()){ + projet_=fichierDirectory; + } + else + projet_ = new File(pathAbsoluProjet); try { in.close(); return true; @@ -380,7 +390,7 @@ */ List<TrPostUserVariableSaver> getPersitantVariablesList(final String path, final boolean init) { - final List<TrPostUserVariableSaver> liste = new XmlArrayList(new FileStreamStrategy(new File(path))); + final List<TrPostUserVariableSaver> liste = new XmlArrayList(new VariablesStreamStrategy(new File(path),trprojet_.listeSrc_)); if (init) clearDatas(liste); @@ -407,7 +417,13 @@ try { final File fichier = new File(projet + File.separator + setupProject); out = getParser().createObjectOutputStream(new FileWriter(fichier)); + + //--enregistrement du path relatif --// + File pathRelatif=CtuluLibFile.getRelativePathnameTo(fichier, projet_); + out.writeObject(pathRelatif.getPath()); + //-- enregistrement du path absolu --// out.writeObject(projet); + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -996,6 +1012,8 @@ // --// final HashMap<String, HashSet<Object>> listeGroupToPerform = new HashMap<String, HashSet<Object>>(); + List<EbliWidgetSerializeXml> listeWidgetLinked=new ArrayList<EbliWidgetSerializeXml>(); + // -- r\xE9cup\xE9ration via xml des eblinode/widgets --// for (int i = 0; i < sceneXml.getNbFrames(); i++) { @@ -1005,7 +1023,8 @@ // generation de la widget dans la scene parametres.put("nodeName", getNodeName(listeCouplesNoms, widgetXml.getId())); final EbliNode node = widgetXml.generateWidgetInScene(parametres, scenToUpdate); - + + if(!widgetXml.isLinked()){ // ajout des noeuds a ajouter dans la selection if (widgetXml.isSelected()) listeNodeSelect.add(node); @@ -1021,8 +1040,36 @@ listeGroupToPerform.get(idGroup).add(node); } + + } + else{ + //-- on ajoute la widget liee a la liste des widget a cree au final--// + listeWidgetLinked.add(widgetXml); + } + } + //--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); + + // ajout de la creation d'un groupe + if (!widgetXml.getIdGroup().equals(EbliWidgetGroup.NOGROUP)) { + // il y a un group a prendre en compte d'id + final String idGroup = widgetXml.getIdGroup(); + if (listeGroupToPerform.get(idGroup) == null) { + // on init + listeGroupToPerform.put(idGroup, new HashSet<Object>()); + } + // on ajoute l'objet node pour la widget + listeGroupToPerform.get(idGroup).add(node); + } + } + // -- lecture des groupes --// // -- ecriture des groupes --// final int nbGroups = in.readInt(); Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/VariablesStreamStrategy.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/VariablesStreamStrategy.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/VariablesStreamStrategy.java 2008-10-21 15:38:05 UTC (rev 4088) @@ -0,0 +1,226 @@ +package org.fudaa.fudaa.tr.post.persist; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.fudaa.fudaa.tr.post.TrPostSource; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.StreamException; +import com.thoughtworks.xstream.persistence.FileStreamStrategy; +import com.thoughtworks.xstream.persistence.StreamStrategy; + + +/** + * Classe qui surcharge FileStreamStrategy de xstream pour g\xE9rer les noms des ficheirs \xE0 sa propre sauce. + * Les fichiers seront de la forme nomFIchier_KEY.xml + * @author Adrien Hadoux + * + */ +public class VariablesStreamStrategy implements StreamStrategy{ + + + List<TrPostSource> listeSourcesAssociees_; + private final FilenameFilter filter; + + private final XStream xstream; + + private final File baseDirectory; + + public VariablesStreamStrategy(File baseDirectory,List<TrPostSource> listeSourcesAssociees) { + this(baseDirectory, new XStream(),listeSourcesAssociees); + } + + public VariablesStreamStrategy(File baseDirectory, XStream xstream,List<TrPostSource> listeSourcesAssociees) { + + listeSourcesAssociees_=listeSourcesAssociees; + + this.baseDirectory = baseDirectory; + this.xstream = xstream; + this.filter = new FilenameFilter() { + public boolean accept(File dir, String name) { + return new File(dir, name).isFile() && isValid(dir, name); + } + }; + } +// public VariablesStreamStrategy(File baseDirectory,List<TrPostSource> listeSourcesAssociees) { +// super(baseDirectory); +// // TODO Auto-generated constructor stub +// listeSourcesAssociees_=listeSourcesAssociees; +// } + + /** + * Il faut extraire la clef du nom du fichier. + * Les fichiers seront toujours de la forme + * nomFIchier_KEY.xml + */ + + protected String extractKey(String name) { + // TODO Auto-generated method stub + String val=name.substring(name.lastIndexOf("_"), name.length() - 4); + return val; + + } + + /** + * Genere le nom du fichier a partir du nom de la source associ\xE9e a la variable et de l'indice + */ + + protected String getName(Object key) { + // TODO Auto-generated method stub + int value= Integer.parseInt(key.toString()); + + String val=listeSourcesAssociees_.get(value).getId()+"_"+key.toString()+".xml"; + + return val; + //return super.getName(key); + } + + + + + + protected boolean isValid(File dir, String name) { + return name.endsWith(".xml"); + } + + + + class XmlMapEntriesIterator implements Iterator { + + private File[] files = baseDirectory.listFiles(filter); + + private int position = -1; + + private File current = null; + + public boolean hasNext() { + return position + 1 < files.length; + } + + public void remove() { + if (current == null) { + throw new IllegalStateException(); + } + // removes without loading + current.delete(); + } + + public Object next() { + return new Map.Entry() { + + private File file = current = files[++position]; + + private String key = extractKey(file.getName()); + + public Object getKey() { + return key; + } + + public Object getValue() { + return readFile(file); + } + + public Object setValue(Object value) { + return put(key, value); + } + + public boolean equals(Object obj) { + if (!(obj instanceof Entry)) { + return false; + } + Entry e2 = (Entry) obj; + // TODO local cache value instead of calling getValue twice + return (key == null ? e2.getKey() == null : key.equals(e2 + .getKey())) + && (getValue() == null ? e2.getValue() == null + : getValue().equals(e2.getValue())); + } + + }; + } + + } + + private void writeFile(File file, Object value) { + try { + OutputStream os = new FileOutputStream(file); + try { + this.xstream.toXML(value, os); + } finally { + os.close(); + } + } catch (IOException e) { + throw new StreamException(e); + } + } + + private File getFile(String filename) { + return new File(this.baseDirectory, filename); + } + + private Object readFile(File file) { + try { + InputStream is = new FileInputStream(file); + try { + return this.xstream.fromXML(is); + } finally { + is.close(); + } + } catch (FileNotFoundException e) { + // not found... file.exists might generate a sync problem + return null; + } catch (IOException e) { + throw new StreamException(e); + } + } + + + public Object put(Object key, Object value) { + Object oldValue = get(key); + String filename = getName(key); + writeFile(new File(baseDirectory, filename), value); + return oldValue; + } + + public Iterator iterator() { + return new XmlMapEntriesIterator(); + } + + public int size() { + return baseDirectory.list(filter).length; + } + + public boolean containsKey(Object key) { + // faster lookup + File file = getFile(getName(key)); + return file.exists(); + } + + public Object get(Object key) { + return readFile(getFile(getName(key))); + } + + public Object remove(Object key) { + // faster lookup + File file = getFile(getName(key)); + Object value = null; + if (file.exists()) { + value = readFile(file); + file.delete(); + } + return value; + } + + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |