From: <de...@us...> - 2009-01-25 22:20:26
|
Revision: 4401 http://fudaa.svn.sourceforge.net/fudaa/?rev=4401&view=rev Author: deniger Date: 2009-01-25 22:20:21 +0000 (Sun, 25 Jan 2009) Log Message: ----------- 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/reflux/io/RefluxSolutionSequentielReader.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/MvLineChooser.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/post/TrPostCourbeModel.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/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/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/TrPostProjetsManagerFille.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/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/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/TrPostVisuPanelPersistManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionChooseAndCreateCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataInfoDoc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigTempLineInLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceFromReader.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderInterface.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderReflux.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderSerafin.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/FSigTempLineInLayer.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 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -71,7 +71,7 @@ return res_; } -public LineString getInitLine_() { +public LineString getInitLine() { return initLine_; } } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/reflux/io/RefluxSolutionSequentielReader.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/reflux/io/RefluxSolutionSequentielReader.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/reflux/io/RefluxSolutionSequentielReader.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -217,4 +217,11 @@ ch_.close(); } } + + /** + * @return the nbPoint + */ + public int getNbPoint() { + return nbPoint_; + } } \ No newline at end of file Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/FSigTempLineInLayer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/FSigTempLineInLayer.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/FSigTempLineInLayer.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -1,116 +0,0 @@ -/** - * Licence GPL - * Copyright Genesis - */ -package org.fudaa.fudaa.meshviewer.profile; - -import java.awt.Color; - -import org.fudaa.ebli.calque.BArbreCalqueModel; -import org.fudaa.ebli.calque.ZCalqueLigneBrisee; -import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.geometrie.GrBoite; -import org.fudaa.ebli.trace.TraceIcon; -import org.fudaa.ebli.trace.TraceIconModel; -import org.fudaa.ebli.trace.TraceLigne; -import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.sig.FSigLineSingleModel; - -import com.vividsolutions.jts.geom.LineString; - -/** - * Une classe permettant d'afficher temporaire une ligne dans le panel - * - * @author deniger - */ -public class FSigTempLineInLayer { - - private Color colorLineTempo_ = Color.RED; - - GrBoite initZoom_; - - boolean isZoomChanged_; - - final ZEbliCalquesPanel panel_; - - ZCalqueLigneBrisee tmp_; - - public FSigTempLineInLayer(ZEbliCalquesPanel _panel) { - super(); - panel_ = _panel; - } - - protected void close() { - if (tmp_ != null) { - tmp_.detruire(); - panel_.getVueCalque().getCalque().repaint(); - panel_.getVueCalque().changeRepere(this, initZoom_); - tmp_ = null; - } - - } - - /** - * @return the colorLineTempo - */ - public Color getColorLineTempo() { - return colorLineTempo_; - } - - /** - * @return the isZoomChanged - */ - public boolean isZoomChanged() { - return isZoomChanged_; - } - - /** - * @param _colorLineTempo the colorLineTempo to set - */ - public void setColorLineTempo(Color _colorLineTempo) { - colorLineTempo_ = _colorLineTempo; - } - - /** - * @param _s la ligne a afficher temporairement. si null n'affiche rien - * @param _zoom true si on doit zoomer sur la ligne. - */ - protected void display(final LineString _s, final boolean _zoom) { - if (panel_ == null) { return; } - if (_s == null) { - if (tmp_ != null) { - tmp_.setVisible(false); - } - return; - } - final FSigLineSingleModel modele = new FSigLineSingleModel(_s); - if (tmp_ == null) { - initZoom_ = panel_.getVueCalque().getViewBoite(); - tmp_ = new ZCalqueLigneBrisee(); - tmp_.setDestructible(true); - final TraceIconModel model = new TraceIconModel(TraceIcon.PLUS_DOUBLE, 4, colorLineTempo_); - tmp_.setIconModel(0, model); - tmp_.setIconModel(1, model); - final TraceLigneModel ligne = new TraceLigneModel(TraceLigne.MIXTE, 2, colorLineTempo_); - tmp_.setLineModel(0, ligne); - tmp_.setLineModel(1, ligne); - panel_.getVueCalque().getCalque().enPremier(tmp_); - panel_.getCqInfos().enPremier(); - } - tmp_.setVisible(true); - tmp_.modele(modele); - if (_zoom) { - BArbreCalqueModel.actionCenter(tmp_, panel_); - isZoomChanged_ = true; - } - } - - public void zoomInitial(){ - panel_.getVueCalque().changeViewBoite(this, initZoom_, false); - } - - public void restaurer(){ - panel_.restaurer(); - } - -} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -7,14 +7,12 @@ */ package org.fudaa.fudaa.meshviewer.profile; +import gnu.trove.TDoubleArrayList; + import java.util.ArrayList; import java.util.List; import java.util.Map; -import javax.swing.JComboBox; - -import gnu.trove.TDoubleArrayList; - import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; @@ -26,14 +24,15 @@ import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.ebli.calque.BCalqueLegende; -import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.commun.EbliFormatter; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.tr.common.TrResource; import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; -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.TrPostSourceAbstract; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; import org.fudaa.fudaa.tr.post.TrReplayCurvesData; import org.fudaa.fudaa.tr.post.actions.TrPostProfileAction; @@ -46,401 +45,390 @@ */ public class MVProfileCourbeModel implements MvProfileCourbeModelInterface { - private int time_; - EfGridData data_; - EfLineIntersectionsResultsI res_; - EfLineIntersectionsResultsBuilder builder_; - String title_; + private int time_; + EfGridData data_; + EfLineIntersectionsResultsI res_; + EfLineIntersectionsResultsBuilder builder_; + String title_; - CtuluVariable variable_; + CtuluVariable variable_; - TDoubleArrayList y_; + TDoubleArrayList y_; - double yMax_; + double yMax_; - double yMin_; + double yMin_; - private MVProfileCourbeModel(final CtuluVariable _variable, final EfGridData _data, - final EfLineIntersectionsResultsI _res, final int _timeStep, final double[] _y, - final EfLineIntersectionsResultsBuilder _builder) { - super(); - variable_ = _variable; - data_ = _data; - res_ = _res; - title_ = _variable.toString(); - time_ = _timeStep; - builder_ = _builder; - y_ = new TDoubleArrayList(_y); - } + private MVProfileCourbeModel(final CtuluVariable _variable, final EfGridData _data, + final EfLineIntersectionsResultsI _res, final int _timeStep, final double[] _y, + final EfLineIntersectionsResultsBuilder _builder) { + super(); + variable_ = _variable; + data_ = _data; + res_ = _res; + title_ = _variable.toString(); + time_ = _timeStep; + builder_ = _builder; + y_ = new TDoubleArrayList(_y); + } - public MVProfileCourbeModel(final CtuluVariable _variable, final EfGridData _data, final int _timeStep, - final EfLineIntersectionsResultsBuilder _builder, final ProgressionInterface _prog) { - super(); - variable_ = _variable; - data_ = _data; - title_ = _variable.toString(); - time_ = _timeStep; - builder_ = _builder; - if (builder_ != null) res_ = builder_.createResults(_timeStep, _prog); - y_ = new TDoubleArrayList(res_.getNbIntersect()); - computeY(_prog); - } + public MVProfileCourbeModel(final CtuluVariable _variable, final EfGridData _data, final int _timeStep, + final EfLineIntersectionsResultsBuilder _builder, final ProgressionInterface _prog) { + super(); + variable_ = _variable; + data_ = _data; + title_ = _variable.toString(); + time_ = _timeStep; + builder_ = _builder; + if (builder_ != null) res_ = builder_.createResults(_timeStep, _prog); + y_ = new TDoubleArrayList(res_.getNbIntersect()); + computeY(_prog); + } - /** - * ACHTUNG: Constructeur uniquement utilis\xE9 pour la persistance des donn\xE9es. - */ - public MVProfileCourbeModel(){ - super(); - } + /** + * ACHTUNG: Constructeur uniquement utilis\xE9 pour la persistance des donn\xE9es. + */ + public MVProfileCourbeModel() { + super(); + } - public boolean addValue(final double _x, final double _y, final CtuluCommandContainer _cmd) { - return false; - } + public boolean addValue(final double _x, final double _y, final CtuluCommandContainer _cmd) { + return false; + } - public boolean addValue(final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { - return false; - } + public boolean addValue(final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { + return false; + } - /** - * Recalcule les y en fonction des informations fournises. - * @param _prog - */ - public final void computeY(final ProgressionInterface _prog) { - final CtuluRange range = new CtuluRange(); - res_ = builder_.createResults(time_, _prog); + /** + * Recalcule les y en fonction des informations fournises. + * + * @param _prog + */ + public final void computeY(final ProgressionInterface _prog) { + final CtuluRange range = new CtuluRange(); + res_ = builder_.createResults(time_, _prog); - if(y_==null) - y_=new TDoubleArrayList(); + if (y_ == null) y_ = new TDoubleArrayList(); - y_.ensureCapacity(res_.getNbIntersect()); - y_.resetQuick(); - for (int i = 0; i < res_.getNbIntersect(); i++) { - double val = 0; - if (res_.getIntersect(i).isRealIntersection()) { - val = res_.getIntersect(i).getValue(variable_, time_); - range.expandTo(val); - } - y_.add(val); - } - if (range.isNill()) { - yMax_ = 0; - yMin_ = 0; - } else { - yMax_ = range.getMax(); - yMin_ = range.getMin(); - } - } + y_.ensureCapacity(res_.getNbIntersect()); + y_.resetQuick(); + for (int i = 0; i < res_.getNbIntersect(); i++) { + double val = 0; + if (res_.getIntersect(i).isRealIntersection()) { + val = res_.getIntersect(i).getValue(variable_, time_); + range.expandTo(val); + } + y_.add(val); + } + if (range.isNill()) { + yMax_ = 0; + yMin_ = 0; + } else { + yMax_ = range.getMax(); + yMin_ = range.getMin(); + } + } - public boolean deplace(final int[] _selectIdx, final double _deltaX, final double _deltaY, - final CtuluCommandContainer _cmd) { - return false; - } + public boolean deplace(final int[] _selectIdx, final double _deltaX, final double _deltaY, + final CtuluCommandContainer _cmd) { + return false; + } - public MVProfileCourbeModel duplicate() { - final MVProfileCourbeModel res = new MVProfileCourbeModel(variable_, data_, res_, time_, y_.toNativeArray(), - builder_); - res.yMax_ = yMax_; - res.yMin_ = yMin_; - return res; - } + public MVProfileCourbeModel duplicate() { + final MVProfileCourbeModel res = new MVProfileCourbeModel(variable_, data_, res_, time_, y_.toNativeArray(), + builder_); + res.yMax_ = yMax_; + res.yMin_ = yMin_; + return res; + } - public void fillWithInfo(InfoData _table, CtuluListSelectionInterface _selectedPt) { - if(EbliWidget.AMELIO_LOT_VISIBLE){ - String pdt="N\xB0"+this.time_; - if(this.data_ instanceof TrPostSource){ - TrPostSource src=(TrPostSource)this.data_; - _table.put(TrResource.getS("Type"),"Profil spatial"); - _table.put(TrResource.getS("Fichier r\xE9sultat"),src.getFile().getName()); - _table.put(TrResource.getS("Chemin complet"),src.getFile().getAbsolutePath()); - _table.put(TrResource.getS("Titre Fichier r\xE9sultat"),src.getTitle()); - if(this.time_!=-1 && this.time_<src.getNbTimeStep()) - pdt+=": "+src.getTimeStep(this.time_); - } - if(this.variable_!=null) - _table.put(TrResource.getS("Variable"),this.variable_.getName()+" en "+this.variable_.getCommonUnit()); - _table.put(TrResource.getS("Pas de temps "),pdt); - - LineString polyligne=builder_.getInitLine_(); - if(polyligne!=null){ - _table.put(TrResource.getS("Polyligne, nb pts"),""+polyligne.getNumPoints()); - _table.put(TrResource.getS("Point d\xE9but"),"("+polyligne.getCoordinateN(0).x+";"+polyligne.getCoordinateN(0).y+")"); - _table.put(TrResource.getS("Point fin"),"("+polyligne.getCoordinateN(polyligne.getNumPoints()-1).x+";"+polyligne.getCoordinateN(polyligne.getNumPoints()-1).y+")"); - - } + EbliFormatter formater = new EbliFormatter(); + public void fillWithInfo(InfoData _table, CtuluListSelectionInterface _selectedPt) { + if (EbliWidget.AMELIO_LOT_VISIBLE) { + String pdt = "N\xB0" + this.time_; + if (this.data_ instanceof TrPostSource) { + _table.put(TrResource.getS("Type"), "Profil spatial"); + TrPostSource src = (TrPostSource) this.data_; + TrPostSourceAbstract.fillWithSourceInfo(_table, src); + if (this.time_ != -1 && this.time_ < src.getNbTimeStep()) pdt += ": " + + src.getTime().getTimeListModel().getElementAt(this.time_); + } + if (this.variable_ != null) _table.put(MvResource.getS("Variable"), this.variable_.getName() + " en " + + this.variable_.getCommonUnit()); + _table.put(MvResource.getS("Pas de temps"), pdt); - } - } + LineString polyligne = builder_.getInitLine(); + if (polyligne != null) { + _table.put(MvResource.getS("Polyligne, nb pts"), Integer.toString(polyligne.getNumPoints())); + _table.put(MvResource.getS("Point d\xE9but"), "(" + formater.getFormatter().format(polyligne.getCoordinateN(0).x) + + ";" + formater.getFormatter().format(polyligne.getCoordinateN(0).y) + ")"); + _table.put(MvResource.getS("Point fin"), "(" + + formater.getFormatter().format(polyligne.getCoordinateN(polyligne.getNumPoints() - 1).x) + ";" + + formater.getFormatter().format(polyligne.getCoordinateN(polyligne.getNumPoints() - 1).y) + ")"); - public int getActiveTimeIdx() { - return 0; - } + } - public int getNbValues() { - return res_.getNbIntersect(); - } + } + } - public EfLineIntersectionsResultsI getRes() { - return res_; - } + public int getActiveTimeIdx() { + return 0; + } - public int getTime() { - return time_; - } + public int getNbValues() { + return res_.getNbIntersect(); + } - public String getTitle() { - return title_; - } + public EfLineIntersectionsResultsI getRes() { + return res_; + } - public CtuluVariable getVariable() { - return variable_; - } + public int getTime() { + return time_; + } - public double getX(final int _idx) { - return res_.getDistFromDeb(_idx); - } + public String getTitle() { + return title_; + } - public double getXMax() { - return res_.getDistFromDeb(getNbValues() - 1); - } + public CtuluVariable getVariable() { + return variable_; + } - public double getXMin() { - return 0; - } + public double getX(final int _idx) { + return res_.getDistFromDeb(_idx); + } - public double getY(final int _idx) { - return y_.getQuick(_idx); - } + public double getXMax() { + return res_.getDistFromDeb(getNbValues() - 1); + } - public double getYMax() { - return yMax_; - } + public double getXMin() { + return 0; + } - public double getYMin() { - return yMin_; - } + public double getY(final int _idx) { + return y_.getQuick(_idx); + } - public boolean isActiveTimeEnable() { - return false; - } + public double getYMax() { + return yMax_; + } - public boolean isDuplicatable() { - return true; - } + public double getYMin() { + return yMin_; + } - public boolean isModifiable() { - return false; - } + public boolean isActiveTimeEnable() { + return false; + } - public boolean isPointDrawn(final int _i) { - return res_.getIntersect(_i).isRealIntersection(); - } + public boolean isDuplicatable() { + return true; + } - public boolean isRemovable_=false; - public boolean isRemovable() { - return isRemovable_; - } + public boolean isModifiable() { + return false; + } - public boolean isSegmentDrawn(final int _i) { - return res_.isSegmentIn(_i); - } + public boolean isPointDrawn(final int _i) { + return res_.getIntersect(_i).isRealIntersection(); + } - public boolean isTitleModifiable() { - return true; - } + public boolean isRemovable_ = false; - public boolean isVisibleLong() { - return false; - } + public boolean isRemovable() { + return isRemovable_; + } - public boolean isXModifiable() { - return false; - } + public boolean isSegmentDrawn(final int _i) { + return res_.isSegmentIn(_i); + } - public boolean removeValue(final int _i, final CtuluCommandContainer _cmd) { - return false; - } + public boolean isTitleModifiable() { + return true; + } - public boolean removeValue(final int[] _i, final CtuluCommandContainer _cmd) { - return false; - } + public boolean isVisibleLong() { + return false; + } - public void reupdateY() { - computeY(null); + public boolean isXModifiable() { + return false; + } - } + public boolean removeValue(final int _i, final CtuluCommandContainer _cmd) { + return false; + } - public void setRes(final EfLineIntersectionsResultsBuilder _builder, final ProgressionInterface _prog) { - builder_ = _builder; - computeY(_prog); - } + public boolean removeValue(final int[] _i, final CtuluCommandContainer _cmd) { + return false; + } - public void setTime(final int _time) { - if (time_ != _time && _time >= 0) { - time_ = _time; - computeY(null); - } - } + public void reupdateY() { + computeY(null); - public boolean setTitle(final String _newName) { - title_ = _newName; - return true; - } + } - public boolean setValue(final int _i, final double _x, final double _y, final CtuluCommandContainer _cmd) { - return false; - } + public void setRes(final EfLineIntersectionsResultsBuilder _builder, final ProgressionInterface _prog) { + builder_ = _builder; + computeY(_prog); + } - public boolean setValues(final int[] _idx, final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { - return false; - } + public void setTime(final int _time) { + if (time_ != _time && _time >= 0) { + time_ = _time; + computeY(null); + } + } - public void setVariable(final CtuluVariable _variable, final boolean _contentChanged) { - variable_ = _variable; - if (_contentChanged && data_.isDefined(_variable)) { - computeY(null); - } - } + public boolean setTitle(final String _newName) { + title_ = _newName; + return true; + } + public boolean setValue(final int _i, final double _x, final double _y, final CtuluCommandContainer _cmd) { + return false; + } + public boolean setValues(final int[] _idx, final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { + return false; + } + public void setVariable(final CtuluVariable _variable, final boolean _contentChanged) { + variable_ = _variable; + if (_contentChanged && data_.isDefined(_variable)) { + computeY(null); + } + } + public Object getPersistSpecificDatas() { + // -- retourne le quatuor point, pdt,variable et fichier source + ArrayList<Object> listeData = new ArrayList<Object>(); + // listeData.add(this.); - public Object getPersistSpecificDatas() { - //-- retourne le quatuor point, pdt,variable et fichier source - ArrayList<Object> listeData=new ArrayList<Object>(); - //listeData.add(this.); + // -- ajout du pas de temps --// + listeData.add(new Integer(time_)); - //-- ajout du pas de temps --// - listeData.add(new Integer(time_)); + // -- ajout de la variable --// + listeData.add(this.variable_.getID()); - //-- ajout de la variable --// - listeData.add(this.variable_.getID()); + // -- ajout de la polyligne --// + listeData.add(builder_.getInitLine()); - //-- ajout de la polyligne --// - listeData.add(builder_.getInitLine_()); + // -- ajout des datas --// + if (data_ instanceof TrPostSource) { + listeData.add(((TrPostSource) data_).getId()); + } - //-- ajout des datas --// - if(data_ instanceof TrPostSource){ - listeData.add(((TrPostSource)data_).getId()); - } + return listeData; + } + public void setPersistSpecificDatas(Object data, Map infos) { - return listeData; - } + if (data == null || !(data instanceof ArrayList)) return; + ArrayList<Object> liste = (ArrayList<Object>) data; + TrPostProjet projet = (TrPostProjet) infos.get("TrPostProjet"); + TrPostSource src = null; + // -- etape 1: le pas de temps --// + this.time_ = (Integer) liste.get(0); - public void setPersistSpecificDatas(Object data, Map infos) { + // -- etape 2 la variable --// + String idVar = (String) liste.get(1); + H2dVariableType var = null;// (H2dVariableType) liste.get(1); - if(data ==null || !(data instanceof ArrayList))return; - ArrayList<Object> liste=(ArrayList<Object>)data; + // -- etape 3: la polyligne --// + LineString polyligne = (LineString) liste.get(2); - TrPostProjet projet = (TrPostProjet) infos.get("TrPostProjet"); - TrPostSource src = null; - //-- etape 1: le pas de temps --// - this.time_=(Integer) liste.get(0); + // -- etape 4: recherche du source qui contient le path donn\xE9 --// + if (projet != null && liste.size() >= 4) { + String idSource = (String) liste.get(3); + src = projet.findSourceById(idSource); + if (src != null) this.data_ = src; + else { + ((List<String>) infos.get("errorMsg")) + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idVar); + return; + } + } else { + ((List<String>) infos.get("errorMsg")) + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idVar); + return; + } + // -- recherche dans les sources de la variable par id --// + for (int i = 0; i < src.getAvailableVar().length; i++) + if (src.getAvailableVar()[i].getID().equals(idVar)) var = src.getAvailableVar()[i]; - //-- etape 2 la variable --// - String idVar=(String)liste.get(1); - H2dVariableType var=null;//(H2dVariableType) liste.get(1); + if (var != null) this.variable_ = var; + else { + ((List<String>) infos.get("errorMsg")) + .add("Erreur, la frame graphe ne trouve pas la variable qui correspond \xE0 l'ID " + idVar); + return; + } + // -- on rejoue les donn\xE9es: --// + // -- creation du resultBuilder: --// + TrPostVisuPanel panelUtilise = new TrPostVisuPanel(projet.impl_, projet, new BCalqueLegende(), src); + MvProfileTarget target = new TrPostProfileAction.ProfileAdapter(src, projet); + MvProfileBuilder builder = new MvProfileBuilderFromLine(target, projet.impl_, polyligne, panelUtilise, + new MvProfileCoteTester()); + // -- intersectionResultI --// + this.res_ = builder.getDefaultRes(this.variable_, projet.impl_.getMainProgression()); + // -- EfLineIntersectionsResultsBuilder --// + this.builder_ = new EfLineIntersectionsResultsBuilder(polyligne, this.res_, new MvProfileCoteTester()); + // -- rejouer les donn\xE9es --// + this.computeY(projet.impl_.getMainProgression()); + } - //-- etape 3: la polyligne --// - LineString polyligne=(LineString) liste.get(2); + public void viewGenerationSource(Map infos, CtuluUI impl) { - // -- etape 4: recherche du source qui contient le path donn\xE9 --// - if (projet != null && liste.size()>=4){ - String idSource=(String) liste.get(3); - src = projet.findSourceById(idSource); - if(src!=null) - this.data_=src; - else{ - ((List<String>) infos.get("errorMsg")) - .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idVar); - return; - } - } - else{ - ((List<String>) infos.get("errorMsg")) - .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idVar); - return; - } - //-- recherche dans les sources de la variable par id --// - for(int i=0;i<src.getAvailableVar().length;i++) - if(src.getAvailableVar()[i].getID().equals(idVar)) - var=src.getAvailableVar()[i]; + if (!(impl instanceof TrPostCommonImplementation)) { + impl.error(TrResource.getS("Impossible de r\xE9cup\xE9rer la bonne interface fudaa")); + return; + } + TrPostCommonImplementation implementation = (TrPostCommonImplementation) impl; - if(var!=null) - this.variable_=var; - else{ - ((List<String>) infos.get("errorMsg")) - .add("Erreur, la frame graphe ne trouve pas la variable qui correspond \xE0 l'ID " + idVar); - return; - } + // -- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --// + TrReplayCurvesData.getInstance().getProfilSpatialOrigine(this, implementation); - //-- on rejoue les donn\xE9es: --// - //-- creation du resultBuilder: --// - TrPostVisuPanel panelUtilise=new TrPostVisuPanel(projet.impl_,projet,new BCalqueLegende(),src); - MvProfileTarget target=new TrPostProfileAction.ProfileAdapter(src,projet); - MvProfileBuilder builder=new MvProfileBuilderFromLine(target,projet.impl_,polyligne,panelUtilise,new MvProfileCoteTester()); + } - //-- intersectionResultI --// - this.res_=builder.getDefaultRes(this.variable_, projet.impl_.getMainProgression()); + public EfGridData getData() { + return data_; + } - //-- EfLineIntersectionsResultsBuilder --// - this.builder_=new EfLineIntersectionsResultsBuilder(polyligne,this.res_,new MvProfileCoteTester()); + public void setData(EfGridData _data) { + this.data_ = _data; + } - //-- rejouer les donn\xE9es --// - this.computeY(projet.impl_.getMainProgression()); - } - public void viewGenerationSource(Map infos, CtuluUI impl){ + public EfLineIntersectionsResultsBuilder getBuilder() { + return builder_; + } - if(!(impl instanceof TrPostCommonImplementation)){ - impl.error(TrResource.getS("Impossible de r\xE9cup\xE9rer la bonne interface fudaa")); - return; - } - TrPostCommonImplementation implementation=(TrPostCommonImplementation)impl; + public void setBuilder(EfLineIntersectionsResultsBuilder _builder) { + this.builder_ = _builder; + } - //-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --// - TrReplayCurvesData.getInstance().getProfilSpatialOrigine(this, implementation); - - } + public void replayData(org.fudaa.ebli.courbe.EGGrapheTreeModel model, Map infos, CtuluUI impl) { + if (!(impl instanceof TrPostCommonImplementation)) { + impl.error(TrResource.getS("Impossible de r\xE9cup\xE9rer la bonne interface fudaa")); + return; + } + TrPostCommonImplementation implementation = (TrPostCommonImplementation) impl; + if (!(this.getData() instanceof TrPostSource)) { + implementation.error("Impossible de r\xE9cup\xE9rer le fichier r\xE9sulat depuis ce type de profil spatial."); + return; + } + // -- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --// + TrReplayCurvesData.getInstance().getProfilSpatialReplayData((TrPostSource) this.getData(), + (MvProfileTreeModel) model, this, implementation); - public EfGridData getData() { - return data_; - } + } - public void setData(EfGridData _data) { - this.data_ = _data; - } - - public EfLineIntersectionsResultsBuilder getBuilder() { - return builder_; - } - - public void setBuilder(EfLineIntersectionsResultsBuilder _builder) { - this.builder_ = _builder; - } - - - public void replayData(org.fudaa.ebli.courbe.EGGrapheTreeModel model,Map infos, CtuluUI impl) { - if(!(impl instanceof TrPostCommonImplementation)){ - impl.error(TrResource.getS("Impossible de r\xE9cup\xE9rer la bonne interface fudaa")); - return; - } - TrPostCommonImplementation implementation=(TrPostCommonImplementation)impl; - if(!(this.getData() instanceof TrPostSource)){ - implementation.error("Impossible de r\xE9cup\xE9rer le fichier r\xE9sulat depuis ce type de profil spatial."); - return; - } - //-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --// - TrReplayCurvesData.getInstance().getProfilSpatialReplayData((TrPostSource) this.getData(),(MvProfileTreeModel)model, this, implementation); - - - } - - } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvLineChooser.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvLineChooser.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvLineChooser.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -20,6 +20,7 @@ import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.fudaa.meshviewer.MvResource; +import org.fudaa.fudaa.sig.layer.FSigTempLineInLayer; import com.memoire.bu.BuBorders; import com.memoire.bu.BuLabel; 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 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -30,7 +30,6 @@ import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; -import org.fudaa.fudaa.tr.post.TrPostSource; import com.memoire.bu.BuBorders; import com.memoire.bu.BuGlassPaneStop; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -132,7 +132,7 @@ resNode_ = _resNode; builderNode_ = _builderNode; if(builderNode_!=null ) - initLineNode=builderNode_.getInitLine_(); + initLineNode=builderNode_.getInitLine(); } @@ -146,7 +146,7 @@ resMesh_ = _resMeshes; builderMesh_ = _builderMeshes; if(builderMesh_!=null ) - initLineMesh=builderMesh_.getInitLine_(); + initLineMesh=builderMesh_.getInitLine(); } Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigTempLineInLayer.java (from rev 4358, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/FSigTempLineInLayer.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigTempLineInLayer.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigTempLineInLayer.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -0,0 +1,116 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.fudaa.sig.layer; + +import java.awt.Color; + +import org.fudaa.ebli.calque.BArbreCalqueModel; +import org.fudaa.ebli.calque.ZCalqueLigneBrisee; +import org.fudaa.ebli.calque.ZEbliCalquesPanel; +import org.fudaa.ebli.geometrie.GrBoite; +import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceIconModel; +import org.fudaa.ebli.trace.TraceLigne; +import org.fudaa.ebli.trace.TraceLigneModel; +import org.fudaa.fudaa.sig.FSigLineSingleModel; + +import com.vividsolutions.jts.geom.LineString; + +/** + * Une classe permettant d'afficher temporaire une ligne dans le panel + * + * @author deniger + */ +public class FSigTempLineInLayer { + + private Color colorLineTempo_ = Color.RED; + + GrBoite initZoom_; + + boolean isZoomChanged_; + + final ZEbliCalquesPanel panel_; + + ZCalqueLigneBrisee tmp_; + + public FSigTempLineInLayer(ZEbliCalquesPanel _panel) { + super(); + panel_ = _panel; + } + + public void close() { + if (tmp_ != null) { + tmp_.detruire(); + panel_.getVueCalque().getCalque().repaint(); + panel_.getVueCalque().changeRepere(this, initZoom_); + tmp_ = null; + } + + } + + /** + * @return the colorLineTempo + */ + public Color getColorLineTempo() { + return colorLineTempo_; + } + + /** + * @return the isZoomChanged + */ + public boolean isZoomChanged() { + return isZoomChanged_; + } + + /** + * @param _colorLineTempo the colorLineTempo to set + */ + public void setColorLineTempo(Color _colorLineTempo) { + colorLineTempo_ = _colorLineTempo; + } + + /** + * @param _s la ligne a afficher temporairement. si null n'affiche rien + * @param _zoom true si on doit zoomer sur la ligne. + */ + public void display(final LineString _s, final boolean _zoom) { + if (panel_ == null) { return; } + if (_s == null) { + if (tmp_ != null) { + tmp_.setVisible(false); + } + return; + } + final FSigLineSingleModel modele = new FSigLineSingleModel(_s); + if (tmp_ == null) { + initZoom_ = panel_.getVueCalque().getViewBoite(); + tmp_ = new ZCalqueLigneBrisee(); + tmp_.setDestructible(true); + final TraceIconModel model = new TraceIconModel(TraceIcon.PLUS_DOUBLE, 4, colorLineTempo_); + tmp_.setIconModel(0, model); + tmp_.setIconModel(1, model); + final TraceLigneModel ligne = new TraceLigneModel(TraceLigne.MIXTE, 2, colorLineTempo_); + tmp_.setLineModel(0, ligne); + tmp_.setLineModel(1, ligne); + panel_.getVueCalque().getCalque().enPremier(tmp_); + panel_.getCqInfos().enPremier(); + } + tmp_.setVisible(true); + tmp_.modele(modele); + if (_zoom) { + BArbreCalqueModel.actionCenter(tmp_, panel_); + isZoomChanged_ = true; + } + } + + public void zoomInitial() { + panel_.getVueCalque().changeViewBoite(this, initZoom_, false); + } + + public void restaurer() { + panel_.restaurer(); + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -401,8 +401,7 @@ public void fillWithInfo(InfoData _table, CtuluListSelectionInterface _selectedPt) { if(EbliWidget.AMELIO_LOT_VISIBLE){ _table.put(TrResource.getS("Type"),"Evolution temporelle"); - _table.put(TrResource.getS("Fichier r\xE9sultat"),this.source_.getFile().getName()); - _table.put(TrResource.getS("Chemin complet"),this.source_.getFile().getAbsolutePath()); + TrPostSourceAbstract.fillWithSourceInfo(_table, source_); _table.put(TrResource.getS("Titre Fichier r\xE9sultat"),this.source_.getTitle()); _table.put(TrResource.getS("Infos Point initial"),this.getInfosPoint()); _table.put(TrResource.getS("Variable"),this.getVar().getName()+" en "+this.getVar().getCommonUnitString()); Modified: 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/TrPostInspector.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspector.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -23,6 +23,8 @@ import com.memoire.fu.FuLog; /** + * TODO a revoir entierement + * * @author fred deniger * @version $Id: TrPostInspector.java,v 1.10 2007-06-05 09:01:14 deniger Exp $ */ @@ -46,7 +48,7 @@ stop(); return; } - src_.setInspected(true); + // src_.setInspected(true); } if (reader_ != null) { @@ -224,12 +226,13 @@ if (timer_ == null) { timer_ = new Timer(); } - if (reader_ == null) { - reader_ = proj_.createWatcher(src_); - } + // TODO a revoir +// if (reader_ == null) { +// reader_ = proj_.createWatcher(src_); +// } if (reader_ == null) { return; } if (proj_ != null && src_ != null) { - src_.setInspected(true); + // src_.setInspected(true); } reader_.setProgression(panel_); @@ -241,7 +244,7 @@ reader_.close(); reader_ = null; if (proj_ != null && src_ != null) { - src_.setInspected(false); + // src_.setInspected(false); } BuLib.invokeLater(new Runnable() { Modified: 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/TrPostInspectorReaderReflux.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorReaderReflux.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -53,7 +53,7 @@ public TrPostInspectorReaderReflux(final TrPostProjet _prj, final TrPostSource _src) { super(); - file_ = _src.getFile(); + file_ = _src.getFiles().iterator().next(); prj_ = _prj; src_ = _src; } Modified: 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/TrPostInspectorReaderRubar.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorReaderRubar.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -76,7 +76,7 @@ if (fmt != null) { // les formats qui seront a recharger final Set<FileFormat> fmtToLoad = new HashSet<FileFormat>(fmt.length); - final String name = CtuluLibFile.getSansExtension(loader_.getSrc().getFile().getName()); + final String name = CtuluLibFile.getSansExtension(loader_.getSrc().getMainFile().getName()); for (int i = fmt.length - 1; i >= 0; i--) { final int idx = FileFormat.findFileFormat(loader_.availFmt_, fmt[i]); if (idx < 0) { Modified: 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/TrPostInspectorReaderSerafin.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorReaderSerafin.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -69,7 +69,7 @@ super(); prj_ = _prj; src_ = _src; - serafin_ = _src.getFile(); + serafin_ = _src.getFiles().iterator().next(); tmpDir_ = null; casFile_ = null; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -14,9 +14,8 @@ import java.awt.event.ActionListener; import java.io.File; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collection; import java.util.Collections; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Observable; @@ -62,7 +61,6 @@ import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetControllerGraphe; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; -import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetGrapheController; import org.fudaa.fudaa.commun.courbe.FudaaGrapheTimeAnimatedVisuPanel; import org.fudaa.fudaa.fdico.FDicoLib; import org.fudaa.fudaa.meshviewer.MvResource; @@ -74,7 +72,6 @@ import org.fudaa.fudaa.tr.post.data.TrPostDataListener; import org.fudaa.fudaa.tr.post.persist.TrPostPersistenceManager; import org.fudaa.fudaa.tr.post.save.TrPostProjetSaver; -import org.netbeans.api.visual.model.ObjectState; import org.netbeans.api.visual.widget.Widget; import com.memoire.bu.BuBorderLayout; @@ -104,9 +101,6 @@ */ public class TrPostProjet implements ActionListener { - - - /** * Manager de sauvegarder/charghement des donn\xE9es */ @@ -391,7 +385,7 @@ */ public void ajouterSource(final TrPostSource _src) { _src.addVariableListener(new VariableListener()); - if (_src.getFile() == null || !isSourceLoaded(_src.getFile().getAbsolutePath())) { + if (_src.getFiles() == null || !isOneSourceLoaded(_src.getFiles())) { listeSrc_.add(_src); _src.buildDefaultVarUpdateLists(); @@ -406,6 +400,10 @@ } } + + public TrPostSource findSource(final String _file) { + return findSource(new File(_file)); + } /** * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. @@ -413,16 +411,35 @@ * @param _file : path absolu du fichier * @return */ - public TrPostSource findSource(final String _file) { + public TrPostSource findSource(final File _file) { for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { final TrPostSource src = it.next(); - if (src.getFile().getAbsolutePath().equals(_file)) return src; + if (src.isOpened(_file)) return src; } return null; } + public TrPostSource findSource(final Collection<File> _file) { + + for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { + final TrPostSource src = it.next(); + if (isOpenedIn(_file, src)) return src; + } + return null; + } + + private boolean isOpenedIn(Collection<File> files, TrPostSource _in) { + if (_in == null) return false; + for (File file : files) { + if (_in.isOpened(file)) return true; + + } + return false; + + } + /** * Retourne la source asscoi\xE9 a l id. * @@ -439,17 +456,26 @@ return null; } + public boolean isSourceLoaded(final String _file) { + return isSourceLoaded(new File(_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) { + public boolean isSourceLoaded(final File _file) { if (findSource(_file) == null) return false; return true; } + public boolean isOneSourceLoaded(final Collection<File> _files) { + if (findSource(_files) == null) return false; + return true; + } + // /** // * methode qui change la source courante et retourne true si la source existe bien, false sinon // * @@ -470,7 +496,7 @@ */ public boolean removeSource(final TrPostSource src, final int n) { - if (isSourceLoaded(src.getFile().getAbsolutePath())) { + if (isOneSourceLoaded(src.getFiles())) { listeSrc_.remove(src); // --recuperation du menu simul --// @@ -517,7 +543,8 @@ */ public String formatInfoSource(final TrPostSource _src) { // --ajout dans la liste des titres --// - return formatName(_src.getTitle()) + " | Fichier: " + formatFichier(_src.getFile()); + Collection<File> files = _src.getFiles(); + return formatName(_src.getTitle()) + " | Fichier: " + formatFichier(files.iterator().next()); } public String formatFichier(final File file) { @@ -557,8 +584,8 @@ */ 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.getFiles().iterator().next()), + "SIMULATION" + (listeSrc_.size())); // -- ajout du menu au menu post --// getMenuPost().add(menuSimul); @@ -587,24 +614,24 @@ 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()); + // if (_src != null ) { + 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); - } + // } } /** @@ -674,23 +701,28 @@ } }); getMenuPost().addMenuItem(TrResource.getS(("Fusionner avec un autre projet POST")), "FUSIONPOST", - CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { + CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { - public void actionPerformed(final ActionEvent _e) { - - final int reponse = JOptionPane.showConfirmDialog(getImpl().getParentComponent(),TrResource.getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); - if (reponse == JOptionPane.CANCEL_OPTION) { return; } - if (reponse == JOptionPane.OK_OPTION) { - getManager().saveProject(false); - } - - getManager().loadProject(false, null); - //-- on reinitialise le nom path du projet a null pour qu'il soit redemand\xE9 lors de la nouvelle sauvegarde --// - getManager().setProjet_(null); + public void actionPerformed(final ActionEvent _e) { - } - }); + final int reponse = JOptionPane + .showConfirmDialog( + getImpl().getParentComponent(), + TrResource + .getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); + if (reponse == JOptionPane.CANCEL_OPTION) { return; } + if (reponse == JOptionPane.OK_OPTION) { + getManager().saveProject(false); + } + getManager().loadProject(false, null); + // -- on reinitialise le nom path du projet a null pour qu'il soit redemand\xE9 lors de la nouvelle sauvegarde + // --// + getManager().setProjet_(null); + + } + }); + getMenuPost().addSeparator(TrResource.getS("Gestion")); // -- ajout de l action de gestion des simus dans post --// final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); @@ -808,9 +840,9 @@ } - TrPostInspectorReader createWatcher(final TrPostSource _src) { - return _src.createWatcher(this, true); - } + // TrPostInspectorReader createWatcher(final TrPostSource _src) { + // return _src.createWatcher(this, true); + // } boolean openSrcDataAndIsModified(final CtuluUI _ui, final ProgressionInterface _prog) { return new TrPostProjetSaver(this).openSrcDataAndIsModified(_ui, _prog); @@ -852,11 +884,11 @@ final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl_, this, projection.getNbFleche() == 0, new BCalqueLegende(), projection); - //-- ajout des infos de cr\xE9ation --// - pnVisu.infosCreation_.put(ZEbliCalquesPanel.NOM_FIC, projection.getFile().getName()); - pnVisu.infosCreation_.put(ZEbliCalquesPanel.PATH_FIC, projection.getFile().getAbsolutePath()); + // -- ajout des infos de cr\xE9ation --// + // TODO centralise tout cela \xFC!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + TrPostSourceAbstract.fillWithSourceInfo(CtuluLibString.EMPTY_STRING, pnVisu.infosCreation_, projection); pnVisu.infosCreation_.put(ZEbliCalquesPanel.TITRE_FIC, projection.getTitle()); - + // creation de l internalframe qui contient le panel de visu // final TrPostFille compFille = new TrPostFille(pnVisu); // creation de la scene layout identique a au dessus @@ -962,19 +994,17 @@ _pn.getGraphe().restore(); if (_desc != null) nodeG.getWidget().getController().setDescription(_desc); currentLayoutFilleOrFirst.getScene().setSelectedObjects(Collections.emptySet()); - - //-- ajout syst\xE9matique de la legende associee --// - EbliWidgetControllerGraphe controller=(EbliWidgetControllerGraphe)nodeG.getWidget().getIntern().getController(); + + // -- ajout syst\xE9matique de la legende associee --// + EbliWidgetControllerGraphe controller = (EbliWidgetControllerGraphe) nodeG.getWidget().getIntern() + .getController(); controller.ajoutLegende(); } }); - //getImpl().getCurrentLayoutFilleOrFirst().getScene().refresh(); - - - - + // getImpl().getCurrentLayoutFilleOrFirst().getScene().refresh(); + } protected void buildTimeUpdater() { @@ -1071,16 +1101,16 @@ // else if ("IMPORTER_RESULTS".equals(commandeBrute) && item == _event.getSource()) { // importerVars(); // } - else if ("MAJ_DATA_ALWAYS".equals(commandeBrute) && item == _event.getSource()) { - if (source.isInspected()) { return; } - new TrPostInspector(this, source).start(); - } else if ("MAJ_DATA".equals(commandeBrute) && item == _event.getSource()) { - final TrPostInspectorReader watcher = source.createWatcher(this, false); - if (watcher != null) { - watcher.read(); - watcher.close(); - } - } + // else if ("MAJ_DATA_ALWAYS".equals(commandeBrute) && item == _event.getSource()) { + // if (source.isInspected()) { return; } + // new TrPostInspector(this, source).start(); + // } else if ("MAJ_DATA".equals(commandeBrute) && item == _event.getSource()) { + // final TrPostInspectorReader watcher = source.createWatcher(this, false); + // if (watcher != null) { + // watcher.read(); + // watcher.close(); + // } + // } } } @@ -1148,16 +1178,17 @@ final TrPostSource source = listeSrc_.get(0); final TrPostVisuPanel pnVisu = source.buildVisuPanel(TrPostProjet.this, legendeCalque); - //-- ajout des infos de cr\xE9ation --// - pnVisu.infosCreation_.put(ZEbliCalquesPanel.NOM_FIC, source.getFile().getName()); - pnVisu.infosCreation_.put(ZEbliCalquesPanel.PATH_FIC, source.getFile().getAbsolutePath()); - pnVisu.infosCreation_.put(ZEbliCalquesPanel.TITRE_FIC, source.getTitle()); - + // -- ajout des infos de cr\xE9ation --// + // TODO Adrien centralise tout cela !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // c'est la source qui doit donner ces info: modifier TrPostSource ! + TrPostSourceAbstract.fillWithSourceInfo(CtuluLibString.EMPTY_STRING, pnVisu.infosCreation_, source); + // -- ajout du visuPanel au layout --// final Point location = pnVisu.getLocation(); location.x += 10; location.y += 10; - filleLayout.addCalque("Calque "+(filleLayout.getScene().getAllVue2d().size()+1), location, pnVisu.getPreferredSize(), pnVisu, legendeCalque); + filleLayout.addCalque("Calque " + (filleLayout.getScene().getAllVue2d().size() + 1), location, pnVisu + .getPreferredSize(), pnVisu, legendeCalque); // -- decoration de la fille layout --// filleLayout.setFrameIcon(EbliResource.EBLI.getToolIcon("lissage")); @@ -1315,16 +1346,18 @@ * @return */ public String deliverSourceId(TrPostSource src) { + String idString = src.getFiles().iterator().next().getName(); if (src.getId() == null) { - String uniqueId = CtuluLibGenerator.getInstance().deliverUniqueStringId(src.getFile().getName()); + + String uniqueId = CtuluLibGenerator.getInstance().deliverUniqueStringId(idString); 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 nameFormate = FuLib.clean(idString); String id = src.getId(); if (!id.startsWith(nameFormate)) { - String uniqueId = CtuluLibGenerator.getInstance().deliverUniqueStringId(src.getFile().getName()); + String uniqueId = CtuluLibGenerator.getInstance().deliverUniqueStringId(idString); src.setId(uniqueId); } Modified: 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/TrPostProjetChooser.java 2009-01-24 22:16:05 UTC (rev 4400) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetChooser.java 2009-01-25 22:20:21 UTC (rev 4401) @@ -73,7 +73,7... [truncated message content] |