|
From: <had...@us...> - 2008-09-16 17:12:42
|
Revision: 3932
http://fudaa.svn.sourceforge.net/fudaa/?rev=3932&view=rev
Author: hadouxad
Date: 2008-09-16 17:12:47 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
Fusion de calques
- utilise le groupage.
- on peut defusionner les calques
- action 'edition' sur les popup des calques pour editer celui qu on veut et mettre en premier plan
- action 'edition' pr?\195?\169sente pour tous les calques.
- undo/redo g?\195?\169r?\195?\169
- propertychangelistener fonctionne pas pour les maj des setMachins
- couleur de fond pour les bordures ok
- modifs de la fusion des courbes temporelles
- duplication des courbes en parcourant les variables
- ajout des group si manquants dans le graphe initial
- modifs de la fusion des profils spatiaux
- meme systeme repris mais cela merdouille
Modified Paths:
--------------
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerForGroup.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionGraphes.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardProfilSpatial.java
Removed Paths:
-------------
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerFusionCalque.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorFusionCalques.java
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -51,6 +51,9 @@
private EbliScene scene_;
private boolean useBorder_ = true;
+
+
+
/**
* @param scene
@@ -274,6 +277,9 @@
public void removePropertyChangeListener(String _key, PropertyChangeListener _l) {}
+ public void removePropertyChangeListenerFormWidget(EbliWidget _widget) {
+ }
+
public void setColorContour(Color newColor) {
propGraphique.put(COLORCONTOUR, newColor);
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -58,6 +58,7 @@
insets_ = createInset((int) getTraceLigneModel().getEpaisseur());
setLayout(new OverlayLayoutGap(insets_));
+
// -- ajout du child --//
addChild(intern_);
@@ -75,6 +76,20 @@
return new Insets(epaisseur, epaisseur, epaisseur, epaisseur);
}
+ // protected void paintWidget() {
+ // // getGraphics().setColor(getColorFond());
+ // // getGraphics().fillRect(insets_.left, insets_.top,
+ // // getClientArea().width - insets_.left - insets_.right,
+ // // getClientArea().height - insets_.bottom - insets_.top);
+ // // getGraphics().setColor(getColorContour());
+ // //
+ // // TraceLigne tl = new TraceLigne(getTraceLigneModel());
+ // // tl.dessineRectangle(getGraphics(), 0, 0, getClientArea().width,
+ // getClientArea().getHeight());
+//
+ //
+ // }
+
/**
* surcharge des methodes getProperty pour recuperer les proprietes graphiques et les dipatcher a son conteneur
*/
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -408,6 +408,10 @@
canResize_ = false;
}
+
+ public WidgetAction getActionMove() {
+ return actionMove_;
+ }
/**
* fonction inverse de la precedente.
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerForGroup.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerForGroup.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerForGroup.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -13,6 +13,8 @@
*/
public class EbliWidgetControllerForGroup extends EbliWidgetController {
+ public boolean hasAlreadyFusion = false;
+
public EbliWidgetControllerForGroup(EbliWidget _widget) {
super(_widget,true,true,false);
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -41,20 +41,28 @@
Rectangle rec = getClientArea();
- // -- couleur de fond --//
- // g.setColor(getColorFond());
- // g.fillRect(0, 0, rec.width, rec.height);
+
g.translate(rec.x, rec.y);
- // la ligne
-
+
+
+
TraceLigne l = new TraceLigne(getTraceLigneModel());
+ getGraphics().setColor(getColorFond());
+ getGraphics().fillRect(0, 0, (int) (rec.width - l.getEpaisseur()), (int) (rec.height - l.getEpaisseur()));
+
+
l.setCouleur(getColorContour());
l.dessineRectangle(g, (int) (l.getEpaisseur() / 2), (int) (l.getEpaisseur() / 2), (int) (rec.width - l
.getEpaisseur()), (int) (rec.height - l.getEpaisseur())/* , rec.width */);
+
+
+
g.translate(-rec.x, -rec.y);
+
+ // setBackground(getColorFond());
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetUngroupAction.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -7,10 +7,7 @@
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
-import java.util.Set;
import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.ebli.ressource.EbliResource;
@@ -38,7 +35,7 @@
}
- protected static void degroupObjects(EbliScene _scene, EbliNode _n) {
+ public static void degroupObjects(EbliScene _scene, EbliNode _n) {
if (_n == null) { return; }
// Set cs = new HashSet();
// for (final Iterator iterator = selectedObjects.iterator(); iterator.hasNext();) {
@@ -50,6 +47,10 @@
Point toScene = w.convertLocalToScene(p);
EbliNode n = (EbliNode) _scene.findObject(widget);
widget.removeFromParent();
+
+ // -- utilis\xE9 pour enlever les propertychange listener
+ w.removePropertyChangeListenerFormWidget((EbliWidget) widget);
+
_n.setPreferedLocation(toScene);
_n.setPreferedSize(widget.getPreferredSize());
// widget.setPreferredLocation(toScene);
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -28,11 +28,11 @@
import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.ebli.visuallibrary.EbliNode;
import org.fudaa.ebli.visuallibrary.EbliWidget;
+import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle;
import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly;
import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure;
import org.fudaa.ebli.visuallibrary.actions.CommandMasquer;
import org.fudaa.ebli.visuallibrary.actions.EbliActionEditorOneClick;
-import org.netbeans.api.visual.action.WidgetAction;
import com.memoire.bu.BuMenuBar;
import com.memoire.bu.BuPanel;
@@ -63,6 +63,7 @@
EbliWidgetVueCalque widgetCalque_;
EbliWidgetWithBordure widgetParent_;
+ EbliActionEditorOneClick<BuPanel> editorAction_;
public EbliWidgetControllerCalque(EbliWidgetVueCalque _widget, EbliWidgetWithBordure _parent) {
super(_parent);
@@ -74,9 +75,10 @@
public void addActionSpecifiques() {
- WidgetAction editorAction = new EbliActionEditorOneClick<BuPanel>((EbliWidgetVueCalque) widgetCalque_);
+ editorAction_ = new EbliActionEditorOneClick<BuPanel>((EbliWidgetVueCalque) widgetCalque_);
// -- ajout de l action au widget correspondant --//
- widgetCalque_.getActions().addAction(editorAction);
+ widgetCalque_.getActions().addAction(editorAction_);
+
}
@@ -161,12 +163,43 @@
public void actionPerformed(ActionEvent e) {
+
+
ajoutLegende();
}
});
+ menuItem = new JMenuItem(EbliResource.EBLI.getString("Editer le calque"));
+ _popup.add(menuItem, 0);
+ menuItem.setIcon(CtuluResource.CTULU.getIcon("crystal_editer"));
+ menuItem.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ MenuEditer();
+
+
+ }
+ });
+
}
+
+ /**
+ * Mise au premier plan de la widget et edition. Sert beaucoup pour la fusion
+ */
+ public void MenuEditer() {
+ // -- premier plan pour la visualiser dans le groupe --//
+ if (this.widgetCalque_.getParentWidget() != null
+ && this.widgetCalque_.getParentWidget() instanceof EbliWidgetBordureSingle)
+ this.widgetCalque_.getParentWidget().bringToFront();
+ else
+ this.widgetCalque_.bringToFront();
+
+ // -- executer l action d edition --//
+ editorAction_.openEditor(widgetCalque_);
+
+ }
+
public ZEbliCalquesPanel getCalque() {
return widgetCalque_.calquePanel_;
}
Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerFusionCalque.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerFusionCalque.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerFusionCalque.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -1,269 +0,0 @@
-package org.fudaa.ebli.visuallibrary.calque;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.image.BufferedImage;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.BorderFactory;
-import javax.swing.DefaultListModel;
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JMenu;
-import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
-import javax.swing.JScrollPane;
-import javax.swing.ListSelectionModel;
-
-import org.fudaa.ctulu.image.CtuluLibImage;
-import org.fudaa.ebli.calque.BArbreCalque;
-import org.fudaa.ebli.calque.BCalquePaletteInfo;
-import org.fudaa.ebli.calque.ZEbliCalquesPanel;
-import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser;
-import org.fudaa.ebli.commun.EbliActionInterface;
-import org.fudaa.ebli.commun.EbliComponentFactory;
-import org.fudaa.ebli.commun.EbliLib;
-import org.fudaa.ebli.controle.BSelecteurListComboBox;
-import org.fudaa.ebli.ressource.EbliResource;
-import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly;
-import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure;
-import org.fudaa.ebli.visuallibrary.graphe.GrapheCellRenderer;
-
-import com.memoire.bu.BuMenuBar;
-import com.memoire.bu.BuToolBar;
-
-public class EbliWidgetControllerFusionCalque extends EbliWidgetControllerMenuOnly {
-
- JLabel labelTrace_;
-
- /**
- * widget de la legende
- */
- CalqueLegendeWidgetAdapter legendeWidget_;
-
- BuMenuBar menuCalque_;
-
- JPanel panelTreeCalque_;
-
- BuToolBar toolbarCalque_;
-
- JList selectionCalque_;
-
- BArbreCalque arbreCalque_;
-
- EbliWidgetFusionCalques widgetCalque_;
- EbliWidgetWithBordure widgetParent_;
-
-
-
- public boolean hasAlreadyFusion = false;
-
-
- public EbliWidgetControllerFusionCalque(EbliWidgetFusionCalques _widget, EbliWidgetWithBordure _parent) {
- super(_parent);
- widgetCalque_ = _widget;
- widgetParent_ = _parent;
- addActionSpecifiques();
-
- }
-
- public void addActionSpecifiques() {
-
- // WidgetAction editorAction = new EbliActionEditorOneClick<BuPanel>(
- // (EbliWidgetVueCalque) widgetCalque_.widgetCalque1_);
- // // -- ajout de l action au widget correspondant --//
- // widgetCalque_.getActions().addAction(editorAction);
-
- }
-
-
-
-
-public ZEbliCalquesPanel getCalqueCourant() {
- return widgetCalque_.getCalqueCourant().calquePanel_;
- }
-
-
- /**
- * retourne le menuBar associee au calque
- *
- * @return
- */
- public BuMenuBar getMenubarComponent() {
-
- if (menuCalque_ == null) {
-
- menuCalque_ = new BuMenuBar();
-
- }
- menuCalque_.removeAll();
-
- JMenu[] specificMenus = getCalqueCourant().getSpecificMenus(EbliLib.getS("Vue 2D"));
-
- for (int i = 0; i < specificMenus.length; i++) {
- menuCalque_.add(specificMenus[i]);
- }
-
-
- return menuCalque_;
-
- }
-
- /**
- * remplit le model de la liste par des labels representants le contenu du
- * widgt fusion.
- *
- * @return
- */
-public DefaultListModel fillModelListWithCalques() {
- Map params = new HashMap();
- CtuluLibImage.setCompatibleImageAsked(params);
- DefaultListModel model = new DefaultListModel();
- for (int i = 0; i < widgetCalque_.listeWidgetCalque_.size(); i++) {
-
- JLabel label = new JLabel();
- label.setText("" + widgetCalque_.getWidgetCalque(i).calquePanel_.getCqInfos().getTitle());
- BufferedImage image = widgetCalque_.getWidgetCalque(i).calquePanel_.produceImage(70, 30, params);
- Icon icone = new ImageIcon(image);
- label.setIcon(icone);
- model.addElement(label);
-
- }
-
- selectionCalque_.addListSelectionListener(widgetCalque_);
- // model.addListDataListener(widgetCalque_);
-
- return model;
- }
-
- /**
- * Recupere les objets graphique tree et panel infos associe au calque.
- *
- * @return
- */
- public JComponent getOverviewComponent() {
-
- // -- jlist qui propose la liste des composants du calque --//
- if (selectionCalque_ == null) {
- selectionCalque_ = new JList();
- selectionCalque_.setCellRenderer(new GrapheCellRenderer());
- selectionCalque_.setBorder(BorderFactory.createTitledBorder(EbliResource.EBLI.getString("Liste des calques")));
- selectionCalque_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- selectionCalque_.setSize(250, 100);
- selectionCalque_.setPreferredSize(new Dimension(250, 100));
- selectionCalque_.setMaximumSize(new Dimension(250, 100));
-
-
- }
- // -- creation du model de la jlist --//
- DefaultListModel model = fillModelListWithCalques();
- selectionCalque_.setModel(model);
- // selectionCalque_.setSelectedIndex(widgetCalque_.getIndexCalqueCourant());
-
-
-
- if (panelTreeCalque_ == null) {
- panelTreeCalque_ = new JPanel(new BorderLayout());
-
-
- BCalquePaletteInfo info = new BCalquePaletteInfo(getCalqueCourant().getArbreCalqueModel());
- info.setAvailable(true);
- panelTreeCalque_.add(info, BorderLayout.NORTH);
- JPanel panelConteneur = new JPanel(new BorderLayout());
-
- arbreCalque_ = new BArbreCalque();
- arbreCalque_.setBorder(BorderFactory.createTitledBorder(EbliResource.EBLI.getString("Arbre du calque")));
- panelConteneur.add(arbreCalque_, BorderLayout.CENTER);
- panelConteneur.add(new JScrollPane(selectionCalque_), BorderLayout.NORTH);
-
- panelTreeCalque_.add(new JScrollPane(panelConteneur), BorderLayout.CENTER);
-
- }
- // -- mise a jour du model de l arbre --//
- arbreCalque_.setModel(getCalqueCourant().getArbreCalqueModel());
-
-
- return panelTreeCalque_;
- }
-
- /**
- * Obtient la toolbar specifique au calque
- *
- * @return
- */
- public BuToolBar getToolbarComponent() {
-
- if (toolbarCalque_ == null) {
- toolbarCalque_ = new BuToolBar();
- }
- toolbarCalque_.removeAll();
-
- // ajout des tool specifiques du calque
- List actions = getCalqueCourant().getController().getActions();
- for (Iterator iterator = actions.iterator(); iterator.hasNext();) {
- EbliActionInterface object = (EbliActionInterface) iterator.next();
- if (object == null) {
- toolbarCalque_.addSeparator();
- } else {
- toolbarCalque_.add(object.buildToolButton(EbliComponentFactory.INSTANCE));
- }
- }
-
- // -- ajout des comboBox des variables --//
- BSelecteurListComboBox combo = new BSelecteurListComboBox();
- // pour mettre \xE0 jour la combo d\xE8s que la s\xE9lection de l'arbre change
- getCalqueCourant().getArbreCalqueModel().getTreeSelectionModel().addTreeSelectionListener(combo);
- combo.setPalettePanelTarget(getCalqueCourant().getArbreCalqueModel().getSelectedCalque());
- // combo.setPalettePanelTarget(listselector.getTarget());
- combo.setMinimumSize(combo.getPreferredSize());
- combo.setMaximumSize(combo.getPreferredSize());
-
- // ajout combobox
- toolbarCalque_.add(combo);
-
- // -- ajout des combo des pas de temps --//
- EbliCalqueActionTimeChooser chooserT = new EbliCalqueActionTimeChooser(getCalqueCourant().getArbreCalqueModel()
- .getTreeSelectionModel(), true);
- // pour activer l'action
- chooserT.setSelected(true);
- combo = (BSelecteurListComboBox) chooserT.buildContentPane();
- chooserT.updateBeforeShow();
- combo.setMaximumSize(combo.getPreferredSize());
- combo.setMinimumSize(combo.getPreferredSize());
-
- // ajout combobox
- toolbarCalque_.add(combo);
-
-
- return toolbarCalque_;
- }
-
- /**
- * affiche le label des coordonnees
- */
- public JComponent geTtracableComponent() {
-
-
- return getCalqueCourant().getLabelSuiviSouris();
- }
-
-
-
- @Override
- protected void buildPopupMenu(JPopupMenu _menu) {
- // constructPopupMenuSpecifique(_menu);
- // -- creation du menu commun a tous les widgets
- constructPopupMenuBase(_menu);
- }
-
-
-
-
-
-}
Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorFusionCalques.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorFusionCalques.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorFusionCalques.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -1,73 +0,0 @@
-package org.fudaa.ebli.visuallibrary.calque;
-
-import java.awt.Dimension;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.fudaa.ebli.geometrie.GrBoite;
-import org.fudaa.ebli.visuallibrary.EbliNode;
-import org.fudaa.ebli.visuallibrary.EbliScene;
-import org.fudaa.ebli.visuallibrary.EbliWidget;
-import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle;
-import org.fudaa.ebli.visuallibrary.EbliWidgetCreator;
-import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure;
-
-public class EbliWidgetCreatorFusionCalques implements EbliWidgetCreator {
-
- ArrayList<EbliWidgetVueCalque> listeWidgetCalque_;
-
- GrBoite initZoom_;
-
- EbliWidgetWithBordure res;
-
-
-
- public EbliWidgetCreatorFusionCalques(EbliWidgetVueCalque widgetCalque1_,
- ArrayList<EbliWidgetVueCalque> listWidgetToMerge) {
- this(widgetCalque1_, listWidgetToMerge, null);
- }
-
- public EbliWidgetCreatorFusionCalques(EbliWidgetVueCalque widgetCalque1_,
- ArrayList<EbliWidgetVueCalque> listWidgetToMerge,
- GrBoite _initZoom) {
- super();
- listeWidgetCalque_ = new ArrayList<EbliWidgetVueCalque>();
-
- listeWidgetCalque_.add(widgetCalque1_);
-
- for (Iterator<EbliWidgetVueCalque> it = listWidgetToMerge.iterator(); it.hasNext();)
- listeWidgetCalque_.add(it.next());
-
- initZoom_ = _initZoom;
- // legendeDuplic_=
- }
-
-
- public EbliWidget create(EbliScene _scene) {
- EbliWidgetFusionCalques widgetCalque = new EbliWidgetFusionCalques(_scene, listeWidgetCalque_,
- initZoom_);
- res = new EbliWidgetBordureSingle(widgetCalque);
- res.setPreferredSize(new Dimension(400, 400));
- widgetCalque.setController(new EbliWidgetControllerFusionCalque(widgetCalque, res));
- return res;
- }
-
-
-
- public EbliWidgetWithBordure getBordure() {
- return res;
- }
-
-
-
- public EbliWidget getWidget() {
- return res;
- }
-
- public EbliNode duplicate(EbliNode _nodeAdupliquer) {
- return null;
- }
-
-
-
-}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -1,133 +1,94 @@
package org.fudaa.ebli.visuallibrary.calque;
-import java.awt.Dimension;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Iterator;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import org.fudaa.ebli.calque.ZEbliCalquesPanel;
-import org.fudaa.ebli.geometrie.GrBoite;
+import org.fudaa.ebli.calque.BCalque;
+import org.fudaa.ebli.geometrie.GrMorphisme;
import org.fudaa.ebli.visuallibrary.EbliScene;
import org.fudaa.ebli.visuallibrary.EbliWidget;
-import org.netbeans.modules.visual.layout.OverlayLayout;
+import com.memoire.fu.FuLog;
+
/**
- * Widget qui resulte de la fusion de 2 calques.
+ * Widget qui resulte de la fusion de calques
*
* @author Adrien Hadoux
*
*/
-public class EbliWidgetFusionCalques extends EbliWidget implements ListSelectionListener {
+public final class EbliWidgetFusionCalques extends EbliWidget implements PropertyChangeListener {
- ArrayList<EbliWidgetVueCalque> listeWidgetCalque_;
-
- /**
- * Calque courant qui sera modifi\xE9 a chaque fois que l utilisateur changera de
- * calque de premier plan.
- */
- EbliWidgetVueCalque calqueCourant_;
+ public final ArrayList<EbliWidgetVueCalque> listeWidgetCalque_ = new ArrayList<EbliWidgetVueCalque>();
- OverlayLayout layout_;
- GrBoite initZoom_;
-
-
- public EbliWidgetFusionCalques(EbliScene _scene, ArrayList<EbliWidgetVueCalque> _liste, GrBoite zoom) {
+ public EbliWidgetFusionCalques(EbliScene _scene) {
super(_scene);
+ //calquePanel_.getVueCalque().getAbstractCalque().addPropertyChangeListener(
+ // "versReel", listener);
- initZoom_ = zoom;
- listeWidgetCalque_=_liste;
- // --creation du layout de mise en page --//
- layout_ = new OverlayLayout();
- this.setLayout(layout_);
-
- // -- ajout des widgets --//
- for (Iterator<EbliWidgetVueCalque> it = listeWidgetCalque_.iterator(); it.hasNext();) {
- EbliWidgetVueCalque calque = it.next();
- this.addChild(calque);
- // -- mise a jour du zoom
- calque.initZoom_ = initZoom_;
-
- // init le calque courant
- if (calqueCourant_ == null)
- calqueCourant_ = calque;
- }
- setPreferredSize(new Dimension(500, 400));
-
}
- /**
- * Methode utilisee pour mettre au premier plan la widget selectionnee.
- *
- * @param newCrt
- * : nouvelle widget calque a positionner au premier plan
- */
- public void changeWidgetCourant(EbliWidgetVueCalque newCrt) {
- calqueCourant_ = newCrt;
+ public void addChildCalque(EbliWidget child) {
+
+ addChild(child);
- // -- mise au premier plan de newCrt --//
- bringToFront(calqueCourant_);
+ EbliWidgetVueCalque widgetCalque;
+ if (child instanceof EbliWidgetVueCalque)
+ widgetCalque = (EbliWidgetVueCalque) child;
+ else
+ widgetCalque = (EbliWidgetVueCalque) child.getChildren().get(0);
+ listeWidgetCalque_.add(widgetCalque);
+ // -- ajout du listener des calques sur this --//
+ widgetCalque.calquePanel_.getVueCalque().getAbstractCalque().addPropertyChangeListener("versEcran", this);
+ widgetCalque.calquePanel_.getVueCalque().getAbstractCalque().addPropertyChangeListener("versReel", this);
}
+
+ boolean noCyclePropertieChange = true;
-
- public void bringToFront(EbliWidgetVueCalque widget) {
+ public void propertyChange(PropertyChangeEvent _evt) {
- this.removeChild(widget);
+ if (!noCyclePropertieChange)
+ return;
+ noCyclePropertieChange = false;
+ // listeWidgetCalque_.get(0).calquePanel_.getVueCalque().changeViewBoite(
+ // _source, _boite, _rapide)
+ FuLog.warning("je rentre dans propertychange !!!");
+ GrMorphisme morph = (GrMorphisme) _evt.getNewValue();
- // -- ajout pour qu elle soit en premier plan --//
- this.addChild(widget);
-
- // -- refrresh de la scene --//
+ for (Iterator<EbliWidgetVueCalque> it = listeWidgetCalque_.iterator(); it.hasNext();) {
+ EbliWidgetVueCalque widget = it.next();
+ if (_evt.getPropertyName().equals("versEcran")) {
+ ((BCalque) widget.calquePanel_.getVueCalque().getAbstractCalque()).setVersEcran(morph);
+
+ } else {
+ ((BCalque) widget.calquePanel_.getVueCalque().getAbstractCalque()).setVersReel(morph);
+ }
+
+ }
+ noCyclePropertieChange = true;
getEbliScene().refresh();
}
- public EbliWidgetVueCalque getCalqueCourant() {
- return calqueCourant_;
- }
-
-
- public ZEbliCalquesPanel getCalque(int i) {
+ /**
+ * Surcharge de la methode de ebli, utilisse pour virer les property change
+ * listener
+ */
+ public void removePropertyChangeListenerFormWidget(EbliWidget child) {
+ EbliWidgetVueCalque widgetCalque;
+ if (child instanceof EbliWidgetVueCalque)
+ widgetCalque = (EbliWidgetVueCalque) child;
+ else
+ widgetCalque = (EbliWidgetVueCalque) child.getChildren().get(0);
+ widgetCalque.calquePanel_.getVueCalque().getAbstractCalque().removePropertyChangeListener("versEcran", this);
+ widgetCalque.calquePanel_.getVueCalque().getAbstractCalque().removePropertyChangeListener("versReel", this);
+
+
- return getWidgetCalque(i).calquePanel_;
}
- public int getNbWidgets() {
- return listeWidgetCalque_.size();
- }
-
- public EbliWidgetVueCalque getWidgetCalque(int i) {
- return listeWidgetCalque_.get(i);
- }
-
-
- public int getIndexCalqueCourant() {
-
- for (int i = 0; i < listeWidgetCalque_.size(); i++)
- if (listeWidgetCalque_.get(i) == calqueCourant_)
- return i;
-
- return -1;
- }
-
- public void valueChanged(ListSelectionEvent _e) {
-
- // -- on est dans un cas single selection mode --//
- int selected = _e.getFirstIndex();
-
- // -- on change de calque courant --//
- if (selected < listeWidgetCalque_.size())
- changeWidgetCourant(getWidgetCalque(selected));
-
- }
-
-
-
-
-
-
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -47,6 +47,8 @@
// GrBoite zoom_;
public EbliWidgetVueCalque(EbliScene _scene, ZEbliCalquesPanel _vue) {
this(_scene, _vue, null);
+
+
}
@@ -66,10 +68,9 @@
setPreferredSize(new Dimension(500, 400));
initSize(new Rectangle(0, 0, 500, 400));
- // _vue.addCqLegende(new BCalqueLegende());
-
- // --ajout du controller specifique au graphe --//
-
+
+
+
}
public BuPanel createEditorComponent(
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -18,16 +18,18 @@
import javax.swing.tree.TreePath;
-import com.vividsolutions.jts.geom.Coordinate;
-import com.vividsolutions.jts.geom.LineString;
-
-import com.memoire.bu.BuLib;
-import com.memoire.bu.BuResource;
-
-import org.fudaa.ctulu.*;
+import org.fudaa.ctulu.CtuluCommand;
+import org.fudaa.ctulu.CtuluCommandContainer;
+import org.fudaa.ctulu.CtuluCommandManager;
+import org.fudaa.ctulu.CtuluLibArray;
+import org.fudaa.ctulu.CtuluLibString;
+import org.fudaa.ctulu.CtuluRunnable;
+import org.fudaa.ctulu.CtuluTaskDelegate;
+import org.fudaa.ctulu.CtuluUI;
+import org.fudaa.ctulu.CtuluVariable;
+import org.fudaa.ctulu.ProgressionInterface;
import org.fudaa.ctulu.gis.GISGeometryFactory;
import org.fudaa.ctulu.gui.CtuluLibSwing;
-
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.ef.operation.EfLineIntersection;
import org.fudaa.dodico.ef.operation.EfLineIntersectionsCorrectionTester;
@@ -35,7 +37,6 @@
import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI;
import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsMng;
import org.fudaa.dodico.h2d.type.H2dVariableType;
-
import org.fudaa.ebli.courbe.EGAxeVertical;
import org.fudaa.ebli.courbe.EGCourbe;
import org.fudaa.ebli.courbe.EGCourbeChild;
@@ -43,11 +44,15 @@
import org.fudaa.ebli.courbe.EGGrapheTreeModel;
import org.fudaa.ebli.courbe.EGGroup;
import org.fudaa.ebli.courbe.EGObject;
-
import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel;
import org.fudaa.fudaa.meshviewer.MvResource;
import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime;
+import com.memoire.bu.BuLib;
+import com.memoire.bu.BuResource;
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.LineString;
+
/**
* @author fred deniger
* @version $Id: MvProfileTreeModel.java,v 1.12 2007-06-13 14:46:13 deniger Exp
@@ -60,7 +65,7 @@
EfLineIntersectionsResultsBuilder builderMesh_;
EfLineIntersectionsResultsMng resMesh_;
final EfLineIntersectionsCorrectionTester tester_;
- final MvProfileTarget target_;
+ public final MvProfileTarget target_;
public MvProfileTreeModel(final MvProfileTarget _target, final EfLineIntersectionsCorrectionTester _tester) {
super();
@@ -154,7 +159,15 @@
return GISGeometryFactory.INSTANCE.createLineString(cs);
}
- protected MvProfileCourbeGroup getGroup(final CtuluVariable _v, final boolean _create) {
+ /**
+ * Recherche le bon groupe pour les profils spatiaux. peut creer le groupe si
+ * booleen est a true.
+ *
+ * @param _v
+ * @param _create
+ * @return
+ */
+ public MvProfileCourbeGroup getGroup(final CtuluVariable _v, final boolean _create) {
for (int i = getNbEGObject() - 1; i >= 0; i--) {
final EGGroup g = getGroup(i);
if ((g instanceof MvProfileCourbeGroup) && ((MvProfileCourbeGroup) g).getVar() == _v) { return (MvProfileCourbeGroup) g; }
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -1,12 +1,19 @@
package org.fudaa.fudaa.tr.post;
import java.awt.BorderLayout;
+import java.awt.Dimension;
import java.awt.FlowLayout;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -22,30 +29,34 @@
import javax.swing.JPanel;
import javax.swing.ListSelectionModel;
+import org.fudaa.ctulu.CtuluCommand;
import org.fudaa.ctulu.CtuluResource;
import org.fudaa.ctulu.ProgressionBuAdapter;
import org.fudaa.ctulu.ProgressionInterface;
import org.fudaa.ctulu.gui.CtuluTaskOperationGUI;
import org.fudaa.ctulu.image.CtuluLibImage;
import org.fudaa.ebli.calque.ZEbliCalquesPanel;
+import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.ebli.visuallibrary.EbliNode;
import org.fudaa.ebli.visuallibrary.EbliNodeDefault;
-import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle;
+import org.fudaa.ebli.visuallibrary.EbliWidget;
+import org.fudaa.ebli.visuallibrary.EbliWidgetControllerForGroup;
+import org.fudaa.ebli.visuallibrary.EbliWidgetGroupCreator;
import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionSimple;
+import org.fudaa.ebli.visuallibrary.actions.EbliWidgetUngroupAction;
import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerCalque;
-import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerFusionCalque;
-import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorFusionCalques;
import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque;
import org.fudaa.ebli.visuallibrary.calque.EbliWidgetFusionCalques;
import org.fudaa.ebli.visuallibrary.calque.EbliWidgetVueCalque;
import org.fudaa.ebli.visuallibrary.graphe.GrapheCellRenderer;
+import org.fudaa.ebli.visuallibrary.layout.OverlayLayoutGap;
import org.fudaa.fudaa.tr.common.TrResource;
+import org.netbeans.api.visual.widget.Widget;
import com.memoire.bu.BuDialog;
-import com.memoire.bu.BuDialogConfirmation;
+import com.memoire.bu.BuDialogMessage;
import com.memoire.bu.BuScrollPane;
-import com.memoire.fu.FuLog;
/**
* Action qui realise la fusion des calques
@@ -100,28 +111,8 @@
- /**
- * Constructeur pour le cas d une widget fusion
- */
- public TrPostActionFusionCalques(EbliWidgetFusionCalques widgetFusion, EbliNode nodeGraphe, TrPostProjet projet) {
- super(widgetFusion.getEbliScene(), TrResource.getS("Fusion avec un autre calque"), CtuluResource.CTULU
- .getIcon("cible"),
- "ADDPOINTWIDGET");
+
- for (int i = 1; i < widgetFusion.getNbWidgets(); i++)
- listeTotaleWidgetToMerge_.add(widgetFusion.getWidgetCalque(i));
-
- widgetCalque_ = widgetFusion.getWidgetCalque(0);
- nodeCalque_ = nodeGraphe;
- projet_ = projet;
-
- // -- ajout de la combo dans la toolbar de la widget --//
- if (!((EbliWidgetControllerFusionCalque) widgetFusion.getController()).hasAlreadyFusion) {
- widgetFusion.getController().getPopup().add(this);
- ((EbliWidgetControllerFusionCalque) widgetFusion.getController()).hasAlreadyFusion = true;
- }
- }
-
/**
* remplissage de la combo avec les graphes disponibles et compatibles
*
@@ -155,21 +146,7 @@
}
- } else if (currentNode != nodeCalque_ && currentNode.getCreator() instanceof EbliWidgetCreatorFusionCalques) {
-
- // -- on ajoute le node potentiel qui renferme une widget fusion --//
- EbliWidgetCreatorFusionCalques new_name = (EbliWidgetCreatorFusionCalques) currentNode.getCreator();
-
- if (isCompatibleWithCalque(new_name)) {
-
- JLabel label = new JLabel();
- label.setText(TrResource.TR.getString("Fusionner avec la Fusion ") + currentNode.getTitle());
- listeObjetsCalques.add(label);
- listeCalquesPossibles.add(currentNode);
- }
-
-
- }
+ }
}
@@ -205,9 +182,7 @@
return true;
}
- public boolean isCompatibleWithCalque(EbliWidgetCreatorFusionCalques widgetFusion) {
- return true;
- }
+
@@ -249,116 +224,142 @@
return;
}
+ final ArrayList<EbliNode> listeToMerge = new ArrayList<EbliNode>();
+
//-- parcours de la liste des indices selectionnes --//
for(int i=0;i<selected.length;i++){
EbliNode nodeToMerge = listeCalquesPossibles.get(selected[i]);
- // --recuperation de son graphe --//
+ // --Ajout du noeud --//
+ listeToMerge.add(nodeToMerge);
- //cas bordure
- if (nodeToMerge.getWidget() instanceof EbliWidgetBordureSingle){
- if(((EbliWidgetBordureSingle) nodeToMerge.getWidget()).getIntern() instanceof EbliWidgetVueCalque){
- EbliWidgetVueCalque calqueWidget = (EbliWidgetVueCalque) ((EbliWidgetBordureSingle) nodeToMerge.getWidget()).getIntern();
- // -- ajout de la widget cible a la liste a merger --//
- listeTotaleWidgetToMerge_.add(calqueWidget);
-
- // -- suppression du noeud de la scene--//
- if (nodeToMerge != null)
- scene_.removeNodeWithEdges(nodeToMerge);
- }
- else
- //-- cas le noeud selectionne contient des fusionWidget
- if(((EbliWidgetBordureSingle) nodeToMerge.getWidget()).getIntern() instanceof EbliWidgetFusionCalques){
-
- EbliWidgetFusionCalques calqueWidget = (EbliWidgetFusionCalques) ((EbliWidgetBordureSingle) nodeToMerge.getWidget()).getIntern();
- // -- ajout de toutes les widgets de la FusionWidget --//
- for(int k=0;k< calqueWidget.getNbWidgets();k++)
- listeTotaleWidgetToMerge_.add(calqueWidget.getWidgetCalque(k));
-
- // -- suppression du noeud de la scene--//
- if (nodeToMerge != null)
- scene_.removeNodeWithEdges(nodeToMerge);
- }
-
-
-
- }
- else{
- if( nodeToMerge.getWidget() instanceof EbliWidgetVueCalque){
- EbliWidgetVueCalque calqueWidget = (EbliWidgetVueCalque) nodeToMerge.getWidget();
- // -- ajout de la widget cible a la liste a merger --//
- listeTotaleWidgetToMerge_.add(calqueWidget);
-
- // -- suppression du noeud de la scene--//
- if (nodeToMerge != null)
- scene_.removeNodeWithEdges(nodeToMerge);
- }
- else
- //-- cas le noeud selectionne contient des fusionWidget
- if( nodeToMerge.getWidget()instanceof EbliWidgetFusionCalques){
-
- EbliWidgetFusionCalques calqueWidget = (EbliWidgetFusionCalques) nodeToMerge.getWidget();
- // -- ajout de toutes les widgets de la FusionWidget --//
- for(int k=0;k< calqueWidget.getNbWidgets();k++)
- listeTotaleWidgetToMerge_.add(calqueWidget.getWidgetCalque(k));
-
- // -- suppression du noeud de la scene--//
- if (nodeToMerge != null) {
- scene_.removeNodeWithEdges(nodeToMerge);
- scene_.refresh();
- }
- }
-
- }
- }
-
+ }
+ // -- ajout du node initial --//
+ listeToMerge.add(nodeCalque_);
-
- FuLog.warning("NB LISTE DES WIDGETS: " + listeTotaleWidgetToMerge_.size());
-
// --ajout de la courbe au widget de base --//
new CtuluTaskOperationGUI(projet_.impl_, TrResource.getS("Fusion avec un autre calque")) {
public void act() {
final ProgressionInterface prog = new ProgressionBuAdapter(this);
+ final EbliNode fusion = groupWidgetsFusion(listeToMerge);
+
+
+ // -- undo/redo --//
+ getScene().getCmdMng().addCmd(new CtuluCommand() {
-
- // -- creation de la nouvelle widget contenant les 2 calques --//
- EbliNode nodeFusion = new EbliNodeDefault();
- nodeFusion.setTitle(TrResource.getS("Fusion de calques"));
-
- nodeFusion.setCreator(new EbliWidgetCreatorFusionCalques(widgetCalque_, listeTotaleWidgetToMerge_));
-
- scene_.addNode(nodeFusion);
+ public void undo() {
+ EbliWidgetUngroupAction.degroupObjects(getScene(), fusion);
+ }
+
+ public void redo() {
+ groupWidgetsFusion(listeToMerge);
+ }
+ });
+
+
}
}.start();
;
+ // -- maj de la combo --//
+ // remplirCombo();
+
+
+
+ }
+
+
+ private EbliNode groupWidgetsFusion(final ArrayList<EbliNode> _selectedObjects) {
+ EbliWidgetFusionCalques parent = new EbliWidgetFusionCalques(scene_);
+ // -- il faut des gaps suffisants pour deplacer la widget et avoir le menu
+ // du groupe --//
+ Insets insetLayout = new Insets(30, 30, 30, 30);
+ // parent.setLayout(new OverlayLayout());
+ parent.setLayout(new OverlayLayoutGap(insetLayout));
- // --suppression du calque de base --//
- scene_.removeNodeWithEdges(nodeCalque_);
+ Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ Point max = new Point(-Integer.MAX_VALUE, -Integer.MAX_VALUE);
+ Rectangle sizeMax = new Rectangle(0, 0);
+ for (Object object : _selectedObjects) {
+ Widget findWidget = scene_.findWidget(object);
+ // Rectangle rec = findWidget.getBounds();
+ Rectangle rec = findWidget.convertLocalToScene(findWidget.getBounds());
+ min.x = Math.min(min.x, rec.x);
+ min.y = Math.min(min.y, rec.y);
+ max.x = Math.max(max.x, rec.x + rec.width);
+ max.y = Math.max(max.y, rec.y + rec.height);
+
+ if (sizeMax.height < rec.height)
+ sizeMax.height = rec.height;
+ if (sizeMax.width < rec.width)
+ sizeMax.width = rec.width;
+
+ }
+ int w = max.x - min.x;
+ int h = max.y - min.y;
+ Insets b = parent.getBorder().getInsets();
- scene_.refresh();
- // -- maj de la combo --//
- remplirCombo();
+ sizeMax.width += 2 * insetLayout.left;
+ sizeMax.height += 2 * insetLayout.bottom;
+ parent.setPreferredBounds(sizeMax);
+ parent.setPreferredSize(new Dimension(sizeMax.width, sizeMax.height));
+
+
+ for (Object object : _selectedObjects) {
+ Widget findWidget = scene_.findWidget(object);
+ Rectangle widgetBounds = findWidget.getBounds();
+ Rectangle rec = findWidget.convertLocalToScene(widgetBounds);
+ EbliWidget ew = (EbliWidget) findWidget;
+ ew.getController().removeActionResizeAndMove();
+
+
+
+ findWidget.removeFromParent();
+ int dx = rec.x - min.x;
+ int dy = rec.y - min.y;
+
+ Point pt = new Point(dx - widgetBounds.x, dy - widgetBounds.y);
+ findWidget.setPreferredLocation(pt);
+ parent.addChildCalque(ew);
+ float rMinX = ((float) dx) / w;
+ float rMinY = ((float) dy) / h;
+ float rMaxX = ((float) (w - widgetBounds.width - dx)) / w;
+ float rMaxY = ((float) (h - widgetBounds.height - dy)) / h;
+ parent.setChildConstraint(findWidget, new Rectangle2D.Float(rMinX, rMinY, rMaxX, rMaxY));
+
+ }
+ EbliWidgetGroupCreator creator = new EbliWidgetGroupCreator();
+
+ parent.setGroup(true);
+ creator.setW(parent);
+
+ EbliNodeDefault node = new EbliNodeDefault();
+ node.setPreferedLocation(min);
+ node.setTitle(EbliLib.getS("Fusion calquess"));
+ node.setCreator(creator);
+ parent.setController(new EbliWidgetControllerForGroup(parent));
+ scene_.addNode(node);
+ scene_.setSelectedObjects(new HashSet(Arrays.asList(node)));
+ return node;
}
-
+ int cpt = 1;
public void actionPerformed(ActionEvent _e) {
// -- remplisage combo --//
remplirCombo();
-
- dialog_ = new BuDialogConfirmation(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), TrResource
- .getS("Fusion avec un autre graphe"));
+
+ dialog_ = new BuDialogMessage(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), TrResource
+ .getS("Fusion avec un autre graphe " + (cpt++)));
if (content_ == null)
content_ = constructPanel();
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionGraphes.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionGraphes.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionGraphes.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -27,7 +27,11 @@
import org.fudaa.ctulu.ProgressionInterface;
import org.fudaa.ctulu.gui.CtuluTaskOperationGUI;
import org.fudaa.ctulu.image.CtuluLibImage;
+import org.fudaa.dodico.h2d.type.H2dVariableType;
+import org.fudaa.ebli.courbe.EGCourbeChild;
import org.fudaa.ebli.courbe.EGGraphe;
+import org.fudaa.ebli.courbe.EGGrapheDuplicator;
+import org.fudaa.ebli.courbe.EGGroup;
import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.ebli.visuallibrary.EbliNode;
import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle;
@@ -36,6 +40,9 @@
import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe;
import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetGraphe;
import org.fudaa.ebli.visuallibrary.graphe.GrapheCellRenderer;
+import org.fudaa.fudaa.meshviewer.profile.MVProfileCourbeModel;
+import org.fudaa.fudaa.meshviewer.profile.MvProfileCourbe;
+import org.fudaa.fudaa.meshviewer.profile.MvProfileCourbeGroup;
import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel;
import org.fudaa.fudaa.tr.common.TrResource;
@@ -215,16 +222,30 @@
public void act() {
final ProgressionInterface prog = new ProgressionBuAdapter(this);
-
- //-- cas points reels --//
- if (grapheToMerge.getObjIdx() != null && grapheToMerge.getObjIdx().length != 0)
- grapheModel.addPoints(grapheToMerge.getObjIdx(), scene_.getCmdMng(), prog, grapheToMerge.getVarSupported());
- //-- cas interpol\xE9 --//
- else if(grapheToMerge.getIntepolPt()!=null)
- for (Iterator it = grapheToMerge.getIntepolPt().iterator(); it.hasNext();)
- grapheModel.addPoints((TrPostInterpolatePoint) it.next(), scene_.getCmdMng(), prog, grapheToMerge
- .getVarSupported());
+
+
+ //-- parcours de la liste des variables du graphe a fusionner --//
+ for (Iterator<Object>it= grapheToMerge.getVarSupported().iterator();it.hasNext();) {
+ final H2dVariableType var = (H2dVariableType) it.next();
+
+ //-- on recherche le group associe a la variale dans l autre graphe sinon on le cree --//
+ EGGroup group = grapheModel.getGroupFor(var);
+
+ //-- on recupere toutes les courbes associees a la var pour le graphe merges
+ final EGGroup g = grapheToMerge.getGroupFor(var);
+ for (int i = g.getChildCount() - 1; i >= 0; i--) {
+ if (g.getCourbeAt(i).getModel() instanceof TrPostCourbeModel) {
+ if (((TrPostCourbeModel) g.getCourbeAt(i).getModel()).getVar() == var) {
+
+ // -- duplication de la courbe dans le groupe --//
+ group.addEGComponent((EGCourbeChild) g.getCourbeAt(i).duplicate(group, new EGGrapheDuplicator()));
+ }
+ }
+
+ }
+ }
+
}
}.start();
;
@@ -240,9 +261,45 @@
public void act() {
final ProgressionInterface prog = new ProgressionBuAdapter(this);
- grapheModel.addNewCourbe(scene_.getCmdMng(), widgetGraphe_.getPanelGraphe(), grapheObject,
- projet_.impl_);
+ // grapheModel.addNewCourbe(scene_.getCmdMng(),
+ // widgetGraphe_.getPanelGraphe(), grapheObject, projet_.impl_);
+
+
+ //-- parcours de la liste des variables du graphe a fusionner --//
+ for (int i=0;i<grapheToMerge.target_.getVars().length;i++) {
+ final H2dVariableType var = (H2dVariableType) grapheToMerge.target_.getVars()[i];
+
+ // -- on recupere toutes les courbes associees a la var pour le
+ // graphe merges
+ final MvProfileCourbeGroup g = grapheToMerge.getGroup(var, false);
+ if (g != null) {
+ //-- on recherche le group associe a la variale dans l autre graphe sinon on le cree --//
+ MvProfileCourbeGroup group = grapheModel.getGroup(var, true);
+
+
+ for (int k = g.getChildCount() - 1; k >= 0; k--) {
+ if (g.getCourbeAt(k).getModel() instanceof MVProfileCourbeModel) {
+ if (((MVProfileCourbeModel) g.getCourbeAt(k).getModel()).getVariable() == var) {
+
+
+ // -- duplication de la courbe dans le groupe --//
+ MvProfileCourbe newChild = new MvProfileCourbe(group, (MVProfileCourbeModel) g.getCourbeAt(k)
+ .getModel().duplicate());
+
+ // group.addEGComponent((EGCourbeChild)
+ // g.getCourbeAt(k).duplicate(group, new
+ // EGGrapheDuplicator()));
+
+ group.addEGComponent(newChild);
+ }
+ }
+
+ }
+ }
+
+ }
+
}
}.start();
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -413,6 +413,14 @@
}
}
+ /**
+ * Determine les courbes qui correspondent a la variable et les stocke dans la
+ * liste _l.
+ *
+ * @param _var
+ * @param _l
+ * contient toutes les courbes qui appartiennent a la variable
+ */
void getCourbeFor(final H2dVariableType _var, final List _l) {
final EGGroup g = getGroupFor(_var);
for (int i = g.getChildCount() - 1; i >= 0; i--) {
@@ -567,6 +575,13 @@
return true;
}
+ /**
+ * Recherche ou cree un groupe correspondant a la variable pour eviter les
+ * doublons.
+ *
+ * @param _t
+ * @return
+ */
public EGGroup getGroupFor(final H2dVariableType _t) {
if (_t == null) {
return null;
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -31,7 +31,6 @@
import org.fudaa.ebli.visuallibrary.actions.CommandUndoRedoPaste;
import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionConfigure;
import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter;
-import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorFusionCalques;
import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorLegende;
import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque;
import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe;
@@ -460,16 +459,6 @@
// -- etape 2: rechargement de la toolbar specifique dans this --//
changeToolbarSpecifiqueGraphe(node.getWidget().getController(), (EbliWidgetCreatorGraphe) node.getCreator());
- } else if (node.getCreator() instanceof EbliWidgetCreatorFusionCalques) {
-
- FuLog.warning("change tree Fusion de calques");
- // -- etape 1: ajout du tree dans fudaaImplementation --//
- changeTree(node.getWidget().getController());
-
- // -- etape 2: rechargement de la toolbar specifique dans this --//
- changeToolbar(node.getWidget().getController());
-
-
} else {
// -- etape 1: on fout eventuellement le tree des layouts --//
changeTreeScene();
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -3,7 +3,6 @@
import org.fudaa.ebli.visuallibrary.EbliNode;
import org.fudaa.ebli.visuallibrary.EbliScene;
import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle;
-import org.fudaa.ebli.visuallibrary.calque.EbliWidgetFusionCalques;
import org.fudaa.ebli.visuallibrary.calque.EbliWidgetVueCalque;
import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetGraphe;
import org.netbeans.api.visual.widget.Widget;
@@ -53,10 +52,10 @@
new TrPostActionFusionCalques((EbliWidgetVueCalque) ((EbliWidgetBordureSingle) node.getWidget()).getIntern(),
node, projet);
- else if (((EbliWidgetBordureSingle) node.getWidget()).getIntern() instanceof EbliWidgetFusionCalques)
- new TrPostActionFusionCalques((EbliWidgetFusionCalques) ((EbliWidgetBordureSingle) node.getWidget())
- .getIntern(),
- node, projet);
+// else if (((EbliWidgetBordureSingle) node.getWidget()).getIntern() instanceof EbliWidgetFusionCalques)
+// new TrPostActionFusionCalques((EbliWidgetFusionCalques) ((EbliWidgetBordureSingle) node.getWidget())
+// .getIntern(),
+// node, projet);
} else {
@@ -67,8 +66,8 @@
}
else if (node.getWidget() instanceof EbliWidgetVueCalque) {
new TrPostActionFusionCalques((EbliWidgetVueCalque) node.getWidget(), node, projet);
- } else if (node.getWidget() instanceof EbliWidgetFusionCalques) {
- new TrPostActionFusionCalques((EbliWidgetFusionCalques) node.getWidget(), node, projet);
+// } else if (node.getWidget() instanceof EbliWidgetFusionCalques) {
+// new TrPostActionFusionCalques((EbliWidgetFusionCalques) node.getWidget(), node, projet);
}
}
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -434,7 +434,7 @@
content.add(actionChoixGraphes_.getInterfacePartielle(false, false, false), BorderLayout.CENTER);
JPanel bouttonCenter = new JPanel(new FlowLayout(FlowLayout.CENTER));
bouttonCenter.add(creationNewGraphe_);
- content.add(bouttonCenter, BorderLayout.SOUTH);
+ content.add(bouttonCenter, BorderLayout.NORTH);
if (actionChoixGraphes_.listeGraphesPossibles.size() == 0 && actionChoixGraphes_.listeGraphesChoisis.size() == 0) {
creationNewGraphe_.setSelected(true);
creationNewGraphe_.setEnabled(false);
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardProfilSpatial.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardProfilSpatial.java 2008-09-16 15:35:12 UTC (rev 3931)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardProfilSpatial.java 2008-09-16 17:12:47 UTC (rev 3932)
@@ -185,10 +185,16 @@
content.add(actionChoixGraphes_.getInterfacePartielle(false, false, false), BorderLayout.CENTER);
JPanel bouttonCenter = new JPanel(new FlowLayout(FlowLayout.CENTER));
bouttonCenter.add(creationNewGraphe_);
- content.add(bouttonCenter, BorderLayout.SOUTH);
+ content.add(bouttonCenter, BorderLayout.NORTH);
content.setBorder(CtuluLibSwing.createTitleBorder(CtuluLib.getS("Etape 3: S\xE9lection et cr\xE9ation des graphes")));
+ if (actionChoixGraphes_.listeGraphesPossibles.size() == 0 && actionChoixGraphes_.listeGraphesChoisis.size() == 0) {
+ creationNewGraphe_.setSelected(true);
+ creationNewGraphe_.setEnabled(false);
+ actionChoixGraphes_.setEnabled(false);
+ }
+
return content;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|