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] |