|
From: <de...@us...> - 2010-01-03 21:46:27
|
Revision: 5584
http://fudaa.svn.sourceforge.net/fudaa/?rev=5584&view=rev
Author: deniger
Date: 2010-01-03 21:46:16 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java 2010-01-03 21:43:37 UTC (rev 5583)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java 2010-01-03 21:46:16 UTC (rev 5584)
@@ -1,9 +1,13 @@
/*
- * @creation 29 ao\xFBt 2005
- * @modification $Date: 2007-04-30 14:22:38 $
- * @license GNU General Public License 2
- * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
- * @mail fud...@li...
+ * @creation 29 ao\xFBt 2005
+ *
+ * @modification $Date: 2007-04-30 14:22:38 $
+ *
+ * @license GNU General Public License 2
+ *
+ * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ *
+ * @mail fud...@li...
*/
package org.fudaa.fudaa.tr.post;
@@ -22,6 +26,7 @@
import org.fudaa.fudaa.tr.post.data.TrPostDataCreated;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedExpr;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedSaver;
+import org.fudaa.fudaa.tr.post.data.TrPostDataHelper;
import org.nfunk.jep.Variable;
/**
@@ -41,15 +46,6 @@
}
- public static void loadVars(final TrPostSource _dest, final CtuluAnalyze _analyze, final ObjectContainer _db,
- final ProgressionInterface _prog, final CtuluUI _ui) {
- final TrPostUserVariableSaver doc = (TrPostUserVariableSaver) FudaaSaveLib.getUniqueData(
- TrPostUserVariableSaver.class, _db);
- if (doc != null) {
- doc.restore(_dest, _analyze, _prog, _ui);
- }
- }
-
public boolean isExprEmpty() {
return CtuluLibArray.isEmpty(varCreated_) || CtuluLibArray.isEmpty(expr_) || expr_.length != varCreated_.length;
}
@@ -67,8 +63,9 @@
* @param _prog
* @param _ui
*/
- public void restore(final TrPostSource _src, final CtuluAnalyze _analyze, final ProgressionInterface _prog,
- final CtuluUI _ui) {
+ public CtuluAnalyze restore(final TrPostSource _src, final CtuluAnalyze _analyze, final ProgressionInterface _prog,
+ final CtuluUI _ui, TrPostSourcesManager ctx) {
+ CtuluAnalyze log=new CtuluAnalyze();
if (g_ != null) {
_src.getGravity().setValue(g_);
}
@@ -88,10 +85,11 @@
final Map shortName = getShortNameVariable(_src);
final TrPostDataCreated[] newData = new TrPostDataCreated[saver_.length];
for (int i = 0; i < saver_.length; i++) {
- newData[i] = saver_[i].restore(varCreatedSimple_[i], _src, _ui, shortName);
+ newData[i] = saver_[i].restore(varCreatedSimple_[i], _src, _ui, shortName, ctx, log);
}
_src.addUserVar(varCreatedSimple_, newData, null);
}
+ return log;
}
public Map getShortNameVariable(final TrPostSource _src) {
@@ -107,56 +105,7 @@
public static void saveIn(final TrPostSourceAbstract _src, final ObjectContainer _db, final ProgressionInterface _prog) {
if (_db == null || _src == null) { return; }
FudaaSaveLib.deleteAll(_db, TrPostUserVariableSaver.class);
- final TrPostUserVariableSaver save = new TrPostUserVariableSaver();
- save.g_ = _src.getGravity().getValue();
-
- if (_src.varUserCreateData_ != null) {
- final Map map = new HashMap(_src.varUserCreateData_);
- // on enleve les variables import\xE9es
- final Set varToRemove = new HashSet();
- for (final Iterator it = map.entrySet().iterator(); it.hasNext();) {
- final Map.Entry e = (Map.Entry) it.next();
- final TrPostDataCreated created = (TrPostDataCreated) e.getValue();
- final H2dVariableType var = (H2dVariableTypeCreated) e.getKey();
- // pas de sauvegarde possible ou non basee sur une expression
- if (!created.isExpr() && created.createSaver() == null) {
- varToRemove.add(var);
- varToRemove.addAll(TrPostDataCreatedExpr.getAllVarDependingOn(var, _src));
- }
- }
- if (Fu.DEBUG && FuLog.isDebug()) {
- FuLog.debug("vars enlevees\n" + CtuluLibString.arrayToString(varToRemove.toArray()));
- }
- map.keySet().removeAll(varToRemove);
- final Map exprVar = new HashMap(map.size());
- final Map otherVar = new HashMap(map.size());
- for (final Iterator it = map.entrySet().iterator(); it.hasNext();) {
- final Map.Entry e = (Map.Entry) it.next();
- final TrPostDataCreated data = ((TrPostDataCreated) e.getValue());
- if (data.isExpr()) {
- exprVar.put(e.getKey(), data);
- } else {
- otherVar.put(e.getKey(), data);
- }
- }
-
- save.varCreated_ = new H2dVariableTypeCreated[exprVar.size()];
- save.expr_ = new String[exprVar.size()];
- int idx = 0;
- for (final Iterator it = exprVar.entrySet().iterator(); it.hasNext();) {
- final Map.Entry e = (Map.Entry) it.next();
- save.varCreated_[idx] = (H2dVariableTypeCreated) e.getKey();
- save.expr_[idx++] = ((TrPostDataCreatedExpr) e.getValue()).getFormule();
- }
- save.varCreatedSimple_ = new H2dVariableTypeCreated[otherVar.size()];
- save.saver_ = new TrPostDataCreatedSaver[otherVar.size()];
- for (final Iterator it = otherVar.entrySet().iterator(); it.hasNext();) {
- final Map.Entry e = (Map.Entry) it.next();
- save.varCreatedSimple_[idx] = (H2dVariableTypeCreated) e.getKey();
- save.saver_[idx++] = ((TrPostDataCreated) e.getValue()).createSaver();
- }
-
- }
+ final TrPostUserVariableSaver save = createSaver(_src, _prog);
_db.set(save);
_db.commit();
}
@@ -168,12 +117,11 @@
* @param _prog
* @return
*/
- public static TrPostUserVariableSaver saveIn(final TrPostSourceAbstract _src, final ProgressionInterface _prog) {
+ public static TrPostUserVariableSaver createSaver(final TrPostSourceAbstract _src, final ProgressionInterface _prog) {
if (_src == null) { return null; }
final TrPostUserVariableSaver save = new TrPostUserVariableSaver();
save.g_ = _src.getGravity().getValue();
-
if (_src.varUserCreateData_ != null) {
final Map map = new HashMap(_src.varUserCreateData_);
// on enleve les variables import\xE9es
@@ -185,7 +133,7 @@
// pas de sauvegarde possible ou non basee sur une expression
if (created != null && !created.isExpr() && created.createSaver() == null) {
varToRemove.add(var);
- varToRemove.addAll(TrPostDataCreatedExpr.getAllVarDependingOn(var, _src));
+ varToRemove.addAll(TrPostDataHelper.getAllVarDependingOn(var, _src));
}
}
if (Fu.DEBUG && FuLog.isDebug()) {
@@ -203,7 +151,6 @@
if (data != null) otherVar.put(e.getKey(), data);
}
}
-
save.varCreated_ = new H2dVariableTypeCreated[exprVar.size()];
save.expr_ = new String[exprVar.size()];
int idx = 0;
@@ -317,7 +264,7 @@
}
} else {
- varPostData.put(vari, TrPostDataCreatedExpr.createData(_src, expr.getParser(), varvar2d));
+ varPostData.put(vari, TrPostDataHelper.createData(_src, expr.getParser(), varvar2d));
}
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java 2010-01-03 21:43:37 UTC (rev 5583)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanelPersistManager.java 2010-01-03 21:46:16 UTC (rev 5584)
@@ -78,7 +78,7 @@
if (projet == null) return null;
// -- etape 1: recherche du source qui contient le path donn\xE9 --//
- TrPostSource src = projet.findSourceById(idSource);
+ TrPostSource src = projet.getSources().findSourceById(idSource);
// -- etape 2 si source pas trouv\xE9, chargement du source --//
if (src == null) {
@@ -87,7 +87,7 @@
((List<String>) parameters.get("errorMsg"))
// TODO traduire !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.add("Erreur, la frame calque ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource);
- if (projet.listeSrc_.size() > 0) {
+ if (projet.getSources().isNotEmpty()) {
((List<String>) parameters.get("errorMsg")).add("Le calque chargera en contrepartie le fichier r\xE9sultat "
+ projet.getSource(0).getFiles().iterator().next().getPath());
// return null;
@@ -112,8 +112,7 @@
if (listeReloadSource != null && listeReloadSource.contains(idSource)) {
- }
- else {
+ } else {
// -- restorer les donn\xE9es --//
FudaaSaveZipLoader loader = null;
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2010-01-03 21:48:21
|
Revision: 5586
http://fudaa.svn.sourceforge.net/fudaa/?rev=5586&view=rev
Author: deniger
Date: 2010-01-03 21:48:10 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceOneTimeStep.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java 2010-01-03 21:46:55 UTC (rev 5585)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java 2010-01-03 21:48:10 UTC (rev 5586)
@@ -1,8 +1,12 @@
/*
* @creation 19 mars 07
+ *
* @modification $Date: 2007-06-13 12:58:14 $
+ *
* @license GNU General Public License 2
+ *
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ *
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.post;
@@ -68,36 +72,34 @@
// il est modifie si on utilise le maillage de projet ou si le type (rubar ou non) est modifie
// la comparaison se fait sur le maillage importe ou le mode rubar est modifie
if (_useProjGrid || rubar != ref.isRubar()) {
- ref = new TrPostSourceProjected(ref, ref.getAvailableVar(), grid, _useProjTime ? time : null, rubar,
- _isGridEquals, _impl);
+ ref = new TrPostSourceProjected(ref, grid, _useProjTime ? time : null, rubar, _isGridEquals, _impl);
openRef = true;
}
// il est egalement modifie si les pas de temps sont diff\xE9rents
else if (_useProjTime) {
// seuls les pas de temps sont modifies
- ref = new TrPostSourceProjected(ref, ref.getAvailableVar(), grid, time, rubar, true, _impl);
+ ref = new TrPostSourceProjected(ref, grid, time, rubar, true, _impl);
openRef = true;
}
// le projet importe
// modifie si on utilise le maillage du projet de ref ou si le mode est modifie
if (!_useProjGrid || rubar != proj.isRubar()) {
- proj = new TrPostSourceProjected(proj, proj.getAvailableVar(), grid, _useProjTime ? null : time, rubar,
- _isGridEquals, _impl);
+ proj = new TrPostSourceProjected(proj, grid, _useProjTime ? null : time, rubar, _isGridEquals, _impl);
openProj = true;
}
// modifie si on utilise les pas de temps du projet importe
// Dans ce cas, seuls les pas de temps sont modifies
else if (!_useProjTime) {
- proj = new TrPostSourceProjected(proj, proj.getAvailableVar(), grid, time, rubar, true, _impl);
+ proj = new TrPostSourceProjected(proj, grid, time, rubar, true, _impl);
openProj = true;
}
if (openProj) {
- proj.openDatas(_prog, null, null, _impl);
+ proj.openDatas(_prog, null, _impl);
proj.buildDefaultVarUpdateLists();
}
if (openRef) {
- ref.openDatas(_prog, null, null, _impl);
+ ref.openDatas(_prog, null, _impl);
ref.buildDefaultVarUpdateLists();
}
final TrPostSourceComparator comparaison = new TrPostSourceComparator(ref, proj, _impl);
@@ -106,7 +108,7 @@
}
- comparaison.openDatas(_prog, null, null, _impl);
+ comparaison.openDatas(_prog, null, _impl);
comparaison.updateVarList();
comparaison.buildDefaultVectors();
return comparaison;
@@ -132,7 +134,6 @@
return FDicoLib.getS("Comparaison");
}
-
protected static void activeComparaison(final TrPostSource _src, final TrPostSource _toProject,
final String _quickDiff, final TrPostProjet projet) {
@@ -193,7 +194,7 @@
pref = TrResource.getS("Projet\xE9") + " ";
infosCreation_.put(pref + ZEbliCalquesPanel.TITRE_FIC, proj.getTitle());
TrPostSourceAbstractFromIdx.fillWithSourceInfo(pref, infosCreation_, proj);
-
+
if (isOnImpGrid) infosCreation_.put(ZEbliCalquesPanel.MAILLAGE_FIC, proj.getTitle());
else infosCreation_.put(ZEbliCalquesPanel.MAILLAGE_FIC, src.getTitle());
@@ -206,9 +207,9 @@
final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl, projet,
comparaison.getFlecheListModel().getSize() == 0, legendeCalque, comparaison);
pnVisu.infosCreation_ = infosCreation_;
-
- final BCalque calqueActif=pnVisu.getCalqueActif();
-
+
+ final BCalque calqueActif = pnVisu.getCalqueActif();
+
// final TrPostFille compFille = new TrPostFille(pnVisu);
// compFille.addInternalFrameListener(new InternalFrameAdapter() {
// public void internalFrameClosed(InternalFrameEvent _e) {
@@ -249,12 +250,11 @@
final Point location = pnVisu.getLocation();
location.x += 10;
location.y += 10;
- BCalque calqueAct=calqueActif;
+ BCalque calqueAct = calqueActif;
pnVisu.setCalqueActif(calqueAct);
- impl.getCurrentLayoutFille().controller_.addCalque(
- TrPostSourceComparatorBuilder.getComparaisonTitle() + " "
- + impl.getCurrentLayoutFille().getScene().getAllVue2d().size() + 1, location,
- pnVisu.getPreferredSize(), pnVisu, legendeCalque);
+ impl.getCurrentLayoutFille().controller_.addCalque(TrPostSourceComparatorBuilder.getComparaisonTitle()
+ + " " + impl.getCurrentLayoutFille().getScene().getAllVue2d().size() + 1, location, pnVisu
+ .getPreferredSize(), pnVisu, legendeCalque);
pnVisu.restaurer();
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceOneTimeStep.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceOneTimeStep.java 2010-01-03 21:46:55 UTC (rev 5585)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceOneTimeStep.java 2010-01-03 21:48:10 UTC (rev 5586)
@@ -1,8 +1,12 @@
/*
* @creation 17 juil. 06
+ *
* @modification $Date: 2007-06-05 09:01:14 $
+ *
* @license GNU General Public License 2
+ *
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ *
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.post;
@@ -14,6 +18,7 @@
import org.fudaa.ctulu.CtuluLibString;
import org.fudaa.dodico.ef.EfData;
import org.fudaa.dodico.h2d.type.H2dVariableType;
+import org.fudaa.fudaa.tr.post.persist.TrPostSourceOneTimeStepReplayPersist;
/**
* Source definie a partir d'une autre et sur un seul pas de temps.
@@ -21,28 +26,28 @@
* @author fred deniger
* @version $Id: TrPostSourceOneTimeStep.java,v 1.4 2007-06-05 09:01:14 deniger Exp $
*/
-public class TrPostSourceOneTimeStep extends TrPostSourceAbstractFromIdx {
+public class TrPostSourceOneTimeStep extends TrPostSourceAbstractFromIdx implements TrPostSourceBuilt {
final int timeStep_;
final TrPostSource init_;
public TrPostSourceOneTimeStep(final TrPostSource _srcInit, final int _timeIdx, final TrPostCommonImplementation _impl) {
- super( _srcInit.getTitle() + CtuluLibString.ESPACE
- + _srcInit.getTime().getTimeListModel().getElementAt(_timeIdx), _srcInit.getGrid(), new double[] { _srcInit
- .getTimeStep(_timeIdx) }, _srcInit.getAllVariablesNonVec(), _impl);
+ super(_srcInit.getTitle() + CtuluLibString.ESPACE + _srcInit.getTime().getTimeListModel().getElementAt(_timeIdx),
+ _srcInit.getGrid(), new double[] { _srcInit.getTimeStep(_timeIdx) }, _srcInit.getAllVariablesNonVec(), _impl);
init_ = _srcInit;
timeStep_ = _timeIdx;
}
-
-
+ public TrPostSourceOneTimeStepReplayPersist getReplay() {
+ return new TrPostSourceOneTimeStepReplayPersist(getId(), init_.getId(), timeStep_);
+ }
+
@Override
public EfData getInitData(final int _varIdx, final int _timeIdx) {
final H2dVariableType var = getVariableWithInitIdx(_varIdx);
return init_.getData(var, timeStep_);
}
-
@Override
public double getInitData(final int _varIdx, final int _timeIdx, final int _ptIdx) throws IOException {
return getInitData(_varIdx, _timeIdx).getValue(_ptIdx);
@@ -56,8 +61,6 @@
return init_.isRubar();
}
-
-
public Collection<File> getFiles() {
return init_.getFiles();
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java 2010-01-03 21:46:55 UTC (rev 5585)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java 2010-01-03 21:48:10 UTC (rev 5586)
@@ -1,19 +1,24 @@
/*
- * @creation 7 d\xE9c. 2005
- * @modification $Date: 2007-06-28 09:28:18 $
- * @license GNU General Public License 2
- * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
- * @mail fud...@li...
+ * @creation 7 d\xE9c. 2005
+ *
+ * @modification $Date: 2007-06-28 09:28:18 $
+ *
+ * @license GNU General Public License 2
+ *
+ * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ *
+ * @mail fud...@li...
*/
package org.fudaa.fudaa.tr.post;
-import gnu.trove.TIntObjectHashMap;
-
import java.io.File;
import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
-import com.db4o.ObjectContainer;
import com.memoire.fu.FuLog;
import org.fudaa.ctulu.CtuluAnalyze;
@@ -31,12 +36,14 @@
import org.fudaa.dodico.ef.interpolation.EfInterpolationGridSupportAdapter;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.fudaa.tr.common.TrResource;
+import org.fudaa.fudaa.tr.post.persist.TrPostSourceProjectedPersistReplay;
+import org.fudaa.fudaa.tr.post.persist.TrPostSourceReplayPersist;
/**
* @author Fred Deniger
* @version $Id: TrPostSourceProjected.java,v 1.14 2007-06-28 09:28:18 deniger Exp $
*/
-public class TrPostSourceProjected extends TrPostSourceAbstractFromIdx {
+public class TrPostSourceProjected extends TrPostSourceAbstract implements TrPostSourceBuilt {
final boolean destIsRubar_;
@@ -44,7 +51,6 @@
double eps_ = 1E-5;
-
/**
* De la taille des points dest. Pour chaque point dest donne les points sources a utiliser pour interpoler la valeur.
* Si null, c'est que c'est identique.
@@ -57,7 +63,7 @@
*/
int[][] idxTime_;
- final TIntObjectHashMap intVar_;
+ // final TIntObjectHashMap intVar_;
final boolean isGridEquals_;
@@ -67,43 +73,32 @@
final EfGridInterface target_;
- public TrPostSourceProjected(final TrPostSource _srcInit, final H2dVariableType[] _varsToProject,
- final EfGridInterface _grid, final double[] _destTimeStep, final boolean _destIsRubar,
- final boolean _isGridEquals, final TrPostCommonImplementation _impl) {
+ final TrPostSourceProjectedPersistReplay replay;
+
+ public TrPostSourceProjected(final TrPostSource _srcInit, final EfGridInterface _grid, final double[] _destTimeStep,
+ final boolean _destIsRubar, final boolean _isGridEquals, final TrPostCommonImplementation _impl) {
+ this(_srcInit, _grid, _destTimeStep, _destIsRubar, _isGridEquals, _impl, null);
+
+ }
+
+ public TrPostSourceProjected(final TrPostSource _srcInit, final EfGridInterface _grid, final double[] _destTimeStep,
+ final boolean _destIsRubar, final boolean _isGridEquals, final TrPostCommonImplementation _impl,
+ TrPostSourceProjectedPersistReplay replay) {
super(_srcInit.getTitle(), _grid, _destTimeStep == null ? _srcInit.getTime().getInitTimeSteps() : _destTimeStep,
- _varsToProject, _impl);
+ _srcInit.getAvailableVar(), _impl);
destTimeStep_ = _destTimeStep;
destIsRubar_ = _destIsRubar;
srcInit_ = _srcInit;
isGridEquals_ = _isGridEquals;
target_ = _grid;
- if (_varsToProject == null) {
- intVar_ = null;
- } else {
- final Set initVar = new HashSet(Arrays.asList(_varsToProject));
- // on va ajouter les variables necessaires pour les vecteurs
- for (int i = 0; i < _varsToProject.length; i++) {
- final TrPostFlecheContent fleche = srcInit_.getFlecheContent(_varsToProject[i]);
- if (fleche != null) {
- fleche.fillWhithAllUsedVar(initVar);
- }
- }
- // il y a eu un changement
- if (initVar.size() != _varsToProject.length) {
- super.variable_ = (H2dVariableType[]) initVar.toArray(new H2dVariableType[initVar.size()]);
- // on remet a jour les indices des variables dans le sens nom de variables -> indices
- setInitVar(super.variable_);
- }
- intVar_ = new TIntObjectHashMap(variable_.length);
- for (int i = variable_.length - 1; i >= 0; i--) {
- // on remet a jour les indices des variables dans le sens indices->nom de variables
- intVar_.put(i, variable_[i]);
- }
- }
+ this.replay = replay;
}
-
-
+ public TrPostSourceReplayPersist getReplay() {
+ replay.setId(getId());
+ return replay;
+ }
+
private int[] getPt(final int[] _srcIdx, final double _xDest, final double _yDest) {
int nb = 0;
final int[] res = new int[4];
@@ -146,8 +141,8 @@
}
@Override
- public EfData getInitData(final int _varIdx, final int _timeIdx) {
- final H2dVariableType dest = (H2dVariableType) intVar_.get(_varIdx);
+ public EfData getInitData(final H2dVariableType dest, final int _timeIdx) {
+ // final H2dVariableType dest = (H2dVariableType) intVar_.get(_varIdx);
try {
// pas de temps identique
@@ -175,8 +170,8 @@
}
@Override
- public double getInitData(final int _varIdx, final int _timeIdx, final int _ptIdx) throws IOException {
- final H2dVariableType dest = (H2dVariableType) intVar_.get(_varIdx);
+ public double getInitData(final H2dVariableType dest, final int _timeIdx, final int _ptIdx) throws IOException {
+ // final H2dVariableType dest = (H2dVariableType) intVar_.get(_varIdx);
try {
// pas de temps identique
@@ -252,7 +247,7 @@
if (nearestPt.length == 1) { return srcInit_.getData(_varIdx, _srcTimeIdx, nearestPt[0]); }
double num = 0;
double den = 0;
- final boolean isSrcRubar = srcInit_.isRubar();
+ final boolean isSrcRubar = srcInit_.isElementVar(_varIdx);
final double ptX = destIsRubar_ ? target_.getCentreXElement(_ptIdx) : target_.getPtX(_ptIdx);
final double ptY = destIsRubar_ ? target_.getCentreYElement(_ptIdx) : target_.getPtY(_ptIdx);
final EfGridInterface srcGrid = srcInit_.getGrid();
@@ -349,8 +344,7 @@
* plus proches dans la source initiale
*/
@Override
- public boolean openDatas(final ProgressionInterface _int, final CtuluAnalyze _analyze, final ObjectContainer _db,
- final CtuluUI _ui) {
+ public boolean openDatas(final ProgressionInterface _int, final CtuluAnalyze _analyze, final CtuluUI _ui) {
if (!isGridEquals_ || (srcInit_.isRubar() != destIsRubar_)) {
final EfInterpolationGridSupportAdapter srcInterpol = srcInit_.isRubar() ? (EfInterpolationGridSupportAdapter) new EfInterpolationGridSupportAdapter.Mesh(
srcInit_.getGrid())
@@ -412,8 +406,6 @@
return null;
}
-
-
public Collection<File> getFiles() {
return this.srcInit_.getFiles();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2010-01-03 21:48:45
|
Revision: 5587
http://fudaa.svn.sourceforge.net/fudaa/?rev=5587&view=rev
Author: deniger
Date: 2010-01-03 21:48:34 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSource.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java 2010-01-03 21:48:10 UTC (rev 5586)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java 2010-01-03 21:48:34 UTC (rev 5587)
@@ -45,7 +45,6 @@
*/
public JXTreeTable listProjets_;
-
TreeTableModelGraphe modelList_;
BuButton boutonAjoutSrc_ = new BuButton("Ajouter un projet", BuResource.BU.getIcon("crystal_ouvrirprojet"));
@@ -64,32 +63,30 @@
projet_.getObservable().addObserver(this);
// --creation de la liste graphique des projets --//
- modelList_ = constructStructureModel() ;//new TreeTableModelGraphe();
+ modelList_ = constructStructureModel();// new TreeTableModelGraphe();
listProjets_ = new JXTreeTable(modelList_);
-
listProjets_.setBorder(BorderFactory.createEtchedBorder());
-
- //-- listener du tree --//
+ // -- listener du tree --//
listProjets_.addMouseListener(new MouseAdapter() {
- @Override
- public void mousePressed(final MouseEvent e) {
- if (e.isPopupTrigger() && e.getClickCount() == 1) {
- affichePopupNode(e.getX(), e.getY());
+ @Override
+ public void mousePressed(final MouseEvent e) {
+ if (e.isPopupTrigger() && e.getClickCount() == 1) {
+ affichePopupNode(e.getX(), e.getY());
- }
}
+ }
- @Override
- public void mouseReleased(final MouseEvent e) {
- if (e.isPopupTrigger() && e.getClickCount() == 1) {
- affichePopupNode(e.getX(), e.getY());
- }
+ @Override
+ public void mouseReleased(final MouseEvent e) {
+ if (e.isPopupTrigger() && e.getClickCount() == 1) {
+ affichePopupNode(e.getX(), e.getY());
}
- });
-
+ }
+ });
+
setTitle(TrResource.getS("Gestion Multi-Sources"));
setLayout(new BorderLayout());
// Box centrePanel = Box.createHorizontalBox();
@@ -137,185 +134,162 @@
menu.add(fermer);
}
-
/**
* Affiche le popup correspondant au fichier cliqu\xE9
+ *
* @param x
* @param y
*/
public void affichePopupNode(final int x, final int y) {
- // Get the tree element under the mouse
- final TreePath clickedElement = listProjets_.getPathForLocation(x, y);
+ // Get the tree element under the mouse
+ final TreePath clickedElement = listProjets_.getPathForLocation(x, y);
-
- MutableTreeTableNode treeNode = null;
- if (clickedElement != null) treeNode = (MutableTreeTableNode) clickedElement.getLastPathComponent();
+ MutableTreeTableNode treeNode = null;
+ if (clickedElement != null) treeNode = (MutableTreeTableNode) clickedElement.getLastPathComponent();
- if (treeNode != null) {
+ if (treeNode != null) {
- // -- recuperation du node associe --//
- TrPostSource src=null;
- if(treeNode.getUserObject() instanceof TrPostSource)
- src=(TrPostSource) treeNode.getUserObject();
- else
- if(treeNode.getUserObject() instanceof File){
- if(treeNode.getParent().getUserObject() instanceof TrPostSource)
- src=(TrPostSource) treeNode.getParent().getUserObject();
- }
- if(src==null)
- return;
-
-
+ // -- recuperation du node associe --//
+ TrPostSource src = null;
+ if (treeNode.getUserObject() instanceof TrPostSource) src = (TrPostSource) treeNode.getUserObject();
+ else if (treeNode.getUserObject() instanceof File) {
+ if (treeNode.getParent().getUserObject() instanceof TrPostSource) src = (TrPostSource) treeNode.getParent()
+ .getUserObject();
+ }
+ if (src == null) return;
- // -- recuperation de la popup du node et ajout a l element du tree a al
- // bonne location--//
- JPopupMenu popup = null;
+ // -- recuperation de la popup du node et ajout a l element du tree a al
+ // bonne location--//
+ JPopupMenu popup = null;
- popup=new JPopupMenu();
-
- int indexSource=projet_.listeSrc_.indexOf(src);
-
- for(BuMenuItem item:this.projet_.getlisteSousMenuProjets_().get(indexSource)){
- if(item.getId()==null)
- item.setId(CtuluLibGenerator.getInstance().deliverUniqueStringId());
- popup.add(new BuMenuItem(item));
- }
-
- //-- affichage au bon endroit --//
- popup.show(listProjets_, x, y);
+ popup = new JPopupMenu();
-
+ int indexSource = projet_.getSources().getIndexOf(src);
- }
+ for (BuMenuItem item : this.projet_.getlisteSousMenuProjets_().get(indexSource)) {
+ if (item.getId() == null) item.setId(CtuluLibGenerator.getInstance().deliverUniqueStringId());
+ popup.add(new BuMenuItem(item));
+ }
- }
-
-
- public void valueChanged(final ListSelectionEvent e) {
+ // -- affichage au bon endroit --//
+ popup.show(listProjets_, x, y);
-
+ }
}
+ public void valueChanged(final ListSelectionEvent e) {
+
+ }
+
/**
* Construit le model du tableau.
+ *
* @return
*/
public TreeTableModelGraphe constructStructureModel() {
- DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode("Gestion multi-fichiers");
+ DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode("Gestion multi-fichiers");
- for (int i = 0; i <projet_.listeSrc_.size(); i++) {
- TrPostSource src= projet_.listeSrc_.get(i);
-
-
- DefaultMutableTreeTableNode nodeCalque = new DefaultMutableTreeTableNode(src);
- root.add(nodeCalque);
-
- //- ajout des fichiers associ\xE9s --//
- for(File f:src.getFiles())
- nodeCalque.add(new DefaultMutableTreeTableNode(f));
- }
- TreeTableModelGraphe model = new TreeTableModelGraphe(projet_);
- model.setRoot(root);
+ for (int i = 0; i < projet_.getSources().getSrcSize(); i++) {
+ TrPostSource src = projet_.getSource(i);
- return model;
- }
-
-
+ DefaultMutableTreeTableNode nodeCalque = new DefaultMutableTreeTableNode(src);
+ root.add(nodeCalque);
+
+ // - ajout des fichiers associ\xE9s --//
+ for (File f : src.getFiles())
+ nodeCalque.add(new DefaultMutableTreeTableNode(f));
+ }
+ TreeTableModelGraphe model = new TreeTableModelGraphe(projet_);
+ model.setRoot(root);
+
+ return model;
+ }
+
public class TreeTableModelGraphe extends DefaultTreeTableModel {
- String[] titre_;
- TrPostProjet projet;
-
-
+ String[] titre_;
+ TrPostProjet projet;
- public Class<?> getColumnClass(final int columnIndex) {
+ public Class<?> getColumnClass(final int columnIndex) {
- switch (columnIndex) {
- case 0:
- return Integer.class;
- case 1:
- return String.class;
- }
- return null;
- }
-
- // -- data correspondant au x donn\xE9 --//
- double[] dataY_ = new double[0];
+ switch (columnIndex) {
+ case 0:
+ return Integer.class;
+ case 1:
+ return String.class;
+ }
+ return null;
+ }
- public TreeTableModelGraphe(TrPostProjet p) {
- String[] val = {"Fichiers", "Date modification" };
- titre_ = val;
- projet=p;
- }
+ // -- data correspondant au x donn\xE9 --//
+ double[] dataY_ = new double[0];
- public int getColumnCount() {
+ public TreeTableModelGraphe(TrPostProjet p) {
+ String[] val = { "Fichiers", "Date modification" };
+ titre_ = val;
+ projet = p;
+ }
- return titre_.length;
- }
+ public int getColumnCount() {
- @Override
- public boolean isCellEditable(Object _node, int _column) {
- return false;
- }
+ return titre_.length;
+ }
- public String getColumnName(int _columnIndex) {
- return titre_[_columnIndex];
- }
+ @Override
+ public boolean isCellEditable(Object _node, int _column) {
+ return false;
+ }
- public int getRowCount() {
- return projet.listeSrc_.size();
+ public String getColumnName(int _columnIndex) {
+ return titre_[_columnIndex];
+ }
- }
+ public int getRowCount() {
+ return projet.getSources().getSrcSize();
- public Object getValueAt(Object node, int column) {
- Object res = new DefaultMutableTreeTableNode("n/a");
- if (node instanceof DefaultMutableTreeTableNode) {
- DefaultMutableTreeTableNode defNode = (DefaultMutableTreeTableNode) node;
- if (defNode.getUserObject() instanceof TrPostSource) {
- TrPostSource src=(TrPostSource)defNode.getUserObject();
- String label=(getRoot().getIndex(defNode)+1)+". "+ projet_.formatName(src.getTitle());
- if (column == 0)
- return label;
- else
- return "";
- } else if (defNode.getUserObject() instanceof File) {
- File fichier = (File) defNode.getUserObject();
-
- if (column == 0)
- return fichier.getAbsolutePath();
- else if (column == 1)
- return new Date(fichier.lastModified());
- else
- return "";
- }
- else
- return "";
- }
- return res;
- }
+ }
- public DefaultMutableTreeTableNode getTreeNode(int i) {
- return (DefaultMutableTreeTableNode) getRoot().getChildAt(i);
-
- }
-
- public void reload() {
-
- this.modelSupport.fireTreeStructureChanged(listProjets_.getPathForRow(0));
+ public Object getValueAt(Object node, int column) {
+ Object res = new DefaultMutableTreeTableNode("n/a");
+ if (node instanceof DefaultMutableTreeTableNode) {
+ DefaultMutableTreeTableNode defNode = (DefaultMutableTreeTableNode) node;
+ if (defNode.getUserObject() instanceof TrPostSource) {
+ TrPostSource src = (TrPostSource) defNode.getUserObject();
+ String label = (getRoot().getIndex(defNode) + 1) + ". " + projet_.formatName(src.getTitle());
+ if (column == 0) return label;
+ else return "";
+ } else if (defNode.getUserObject() instanceof File) {
+ File fichier = (File) defNode.getUserObject();
- }
-
-
- }
-
+ if (column == 0) return fichier.getAbsolutePath();
+ else if (column == 1) return new Date(fichier.lastModified());
+ else return "";
+ } else return "";
+ }
+ return res;
+ }
+
+ public DefaultMutableTreeTableNode getTreeNode(int i) {
+ return (DefaultMutableTreeTableNode) getRoot().getChildAt(i);
+
+ }
+
+ public void reload() {
+
+ this.modelSupport.fireTreeStructureChanged(listProjets_.getPathForRow(0));
+
+ }
+
+ }
+
public void update(final Observable o, final Object arg) {
// mise a jour de la liste
- if(listProjets_==null)return;
- listProjets_.setTreeTableModel(constructStructureModel());
- listProjets_.expandAll();
-// if(listProjets_.getModel() instanceof TreeTableModelGraphe)
-// ((TreeTableModelGraphe)listProjets_.getModel()).reload();
+ if (listProjets_ == null) return;
+ listProjets_.setTreeTableModel(constructStructureModel());
+ listProjets_.expandAll();
+ // if(listProjets_.getModel() instanceof TreeTableModelGraphe)
+ // ((TreeTableModelGraphe)listProjets_.getModel()).reload();
// selection par defaut de la premiere simul
listProjets_.clearSelection();
this.revalidate();
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSource.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSource.java 2010-01-03 21:48:10 UTC (rev 5586)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSource.java 2010-01-03 21:48:34 UTC (rev 5587)
@@ -14,7 +14,6 @@
import javax.swing.ListModel;
-import com.db4o.ObjectContainer;
import com.memoire.bu.BuMenu;
import org.fudaa.ctulu.*;
@@ -62,12 +61,6 @@
void buildDefaultVarUpdateLists();
- // TrPostInspectorReader createWatcher(TrPostProjet _proj, boolean _auto);
-
- // boolean isInspectable();
-
- // void setInspected(boolean _b);
-
boolean isInspected();
/**
@@ -123,7 +116,7 @@
* @param _int la progression
* @return true si la bd a ete modifiee
*/
- boolean openDatas(ProgressionInterface _int, CtuluAnalyze _analyze, ObjectContainer _db, CtuluUI _ui);
+ boolean openDatas(ProgressionInterface _int, CtuluAnalyze _analyze, CtuluUI _ui);
/**
* @param _variable la variable voulu
@@ -244,6 +237,7 @@
* @return true si creee par l'utilisateur
*/
boolean isUserCreatedVar(H2dVariableType _t);
+
/**
* @param _t la variable a tester
* @return true si definie dans les sources du projet
@@ -329,8 +323,7 @@
* @param _d
*/
void setDefaultPaletteMinPalette(H2dVariableType[] _v, boolean[] _actived, double[] _d);
-
-
- public void fillWithSourceCreationInfo(String _pref, Map _table) ;
-
+
+ public void fillWithSourceCreationInfo(String _pref, Map _table);
+
}
\ No newline at end of file
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2010-01-03 21:48:10 UTC (rev 5586)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2010-01-03 21:48:34 UTC (rev 5587)
@@ -78,10 +78,10 @@
import org.fudaa.fudaa.tr.common.TrResource;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreated;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedDefault;
-import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedExpr;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedFroud;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedMoins;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedPlus;
+import org.fudaa.fudaa.tr.post.data.TrPostDataHelper;
import org.fudaa.fudaa.tr.post.data.TrPostDataInfoDoc;
import org.fudaa.fudaa.tr.post.data.TrPostDataListener;
import org.fudaa.fudaa.tr.post.data.TrPostDataMinMaxGlobalItem;
@@ -169,7 +169,7 @@
if (Fu.DEBUG && FuLog.isDebug()) {
FuLog.debug("TRP: froud changed");
}
- fireVariableChanged(fr, fr, true, false, TrPostDataCreatedExpr.getAllVarDependingOn(fr,
+ fireVariableChanged(fr, fr, true, false, TrPostDataHelper.getAllVarDependingOn(fr,
TrPostSourceAbstract.this));
}
if (varUserCreateData_ != null) {
@@ -183,7 +183,7 @@
FuLog.debug("TRP: ->" + e.getKey() + " changed");
}
final H2dVariableType vChanged = (H2dVariableType) e.getKey();
- fireVariableChanged(vChanged, vChanged, true, false, TrPostDataCreatedExpr.getAllVarDependingOn(fr,
+ fireVariableChanged(vChanged, vChanged, true, false, TrPostDataHelper.getAllVarDependingOn(fr,
TrPostSourceAbstract.this));
}
}
@@ -1161,49 +1161,19 @@
return -1;
}
- public boolean openDatas(final ProgressionInterface _int, final CtuluAnalyze _analyze, final ObjectContainer _db,
- final CtuluUI _ui) {
- if (_db == null) { return false; }
+ public boolean openDatas(final ProgressionInterface _int, final CtuluAnalyze _analyze, final CtuluUI _ui) {
if (tmpContainer_ != null) {
FuLog.error("the database is already opened", new Throwable());
}
FudaaSaveLib.configureDb4o();
initializeTempDb(_analyze);
- info_ = (TrPostDataInfoDoc) FudaaSaveLib.getUniqueData(TrPostDataInfoDoc.class, _db);
// c'est la premiere fois que l'on ouvre le fichier de post.
// on enregistre les infos
- if (info_ == null) {
- CtuluLibMessage.info("file first open session");
- info_ = new TrPostDataInfoDoc();
- _db.close();
- return true;
- }
- boolean isDbUptodate = false;
- // Le fichier de post a ete modifie: il faut tout effacer
- // if (!readMinMaxSave() || info_.getLastModifiedTime() < f_.lastModified()) {
- // if (Fu.DEBUG && FuLog.isDebug()) {
- // FuLog.warning("FTR: the file " + f_.getName() + " is modified since last opening");
- // FuLog.warning("FTR: can read Min Max " + readMinMaxSave());
- // }
- // isDbUptodate = false;
- // info_.setFile(f_);
- // // getBdTemp().set(info);
- // } else if (tmpContainer_ != null) {
- // final Query q = _db.query();
- // q.constrain(TrPostDataMinMaxGlobalItem.class);
- // for (final ObjectSet s = q.execute(); s.hasNext();) {
- // tmpContainer_.set(s.next());
- // }
- //
- // }
- TrPostUserVariableSaver.loadVars(this, _analyze, _db, _int, _ui);
- TrPostTimeModelSaver.restore(this, _db, _int, isDbUptodate);
- afterOpenDatas(_int, _analyze);
- _db.close();
- return !isDbUptodate;
+
+ return true;
}
protected boolean readMinMaxSave() {
@@ -1383,7 +1353,7 @@
changeUserVar(_old, _new);
}
- fireVariableChanged(_old, _new, isFormuleChanged, false, TrPostDataCreatedExpr.getAllVarDependingOn(_old,
+ fireVariableChanged(_old, _new, isFormuleChanged, false, TrPostDataHelper.getAllVarDependingOn(_old,
TrPostSourceAbstract.this));
if (_cmd != null) {
_cmd.addCmd(new CtuluCommand() {
@@ -1421,8 +1391,6 @@
// }
public String getId() {
- // if(id_==null)
- // id_=generateId();
return id_;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2010-01-03 21:49:31
|
Revision: 5589
http://fudaa.svn.sourceforge.net/fudaa/?rev=5589&view=rev
Author: deniger
Date: 2010-01-03 21:49:25 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2010-01-03 21:49:01 UTC (rev 5588)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2010-01-03 21:49:25 UTC (rev 5589)
@@ -91,7 +91,7 @@
final TrPostCourbeModel modelEvol=(TrPostCourbeModel)selectedComponent.getModel();
//-- creation d'un lister de fichier source --//
- final String[] values = impl_.c_.formattageDonnees(false);
+ final String[] values = impl_.c_.getListSources(false);
final int selectedSource = selectSource(values, (String) getValue(Action.NAME), impl_.getFrame());
if(selectedSource !=-1)
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2010-01-03 21:49:01 UTC (rev 5588)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2010-01-03 21:49:25 UTC (rev 5589)
@@ -451,7 +451,7 @@
TrPostSource src =null;
if (projet != null){
// -- etape 1: recherche du source qui contient le path donn\xE9 --//
- src = projet.findSourceById(idSource);
+ src = projet.getSources().findSourceById(idSource);
if(src!=null)
this.source_=src;
else{
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2010-01-03 21:49:01 UTC (rev 5588)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2010-01-03 21:49:25 UTC (rev 5589)
@@ -634,7 +634,7 @@
// -- recuperation du source voulu --//
// -- recuperation de la liste des src sous forme de liste --//
- final String[] values = formattageDonnees();
+ final String[] values = projet_.getListSources();
// -- ouverture du chooser --//
final BuDialogChoice chooser = new BuDialogChoice(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(),
@@ -696,21 +696,6 @@
return null;
}
- String[] formattageDonnees() {
-
- final String[] listeSimul = new String[projet_.listeSrc_.size()];
- int cpt = 0;
- for (final Iterator<TrPostSource> it = projet_.listeSrc_.iterator(); it.hasNext();) {
-
- final TrPostSource src = it.next();
-
- // --ajout dans la liste des titres --//
- listeSimul[cpt++] = projet_.formatInfoSource(src);
- }
-
- return listeSimul;
- }
-
/**
* Determine les courbes qui correspondent a la variable et les stocke dans la liste _l.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2010-01-03 21:49:12
|
Revision: 5588
http://fudaa.svn.sourceforge.net/fudaa/?rev=5588&view=rev
Author: deniger
Date: 2010-01-03 21:49:01 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaultSaver.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjetChooser.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaultSaver.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaultSaver.java 2010-01-03 21:48:34 UTC (rev 5587)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaultSaver.java 2010-01-03 21:49:01 UTC (rev 5588)
@@ -6,6 +6,7 @@
import java.util.Map;
+import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.ctulu.CtuluUI;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreated;
@@ -28,7 +29,7 @@
vy_ = _defaut.getVy().getShortName();
}
- public TrPostDataCreated restore(H2dVariableType _newVar, TrPostSource _src, CtuluUI _ui, Map _shortName) {
+ public TrPostDataCreated restore(H2dVariableType _newVar, TrPostSource _src, CtuluUI _ui, Map _shortName, TrPostSourcesManager srcMng, CtuluAnalyze log) {
H2dVariableType var = _newVar;
H2dVariableType varX = (H2dVariableType) _shortName.get(vx_);
H2dVariableType varY = (H2dVariableType) _shortName.get(vy_);
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java 2010-01-03 21:48:34 UTC (rev 5587)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java 2010-01-03 21:49:01 UTC (rev 5588)
@@ -17,7 +17,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
@@ -101,105 +100,79 @@
*/
public class TrPostProjet implements ActionListener {
- /**
- * Manager de sauvegarder/charghement des donn\xE9es
- */
- private TrPostPersistenceManager manager_;
+ class ModifyObserver implements Observer {
- public TrPostPersistenceManager getManager() {
- if (manager_ == null) manager_ = new TrPostPersistenceManager(this);
+ private boolean isModified_;
- return manager_;
- }
+ protected void clearModified() {
+ isModified_ = false;
+ updateFrameState();
+ }
- private class TimeContentUpdater implements ListDataListener {
+ public boolean isModified() {
+ return isModified_;
+ }
- protected TimeContentUpdater() {
-
+ public void setModified() {
+ isModified_ = true;
+ updateFrameState();
}
- 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 update(final Observable _o, final Object _arg) {
+ setModified();
}
- public void contentsChanged(final ListDataEvent _event) {
- updateAll();
+ protected void updateFrameState() {
+ if (impl_ != null) {
+ impl_.setEnabledForAction("ENREGISTRER", isModified_);
+ impl_.setEnabledForAction("ENREGISTRERSOUS", isModified_);
+ changedMainFrameState();
+ }
}
- public void intervalAdded(final ListDataEvent _event) {
- updateAll();
+ }
+
+ /**
+ * 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();
}
- public void intervalRemoved(final ListDataEvent _event) {
- updateAll();
+ @Override
+ public void notifyObservers(final Object arg) {
+ this.setChanged();
+ super.notifyObservers(arg);
}
+
}
- class ModifyObserver implements Observer {
+ private class TimeContentUpdater implements ListDataListener {
- private boolean isModified_;
+ protected TimeContentUpdater() {
- protected void clearModified() {
- isModified_ = false;
- updateFrameState();
}
- protected void updateFrameState() {
- if (impl_ != null) {
- impl_.setEnabledForAction("ENREGISTRER", isModified_);
- impl_.setEnabledForAction("ENREGISTRERSOUS", isModified_);
- changedMainFrameState();
- }
+ public void contentsChanged(final ListDataEvent _event) {
+ updateAll();
}
- public boolean isModified() {
- return isModified_;
+ public void intervalAdded(final ListDataEvent _event) {
+ updateAll();
}
- public void setModified() {
- isModified_ = true;
- updateFrameState();
+ public void intervalRemoved(final ListDataEvent _event) {
+ updateAll();
}
- public void update(final Observable _o, final Object _arg) {
- setModified();
+ protected void updateAll() {
+ setProjectModified();
}
-
}
class VariableListener implements TrPostDataListener {
@@ -264,6 +237,19 @@
}
+ /**
+ * Manager de sauvegarder/charghement des donn\xE9es
+ */
+ private TrPostPersistenceManager manager_;
+
+ private final TrPostSourcesManager sources_ = new TrPostSourcesManager();
+
+ /**
+ * liste des noeuds pour gerer le cut/copy/paste avec en + le undo/redo
+ */
+ // liste des noeuds copies
+ Set<EbliNode> nodesCopyied = null;
+
// transient TrPostFille fille_;
//
// /**
@@ -274,14 +260,8 @@
// 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;
-
/**
* internalframe qui gere les multiProjets
*/
@@ -291,45 +271,13 @@
* 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_;
+ BuMenu menuLayout_ = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER");
+ List<BuMenu> listeMenuProjets_;;
List<ArrayList<BuMenuItem>> listeSousMenuProjets_;
- /**
- * Observable custom reserv\xE9 aux modifs apport\xE9es a la liste des src.
- *
- * @author Adrien Hadoux
- */
- class observableSupport extends Observable {
- @Override
- public void notifyObservers() {
- this.setChanged();
- super.notifyObservers();
- }
-
- @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();
-
- getObservable().notifyObservers();
-
- }
-
transient int idxFilleG_;
public transient TrPostCommonImplementation impl_;
@@ -343,7 +291,7 @@
/**
* liste des sources pour le multiProjet.
*/
- public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>();
+ // public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>();
transient TimeContentUpdater timeUpdater_;
@@ -353,7 +301,9 @@
}
public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) {
- if (_src != null) ajouterSource(_src);
+ if (_src != null) {
+ ajouterSource(_src);
+ }
// -- creation de la frame de gestion multi projet --//
filleProjetctManager_ = new TrPostProjetsManagerFille(this);
@@ -362,561 +312,115 @@
}
/**
- * 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
+ * performed d action pour toutes les simulations charg\xE9es. compl\xE9xit\xE9 de l algo: lin\xE9aire Cette methode est robuste
+ * en cas de suppression de sources et donc de menus.
*/
- public void ajouterSource(final TrPostSource _src) {
- if (!EventQueue.isDispatchThread()) {
- EventQueue.invokeLater(new Runnable() {
+ public void actionPerformed(final ActionEvent _event) {
+ final String commandeBrute = _event.getActionCommand();
- public void run() {
- ajouterSource(_src, null);
- }
- });
- } else ajouterSource(_src, null);
+ // i indique le numero de la simulation
+ for (int i = 0; i < getlisteSousMenuProjets_().size(); i++) {
- }
+ // --recuperation de la liste des sousmenu de la simulation i --//
+ final ArrayList<BuMenuItem> listeSousMenus = getlisteSousMenuProjets_().get(i);
+ final TrPostSource source = getSource(i);
+ // -- on recherche si l action provient d un des fils --//
+ for (int j = 0; j < listeSousMenus.size(); j++) {
+ final BuMenuItem item = listeSousMenus.get(j);
- public void ajouterSource(final TrPostSource _src, String title) {
- _src.addVariableListener(new VariableListener());
- if (_src.getFiles() == null || !isOneSourceLoaded(_src.getFiles())) {
- listeSrc_.add(_src);
- _src.buildDefaultVarUpdateLists();
+ // -- on essaie de matcher a la fois la commande et l objet pour
+ // savoir si c est le bon --//
+ // -- si une clause du if est v\xE9rifi\xE9 alors on gere la
+ // simulation i
+ // --//
+ if ("COMPUTE_EXTREMA".equals(commandeBrute) && item.equals(_event.getSource())) {
- // -- ajout du menu correspondant uniquement a partir de la 2eme
- // --//
- // if (listeSrc_.size()>1 || (menuPost_!=null &&))
- construitMenuPostSpecifiqueSource(_src, title);
+ FuLog.debug("je fais partie de la simulation " + i);
+ showExtremum(i);
+ } else if ("PALETTE_DEFAULT".equals(commandeBrute) && item.equals(_event.getSource())) {
+ updatePaletteMin(source);
+ } else if ("TIME_FORMAT".equals(commandeBrute) && item.equals(_event.getSource())) {
+ TrPostTimeFmtPanel.updateTimeStepFmt(source, getImpl().getFrame());
+ } else {
- } else {
- // -- messqge d erreur: le fichier est deja ouvert --//
- new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), "Le fichier est deja ouvert.").activate();
-
- }
- // -- notify aux observers --//
- this.notifyObservers();
-
- }
-
- 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.
- *
- * @param _file : path absolu du fichier
- * @return
- */
- public TrPostSource findSource(final File _file) {
-
- for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) {
- final TrPostSource src = it.next();
- 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;
- boolean sourceGetAllFiles = true;
- for (File file : files) {
- if (!_in.isOpened(file)) sourceGetAllFiles = false;;
-
- }
- return sourceGetAllFiles;
-
- }
-
- /**
- * Retourne la source asscoi\xE9 a l id.
- *
- * @param _id
- * @return
- */
- public TrPostSource findSourceById(final String _id) {
-
- for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) {
- final TrPostSource src = it.next();
- if (src.getId().equals(_id)) return src;
- }
-
- return null;
- }
-
- /**
- * Retourne toutes les sources qui ne sont pas des composites
- *
- * @return
- */
- public List<TrPostSource> getAllClassicalSource() {
- List<TrPostSource> res = new ArrayList<TrPostSource>();
- for (TrPostSource src : listeSrc_) {
- if (!isAsuiteCalcul(src)) res.add(src);
- }
- return res;
- }
-
- /**
- * Retourne toutes les sources qui sont des composites
- *
- * @return
- */
- public List<TrPostSourceFromReader> getAllCCompositeSource() {
- List<TrPostSourceFromReader> res = new ArrayList<TrPostSourceFromReader>();
- for (TrPostSource src : listeSrc_) {
- if (isAsuiteCalcul(src)) res.add((TrPostSourceFromReader) src);
- }
- return res;
- }
-
- 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 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
- // *
- // * @param _file : path absolu du fichier
- // * @return
- // */
- // public boolean changeSource(final TrPostSource _src) {
- //
- // src_ = _src;
- //
- // return true;
- // }
-
- /**
- * Methode de suppression de la source
- *
- * @param src : TrPostSource, retourne true si la suppression a bien ete effectuee.
- */
- public boolean removeSource(final TrPostSource src, final int n) {
-
- if (isOneSourceLoaded(src.getFiles())) {
- listeSrc_.remove(src);
-
- // --recuperation du menu simul --//
- final BuMenu menuSimul = getlisteMenuProjets_().get(n);
-
- // --on retire les menus correspondants --//
- // for (int i = 0; i < listeSousMenuProjets_.get(n).size(); i++) {
- // BuMenuItem item = listeSousMenuProjets_.get(n).get(i);
- // menuSimul.remove(item);
- // }
-
- // -- on retire le menuSimul de la liste --//
- menuPost_.remove(menuSimul);
-
- // -- on retire de la liste des menus le menusimul et la liste des
- // sous
- // menus --//
- getlisteMenuProjets_().remove(n);
- getlisteSousMenuProjets_().remove(n);
-
- // -- mise a jour de la barre des menus --//
- impl_.getMainMenuBar().revalidate();
-
- // -- on met a jour la scene en enlevant tous les objets reli\xE9s \xE0
- // cette source --//
- for (TrPostLayoutFille frame : impl_.getAllLayoutFille()) {
- frame.getScene().removeAllWidgetLinkedToSrc(src);
+ if ("VARIABLES".equals(commandeBrute) && item.equals(_event.getSource())) {
+ TrPostDataCreationPanel.activeVarFrame(this, source, getImpl());
+ } else if ("EXPORTDATA".equals(commandeBrute) && item.equals(_event.getSource())) {
+ TrPostVisuPanel.startExport(getImpl(), source, null, null);
+ } else if ("COMPARE".equals(commandeBrute) && item.equals(_event.getSource())) {
+ compareWith(source);
+ }
+ }
}
-
- return true;
- } else {
- // -- messqge d erreur: le fichier est deja ouvert --//
- new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(),
- "Impossible de supprimer ce fichier de la liste.").activate();
-
- return false;
}
-
}
/**
- * methode qui formatte les infos de la source
- *
- * @param _src
- * @return
+ * @param _impl l'implementation parente
*/
- public String formatInfoSource(final TrPostSource _src) {
- // --ajout dans la liste des titres --//
- Collection<File> files = _src.getFiles();
- if (!isAsuiteCalcul(_src)) return formatName(_src.getTitle()) + " | Fichier: "
- + formatFichier(files.iterator().next());
- else {
+ public void active(final TrPostCommonImplementation _impl) {
+ impl_ = _impl;
+ // pour mettre a jour le receveur d'evt
+ impl_.getUndoCmdListener();
- // String listeFiles="";
- // for(File f:files)
- // listeFiles+="| "+f.getName();
- return _src.getTitle();// + listeFiles;
+ modifyState_.updateFrameState();
+ if (isModified()) {
+ _impl.setMainMessageAndClear(TrResource
+ .getS("Le fichier des r\xE9sultats a \xE9t\xE9 modifi\xE9: la base de donn\xE9es a \xE9t\xE9 mise \xE0 jour"));
}
- }
- public boolean isAsuiteCalcul(final TrPostSource _src) {
- if (_src instanceof TrPostSourceFromReader) {
- TrPostSourceFromReader s = (TrPostSourceFromReader) _src;
- if (s.getReader() instanceof TrPostSourceReaderComposite) return true;
+ // -- lancement du thread d'ouverture du layout avec els widgets calque
+ // TODO pourquoi faire un thread pour des operation graphiques
+ // !!!!!!!!!!!!!!!!!!!!!!!!
+ // new CtuluTaskOperationGUI(impl_,
+ // TrResource.getS("Ouverture vue 2D...")) {
- }
+ final Runnable r = new Runnable() {
- return false;
- }
+ public void run() {
- public String formatFichier(final File file) {
- if (file == null) return "";
- final String nomFichier = file.getAbsolutePath();
- // int position = nomFichier.lastIndexOf(File.separator) + 1;
- // if (position != -1) {
- // nomFichier = nomFichier.substring(position);
- // }
- // position = nomFichier.lastIndexOf(CtuluLibString.DOT);
- // if (position != -1) {
- // nomFichier = nomFichier.substring(0, position);
- // }
- // FuLog.warning("nom du fichier: " + nomFichier);
- return nomFichier;
- }
+ // -- si il y a deja une source de pr\xE9charg\xE9e --//
+ if (sources_.isNotEmpty()) {
+ final TrPostLayoutFille filleLayout = new TrPostLayoutFille(TrPostProjet.this);
+ // -- creation d une instance de la legende du calque --//
+ final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter(filleLayout.getScene(), null);
- /**
- * formatte le titre
- *
- * @param file
- * @return
- */
- public String formatName(String title) {
- // --suppression des trop long espaces du titre --//
+ final TrPostSource source = sources_.getSource(0);
+ final TrPostVisuPanel pnVisu = source.buildVisuPanel(TrPostProjet.this, legendeCalque);
- title = title.replaceAll(" ", "");
+ // -- 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);
- return title;
- }
+ // -- 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);
- /**
- * Construit un menu specifique a la source choisie. A chaque fois que l on ajoute une source au projet, il faut
- * ajouter un menu sp\xE9cifique.
- *
- * @param _src
- */
- public void construitMenuPostSpecifiqueSource(final TrPostSource _src, String title) {
+ // -- decoration de la fille layout --//
+ filleLayout.setFrameIcon(EbliResource.EBLI.getToolIcon("lissage"));
- BuMenu menuSimul = null;
- if (title == null) menuSimul = new BuMenu((listeSrc_.size()) + ". "
- + formatFichier(_src.getFiles().iterator().next()), "SIMULATION" + (listeSrc_.size()));
- else menuSimul = new BuMenu((listeSrc_.size()) + ". " + _src.getTitle(), "SIMULATION" + (listeSrc_.size()));
- // -- ajout du menu au menu post --//
- getMenuPost().add(menuSimul);
+ filleLayout.setClosable(true);
+ filleLayout.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
- // -- sauvegarde d une trace du menu dans la liste pour une suppression
- // ulterieure --//
- getlisteMenuProjets_().add(menuSimul);
+ // --ajout dans le post de la frame --//
+ impl_.addInternalFrame(filleLayout);
+ }
- // final ArrayList<BuMenuItem> listSousMenus = new
- // ArrayList<BuMenuItem>();
- //
- // final BuIcon ic = BuResource.BU.getIcon("aucun");
- //
- // listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."),
- // "COMPUTE_EXTREMA", ic, TrPostProjet.this));
- // listSousMenus.add(menuSimul.addMenuItem(CtuluLib.getS(
- // "Editer les variables..."), "VARIABLES", ic,
- // TrPostProjet.this));
- // menuSimul.addSeparator();
- // listSousMenus.add(menuSimul.addMenuItem(TrResource.getS(
- // "Palettes de couleurs"), "PALETTE_DEFAULT", ic,
- // TrPostProjet.this));
- // listSousMenus.add(menuSimul.addMenuItem(TrResource.getS(
- // "Formater/modifier les pas de temps..."), "TIME_FORMAT",
- // ic, TrPostProjet.this));
- //
- // menuSimul.addSeparator();
- //
- // listSousMenus.add(menuSimul.addMenuItem(new
- // TrPostBuilderSuiteCalcul.ActionBuildSuite(_src, TrResource
- // .getS("Suite de calcul"), EbliResource.EBLI.getIcon(""),
- // "SUITECALCUL", impl_)));
- // listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer...")
- // , "COMPARE", ic, TrPostProjet.this));
- // listSousMenus.get(listSousMenus.size() - 1).setToolTipText(
- // TrResource.getS("Comparer les r\xE9sultats avec ceux d'un autre projet"))
- // ;
- // listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter...")
- // , "PROJECT", ic, TrPostProjet.this));
- // listSousMenus.get(listSousMenus.size() - 1).setToolTipText(
- // TrResource.getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent"));
- //
- // menuSimul.addSeparator();
- //
- // listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"),
- // "EXPORTDATA", TrPostProjet.this));
- // _src.addSpecificItemInMainMenu(menuSimul, getImpl());
-
- ArrayList<BuMenuItem> listSousMenus = getSousMenusSpecifiqueSource(_src, menuSimul);
- // -- ajout de la sous liste de menus pour la garder en memoire --//
- getlisteSousMenuProjets_().add(listSousMenus);
-
- }
-
- /**
- * Cree la liste des menu items sp\xE9cifiques au fichier source charg\xE9.
- *
- * @param _src
- * @param menuSimul
- * @return
- */
- public ArrayList<BuMenuItem> getSousMenusSpecifiqueSource(final TrPostSource _src, BuMenu menuSimul) {
- final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>();
-
- final BuIcon ic = BuResource.BU.getIcon("aucun");
-
- listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."), "COMPUTE_EXTREMA", ic, TrPostProjet.this));
- BuMenuItem item = new BuMenuItem();
-
- listSousMenus.add(menuSimul.addMenuItem(CtuluLib.getS("Editer les variables..."), "VARIABLES", ic,
- TrPostProjet.this));
- menuSimul.addSeparator();
- listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Palettes de couleurs"), "PALETTE_DEFAULT", ic,
- TrPostProjet.this));
- listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Formater/modifier les pas de temps..."), "TIME_FORMAT",
- ic, TrPostProjet.this));
-
- menuSimul.addSeparator();
-
- listSousMenus.add(menuSimul.addMenuItem(new TrPostBuilderSuiteCalcul.ActionBuildSuite(_src, TrResource
- .getS("Suite de calcul"), EbliResource.EBLI.getIcon(""), "SUITECALCUL", impl_)));
- listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer..."), "COMPARE", ic, TrPostProjet.this));
- listSousMenus.get(listSousMenus.size() - 1).setToolTipText(
- TrResource.getS("Comparer les r\xE9sultats avec ceux d'un autre projet"));
- listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter..."), "PROJECT", ic, TrPostProjet.this));
- listSousMenus.get(listSousMenus.size() - 1).setToolTipText(
- TrResource.getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent"));
-
- menuSimul.addSeparator();
-
- listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"), "EXPORTDATA", TrPostProjet.this));
- _src.addSpecificItemInMainMenu(menuSimul, getImpl());
- return listSousMenus;
- }
-
- public BuMenu getMenuPost() {
- if (menuPost_ == null) menuPost_ = new BuMenu(TrResource.getS("Post"), "POST");
- return menuPost_;
- }
-
- /**
- * Creation par defaut du menu post de l interface. Cette methdoe est appelee une seule dfois au moment de la creation
- * de l impl.
- */
- public void setMenuPost() {
- final BuMenuBar menubar = impl_.getMainMenuBar();
-
- Component comp = null;
- if (getMenuPost().getMenuComponentCount() > 0) {
- comp = getMenuPost().getMenuComponent(0);
- // getMenuPost().remove(0);
- }
-
- getMenuPost().setIcon(null);
- getMenuPost().setName("mnPost");
-
- menubar.add(getMenuPost(), 2);
-
- getMenuPost().addSeparator(TrResource.getS("Layout"));
- // -- ajout de l action de creation du calque --//
- // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this));
- // getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D",
- // BuResource.BU.getIcon("aucun"), TrPostProjet.this);
- getMenuPost().addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME",
- CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() {
-
- public void actionPerformed(final ActionEvent _e) {
- createNewLayoutFrame();
-
- }
- });
- getMenuPost().addMenuItem(TrResource.getS(("Fusionner avec un autre projet POST")), "FUSIONPOST",
- CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() {
-
- public void actionPerformed(final ActionEvent _e) {
- boolean ok = CtuluLibDialog
- .showConfirmation(
- getImpl().getFrame(),
- TrResource.getS("Fusionner avec un autre projet POST"),
- TrResource
- .getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?"),
- TrResource.getS("Sauvegarder et continuer"), TrResource.getS("Annuler"));
- if (!ok) return;
- 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-Sources"));
- item.addActionListener(new ActionListener() {
-
- public void actionPerformed(final ActionEvent e) {
- // -- affichage de la fenetre de gestion multi projet --//
-
- if (!filleProjetctManager_.isVisible()) {
- // filleProjetctManager_.setSize(filleProjetctManager_.getSize
- // ().width,
- // filleProjetctManager_.getSize().height / 2);
-
- impl_.addInternalFrame(filleProjetctManager_);
- } else filleProjetctManager_.moveToFront();
-
+ // -- creation du menu POST de base --//
+ setMenuPost();
+ changedMainFrameState();
}
-
- });
- getMenuPost().add(item);
- getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats");
- // -- init de la liste des menus --//
-
- // -- construction par defaut du premier menu de simulation --//
- // construitMenuPostSpecifiqueSource(getSource(0));
-
- if (comp != null) {
- getMenuPost().add(comp);
- }
-
- }
-
- public List<BuMenu> getlisteMenuProjets_() {
- if (listeMenuProjets_ == null) listeMenuProjets_ = new ArrayList<BuMenu>();
- return listeMenuProjets_;
- }
-
- public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_() {
- if (listeSousMenuProjets_ == null) listeSousMenuProje...
[truncated message content] |
|
From: <de...@us...> - 2010-06-10 21:37:11
|
Revision: 5763
http://fudaa.svn.sourceforge.net/fudaa/?rev=5763&view=rev
Author: deniger
Date: 2010-06-10 21:37:04 +0000 (Thu, 10 Jun 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrEvolutionBuilderFromTree.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelAbstract.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelEltDataAdapter.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostAnalyze.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostBuilderSuiteCalcul.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterHauteurPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterLayer.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheLayer.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheModel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostInspector.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSource.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceBuilder.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparator.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceDefault.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceFromReader.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceOneTimeStep.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubarZFN.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceSerafin.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceTelemac3D.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrEvolutionBuilderFromTree.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrEvolutionBuilderFromTree.java 2010-06-10 16:39:11 UTC (rev 5762)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrEvolutionBuilderFromTree.java 2010-06-10 21:37:04 UTC (rev 5763)
@@ -19,235 +19,211 @@
import org.fudaa.fudaa.tr.TrPostImplementation;
import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardCourbeTemporelle.ModelListePoints;
-
-
/**
- * Construit un composant arbre g\xE9n\xE9rique qui permet de r\xE9cup\xE9rer les points des calques d'une vue 2d.
- * Utiliser surtout pour l'assistant de cr\xE9ation d'\xE9volutions temporelles.
+ * Construit un composant arbre g\xE9n\xE9rique qui permet de r\xE9cup\xE9rer les points des calques d'une vue 2d. Utiliser surtout
+ * pour l'assistant de cr\xE9ation d'\xE9volutions temporelles.
+ *
* @author Adrien Hadoux
- *
*/
public abstract class TrEvolutionBuilderFromTree {
+ public static class PostEvolutionTemporelles extends TrEvolutionBuilderFromTree {
+ /**
+ * le modele du tableau a mettre a jour
+ */
+ ModelListePoints modeletableau_;
+ /**
+ * la liste des points. Peut etre des points reels mais aussi interpol\xE9s
+ */
+ @SuppressWarnings("unchecked")
+ List listePoints_;
+ public PostEvolutionTemporelles(TrPostVisuPanel panel, ModelListePoints modeletableau, List liste) {
+ super(panel);
+ modeletableau_ = modeletableau;
+ listePoints_ = liste;
- public static class PostEvolutionTemporelles extends TrEvolutionBuilderFromTree{
- /**
- * le modele du tableau a mettre a jour
- */
- ModelListePoints modeletableau_;
- /**
- * la liste des points. Peut etre des points reels mais aussi interpol\xE9s
- */
- @SuppressWarnings("unchecked")
- List listePoints_;
+ }
+ protected void apply() {
- public PostEvolutionTemporelles(TrPostVisuPanel panel, ModelListePoints modeletableau, List liste){
- super(panel);
- modeletableau_= modeletableau;
- listePoints_=liste;
-
- }
+ // -- mise a jour des donn\xE9es du tableau--//
+ modeletableau_.fireTableDataChanged();
+ }
- protected void apply(){
+ public boolean ajouterSelection(ZCalqueMultiPoint cq) {
+ boolean modifierStructure = false;
- //-- mise a jour des donn\xE9es du tableau--//
- modeletableau_.fireTableDataChanged();
- }
+ TrPostInterpolatePoint newPoint = null;
+ if (cq == null || cq.modeleDonnees() == null) return false;
- public boolean ajouterSelection(ZCalqueMultiPoint cq){
- boolean modifierStructure=false;
+ int nb = cq.modeleDonnees().getNombre();
- TrPostInterpolatePoint newPoint=null;
- if(cq==null || cq.modeleDonnees()==null)
- return false;
+ for (int i = 0; i < nb; i++) {
+ GrPoint point = (GrPoint) cq.modeleDonnees().getObject(i);
+ if (point != null) {
+ final int idxElt = TrIsoLayerDefault.sondeSelection(point, panel_.getIsoLayer().getIsoModel());
+ if (idxElt > -1) {
+ newPoint = new TrPostInterpolatePoint(idxElt, point.x_, point.y_, panel_.getSource().getPrecisionModel());
+ modifierStructure = true;
+ listePoints_.add(newPoint);
+ }
+ }
+ }
+ return modifierStructure;
- int nb=cq.modeleDonnees().getNombre();
+ }
- for(int i=0;i<nb;i++){
- GrPoint point=(GrPoint) cq.modeleDonnees().getObject(i);
- if(point!=null){
- final int idxElt = TrIsoLayerDefault.sondeSelection(point, panel_.getIsoLayer().getIsoModel());
- if (idxElt > -1){
- newPoint= new TrPostInterpolatePoint(idxElt, point.x_, point.y_, new GISPrecision());
- modifierStructure=true;
- listePoints_.add(newPoint);
- }
- }
- }
- return modifierStructure;
+ public boolean ajouterSelection(ZCalquePoint cq) {
+ boolean modifierStructure = false;
+ TrPostInterpolatePoint newPoint = null;
+ if (cq == null || cq.modeleDonnees() == null) return false;
- }
+ int nb = cq.modeleDonnees().getNombre();
-
- public boolean ajouterSelection(ZCalquePoint cq){
- boolean modifierStructure=false;
- TrPostInterpolatePoint newPoint=null;
- if(cq==null || cq.modeleDonnees()==null)
- return false;
+ for (int i = 0; i < nb; i++) {
+ GrPoint point = cq.getPoint(i);
+ if (point != null) {
+ final int idxElt = TrIsoLayerDefault.sondeSelection(point, panel_.getIsoLayer().getIsoModel());
+ if (idxElt > -1) {
+ newPoint = new TrPostInterpolatePoint(idxElt, point.x_, point.y_, panel_.getSource().getPrecisionModel());
+ modifierStructure = true;
+ if (canAdd(newPoint)) listePoints_.add(newPoint);
+ }
+ }
+ }
+ return modifierStructure;
+ }
- int nb=cq.modeleDonnees().getNombre();
+ public boolean ajouterSelection(ZCalquePoint cq, int i) {
+ boolean modifierStructure = false;
+ TrPostInterpolatePoint newPoint = null;
+ if (cq == null || cq.modeleDonnees() == null) return false;
+ GrPoint point = cq.getPoint(i);
+ if (point != null) {
+ final int idxElt = TrIsoLayerDefault.sondeSelection(point, panel_.getIsoLayer().getIsoModel());
+ if (idxElt > -1) {
+ newPoint = new TrPostInterpolatePoint(idxElt, point.x_, point.y_, panel_.getSource().getPrecisionModel());
+ modifierStructure = true;
+ if (canAdd(newPoint)) listePoints_.add(newPoint);
+ }
+ }
- for(int i=0;i<nb;i++){
- GrPoint point=cq.getPoint(i);
- if(point!=null){
- final int idxElt = TrIsoLayerDefault.sondeSelection(point, panel_.getIsoLayer().getIsoModel());
- if (idxElt > -1){
- newPoint= new TrPostInterpolatePoint(idxElt, point.x_, point.y_, new GISPrecision());
- modifierStructure=true;
- if(canAdd(newPoint))
- listePoints_.add(newPoint);
- }
- }
- }
- return modifierStructure;
- }
+ return modifierStructure;
+ }
- public boolean ajouterSelection(ZCalquePoint cq,int i){
- boolean modifierStructure=false;
- TrPostInterpolatePoint newPoint=null;
- if(cq==null || cq.modeleDonnees()==null)
- return false;
- GrPoint point=cq.getPoint(i);
- if(point!=null){
- final int idxElt = TrIsoLayerDefault.sondeSelection(point, panel_.getIsoLayer().getIsoModel());
- if (idxElt > -1){
- newPoint= new TrPostInterpolatePoint(idxElt, point.x_, point.y_, new GISPrecision());
- modifierStructure=true;
- if(canAdd(newPoint))
- listePoints_.add(newPoint);
- }
- }
+ private boolean canAdd(TrPostInterpolatePoint pt) {
+ for (Object ob : listePoints_) {
+ if (ob instanceof TrPostInterpolatePoint) {
+ TrPostInterpolatePoint tr = (TrPostInterpolatePoint) ob;
+ if (tr.equals(pt)) return false;
+ }
+ }
+ return true;
- return modifierStructure;
- }
+ }
+ }
-
- private boolean canAdd(TrPostInterpolatePoint pt){
- for(Object ob:listePoints_){
- if(ob instanceof TrPostInterpolatePoint){
- TrPostInterpolatePoint tr=(TrPostInterpolatePoint) ob;
- if(tr.equals(pt))
- return false;
- }
- }
- return true;
-
- }
- }
+ /**
+ * Liste des points selectionn\xE9s.
+ */
+ protected GISZoneCollectionPoint pointsSelectionnees_;
- /**
- * Liste des points selectionn\xE9s.
- */
- protected GISZoneCollectionPoint pointsSelectionnees_;
+ final TrPostVisuPanel panel_;
- final TrPostVisuPanel panel_;
+ protected TrPostImplementation impl_;
- protected TrPostImplementation impl_;
+ /**
+ * l'arbre des donn\xE9es representant le calque
+ */
+ public JTree tree_;
- /**
- * l'arbre des donn\xE9es representant le calque
- */
- public JTree tree_;
+ /**
+ * le linetreemodel aui filtre uniquement les type d'objets g\xE9om\xE9triaues recherch\xE9s.
+ */
+ final CalqueGISTreeModel lineTreeModel_;
+ public TrEvolutionBuilderFromTree(TrPostVisuPanel panel) {
+ this(panel, null);
+ }
- /**
- * le linetreemodel aui filtre uniquement les type d'objets g\xE9om\xE9triaues recherch\xE9s.
- */
- final CalqueGISTreeModel lineTreeModel_;
+ public TrEvolutionBuilderFromTree(TrPostVisuPanel panel, TrPostImplementation impl) {
- public TrEvolutionBuilderFromTree(TrPostVisuPanel panel) {
- this(panel,null);
- }
+ this.panel_ = panel;
+ this.impl_ = impl;
+ pointsSelectionnees_ = null;
+ lineTreeModel_ = new CalqueGISTreeModel(null, panel.getDonneesCalque());
+ lineTreeModel_.setMask(GISLib.MASK_POINT);
+ }
- public TrEvolutionBuilderFromTree(TrPostVisuPanel panel, TrPostImplementation impl) {
+ public GISZoneCollectionPoint getSelection() {
- this.panel_ = panel;
- this.impl_ = impl;
- pointsSelectionnees_=null;
- lineTreeModel_ = new CalqueGISTreeModel(null, panel.getDonneesCalque());
- lineTreeModel_.setMask(GISLib.MASK_POINT);
- }
+ if (tree_ == null) return null;
- public GISZoneCollectionPoint getSelection(){
+ return null;
+ }
- if(tree_==null)
- return null;
+ public JTree buildTree() {
+ if (tree_ == null) {
+ tree_ = lineTreeModel_.createView(false, false);
+ // -- gestion double click pour r\xE9cup\xE9rer l'information
+ tree_.addMouseListener(new MouseAdapter() {
- return null;
- }
+ public void mouseClicked(MouseEvent e) {
+ if (e.getClickCount() < 2) return;
+ final TreePath clickedElement = tree_.getPathForLocation(e.getX(), e.getY());
+ LayerNode treeNode = null;
+ if (clickedElement != null && clickedElement.getLastPathComponent() instanceof LayerNode) treeNode = (LayerNode) clickedElement
+ .getLastPathComponent();
- public JTree buildTree() {
- if(tree_==null){
- tree_=lineTreeModel_.createView(false,false);
- //-- gestion double click pour r\xE9cup\xE9rer l'information
- tree_.addMouseListener(new MouseAdapter(){
+ if (treeNode == null) return;
+ boolean apply = false;
+ if (treeNode.getUserObject() instanceof ZCalquePoint && treeNode.isLeaf())
+ apply = ajouterSelection((ZCalquePoint) treeNode.getUserObject(), treeNode.getIdxGeom());
+ else if (treeNode.getUserObject() instanceof ZCalquePoint) apply = ajouterSelection((ZCalquePoint) treeNode
+ .getUserObject());
+ else if (treeNode.getUserObject() instanceof ZCalqueMultiPoint) apply = ajouterSelection((ZCalqueMultiPoint) treeNode
+ .getUserObject());
+ else if (treeNode.getUserObject() instanceof BGroupeCalque) {
- public void mouseClicked(MouseEvent e) {
- if(e.getClickCount()<2)
- return;
- final TreePath clickedElement = tree_.getPathForLocation(e.getX(), e.getY());
- LayerNode treeNode = null;
- if (clickedElement != null && clickedElement.getLastPathComponent() instanceof LayerNode)
- treeNode=(LayerNode) clickedElement.getLastPathComponent();
+ if (treeNode.getChildCount() > 0 && treeNode.getChildAt(0) instanceof LayerNode) {
- if(treeNode==null)return;
- boolean apply=false;
- if(treeNode.getUserObject() instanceof ZCalquePoint && treeNode.isLeaf())
+ LayerNode treeNodeFils = (LayerNode) treeNode.getChildAt(0);
+ if (treeNodeFils.getChildCount() > 0 && treeNodeFils.getChildAt(0) instanceof LayerNode
+ && !treeNodeFils.isLeaf()) treeNodeFils = (LayerNode) treeNodeFils.getChildAt(0);
+ if (treeNodeFils.getUserObject() instanceof ZCalquePoint) {
+ // -- on recupere le calque global et on l'ajoute direct --//
+ ZCalquePoint zcq = (ZCalquePoint) treeNodeFils.getUserObject();
+ if (zcq != null) apply = ajouterSelection(zcq);
+ }
- apply=ajouterSelection((ZCalquePoint) treeNode.getUserObject(),treeNode.getIdxGeom());
- else
- if(treeNode.getUserObject() instanceof ZCalquePoint )
- apply=ajouterSelection((ZCalquePoint) treeNode.getUserObject());
- else
- if(treeNode.getUserObject() instanceof ZCalqueMultiPoint)
- apply= ajouterSelection((ZCalqueMultiPoint) treeNode.getUserObject());
- else if( treeNode.getUserObject() instanceof BGroupeCalque){
-
- if(treeNode.getChildCount()>0 && treeNode.getChildAt(0) instanceof LayerNode){
-
- LayerNode treeNodeFils =(LayerNode) treeNode.getChildAt(0);
- if(treeNodeFils.getChildCount()>0 && treeNodeFils.getChildAt(0)instanceof LayerNode && !treeNodeFils.isLeaf())
- treeNodeFils=(LayerNode) treeNodeFils.getChildAt(0);
- if(treeNodeFils.getUserObject() instanceof ZCalquePoint){
- //-- on recupere le calque global et on l'ajoute direct --//
- ZCalquePoint zcq=(ZCalquePoint) treeNodeFils.getUserObject() ;
- if(zcq!=null)
- apply=ajouterSelection(zcq);
- }
-
- }
-
-
-
- }
- //-- on fait appel a pply qui met a jour les composants voulues --//
- if(apply)
- apply();
- }
- });
- }
- return tree_;
- }
+ }
- /**
- * est appel\xE9e lors du double clic sur le tree.
- * @param objectSelection
- * @return
- */
- public abstract boolean ajouterSelection(ZCalqueMultiPoint cq);
+ }
+ // -- on fait appel a pply qui met a jour les composants voulues --//
+ if (apply) apply();
+ }
+ });
+ }
+ return tree_;
+ }
-
+ /**
+ * est appel\xE9e lors du double clic sur le tree.
+ *
+ * @param objectSelection
+ * @return
+ */
+ public abstract boolean ajouterSelection(ZCalqueMultiPoint cq);
- public abstract boolean ajouterSelection(ZCalquePoint cq);
-
- public abstract boolean ajouterSelection(ZCalquePoint cq,int indice);
+ public abstract boolean ajouterSelection(ZCalquePoint cq);
- /**
- * applique les modifications (listener a appeler ou autre)...
- */
- protected abstract void apply();
+ public abstract boolean ajouterSelection(ZCalquePoint cq, int indice);
+ /**
+ * applique les modifications (listener a appeler ou autre)...
+ */
+ protected abstract void apply();
+
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2010-06-10 16:39:11 UTC (rev 5762)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2010-06-10 21:37:04 UTC (rev 5763)
@@ -15,7 +15,6 @@
import java.awt.RenderingHints;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
-import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -25,12 +24,17 @@
import javax.swing.DefaultListSelectionModel;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
import javax.swing.ListModel;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
+import com.memoire.bu.BuMenuItem;
+import com.memoire.bu.BuResource;
+import com.memoire.fu.FuLog;
+import com.vividsolutions.jts.geom.LineString;
+import com.vividsolutions.jts.geom.LinearRing;
+
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.ctulu.CtuluLib;
import org.fudaa.ctulu.CtuluLibArray;
@@ -74,12 +78,6 @@
import org.fudaa.fudaa.tr.persistence.TrPostIsoLayerPersistence;
import org.fudaa.fudaa.tr.post.data.TrPostDataListener;
-import com.memoire.bu.BuMenuItem;
-import com.memoire.bu.BuResource;
-import com.memoire.fu.FuLog;
-import com.vividsolutions.jts.geom.LineString;
-import com.vividsolutions.jts.geom.LinearRing;
-
/**
* Un calque de trace de cartes avec un nouvel algorithme de trace.
*
@@ -289,7 +287,7 @@
i = 0;
}
setV(i);
- sondePt_=new ArrayList<GrPoint>();
+ sondePt_ = new ArrayList<GrPoint>();
}
void initPaletteMap() {
@@ -337,24 +335,24 @@
protected final void paintSonde(final Graphics2D _g2d, final GrMorphisme _versEcran) {
if (sondeSelectedElement_ >= 0) {
- GrPoint oldPoint=null;
- for(GrPoint point:sondePt_) {
-
- final GrPoint p = point.applique(_versEcran);
- if (sondeIcone_ == null) {
- sondeIcone_ = getSondeIcone();
+ GrPoint oldPoint = null;
+ for (GrPoint point : sondePt_) {
+
+ final GrPoint p = point.applique(_versEcran);
+ if (sondeIcone_ == null) {
+ sondeIcone_ = getSondeIcone();
+ }
+ // _g2d.setXORMode(Color.WHITE);
+ sondeIcone_.paintIconCentre(this, _g2d, p.x_, p.y_);
+
+ // -- on trace la ligne entre les sondes --//
+ if (oldPoint != null) {
+ _g2d.drawLine((int) oldPoint.x_, (int) oldPoint.y_, (int) p.x_, (int) p.y_);
+
+ }
+ oldPoint = p;
}
- // _g2d.setXORMode(Color.WHITE);
- sondeIcone_.paintIconCentre(this, _g2d, p.x_, p.y_);
-
- //-- on trace la ligne entre les sondes --//
- if(oldPoint!=null){
- _g2d.drawLine((int)oldPoint.x_,(int) oldPoint.y_, (int) p.x_,(int) p.y_);
-
- }
- oldPoint=p ;
}
- }
}
protected void timeStepFormatChanged() {
@@ -406,18 +404,17 @@
public final boolean changeSonde(final GrPoint _ptReel, final boolean _add) {
if (!isSondeEnable()) { return false; }
if (sondePt_ == null) {
- //sondePt_ = new GrPoint();
- sondePt_=new ArrayList<GrPoint>();
+ // sondePt_ = new GrPoint();
+ sondePt_ = new ArrayList<GrPoint>();
}
-
- GrPoint point=new GrPoint();
-
+
+ GrPoint point = new GrPoint();
+
point.initialiseAvec(_ptReel);
-
- if(!_add)
- sondePt_.clear();
+
+ if (!_add) sondePt_.clear();
sondePt_.add(point);
-
+
final int i = sondeSelection(point, getIsoModelAbstract());
final boolean oldIsDraw = sondeSelectedElement_ >= 0;
sondeSelectedElement_ = i;
@@ -523,7 +520,9 @@
@Override
public void fillWithInterpolateInfo(final InfoData _m) {
- getIsoModelAbstract().fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.get(0).x_, sondePt_.get(0).y_, getTitle());
+ int i = sondePt_.size()-1;
+ getIsoModelAbstract().fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.get(i).x_, sondePt_.get(i).y_,
+ getTitle());
}
@Override
@@ -574,7 +573,7 @@
@Override
public int[] getSelectedElementIdx() {
- if (getIsoModelAbstract().isRubar()) { return getSelectedIndex(); }
+ if (getIsoModelAbstract().isCurrentDataElementType()) { return getSelectedIndex(); }
return null;
}
@@ -592,7 +591,7 @@
@Override
public int[] getSelectedPtIdx() {
- if (getIsoModelAbstract().isRubar()) { return null; }
+ if (getIsoModelAbstract().isCurrentDataElementType()) { return null; }
return super.getSelectedPtIdx();
}
@@ -614,11 +613,11 @@
}
public final double getSondeX() {
- return sondePt_ == null ? 0 : sondePt_.get(0).x_;
+ return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size()-1).x_;
}
public final double getSondeY() {
- return sondePt_ == null ? 0 : sondePt_.get(0).y_;
+ return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size()-1).y_;
}
public final JComponent getTargetComponent() {
@@ -695,13 +694,13 @@
@Override
public boolean isSelectionElementEmpty() {
- if (getIsoModelAbstract().isRubar()) { return isSelectionEmpty(); }
+ if (getIsoModelAbstract().isCurrentDataElementType()) { return isSelectionEmpty(); }
return true;
}
@Override
public boolean isSelectionPointEmpty() {
- return getIsoModelAbstract().isRubar() ? true : super.isSelectionPointEmpty();
+ return getIsoModelAbstract().isCurrentDataElementType() ? true : super.isSelectionPointEmpty();
}
public final boolean isSondeActive() {
@@ -726,9 +725,7 @@
@Override
public void paintDonnees(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel,
final GrBoite _clipReel) {
- System.out.println("Start TrIsoLayerDefault.paintDonnees");
long currentTime = System.currentTimeMillis();
-
if (namePalette_ == null) {
updateLegende();
}
@@ -770,16 +767,39 @@
final int n = modelToUse.getNbElt();
final GrPolygone poly = new GrPolygone();
final GrBoite b = new GrBoite();
-
- /*******************************************************************************/
- /** D\xE9claration variables utilis\xE9es par algo optimisation par centre \xE9l\xE9ments **/
- /*******************************************************************************/
- GrPoint ptCenter = new GrPoint();
- final int width = this.getSize().width;
- int count = 0;
- CtuluListSelection alreadyExist = new CtuluListSelection();
-
+// final int width = this.getSize().width;
+// final int height = this.getSize().height;
+// GrPoint ptCenter = new GrPoint();
+// CtuluListSelection alreadyExist = new CtuluListSelection();
for (i = 0; i < n; i++) {
+// modelToUse.getCentre(ptCenter, i, false);
+// ptCenter.autoApplique(_versEcran);
+// if (ptCenter.y_ >= 0 && ptCenter.y_ <= height && ptCenter.x_ >= 0 && ptCenter.x_ <= width) {
+// int idx = (2*width * ((int) ptCenter.y_)) + ((int) ptCenter.x_*2);
+// if (alreadyExist.isSelected(idx)) {
+//// System.err.println("same for "+ptCenter);
+// continue;
+// } else {
+// if (idx >= 0) alreadyExist.add(idx);
+//
+// if (rapide) {
+// int idx2;
+//
+// for (int j = ((int) ptCenter.x_) - 1; j < (((int) ptCenter.x_) + 2); j++) {
+// for (int k = ((int) ptCenter.y_) - 1; k < (((int) ptCenter.y_) + 2); k++) {
+// if ((j >= 0) && (j < width) && (k >= 0) && (k < height)) {
+// idx2 = (width * k) + j;
+//
+// if (idx2 != idx && idx2 >= 0) {
+// alreadyExist.add(idx2);
+// }
+// }
+// }
+// }
+// }
+// }
+// }
+
// le test sur la condition se fait dans le modele
if (!modelToUse.polygone(poly, i, false)) {
continue;
@@ -788,53 +808,6 @@
if (!_clipReel.intersectXY(b)) {
continue;
}
-
- /******************************************************/
- /** D\xE9but code algo optimisation par centre \xE9l\xE9ments **/
- /******************************************************/
- poly.centre(ptCenter);
-// System.out.print("X : " + ptCenter.x_ + ", Y : " + ptCenter.y_);
- ptCenter.autoApplique(_versEcran);
-// System.out.println(", X : " + ptCenter.x_ + ", Y : " + ptCenter.y_);
- int idx = (width * ((int)ptCenter.y_)) + ((int)ptCenter.x_);
-// System.out.println("id : " + idx);
-
- if (alreadyExist.isSelected(idx))
- {
- count++;
- continue;
- }
- else
- {
- alreadyExist.add(idx);
-
- //TODO rapide n'est jamais \xE0 true, car si il doit l'\xEAtre on passe dans la m\xE9thode m\xE8re.
- if (rapide)
- {
- int idx2;
- final int height = this.getSize().height;
-
- for (int j = ((int)ptCenter.x_) - 1; j < (((int)ptCenter.x_) + 2); j++)
- {
- for (int k = ((int)ptCenter.y_) - 1; k < (((int)ptCenter.y_) + 2); k++)
- {
- if ((j >= 0) && (j < width) && (k >= 0) && (k < height))
- {
- idx2 = (width * k) + j;
-
- if (idx2 != idx)
- {
- alreadyExist.add(idx2);
- }
- }
- }
- }
- }
- }
- /****************************************************/
- /** Fin code algo optimisation par centre \xE9l\xE9ments **/
- /****************************************************/
-
// Trace des isosurfaces / Isolignes (dans la couleur du fond si les isocouleurs sont
// tracees).
if (isElement && !traceIsoLine_) {
@@ -859,10 +832,6 @@
}
paintSonde(_g, _versEcran);
currentTime = System.currentTimeMillis() - currentTime;
- System.out.println("Stop TrIsoLayerDefault.paintDonnees");
- System.out.println("Dur\xE9e : " + currentTime);
- System.out.println("isElement : " + isElement);
- System.out.println("Nb ... : " + n + ", non affich\xE9 : " + count);
}
protected void updateEltAdapter() {
@@ -946,7 +915,7 @@
@Override
public final void paintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran,
final GrBoite _clipReel) {
- if (getIsoModelAbstract().isRubar()) {
+ if (getIsoModelAbstract().isCurrentDataElementType()) {
paintElementSelection(_g, _trace, _versEcran, _clipReel);
} else {
super.paintSelection(_g, _trace, _versEcran, _clipReel);
@@ -967,13 +936,13 @@
@Override
public final CtuluListSelection selection(final GrPoint _pt, final int _tolerance) {
- if (getIsoModelAbstract().isRubar()) { return selectionElement(_pt, _tolerance); }
+ if (getIsoModelAbstract().isCurrentDataElementType()) { return selectionElement(_pt, _tolerance); }
return super.selection(_pt, _tolerance);
}
@Override
public final CtuluListSelection selection(final LinearRing _poly, final int _mode) {
- if (getIsoModelAbstract().isRubar()) { return selectionElement(_poly, _mode); }
+ if (getIsoModelAbstract().isCurrentDataElementType()) { return selectionElement(_poly, _mode); }
return super.selection(_poly, _mode);
}
@@ -1061,10 +1030,9 @@
repaint();
}
}
-
- public List<GrPoint> getLigneBriseeFromSondes(){
- return this.sondePt_;
+
+ public List<GrPoint> getLigneBriseeFromSondes() {
+ return this.sondePt_;
}
-
}
\ No newline at end of file
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModel.java 2010-06-10 16:39:11 UTC (rev 5762)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModel.java 2010-06-10 21:37:04 UTC (rev 5763)
@@ -49,7 +49,7 @@
@Override
public void fillInterpolateInfo(final InfoData _m, final int _element, final double _x, final double _y,
final String _layerTitle) {
- if (_element >= 0 && s_.isRubar()) {
+ if (_element >= 0 && s_.containsOnlyElementVar()) {
_m.put(MvResource.getS("Aire de l'\xE9l\xE9ment"), CtuluLib.DEFAULT_NUMBER_FORMAT
.format(s_.getGrid().getA...
[truncated message content] |
|
From: <de...@us...> - 2010-06-24 15:49:11
|
Revision: 5772
http://fudaa.svn.sourceforge.net/fudaa/?rev=5772&view=rev
Author: deniger
Date: 2010-06-24 15:49:05 +0000 (Thu, 24 Jun 2010)
Log Message:
-----------
IN PROGRESS - issue PREPRO-83: Projection r?\195?\169sultat sur maillage diff?\195?\169rent
http://issues.fudaa.fr/jira/browse/PREPRO-83
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2010-06-24 11:16:50 UTC (rev 5771)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2010-06-24 15:49:05 UTC (rev 5772)
@@ -7,6 +7,7 @@
*/
package org.fudaa.fudaa.tr.post;
+import java.awt.Point;
import java.awt.event.ActionEvent;
import java.io.File;
import java.util.ArrayList;
@@ -25,6 +26,8 @@
import org.fudaa.ctulu.ProgressionInterface;
import org.fudaa.ctulu.gui.CtuluLibDialog;
import org.fudaa.ctulu.gui.CtuluTaskOperationGUI;
+import org.fudaa.ebli.calque.BCalque;
+import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter;
import org.fudaa.fudaa.tr.common.TrCommonImplementation;
import org.fudaa.fudaa.tr.common.TrLib;
import org.fudaa.fudaa.tr.common.TrResource;
@@ -78,7 +81,30 @@
}
}
+
+ public void display(final TrPostVisuPanel pnVisu,final BCalque calqueActif){
+ BuLib.invokeLater(new Runnable() {
+ public void run() {
+ final CalqueLegendeWidgetAdapter legendeCalque=(CalqueLegendeWidgetAdapter) pnVisu.getCqLegend();
+ // _impl.addInternalFrame(compFille);
+ // -- ajout de la comparaison en tant que widget --//
+ final Point location = pnVisu.getLocation();
+ location.x += 10;
+ location.y += 10;
+ BCalque calqueAct = calqueActif;
+ pnVisu.setCalqueActif(calqueAct);
+ TrPostLayoutFille layoutFille = getCurrentLayoutFille();
+ layoutFille.controller_.addCalque(TrPostSourceComparatorBuilder.getComparaisonTitle()
+ + " " + layoutFille.getScene().getAllVue2d().size() + 1, location, pnVisu
+ .getPreferredSize(), pnVisu, legendeCalque);
+
+ pnVisu.restaurer();
+ }
+
+ });
+ }
+
/**
* @return la fenetre layout active.
*/
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java 2010-06-24 11:16:50 UTC (rev 5771)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java 2010-06-24 15:49:05 UTC (rev 5772)
@@ -330,24 +330,27 @@
// -- si une clause du if est v\xE9rifi\xE9 alors on gere la
// simulation i
// --//
- if ("COMPUTE_EXTREMA".equals(commandeBrute) && item.equals(_event.getSource())) {
+ boolean isIt = item.equals(_event.getSource());
+ if (isIt) {
+ if ("COMPUTE_EXTREMA".equals(commandeBrute) && item.equals(_event.getSource())) {
- FuLog.debug("je fais partie de la simulation " + i);
- showExtremum(i);
- } else if ("PALETTE_DEFAULT".equals(commandeBrute) && item.equals(_event.getSource())) {
- updatePaletteMin(source);
- } else if ("TIME_FORMAT".equals(commandeBrute) && item.equals(_event.getSource())) {
- TrPostTimeFmtPanel.updateTimeStepFmt(source, getImpl().getFrame());
- } else {
-
- if ("VARIABLES".equals(commandeBrute) && item.equals(_event.getSource())) {
+ FuLog.debug("je fais partie de la simulation " + i);
+ showExtremum(i);
+ } else if ("PALETTE_DEFAULT".equals(commandeBrute)) {
+ updatePaletteMin(source);
+ } else if ("TIME_FORMAT".equals(commandeBrute)) {
+ TrPostTimeFmtPanel.updateTimeStepFmt(source, getImpl().getFrame());
+ } else if ("VARIABLES".equals(commandeBrute)) {
TrPostDataCreationPanel.activeVarFrame(this, source, getImpl());
- } else if ("EXPORTDATA".equals(commandeBrute) && item.equals(_event.getSource())) {
+ } else if ("EXPORTDATA".equals(commandeBrute)) {
final TrPostVisuPanel selected = getActiveOrSelectedVisuPanel(source);
TrPostVisuPanel.startExport(getImpl(), source, selected == null ? null : selected.getCurrentSelection(),
selected);
- } else if ("COMPARE".equals(commandeBrute) && item.equals(_event.getSource())) {
+ } else if ("COMPARE".equals(commandeBrute)) {
compareWith(source);
+ } else if ("PROJECT".equals(commandeBrute)) {
+ projectOn(source);
+
}
}
}
@@ -462,82 +465,16 @@
final CtuluAnalyze ana = new CtuluAnalyze();
_destGrid.computeBord(_prog, ana);
getImpl().manageAnalyzeAndIsFatal(ana);
- final TrPostSourceProjected projection = new TrPostSourceProjected(_src, _destGrid, null, _src.containsOnlyElementVar(), false,
- getImpl());
+ final TrPostSourceProjected projection = new TrPostSourceProjected(_src, _destGrid, null, _src
+ .containsOnlyElementVar(), false, getImpl());
projection.openDatas(_prog, null, getImpl());
projection.buildDefaultVectors();
- // creation du postprojet
- // final TrPostProjet trPostProjet = new TrPostProjet(projection,
- // impl_);
-
// creation du panel de visualisation du posttraitement
- final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl_, this, projection.getNbFleche() == 0,
- new BCalqueLegende(), projection);
+ final TrPostVisuPanel pnVisu = TrPostVisuPanel.buildVisuPanelForWidgets(this, impl_, projection);
+ impl_.display(pnVisu, pnVisu.getIsoLayer());
- // -- ajout des infos de cr\xE9ation --//
- projection.fillWithSourceCreationInfo(CtuluLibString.EMPTY_STRING, pnVisu.getInfosCreation());
- // 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
- final TrPostLayoutFille compFille = new TrPostLayoutFille(this);
-
- // -- on ajoute le panel de visu comm widget calque au layout --//
- compFille.addCalque(MvResource.getS("Maillage initial"), new Point(250, 170), new Dimension(400, 200), pnVisu,
- new CalqueLegendeWidgetAdapter(compFille.getScene(), pnVisu.getArbreCalqueModel()));
-
- // test si il faut ajouter le calque
- if (_isInitGridDisplay) {
- final MvGridLayerGroup src = new MvGridLayerGroup(_src.getGrid());
- src.setTitle(MvResource.getS("Maillage initial"));
- src.setVisible(false);
-
- // on ajoute le calque dans le panel visu
- pnVisu.addCalque(src);
-
- src.monter();
- src.monter();
- }
-
- // titre et action de la internalFrame
- compFille.setTitle(FDicoLib.getS("Projection"));
- compFille.setClosable(true);
- compFille.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
-
- // ajout du listener associe a la fille
- compFille.addInternalFrameListener(new InternalFrameListener() {
-
- public void internalFrameActivated(final InternalFrameEvent _e) {}
-
- public void internalFrameClosed(final InternalFrameEvent _e) {
- projection.close();
- }
-
- public void internalFrameClosing(final InternalFrameEvent _e) {}
-
- public void internalFrameDeactivated(final InternalFrameEvent _e) {}
-
- public void internalFrameDeiconified(final InternalFrameEvent _e) {}
-
- public void internalFrameIconified(final InternalFrameEvent _e) {}
-
- public void internalFrameOpened(final InternalFrameEvent _e) {}
-
- });
-
- // trPostProjet.fille_ = compFille;
- // trPostProjet.filleLayout_ = compFille;
- // addFillesLayout(compFille);
-
- BuLib.invokeLater(new Runnable() {
-
- public void run() {
- getImpl().addInternalFrame(compFille);
- pnVisu.restaurer();
- }
- });
-
}
/**
@@ -599,7 +536,6 @@
}
});
-
}
/**
@@ -709,6 +645,20 @@
task.start(r);
}
+ public void projectOn(final TrPostSource sourceSelectionnee) {
+ final TrPostSource toProject = getChooserMultiSources(-1);
+ if (toProject != null) {
+ final CtuluTaskDelegate task = getImpl().createTask(TrPostSourceComparatorBuilder.getComparaisonTitle());
+ final Runnable r = new Runnable() {
+
+ public void run() {
+ activeProjectionAction(sourceSelectionnee, toProject.getGrid(), task.getMainStateReceiver(), false);
+ }
+ };
+ task.start(r);
+ }
+ }
+
/**
* Construit un menu specifique a la source choisie. A chaque fois que l on ajoute une source au projet, il faut
* ajouter un menu sp\xE9cifique.
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java 2010-06-24 11:16:50 UTC (rev 5771)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java 2010-06-24 15:49:05 UTC (rev 5772)
@@ -27,7 +27,6 @@
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.ebli.calque.BCalque;
import org.fudaa.ebli.calque.ZEbliCalquesPanel;
-import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter;
import org.fudaa.fudaa.fdico.FDicoLib;
import org.fudaa.fudaa.meshviewer.MvResource;
import org.fudaa.fudaa.meshviewer.layer.MvGridLayerGroup;
@@ -198,26 +197,11 @@
if (isOnImpGrid) infosCreation.put(ZEbliCalquesPanel.MAILLAGE_FIC, proj.getTitle());
else infosCreation.put(ZEbliCalquesPanel.MAILLAGE_FIC, src.getTitle());
- // final TrPostProjet trPostProjet = new TrPostProjet(comparaison, impl);
-
- // -- creation de la legende --//
- final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter(impl.getCurrentLayoutFille()
- .getScene(), null);
-
- final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl, projet,
- comparaison.getFlecheListModel().getSize() == 0, legendeCalque, comparaison);
+ final TrPostVisuPanel pnVisu = TrPostVisuPanel.buildVisuPanelForWidgets(projet, impl, comparaison);
pnVisu.getInfosCreation().putAll(infosCreation);
final BCalque calqueActif = pnVisu.getCalqueActif();
- // final TrPostFille compFille = new TrPostFille(pnVisu);
- // compFille.addInternalFrameListener(new InternalFrameAdapter() {
- // public void internalFrameClosed(InternalFrameEvent _e) {
- // comparaison.close();
- // _toProject.close();
- // }
- // });
-
if (isOnImpGrid) {
pnVisu.getGridGroup().setTitle(MvResource.getS("Maillage import\xE9"));
}
@@ -235,32 +219,8 @@
pnVisu.addCalque(trIsoLayerDefault);
trIsoLayerDefault.monter();
}
+ impl.display(pnVisu, calqueActif);
- // compFille.setTitle(TrPostSourceComparatorBuilder.getComparaisonTitle());
- // compFille.setClosable(true);
- // compFille.setFrameIcon(FudaaResource.FUDAA.getToolIcon("diff"));
- // compFille.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
-
- // trPostProjet.fille_ = compFille;
- BuLib.invokeLater(new Runnable() {
-
- public void run() {
- // _impl.addInternalFrame(compFille);
- // -- ajout de la comparaison en tant que widget --//
- final Point location = pnVisu.getLocation();
- location.x += 10;
- location.y += 10;
- BCalque calqueAct = calqueActif;
- pnVisu.setCalqueActif(calqueAct);
- impl.getCurrentLayoutFille().controller_.addCalque(TrPostSourceComparatorBuilder.getComparaisonTitle()
- + " " + impl.getCurrentLayoutFille().getScene().getAllVue2d().size() + 1, location, pnVisu
- .getPreferredSize(), pnVisu, legendeCalque);
-
- pnVisu.restaurer();
- }
-
- });
-
}
};
task.start(r);
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2010-06-24 11:16:50 UTC (rev 5771)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2010-06-24 15:49:05 UTC (rev 5772)
@@ -556,4 +556,15 @@
}
+ public static TrPostVisuPanel buildVisuPanelForWidgets(final TrPostProjet projet, final TrPostCommonImplementation impl,
+ final TrPostSource source) {
+ // -- creation de la legende --//
+ final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter(impl.getCurrentLayoutFille()
+ .getScene(), null);
+
+ final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl, projet,
+ source.getFlecheListModel().getSize() == 0, legendeCalque, source);
+ return pnVisu;
+ }
+
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2010-06-24 15:54:26
|
Revision: 5773
http://fudaa.svn.sourceforge.net/fudaa/?rev=5773&view=rev
Author: deniger
Date: 2010-06-24 15:54:19 +0000 (Thu, 24 Jun 2010)
Log Message:
-----------
IN PROGRESS - issue PREPRO-83: Projection r?\195?\169sultat sur maillage diff?\195?\169rent
http://issues.fudaa.fr/jira/browse/PREPRO-83
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2010-06-24 15:49:05 UTC (rev 5772)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2010-06-24 15:54:19 UTC (rev 5773)
@@ -82,7 +82,11 @@
}
+
public void display(final TrPostVisuPanel pnVisu,final BCalque calqueActif){
+ display(pnVisu, calqueActif, TrPostSourceComparatorBuilder.getComparaisonTitle());
+ }
+ public void display(final TrPostVisuPanel pnVisu,final BCalque calqueActif,final String title){
BuLib.invokeLater(new Runnable() {
public void run() {
@@ -95,7 +99,7 @@
BCalque calqueAct = calqueActif;
pnVisu.setCalqueActif(calqueAct);
TrPostLayoutFille layoutFille = getCurrentLayoutFille();
- layoutFille.controller_.addCalque(TrPostSourceComparatorBuilder.getComparaisonTitle()
+ layoutFille.controller_.addCalque(title
+ " " + layoutFille.getScene().getAllVue2d().size() + 1, location, pnVisu
.getPreferredSize(), pnVisu, legendeCalque);
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java 2010-06-24 15:49:05 UTC (rev 5772)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjet.java 2010-06-24 15:54:19 UTC (rev 5773)
@@ -472,7 +472,7 @@
// creation du panel de visualisation du posttraitement
final TrPostVisuPanel pnVisu = TrPostVisuPanel.buildVisuPanelForWidgets(this, impl_, projection);
- impl_.display(pnVisu, pnVisu.getIsoLayer());
+ impl_.display(pnVisu, pnVisu.getIsoLayer(),TrResource.getS("Projection"));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2010-09-24 21:19:36
|
Revision: 5955
http://fudaa.svn.sourceforge.net/fudaa/?rev=5955&view=rev
Author: deniger
Date: 2010-09-24 21:19:29 +0000 (Fri, 24 Sep 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatisticSaver.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java
Added Paths:
-----------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/XppCustomDriver.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2010-09-24 08:56:13 UTC (rev 5954)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2010-09-24 21:19:29 UTC (rev 5955)
@@ -812,7 +812,6 @@
int w = getWidth()+1;
CtuluListSelection memory = new CtuluListSelection(w * getHeight());
Envelope envReel = _clipReel.getEnv();
- long t0 = System.currentTimeMillis();
for (idxElt = 0; idxElt < n; idxElt++) {
if (!modelToUse.isPainted(idxElt)) {
continue;
@@ -888,19 +887,20 @@
}
}
_g.drawLine(minX, minY, maxX, maxY);
- } else if (((maxX - minX) == 1 && (maxY - minY) == 1)) {
- double value = modelToUse.getDatatFor(idxElt, 0);
- final Color c = EbliLib.getAlphaColor(paletteCouleur_ == null ? null : ((BPalettePlage) paletteCouleur_) // on utilise getIsoModelAbstract car on est bien dans le cas ou il n'y a pas d'adapteur
- .getColorFor(value), alpha_);
- _g.setColor(c);
- for (int iPoly = 1; iPoly < nbPt; iPoly++) {
- _g.drawLine(x[iPoly], y[iPoly],x[iPoly-1], y[iPoly-1]);
- int idxDone = x[iPoly] + y[iPoly] * w;
- if (idxDone >= 0 && !memory.isSelected(idxDone)) {
- memory.add(idxDone);
- }
- }
- _g.drawLine(x[0], y[0],x[nbPt-1], y[nbPt-1]);
+ //TODO optimisation a revoir
+// } else if (((maxX - minX) == 1 && (maxY - minY) == 1)) {
+// double value = modelToUse.getDatatFor(idxElt, 0);
+// final Color c = EbliLib.getAlphaColor(paletteCouleur_ == null ? null : ((BPalettePlage) paletteCouleur_) // on utilise getIsoModelAbstract car on est bien dans le cas ou il n'y a pas d'adapteur
+// .getColorFor(value), alpha_);
+// _g.setColor(c);
+// for (int iPoly = 1; iPoly < nbPt; iPoly++) {
+// _g.drawLine(x[iPoly], y[iPoly],x[iPoly-1], y[iPoly-1]);
+// int idxDone = x[iPoly] + y[iPoly] * w;
+// if (idxDone >= 0 && !memory.isSelected(idxDone)) {
+// memory.add(idxDone);
+// }
+// }
+// _g.drawLine(x[0], y[0],x[nbPt-1], y[nbPt-1]);
} else {
v_ = modelToUse.fillWithData(idxElt, v_);
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2010-09-24 08:56:13 UTC (rev 5954)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2010-09-24 21:19:29 UTC (rev 5955)
@@ -1,12 +1,18 @@
package org.fudaa.fudaa.tr.post;
import java.awt.BorderLayout;
+import java.awt.Color;
import java.awt.Dimension;
+import java.awt.EventQueue;
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.Point;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -14,7 +20,6 @@
import java.util.Map;
import java.util.Set;
-import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JMenu;
@@ -52,6 +57,7 @@
import org.fudaa.ebli.impression.EbliPrinter;
import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.ebli.visuallibrary.EbliNode;
+import org.fudaa.ebli.visuallibrary.EbliScene;
import org.fudaa.ebli.visuallibrary.EbliWidgetController;
import org.fudaa.ebli.visuallibrary.EbliWidgetControllerInterface;
import org.fudaa.ebli.visuallibrary.EbliWidgetEditModeListener;
@@ -70,12 +76,10 @@
import org.fudaa.fudaa.tr.TrLauncherDefault;
import org.fudaa.fudaa.tr.common.TrCourbeImporter;
import org.fudaa.fudaa.tr.common.TrLib;
-import org.fudaa.fudaa.tr.common.TrProjet;
import org.fudaa.fudaa.tr.common.TrResource;
import org.fudaa.fudaa.tr.common.TrCourbeImporter.Target;
import org.fudaa.fudaa.tr.post.actions.TrPostActionBilan;
import org.fudaa.fudaa.tr.post.actions.TrPostActionChooseAndCreateCalque;
-import org.fudaa.fudaa.tr.post.actions.TrPostActionController;
import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardCreateScope;
import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardImportScope;
import org.fudaa.fudaa.tr.post.profile.MvProfileTreeModel;
@@ -202,9 +206,13 @@
* @param _controller
*/
private void changeSouth(final EbliWidgetInterface _controller) {
- if (panelSouthSuiviSouris_ != null) this.remove(this.panelSouthSuiviSouris_);
+ if (panelSouthSuiviSouris_ != null) {
+ this.remove(this.panelSouthSuiviSouris_);
+ }
this.panelSouthSuiviSouris_ = _controller.getController().getTracableComponent();
- if (panelSouthSuiviSouris_ == null) panelSouthSuiviSouris_ = defaultSouth_;
+ if (panelSouthSuiviSouris_ == null) {
+ panelSouthSuiviSouris_ = defaultSouth_;
+ }
this.add(panelSouthSuiviSouris_, BorderLayout.SOUTH);
this.revalidate();
}
@@ -344,8 +352,9 @@
for (final Iterator<EbliNode> it = ((Set<EbliNode>) getScene().getSelectedObjects()).iterator(); it.hasNext();) {
final EbliNode node = it.next();
if (!(node.getCreator() instanceof EbliWidgetCreatorLegende)
- && !(node.getCreator() instanceof org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorLegende)) projet_.nodesCopyied
- .add(node);
+ && !(node.getCreator() instanceof org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorLegende)) {
+ projet_.nodesCopyied.add(node);
+ }
}
// -- reinit de la commande cut si on voulait faire un ctrl+x
projet_.nodesCutted = null;
@@ -365,7 +374,9 @@
if (controller_ != null) {
final Set<EbliNode> noeudContenus = (Set<EbliNode>) controller_.getSceneCourante().getObjects();
- if (noeudContenus.size() == 1) getScene().setSelectedObjects(noeudContenus);
+ if (noeudContenus.size() == 1) {
+ getScene().setSelectedObjects(noeudContenus);
+ }
getScene().refresh();
}
}
@@ -382,8 +393,9 @@
for (final Iterator<EbliNode> it = ((Set<EbliNode>) getScene().getSelectedObjects()).iterator(); it.hasNext();) {
final EbliNode node = it.next();
if (!(node.getCreator() instanceof EbliWidgetCreatorLegende)
- && !(node.getCreator() instanceof org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorLegende)) projet_.nodesCutted
- .add(node);
+ && !(node.getCreator() instanceof org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorLegende)) {
+ projet_.nodesCutted.add(node);
+ }
}
// -- suppression des nodes depuis cetet kliste pour eviter les concourant
@@ -400,8 +412,9 @@
projet_.nodesCopyied = null;
// --creation de la commande undo/redo --//
- if (projet_.nodesCutted != null && projet_.nodesCutted.size() != 0) getScene().getCmdMng().addCmd(
- new CommandUndoRedoCut(projet_.nodesCutted));
+ if (projet_.nodesCutted != null && projet_.nodesCutted.size() != 0) {
+ getScene().getCmdMng().addCmd(new CommandUndoRedoCut(projet_.nodesCutted));
+ }
}
@@ -409,10 +422,12 @@
throw new IllegalAccessError("not supported");
}
- public void editStart(final Widget _w, JComponent _editor) {
+ public void editStart(final Widget _w, final JComponent _editor) {
editorEnCours_ = _editor;
final EbliNode node = (EbliNode) controller_.getSceneCourante().findObject(_w);
- if (node == null || !node.hasWidget() || node.getWidget().getController() == null) editStop(null, null);
+ if (node == null || !node.hasWidget() || node.getWidget().getController() == null) {
+ editStop(null, null);
+ }
if (node.getCreator() instanceof EbliWidgetCreatorVueCalque) {
// -- etape 1: ajout du tree dans fudaaImplementation --//
@@ -464,7 +479,7 @@
}
- public void editStop(final Widget _w, JComponent _editor) {
+ public void editStop(final Widget _w, final JComponent _editor) {
editorEnCours_ = null;
changeTree(getScene());
changeToolbarScene();
@@ -625,8 +640,11 @@
// --recuperation des noeuds copies --//
if (projet_.nodesCopyied != null) {
- ArrayList<EbliNode> listeNodeUndo = EbliWidgetActionDuplicate.duplicateInScene(projet_.nodesCopyied, getScene());
- if (listeNodeUndo.size() != 0) getScene().getCmdMng().addCmd(new CommandUndoRedoPaste(listeNodeUndo));
+ final ArrayList<EbliNode> listeNodeUndo = EbliWidgetActionDuplicate.duplicateInScene(projet_.nodesCopyied,
+ getScene());
+ if (listeNodeUndo.size() != 0) {
+ getScene().getCmdMng().addCmd(new CommandUndoRedoPaste(listeNodeUndo));
+ }
// reinitialisation de la liste
projet_.nodesCopyied = null;
@@ -643,8 +661,9 @@
}
// --creation de la commande undo/redo --//
- if (projet_.nodesCutted != null && projet_.nodesCutted.size() != 0) getScene().getCmdMng().addCmd(
- new CommandUndoRedoPaste(projet_.nodesCutted));
+ if (projet_.nodesCutted != null && projet_.nodesCutted.size() != 0) {
+ getScene().getCmdMng().addCmd(new CommandUndoRedoPaste(projet_.nodesCutted));
+ }
// reinit de la liste
projet_.nodesCutted = null;
@@ -654,8 +673,56 @@
}
}
- public int print(Graphics _g, PageFormat _format, int _page) {
- return EbliPrinter.printComponent(_g, _format, controller_.getSceneCourante().getView(), false, _page);
+ public int print(final Graphics _g, final PageFormat _format, final int _page) {
+ if (_page != 0) { return Printable.NO_SUCH_PAGE; }
+ final EbliScene scene = getScene();
+ // Sauvegarde de Clip pour restauration finale.
+ final Shape s = _g.getClip();
+ // Utilisation de methode de Graphics2d.
+ final Graphics2D g2d = (Graphics2D) _g;
+ AffineTransform transform = g2d.getTransform();
+
+ // Initialisation du graphics et translation de l 'origine.
+ final double[] coord = EbliPrinter.initGraphics(g2d, _format);
+ final Dimension dimension = scene.getDefaultImageDimension();
+
+ // Calcul du facteur d'echelle.
+ final int wComp = dimension.width;
+ final int hComp = dimension.height;
+ final double facteur = EbliPrinter.echelle(_format, wComp, hComp);
+ final double wCompDessine = wComp * facteur;
+ final double hCompDessine = hComp * facteur;
+ // definition de la zone d'impression
+ double xCentre = (_format.getImageableWidth() - wCompDessine) / 2;
+ double yCentre = (_format.getImageableHeight() - hCompDessine) / 2;
+// if (_format.getOrientation() == PageFormat.LANDSCAPE) {
+// xCentre = 0;
+// yCentre = 0;
+// }
+ g2d.translate(xCentre, yCentre);
+ try {
+ Runnable runnable = new Runnable() {
+
+ @Override
+ public void run() {
+ scene.produceImage(g2d, (int) wCompDessine, (int) hCompDessine, null);
+
+ }
+ };
+ if (!EventQueue.isDispatchThread()) {
+ EventQueue.invokeAndWait(runnable);
+ } else {
+ runnable.run();
+ }
+ } catch (Exception e) {
+ FuLog.error(e);
+ }
+ g2d.setTransform(transform);
+ g2d.setColor(Color.RED);
+ g2d.drawRect((int) _format.getImageableX(), (int) _format.getImageableY(), (int) _format.getImageableWidth(),
+ (int) _format.getImageableHeight());
+ g2d.setClip(s);
+ return Printable.PAGE_EXISTS;
}
public BufferedImage produceImage(final int _w, final int _h, final Map _params) {
@@ -694,8 +761,12 @@
super.setTitle(_title);
if (ecrasePrevious_) {
previousTitleFrame = title;
- if (menus_ != null) menus_[0].setText(_title);
- } else ecrasePrevious_ = true;
+ if (menus_ != null) {
+ menus_[0].setText(_title);
+ }
+ } else {
+ ecrasePrevious_ = true;
+ }
}
public void setTitle(final String _title, final boolean ecrasePrevious) {
@@ -716,10 +787,10 @@
}
@SuppressWarnings("serial")
- public void startExport(CtuluUI impl) {
- Collection<EbliNode> nodes = controller_.getSceneCourante().getNodes();
- Collection<CtuluExportDataInterface> exportables = new ArrayList<CtuluExportDataInterface>();
- for (EbliNode node : nodes) {
+ public void startExport(final CtuluUI impl) {
+ final Collection<EbliNode> nodes = controller_.getSceneCourante().getNodes();
+ final Collection<CtuluExportDataInterface> exportables = new ArrayList<CtuluExportDataInterface>();
+ for (final EbliNode node : nodes) {
if (node.getController().isDataExportable()) {
exportables.add((CtuluExportDataInterface) node.getController());
}
@@ -732,19 +803,19 @@
exportables.iterator().next().startExport(impl);
return;
}
- BuComboBox cb = new BuComboBox(exportables.toArray());
+ final BuComboBox cb = new BuComboBox(exportables.toArray());
cb.setRenderer(new CtuluCellTextRenderer() {
@Override
- protected void setValue(Object value) {
+ protected void setValue(final Object value) {
setText(((CtuluExportDataInterface) value).getTitle());
}
});
- CtuluDialogPanel pn = new CtuluDialogPanel(false);
+ final CtuluDialogPanel pn = new CtuluDialogPanel(false);
pn.setLayout(new BorderLayout());
pn.addLabel(TrResource.getS("Choisir la source de donn\xE9es"));
pn.add(cb);
- boolean afficheModaleOk = pn.afficheModaleOk(impl.getParentComponent(), getTitle());
+ final boolean afficheModaleOk = pn.afficheModaleOk(impl.getParentComponent(), getTitle());
if (afficheModaleOk) {
((CtuluExportDataInterface) cb.getSelectedItem()).startExport(impl);
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatisticSaver.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatisticSaver.java 2010-09-24 08:56:13 UTC (rev 5954)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatisticSaver.java 2010-09-24 21:19:29 UTC (rev 5955)
@@ -23,7 +23,9 @@
public class TrPostDataCreatedStatisticSaver implements TrPostDataCreatedSaver {
public TrPostDataCreated restore(H2dVariableType _newVar, final TrPostSource _src, final CtuluUI _ui, final Map _shortName, TrPostSourcesManager srcMng, CtuluAnalyze log) {
- return TrPostDataCreatedStatistic.createFrom(this, _src, _shortName, _ui);
+ TrPostDataCreatedStatistic stat = TrPostDataCreatedStatistic.createFrom(this, _src, _shortName, _ui);
+ stat.updateValues();
+ return stat;
}
double[] data_;
@@ -38,7 +40,7 @@
}
public TrPostDataCreatedStatisticSaver(final TrPostDataCreatedStatistic _data) {
- data_ = _data.value_;
+// data_ = _data.value_;
statId_ = _data.evaluator_.getStatId();
tBegin_ = _data.tsBegin_;
tEnd_ = _data.tsEnd_;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2010-09-24 08:56:13 UTC (rev 5954)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2010-09-24 21:19:29 UTC (rev 5955)
@@ -26,8 +26,14 @@
import com.memoire.fu.FuLib;
import com.memoire.fu.FuLog;
import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.io.xml.DomDriver;
+import com.thoughtworks.xstream.converters.Converter;
+import com.thoughtworks.xstream.converters.MarshallingContext;
+import com.thoughtworks.xstream.converters.UnmarshallingContext;
+import com.thoughtworks.xstream.io.HierarchicalStreamReader;
+import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
+import com.thoughtworks.xstream.io.xml.StaxDriver;
import com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer;
+import com.thoughtworks.xstream.io.xml.XppDriver;
import com.thoughtworks.xstream.persistence.XmlArrayList;
import org.fudaa.ctulu.CtuluAnalyze;
@@ -60,6 +66,7 @@
import org.fudaa.fudaa.tr.post.TrPostTimeModelSaver;
import org.fudaa.fudaa.tr.post.TrPostUserVariableSaver;
import org.fudaa.fudaa.tr.post.actions.TrPostActionFusionCalques;
+import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedStatisticSaver;
import org.netbeans.api.visual.widget.Widget;
import org.netbeans.modules.visual.anchor.TriangleAnchorShape;
@@ -120,7 +127,7 @@
ProgressionInterface prog_;
File projet_;
- public File getProjet_() {
+ public File getProjet() {
return projet_;
}
@@ -193,27 +200,21 @@
if (projet_ != null) {}
File conteneurProjet = null;
- fileChooser.setFileFilter(new FileFilter()
- {
-
+ fileChooser.setFileFilter(new FileFilter() {
+
@Override
- public String getDescription()
- {
+ public String getDescription() {
return "*.POST (Fichier POST)";
}
-
+
@Override
- public boolean accept(File f)
- {
- if (f.isDirectory())
- {
- return true;
- }
-
+ public boolean accept(File f) {
+ if (f.isDirectory()) { return true; }
+
return false;
}
});
-
+
final int reponse = fileChooser.showSaveDialog(CtuluLibSwing.getFrameAncestor(ui_.getParentComponent()));
if (reponse == JFileChooser.APPROVE_OPTION) {
conteneurProjet = fileChooser.getSelectedFile();
@@ -494,7 +495,7 @@
// -- g\xE9n\xE9ration du xml pour la scene --//
try {
final File fichier = new File(projet + File.separator + setupProject);
- out=EbliLib.createObjectOutpuStream(fichier, getParser());
+ out = EbliLib.createObjectOutpuStream(fichier, getParser());
// --enregistrement du path relatif --//
final File pathRelatif = CtuluLibFile.getRelativePathnameTo(fichier, projet_);
@@ -530,11 +531,10 @@
ObjectOutputStream out = null;
// -- g\xE9n\xE9ration du xml pour la scene --//
try {
- if(!file.exists()){
+ if (!file.exists()) {
file.getParentFile().mkdirs();
}
out = EbliLib.createObjectOutpuStream(file, getParser());
-
// -- redame --//
out.writeObject(XmlCommentaire.getCommentaireSources());
@@ -808,7 +808,7 @@
e.printStackTrace();
} finally {
try {
- in.close();
+ if (in != null) in.close();
} catch (final IOException e) {
e.printStackTrace();
}
@@ -1100,8 +1100,9 @@
*/
private XStream initXmlParser() {
final XmlFriendlyReplacer replacer = new XmlFriendlyReplacer("#", "_");
- final DomDriver domDriver = new DomDriver("UTF-8", replacer);
- final XStream xstream = new XStream(domDriver);
+ // final DomDriver domDriver = new DomDriver("UTF-8", replacer);
+ final XppDriver staxDriver = new XppCustomDriver(replacer);
+ final XStream xstream = new XStream(staxDriver);
// -- creation des alias pour que ce soit + parlant dans le xml file --//
xstream.alias("LAYOUT", EbliSceneSerializeXml.class);
xstream.alias("FRAME", EbliWidgetSerializeXml.class);
@@ -1116,12 +1117,26 @@
xstream.alias("README", XmlCommentaire.class);
xstream.alias("TIMEMODEL", TrPostTimeModelSaver.class);
xstream.alias("USERVAR", TrPostUserVariableSaver.class);
+ xstream.omitField(TrPostDataCreatedStatisticSaver.class, "data_");
xstream.omitField(TriangleAnchorShape.class, "generalPath");
+ xstream.registerLocalConverter(TrPostDataCreatedStatisticSaver.class, "data_", new Converter() {
- // xstream.addImplicitCollection(EbliWidgetSerializeXml.CoupleNomId.class,
- // "FRAMENAME");
- // xstream.alias( "NbElements",Integer.class);
+ @Override
+ public boolean canConvert(Class type) {
+ return true;
+ }
+ @Override
+ public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
+ return null;
+ }
+
+ @Override
+ public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
+
+ }
+ });
+
return xstream;
}
@@ -1426,7 +1441,9 @@
}
// -- on ajoute les noeuds selectionnes a ebliScene --//
- if (listeNodeSelect != null) scenToUpdate.setSelectedObjects(listeNodeSelect);
+ if (listeNodeSelect != null) {
+ if (listeNodeSelect != null) scenToUpdate.setSelectedObjects(listeNodeSelect);
+ }
// mise a jour de la scene
scenToUpdate.refresh();
Added: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/XppCustomDriver.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/XppCustomDriver.java (rev 0)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/XppCustomDriver.java 2010-09-24 21:19:29 UTC (rev 5955)
@@ -0,0 +1,46 @@
+package org.fudaa.fudaa.tr.post.persist;
+
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
+import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
+import com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer;
+import com.thoughtworks.xstream.io.xml.XppDriver;
+
+import org.fudaa.ctulu.CtuluLibString;
+
+/**
+ * @author deniger
+ */
+public class XppCustomDriver extends XppDriver {
+
+ /**
+ *
+ */
+ public XppCustomDriver() {}
+
+ /**
+ * @param replacer
+ */
+ public XppCustomDriver(XmlFriendlyReplacer replacer) {
+ super(replacer);
+ }
+
+ private static char[] INDENT = new char[] { ' ', ' ' };
+
+ @Override
+ public HierarchicalStreamWriter createWriter(Writer out) {
+ return new PrettyPrintWriter(out, INDENT, CtuluLibString.LINE_SEP, xmlFriendlyReplacer());
+ }
+
+ /**
+ *
+ */
+ @Override
+ public HierarchicalStreamWriter createWriter(OutputStream out) {
+ return createWriter(new OutputStreamWriter(out));
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-05-25 17:57:16
|
Revision: 7238
http://fudaa.svn.sourceforge.net/fudaa/?rev=7238&view=rev
Author: deniger
Date: 2012-05-25 17:57:09 +0000 (Fri, 25 May 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedExpr.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedMoins.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPlus.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2012-05-25 17:29:59 UTC (rev 7237)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2012-05-25 17:57:09 UTC (rev 7238)
@@ -103,7 +103,7 @@
/**
* Un modele pour les pas de temps.
- *
+ *
* @author Fred Deniger
* @version $Id: TrPostSourceAbstract.java,v 1.52 2007-06-28 09:28:18 deniger Exp $
*/
@@ -115,7 +115,7 @@
@Override
public Object getElementAt(final int _index) {
- return (fleches_ == null || _index >= fleches_.length) ? null : fleches_[_index];
+ return (fleches_ == null || _index >= fleches_.length || _index < 0) ? null : fleches_[_index];
}
@Override
@@ -131,7 +131,7 @@
/**
* Un modele pour les pas de temps.
- *
+ *
* @author Fred Deniger
* @version $Id: TrPostSourceAbstract.java,v 1.52 2007-06-28 09:28:18 deniger Exp $
*/
@@ -185,7 +185,7 @@
}
final H2dVariableType vChanged = (H2dVariableType) e.getKey();
fireVariableChanged(vChanged, vChanged, true, false, TrPostDataHelper.getAllVarDependingOn(fr,
- TrPostSourceAbstract.this));
+ TrPostSourceAbstract.this));
}
}
}
@@ -244,61 +244,38 @@
public static String getPrefNameValue(final H2dVariableType _t) {
return "palette.min.var." + _t.getShortName() + ".val";
}
-
boolean close_;
-
File dbTmpFile_;
-
// final File f_;
-
FlecheListModel flecheModel_;
-
protected TrPostFlecheContent[] fleches_;
-
EfGridInterface g_;
-
Variable gravite_;
-
CtuluUI impl_;
-
TrPostDataInfoDoc info_;
-
protected boolean inspected_;
-
EfGridDataInterpolator interpolator_;
-
GISPrecision precision_;
-
private final Map shortNameCreateVar_ = new HashMap();
-
TrPostTimeModel time_;
-
protected final String title_;
-
protected ObjectContainer tmpContainer_;
-
Map varCreateData_;
-
/**
* Les variables utilisees.
*/
H2dVariableType[] variable_;
-
List varListener_;
-
VariableListModel varModel_;
-
Map varUserCreateData_;
-
InterpolationVectorContainer vectors_;
-
private String id_;
protected TrPostSourceAbstract(final String _titre, final EfGridInterface _g, final double[] _time,
- final CtuluUI _impl) {
+ final CtuluUI _impl) {
title_ = _titre;
gravite_ = new VariableFactory().createVariable("g", CtuluLib.getDouble(TrPreferences.TR.getDoubleProperty(
- "tr.gravity.value", 9.81)));
+ "tr.gravity.value", 9.81)));
gravite_.addObserver(new VariableObserver());
time_ = new TrPostTimeModel();
time_.setTimeSteps(_time);
@@ -317,16 +294,19 @@
}
@Override
- public void activate() {}
+ public void activate() {
+ }
protected final void addFroud(final Map _l) {
- if (getInitDataIndex("FROUDE") != null) { return; }
+ if (getInitDataIndex("FROUDE") != null) {
+ return;
+ }
// les variables h,u et v doivent etre d\xE9finies
if ((isInitVar(H2dVariableType.HAUTEUR_EAU) || _l.containsKey(H2dVariableType.HAUTEUR_EAU))
&& (isInitVar(H2dVariableType.VITESSE_U) || _l.containsKey(H2dVariableType.VITESSE_U))
&& (isInitVar(H2dVariableType.VITESSE_V) || _l.containsKey(H2dVariableType.VITESSE_V))) {
final H2dVariableTypeCreated c = H2dVariableType.createTempVar(H2dResource.getS("Nombre de Froude"), "froude",
- shortNameCreateVar_);
+ shortNameCreateVar_);
_l.put(c, new TrPostDataCreatedFroud(this));
}
@@ -335,23 +315,28 @@
protected void addOtherVariables(final Map _l, final Map _fleche) {
addFroud(_l);
}
-
+
@Override
public long getReferenceDateInMillis() {
return 0;
}
@Override
- public void addSpecificItemInMainMenu(final BuMenu _m, final TrPostCommonImplementation _impl) {}
+ public void addSpecificItemInMainMenu(final BuMenu _m, final TrPostCommonImplementation _impl) {
+ }
@Override
public final void addUserVar(final H2dVariableTypeCreated[] _t, final TrPostDataCreated[] _cr,
- final CtuluCommandContainer _cmd) {
- if (_t == null || _t.length == 0) { return; }
+ final CtuluCommandContainer _cmd) {
+ if (_t == null || _t.length == 0) {
+ return;
+ }
buildUserVarMap();
final Set newList = new HashSet(_t.length + variable_.length);
newList.addAll(Arrays.asList(variable_));
- if (!newList.addAll(Arrays.asList(_t))) { return; }
+ if (!newList.addAll(Arrays.asList(_t))) {
+ return;
+ }
List newFleche = null;
for (int i = _t.length - 1; i >= 0; i--) {
varUserCreateData_.put(_t[i], _cr[i]);
@@ -400,7 +385,6 @@
public void undo() {
removeUserVar(_t, null);
}
-
});
}
@@ -438,7 +422,7 @@
if (isInitVar(H2dVariableType.VITESSE_U)) {
if (isInitVar(H2dVariableType.VITESSE_V)) {
final TrPostFlecheContent vec = createSimpleVecteurContent(H2dVariableType.VITESSE, H2dVariableType.VITESSE_U,
- H2dVariableType.VITESSE_V, containsOnlyElementVar());
+ H2dVariableType.VITESSE_V, containsOnlyElementVar());
nameFleche.put(H2dVariableType.VITESSE, vec);
if (!isInitVar(H2dVariableType.VITESSE)) {
@@ -449,7 +433,7 @@
if (isInitVar(H2dVariableType.DEBIT_X)) {
if (isInitVar(H2dVariableType.DEBIT_Y)) {
final TrPostFlecheContent vec = createSimpleVecteurContent(H2dVariableType.DEBIT, H2dVariableType.DEBIT_X,
- H2dVariableType.DEBIT_Y, containsOnlyElementVar());
+ H2dVariableType.DEBIT_Y, containsOnlyElementVar());
nameFleche.put(H2dVariableType.DEBIT, vec);
if (!isInitVar(H2dVariableType.DEBIT)) {
varCreateData_.put(H2dVariableType.DEBIT, vec);
@@ -460,13 +444,12 @@
if (!isInitVar(H2dVariableType.COTE_EAU)) {
if (isInitVar(H2dVariableType.BATHYMETRIE) && isInitVar(H2dVariableType.HAUTEUR_EAU)) {
varCreateData_.put(H2dVariableType.COTE_EAU, new TrPostDataCreatedPlus(this, H2dVariableType.BATHYMETRIE,
- H2dVariableType.HAUTEUR_EAU));
+ H2dVariableType.HAUTEUR_EAU));
}
- }
- // sinon on cree la hauteur d'eau
+ } // sinon on cree la hauteur d'eau
else if (!isInitVar(H2dVariableType.HAUTEUR_EAU) && isInitVar(H2dVariableType.BATHYMETRIE)) {
varCreateData_.put(H2dVariableType.HAUTEUR_EAU, new TrPostDataCreatedMoins(this, H2dVariableType.COTE_EAU,
- H2dVariableType.BATHYMETRIE));
+ H2dVariableType.BATHYMETRIE));
}
Collection<H2dVariableType> vars = getInitVar();
if (vars != null) {
@@ -511,7 +494,9 @@
protected final void changeUserVar(final H2dVariableTypeCreated _old, final H2dVariableTypeCreated _new) {
if (_old != null && _new != null && isUserCreatedVar(_old)) {
final int i = CtuluLibArray.findObjectEgalEgal(variable_, _old);
- if (i < 0) { return; }
+ if (i < 0) {
+ return;
+ }
_old.removeShortName(getShortNameCreateVar());
getShortNameCreateVar().put(_new.getShortName(), _new);
if (!varUserCreateData_.containsKey(_old)) {
@@ -527,7 +512,9 @@
}
protected final void clearInterpolator() {
- if (interpolator_ != null) interpolator_.getVect().clear();
+ if (interpolator_ != null) {
+ interpolator_.getVect().clear();
+ }
}
@Override
@@ -548,7 +535,7 @@
protected TrPostDataMinMaxGlobalItem computeMinMax(final H2dVariableType _variable, final ProgressionInterface _prog) {
final ProgressionUpdater up = createUpdaterForMinMax(_variable);
final TrPostExtremVisitor visitor = new TrPostExtremVisitor(containsOnlyElementVar() ? getGrid().getEltNb()
- : getGrid().getPtsNb());
+ : getGrid().getPtsNb());
for (int i = getNbTimeStep() - 1; i >= 0; i--) {
final EfData d = getData(_variable, i);
visitor.setCurrentTime(getTimeStep(i));
@@ -569,7 +556,7 @@
* @return le conteneur du vecteur
*/
public final TrPostFlecheContent createSimpleVecteurContent(final H2dVariableType _name, final H2dVariableType _idxX,
- final H2dVariableType _idxY, final boolean _isElt) {
+ final H2dVariableType _idxY, final boolean _isElt) {
return new TrPostFlecheContentDefaut(this, _name, _idxX, _idxY);
}
@@ -598,7 +585,7 @@
}
private void fillAllValuesFrom(final InfoData _m, final int _element, final double _x, final double _y,
- final int _time) {
+ final int _time) {
if (_element >= 0) {
_m.put("X", CtuluLib.DEFAULT_NUMBER_FORMAT.format(_x));
_m.put("Y", CtuluLib.DEFAULT_NUMBER_FORMAT.format(_y));
@@ -611,7 +598,7 @@
@Override
public void fillInterpolateInfo(final InfoData _m, final int _element, final double _x, final double _y,
- final int _time, final String _layerTitle) {
+ final int _time, final String _layerTitle) {
// TODO a remplacer par isVolumique
if (containsOnlyElementVar()) {
fillVolumiqueInterpolateInfo(_m, _element, _x, _y, _time, _layerTitle);
@@ -621,12 +608,12 @@
if (selection != null && selection.isOnlyOnIndexSelected()) {
int maxIndex = selection.getMaxIndex();
_m.setTitle("-- " + TrResource.getS("Valeurs au noeud") + CtuluLibString.getEspaceString(maxIndex + 1)
- + (_layerTitle == null ? CtuluLibString.EMPTY_STRING : CtuluLibString.ESPACE + _layerTitle) + " --");
+ + (_layerTitle == null ? CtuluLibString.EMPTY_STRING : CtuluLibString.ESPACE + _layerTitle) + " --");
fillAllValuesFrom(_m, maxIndex, getGrid().getPtX(maxIndex), getGrid().getPtY(maxIndex), _time);
} else {
_m.setTitle("-- " + TrResource.getS("Interpolation")
- + (_layerTitle == null ? CtuluLibString.EMPTY_STRING : CtuluLibString.ESPACE + _layerTitle) + " --");
+ + (_layerTitle == null ? CtuluLibString.EMPTY_STRING : CtuluLibString.ESPACE + _layerTitle) + " --");
if (_element >= 0) {
_m.put("X", CtuluLib.DEFAULT_NUMBER_FORMAT.format(_x));
_m.put("Y", CtuluLib.DEFAULT_NUMBER_FORMAT.format(_y));
@@ -634,8 +621,9 @@
final EfGridDataInterpolator interpolator = getInterpolator();
for (int i = 0; i < variable_.length; i++) {
try {
- _m.put(variable_[i].getName(), CtuluLib.DEFAULT_NUMBER_FORMAT.format(interpolator.interpolate(_element, _x,
- _y, variable_[i], _time)));
+ _m.put(variable_[i].getName(),
+ CtuluLib.DEFAULT_NUMBER_FORMAT.format(interpolator.interpolate(_element, _x,
+ _y, variable_[i], _time)));
} catch (final IOException _evt) {
FuLog.error(_evt);
_m.put(variable_[i].getName(), "ERROR");
@@ -647,10 +635,9 @@
}
public void fillVolumiqueInterpolateInfo(final InfoData _m, final int _element, final double _x, final double _y,
- final int _time, final String _layerTitle) {
- _m
- .setTitle("-- " + TrResource.getS("Valeurs sur l'\xE9l\xE9ment") + CtuluLibString.getEspaceString(_element + 1)
- + " --");
+ final int _time, final String _layerTitle) {
+ _m.setTitle("-- " + TrResource.getS("Valeurs sur l'\xE9l\xE9ment") + CtuluLibString.getEspaceString(_element + 1)
+ + " --");
fillAllValuesFrom(_m, _element, _x, _y, _time);
}
@@ -684,7 +671,7 @@
}
protected final void fireVariableChanged(final H2dVariableType _old, final H2dVariableType _new,
- final boolean _dataChanged, final boolean _isVect, final Set _varDepending) {
+ final boolean _dataChanged, final boolean _isVect, final Set _varDepending) {
if (_dataChanged) {
updateCache(_new);
if (_varDepending != null) {
@@ -744,7 +731,7 @@
final VariableFactory fact = new VariableFactory();
final Variable pi = fact.createVariable("pi", CtuluLib.getDouble(Math.PI));
final Variable e = fact.createVariable("e", CtuluLib.getDouble(Math.E));
- return new Variable[] { gravite_, pi, e };
+ return new Variable[]{gravite_, pi, e};
}
public final TrPostDataCreated getCreatedVar(final H2dVariableType _t) {
@@ -763,21 +750,34 @@
@Override
public EfData getData(final H2dVariableType _variable, final int _timeStep) {
- if (_timeStep < 0) { return null; }
- if (isInitVar(_variable)) return getInitData(_variable, _timeStep);
- if (isCreatedVar(_variable)) { return ((TrPostDataCreated) varCreateData_.get(_variable)).getDataFor(_timeStep); }
- if (isUserCreatedVar(_variable)) { return ((TrPostDataCreated) varUserCreateData_.get(_variable))
- .getDataFor(_timeStep); }
+ if (_timeStep < 0) {
+ return null;
+ }
+ if (isInitVar(_variable)) {
+ return getInitData(_variable, _timeStep);
+ }
+ if (isCreatedVar(_variable)) {
+ return ((TrPostDataCreated) varCreateData_.get(_variable)).getDataFor(_timeStep);
+ }
+ if (isUserCreatedVar(_variable)) {
+ return ((TrPostDataCreated) varUserCreateData_.get(_variable)).getDataFor(_timeStep);
+ }
return null;
}
@Override
public double getData(final H2dVariableType _variable, final int _timeStep, final int _idxPt) throws IOException {
- if (isInitVar(_variable)) return getInitData(_variable, _timeStep, _idxPt);
- if (isCreatedVar(_variable)) { return ((TrPostDataCreated) varCreateData_.get(_variable)).getValue(_timeStep,
- _idxPt); }
- if (isUserCreatedVar(_variable)) { return ((TrPostDataCreated) varUserCreateData_.get(_variable)).getValue(
- _timeStep, _idxPt); }
+ if (isInitVar(_variable)) {
+ return getInitData(_variable, _timeStep, _idxPt);
+ }
+ if (isCreatedVar(_variable)) {
+ return ((TrPostDataCreated) varCreateData_.get(_variable)).getValue(_timeStep,
+ _idxPt);
+ }
+ if (isUserCreatedVar(_variable)) {
+ return ((TrPostDataCreated) varUserCreateData_.get(_variable)).getValue(
+ _timeStep, _idxPt);
+ }
return -1;
}
@@ -803,10 +803,9 @@
// public final File getFile() {
// return f_;
// }
-
@Override
public final CtuluRange getExtrema(final CtuluRange _r, final H2dVariableType _variable, final EfFilter _cond,
- final ProgressionInterface _prog) {
+ final ProgressionInterface _prog) {
if (_variable == null) {
if (_r != null) {
_r.setToNill();
@@ -860,8 +859,10 @@
*/
@Override
public final CtuluRange getExtremaForTimeStep(final CtuluRange _r, final H2dVariableType _variable, final int _time,
- final EfFilter _cond) {
- if (_variable == null) { return new CtuluRange(); }
+ final EfFilter _cond) {
+ if (_variable == null) {
+ return new CtuluRange();
+ }
CtuluRange range = _r;
if (range == null) {
range = new CtuluRange();
@@ -869,7 +870,9 @@
_r.setToNill();
}
final EfData d = getData(_variable, _time);
- if (d == null) { return null; }
+ if (d == null) {
+ return null;
+ }
return EfLib.getMinMax(d, range, _cond);
}
@@ -877,7 +880,9 @@
public final TrPostFlecheContent getFlecheContent(final H2dVariableType _t) {
if (fleches_ != null) {
for (int i = fleches_.length - 1; i >= 0; i--) {
- if (fleches_[i].getVar() == _t) { return fleches_[i]; }
+ if (fleches_[i].getVar() == _t) {
+ return fleches_[i];
+ }
}
}
return null;
@@ -895,18 +900,22 @@
* @return la variable utilisee pour le nombre de froude. null si non utilisee.
*/
protected final H2dVariableTypeCreated getFroudVar() {
- if (varCreateData_ == null) { return null; }
+ if (varCreateData_ == null) {
+ return null;
+ }
final String name = "froude";
for (final Iterator it = varCreateData_.keySet().iterator(); it.hasNext();) {
final H2dVariableType t = (H2dVariableType) it.next();
- if (name.equals(t.getShortName())) { return (H2dVariableTypeCreated) t; }
+ if (name.equals(t.getShortName())) {
+ return (H2dVariableTypeCreated) t;
+ }
}
return null;
}
@Override
public final TrPostDataMinMaxGlobalItem getGlobalExtrema(final H2dVariableType _variable,
- final ProgressionInterface _prog) {
+ final ProgressionInterface _prog) {
if (_variable == null) {
FuLog.warning("TRP: _var null");
return null;
@@ -918,7 +927,9 @@
if (s.size() > 1) {
FuLog.warning(new Throwable());
deleteAll(s);
- } else if (s.size() == 1) { return (TrPostDataMinMaxGlobalItem) s.next(); }
+ } else if (s.size() == 1) {
+ return (TrPostDataMinMaxGlobalItem) s.next();
+ }
}
initBd();
final TrPostDataMinMaxGlobalItem r = computeMinMax(_variable, _prog);
@@ -961,14 +972,15 @@
// initVarIdx_.get(_t); }
// return -1;
// }
-
public abstract double getInitData(H2dVariableType _varIdx, int _timeIdx, int _ptIdx) throws IOException;
protected final H2dVariableType getInitDataIndex(final String _varName) {
Collection<H2dVariableType> vars = getInitVar();
if (vars != null) {
for (H2dVariableType variableType : vars) {
- if (variableType.getName().equals(_varName)) { return variableType; }
+ if (variableType.getName().equals(_varName)) {
+ return variableType;
+ }
}
}
return null;
@@ -980,13 +992,17 @@
@Override
public final EfGridDataInterpolator getInterpolator() {
- if (interpolator_ == null) interpolator_ = new EfGridDataInterpolator(this, createVectorInterpolation());
+ if (interpolator_ == null) {
+ interpolator_ = new EfGridDataInterpolator(this, createVectorInterpolation());
+ }
return interpolator_;
}
@Override
public final boolean[] getMinPaletteActived(final H2dVariableType[] _v) {
- if (_v == null) { return null; }
+ if (_v == null) {
+ return null;
+ }
final boolean[] r = new boolean[_v.length];
for (int i = _v.length - 1; i >= 0; i--) {
r[i] = isDefaultPaletteMinValueDefined(_v[i]);
@@ -1001,7 +1017,9 @@
@Override
public final double[] getMinPaletteValues(final H2dVariableType[] _v) {
- if (_v == null) { return null; }
+ if (_v == null) {
+ return null;
+ }
final double[] r = new double[_v.length];
for (int i = _v.length - 1; i >= 0; i--) {
r[i] = getDefaultPaletteMinValueFor(_v[i]);
@@ -1090,12 +1108,14 @@
@Override
public String getFormatedTitle() {
return TrLib.formatName(getTitle()) + " | " + TrResource.getS("Fichier") + ": "
- + TrLib.formatFichier(getMainFile());
+ + TrLib.formatFichier(getMainFile());
}
@Override
public final H2dVariableType[] getUserCreatedVar() {
- if (varUserCreateData_ == null) { return new H2dVariableType[0]; }
+ if (varUserCreateData_ == null) {
+ return new H2dVariableType[0];
+ }
final H2dVariableType[] res = new H2dVariableType[varUserCreateData_.size()];
varUserCreateData_.keySet().toArray(res);
return res;
@@ -1109,7 +1129,9 @@
public final H2dVariableType getVarForShortName(final String _var) {
if (variable_ != null) {
for (int i = variable_.length - 1; i >= 0; i--) {
- if (variable_[i].getShortName().equals(_var)) { return variable_[i]; }
+ if (variable_[i].getShortName().equals(_var)) {
+ return variable_[i];
+ }
}
}
return null;
@@ -1117,7 +1139,9 @@
@Override
public final H2dVariableType getVariable(final int _idx) {
- if (_idx >= variable_.length || _idx < 0) { return null; }
+ if (_idx >= variable_.length || _idx < 0) {
+ return null;
+ }
return variable_[_idx];
}
@@ -1159,7 +1183,9 @@
if (tmpContainer_ == null) {
final File dbFile = getDbFile();
final String err = CtuluLibFile.canWrite(dbFile);
- if (err != null) { return err; }
+ if (err != null) {
+ return err;
+ }
tmpContainer_ = Db4o.openFile(dbFile.getAbsolutePath());
}
return null;
@@ -1171,8 +1197,8 @@
if (err != null) {
_analyze.setDesc(TrResource.getS("Sauvegarde des donn\xE9es"));
final String mess = TrResource.getS("Les sauvegardes ne seront pas effectu\xE9es") + CtuluLibString.LINE_SEP
- + TrResource.getS("Le fichier de sauvegarde {0} ne peut pas \xEAtre acc\xE9der:", getDbFile().getName())
- + CtuluLibString.LINE_SEP + err;
+ + TrResource.getS("Le fichier de sauvegarde {0} ne peut pas \xEAtre acc\xE9der:", getDbFile().getName())
+ + CtuluLibString.LINE_SEP + err;
_analyze.addError(mess, -1);
}
}
@@ -1191,7 +1217,7 @@
* @return true si operation reussie
*/
public final boolean interpolate(final H2dVariableType[] _t, final int _time, final double[] _values,
- final int _elementIdx, final double _x, final double _y) {
+ final int _elementIdx, final double _x, final double _y) {
final EfGridDataInterpolator interpolator = getInterpolator();
for (int i = _t.length - 1; i >= 0; i--) {
try {
@@ -1262,7 +1288,9 @@
*/
@Override
public final boolean isMinMaxCompute(final H2dVariableType _var) {
- if (tmpContainer_ == null) { return false; }
+ if (tmpContainer_ == null) {
+ return false;
+ }
final Query q = tmpContainer_.query();
TrPostDataMinMaxGlobalItem.updateQueryFor(q, _var.getShortName());
return q.execute().size() == 1;
@@ -1277,7 +1305,9 @@
@Override
public boolean isOpened(final File _f) {
- if (_f == null) { return false; }
+ if (_f == null) {
+ return false;
+ }
return getFiles().contains(_f);
}
@@ -1304,7 +1334,9 @@
public final int isVectVar(final H2dVariableType _var) {
if (fleches_ != null) {
for (int i = fleches_.length - 1; i >= 0; i--) {
- if (fleches_[i].getVar().equals(_var)) { return i; }
+ if (fleches_[i].getVar().equals(_var)) {
+ return i;
+ }
}
}
return -1;
@@ -1335,7 +1367,9 @@
@Override
public final void removeMinMax(final String _var) {
- if (tmpContainer_ == null) { return; }
+ if (tmpContainer_ == null) {
+ return;
+ }
final Query q = tmpContainer_.query();
TrPostDataMinMaxGlobalItem.updateQueryFor(q, _var);
final ObjectSet s = q.execute();
@@ -1346,12 +1380,16 @@
@Override
public final void removeUserVar(final H2dVariableTypeCreated[] _t, final CtuluCommandContainer _cmd) {
- if (varUserCreateData_ == null) { return; }
+ if (varUserCreateData_ == null) {
+ return;
+ }
if (_t != null) {
final List toRemove = Arrays.asList(_t);
final List varToKeep = new ArrayList(Arrays.asList(variable_));
// si rien n'a ete enleve on retourne
- if (!varToKeep.removeAll(toRemove)) { return; }
+ if (!varToKeep.removeAll(toRemove)) {
+ return;
+ }
// on teste les vecteurs
List flecheToRemove = null;
List flecheVarToRemove = null;
@@ -1388,8 +1426,7 @@
fireVariableRemoved(_t, false);
fireVarListModelChanged();
if (flecheToRemove != null) {
- fireVariableRemoved((H2dVariableType[]) flecheVarToRemove
- .toArray(new H2dVariableType[flecheVarToRemove.size()]), true);
+ fireVariableRemoved((H2dVariableType[]) flecheVarToRemove.toArray(new H2dVariableType[flecheVarToRemove.size()]), true);
fireFlecheListModelChanged();
}
if (_cmd != null) {
@@ -1404,7 +1441,6 @@
public void undo() {
addUserVar(_t, cr, null);
}
-
});
}
@@ -1431,7 +1467,9 @@
@Override
public final void saveIn(final ObjectContainer _db, final ProgressionInterface _prog) {
- if (_db == null) { return; }
+ if (_db == null) {
+ return;
+ }
_db.set(info_);
if (tmpContainer_ != null) {
final Query q = tmpContainer_.query();
@@ -1471,7 +1509,6 @@
// protected String generateId() {
// return CtuluLibGenerator.getInstance().deliverUniqueStringId();
// }
-
// protected void setInitVar(final H2dVariableType[] _v) {
// initVar_ =
// _v==null?Collections.EMPTY_LIST:Collections.unmodifiableCollection(Arrays.asList(_v));
@@ -1481,7 +1518,6 @@
// }
//
// }
-
public final void setInspected(final boolean _inspected) {
inspected_ = _inspected;
}
@@ -1505,7 +1541,7 @@
@Override
public final void updateUserValue(final H2dVariableTypeCreated _old, final H2dVariableTypeCreated _new,
- final TrPostDataCreated _newData, final CtuluCommandContainer _cmd) {
+ final TrPostDataCreated _newData, final CtuluCommandContainer _cmd) {
// on change la formule si necessaire, puis la variable
if (!isUserCreatedVar(_old)) {
FuLog.warning("TRP: var not created " + _old);
@@ -1514,7 +1550,9 @@
final TrPostDataCreated oldExpr = getUserCreatedVar(_old);
final boolean isFormuleChanged = _newData != null && !_newData.equals(oldExpr);
// pas de changement !
- if (!isFormuleChanged && (_new == _old)) { return; }
+ if (!isFormuleChanged && (_new == _old)) {
+ return;
+ }
if (isFormuleChanged) {
varUserCreateData_.put(_old, _newData);
}
@@ -1527,7 +1565,7 @@
}
fireVariableChanged(_old, _new, isFormuleChanged, false, TrPostDataHelper.getAllVarDependingOn(_old,
- TrPostSourceAbstract.this));
+ TrPostSourceAbstract.this));
if (_cmd != null) {
_cmd.addCmd(new CtuluCommand() {
@@ -1569,5 +1607,4 @@
public List<TrPostSource> getUsedSources() {
return Collections.emptyList();
}
-
}
\ No newline at end of file
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java 2012-05-25 17:29:59 UTC (rev 7237)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java 2012-05-25 17:57:09 UTC (rev 7238)
@@ -43,8 +43,6 @@
import org.fudaa.dodico.dico.DicoParams;
import org.fudaa.dodico.ef.EfData;
import org.fudaa.dodico.ef.EfDataElement;
-import org.fudaa.dodico.ef.EfElement;
-import org.fudaa.dodico.h2d.rubar.H2dRubarDonneesBrutes.NuagePoint;
import org.fudaa.dodico.h2d.rubar.H2dRubarGridAreteSource;
import org.fudaa.dodico.h2d.rubar.H2dRubarOuvrageContainer;
import org.fudaa.dodico.h2d.type.H2dVariableType;
@@ -66,7 +64,6 @@
import com.memoire.bu.BuMenu;
import com.memoire.fu.FuLog;
-import gnu.trove.TDoubleArrayList;
import org.fudaa.dodico.ef.EfDataNode;
import org.fudaa.dodico.rubar.io.RubarDFZResult;
@@ -296,25 +293,11 @@
private synchronized EfData getInitDataZFN(final int _timeIdx) {
if (_timeIdx != zfnTimeStep_) {
try {
- if (zfnValues_ == null) {
- zfnValues_ = new double[g_.getEltNb()];
- }
final double[][] initValues = getBathyValues(_timeIdx);
if (initValues == null) {
return null;
}
- double[] vals = null;
- for (int ielt = zfnValues_.length - 1; ielt >= 0; ielt--) {
- final EfElement e = g_.getElement(ielt);
- if ((vals == null) || vals.length != e.getPtNb()) {
- vals = new double[e.getPtNb()];
- }
- for (int i = vals.length - 1; i >= 0; i--) {
- vals[i] = initValues[0][e.getPtIndex(i)];
- }
- zfnValues_[ielt] = CtuluLibArray.getMoyenne(vals);
-
- }
+ zfnValues_ = initValues[0];
} catch (final IOException _e) {
if (!inspected_) {
impl_.error(CtuluUIAbstract.getDefaultErrorTitle(), _e.getMessage(), false);
@@ -324,9 +307,15 @@
}
zfnTimeStep_ = _timeIdx;
}
- return new EfDataElement(CtuluLibArray.copy(zfnValues_));
+ return new EfDataNode(CtuluLibArray.copy(zfnValues_));
}
+ /**
+ *
+ * @param _timeIdx
+ * @return tableau de double dont le 2 est de la taille du nombre de points.
+ * @throws IOException
+ */
double[][] getBathyValues(...
[truncated message content] |
|
From: <de...@us...> - 2012-05-25 23:19:35
|
Revision: 7240
http://fudaa.svn.sourceforge.net/fudaa/?rev=7240&view=rev
Author: deniger
Date: 2012-05-25 23:19:29 +0000 (Fri, 25 May 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentExpr.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarEnvFlecheContent.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedExpr.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatistic.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataVecteur.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/profile/MVProfileCourbeModel.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java 2012-05-25 23:13:01 UTC (rev 7239)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java 2012-05-25 23:19:29 UTC (rev 7240)
@@ -120,7 +120,7 @@
public TrPostDataVecteur getValues(final int _tIdx) {
if (_tIdx != lastTime_) {
lastTime_ = _tIdx;
- val_ = new TrPostDataVecteur(src_.getData(varVx_, lastTime_), src_.getData(varVy_, lastTime_));
+ val_ = new TrPostDataVecteur(src_.getData(varVx_, lastTime_), src_.getData(varVy_, lastTime_),src_.getGrid());
}
return val_;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentExpr.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentExpr.java 2012-05-25 23:13:01 UTC (rev 7239)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheContentExpr.java 2012-05-25 23:19:29 UTC (rev 7240)
@@ -15,177 +15,169 @@
import org.nfunk.jep.Variable;
/**
- * @author denf01a
- * @creation 27 janv. 2009
+ * @author denf01a @creation 27 janv. 2009
* @version
*
*/
public class TrPostFlecheContentExpr implements TrPostFlecheContent {
- H2dVariableType varName_;
+ H2dVariableType varName_;
+ TrPostDataCreatedExpr vx_;
+ TrPostDataCreatedExpr vy_;
+ private TrPostDataVecteur lastValue_;
+ boolean isElementData_;
+ private int lastTime_;
- TrPostDataCreatedExpr vx_;
- TrPostDataCreatedExpr vy_;
+ protected TrPostFlecheContentExpr(boolean _isElementData, H2dVariableType varName_, TrPostDataCreatedExpr vx_,
+ TrPostDataCreatedExpr vy_) {
+ super();
+ this.varName_ = varName_;
+ this.vx_ = vx_;
+ this.vy_ = vy_;
+ isElementData_ = _isElementData;
+ }
- private TrPostDataVecteur lastValue_;
- boolean isElementData_;
-
- private int lastTime_;
-
- protected TrPostFlecheContentExpr(boolean _isElementData, H2dVariableType varName_, TrPostDataCreatedExpr vx_,
- TrPostDataCreatedExpr vy_) {
- super();
- this.varName_ = varName_;
- this.vx_ = vx_;
- this.vy_ = vy_;
- isElementData_ = _isElementData;
- }
-
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public TrPostFlecheContent changeVar(H2dVariableType _name) {
- return new TrPostFlecheContentExpr(isElementData_, _name, vx_, vy_);
- }
-
-
+ public TrPostFlecheContent changeVar(H2dVariableType _name) {
+ return new TrPostFlecheContentExpr(isElementData_, _name, vx_, vy_);
+ }
-
@Override
- public void clearCache() {
- vx_.clearCache();
- vy_.clearCache();
- }
-
- @Override
- public void restore() {
- }
+ public void clearCache() {
+ vx_.clearCache();
+ vy_.clearCache();
+ }
@Override
- public TrPostDataCreatedSaver createSaver() {
- return null;
- }
+ public void restore() {
+ }
@Override
- public TrPostFlecheContent duplicate(TrPostSource _src) {
- return new TrPostFlecheContentExpr(isElementData_, varName_, vx_.createCopy(_src), vy_.createCopy(_src));
- }
+ public TrPostDataCreatedSaver createSaver() {
+ return null;
+ }
@Override
- public TrPostFlecheContent duplicate(TrPostSource _src, H2dVariableType name) {
- return new TrPostFlecheContentExpr(isElementData_, name, vx_.createCopy(_src), vy_.createCopy(_src));
- }
+ public TrPostFlecheContent duplicate(TrPostSource _src) {
+ return new TrPostFlecheContentExpr(isElementData_, varName_, vx_.createCopy(_src), vy_.createCopy(_src));
+ }
@Override
- public void fillWhithAllUsedVar(Set _res) {
- vx_.fillWhithAllUsedVar(_res);
- vy_.fillWhithAllUsedVar(_res);
- }
+ public TrPostFlecheContent duplicate(TrPostSource _src, H2dVariableType name) {
+ return new TrPostFlecheContentExpr(isElementData_, name, vx_.createCopy(_src), vy_.createCopy(_src));
+ }
- /**
- *
- */
@Override
- public EfData getDataFor(int time) {
- return getValues(time);
- }
+ public void fillWhithAllUsedVar(Set _res) {
+ vx_.fillWhithAllUsedVar(_res);
+ vy_.fillWhithAllUsedVar(_res);
+ }
+ /**
+ *
+ */
@Override
- public String getDescription() {
- return varName_.getName();
- }
+ public EfData getDataFor(int time) {
+ return getValues(time);
+ }
- /**
- *
- */
@Override
- public double getValue(int time, int object) {
- return Math.hypot(vx_.getValue(time, object), vy_.getValue(time, object));
- }
+ public String getDescription() {
+ return varName_.getName();
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public TrPostDataVecteur getValues(int _tIdx) {
- if (_tIdx != lastTime_) {
- lastTime_ = _tIdx;
- lastValue_ = new TrPostDataVecteur(vx_.getDataFor(_tIdx), vy_.getDataFor(_tIdx));
- }
- return lastValue_;
- }
+ public double getValue(int time, int object) {
+ return Math.hypot(vx_.getValue(time, object), vy_.getValue(time, object));
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public H2dVariableType getVar() {
- return varName_;
+ public TrPostDataVecteur getValues(int _tIdx) {
+ if (_tIdx != lastTime_) {
+ lastTime_ = _tIdx;
+ lastValue_ = new TrPostDataVecteur(vx_.getDataFor(_tIdx), vy_.getDataFor(_tIdx), vx_.getSrc().getGrid());
}
+ return lastValue_;
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public H2dVariableType getVx() {
- return null;
- }
+ public H2dVariableType getVar() {
+ return varName_;
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public String getVxDesc() {
- return getDescription() + " X";
- }
+ public H2dVariableType getVx() {
+ return null;
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public H2dVariableType getVy() {
- return null;
- }
+ public String getVxDesc() {
+ return getDescription() + " X";
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public String getVyDesc() {
- return getDescription() + " Y";
- }
+ public H2dVariableType getVy() {
+ return null;
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public boolean isEditable() {
- return true;
- }
+ public String getVyDesc() {
+ return getDescription() + " Y";
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public boolean isExpr() {
- return true;
- }
+ public boolean isEditable() {
+ return true;
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public TrPostFlecheContent isFleche() {
- return this;
- }
+ public boolean isExpr() {
+ return true;
+ }
- /**
- *
- */
+ /**
+ *
+ */
@Override
- public boolean updateConstantVar(Variable _var) {
- return vx_.updateConstantVar(_var) | vy_.updateConstantVar(_var);
- }
+ public TrPostFlecheContent isFleche() {
+ return this;
+ }
+ /**
+ *
+ */
+ @Override
+ public boolean updateConstantVar(Variable _var) {
+ return vx_.updateConstantVar(_var) | vy_.updateConstantVar(_var);
+ }
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarEnvFlecheContent.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarEnvFlecheContent.java 2012-05-25 23:13:01 UTC (rev 7239)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarEnvFlecheContent.java 2012-05-25 23:19:29 UTC (rev 7240)
@@ -34,7 +34,7 @@
* @param _idxY
*/
public TrPostRubarEnvFlecheContent(final TrPostSourceRubar _src, final H2dVariableType _name,
- final H2dVariableType _idxX, final H2dVariableType _idxY) {
+ final H2dVariableType _idxX, final H2dVariableType _idxY) {
src_ = _src;
varVx_ = _idxX;
varVy_ = _idxY;
@@ -105,7 +105,7 @@
@Override
public TrPostDataVecteur getValues(final int _tIdx) {
if (val_ == null) {
- val_ = new TrPostDataVecteur(src_.getEnveloppData(varVx_), src_.getEnveloppData(varVy_));
+ val_ = new TrPostDataVecteur(src_.getEnveloppData(varVx_), src_.getEnveloppData(varVy_), src_.getGrid());
}
return val_;
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java 2012-05-25 23:13:01 UTC (rev 7239)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java 2012-05-25 23:19:29 UTC (rev 7240)
@@ -343,7 +343,7 @@
varEnveloppData.put(H2dVariableType.VITESSE_U, qx);
final EfDataElement qy = new EfDataElement(qvMax);
varEnveloppData.put(H2dVariableType.VITESSE_V, qy);
- varEnveloppData.put(H2dVariableType.VITESSE, new TrPostDataVecteur(qx, qy));
+ varEnveloppData.put(H2dVariableType.VITESSE, new TrPostDataVecteur(qx, qy, getSrc().getGrid()));
src_.setEnvResultats(varEnveloppData);
src_.setEnvTime(envReader.getTfinal());
checkEnvTime();
@@ -629,11 +629,13 @@
src_.sedimentVariable.put(h2dRubarSedimentVariableType, new TrPostRubarSedimentVariable(src_, h2dRubarSedimentVariableType,
result));
idx++;
- TrPostRubarSedimentFondVariable value = new TrPostRubarSedimentFondVariable(src_, h2dRubarSedimentVariableType, result);
- H2dVariableTypeCreated variableFond = new H2dVariableTypeCreated(value.getDescription(), src_.getShortNameCreateVar());
- src_.sedimentVariable.put(variableFond, value);
- varInitIDx_.put(variableFond, SED_START_IDX + idx);
- idx++;
+ if (h2dRubarSedimentVariableType.getParentVariable().equals(H2dVariableTransType.EPAISSEUR)) {
+ TrPostRubarSedimentFondVariable value = new TrPostRubarSedimentFondVariable(src_, h2dRubarSedimentVariableType, result);
+ H2dVariableTypeCreated variableFond = new H2dVariableTypeCreated(value.getDescription(), src_.getShortNameCreateVar());
+ src_.sedimentVariable.put(variableFond, value);
+ varInitIDx_.put(variableFond, SED_START_IDX + idx);
+ idx++;
+ }
}
//TODO Mettre result dans bon container.
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedExpr.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedExpr.java 2012-05-25 23:13:01 UTC (rev 7239)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedExpr.java 2012-05-25 23:19:29 UTC (rev 7240)
@@ -70,6 +70,10 @@
}
}
+ public TrPostSource getSrc() {
+ return src_;
+ }
+
@Override
public void restore() {
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java 2012-05-25 23:13:01 UTC (rev 7239)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java 2012-05-25 23:19:29 UTC (rev 7240)
@@ -10,9 +10,7 @@
import java.util.Set;
import org.fudaa.dodico.ef.EfData;
-import org.fudaa.dodico.ef.EfDataElement;
import org.fudaa.dodico.ef.EfDataNode;
-import org.fudaa.dodico.ef.EfElement;
import org.fudaa.dodico.ef.EfGridInterface;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.fudaa.tr.post.TrPostSource;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatistic.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatistic.java 2012-05-25 23:13:01 UTC (rev 7239)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedStatistic.java 2012-05-25 23:19:29 UTC (rev 7240)
@@ -14,7 +14,6 @@
import java.io.IOException;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.ExecutorService;
import com.memoire.fu.FuLog;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataVecteur.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataVecteur.java 2012-05-25 23:13:01 UTC (rev 7239)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataVecteur.java 2012-05-25 23:19:29 UTC (rev 7240)
@@ -11,6 +11,7 @@
import org.fudaa.ctulu.interpolation.InterpolationVectorContainer;
import org.fudaa.dodico.ef.EfData;
import org.fudaa.dodico.ef.EfGridInterface;
+import org.fudaa.dodico.ef.EfLib;
import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator;
import org.fudaa.ebli.geometrie.GrSegment;
@@ -20,18 +21,28 @@
*/
public class TrPostDataVecteur extends CtuluCollectionDoubleAbstract implements EfData {
- final EfData x_;
- final EfData y_;
+ EfData x_;
+ EfData y_;
/**
* @param _x les valeurs selon x
* @param _y les valeurs selon y
*/
- public TrPostDataVecteur(final EfData _x, final EfData _y) {
+ public TrPostDataVecteur(final EfData _x, final EfData _y, EfGridInterface grid) {
x_ = _x;
y_ = _y;
- if (isElementData() != y_.isElementData()) throw new IllegalArgumentException(
- "x and y data must be in the same type");
+ if (x_.isElementData() != y_.isElementData()) {
+ if (!x_.isElementData()) {
+ x_ = EfLib.getElementDataDanger(_x, grid);
+ }
+ if (!y_.isElementData()) {
+ y_ = EfLib.getElementDataDanger(_y, grid);
+ }
+ }
+ if (isElementData() != y_.isElementData()) {
+ throw new IllegalArgumentException(
+ "x and y data must be in the same type");
+ }
}
@Override
@@ -40,7 +51,7 @@
}
public void interpolateValues(final GrSegment _target, final EfGridInterface _grid, final int _idxElt,
- final double _x, final double _y) {
+ final double _x, final double _y) {
_target.o_.x_ = _x;
_target.o_.y_ = _y;
double vx = 0;
@@ -81,5 +92,4 @@
public final double getVy(final int _ptIdx) {
return y_.getValue(_ptIdx);
}
-
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/profile/MVProfileCourbeModel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/profile/MVProfileCourbeModel.java 2012-05-25 23:13:01 UTC (rev 7239)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/profile/MVProfileCourbeModel.java 2012-05-25 23:19:29 UTC (rev 7240)
@@ -159,6 +159,7 @@
*
* @return the line used to build this profile
*/
+ @Override
public LineString getInitLine() {
return builder_ == null ? initialBuilder.selectedLine_ : builder_.getInitLine();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-06-27 23:09:55
|
Revision: 7408
http://fudaa.svn.sourceforge.net/fudaa/?rev=7408&view=rev
Author: deniger
Date: 2012-06-27 23:09:48 +0000 (Wed, 27 Jun 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrPostActionController.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2012-06-27 22:25:06 UTC (rev 7407)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2012-06-27 23:09:48 UTC (rev 7408)
@@ -1,9 +1,6 @@
/**
- * @creation 25 mars 2004
- * @modification $Date: 2007-06-14 12:01:40 $
- * @license GNU General Public License 2
- * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
- * @mail de...@fu...
+ * @creation 25 mars 2004 @modification $Date: 2007-06-14 12:01:40 $ @license GNU General Public License 2 @copyright (c)1998-2001
+ * CETMEF 2 bd Gambetta F-60231 Compiegne @mail de...@fu...
*/
package org.fudaa.fudaa.tr.post;
@@ -83,7 +80,7 @@
*/
@SuppressWarnings("serial")
public class TrPostVisuPanel extends TrVisuPanel implements TrPostDataListener, EbliAnimatedInterface, CtuluExportDataInterface, TimeStepFormatAware,
- ListDataListener {
+ ListDataListener {
private class ClearSonde extends EbliActionSimple {
@@ -110,7 +107,6 @@
setEnabled(true);
}
}
-
}
private class EvolutionAction extends EbliActionSimple {
@@ -136,7 +132,6 @@
setEnabled(true);
}
}
-
}
public static class ExportAction extends EbliActionSimple {
@@ -156,11 +151,13 @@
}
}
- public static TrPostVisuPanel buildVisuPanelForWidgets(final TrPostProjet projet, final TrPostCommonImplementation impl, final TrPostSource source) {
+ public static TrPostVisuPanel buildVisuPanelForWidgets(final TrPostProjet projet, final TrPostCommonImplementation impl,
+ final TrPostSource source) {
// -- creation de la legende --//
final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter(impl.getCurrentLayoutFille().getScene());
- final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl, projet, source.getFlecheListModel().getSize() == 0, legendeCalque, source);
+ final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl, projet, source.getFlecheListModel().getSize() == 0, legendeCalque,
+ source);
return pnVisu;
}
@@ -170,12 +167,14 @@
* @param _selection la selection
* @param pn peut etre null.//TODO WARN
*/
- public static void startExport(final CtuluUI _impl, final TrPostSource _src, final MvSelectionNodeOrEltData _selection, TrVisuPanel pn) {
+ public static void startExport(final CtuluUI _impl, final TrPostSource _src, final MvSelectionNodeOrEltData _selection,
+ TrVisuPanel pn) {
TrExportFactory fac = null;
if ((_src instanceof TrPostSourceTelemac3D)
&& CtuluLibDialog.showConfirmation(_impl.getParentComponent(), "TELEMAC 3D",
- TrResource.getS("Voulez-vous exporter votre projet dans son format 3D initial ?"), TrLib.getString("Exporter en 3D"),
- TrLib.getString(" Rester en 2D"))) {
+ TrResource.getS("Voulez-vous exporter votre projet dans son format 3D initial ?"),
+ TrLib.getString("Exporter en 3D"),
+ TrLib.getString(" Rester en 2D"))) {
fac = new TrExportFactory(_impl, TrTelemacImplHelper.getID(), ((TrPostSourceTelemac3D) _src).getInit3DSource(), pn);
fac.setInitIpobo(((TrPostSourceTelemac3D) _src).getIpobo());
fac.setIparams(((TrPostSourceTelemac3D) _src).getIparams());
@@ -186,37 +185,33 @@
}
if (_src.containsOnlyElementVar()) {
fac = new TrExportFactory(_impl, TrRubarImplHelper.getID(), _src.getNewVarListModel(), _src.getNewTimeListModel(),
- new TrPostSourceRubarNodeBathyAdapter((TrPostSourceRubar) _src), _src.getInterpolator().getVect(), pn);
+ new TrPostSourceRubarNodeBathyAdapter((TrPostSourceRubar) _src), _src.getInterpolator().getVect(),
+ pn);
}
if (fac == null) {
- fac = new TrExportFactory(_impl, (_src instanceof TrPostSourceReflux || _src instanceof TrPostSourceReaderReflux) ? TrRefluxImplHelper.getID()
- : null, _src, pn);
+ fac = new TrExportFactory(_impl,
+ (_src instanceof TrPostSourceReflux || _src instanceof TrPostSourceReaderReflux) ? TrRefluxImplHelper.getID()
+ : null, _src, pn);
}
if (_src instanceof TrPostSourceSerafin) {
fac.setIdate(((TrPostSourceSerafin) _src).getReaderSerafin().getReferenceDateInMillis());
}
MvExportFactory.startExport(fac, _impl, _selection);
}
-
CalqueActionSonde actionSonde = null;
-
ActionAnimationTreeSelection anim_;
-
TrPostInfoDelegate info_;
-
protected TrIsoLayer isoLayer_;
-
protected TrPostProjet projet_;
-
public boolean simplifiedInit;
-
/**
- * Tres important!!! c'est la source utilisee par le trpostvisupanel. Il est automatiquement plac\xE9 en param du
- * constructeur. Si rien n est mis apr defaut ce sera le source 0, donc le cas ou il y a une seule simul.
+ * Tres important!!! c'est la source utilisee par le trpostvisupanel. Il est automatiquement plac\xE9 en param du constructeur. Si
+ * rien n est mis apr defaut ce sera le source 0, donc le cas ou il y a une seule simul.
*/
private final TrPostSource source_;
- public TrPostVisuPanel(final TrPostCommonImplementation _impl, final TrPostProjet _projet, final BCalqueLegende _leg, final TrPostSource _src) {
+ public TrPostVisuPanel(final TrPostCommonImplementation _impl, final TrPostProjet _projet, final BCalqueLegende _leg,
+ final TrPostSource _src) {
this(_impl, _projet, false, _leg, _src);
}
@@ -227,7 +222,7 @@
* @param _src : l indice de la source courante utilis\xE9e
*/
public TrPostVisuPanel(final TrPostCommonImplementation _impl, final TrPostProjet _controller, final boolean _simplified,
- final BCalqueLegende _leg, final TrPostSource _src) {
+ final BCalqueLegende _leg, final TrPostSource _src) {
super(new TrPostActionController(_impl));
// -- mise a jour de l indice de la source courante --//
@@ -235,8 +230,9 @@
projet_ = _controller;
info_ = new TrPostInfoDelegate(source_, getEbliFormatter());
addCqInfos(source_.getGrid());
- if (_leg != null)
+ if (_leg != null) {
addCqLegende(_leg);
+ }
addCqMaillage(source_.getGrid(), info_);
final MvGridLayerGroup gr = getGridGroup();
gr.getPointLayer().setVisible(false);
@@ -245,8 +241,8 @@
polygonLayer.setVisible(false);
buildFrontiereLayer();
isoLayer_ = buildIsoLayer();
- final EbliActionInterface[] action = new EbliActionInterface[] { addActionEvolutionFor(getSource().containsOnlyElementVar()),
- new TrIsoLineAction(this), getClearSondeAction() };
+ final EbliActionInterface[] action = new EbliActionInterface[]{addActionEvolutionFor(),
+ new TrIsoLineAction(this), getClearSondeAction()};
simplifiedInit = _simplified;
if (!_simplified) {
final TrPostFlecheLayer fleche = new TrPostFlecheLayer(source_);
@@ -275,7 +271,7 @@
_controller.registerTimeListenerTo(_src, this);
}
- protected EbliActionInterface addActionEvolutionFor(final boolean _rubar) {
+ protected EbliActionInterface addActionEvolutionFor() {
return new EvolutionAction();
}
@@ -293,10 +289,12 @@
TrPostCourbeBuilder.chooseAndBuild(this, (ZCalqueAffichageDonnees) getCalqueActif(), idx, selectedVar);
} else if (isSelectionOkForEvolutionSonde()) {
- TrPostCourbeBuilder.chooseAndBuild(this, (ZCalqueAffichageDonnees) getCalqueActif(), getInterpolePointForEvol(), getSelectedVarInCalqueActif());
+ TrPostCourbeBuilder.chooseAndBuild(this, (ZCalqueAffichageDonnees) getCalqueActif(), getInterpolePointForEvol(),
+ getSelectedVarInCalqueActif());
} else {
- TrPostCourbeBuilder.chooseAndBuild(this, (ZCalqueAffichageDonnees) getCalqueActif(), null, null, getSelectedVarInCalqueActif());
+ TrPostCourbeBuilder.chooseAndBuild(this, (ZCalqueAffichageDonnees) getCalqueActif(), null, null,
+ getSelectedVarInCalqueActif());
}
@@ -306,7 +304,7 @@
final MvFrontierLayerAbstract l = new TrFrontierLayer(source_, info_);
l.setName("cqGridFr");
l.setTitle(TrResource.getS("fronti\xE8res"));
- l.setActions(new EbliActionInterface[] { l.create3DAction(getImpl(), getCmdMng()) });
+ l.setActions(new EbliActionInterface[]{l.create3DAction(getImpl(), getCmdMng())});
getDonneesCalque().enPremier(l);
}
@@ -340,8 +338,9 @@
}
@Override
- public void dataChanged(final H2dVariableType _old, final H2dVariableType _new, final boolean _contentChanged, final boolean _isFleche,
- final Set _varDependingOnOld) {
+ public void dataChanged(final H2dVariableType _old, final H2dVariableType _new, final boolean _contentChanged,
+ final boolean _isFleche,
+ final Set _varDependingOnOld) {
final BCalque[] cq = getDonneesCalque().getTousCalques();
if (cq != null) {
for (int i = cq.length - 1; i >= 0; i--) {
@@ -413,7 +412,6 @@
public TrBcBoundaryLayer getBcLayer() {
return null;
}
-
ClearSonde actionClearSonde;
public ClearSonde getClearSondeAction() {
@@ -432,6 +430,7 @@
}
private class BuildingData {
+
ZCalqueLigneBrisee[] buildings;
boolean useBoundary = false;
}
@@ -461,8 +460,9 @@
MvFrontierLayerAbstract boundaryLayer = getFrontierLayer3D();
boolean useFrontier = boundaryLayer != null && boundaryLayer.getModeleCl().getNbFrontier() > 0;
if (!useFrontier && buildingLayers.isEmpty()) {
- getImpl().warn(TrLib.getString("Affichage des batiments 3D"), TrLib.getString("Il n'y a pas de donn\xE9es permettant l'affichage de batiments"),
- true);
+ getImpl().warn(TrLib.getString("Affichage des batiments 3D"), TrLib.getString(
+ "Il n'y a pas de donn\xE9es permettant l'affichage de batiments"),
+ true);
return new BuildingData();
}
BuildingLayerSelector selector = new BuildingLayerSelector(buildingLayers, useFrontier);
@@ -495,7 +495,6 @@
/*
* protected void anim(){ if (anim_ == null) anim_ = new EbliAnimation(this); anim_.go(); }
*/
-
public TrPostInfoDelegate getInfo() {
return info_;
}
@@ -536,7 +535,7 @@
/**
* Retourne le pas de temps du calque actif. Retourne -1 sinon.
- *
+ *
* @return
*/
public int getSelectedTimeInCalqueActif() {
@@ -570,7 +569,7 @@
/**
* Action qui recupere la sonde comme action.
- *
+ *
* @return
*/
public CalqueActionSonde getSondeAction() {
@@ -659,7 +658,7 @@
return;
}
Tr3DFactory.afficheFrame(_f, source_, source_.getInterpolator().getVect(), getImpl(), getGroupFond(),
- buildingLayers3D.useBoundary ? getFrontierLayer3D() : null, buildingLayers3D.buildings);
+ buildingLayers3D.useBoundary ? getFrontierLayer3D() : null, buildingLayers3D.buildings);
}
@@ -687,5 +686,4 @@
@Override
public void intervalRemoved(ListDataEvent e) {
}
-
}
\ No newline at end of file
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrPostActionController.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrPostActionController.java 2012-06-27 22:25:06 UTC (rev 7407)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrPostActionController.java 2012-06-27 23:09:48 UTC (rev 7408)
@@ -22,9 +22,9 @@
import org.fudaa.fudaa.sig.layer.FSigVisuPanelController;
/**
- * Un ActionController sp\xE9cifique qui permet de preciser les palettes qui doivent rester en tant que JDialog et celle
- * qui seront dockes dans la frame Flexdock.
- *
+ * Un ActionController sp\xE9cifique qui permet de preciser les palettes qui doivent rester en tant que JDialog et celle qui seront
+ * dockes dans la frame Flexdock.
+ *
* @author deniger
*/
public class TrPostActionController extends FSigVisuPanelController {
@@ -34,11 +34,10 @@
*/
Map<String, EbliActionPaletteAbstract> mapTabPalettes_ = new HashMap<String, EbliActionPaletteAbstract>(2);
Collection<EbliActionPaletteAbstract> tabPalettes_ = null;
+ Collection<String> useAsPalette = Arrays.asList("CONFIGURE", "CHANGE_REFERENCE", "GLOBAL_MOVE", "GLOBAL_ROTATE",
+ "PALETTE_DISTANCE");
+ Collection<String> useAsTab = Arrays.asList("INFOS", "PALETTE_EDTION");
- Collection<String> useAsPalette = Arrays.asList("CONFIGURE", "CHANGE_REFERENCE", "GLOBAL_MOVE", "GLOBAL_ROTATE");
-
- Collection<String> useAsTab = Arrays.asList("INFOS", "PALETTE_EDTION"/**, "NAVIGATE"**/);
-
/**
* @param _ui l'ui
*/
@@ -48,7 +47,9 @@
@Override
protected void buildButtonGroupNavigation() {
- if (navigationActionGroup_ != null) { return; }
+ if (navigationActionGroup_ != null) {
+ return;
+ }
super.buildButtonGroupNavigation();
final EbliActionInterface[] actions = navigationActionGroup_;
navigationActionGroup_ = removePalettes(actions);
@@ -62,13 +63,17 @@
@Override
protected void buildButtonGroupStandard() {
- if (standardActionGroup_ != null) return;
+ if (standardActionGroup_ != null) {
+ return;
+ }
super.buildButtonGroupStandard();
standardActionGroup_ = removePalettes(standardActionGroup_);
}
protected void buildButtonGroupSpecifiques() {
- if (standardActionGroup_ != null) return;
+ if (standardActionGroup_ != null) {
+ return;
+ }
super.buildButtonGroupStandard();
standardActionGroup_ = removePalettes(standardActionGroup_);
@@ -80,17 +85,20 @@
@Override
public Collection<EbliActionPaletteAbstract> getTabPaletteAction() {
// si deja fait on retourne de suite
- if (tabPalettes_ != null) return tabPalettes_;
+ if (tabPalettes_ != null) {
+ return tabPalettes_;
+ }
initSpecificActions();
tabPalettes_ = new ArrayList<EbliActionPaletteAbstract>(3);
for (final String str : useAsTab) {
final EbliActionPaletteAbstract o = mapTabPalettes_.get(str);
- if (o != null) tabPalettes_.add(o);
+ if (o != null) {
+ tabPalettes_.add(o);
+ }
}
return tabPalettes_;
}
-
@Override
public FSigVisuPanel getVisuPanel() {
return super.getVisuPanel();
@@ -112,13 +120,12 @@
protected EbliActionInterface[] getApplicationActions() {
return removePalettes(pn_.getApplicationActions());
}
-
private List<EbliActionPaletteAbstract> toHide = new ArrayList<EbliActionPaletteAbstract>();
/**
* @param actions les actions a trier
- * @return la listes des actions a ajouter dans les menus et autres. Les autres ( les palettes) seront visible tout le
- * temps dans des dock.
+ * @return la listes des actions a ajouter dans les menus et autres. Les autres ( les palettes) seront visible tout le temps
+ * dans des dock.
*/
private EbliActionInterface[] removePalettes(final EbliActionInterface[] actions) {
@@ -126,7 +133,9 @@
for (int i = 0; i < actions.length; i++) {
final EbliActionInterface action = actions[i];
- if (action == null) continue;
+ if (action == null) {
+ continue;
+ }
final String value = (String) action.getValue(Action.ACTION_COMMAND_KEY);
final boolean isPalette = action instanceof EbliActionPaletteAbstract;
if ("GLOBAL_MOVE".equals(value) || "GLOBAL_ROTATE".equals(value)) {
@@ -136,6 +145,7 @@
}
if (!isPalette || useAsPalette.contains(value)) {
acts.add(action);
+ ((EbliActionPaletteAbstract) action).setDialogIsModal(false);
}
if (isPalette && useAsTab.contains(value)) {
mapTabPalettes_.put(value, (EbliActionPaletteAbstract) action);
@@ -152,5 +162,4 @@
}
}
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-08-14 00:25:21
|
Revision: 7547
http://fudaa.svn.sourceforge.net/fudaa/?rev=7547&view=rev
Author: deniger
Date: 2012-08-14 00:25:15 +0000 (Tue, 14 Aug 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparator.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparator.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparator.java 2012-08-14 00:14:01 UTC (rev 7546)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceComparator.java 2012-08-14 00:25:15 UTC (rev 7547)
@@ -143,7 +143,7 @@
@Override
public EfData getInitData(final int _varIdx, final int _timeIdx) {
H2dVariableType src = srcVariable_[_varIdx];
- final EfData refData = ref_.getData(src, _timeIdx);
+ EfData refData = ref_.getData(src, _timeIdx);
if (compVar_ != null && compVar_.containsKey(src)) {
src = (H2dVariableType) compVar_.get(src);
}
@@ -155,7 +155,7 @@
if (refData.isElementData()) {
projData = EfLib.getElementDataDanger(projData, proj_.getGrid());
} else {
- projData = proj_.getGrid().getNeighbors().getDataNodeSimple(projData);
+ refData = EfLib.getElementDataDanger(refData, ref_.getGrid());
}
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java 2012-08-14 00:14:01 UTC (rev 7546)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceProjected.java 2012-08-14 00:25:15 UTC (rev 7547)
@@ -267,13 +267,14 @@
final double[] res = new double[nbDestSupport];
final boolean srcIsRubar = srcInit_.containsElementVar();
EfData datas = srcInit_.getData(_varIdx, _srcTimeIdx);
+ if (datas == null) {
+ throw new IOException(DodicoLib.getS("Fichier invalide"));
+ }
//for rubar, all values must be defined on meshes:
if (srcIsRubar && !datas.isElementData()) {
datas = EfLib.getElementDataDanger(datas, srcInit_.getGrid());
}
- if (datas == null) {
- throw new IOException(DodicoLib.getS("Fichier invalide"));
- }
+
final EfGridInterface srcGrid = srcInit_.getGrid();
for (int i = 0; i < nbDestSupport; i++) {
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-08-28 12:48:15
|
Revision: 7584
http://fudaa.svn.sourceforge.net/fudaa/?rev=7584&view=rev
Author: deniger
Date: 2012-08-28 12:48:04 +0000 (Tue, 28 Aug 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubarMaxContainer.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java 2012-08-28 09:31:04 UTC (rev 7583)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java 2012-08-28 12:48:04 UTC (rev 7584)
@@ -173,7 +173,7 @@
if (exposeTimeInitTime_.containsKey(_timeIdx)) {
ok = tpcReader_.read(exposeTimeInitTime_.get(_timeIdx), tpcValues_);
} else {
- getMaxContainer(_timeIdx).getValueTPC(tpcValues_, tpcReader_);
+ getMaxContainer(_timeIdx).getValues(tpcValues_, tpcReader_);
}
} else {
ok = tpcReader_.read(_timeIdx, tpcValues_);
@@ -327,18 +327,18 @@
initValues[0][i] = g_.getPtZ(i);
}
} else {
- if (!useEnvTime_ || (exposeTimeInitTime_ == null) || (exposeTimeInitTime_.containsKey(_timeIdx))) {
- int idxTime = _timeIdx;
- if (exposeTimeInitTime_ != null) {
- idxTime = exposeTimeInitTime_.get(_timeIdx);
+ if (useEnvTime_ && exposeTimeExtrapolValues_ != null) {
+ if (exposeTimeInitTime_.containsKey(_timeIdx)) {
+ zfnReader_.read(exposeTimeInitTime_.get(_timeIdx), initValues);
+ } else {
+ final TrPostSourceRubarMaxContainer c = getMaxContainer(_timeIdx);
+ if (c == null) {
+ return null;
+ }
+ c.getValueZFN(initValues, zfnReader_);
}
- zfnReader_.read(idxTime, initValues);
} else {
- final TrPostSourceRubarMaxContainer c = getMaxContainer(_timeIdx);
- if (c == null) {
- return null;
- }
- c.getValueZFN(initValues, zfnReader_);
+ zfnReader_.read(_timeIdx, initValues);
}
}
return initValues;
@@ -349,20 +349,18 @@
return zfnValues_[idxPt];
}
try {
- if (!useEnvTime_ || (exposeTimeInitTime_ == null) || (exposeTimeInitTime_.containsKey(_timeIdx))) {
- int idxTime = _timeIdx;
- if (exposeTimeInitTime_ != null) {
- idxTime = exposeTimeInitTime_.get(_timeIdx);
+ if (useEnvTime_ && exposeTimeExtrapolValues_ != null) {
+ if (exposeTimeInitTime_.containsKey(_timeIdx)) {
+ return zfnReader_.read(0, exposeTimeInitTime_.get(_timeIdx), idxPt);
+ } else {
+ final TrPostSourceRubarMaxContainer c = getMaxContainer(_timeIdx);
+ if (c == null) {
+ return -1;
+ }
+ c.getValueZFN(idxPt, zfnReader_);
}
- double valeur = zfnReader_.read(0, idxTime, idxPt);
- return valeur;
} else {
- final TrPostSourceRubarMaxContainer c = getMaxContainer(_timeIdx);
- if (c == null) {
- return -1;
- }
- return c.getValueZFN(idxPt, zfnReader_);
-
+ return zfnReader_.read(0, _timeIdx, idxPt);
}
} catch (final IOException _e) {
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubarMaxContainer.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubarMaxContainer.java 2012-08-28 09:31:04 UTC (rev 7583)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceRubarMaxContainer.java 2012-08-28 12:48:04 UTC (rev 7584)
@@ -195,7 +195,7 @@
}
}
- protected void getValueTPC(final double[][] _d, final RubarSolutionSequentielReader _tpcReader) throws IOException {
+ protected void getValues(final double[][] _d, final RubarSolutionSequentielReader _tpcReader) throws IOException {
if (outOfBound_) {
_tpcReader.read(tInfInTPC_, _d);
} else {
@@ -215,7 +215,7 @@
}
protected void getValueZFN(final double[][] _d, final RubarSolutionSequentielReader _zfnReader) throws IOException {
- getValueTPC(_d, _zfnReader);
+ getValues(_d, _zfnReader);
}
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-11-16 15:56:47
|
Revision: 7893
http://fudaa.svn.sourceforge.net/fudaa/?rev=7893&view=rev
Author: deniger
Date: 2012-11-16 15:56:37 +0000 (Fri, 16 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLineAdder.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrIsoLineAction.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLineAdder.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLineAdder.java 2012-11-16 14:48:29 UTC (rev 7892)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLineAdder.java 2012-11-16 15:56:37 UTC (rev 7893)
@@ -22,6 +22,7 @@
import org.fudaa.ctulu.CtuluTaskDelegate;
import org.fudaa.ctulu.ProgressionInterface;
import org.fudaa.ctulu.collection.CtuluArrayDouble;
+import org.fudaa.ctulu.gis.GISAttributeDouble;
import org.fudaa.ctulu.gis.GISAttributeInterface;
import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee;
import org.fudaa.ctulu.interpolation.InterpolationVectorContainer;
@@ -56,15 +57,12 @@
final double prec_;
final TrPostSource src_;
final int[] ts_;
-
boolean useOnValueByLayer_;
-
final CtuluArrayDouble values_;
-
final H2dVariableType var_;
public TrIsoLineAdder(final TrPostSource _src, final TrPostVisuPanel _pn, final double[] _values, final int[] _ts,
- final H2dVariableType _var, final double _prec) {
+ final H2dVariableType _var, final double _prec) {
super();
src_ = _src;
pn_ = _pn;
@@ -76,7 +74,6 @@
private void afficheRes(final EfIsoResultDefault _res, final int _tidx, final double _v) {
BuLib.invokeLater(new Runnable() {
-
@Override
public void run() {
@@ -85,9 +82,16 @@
titre += CtuluLibString.ESPACE + _v;
}
final GISZoneCollectionLigneBrisee lb = new GISZoneCollectionLigneBrisee();
+
getDestGroup();
- if (grVar_ == null) { return; }
+ if (grVar_ == null) {
+ return;
+ }
lb.setAttributes(grVar_.getAttributes(), null);
+ if (var_ == H2dVariableType.BATHYMETRIE) {
+ GISAttributeInterface att = grVar_.getAtt().getAttribute(var_.getName());
+ lb.setAttributeIsZ((GISAttributeDouble) att);
+ }
lb.addAll(_res, null, false);
final ZCalqueLigneBrisee cq = getDestGroup().addLigneBriseeLayerAct(titre, lb);
// on n'affiche pas les sommets: plus joli
@@ -96,7 +100,6 @@
cq.setIconModel(i, model);
}
}
-
});
}
@@ -107,7 +110,9 @@
if (cq != null) {
for (int i = 0; i < cq.length; i++) {
final Object o = cq[i].getClientProperty("iso.type");
- if (o == var_ && cq[i] instanceof FSigLayerGroup) { return (FSigLayerGroup) cq[i]; }
+ if (o == var_ && cq[i] instanceof FSigLayerGroup) {
+ return (FSigLayerGroup) cq[i];
+ }
}
}
return null;
@@ -134,7 +139,7 @@
}
grVar_ = gr.addGroupAct(TrResource.getS("isolignes pour {0}", var_.toString()), gr, true,
- new GISAttributeInterface[] { att });
+ new GISAttributeInterface[]{att});
grVar_.putClientProperty("iso.type", var_);
}
return grVar_;
@@ -163,7 +168,9 @@
EfData data = src.getData(var_, tidx);
final EfGridDataInterpolationValuesAdapter values = new EfGridDataInterpolationValuesAdapter(src, tidx);
final EfIsoActivitySearcher searcher = act.search(var_, data, _prog, an, values);
- if (searcher == null) return;
+ if (searcher == null) {
+ return;
+ }
for (int v = 0; v < nbValues; v++) {
final double value = values_.getValue(v);
searcher.search(value, res, _prog, an);
@@ -193,12 +200,10 @@
public void go() {
final CtuluTaskDelegate task = pn_.getImpl().createTask(TrLib.getString("Rechercher les isolignes"));
task.start(new Runnable() {
-
@Override
public void run() {
goAct(task.getStateReceiver());
}
-
});
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrIsoLineAction.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrIsoLineAction.java 2012-11-16 14:48:29 UTC (rev 7892)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrIsoLineAction.java 2012-11-16 15:56:37 UTC (rev 7893)
@@ -10,7 +10,6 @@
import java.awt.event.ActionEvent;
import org.fudaa.ebli.commun.EbliActionSimple;
-import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.fudaa.tr.common.TrResource;
import org.fudaa.fudaa.tr.post.TrIsoLineWizard;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-12-14 18:08:46
|
Revision: 8136
http://fudaa.svn.sourceforge.net/fudaa/?rev=8136&view=rev
Author: deniger
Date: 2012-12-14 18:08:39 +0000 (Fri, 14 Dec 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelAbstract.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelEltDataAdapter.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheModel.java
Removed Paths:
-------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostModelInterface.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2012-12-14 18:08:12 UTC (rev 8135)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2012-12-14 18:08:39 UTC (rev 8136)
@@ -7,6 +7,7 @@
*/
package org.fudaa.fudaa.tr.post;
+import org.fudaa.fudaa.meshviewer.layer.MvIsoModelInterface;
import com.memoire.bu.BuMenuItem;
import com.memoire.bu.BuResource;
import com.memoire.fu.FuLog;
@@ -221,7 +222,7 @@
}
public static int selectionElement(final GrPoint _pt, final int _tolerance, final GrMorphisme _versReel,
- final TrPostModelInterface _model,
+ final MvIsoModelInterface _model,
final GrBoite _clipReel) {
GrBoite bClip = _model.getDomaine();
final double distanceReel = GrMorphisme.convertDistanceXY(_versReel, _tolerance);
@@ -252,7 +253,7 @@
* @param _model
* @return
*/
- public static int sondeSelection(final GrPoint _prReel, final TrPostModelInterface _model) {
+ public static int sondeSelection(final GrPoint _prReel, final MvIsoModelInterface _model) {
final EfGridInterface grid = _model.getGrid();
if (grid.getIndex() != null) {
return EfIndexHelper.getElementEnglobant(grid, _prReel.x_, _prReel.y_, null);
@@ -274,7 +275,7 @@
return -1;
}
- private static int sondeSelectionLong(final GrPoint _prReel, final TrPostModelInterface _model) {
+ private static int sondeSelectionLong(final GrPoint _prReel, final MvIsoModelInterface _model) {
final GrPolygone poly = new GrPolygone();
for (int i = _model.getNbElt() - 1; i >= 0; i--) {
_model.polygone(poly, i, true);
@@ -859,7 +860,7 @@
return;
}
boolean keepAntialias = false;
- TrPostModelInterface modelToUse = getIsoModelAbstract();
+ MvIsoModelInterface modelToUse = getIsoModelAbstract();
if (traceIsoLine_) {
isos = new TraceIsoLignesAvecPlages(paletteCouleur_, alpha_, ligneModel_);
keepAntialias = true;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelAbstract.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelAbstract.java 2012-12-14 18:08:12 UTC (rev 8135)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelAbstract.java 2012-12-14 18:08:39 UTC (rev 8136)
@@ -7,6 +7,7 @@
*/
package org.fudaa.fudaa.tr.post;
+import org.fudaa.fudaa.meshviewer.layer.MvIsoModelInterface;
import com.memoire.bu.BuTable;
import com.memoire.fu.FuLog;
import javax.swing.ListModel;
@@ -36,7 +37,7 @@
* @author Fred Deniger
* @version $Id: TrIsoModelAbstract.java,v 1.24 2007-05-04 14:01:51 deniger Exp $
*/
-public abstract class TrIsoModelAbstract extends MvElementModelDefault implements MvNodeModel, TrPostModelInterface {
+public abstract class TrIsoModelAbstract extends MvElementModelDefault implements MvNodeModel, MvIsoModelInterface {
TrPostSource s_;
ListModel varModel_;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelEltDataAdapter.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelEltDataAdapter.java 2012-12-14 18:08:12 UTC (rev 8135)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoModelEltDataAdapter.java 2012-12-14 18:08:39 UTC (rev 8136)
@@ -11,6 +11,7 @@
*/
package org.fudaa.fudaa.tr.post;
+import org.fudaa.fudaa.meshviewer.layer.MvIsoModelInterface;
import com.memoire.bu.BuTable;
import com.vividsolutions.jts.geom.Envelope;
import org.fudaa.ctulu.CtuluAnalyze;
@@ -30,7 +31,7 @@
* @author fred deniger
* @version $Id: TrIsoModelEltDataAdapter.java,v 1.4 2007-06-11 13:08:18 deniger Exp $
*/
-public class TrIsoModelEltDataAdapter implements TrPostModelInterface {
+public class TrIsoModelEltDataAdapter implements MvIsoModelInterface {
final EfIsoRestructuredGridResult res_;
EfData currentNodeData_;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheModel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheModel.java 2012-12-14 18:08:12 UTC (rev 8135)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheModel.java 2012-12-14 18:08:39 UTC (rev 8136)
@@ -4,6 +4,7 @@
*/
package org.fudaa.fudaa.tr.post;
+import org.fudaa.fudaa.meshviewer.layer.MvIsoModelInterface;
import com.memoire.bu.BuTable;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Envelope;
@@ -38,7 +39,7 @@
* @author Fred Deniger
* @version $Id: TrPostFlecheModel.java,v 1.32 2007-06-20 12:23:40 deniger Exp $
*/
-public class TrPostFlecheModel implements ZModeleFleche, TrPostModelInterface {
+public class TrPostFlecheModel implements ZModeleFleche, MvIsoModelInterface {
TrPostFilterLayer cond_;
TrPostFlecheContent current_;
Deleted: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostModelInterface.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostModelInterface.java 2012-12-14 18:08:12 UTC (rev 8135)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostModelInterface.java 2012-12-14 18:08:39 UTC (rev 8136)
@@ -1,65 +0,0 @@
-/**
- * @creation 21 d\xE9c. 2004
- * @modification $Date: 2007-06-05 09:01:14 $
- * @license GNU General Public License 2
- * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
- * @mail fud...@li...
- */
-package org.fudaa.fudaa.tr.post;
-
-import com.vividsolutions.jts.geom.Envelope;
-import org.fudaa.dodico.ef.EfGridInterface;
-import org.fudaa.ebli.calque.ZModelePolygone;
-
-/**
- * @author Fred Deniger
- * @version $Id: TrPostModelInterface.java,v 1.4 2007-06-05 09:01:14 deniger Exp $
- */
-public interface TrPostModelInterface extends ZModelePolygone {
- /**
- * @return le nombre d'element
- */
- int getNbElt();
-
- EfGridInterface getGrid();
-
- public Envelope getEnvelopeForElement(int idxElt) ;
-
- /**
- *
- * @param idxElt
- * @return
- */
- int getNbPt(int idxElt);
-
- /**
- *
- * @param idxElt
- * @param idxPtInElt
- * @return x value
- */
- double getX(int idxElt,int idxPtInElt);
- /**
- *
- * @param idxElt
- * @param idxPtInElt
- * @return
- */
- double getY(int idxElt,int idxPtInElt);
- /**
- *
- * @param idxElt
- * @return true if the element must be painted
- */
- @Override
- boolean isPainted(int idxElt);
-
- double[] fillWithData(final int _idxElement, final double[] _l);
-/**
- *
- * @param idxElt
- * @param idxPtOnElt the index in the mesh.
- * @return the value
- */
- public double getDatatFor(int idxElt, int idxPtOnElt);
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2015-03-16 21:31:55
|
Revision: 9073
http://sourceforge.net/p/fudaa/svn/9073
Author: deniger
Date: 2015-03-16 21:31:52 +0000 (Mon, 16 Mar 2015)
Log Message:
-----------
dev
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java
Added Paths:
-----------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPtX.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPtY.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2015-03-16 21:26:46 UTC (rev 9072)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2015-03-16 21:31:52 UTC (rev 9073)
@@ -81,6 +81,8 @@
import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedMoins;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedMultiply;
import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedPlus;
+import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedPtX;
+import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedPtY;
import org.fudaa.fudaa.tr.post.data.TrPostDataHelper;
import org.fudaa.fudaa.tr.post.data.TrPostDataInfoDoc;
import org.fudaa.fudaa.tr.post.data.TrPostDataListener;
@@ -414,7 +416,9 @@
protected void buildDefaultVectors() {
final Map nameFleche = new HashMap();
varCreateData_ = new HashMap();
- // par defaut vitesse et debit
+ //x et y :
+ varCreateData_.put(H2dVariableType.POINT_X, new TrPostDataCreatedPtX(this)); // par defaut vitesse et debit
+ varCreateData_.put(H2dVariableType.POINT_Y, new TrPostDataCreatedPtY(this)); // par defaut vitesse et debit
if (isInitVar(H2dVariableType.VITESSE_U)) {
if (isInitVar(H2dVariableType.VITESSE_V)) {
final TrPostFlecheContent vec = createSimpleVecteurContent(H2dVariableType.VITESSE, H2dVariableType.VITESSE_U,
@@ -637,7 +641,7 @@
try {
_m.put(variable_[i].getName(),
CtuluLib.DEFAULT_NUMBER_FORMAT.format(interpolator.interpolate(_element, _x,
- _y, variable_[i], _time)));
+ _y, variable_[i], _time)));
} catch (final IOException _evt) {
FuLog.error(_evt);
_m.put(variable_[i].getName(), "ERROR");
@@ -1371,7 +1375,6 @@
// c'est la premiere fois que l'on ouvre le fichier de post.
// on enregistre les infos
-
return true;
}
@@ -1619,4 +1622,4 @@
public List<TrPostSource> getUsedSources() {
return Collections.emptyList();
}
-}
\ No newline at end of file
+}
Copied: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPtX.java (from rev 9071, trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java)
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPtX.java (rev 0)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPtX.java 2015-03-16 21:31:52 UTC (rev 9073)
@@ -0,0 +1,46 @@
+/*
+ * @creation 3 mai 2005
+ * @modification $Date: 2007-04-16 16:35:31 $
+ * @license GNU General Public License 2
+ * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ * @mail fud...@li...
+ */
+package org.fudaa.fudaa.tr.post.data;
+
+import java.util.Set;
+import org.fudaa.dodico.ef.EfData;
+import org.fudaa.dodico.ef.EfDataNode;
+import org.fudaa.dodico.ef.EfGridInterface;
+import org.fudaa.fudaa.tr.post.TrPostSource;
+
+public final class TrPostDataCreatedPtX extends TrPostDataCreatedDefault {
+
+ public TrPostDataCreatedPtX(final TrPostSource _src) {
+ super(_src);
+ }
+
+ @Override
+ public double buildDataFor(final int _idxTime, final int _idxObject) {
+ final EfGridInterface grid = src_.getGrid();
+ return grid.getPtX(_idxObject);
+ }
+
+ @Override
+ public void fillWhithAllUsedVar(final Set _res) {
+ }
+
+ @Override
+ public String getDescription() {
+ return "X";
+ }
+
+ @Override
+ public EfData buildDataFor(final int _idxTime) {
+ final EfGridInterface grid = src_.getGrid();
+ final double[] bathy = new double[grid.getPtsNb()];
+ for (int i = bathy.length - 1; i >= 0; i--) {
+ bathy[i] = grid.getPtX(i);
+ }
+ return new EfDataNode(bathy);
+ }
+}
Copied: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPtY.java (from rev 9071, trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedRubarBathy.java)
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPtY.java (rev 0)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreatedPtY.java 2015-03-16 21:31:52 UTC (rev 9073)
@@ -0,0 +1,46 @@
+/*
+ * @creation 3 mai 2005
+ * @modification $Date: 2007-04-16 16:35:31 $
+ * @license GNU General Public License 2
+ * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ * @mail fud...@li...
+ */
+package org.fudaa.fudaa.tr.post.data;
+
+import java.util.Set;
+import org.fudaa.dodico.ef.EfData;
+import org.fudaa.dodico.ef.EfDataNode;
+import org.fudaa.dodico.ef.EfGridInterface;
+import org.fudaa.fudaa.tr.post.TrPostSource;
+
+public final class TrPostDataCreatedPtY extends TrPostDataCreatedDefault {
+
+ public TrPostDataCreatedPtY(final TrPostSource _src) {
+ super(_src);
+ }
+
+ @Override
+ public double buildDataFor(final int _idxTime, final int _idxObject) {
+ final EfGridInterface grid = src_.getGrid();
+ return grid.getPtY(_idxObject);
+ }
+
+ @Override
+ public void fillWhithAllUsedVar(final Set _res) {
+ }
+
+ @Override
+ public String getDescription() {
+ return "Y";
+ }
+
+ @Override
+ public EfData buildDataFor(final int _idxTime) {
+ final EfGridInterface grid = src_.getGrid();
+ final double[] bathy = new double[grid.getPtsNb()];
+ for (int i = bathy.length - 1; i >= 0; i--) {
+ bathy[i] = grid.getPtY(i);
+ }
+ return new EfDataNode(bathy);
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|