From: <had...@us...> - 2008-09-27 19:07:05
|
Revision: 3995 http://fudaa.svn.sourceforge.net/fudaa/?rev=3995&view=rev Author: hadouxad Date: 2008-09-27 19:06:59 +0000 (Sat, 27 Sep 2008) Log Message: ----------- - Importation des structures scopeS,t et gene idfferenciation des structure en fonction des graphes debut mise en place du lnf substance Modified Paths: -------------- 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/impl/FudaaLookPreferencesPanel.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/TrFileFormatManager.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/ctulu/lib/asm-all-2.2.2.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/forms-1.2.0.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/laf-plugin-50.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/laf-widget.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance-baseline.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance-swingx.jar branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeT.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/asm-all-2.2.2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/forms-1.2.0.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/laf-plugin-50.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/laf-widget.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance-baseline.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance-swingx.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream 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-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -60,6 +60,14 @@ return listeVariales_.get(_i); } + public List<Double> getListValueForVariable(int i) { + return data_.get(getVariable(i)); + } + + public double getValueOfvariable(int indexVar,int indexValue){ + return getListValueForVariable(indexVar).get(indexValue); + } + public void addValueForVariable(double value, int indexVariable) { data_.get(listeVariales_.get(indexVariable)).add(value); } 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-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -41,6 +41,7 @@ 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.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionSimple; @@ -50,6 +51,7 @@ import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.impl.FudaaGuiLib; import org.fudaa.fudaa.commun.impl.FudaaImportCsvPanel; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import com.memoire.bu.BuFileFilter; import com.memoire.bu.BuResource; @@ -121,6 +123,8 @@ */ void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog); + public boolean isSpatial(); + } public static class ExportAction extends EbliActionSimple { @@ -134,7 +138,7 @@ } public void actionPerformed(final ActionEvent _e) { - EGExporter.startExport(graphe_, impl_, getFileFormatForExport()); + EGExporter.startExport(graphe_, impl_, getFileFormatForExport(graphe_)); } } @@ -158,7 +162,7 @@ } public void actionPerformed(final ActionEvent _e) { - final FileFormat[] ft = getFileFormatForImportEvol(); + final FileFormat[] ft = getFileFormatForImportEvol(target_); Arrays.sort(ft); final BuFileFilter[] filters = FileFormat.createFilters(ft); final CtuluFileChooser fileChooser = FudaaGuiLib.getFileChooser(BuResource.BU.getString("Importer"), filters, @@ -184,7 +188,7 @@ } } - public static FileFormat[] getFileFormatForImportEvol() { + public static FileFormat[] getFileFormatForImportEvol(final FudaaCourbeImporter.Target target) { final ArrayList r = new ArrayList(10); r.add(TelemacLiquideFileFormat.getInstance()); r.add(EvolutionFileFormat.getInstance()); @@ -192,7 +196,11 @@ r.add(CLTransitoireFileFormat.getInstance()); r.add(RubarTARFileFormat.getInstance()); r.add(RubarCLIFileFormat.getInstance()); + if (target != null && target.isSpatial()) r.add(ScopeSFileFormat.getInstance()); + else + if (target != null) + r.add(ScopeTFileFormat.getInstance()); r.add(ScopeGENEFileFormat.getInstance()); final FileFormat[] rf = new FileFormat[r.size()]; @@ -207,14 +215,18 @@ * * @return */ - public static List<CtuluWriter> getFileFormatForExport() { + public static List<CtuluWriter> getFileFormatForExport(EGGraphe graphe) { final ArrayList<CtuluWriter> liste = new ArrayList<CtuluWriter>(10); liste.add(new CtuluTableExcelWriter()); liste.add(new CtuluTableCsvWriter()); // --ajout des formats scope --// + if (graphe.getModel() instanceof MvProfileTreeModel) liste.add(new FudaaWriterScopeS()); + else + liste.add(new FudaaWriterScopeT()); + liste.add(new FudaaWriterScopeGENE()); return liste; } Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeT.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeT.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -0,0 +1,17 @@ +package org.fudaa.fudaa.commun.courbe; + +import org.fudaa.dodico.telemac.io.ScopeTFileFormat; + +public class FudaaWriterScopeT extends FudaaWriterScopeS { + + + ScopeTFileFormat format_; + String extension_ = ".scopT"; + + public FudaaWriterScopeT() { + format_ = ScopeTFileFormat.getInstance(); + filter_ = format_.createFileFilter(); + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaLookPreferencesPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaLookPreferencesPanel.java 2008-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaLookPreferencesPanel.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -25,7 +25,20 @@ import org.fudaa.fudaa.tr.common.TrResource; -import com.memoire.bu.*; +import com.memoire.bu.BuAbstractPreferencesPanel; +import com.memoire.bu.BuColorIcon; +import com.memoire.bu.BuComboBox; +import com.memoire.bu.BuCommonInterface; +import com.memoire.bu.BuGridLayout; +import com.memoire.bu.BuLabel; +import com.memoire.bu.BuOptionItem; +import com.memoire.bu.BuOptionRenderer; +import com.memoire.bu.BuPanel; +import com.memoire.bu.BuPreferences; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuTextField; +import com.memoire.bu.BuTextureIcon; +import com.memoire.bu.BuVerticalLayout; import com.memoire.fu.FuLib; /** @@ -93,6 +106,8 @@ .isEnabled("ASPECT_KUNSTSTOFF"))); optionsStr_.put("ASPECT_LIQUID", new BuOptionItem("Liquid", BuResource.BU.getMenuIcon(aspectStr), options_ .isEnabled("ASPECT_LIQUID"))); + optionsStr_.put("ASPECT_SUBSTANCE", new BuOptionItem("Substance", BuResource.BU.getMenuIcon(aspectStr), options_ + .isEnabled("ASPECT_SUBSTANCE"))); optionsStr_.put("ASPECT_MAC", new BuOptionItem("Mac", BuResource.BU.getMenuIcon(aspectStr), options_ .isEnabled("ASPECT_MAC"))); optionsStr_.put("ASPECT_METAL", new BuOptionItem("Metal", BuResource.BU.getMenuIcon(aspectStr), options_ @@ -153,7 +168,7 @@ // Aspect lbGenAspAspect_ = new BuLabel(getS("Aspect:"), SwingConstants.RIGHT); - items = new BuOptionItem[10]; + items = new BuOptionItem[11]; int i = 0; items[i++] = optionsStr_.get(getAspectDefaut()); // items[ i++]=optionsStr_.get("ASPECT_AMIGA"); @@ -161,6 +176,7 @@ items[i++] = optionsStr_.get("ASPECT_GTK"); // items[ i++]=optionsStr_.get("ASPECT_KUNSTSTOFF"); items[i++] = optionsStr_.get("ASPECT_LIQUID"); + items[i++] = optionsStr_.get("ASPECT_SUBSTANCE"); items[i++] = optionsStr_.get("ASPECT_MAC"); items[i++] = optionsStr_.get("ASPECT_METAL"); items[i++] = optionsStr_.get("ASPECT_MOTIF"); Deleted: 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 2008-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -1,51 +0,0 @@ -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-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -464,5 +464,10 @@ public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { } + + public boolean isSpatial() { + return false; + } + } \ No newline at end of file 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-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -13,11 +13,7 @@ import java.util.Map; import java.util.TreeMap; -import com.memoire.bu.BuInformationsSoftware; -import com.memoire.bu.BuMenu; - import org.fudaa.ctulu.fileformat.FileFormat; - import org.fudaa.dodico.dunes.io.DunesFileFormat; import org.fudaa.dodico.h2d.type.H2dFileFormatType; import org.fudaa.dodico.reflux.io.CorEleBthFileFormat; @@ -30,12 +26,14 @@ import org.fudaa.dodico.telemac.TelemacDicoFileFormat; 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.reflux.TrRefluxImplHelper; import org.fudaa.fudaa.tr.rubar.TrRubarImplHelper; import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper; +import com.memoire.bu.BuInformationsSoftware; +import com.memoire.bu.BuMenu; + /** * @author deniger * @version $Id: TrFileFormatManager.java,v 1.30 2007-06-20 12:23:38 deniger Exp $ @@ -53,7 +51,7 @@ } public static FileFormat getFileFormatImportForId(final String _id) { - final FileFormat[] ftsImport = FudaaCourbeImporter.getFileFormatForImportEvol(); + final FileFormat[] ftsImport = FudaaCourbeImporter.getFileFormatForImportEvol(null); for (int i = ftsImport.length - 1; i >= 0; i--) { if (ftsImport[i].getID().equals(_id)) { return ftsImport[i]; Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java (from rev 3994, 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/TrImportCourbeScopeManager.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -0,0 +1,99 @@ +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.dodico.telemac.io.ScopeStructure.Gene; +import org.fudaa.dodico.telemac.io.ScopeStructure.SorT; +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 TrImportCourbeScopeManager implements FudaaCourbeImporter.Target { + + EGGraphe graphe_; + MvProfileTreeModel modelGraphe_; + /** + * indique si la courbe a importer est correcte + */ + private boolean enabled = true; + TrCommonImplementation impl_; + + + public TrImportCourbeScopeManager(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) { + + // do nothing + + + + } + + 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 { + // -- import des courbes dans le graphe --// + + if(_crb instanceof ScopeStructure.SorT) + importCourbesSorT((SorT) _crb, _mng, _prog); + else + importCourbesGENE((Gene) _crb, _mng, _prog); + // } + } + + /** + * Methode d import depuis format scope S ou t + * + * @param _crb + * @param _mng + * @param _prog + */ + public void importCourbesSorT(ScopeStructure.SorT s, CtuluCommandManager _mng, ProgressionInterface _prog) { + + // -- 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 + + } + + + } + + + /** + * Methode d import depusi scope GENE + * + * @param _crb + * @param _mng + * @param _prog + */ + public void importCourbesGENE(ScopeStructure.Gene s, CtuluCommandManager _mng, ProgressionInterface _prog) { + + } + + public boolean isSpatial() { + return graphe_.getModel() instanceof MvProfileTreeModel; + } + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java ___________________________________________________________________ Added: svn:mergeinfo + 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-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -39,7 +39,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.TrCourbeSpatialManager; +import org.fudaa.fudaa.tr.common.TrImportCourbeScopeManager; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.netbeans.api.visual.widget.Widget; @@ -563,7 +563,7 @@ listeActions.add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); //--ajout des actions import export format scope --// - listeActions.add(new FudaaCourbeImporter.ImportAction(new TrCourbeSpatialManager(_graphe.getGraphe(), + listeActions.add(new FudaaCourbeImporter.ImportAction(new TrImportCourbeScopeManager(_graphe.getGraphe(), projet_.impl_), projet_.impl_, creator.getGraphe().getCmd())); listeActions.add( new FudaaCourbeImporter.ExportAction(creator.getGraphe(), projet_.impl_)); 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-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -152,4 +152,8 @@ public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { } + public boolean isSpatial() { + return false; + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |