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