|
From: <had...@us...> - 2008-10-09 17:33:57
|
Revision: 4049
http://fudaa.svn.sourceforge.net/fudaa/?rev=4049&view=rev
Author: hadouxad
Date: 2008-10-09 17:33:43 +0000 (Thu, 09 Oct 2008)
Log Message:
-----------
- gestion annuler/ajouter projet au projet actuel
- Prise en compte des positions et des tailles
- des widget
- de la trpostlayoutfille
- Gestion des objets shape: propri?\195?\169t?\195?\169s sauvegard?\195?\169es correctement
- Sauvegarde du caract?\195?\168re visible ou non de la widget
- Sauvegarde du caract?\195?\168re s?\195?\169lectionn?\195?\169 ou non de la widget
- Sauvegarde de la superposition des widgets dans le layout
- Sauvegarde des objets persistants correpsondant au graphe dans un repertoire
- conception atomique (EggroupPersit,EgcourbePersit, egAxePersist)
- Un fichier de sauvegarde par courbe
- Un complet qui contient tous les groupes
- Gestion des relations 1:N groupe:courbe (l'id du groupe est stock?\195?\169 dans le fichier courbe)
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/calque/CalqueLegendeWidgetAdapter.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/EbliWidgetCreatorLegende.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java
branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.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/TrPostLayoutPanelController.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java
Added Paths:
-----------
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java
Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java (rev 0)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -0,0 +1,20 @@
+package org.fudaa.ebli.courbe;
+
+
+/**
+ * Classe persistante des axe horizontaux
+ * @author Adrien Hadoux
+ *
+ */
+public class EGAxeHorizontalPersist {
+
+ public EGAxeHorizontalPersist(EGAxeHorizontal axeX) {
+ // TODO Auto-generated constructor stub
+ fillInfoWith(axeX);
+ }
+
+ private void fillInfoWith(EGAxeHorizontal axeX ){
+
+ }
+
+}
Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java (rev 0)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -0,0 +1,20 @@
+package org.fudaa.ebli.courbe;
+
+
+/**
+ * Classe persistante des axe verticaux
+ * @author Adrien Hadoux
+ *
+ */
+public class EGAxeVerticalPersist {
+
+ public EGAxeVerticalPersist(EGAxeVertical axeY) {
+ // TODO Auto-generated constructor stub
+ fillInfoWith(axeY);
+ }
+
+ private void fillInfoWith(EGAxeVertical axeY ){
+
+ }
+
+}
Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java (rev 0)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -0,0 +1,49 @@
+package org.fudaa.ebli.courbe;
+
+/**
+ * Classe persistante de la courbe
+ * @author Adrien Hadoux
+ *
+ */
+public class EGCourbePersist {
+
+ String title_;
+ int Idgroup;
+
+ public EGCourbePersist(EGCourbe courbe, int IdGroup) {
+
+ fillInfoWith(courbe,IdGroup);
+ }
+
+
+
+ private void fillInfoWith(EGCourbe courbe,int idgroupe){
+ this.Idgroup=idgroupe;
+ title_=courbe.getTitle();
+
+ }
+
+
+
+ public String getTitle_() {
+ return title_;
+ }
+
+
+
+ public void setTitle_(String title_) {
+ this.title_ = title_;
+ }
+
+
+
+ public int getIdgroup() {
+ return Idgroup;
+ }
+
+
+
+ public void setIdgroup(int idgroup) {
+ Idgroup = idgroup;
+ }
+}
Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java (rev 0)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -0,0 +1,137 @@
+package org.fudaa.ebli.courbe;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.List;
+import java.util.Map;
+
+import org.fudaa.ebli.visuallibrary.persist.EbliSceneSerializeXml;
+import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+import com.thoughtworks.xstream.persistence.FileStreamStrategy;
+import com.thoughtworks.xstream.persistence.StreamStrategy;
+import com.thoughtworks.xstream.persistence.XmlArrayList;
+
+/**
+ * Classe qui se charge de rendre persistant les donn\xE9es des graphes en xml.
+ * @author Adrien Hadoux
+ *
+ */
+public class EGGraphePersist {
+
+ /**
+ * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et
+ * model...
+ */
+ String directoryPath_;
+
+ EGGraphe grapheTopersist;
+
+ private XStream parser_;
+
+ private static String MAINFILE="descriptorGraphe.xml";
+ private static String COURBEDIRECTORY="courbes";
+
+ public EGGraphePersist(String directoryPath_, EGGraphe grapheTopersist,Map parameters) throws IOException {
+ super();
+ this.directoryPath_ = directoryPath_;
+ this.grapheTopersist = grapheTopersist;
+
+ savePersitGrapheXml(parameters);
+ }
+
+
+
+ /**
+ * Recupere le parser adequat.
+ * @return
+ */
+ private XStream getParser(){
+ if(parser_==null)
+ parser_=initXmlParser();
+ return parser_;
+ }
+
+ /**
+ * Init le parser avec les alias adequats.
+ * @return
+ */
+ private XStream initXmlParser(){
+ XStream xstream = new XStream(new DomDriver());
+ //-- creation des alias pour que ce soit + parlant dans le xml file --//
+ xstream.alias("Groupe", EGGroupPersist.class);
+ xstream.alias("AxeX", EGAxeHorizontalPersist.class);
+ xstream.alias("AxeY", EGAxeVerticalPersist.class);
+ xstream.alias("Courbe", EGCourbePersist.class);
+
+ return xstream;
+ }
+
+
+ /**
+ * Enrtegistre le graphe au format persistant xml.
+ * @param parameters des parametres supplementaires utiles.
+ * @throws IOException
+ */
+ private void savePersitGrapheXml(Map parameters) throws IOException{
+
+ String mainfile=directoryPath_+File.separator+MAINFILE;
+ //-- outputstream du xstream pour enregistrement des diff\xE9rents groupes--//
+ ObjectOutputStream out = getParser().createObjectOutputStream(new FileWriter(mainfile));
+ //-- enregistrement des courbes --//
+ // strategy pour la liste xml: aun fichier par courbe.
+ File fichierCourbes=new File(directoryPath_+File.separator+COURBEDIRECTORY);
+ if(fichierCourbes.mkdir()){
+ StreamStrategy strategy = new FileStreamStrategy(fichierCourbes);
+ // creates the list of curves:
+ List<EGCourbePersist> list = new XmlArrayList(strategy);
+
+
+ for(int i=0;i<grapheTopersist.getModel().getNbEGObject();i++){
+
+ EGObject objet=grapheTopersist.getModel().getEGObject(i);
+
+ if(objet instanceof EGGroup){
+ EGGroup groupe=(EGGroup) objet;
+ out.writeObject(new EGGroupPersist(groupe));
+
+ for(int k=0;k<groupe.getEGChilds().length;k++){
+ if(groupe.getEGChilds()[k] instanceof EGCourbe){
+ //-- ajout de la courbe persitante dans un fichier avec pour groupee le i eme
+ list.add(new EGCourbePersist((EGCourbe) groupe.getEGChilds()[k],i));
+ }
+ }
+ }else
+ if(objet instanceof EGCourbe){
+ //le groupe d appartenance est -1
+ list.add(new EGCourbePersist((EGCourbe) objet,-1));
+ }
+ }
+ }
+ out.close();
+
+ }
+
+ public String getDirectoryPath_() {
+ return directoryPath_;
+ }
+
+ public void setDirectoryPath_(String directoryPath_) {
+ this.directoryPath_ = directoryPath_;
+ }
+
+ public EGGraphe getGrapheTopersist() {
+ return grapheTopersist;
+ }
+
+ public void setGrapheTopersist(EGGraphe grapheTopersist) {
+ this.grapheTopersist = grapheTopersist;
+ }
+
+
+
+}
Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java (rev 0)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -0,0 +1,32 @@
+package org.fudaa.ebli.courbe;
+
+import java.util.ArrayList;
+
+/**
+ * Classe persistante xml du eggroup
+ * @author Adrien Hadoux
+ *
+ */
+public class EGGroupPersist {
+
+ String title_;
+ EGAxeHorizontalPersist axeX;
+ EGAxeVerticalPersist axeY;
+
+
+public EGGroupPersist(EGGroup group) {
+ super();
+ fillInfoWith(group);
+
+}
+
+private void fillInfoWith(EGGroup groupe){
+ title_=groupe.getTitle();
+ axeX=new EGAxeHorizontalPersist(groupe.getAxeX());
+ axeY=new EGAxeVerticalPersist(groupe.getAxeY());
+
+
+}
+
+
+}
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-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -50,7 +50,7 @@
/**
* L'identifiant unique du widget
*/
- private final String id_;
+ private String id_;
boolean isGroup;
boolean isInEditMode_ = false;
@@ -491,4 +491,12 @@
useBorder_ = _useBorder;
}
+public String getId_() {
+ return id_;
+}
+
+public void setId_(String id_) {
+ this.id_ = id_;
+}
+
}
\ No newline at end of file
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -217,12 +217,12 @@
*
* @return EbliNode cree ajoute a la scene.
*/
- public EbliNode createLegende(Point _location, EbliScene _scene) {
+ public EbliNode createLegende(Point _location, EbliScene _scene,String id) {
setScene(_scene);
EbliNodeDefault def = new EbliNodeDefault();
def.setPreferedLocation(_location);
// def.setPreferedSize(new Dimension(150, 250));
- def.setCreator(new EbliWidgetCreatorLegende(legendePanel_));
+ def.setCreator(new EbliWidgetCreatorLegende(legendePanel_,id));
def.setTitle("L\xE9gende calque");
// TODO non stable
_scene.addNode(def);
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-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -162,7 +162,7 @@
if (widget_.getBounds() != null && widget_.getPreferredLocation() != null) {
positionLegende.x = widget_.getPreferredLocation().x + widget_.getBounds().width + 20;
positionLegende.y = widget_.getPreferredLocation().y;
- setNodeLegende(legendeWidget_.createLegende(positionLegende, widget_.getEbliScene()));
+ setNodeLegende(legendeWidget_.createLegende(positionLegende, widget_.getEbliScene(),widget_.getId()));
}
widget_.getEbliScene().refresh();
} else if (getNodeLegende().hasWidget())
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -12,6 +12,7 @@
import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle;
import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure;
import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator;
+import org.netbeans.api.visual.widget.Widget;
import org.w3c.dom.Element;
/**
@@ -23,14 +24,18 @@
BCalqueLegendePanel g;
// EbliWidget res;
-
+ /**
+ * L'id de la widget qui a declench\xE9 la legende
+ */
+ private String IdPossessor_;
EbliWidgetWithBordure res;
// BArbreCalqueModel modelTreeCalque_;
- public EbliWidgetCreatorLegende(BCalqueLegendePanel g/* , BArbreCalqueModel model */) {
+ public EbliWidgetCreatorLegende(BCalqueLegendePanel g,String id/* , BArbreCalqueModel model */) {
super();
this.g = g;
+ IdPossessor_=id;
// modelTreeCalque_ = model;
}
@@ -70,7 +75,8 @@
@Override
public Object getPersistData(Map parameters) {
// TODO Auto-generated method stub
- return null;
+ //-- pour le moment on se contente juste de rejouer la legende --//
+ return IdPossessor_;
}
@Override
@@ -78,8 +84,27 @@
// TODO Auto-generated method stub
if(data==null)
g=new BCalqueLegendePanel(new BCalqueLegende(),"empty");
- else
- g=(BCalqueLegendePanel) data;
+ else{
+ String idCalque=(String) data;
+
+ EbliScene scene=(EbliScene) parameters.get("scene");
+ //-- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --//
+ for(Widget widget: scene.getLayerVisu().getChildren()){
+ EbliWidget candidat=null;
+ if(widget instanceof EbliWidgetBordureSingle)
+ candidat=((EbliWidgetBordureSingle) widget).getIntern();
+ else
+ candidat=(EbliWidget) widget;
+
+ if(candidat.getId().equals(idCalque)){
+ //--on a le bon, on rejoue la legende --//
+ ((EbliWidgetControllerCalque)candidat.getController()).ajoutLegende();
+ return;
+ }
+ }
+ }
+
+
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -48,7 +48,7 @@
positionLegende.x = _dest.getLocation().x + _dest.getIntern().getPreferredSize().width + 5;
positionLegende.y = _dest.getPreferredLocation().y;
EbliWidgetVueCalque vue = (EbliWidgetVueCalque) _dest.getIntern();
- vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene());
+ vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene(),getBordure().getIntern().getId());
((EbliWidgetControllerCalque) vue.getController()).setLegendeWidget(_legende);
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -86,7 +86,7 @@
@Override
public Object getPersistData(Map parameters) {
// TODO Auto-generated method stub
- return null;
+ return typeObject_;
}
@Override
@@ -94,6 +94,9 @@
// TODO Auto-generated method stub
if(data==null)
typeObject_=new ShapeCreatorCircle();
+ else{
+ typeObject_=(ShapeCreator) data;
+ }
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -63,14 +63,13 @@
return duplique;
}
- public EbliWidgetWithBordure getBordure() {
- return res;
+ public EbliWidgetWithBordure getBordure() { return res;
}
@Override
public Object getPersistData(Map parameters) {
// TODO Auto-generated method stub
- return null;
+ return label_;
}
@Override
@@ -78,6 +77,7 @@
// TODO Auto-generated method stub
if(data==null)
label_="";
+ label_=(String) data;
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -34,6 +34,7 @@
import org.fudaa.ebli.visuallibrary.actions.CommandMasquer;
import org.fudaa.ebli.visuallibrary.actions.CommandSupprimer;
import org.fudaa.ebli.visuallibrary.actions.EbliActionEditorOneClick;
+import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator;
import com.memoire.bu.BuMenuBar;
import com.memoire.bu.BuPanel;
@@ -223,9 +224,10 @@
// -- non de la legende --//
widgetGraphe_.getNodeLegende().setTitle("L\xE9gende " + (indiceLegende++));
-
- widgetGraphe_.getNodeLegende().setCreator(
- new EbliWidgetCreatorLegende(((EbliWidgetGraphe) widget_).getGraphe()));
+
+ EbliWidgetCreatorLegende creator= new EbliWidgetCreatorLegende(((EbliWidgetGraphe) widget_).getGraphe(),widget_.getId());
+
+ widgetGraphe_.getNodeLegende().setCreator( creator );
widgetGraphe_.getNodeLegende().setPreferedLocation(positionLegende);
widget_.getEbliScene().addNode(widgetGraphe_.getNodeLegende());
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -1,12 +1,15 @@
package org.fudaa.ebli.visuallibrary.graphe;
import java.awt.Point;
+import java.io.File;
+import java.io.IOException;
import java.util.Map;
import org.fudaa.ebli.calque.ZEbliCalquesPanel;
import org.fudaa.ebli.courbe.EGFillePanel;
import org.fudaa.ebli.courbe.EGGraphe;
import org.fudaa.ebli.courbe.EGGrapheModel;
+import org.fudaa.ebli.courbe.EGGraphePersist;
import org.fudaa.ebli.courbe.EGGrapheTreeModel;
import org.fudaa.ebli.courbe.EGModel;
import org.fudaa.ebli.visuallibrary.EbliNode;
@@ -109,8 +112,21 @@
@Override
public Object getPersistData(Map parameters) {
// TODO Auto-generated method stub
- return null;
+ //-- generation d'un identifiant unique pour le repertoire du graphe --//
+ String pathUnique=parameters.get("path")+File.separator+"Graph"+res.getIntern().getId();
+
+ //- sauvegarde du contenu de l eggraphe dans un repertoire a part --//
+ try {
+ File createRep=new File(pathUnique);
+ if( createRep.mkdir())
+ new EGGraphePersist(pathUnique,getGraphe(),parameters);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
+
+ return pathUnique;
+ }
@Override
public void setPersistData(Object data, Map parameters) {
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -2,6 +2,8 @@
import java.util.Map;
+import org.fudaa.ebli.calque.BCalqueLegende;
+import org.fudaa.ebli.calque.BCalqueLegendePanel;
import org.fudaa.ebli.courbe.EGGraphe;
import org.fudaa.ebli.courbe.EGGrapheTreeModel;
import org.fudaa.ebli.visuallibrary.EbliNode;
@@ -9,7 +11,9 @@
import org.fudaa.ebli.visuallibrary.EbliWidget;
import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle;
import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure;
+import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerCalque;
import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator;
+import org.netbeans.api.visual.widget.Widget;
import org.w3c.dom.Element;
public class EbliWidgetCreatorLegende implements EbliWidgetCreator {
@@ -17,9 +21,11 @@
EGGraphe g;
// EbliWidget res;
EbliWidgetWithBordure res;
- public EbliWidgetCreatorLegende(EGGraphe g) {
+ private String IdPossessor_;
+ public EbliWidgetCreatorLegende(EGGraphe g,String id) {
super();
this.g = g;
+ IdPossessor_=id;
}
public EbliWidgetCreatorLegende(){
@@ -55,14 +61,35 @@
@Override
public Object getPersistData(Map parameters) {
// TODO Auto-generated method stub
- return null;
+ return IdPossessor_;
}
- @Override
+
public void setPersistData(Object data, Map parameters) {
- // TODO Auto-generated method stub
- if(data==null)
- g=new EGGraphe(new EGGrapheTreeModel());
- }
+ // TODO Auto-generated method stub
+ if(data==null)
+ g=new EGGraphe(new EGGrapheTreeModel());
+ else{
+ String idGraphe=(String) data;
+
+ EbliScene scene=(EbliScene) parameters.get("scene");
+ //-- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --//
+ for(Widget widget: scene.getLayerVisu().getChildren()){
+ EbliWidget candidat=null;
+ if(widget instanceof EbliWidgetBordureSingle)
+ candidat=((EbliWidgetBordureSingle) widget).getIntern();
+ else
+ candidat=(EbliWidget) widget;
+
+ if(candidat.getId().equals(idGraphe)){
+ //--on a le bon, on rejoue la legende --//
+ ((EbliWidgetControllerGraphe)candidat.getController()).ajoutLegende();
+ return;
+ }
+ }
+ }
+
+
+ }
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -2,12 +2,14 @@
import java.awt.Color;
import java.awt.Dimension;
+import java.awt.Point;
import org.fudaa.ebli.visuallibrary.EbliScene;
import com.sun.j3d.loaders.vrml97.impl.Background;
+
/**
* Classe utilis\xE9e par d\xE9faut pour la serialization xml avec xstream
* @author Adrien Hadoux
@@ -18,23 +20,32 @@
String title;
Color background;
int nbFrames;
+
+//dimensiosn de la frame
int width;
int height;
-public EbliSceneSerializeXml(EbliScene scene,String title){
+//position de la frame ou autre
+int x;
+int y;
+
+
+public EbliSceneSerializeXml(EbliScene scene,String title,Dimension dimensionFrame,Point location){
- fillInfoWith(scene,title);
+ fillInfoWith(scene,title,dimensionFrame,location);
}
-private void fillInfoWith(EbliScene scene,String title){
+private void fillInfoWith(EbliScene scene,String title,Dimension dimensionFrame,Point location){
this.title=title;
this.background=(Color) scene.getBackground();
this.nbFrames=scene.getObjects().size();
if(scene.getView() !=null){
- this.width=scene.getView().getSize().width;
- this.height=scene.getView().getSize().height;
+ this.width=dimensionFrame.width;
+ this.height=dimensionFrame.height;
+ this.x=location.x;
+ this.y=location.y;
}
}
@@ -109,5 +120,25 @@
}
+public int getX() {
+ return x;
+}
+
+public void setX(int x) {
+ this.x = x;
}
+
+
+public int getY() {
+ return y;
+}
+
+
+public void setY(int y) {
+ this.y = y;
+}
+
+
+
+}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -17,6 +17,7 @@
import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator;
import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorClassLoader;
import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape;
+import org.netbeans.api.visual.widget.Widget;
import org.w3c.dom.Element;
/**
@@ -26,6 +27,11 @@
*/
public class EbliWidgetSerializeXml {
+ /**
+ * Important: l'id de la widget pour avoir des references .
+ */
+ String Id;
+
String title;
/**
* L'instance de la classe creator
@@ -54,10 +60,13 @@
boolean bordure;
-
- //-- datas : objet g\xE9r\xE9 par le creator, inconnu poru cette classe --//
+ boolean isVisible;
+
+ boolean isSelected;
+
+ //-- datas : objet g\xE9r\xE9 par le creator, inconnu pour cette classe --//
Object data;
-
+
public EbliWidgetSerializeXml(EbliNode node,Map parameters) {
fillInfoWith(node,parameters);
@@ -66,46 +75,60 @@
}
private void fillInfoWith(EbliNode node,Map parameters){
- EbliWidget widget_;
+ EbliWidget widget;
if(node.getWidget() instanceof EbliWidgetBordureSingle){
- widget_ = (EbliWidget) node.getWidget().getChildren().get(0);
+ widget = (EbliWidget) node.getWidget().getChildren().get(0);
this.bordure=true;
}
else{
- widget_ = node.getWidget();
+ widget = node.getWidget();
this.bordure=false;
}
-
+ this.Id=widget.getId();
this.title = node.getTitle();
this.type = node.getCreator().getClass().toString();
- if(widget_.getColorFond() !=null)
+ if(widget.getColorFond() !=null)
this.bacckground = node.getWidget().getColorFond();
- if(widget_.getColorContour() !=null)
- this.foreground = widget_.getColorContour();
- if(widget_.getFormeFont() !=null)
- this.font = widget_.getFormeFont();
- this.rotation = widget_.getRotation();
- if(widget_.getTraceLigneModel()!=null){
- this.epaisseurTrait = widget_.getTraceLigneModel().getEpaisseur();
- this.typeTrait = widget_.getTraceLigneModel().getTypeTrait();
- this.colorModel=widget_.getTraceLigneModel().getCouleur();
+ if(widget.getColorContour() !=null)
+ this.foreground = widget.getColorContour();
+ if(widget.getFormeFont() !=null)
+ this.font = widget.getFormeFont();
+ this.rotation = widget.getRotation();
+ if(widget.getTraceLigneModel()!=null){
+ this.epaisseurTrait = widget.getTraceLigneModel().getEpaisseur();
+ this.typeTrait = widget.getTraceLigneModel().getTypeTrait();
+ this.colorModel=widget.getTraceLigneModel().getCouleur();
}
- if(widget_.getBounds() !=null){
- this.width = widget_.getBounds().width;
- this.height = widget_.getBounds().height;
+
+
+ //--cas particulier, si widget non visible les dimension bonnes sont celles du parent preferredbounds--//
+ if(!widget.getParentBordure().isVisible()){
+ if(widget.getParentBordure().getPreferredBounds() !=null){
+ this.width = widget.getParentBordure().getPreferredBounds().width;
+ this.height = widget.getParentBordure().getPreferredBounds().height;
+ }
+ }else
+ if(widget.getParentBordure().getBounds() !=null){
+ this.width = widget.getParentBordure().getBounds().width;
+ this.height = widget.getParentBordure().getBounds().height;
+ }
+
+ if( widget.getParentBordure().getPreferredLocation()!=null){
+ this.x =widget.getParentBordure().getPreferredLocation().x;
+ this.y = widget.getParentBordure().getPreferredLocation().y;
}
- if(widget_.getLocation() !=null){
- this.x =widget_.getLocation().x;
- this.y = widget_.getLocation().y;
- }
-
+
+ this.isVisible=widget.getParentBordure().isVisible();
+ this.isSelected=widget.getEbliScene().getSelectedObjects().contains(node);
+
+
//-- datas --//
this.data=node.getCreator().getPersistData(parameters);
}
-
+
/**
* Genere la widget, le creator et le node correspondant
* ajoute le tout dans la scene et regle les parametres graphiques.
@@ -118,19 +141,24 @@
EbliNode newNode=new EbliNodeDefault();
newNode.setTitle(title);
newNode.setPreferedLocation(new Point(x,y));
- newNode.setPreferedSize(new Dimension(width,height));
-
+ if(width>0 && height>0)
+ newNode.setPreferedSize(new Dimension(width,height));
+ else
+ newNode.setPreferedSize(new Dimension(200,200));
//-- creation du creator specicalis\xE9 --//
//EbliWidgetCreator creator= (EbliWidgetCreator) EbliWidgetCreatorShape.class.forName(type).newInstance();
EbliWidgetCreator creator= EbliWidgetCreatorClassLoader.forName(type);
-
+
//-- creation des datas --//
creator.setPersistData(data, parameters);
-
+
newNode.setCreator(creator);
-
+
//-- ajout du node dans la scene --//
scene.addNode(newNode);
+
+ //-- recuperation du precedent Id, tres important poru les references --//
+ newNode.getWidget().setId_(this.Id);
//--remplissage des proprietes graphiques --//
newNode.getWidget().setColorFond(bacckground);
@@ -139,11 +167,12 @@
newNode.getWidget().setRotation(rotation);
TraceLigneModel model=new TraceLigneModel(typeTrait,epaisseurTrait,colorModel);
newNode.getWidget().setTraceLigneModel(model);
-
-
+ newNode.getWidget().getParentBordure().setVisible(isVisible);
+
+
return newNode;
}
-
+
public String getTitle() {
return title;
}
@@ -256,6 +285,38 @@
this.data = data;
}
+ public Color getColorModel() {
+ return colorModel;
+ }
+ public void setColorModel(Color colorModel) {
+ this.colorModel = colorModel;
+ }
+ public boolean isVisible() {
+ return isVisible;
+ }
+
+ public void setVisible(boolean isVisible) {
+ this.isVisible = isVisible;
+ }
+
+ public boolean isSelected() {
+ return isSelected;
+ }
+
+ public void setSelected(boolean isSelected) {
+ this.isSelected = isSelected;
+ }
+
+ public String getId() {
+ return Id;
+ }
+
+ public void setId(String id) {
+ Id = id;
+ }
+
+
+
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -192,7 +192,7 @@
// -- creation d un noeud legende --//
EbliNodeDefault nodeLegende = new EbliNodeDefault();
nodeLegende.setTitle("Legende");
- nodeLegende.setCreator(new EbliWidgetCreatorLegende(g));
+ nodeLegende.setCreator(new EbliWidgetCreatorLegende(g,""));
nodeLegende.setPreferedSize(new Dimension(100, 100));
nodeLegende.setPreferedLocation(new Point(4, 270));
scene.addNode(nodeLegende);
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -157,6 +157,9 @@
if ("OUVRIR".equals(com)) {
// -- ouverture d un nouveau projet --//
int reponse=JOptionPane.showConfirmDialog(this.getParentComponent(), TrResource.getS("Voulez vous fermer le projet courant?\n Cliquez non si vous voulez ajouter le nouveau projet au projet existant."));
+ if(reponse==JOptionPane.CANCEL_OPTION){
+ return;
+ }
if(reponse==JOptionPane.OK_OPTION){
c_.getManager().clearProject();
}
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-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -23,6 +23,7 @@
import org.fudaa.ebli.calque.ZEbliCalquesPanel;
import org.fudaa.ebli.commun.EbliActionSimple;
import org.fudaa.ebli.courbe.EGFillePanel;
+import org.fudaa.ebli.ressource.EbliResource;
import org.fudaa.ebli.visuallibrary.EbliNode;
import org.fudaa.ebli.visuallibrary.EbliScene;
import org.fudaa.ebli.visuallibrary.EbliWidgetController;
@@ -117,6 +118,7 @@
public TrPostLayoutFille(final TrPostProjet _projet) {
super();
setTitle(TrResource.getS("vue 2D"));
+ setFrameIcon(EbliResource.EBLI.getToolIcon("lissage"));
previousTitleFrame = getTitle();
projet_ = _projet;
// creation de la scene EBLI
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -250,7 +250,7 @@
// -- ajout du rectangle --//
final EbliNodeDefault nodeLegende = new EbliNodeDefault();
nodeLegende.setTitle("Legende calque");
- nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0)));
+ nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0),"x"));
nodeLegende.setPreferedSize(new Dimension(200, 100));
nodeLegende.setPreferedLocation(new Point(350, 125));
// ajout du node au layout
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -7,6 +7,7 @@
*/
package org.fudaa.fudaa.tr.post;
+import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.ActionEvent;
@@ -359,7 +360,8 @@
}
public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) {
- if (_src != null) ajouterSource(_src);
+ if (_src != null)
+ ajouterSource(_src);
// -- creation de la frame de gestion multi projet --//
filleProjetctManager_ = new TrPostProjetsManagerFille(this);
@@ -379,7 +381,8 @@
listeSrc_.add(_src);
// -- ajout du menu correspondant uniquement a partir de la 2eme --//
- if (listeSrc_.size() > 1) construitMenuPostSpecifiqueSource(_src);
+ // if (listeSrc_.size()>1 || (menuPost_!=null &&))
+ construitMenuPostSpecifiqueSource(_src);
} else {
// -- messqge d erreur: le fichier est deja ouvert --//
@@ -389,6 +392,7 @@
}
+
/**
* retourne la source dans la liste des sources correspondant au fichier. retourne null sinon.
*
@@ -440,7 +444,7 @@
listeSrc_.remove(src);
// --recuperation du menu simul --//
- final BuMenu menuSimul = listeMenuProjets_.get(n);
+ final BuMenu menuSimul = getlisteMenuProjets_().get(n);
// --on retire les menus correspondants --//
// for (int i = 0; i < listeSousMenuProjets_.get(n).size(); i++) {
@@ -453,8 +457,8 @@
// -- on retire de la liste des menus le menusimul et la liste des sous
// menus --//
- listeMenuProjets_.remove(n);
- listeSousMenuProjets_.remove(n);
+ getlisteMenuProjets_().remove(n);
+ getlisteSousMenuProjets_().remove(n);
// -- mise a jour de la barre des menus --//
impl_.getMainMenuBar().revalidate();
@@ -522,11 +526,11 @@
+ (listeSrc_.size()));
// -- ajout du menu au menu post --//
- menuPost_.add(menuSimul);
+ getMenuPost().add(menuSimul);
// -- sauvegarde d une trace du menu dans la liste pour une suppression
// ulterieure --//
- listeMenuProjets_.add(menuSimul);
+ getlisteMenuProjets_().add(menuSimul);
final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>();
@@ -563,7 +567,7 @@
_src.addSpecificItemInMainMenu(menuSimul, getImpl());
// -- ajout de la sous liste de menus pour la garder en memoire --//
- listeSousMenuProjets_.add(listSousMenus);
+ getlisteSousMenuProjets_().add(listSousMenus);
}
}
@@ -599,27 +603,39 @@
// menubar.add(menuLayout_, 2);
//
// }
+
+ public BuMenu getMenuPost(){
+ if(menuPost_==null)
+ menuPost_ = new BuMenu(TrResource.getS("Post"), "POST");
+ return menuPost_;
+ }
+
/**
* Creation par defaut du menu post de l interface. Cette methdoe est appelee une seule dfois au moment de la creation
* de l impl.
*/
public void setMenuPost() {
final BuMenuBar menubar = impl_.getMainMenuBar();
+
+ Component comp=null;
+ if(getMenuPost().getMenuComponentCount()>0){
+ comp= getMenuPost().getMenuComponent(0);
+ //getMenuPost().remove(0);
+ }
+
+ getMenuPost().setIcon(null);
+ getMenuPost().setName("mnPost");
- menuPost_ = new BuMenu(TrResource.getS("Post"), "POST");
- menuPost_.setIcon(null);
- menuPost_.setName("mnPost");
+ menubar.add(getMenuPost(), 2);
- menubar.add(menuPost_, 2);
-
- menuPost_.addSeparator(TrResource.getS("Layout"));
+ getMenuPost().addSeparator(TrResource.getS("Layout"));
// -- ajout de l action de creation du calque --//
- // menuPost_.add(new TrPostActionChooseAndCreateCalque(this));
- menuPost_.addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this);
- menuPost_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", CtuluResource.CTULU
+ // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this));
+ getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this);
+ getMenuPost().addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", CtuluResource.CTULU
.getIcon("crystal_ajouter"), new ActionListener() {
public void actionPerformed(final ActionEvent _e) {
@@ -628,7 +644,7 @@
}
});
- menuPost_.addSeparator(TrResource.getS("Gestion"));
+ getMenuPost().addSeparator(TrResource.getS("Gestion"));
// -- ajout de l action de gestion des simus dans post --//
final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats"));
item.addActionListener(new ActionListener() {
@@ -646,17 +662,33 @@
}
});
- menuPost_.add(item);
- menuPost_.addSeparator("Liste des Fichiers r\xE9sultats");
+ getMenuPost().add(item);
+ getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats");
// -- init de la liste des menus --//
- listeMenuProjets_ = new ArrayList<BuMenu>();
+
- listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>();
+
// -- construction par defaut du premier menu de simulation --//
- construitMenuPostSpecifiqueSource(getSource(0));
+ // construitMenuPostSpecifiqueSource(getSource(0));
+ if(comp!=null){
+ getMenuPost().add(comp);
+ }
+
}
+
+ public List<BuMenu> getlisteMenuProjets_(){
+ if(listeMenuProjets_==null)
+ listeMenuProjets_ = new ArrayList<BuMenu>();
+ return listeMenuProjets_;
+ }
+
+ public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_(){
+ if(listeSousMenuProjets_==null)
+ listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>();
+ return listeSousMenuProjets_;
+ }
/**
* calcul les extrema en fonction de la source proposee
*
@@ -943,10 +975,10 @@
// return;
// } else {
// i indique le numero de la simulation
- for (int i = 0; i < listeSousMenuProjets_.size(); i++) {
+ for (int i = 0; i < getlisteSousMenuProjets_().size(); i++) {
// --recuperation de la liste des sousmenu de la simulation i --//
- final ArrayList<BuMenuItem> listeSousMenus = listeSousMenuProjets_.get(i);
+ final ArrayList<BuMenuItem> listeSousMenus = getlisteSousMenuProjets_().get(i);
final TrPostSource source = getSource(i);
// -- on recherche si l action provient d un des fils --//
for (int j = 0; j < listeSousMenus.size(); j++) {
@@ -1292,7 +1324,7 @@
final TrPostLayoutFille newLayoutFille = new TrPostLayoutFille(this);
newLayoutFille.setTitle(newLayoutFille.getTitle() + " N\xB0 " + (++idx));
- newLayoutFille.setFrameIcon(EbliResource.EBLI.getToolIcon("lissage"));
+
// addFillesLayout(newLayoutFille);
impl_.addInternalFrame(newLayoutFille);
}
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -394,6 +394,9 @@
public TrPostSource getSource() {
return source_;
}
+
+
+
/**
* @return the suiviPanel
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-08 17:44:48 UTC (rev 4048)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-09 17:33:43 UTC (rev 4049)
@@ -1,5 +1,7 @@
package org.fudaa.fudaa.tr.post.persist;
+import java.awt.Dimension;
+import java.awt.Point;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
@@ -9,9 +11,11 @@
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.swing.JFileChooser;
import javax.swing.JInternalFrame;
@@ -30,10 +34,12 @@
import org.fudaa.ebli.visuallibrary.persist.ManagerWidgetPersist;
import org.fudaa.fudaa.tr.common.TrLib;
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.TrPostMultiSourceActivator;
import org.fudaa.fudaa.tr.post.TrPostProjet;
import org.fudaa.fudaa.tr.post.TrPostSource;
+import org.netbeans.api.visual.widget.Widget;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -94,7 +100,7 @@
ProgressionInterface prog_;
File projet_;
- CtuluUI ui_;
+ TrPostCommonImplementation ui_;
public TrPostPersistenceManager(TrPostProjet projet) {
@@ -139,12 +145,17 @@
if (reponse == JFileChooser.APPROVE_OPTION) {
File conteneurProjet = fileChooser.getSelectedFile();
- if(projet_==null || projet_!=conteneurProjet)
- projet_ = new File(conteneurProjet.getAbsoluteFile() + EXTENSION);
+ if(projet_==null || !projet_.equals(conteneurProjet))
+ projet_ = new File(GetExtensionName(conteneurProjet.getAbsolutePath()));
// creation du repertoire global contenant toutes les donn\xE9es
if (projet_.mkdir()) {
return true;
- } else {
+ } else
+
+ if(projet_.isDirectory()){
+ return true;
+ }else
+ {
ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le r\xE9pertoire"));
return false;
}
@@ -153,6 +164,19 @@
} else
return false;
}
+
+ /**
+ * Retourne un nom avec extension
+ * @param name
+ * @return
+ */
+ public String GetExtensionName(String name){
+
+ if(name.contains(EXTENSION)){
+ return name;
+ }else
+ return name+EXTENSION;
+ }
/**
* Charge le repertoire contenant tous les fichiers
@@ -276,9 +300,10 @@
}else{
File f = new File(path);
// -- tentative de chargement du source dans le multi-projet --//
+
multiProjectActivator.active(f, trprojet_.impl_);
// -- notify aux observers --//
- trprojet_.notifyObservers();
+ //trprojet_.notifyObservers();
}
@@ -337,6 +362,8 @@
progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listFilles.size());
file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION);
//-- sauvegarde du persitant --//
+ parametres.put("dimensions", fille.getSize());
+ parametres.put("location", fille.getLocation());
savePersitSceneXml(scene,title,file,parametres);
cpt++;
@@ -397,9 +424,8 @@
TrPostLayoutFille postFrame=new TrPostLayoutFille(trprojet_);
//-- sauvegarde du persitant --//
try {
+ trprojet_.getImpl().addInternalFrame(postFrame);
loadPersitSceneXml(file,postFrame,parametres);
-
- trprojet_.getImpl().addInternalFrame(postFrame);
} catch (InstantiationException e) {
// TODO Auto-generated catch block
ui_.error(TrResource.getS("Erreur dans le chargement du layout. Chargement annul\xE9 pour le fichier ")+fichier);
@@ -413,6 +439,9 @@
progression("", 100);
ui_.message(TrResource.getS("Chargement termin\xE9"), TrResource.getS("Chargement termin\xE9 avec succ\xE8s"), false);
+
+
+
return true;
}
@@ -461,16 +490,18 @@
//-- g\xE9n\xE9ration du xml pour la scene --//
- out.writeObject(new EbliSceneSerializeXml(scene,title));
+ out.writeObject(new EbliSceneSerializeXml(scene,title,(Dimension) parametres.get("dimensions"),(Point) parametres.get("location")));
//-- g\xE9n\xE9ration du xml pour les eblinode/widgets --//
-
- Iterator<EbliNode> it=(Iterator<EbliNode>) scene.getObjects().iterator();
+ //-- ACHTUNG!!! IL FAUT RECUPERER LES OBJETS VIA CHILDREN POUR PRESERVER L ORDRE DE SUPERPOSITION!!! --//
+ Iterator<Widget> it= scene.getLayerVisu().getChildren().iterator();
while(it.hasNext()){
- EbliNode node=it.next();
+ Widget widget=it.next();
+ EbliNode node=(EbliNode) scene.findObject(widget);
//ecriture de l objet
- out.writeObject(new EbliWidgetSerializeXml(node,parametres));
+ if(node !=null)
+ out.writeObject(new EbliWidgetSerializeXml(node,parametres));
}
@@ -496,6 +527,7 @@
// HashMap<String, Object> parametres=new HashMap<String, Object>();
// parametres.put("path", file.getAbsolutePath());
EbliScene scenToUpdate=fille.getScene();
+ parametres.put("scene",scenToUpdate);
//-- inputstream du xstream --//
ObjectInputStream in = getParser().createObjectInputStream(new FileReader(file));
@@ -509,9 +541,11 @@
if(sceneXml.getWidth()>0 && sceneXml.getHeight()>0)
fille.setSize(sceneXml.getWidth(),sceneXml.getHeight());
fille.setTitle(sceneXml.getTitle());
+ fille.setLocation(sceneXml.getX(),sceneXml.getY());
+ //-- preparation de la liste de selection des frames dans le layout --//
+ final Set<Object> listeNodeSelect = new HashSet<Object>();
-
//-- r\xE9cup\xE9ration via xml des eblinode/widgets --//
for(int i=0;i<sceneXml.getNbFrames();i++){
@@ -519,14 +553,21 @@
EbliWidgetSerializeXml widgetXml = (EbliWidgetSerializeXml)in.readObject();
//generation de la widget dans la scene
- widgetXml.generateWidgetInScene(parametres, scenToUpdate);
+ EbliNode node=widgetXml.generateWidgetInScene(parametres, scenToUpdate);
+
+ if(widgetXml.isSelected())
+ listeNodeSelect.add(node);
}
in.close();
+
+ //-- on ajoute les noeuds selectionnes a ebliScene --//
+ scenToUpdate.setSelectedObjects(listeNodeSelect);
+ // mise a jour de la scene
+ scenToUpdate.refresh();
-
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|