|
From: <de...@us...> - 2010-06-28 22:56:03
|
Revision: 5783
http://fudaa.svn.sourceforge.net/fudaa/?rev=5783&view=rev
Author: deniger
Date: 2010-06-28 22:55:55 +0000 (Mon, 28 Jun 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/TrLauncherDefault.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/TrPostImplementation.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrCourbeWizardImportScope.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrProjectImportPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrProjectPersistence.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/data/TrRubarAreteEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/data/TrSiInterpolAction.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.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/TrPostCommonImplementation.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterDefaultValuePanel.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/TrPostFilterSelecteur.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/TrPostLayoutFille.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/TrPostMultiSourceActivator.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator2.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostProjectCompPanel.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/TrPostRubarLimniMng.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/TrPostTimeFmtPanel.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/actions/TrIsoLineAction.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrPostActionAddPointFromWidgetCalque.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrPostActionChooseAndCreateCalque.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/actions/TrPostActionOpenSrc.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreationActions.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/data/TrPostDataEditCommonPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/dialogSpec/TrPostTrajectoireTaskModel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCreateScope.java
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/profile/MvLineChooser.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/profile/MvProfileBuilderFromTree.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/reflux/TrRefluxBoundaryEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/reflux/TrRefluxImplHelper.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/reflux/TrRefluxPropEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/reflux/TrRefluxRadiationVentPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/reflux/TrRefluxTimeStepsEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/rubar/TrRubarDonneesBrutesLayerGroup.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/rubar/TrRubarNewProjectPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageEditorFactory.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/rubar/TrRubarProjectFactory.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/rubar/TrRubarRegularGridEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/rubar/TrRubarSIEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/rubar/TrRubarVisuPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryPtsEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacCommunProjet.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacCulvertEndEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacDefaultPropertiesEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacExecPreferencesPanel.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacImplHelper.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacSaveBackupGeometryFile.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacSiActivateDialog.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacSiphonEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacSiphonLayer.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacSourceDefaultValues.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacSourceEditor.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacSourceSaisie.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacWeirLayerDisplay.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/telemac/TrTelemacWeirValuesEditor.java
trunk/soft/fudaa-prepro/ui/src/main/resources/org/fudaa/fudaa/tr/common/tr_en.fr_txt
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/TrLauncherDefault.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/TrLauncherDefault.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/TrLauncherDefault.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -112,7 +112,7 @@
infoSoft = new BuInformationsSoftware();
infoSoft.name = "prepro";
infoSoft.version = "1.1RC7";
- infoSoft.date = "2010-06-10";
+ infoSoft.date = "2010-06-29";
// infoSoft.version = "1.00";
// infoSoft.date = "2010-01-27";
infoSoft.rights = TrResource.getS("Tous droits r\xE9serv\xE9s") + ". CETMEF (c)2003-2009";
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/TrPostImplementation.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/TrPostImplementation.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/TrPostImplementation.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -1,9 +1,9 @@
/**
- * @creation 24 mai 2004
- * @modification $Date: 2006-09-19 15:07:28 $
- * @license GNU General Public License 2
- * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
- * @mail fud...@li...
+ * @creation 24 mai 2004
+ * @modification $Date: 2006-09-19 15:07:28 $
+ * @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;
@@ -12,6 +12,10 @@
import org.fudaa.fudaa.tr.common.TrResource;
import org.fudaa.fudaa.tr.post.TrPostCommonImplementation;
+import org.fudaa.fudaa.tr.post.TrPostLayoutFille;
+import org.fudaa.fudaa.tr.post.TrPostSource;
+import org.fudaa.fudaa.tr.post.actions.TrPostActionChooseAndCreateCalque;
+import org.fudaa.fudaa.tr.post.actions.TrPostActionOpenSrc;
/**
* @author Fred Deniger
@@ -35,14 +39,17 @@
@Override
public void doImportProject() {
+
+ TrPostLayoutFille currentLayoutFilleOrFirst = getCurrentLayoutFilleOrFirst();
+ if (currentLayoutFilleOrFirst != null) {
+ TrPostActionOpenSrc open=new TrPostActionOpenSrc(getCurrentProject());
+ TrPostSource openSource = open.openSource();
+ if(openSource!=null){
+ currentLayoutFilleOrFirst.controller_.addSource(openSource);
+ }
- /*
- * if (getCurrentProject() != null && getCurrentProject().getFille() != null) {
- * TrProjectPersistence.importForFrame(getCurrentProject().getFille(), this);
- *
- *
- * }
- */
+ }
+
}
@Override
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrCourbeWizardImportScope.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrCourbeWizardImportScope.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrCourbeWizardImportScope.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -154,18 +154,10 @@
BuFileFilter filterScopeT=ScopeTFileFormat.getInstance().createFileFilter();
BuFileFilter filterScopeGENE=ScopeGENEFileFormat.getInstance().createFileFilter();
-// for(int i=0;i<ScopeSFileFormat.getInstance().getExtensions().length;i++)
-// if(name.contains(ScopeSFileFormat.getInstance().getExtensions()[i]) || name.contains(ScopeSFileFormat.getInstance().getExtensions()[i].toLowerCase()))
-
if(filterScopeS.accept(_file))
return 0;
-// for(int i=0;i<ScopeTFileFormat.getInstance().getExtensions().length;i++)
-// if(name.contains(ScopeSFileFormat.getInstance().getExtensions()[i])|| name.contains(ScopeSFileFormat.getInstance().getExtensions()[i].toLowerCase()))
if(filterScopeT.accept(_file))
return 1;
-// for(int i=0;i<ScopeGENEFileFormat.getInstance().getExtensions().length;i++){
-// String ext=ScopeGENEFileFormat.getInstance().getExtensions()[i];
-// if(name.contains(ScopeGENEFileFormat.getInstance().getExtensions()[i])|| name.contains(ScopeGENEFileFormat.getInstance().getExtensions()[i].toLowerCase()))
if(filterScopeGENE.accept(_file))
return 2;
@@ -191,8 +183,6 @@
//Choose a valid file
}
- // if(panelParametres_==null)
- // panelParametres_=buildPanelParametresImportation();
return buildPanelParametresImportation();
}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrProjectImportPanel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrProjectImportPanel.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrProjectImportPanel.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -76,7 +76,7 @@
}
@Override
- public boolean valide() {
+ public boolean isDataValid() {
final File f = pn_.getFile();
if (!isAcceptable(f)) {
if (f == null || !f.exists()) {
@@ -91,15 +91,15 @@
}
public void changedUpdate(final DocumentEvent _e) {
- valide();
+ isDataValid();
}
public void insertUpdate(final DocumentEvent _e) {
- valide();
+ isDataValid();
}
public void removeUpdate(final DocumentEvent _e) {
- valide();
+ isDataValid();
}
public FudaaSaveZipLoader getLoader() throws IOException {
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrProjectPersistence.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrProjectPersistence.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/common/TrProjectPersistence.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -1,8 +1,12 @@
/*
* @creation 6 sept. 06
+ *
* @modification $Date: 2007-06-11 13:08:21 $
+ *
* @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.common;
@@ -14,6 +18,7 @@
import org.fudaa.ctulu.CtuluTaskDelegate;
import org.fudaa.ctulu.ProgressionInterface;
+import org.fudaa.ebli.calque.ZEbliCalquesPanel;
import org.fudaa.ebli.calque.ZEbliFilleCalques;
import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation;
import org.fudaa.fudaa.commun.save.FudaaSaveLib;
@@ -41,7 +46,7 @@
final boolean r = FSigProjectPersistence.saveProject(_impl, _proj, TrLib.getPreSaveFile(_destFile), _prog);
if (r) {
// ancien format a effacer
- // old format to erase
+ // old format to erase
final File db = FSigProjectPersistence.getPreSaveFileOld(_destFile);
if (db.exists()) {
db.delete();
@@ -90,7 +95,7 @@
if (doc != null) {
prj.initInformationsDocument(doc);
// le reste ce fait automatiquement par les objets sauv\xE9s.
- // the rest is automatically made by the saved objects
+ // the rest is automatically made by the saved objects
}
return true;
@@ -106,9 +111,14 @@
public static FudaaSaveZipLoader importForFrame(final JInternalFrame _currentFrame,
final FudaaCommonImplementation _impl) {
+ return importForFrame(((ZEbliFilleCalques) _currentFrame).getVisuPanel(), _impl);
+ }
+
+ public static FudaaSaveZipLoader importForFrame(final ZEbliCalquesPanel _calquePanel,
+ final FudaaCommonImplementation _impl) {
final TrProjectImportPanel pn = new TrProjectImportPanel();
final String s = FSigLib.getS("Importer un projet");
- if (pn.afficheModaleOk(_currentFrame, s)) {
+ if (pn.afficheModaleOk(_calquePanel.getCtuluUI().getParentComponent(), s)) {
FudaaSaveZipLoader loader = null;
try {
loader = pn.getLoader();
@@ -116,8 +126,7 @@
final CtuluTaskDelegate createTask = _impl.createTask(s);
createTask.start(new Runnable() {
public void run() {
- FudaaSaveLib.restoreAndLaunch(_impl, (ZEbliFilleCalques) _currentFrame, createTask.getStateReceiver(),
- finalLoader);
+ FudaaSaveLib.restoreAndLaunch(_impl, _calquePanel, createTask.getStateReceiver(), finalLoader);
}
});
} catch (final IOException _evt) {
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/data/TrRubarAreteEditor.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/data/TrRubarAreteEditor.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/data/TrRubarAreteEditor.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -413,7 +413,7 @@
}
@Override
- public boolean valide() {
+ public boolean isDataValid() {
boolean r = true;
StringBuffer err = null;
if (tarageEditor_ != null && tarageEditor_.isError()) {
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/data/TrSiInterpolAction.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/data/TrSiInterpolAction.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/data/TrSiInterpolAction.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -150,7 +150,7 @@
final CtuluDialogPanel pn = new CtuluDialogPanel() {
@Override
- public boolean valide() {
+ public boolean isDataValid() {
final TableCellEditor cellEditor = table.getCellEditor();
if (cellEditor != null) {
cellEditor.stopCellEditing();
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -27,6 +27,7 @@
* @author genesis
*
*/
+@SuppressWarnings("serial")
public class ScopCourbeTreeModel extends TrPostCourbeTreeModel{
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-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -94,7 +94,7 @@
@Override
public void paintIconCentre(final Component _c, final Graphics _g, final int _x, final int _y) {
- if (_g == null) return;
+ if (_g == null) { return; }
Color old = null;
if (getCouleur() != null) {
old = _g.getColor();
@@ -336,7 +336,7 @@
protected final void paintSonde(final Graphics2D _g2d, final GrMorphisme _versEcran) {
if (sondeSelectedElement_ >= 0) {
GrPoint oldPoint = null;
- for (GrPoint point : sondePt_) {
+ for (final GrPoint point : sondePt_) {
final GrPoint p = point.applique(_versEcran);
if (sondeIcone_ == null) {
@@ -408,11 +408,13 @@
sondePt_ = new ArrayList<GrPoint>();
}
- GrPoint point = new GrPoint();
+ final GrPoint point = new GrPoint();
point.initialiseAvec(_ptReel);
- if (!_add) sondePt_.clear();
+ if (!_add) {
+ sondePt_.clear();
+ }
sondePt_.add(point);
final int i = sondeSelection(point, getIsoModelAbstract());
@@ -520,7 +522,7 @@
@Override
public void fillWithInterpolateInfo(final InfoData _m) {
- int i = sondePt_.size()-1;
+ final int i = sondePt_.size() - 1;
getIsoModelAbstract().fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.get(i).x_, sondePt_.get(i).y_,
getTitle());
}
@@ -613,17 +615,18 @@
}
public final double getSondeX() {
- return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size()-1).x_;
+ return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size() - 1).x_;
}
public final double getSondeY() {
- return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size()-1).y_;
+ return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size() - 1).y_;
}
public final JComponent getTargetComponent() {
return this;
}
+ @Override
public GrBoite getDomaineOnSelected() {
if (isSelectionEmpty()) { return null; }
int m = selection_.getMaxIndex();
@@ -767,38 +770,38 @@
final int n = modelToUse.getNbElt();
final GrPolygone poly = new GrPolygone();
final GrBoite b = new GrBoite();
-// final int width = this.getSize().width;
-// final int height = this.getSize().height;
-// GrPoint ptCenter = new GrPoint();
-// 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);
-// }
-// }
-// }
-// }
-// }
-// }
-// }
+ // 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)) {
@@ -982,13 +985,44 @@
if (sonde_) {
clearSelection();
} else {
- sondeSelectedElement_ = -1;
+ clearSonde();
}
- // pour mettre a jour le panel d'info
- fireSelectionEvent();
}
}
+ @Override
+ public boolean changeSelection(final CtuluListSelection s, final int action) {
+ clearSonde();
+ return super.changeSelection(s, action);
+ }
+
+ @Override
+ public boolean changeSelection(final LinearRing poly, final int action, final int mode) {
+ clearSonde();
+ return super.changeSelection(poly, action, mode);
+ }
+
+ @Override
+ public boolean changeSelection(final GrPoint pt, final int tolerancePixel, final int action) {
+ clearSonde();
+ return super.changeSelection(pt, tolerancePixel, action);
+ }
+
+ @Override
+ public boolean changeSelection(final LinearRing[] p, final int action, final int mode) {
+ clearSonde();
+ return super.changeSelection(p, action, mode);
+ }
+
+ public void clearSonde() {
+ if (sondePt_ != null) {
+ this.sondePt_.clear();
+ }
+ sondeSelectedElement_ = -1;
+ // pour mettre a jour le panel d'info
+ fireSelectionEvent();
+ }
+
public final void setV(final int _i) {
if (getIsoModelAbstract().getVariableNb() == 0) { return; }
getListSelectionModel().setSelectionInterval(_i, _i);
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-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -15,11 +15,13 @@
import java.util.List;
import javax.swing.JInternalFrame;
+import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import com.memoire.bu.BuLib;
import com.memoire.bu.BuMenu;
+import com.memoire.bu.BuMenuBar;
import com.memoire.bu.BuWizardDialog;
import org.fudaa.ctulu.CtuluLibString;
@@ -46,7 +48,7 @@
return project;
}
- public final void setCurrentProject(TrPostProjet _c) {
+ public final void setCurrentProject(final TrPostProjet _c) {
project = _c;
}
@@ -55,7 +57,7 @@
*/
public List<TrPostLayoutFille> getAllLayoutFille() {
final JInternalFrame[] allInternalFrames = getAllInternalFrames();
- if (allInternalFrames == null) return Collections.emptyList();
+ if (allInternalFrames == null) { return Collections.emptyList(); }
final List<TrPostLayoutFille> res = new ArrayList<TrPostLayoutFille>(allInternalFrames.length);
for (int i = 0; i < allInternalFrames.length; i++) {
final JInternalFrame internalFrame = allInternalFrames[i];
@@ -67,7 +69,7 @@
}
public void elimineDoublonNomsLayout() {
- List<TrPostLayoutFille> liste = getAllLayoutFille();
+ final List<TrPostLayoutFille> liste = getAllLayoutFille();
for (int i = 0; i < liste.size(); i++) {
int cpt = 1;
@@ -81,27 +83,26 @@
}
}
-
- public void display(final TrPostVisuPanel pnVisu,final BCalque calqueActif){
+ 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){
+
+ public void display(final TrPostVisuPanel pnVisu, final BCalque calqueActif, final String title) {
BuLib.invokeLater(new Runnable() {
public void run() {
- final CalqueLegendeWidgetAdapter legendeCalque=(CalqueLegendeWidgetAdapter) pnVisu.getCqLegend();
+ 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;
+ final BCalque calqueAct = calqueActif;
pnVisu.setCalqueActif(calqueAct);
- TrPostLayoutFille layoutFille = getCurrentLayoutFille();
- layoutFille.controller_.addCalque(title
- + " " + layoutFille.getScene().getAllVue2d().size() + 1, location, pnVisu
- .getPreferredSize(), pnVisu, legendeCalque);
+ final TrPostLayoutFille layoutFille = getCurrentLayoutFille();
+ layoutFille.controller_.addCalque(title + " " + layoutFille.getScene().getAllVue2d().size() + 1, location,
+ pnVisu.getPreferredSize(), pnVisu, legendeCalque);
pnVisu.restaurer();
}
@@ -114,8 +115,9 @@
*/
public TrPostLayoutFille getCurrentLayoutFille() {
final JInternalFrame currentInternalFrame = getCurrentInternalFrame();
- if (currentInternalFrame instanceof TrPostLayoutFille) return (TrPostLayoutFille) currentInternalFrame;
- else {
+ if (currentInternalFrame instanceof TrPostLayoutFille) {
+ return (TrPostLayoutFille) currentInternalFrame;
+ } else {
// -- on recherche la premiere file layout qu'on a et on l'envoie --//
// -- ACHTUNG: CAS A TRAITER:EXEMPLE SI ON EST DANS LA FRAME GESTION MULTI SOURCE; ON EST PAS DANS LA CURRENT
// LAYOUT MAIS ON S EN FOUT--//
@@ -130,7 +132,9 @@
TrPostLayoutFille current = getCurrentLayoutFille();
if (current == null) {
final List<TrPostLayoutFille> allLayoutFille = getAllLayoutFille();
- if (!allLayoutFille.isEmpty()) current = allLayoutFille.get(0);
+ if (!allLayoutFille.isEmpty()) {
+ current = allLayoutFille.get(0);
+ }
}
return current;
}
@@ -139,7 +143,16 @@
public void init() {
super.init();
final BuMenu menu = (BuMenu) getMainMenuBar().getMenu("IMPORTER");
- menu.addMenuItem(TrResource.getS("Autres r\xE9sultats"), getImportResultsAct());
+ final JMenuItem menuImportImage = BuMenuBar.getMenuItem(menu, "IMPORT_IMAGE");
+ if (menuImportImage != null) {
+ menu.remove(menuImportImage);
+ }
+ final JMenuItem menuImportProjet= BuMenuBar.getMenuItem(menu, "IMPORT_PROJECT");
+ if (menuImportProjet != null) {
+ menuImportProjet.setText(TrResource.getS("Importer un fichier source"));
+ }
+
+ menu.addMenuItem(TrResource.getS("Fichiers scope"), getImportResultsAct());
}
String getImportResultsAct() {
@@ -240,8 +253,8 @@
// -- ouverture d'un fichier r\xE9sultat qui sera automatiquement ajout\xE9 dans la layout courante --//
project.createNewLayoutFrame();
// -- ouverture d'un fichier r\xE9sultat --//
- TrPostActionChooseAndCreateCalque chooserSource = new TrPostActionChooseAndCreateCalque(project, project.getImpl()
- .getCurrentLayoutFille().controller_);
+ final TrPostActionChooseAndCreateCalque chooserSource = new TrPostActionChooseAndCreateCalque(project, project
+ .getImpl().getCurrentLayoutFille().controller_);
chooserSource.actionPerformed(null);
} else if ("OUVRIR".equals(com)) {
@@ -262,7 +275,6 @@
}
project.getManager().loadProject(false, null);
- // new TrPostFusionProjet(c_);
} else
@@ -279,7 +291,6 @@
@Override
public void act() {
- // c_.save(TrPostCommonImplementation.this, createProgressionInterface(this));
// -- enregistrement sauce widget --//
project.getManager().saveProject(false);
@@ -291,18 +302,19 @@
@Override
public void act() {
- // c_.save(TrPostCommonImplementation.this, createProgressionInterface(this));
// -- enregistrement sauce widget --//
project.getManager().saveProject(true);
}
}.start();
+ } else if (getImportResultsAct().equals(com) && project != null) {
+ File scopeFile = ouvrirFileChooser("Scope", null);
+ if (scopeFile != null) {
+ doImportScopeFile(scopeFile, false);
+ }
}
- // else if (getImportResultsAct().equals(com) && c_ != null) {
- // c_.importerVars();
- // }
else {
super.actionPerformed(_evt);
}
@@ -326,7 +338,6 @@
public void cmdOuvrirLayoutFile(final File _f) {
if (project == null) {
- // setProjet(new TrPostProjet(TrPostCommonImplementation.this));
project = new TrPostProjet(TrPostCommonImplementation.this);
project.active(TrPostCommonImplementation.this);
BuLib.invokeNowOrLater(new Runnable() {
@@ -349,7 +360,7 @@
}
- public void cmdOuvrirScopFile(final File _f) {
+ public void cmdOuvrirScopFile(final File scopeFile) {
if (project == null) {
// setProjet(new TrPostProjet(TrPostCommonImplementation.this));
@@ -368,65 +379,36 @@
}
BuLib.invokeLater(new Runnable() {
public void run() {
-
- if (TrPostCommonImplementation.this.getCurrentProject() == null) TrPostCommonImplementation.this
- .setCurrentProject(new TrPostProjet(TrPostCommonImplementation.this));
-
- // -- creation de la trpostlayoutFille --//
- final TrPostLayoutFille postFrame = new TrPostLayoutFille(getCurrentProject());
- // -- sauvegarde du persitant --//
- TrPostCommonImplementation.this.addInternalFrame(postFrame);
-
- // -- creation du wizard scop --//
- ScopCourbeTreeModel modelGraphe = new ScopCourbeTreeModel();
- final TrPostWizardCreateScope wizard = new TrPostWizardCreateScope(TrPostCommonImplementation.this
- .getCurrentProject(), modelGraphe, _f);
- final BuWizardDialog DialogWizard = new BuWizardDialog(TrPostCommonImplementation.this.getFrame(), wizard);
- // --affichage du wizard --//
- DialogWizard.setSize(600, 600);
- DialogWizard.setLocationRelativeTo(TrPostCommonImplementation.this.getFrame());
- DialogWizard.setVisible(true);
-
- // -- TODO: ajout d'une frame ??? --//
-
- // final EGGraphe graphe = new EGGraphe(modelGraphe);
- // TrPostCommonImplementation.this.getCurrentProject().addGrapheNodeInCurrentScene(new EGFillePanel(graphe),
- // _f.getName());
+ doImportScopeFile(scopeFile, true);
}
});
+ }
+ private void doImportScopeFile(final File scopeFile, final boolean inNewLayout) {
+ // -- creation de la trpostlayoutFille --//
+ if (inNewLayout) {
+ final TrPostLayoutFille postFrame = new TrPostLayoutFille(getCurrentProject());
+ // -- sauvegarde du persitant --//
+ TrPostCommonImplementation.this.addInternalFrame(postFrame);
+ } else {
+ TrPostLayoutFille current = getCurrentLayoutFilleOrFirst();
+ if (current == null) {
+ doImportScopeFile(scopeFile, true);
+ } else {
+ current.toFront();
+ }
+ }
+ // -- creation du wizard scop --//
+ final ScopCourbeTreeModel modelGraphe = new ScopCourbeTreeModel();
+ final TrPostWizardCreateScope wizard = new TrPostWizardCreateScope(TrPostCommonImplementation.this
+ .getCurrentProject(), modelGraphe, scopeFile);
+ final BuWizardDialog DialogWizard = new BuWizardDialog(TrPostCommonImplementation.this.getFrame(), wizard);
+ // --affichage du wizard --//
+ DialogWizard.setSize(600, 600);
+ DialogWizard.setLocationRelativeTo(TrPostCommonImplementation.this.getFrame());
+ DialogWizard.setVisible(true);
}
- // /**
- // * Methode appelee pour creer un projet .SCOP
- // *
- // * @param _f
- // */
- // public void cmdOuvrirScopFile(final File _f) {
- // if (c_ == null) {
- // // setProjet(new
- // TrTrPostCommonImplementation.thisProjet(TrTrPostCommonImplementation.thisCommonImplementation.this));
- // c_ = new TrPostProjet(TrPostCommonImplementation.this);
- // c_.active(TrPostCommonImplementation.this);
- // BuLib.invokeNowOrLater(new Runnable() {
- // public void run() {
- // setEnabledForAction("ENREGISTRER", true);
- // setEnabledForAction("ENREGISTRERSOUS", true);
- // setEnabledForAction("IMPORTER", true);
- // setEnabledForAction(getImportResultsAct(), true);
- // setEnabledForAction("IMPORT_PROJECT", true);
- // setEnabledForAction("RECHERCHER", true);
- // }
- // });
- // }
- // BuLib.invokeLater(new Runnable() {
- // public void run() {
- // c_.getManager().loadProject(true, _f);
- // }
- // });
- //
- // }
-
@Override
public void cmdOuvrirFile(final File _f) {
final TrPostCommonImplementation alreadyOpen = getLauncher().findPostWithOpenedFile(_f);
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterDefaultValuePanel.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterDefaultValuePanel.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterDefaultValuePanel.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -77,7 +77,7 @@
* Applique les valeurs par defaut.
*/
public void apply() {
- if (isValid()) {
+ if (isDataValid()) {
TrPostFilterHauteur.setEpsInPref(hauteur_.getCondition().getEps());
TrPostFilterHauteur.setActivatedInPref(cbAlwaysActivated_.isSelected());
if (cbAlwaysStrict_ != null) {
@@ -95,7 +95,7 @@
/**
* @return true si valid
*/
- public boolean isValid() {
- return hauteur_.isValid();
+ public boolean isDataValid() {
+ return hauteur_.isDataValid();
}
}
Modified: 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/TrPostFilterHauteurPanel.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterHauteurPanel.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -98,7 +98,7 @@
/**
* @return true si valid
*/
- public boolean isValid() {
+ public boolean isDataValid() {
final boolean r = tfEps_.getValue() != null && tfEps_.getValueValidator().isValueValid(tfEps_.getValue());
lbEps_.setForeground(r ? Color.BLACK : Color.RED);
return r;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterSelecteur.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterSelecteur.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFilterSelecteur.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -146,8 +146,8 @@
}
@Override
- public boolean valide() {
- return panel.isValid();
+ public boolean isDataValid() {
+ return panel.isDataValid();
}
};
pn.setLayout(new BuBorderLayout());
@@ -180,8 +180,8 @@
}
@Override
- public boolean isValid() {
- return panel.isValid();
+ public boolean isDataValid() {
+ return panel.isDataValid();
}
};
pn.setLayout(new BuBorderLayout());
Modified: 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/TrPostFlecheLayer.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostFlecheLayer.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -26,10 +26,12 @@
import com.memoire.bu.BuMenuItem;
import com.memoire.bu.BuResource;
+import com.vividsolutions.jts.geom.LinearRing;
import org.fudaa.ctulu.CtuluLib;
import org.fudaa.ctulu.CtuluLibArray;
import org.fudaa.ctulu.CtuluLibString;
+import org.fudaa.ctulu.CtuluListSelection;
import org.fudaa.ctulu.CtuluRange;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.ebli.animation.EbliAnimationAdapterInterface;
@@ -92,7 +94,7 @@
super(new TrPostFlecheModel(_s));
initModel_ = (TrPostFlecheModel) super.modele_;
setTitle(TrResource.getS("Vecteurs"));
- sondePt_=new ArrayList<GrPoint>();
+ sondePt_ = new ArrayList<GrPoint>();
}
public H2dVariableType getSelectedVar() {
@@ -163,17 +165,17 @@
protected void paintSonde(final Graphics2D _g2d, final GrMorphisme _versEcran) {
if (sondeSelectedElement_ >= 0) {
-
- for(GrPoint point:sondePt_) {
-
- final GrPoint p = point.applique(_versEcran);
- if (sondeIcone_ == null) {
- sondeIcone_ = TrIsoLayerDefault.getSondeIcone();
+
+ for (final GrPoint point : sondePt_) {
+
+ final GrPoint p = point.applique(_versEcran);
+ if (sondeIcone_ == null) {
+ sondeIcone_ = TrIsoLayerDefault.getSondeIcone();
+ }
+ // _g2d.setXORMode(Color.WHITE);
+ sondeIcone_.paintIconCentre(this, _g2d, p.x_, p.y_);
}
- // _g2d.setXORMode(Color.WHITE);
- sondeIcone_.paintIconCentre(this, _g2d, p.x_, p.y_);
}
- }
}
@Override
@@ -248,18 +250,18 @@
public boolean changeSonde(final GrPoint _pt, final boolean add) {
if (!isSondeEnable()) { return false; }
if (sondePt_ == null) {
- sondePt_=new ArrayList<GrPoint>();
- //sondePt_ = new GrPoint();
+ sondePt_ = new ArrayList<GrPoint>();
+ // sondePt_ = new GrPoint();
}
- GrPoint point=new GrPoint();
-
+ final GrPoint point = new GrPoint();
+
point.initialiseAvec(_pt);
-
- if(!add)
- sondePt_.clear();
+
+ if (!add) {
+ sondePt_.clear();
+ }
sondePt_.add(point);
-
-
+
final int i = TrIsoLayerDefault.sondeSelection(point, initModel_);
final boolean oldIsDraw = sondeSelectedElement_ >= 0;
sondeSelectedElement_ = i;
@@ -346,7 +348,7 @@
@Override
public void fillWithInfo(final InfoData _m) {
if (isSondeActive()) {
- int i = sondePt_.size()-1;
+ final int i = sondePt_.size() - 1;
initModel_.fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.get(i).x_, sondePt_.get(i).y_, getTitle());
} else if (!isGrilleActivated()) {
@@ -410,11 +412,11 @@
}
public double getSondeX() {
- return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size()-1).x_;
+ return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size() - 1).x_;
}
public double getSondeY() {
- return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size()-1).y_;
+ return sondePt_ == null ? 0 : sondePt_.get(sondePt_.size() - 1).y_;
}
@Override
@@ -567,7 +569,7 @@
public void setPaletteCouleurPlages(final BPalettePlageInterface _newPlage) {
if (getListSelectionModel().isSelectionEmpty()) { return; }
if (_newPlage == null) { return; }
-// final boolean old = isPaletteCouleurUsed_;
+ // final boolean old = isPaletteCouleurUsed_;
super.setPaletteCouleurPlages(_newPlage);
// si c'est la premiere fois, il faut mettre \xE0 jour les titres
if (paletteCouleur_ != null) {
@@ -582,16 +584,48 @@
public void setSondeEnable(final boolean _enable) {
if (_enable != sonde_) {
sonde_ = _enable;
- // pour mettre a jour le panel d'info
- fireSelectionEvent();
+
if (sonde_) {
clearSelection();
} else {
- sondeSelectedElement_ = -1;
+ clearSonde();
}
}
}
+ public void clearSonde() {
+ sondeSelectedElement_ = -1;
+ if (sondePt_ != null) {
+ sondePt_.clear();
+ }
+ // pour mettre a jour le panel d'info
+ fireSelectionEvent();
+ }
+
+ @Override
+ public boolean changeSelection(CtuluListSelection s, int action) {
+ clearSonde();
+ return super.changeSelection(s, action);
+ }
+
+ @Override
+ public boolean changeSelection(GrPoint pt, int tolerancePixel, int action) {
+ clearSonde();
+ return super.changeSelection(pt, tolerancePixel, action);
+ }
+
+ @Override
+ public boolean changeSelection(LinearRing poly, int action, int mode) {
+ clearSonde();
+ return super.changeSelection(poly, action, mode);
+ }
+
+ @Override
+ public boolean changeSelection(LinearRing[] p, int action, int mode) {
+ clearSonde();
+ return super.changeSelection(p, action, mode);
+ }
+
public void setTimeStep(final int _idx) {
getTimeListSelectionModel().setSelectionInterval(_idx, _idx);
}
@@ -604,9 +638,9 @@
changeVarStep();
}
}
-
- 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/TrPostLayoutFille.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -74,7 +74,9 @@
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;
import org.netbeans.api.visual.widget.Widget;
@@ -136,11 +138,6 @@
JComponent right_;
/**
- * bouton qui permet de masquer/afficher le tree
- */
-// JButton toggleTree_;
-
- /**
* Toolbar modifiable qui se met a jour selon la selection de la widget.
*/
JToolBar toolBarModifiable_ = new BuToolBar();
@@ -159,11 +156,6 @@
// creation de la scene EBLI
controller_ = new TrPostLayoutPanelController(new TrPostScene(_projet), _projet);
setContentPane(controller_.getPanel());
-
- // -- enregistrement de this comem listener de la scene pour le type d objet
- // selection changed--//
- // controller_.getSceneCourante().addObjectSceneListener(this, ObjectSceneEventType.OBJECT_SELECTION_CHANGED,
- // ObjectSceneEventType.OBJECT_STATE_CHANGED);
controller_.getSceneCourante().getController().addEditListener(this);
// -- ajout de la toolbar et du menu en haut --//
@@ -177,8 +169,8 @@
this.add(panelSouthSuiviSouris_, BorderLayout.SOUTH);
}
-
- public TrPostProjet getProject(){
+
+ public TrPostProjet getProject() {
return projet_;
}
@@ -251,9 +243,13 @@
menuModifiable_ = new BuMenuBar();
toolBarModifiable_.add(new EbliWidgetActionConfigure(controller_.getSceneCourante()));
- final JMenu menu = new JMenu("Configurer");
+ final JMenu menu = new JMenu(TrResource.getS("Configurer"));
menu.add(new EbliWidgetActionConfigure(controller_.getSceneCourante()));
menuModifiable_.add(menu);
+ final JMenu menuImporter = new JMenu(TrResource.getS("Importer"));
+ menuImporter.add(new TrPostActionChooseAndCreateCalque(projet_, controller_));
+ menuImporter.add(new TrPostWizardCreateScope.ImportAction(getScene().projet));
+ menuModifiable_.add(menuImporter);
// mise a jour des params
// ajoutMenusLayoutTabbed(menuModifiable_);
@@ -364,8 +360,6 @@
right_ = new JPanel(new BorderLayout());
right_.putClientProperty(FudaaCommonImplementation.RIGHT_COMPONENT_IN_SCROLL, Boolean.FALSE);
-// toggleTree_ = new JButton(TrLib.getString("Arbre"));
-// toggleTree_.setText("Composants");
overview_ = controller_.getSceneCourante().getController().getOverviewComponent();
right_.add(overview_, BorderLayout.CENTER);
Modified: 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/TrPostLayoutPanelController.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -4,12 +4,14 @@
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
+import javax.swing.JInternalFrame;
import javax.swing.JMenu;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
@@ -19,9 +21,11 @@
import com.memoire.bu.BuDesktop;
import com.memoire.bu.BuMenu;
import com.memoire.bu.BuMenuItem;
+import com.memoire.bu.BuResource;
import com.memoire.bu.BuSeparator;
import org.fudaa.ctulu.CtuluCommandManager;
+import org.fudaa.ctulu.CtuluLibString;
import org.fudaa.ctulu.gui.CtuluSelectorPopupButton;
import org.fudaa.ebli.calque.ZEbliCalquesPanel;
import org.fudaa.ebli.commun.EbliActionAbstract;
@@ -33,7 +37,6 @@
import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.ebli.visuallibrary.EbliNode;
import org.fudaa.ebli.visuallibrary.EbliNodeDefault;
-import org.fudaa.ebli.visuallibrary.EbliWidgetEditModeListener;
import org.fudaa.ebli.visuallibrary.WidgetResource;
import org.fudaa.ebli.visuallibrary.actions.CommandUndoRedoCreation;
import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionAlign;
@@ -60,10 +63,12 @@
import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorFleche;
import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorLine;
import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorRectangle;
+import org.fudaa.fudaa.commun.FudaaLib;
+import org.fudaa.fudaa.sig.layer.FSigImageImportAction;
+import org.fudaa.fudaa.tr.common.TrProjectPersistence;
import org.fudaa.fudaa.tr.common.TrResource;
import org.fudaa.fudaa.tr.post.actions.TrPostActionChangeSceneForWidget;
import org.fudaa.fudaa.tr.post.actions.TrPostActionChooseAndCreateCalque;
-import org.fudaa.fudaa.tr.post.actions.TrPostActionController;
import org.fudaa.fudaa.tr.post.actions.TrPostActionDuplicate;
import org.fudaa.fudaa.tr.post.actions.TrPostActionDuplicateLayout;
import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardCreateScope;
@@ -95,8 +100,7 @@
/**
* Liste qui contient l'ensemble des scenes.
*/
- // ArrayList<EbliScene> listeScenes_ = new ArrayList<EbliScene>();
- BuMenu menuScenes_ = new BuMenu(TrResource.getS("Liste des Layouts"), "LISTELAYOUT");
+ // BuMenu menuScenes_ = new BuMenu(TrResource.getS("Liste des Layouts"), "LISTELAYOUT");
// JPanel pn_;
JTabbedPane pn_;
@@ -108,16 +112,30 @@
*/
TrPostScene sceneCourante_;
-
TrPostLayoutPanelController(final TrPostScene _scene, final TrPostProjet _projet) {
sceneCourante_ = _scene;
_scene.setCmdMng(new CtuluCommandManager());
projet_ = _projet;
+ }
+ public void addSource(TrPostSource srcChoisie) {
+ // -- TRES IMPORTANT: on cree le calque en precisant l indice de la SOURCE
+ // SELECTIONNEE --//
+ final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter(getSceneCourante(), null);
+ final TrPostVisuPanel pnVisu = new TrPostVisuPanel(projet_.getImpl(), projet_, legendeCalque, srcChoisie);
+ final EbliNode node = addCalque(TrResource.getS("Calque") + (getSceneCourante().getAllVue2d().size() + 1), pnVisu
+ .getLocation(), pnVisu.getPreferredSize(), pnVisu, legendeCalque);
+ // -- ajout de l INFO de la source utilis\xE9e --//
+ node.setDescription("Source: " + projet_.formatInfoSource(srcChoisie));
+
+ // -- ajout des infos de cr\xE9ation --//
+ pnVisu.addInfosCreation(ZEbliCalquesPanel.TITRE_FIC, srcChoisie.getTitle());
+
+ // TrPostSourceAbstractFromIdx.fillWithSourceInfo( srcChoisie);
+ srcChoisie.fillWithSourceCreationInfo(CtuluLibString.EMPTY_STRING, pnVisu.getInfosCreation());
}
-
/**
* Methode specialisee dans l ajout d un ndoe de type calque a la scene.
*
@@ -155,11 +173,36 @@
calque.getController().buildActions();
// -- ajout de la legende dans le calque associe --//
- ((EbliWidgetControllerCalque) nodeCalque.getController()).ajoutLegende();
- ((EbliWidgetControllerCalque) nodeCalque.getController()).registerListenerForNewLegend();
+ EbliWidgetControllerCalque controllerCalque = (EbliWidgetControllerCalque) nodeCalque.getController();
+ controllerCalque.ajoutLegende();
+ controllerCalque.registerListenerForNewLegend();
+ controllerCalque.addMenuSpecifique(createImportMenu(calque));
return nodeCalque;
}
+ private JMenu createImportMenu(final TrPostVisuPanel calque) {
+ BuMenu importMenu = new BuMenu();
+ importMenu.setText(BuResource.BU.getString("Importer"));
+ importMenu.setIcon(null);
+ importMenu.addMenuItem(FudaaLib.getS("Importer un projet"), "IMPORT_PROJECT",
+ BuResource.BU.getMenuIcon("importer"), new ActionListener() {
+
+ public void actionPerformed(ActionEvent arg0) {
+ TrProjectPersistence.importForFrame(calque, projet_.impl_);
+ }
+ });
+
+ importMenu.addMenuItem(FSigImageImportAction.getCommonTitle(), "IMPORT_IMAGE", FSigImageImportAction
+ .getCommonImage(), new ActionListener() {
+
+ public void actionPerformed(ActionEvent arg0) {
+ calque.importImage();
+ }
+ });
+ return importMenu;
+
+ }
+
public EbliNode addLigne() {
// -- ajout du rectangle --//
final EbliNode nodeLigne = new EbliNodeDefault();
@@ -294,15 +337,6 @@
@SuppressWarnings("serial")
protected void addShapeActions(final List<EbliActionAbstract> _l) {
// -- palette rectangle texte--//
- // _l.add(new
- // EbliActionSimple(EbliResource.EBLI.getString("Rectangle texte"),
- // BuResource.BU
- // .getToolIcon("crystal_couleurtexte"), "WIDGETRECTANGLE") {
- // @Override
- // public void actionPerformed(final ActionEvent _evt) {
- // addRectangleTexte();
- // }
- // });
// widget texte
// TODO a revoir
_l.add(new EbliWidgetActiontextEditor(getSceneCourante()));
@@ -326,8 +360,8 @@
});
// -- palette fleche --//
- _l.add(new EbliActionSimple(EbliResource.EBLI.getString("Fl\xE8che pleine"),
- WidgetResource.WIDGET.getToolIcon("arrow-left_16"), "WIDGETFLECHE") {
+ _l.add(new EbliActionSimple(EbliResource.EBLI.getString("Fl\xE8che pleine"), WidgetResource.WIDGET
+ .getToolIcon("arrow-left_16"), "WIDGETFLECHE") {
@Override
public void actionPerformed(final ActionEvent _evt) {
addFleche();
@@ -336,7 +370,8 @@
// -- palette double fleche --//
// crystal_bu_scrollpane_corner.png
- _l.add(new EbliActionSimple(EbliResource.EBLI.getString("Double Fleche"), WidgetResource.WIDGET.getToolIcon("double-arrow_16"), "WIDGETDBLFLECHE") {
+ _l.add(new EbliActionSimple(EbliResource.EBLI.getString("Double Fleche"), WidgetResource.WIDGET
+ .getToolIcon("double-arrow_16"), "WIDGETDBLFLECHE") {
@Override
public void actionPerformed(final ActionEvent _evt) {
addDblFleche();
@@ -429,8 +464,6 @@
init.add(null);
// -- actions de retaillage min et max --//
- // init.add(new EbliWidgetActionRetaillageHorizontal(getScene(),
- // EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MIN));
init.add(new EbliWidgetActionRetaillageHorizontal(sceneCourante,
EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MAX));
init
@@ -443,14 +476,12 @@
init.add(new EbliWidgetActionDelete(sceneCourante));
init.add(null);
// -- action de duplication --//
- // init.add(new EbliWidgetActionDuplicate(getSceneCourante()));
init.add(new TrPostActionDuplicate(sceneCourante, projet_));
init.add(new TrPostActionDuplicateLayout(sceneCourante, projet_));
init.add(new TrPostActionChangeSceneForWidget(sceneCourante, projet_));
init.add(null);
// -- Action sur le format --//
- // init.add(new EbliWidgetActionColorForeground(getSceneCourante()));
init.add(new EbliWidgetActionColorBackground.ForScene(sceneCourante));
// -- action de configuration des composants graphiques--//
init.add(new EbliWidgetActionConfigure(sceneCourante));
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator.java 2010-06-28 22:54:10 UTC (rev 5782)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostMultiSourceActivator.java 2010-06-28 22:55:55 UTC (rev 5783)
@@ -1,8 +1,12 @@
/*
* @creation 24 mars 2004
+ *
* @modification $Date: 2007-06-20 12:23:39 $
+ *
* @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;
@@ -42,18 +46,25 @@
}
+ protected static void afficheFrame(final TrPostProjet _p, final TrPostCommonImplementation _impl) {
+ afficheFrame(_p, _impl, null);
+ }
+
/**
* @param _s la source
* @param _impl l'impl parente
*/
- protected static void afficheFrame(final TrPostProjet _p, final TrPostCommonImplementation _impl) {
+ protected static void afficheFrame(final TrPostProjet _p, final TrPostCommonImplementation _impl,
+ final Runnable runnable) {
BuLib.invokeNow(new Runnable() {
public void run() {
_impl.setProjet(_p);
+ if (runnable != null) {
+ runnable.run();
+ }
}
});
-
}
public static void activeFile(final File _f, final TrPostCommonImplementation _impl) {
@@ -69,12 +80,13 @@
* @param _f le fichier a ouvrir
* @param _impl l'impl parent
*/
- public void activeSerafin(final File _f, final TrPostCommonImplementation _impl,final String id,final boolean isVolume) {
+ public void activeSerafin(final File _f, final TrPostCommonImplementation _impl, final String id,
+ final boolean isVolume) {
new CtuluTaskOperationGUI(_impl, CtuluLibString.ESPACE) {
@Override
public void act() {
- final TrPostSource source = activeSerafinAction(_f, _impl, _impl.createProgressionInterface(this),isVolume);
+ final TrPostSource source = activeSerafinAction(_f, _impl, _impl.createProgressionInterface(this), isVolume);
if (source == null) { return; }
source.setId(id);
if (SerafinFileFormat.is3DGrid(source.getGrid())) {
@@ -86,18 +98,19 @@
});
} else {
- afficheFrame(projetCourant_, _impl);
+ afficheFrame(projetCourant_, _impl, null);
}
}
}.start();
}
- public void activeGrid(final File _f, final FileFormatGridVersion _fmt, final TrPostCommonImplementation _impl,final String id) {
+ public void activeGrid(final File _f, final FileFormatGridVersion _fmt, final TrPostCommonImplementation _impl,
+ final String id) {
new CtuluTaskOperationGUI(_impl, CtuluLibString.ESPACE) {
@Override
public void act() {
- activeGridAction(_f, _fmt, _impl, _impl.createProgressionInterface(this),id);
+ activeGridAction(_f, _fmt, _impl, _impl.createProgressionInterface(this), id);
if (projetCourant_ != null) {
afficheFrame(projetCourant_, _impl);
}
@@ -105,60 +118,60 @@
}.start();
}
-
- public void active(final File _f, final TrPostCommonImplementation _impl){
-
- String uniqueId;
- if(_impl.project!=null)
- uniqueId=_impl.project.deliverSourceId(_f.getName());
- else
- uniqueId=CtuluLibGenerator.getInstance().deliverUniqueStringId();
-
- active(_f,_impl,uniqueId);
+ public void active(final File _f, final TrPostCommonImplementation _impl) {
+
+ String uniqueId;
+ if (_impl.project != null) {
+ uniqueId = _impl.project.deliverSourceId(_f.getName());
+ } else {
+ uniqueId = CtuluLibGenerator.getInstance().deliverUniqueStringId();
+ }
+
+ active(_f, _impl, uniqueId);
}
-
+
/**
* Ouvre le fichier en fonction de l'extension.
*
* @param _f le fichier correct
* @param _impl l'impl parent
*/
- public void active(final File _f, final TrPostCommonImplementation _impl,String IdSourceToActive) {
+ public void active(final File _f, final TrPostCommonImplementation _impl, final String IdSourceToActive) {
if (_f == null) { return; }
final TrFileFormatManager mng = TrFileFormatManager.INSTANCE;
final String name = _f.getName();
if (TrPostSourceBuilder.isReflux(name)) {
- activeINP(_f, _impl,IdSourceToActive);
+ activeINP(_f, _impl, IdSourceToActive);
return;
}
if (mng.isRubarTPSFile(name)) {
- activeRubar(_f, _impl,IdSourceToActive);
+ activeRubar(_f, _impl, IdSourceToActive);
return;
}
-
- //-- test format volumique --//
+
+ // -- test format volumique --//
if (SerafinVolumeFileFormat.getInstance().createFileFilter().accept(_f)) {
- activeSerafin(_f, _impl,IdSourceToActive,true);
- return;
- }
-
+ activeSerafin(_f, _impl, IdSourceToActive, true);
+ return;
+ }
+
// mettre serafin en dernier car le test est tres large ....
if (SerafinFileFormat.getInstance().createFileFilter().accept(_f)) {
- activeSerafin(_f, _impl,IdSourceToActive,false);
+ activeSerafin(_f, _impl, IdSourceToActive, false);
return;
}
final FileFormat ft = FileFormat.findFileFormat(TrFileFormatManager.getAllGridFormat(), _f);
if (ft == null) {
final String id = _impl.getLauncher().getCurrentPrefHydId();
if (FileFormatSoftware.REFLUX_IS.name.equals(id)) {
- activeINP(_f, _impl,IdSourceToActive);
+ activeINP(_f, _impl, IdSourceToActive);...
[truncated message content] |