From: <had...@us...> - 2008-08-12 15:03:50
|
Revision: 3781 http://fudaa.svn.sourceforge.net/fudaa/?rev=3781&view=rev Author: hadouxad Date: 2008-08-12 15:03:56 +0000 (Tue, 12 Aug 2008) Log Message: ----------- - integration de la scene dans fudaa prepro : creation de la classe TrPostLayoutFille extends BuInternalFrame - integration des actions de bases (alignements, arriere, avant plan et duplication) - integration de la palette de base (pour le moment ractangle et fleche) - ajout des l ouverture du calque de resultat (possibiliter d editer, de dupliauer et supprimer la legende du bidule) Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTree.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java 2008-08-12 14:51:12 UTC (rev 3780) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java 2008-08-12 15:03:56 UTC (rev 3781) @@ -7,6 +7,9 @@ import javax.swing.AbstractAction; +import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; @@ -15,11 +18,13 @@ * @author genesis * */ -public class EbliWidgetActionBackGround extends AbstractAction{ +public class EbliWidgetActionBackGround extends EbliActionSimple{ EbliScene scene_; public EbliWidgetActionBackGround(EbliScene _scene){ + super(EbliResource.EBLI.getString("Arri\xE8re plan"), CtuluResource.CTULU.getIcon("crystal_arriereplan"), "BACKGROUND"); + scene_=_scene; putValue(NAME,"Arri\xE8re plan"); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java 2008-08-12 14:51:12 UTC (rev 3780) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java 2008-08-12 15:03:56 UTC (rev 3781) @@ -9,6 +9,9 @@ import javax.swing.AbstractAction; +import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; @@ -22,7 +25,7 @@ * @author genesis * */ -public class EbliWidgetActionDuplicate extends AbstractAction{ +public class EbliWidgetActionDuplicate extends EbliActionSimple{ /** * @@ -31,6 +34,7 @@ EbliScene scene_; public EbliWidgetActionDuplicate(EbliScene _scene){ + super(EbliResource.EBLI.getString("dupliquer les objets s\xE9lectionn\xE9s"), CtuluResource.CTULU.getIcon("crystal_copier"), "DUPLICATE"); scene_=_scene; putValue(NAME,"Duplication des \xE9lements s\xE9lectionn\xE9s"); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java 2008-08-12 14:51:12 UTC (rev 3780) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java 2008-08-12 15:03:56 UTC (rev 3781) @@ -7,6 +7,9 @@ import javax.swing.AbstractAction; +import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; @@ -15,11 +18,13 @@ * @author genesis * */ -public class EbliWidgetActionForeGround extends AbstractAction{ +public class EbliWidgetActionForeGround extends EbliActionSimple{ EbliScene scene_; public EbliWidgetActionForeGround(EbliScene _scene){ + super(EbliResource.EBLI.getString("Premier plan"), CtuluResource.CTULU.getIcon("crystal_analyser"), "FORGROUND"); + scene_=_scene; putValue(NAME,"Premier plan"); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTree.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTree.java 2008-08-12 14:51:12 UTC (rev 3780) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTree.java 2008-08-12 15:03:56 UTC (rev 3781) @@ -2,12 +2,13 @@ import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; -import javax.swing.tree.TreeModel; + import org.jdesktop.swingx.JXTree; public class EbliWidgetJXTree extends JXTree implements TreeSelectionListener{ + // modele du tree private EbliWidgetJXTreeModel model_; Added: 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 (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-08-12 15:03:56 UTC (rev 3781) @@ -0,0 +1,360 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.event.ActionEvent; + +import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ebli.calque.ZEbliCalquesPanel; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorFleche; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorRectangle; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionAlign; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionBackGround; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionDuplicate; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionForeGround; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; +import org.fudaa.ebli.visuallibrary.tree.EbliCheckBoxNodeEditor; +import org.fudaa.ebli.visuallibrary.tree.EbliCheckBoxTreeRenderer; +import org.fudaa.ebli.visuallibrary.tree.EbliWidgetJXTree; +import org.fudaa.ebli.visuallibrary.tree.EbliWidgetJXTreeModel; +import org.fudaa.fudaa.tr.common.TrResource; + +import javax.swing.Box; +import javax.swing.JScrollPane; +import javax.swing.JToolBar; +import javax.swing.JTree; + +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuInternalFrame; +import com.memoire.bu.BuPanel; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuScrollPane; +/** + * InternalFrame qui contient la scene EbliScene. + * @author Adrien Hadoux + * + */ +public class TrPostLayoutFille extends BuInternalFrame { + + /** + * + */ + private static final long serialVersionUID = -2769884291563880931L; + + /** + * scene de l internalFrame. + */ + final private EbliScene scene_; + + /** + * Calque principal associ\xE9 a la vue layout. + */ + private ZEbliCalquesPanel calquePrincipal; + + + + + /** + * Model du Jxtree associe. + */ + private EbliWidgetJXTreeModel modelTree_; + + /** + * Tree associe a la scene. + */ + private EbliWidgetJXTree tree_; + + + + + + + /** + * Constructeur de la fenetre. + */ + public TrPostLayoutFille() { + super(); + // TODO Auto-generated constructor stub + setTitle(TrResource.getS("vue 2D")); + // creation de la scene EBLI + scene_ = new EbliScene(); + + // -- construction du jtree + + // etape 1 construction du model + EbliWidgetJXTreeModel model = new EbliWidgetJXTreeModel(1); + + // etape 2 SUPER IMPORTANT: ajout du model comme listener de la scene + scene_.addEbliNodeListener(model); + + // etape 3 creation du jxtree + tree_ = new EbliWidgetJXTree(model); + + //renderer du jxtree + EbliCheckBoxTreeRenderer renderer = new EbliCheckBoxTreeRenderer(); + tree_.setCellRenderer(renderer); + tree_.setCellEditor(new EbliCheckBoxNodeEditor(tree_)); + tree_.setEditable(true); + //tree_.setPreferredSize(new Dimension(300,600)); + //-- initialisation de la frame --// + init(); + } + + + public ZEbliCalquesPanel getCalquePrincipal() { + return calquePrincipal; + } + + public void setCalquePrincipal(ZEbliCalquesPanel calquePrincipal) { + this.calquePrincipal = calquePrincipal; + } + + public EbliScene getScene_() { + return scene_; + } + + + public EbliWidgetJXTreeModel getModelTree_() { + return modelTree_; + } + + public void setModelTree_(EbliWidgetJXTreeModel modelTree_) { + this.modelTree_ = modelTree_; + } + + public EbliWidgetJXTree getTree_() { + return tree_; + } + + public void setTree_(EbliWidgetJXTree tree_) { + this.tree_ = tree_; + } + + /** + * methode appelee pour l init de la construction de la internalframe + */ + public void init(){ + + //-- creation du conteneur de base qui contient tout --// + BuPanel content =new BuPanel(new BuBorderLayout()); + + //-- creation de la box sur le cote qui contient le tree et la sattelite view --// + Box contentEast=Box.createVerticalBox(); + + + this.add(content); + + this.setLayout(new BuBorderLayout()); + + + + //ajout de la scene au centre + content.add(new JScrollPane(scene_.createView()),BuBorderLayout.CENTER); + + + //FIXME Adrien bug affichage du tree les noeuds sont renfonces sur eux + //ajout du jtree sur la droite + getTree_().setPreferredSize(new Dimension(200,500)); + contentEast.add(new BuScrollPane(getTree_())); + + //-- ajout de la vue sattelite dans la box --// + contentEast.add(getScene_().createSatelliteView()); + + //-- ajout de la box dans le content --// + content.add(contentEast,BuBorderLayout.EAST); + + // content.doLayout(); + //this.pack(); + this.setVisible(true); + + + //-- construction de la barre des commandes de base --// + content.add(buildToolBar(),BuBorderLayout.NORTH); + + + } + + + /** + * Methode generique d ajout d un node widget a la scene. + * @param node + */ + public void addNode(EbliNode node){ + getScene_().addNode(node); + + //-- rafraichissement de la scene pour eviter les plantages --// + getScene_().refresh(); + } + + + /** + * Methode specialisee dans l ajout d un ndoe de type calque a la scene. + * @param title de la widget + * @param preferredLocation de la widget + * @param preferedDimension de la widget + * @param calque contenu de la widget + * @return le node cree + */ + public EbliNode addCalque(String title, Point preferredLocation, Dimension preferedDimension,ZEbliCalquesPanel calque ){ + + //-- enregistrement du calque principal --// + if(calquePrincipal==null) + //-- alors le calque recupere sera considere comem le calque principal --// + setCalquePrincipal(calque); + + + //on ajoute le calque sous forme d'un node + + //construction du node correspondant + final EbliNode nodeCalque = new EbliNodeDefault(); + nodeCalque.setTitle(title); + nodeCalque.setPreferedSize(preferedDimension);//new Dimension(400, 200) + nodeCalque.setPreferedLocation(preferredLocation);//new Point(250, 170) + nodeCalque.setCreator(new EbliWidgetCreatorVueCalque(calque)); + + //ajout du node au layout + addNode(nodeCalque); + + return nodeCalque; + } + + /** + * Methode d ajout de composant de base graphique. + * @return + */ + public EbliNode addRectangle( ){ + // -- ajout du rectangle --// + final EbliNodeDefault nodeRect = new EbliNodeDefault(); + nodeRect.setTitle("Rectangle"); + nodeRect.setCreator(new EbliWidgetCreatorRectangle("Tapez votre texte ici")); + nodeRect.setPreferedSize(new Dimension(200, 100)); + nodeRect.setPreferedLocation(new Point(350, 125)); + //ajout du node au layout + addNode(nodeRect); + + return nodeRect; + } + + /** + * Methode d ajout de composant de base graphique. + * @return + */ + public EbliNode addFleche( ){ + // -- ajout du rectangle --// + final EbliNodeDefault nodeFleche = new EbliNodeDefault(); + nodeFleche.setTitle("Fleche"); + nodeFleche.setCreator(new EbliWidgetCreatorFleche(0)); + nodeFleche.setPreferedSize(new Dimension(100, 50)); + nodeFleche.setPreferedLocation(new Point(350, 125)); + + //ajout du node au layout + addNode(nodeFleche); + + + return nodeFleche; + } + + /** + * Methode utilisee dans la classe fille TrPostFille pour recuperer le calque principal et enregistrer. + * @return + */ + public final ZEbliCalquesPanel getVisuPanel() { + return getCalquePrincipal(); + } + + + /** + * Methode qui construit la toolbar contenant toutes les actions alignements, duplication et premier plan de la scene + * @return + */ + public JToolBar buildToolBar(){ + + JToolBar bar = new JToolBar(); + //-- actions d etat des widgets --// + buildActions(bar); + + //-- action liees a la palette d objets graphiques --// + buildPaletteGraphique(bar); + + bar.setFloatable(false); + + return bar; + } + + + /** + * Ajoute les actions a la toolbar + */ + public void buildActions(JToolBar bar){ + // om met en place le undo/redo + scene_.setCmdMng(new CtuluCommandManager()); + bar.add(new EbliActionSimple("undo", BuResource.BU.getToolIcon("defaire"), "UNDO") { + @Override + public void actionPerformed(ActionEvent _e) { + if (scene_.getCmdMng().canUndo()) + scene_.getCmdMng().undo(); + } + }); + + bar.add(new EbliActionSimple("redo", BuResource.BU.getToolIcon("refaire"), "REDO") { + @Override + public void actionPerformed(ActionEvent _e) { + if (scene_.getCmdMng().canRedo()) + scene_.getCmdMng().redo(); + } + }); + bar.addSeparator(); + //-- actions d alignement --// + bar.add(new EbliWidgetActionAlign.Left(scene_)); + bar.add(new EbliWidgetActionAlign.Right(scene_)); + bar.add(new EbliWidgetActionAlign.Middle(scene_)); + bar.add(new EbliWidgetActionAlign.Center(scene_)); + bar.add(new EbliWidgetActionAlign.Top(scene_)); + bar.add(new EbliWidgetActionAlign.Bottom(scene_)); + bar.addSeparator(); + //-- action de positions --// + bar.add(new EbliWidgetActionForeGround(scene_)); + bar.add(new EbliWidgetActionBackGround(scene_)); + bar.addSeparator(); + //-- action de duplication --// + bar.add(new EbliWidgetActionDuplicate(scene_)); + bar.addSeparator(); + } + + /** + * Ajoute la palette graphique a la toolbar + */ + public void buildPaletteGraphique(JToolBar bar){ + + //-- palette rectangle --// + bar.add(new EbliActionSimple(EbliResource.EBLI.getString("Rectangle texte"), EbliResource.EBLI.getToolIcon("draw-rectangle"), "WIDGETRECTANGLE"){ + public void actionPerformed(ActionEvent _evt) { + System.out.println("je passe dans le actionperformed de layout"); + addRectangle(); + + } + }); + //-- palette fleche --// + bar.add(new EbliActionSimple(EbliResource.EBLI.getString("Fleche"), EbliResource.EBLI.getToolIcon("crystal_bu_link"), "WIDGETFLECHE"){ + public void actionPerformed(ActionEvent _evt) { + System.out.println("je passe dans le actionperformed de layout"); + addFleche(); + //-- rafraichissement de la scene pour eviter les plantages --// + getScene_().refresh(); + } + }); + + //getVisuPanel().getArbreCalqueModel().fillMenu(_m); + } + + + + +} 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-08-12 14:51:12 UTC (rev 3780) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-08-12 15:03:56 UTC (rev 3781) @@ -8,6 +8,7 @@ package org.fudaa.fudaa.tr.post; import java.awt.Dimension; +import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyVetoException; @@ -56,6 +57,9 @@ import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; +import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; @@ -236,9 +240,17 @@ } } - + //FIXME: remplacer par une TrPostLayout = scene ADRIEN => remplac\xE9 mais je conserve cette variable pour me rep\xE9rer dans le code la ou je dois faire des modifs transient TrPostFille fille_; - + + /** + * Fenetre fille qui contient le layout scene. + * Cette fenetre remplace petit a petit fille_ + */ + transient TrPostLayoutFille filleLayout_=new TrPostLayoutFille(); + + + transient BuInternalFrame frVariables_; int idx_; @@ -404,10 +416,21 @@ return res; } + /** + * Methode qui qctive l'internalFrame layout. + */ protected void activeFille() { - impl_.addInternalFrame(fille_); + //impl_.addInternalFrame(fille_); + impl_.addInternalFrame(filleLayout_); } + +/** + * Methode appelee apres ouverture du fichier de resultats. + * @param _destGrid + * @param _prog + * @param _isInitGridDisplay + */ protected void activeProjectionAction(final EfGridInterface _destGrid, final ProgressionInterface _prog, final boolean _isInitGridDisplay) { final CtuluAnalyze ana = new CtuluAnalyze(); @@ -417,21 +440,40 @@ _destGrid, null, getSource().isRubar(), false, getImpl()); projection.openDatas(_prog, null, null, getImpl()); projection.buildDefaultVectors(); + + //creation du postprojet final TrPostProjet trPostProjet = new TrPostProjet(projection, impl_); + + //creation du panel de visualisation du posttraitement final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl_, trPostProjet, projection.getNbFleche() == 0); - final TrPostFille compFille = new TrPostFille(pnVisu); + + //creation de l internalframe qui contient le panel de visu + // final TrPostFille compFille = new TrPostFille(pnVisu); + //creation de la scene layout identique a au dessus + final TrPostLayoutFille compFille = new TrPostLayoutFille(); + + //-- on ajoute le panel de visu comm widget calque au layout --// + compFille.addCalque(MvResource.getS("Maillage initial"), new Point(250, 170), new Dimension(400, 200), pnVisu); + + //test si il faut ajouter le calque if (_isInitGridDisplay) { final MvGridLayerGroup src = new MvGridLayerGroup(getSource().getGrid()); src.setTitle(MvResource.getS("Maillage initial")); src.setVisible(false); + + //on ajoute le calque dans le panel visu pnVisu.addCalque(src); + src.monter(); src.monter(); } + + // titre et action de la internalFrame compFille.setTitle(FDicoLib.getS("Projection")); compFille.setClosable(true); compFille.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + //ajout du listener associe a la fille compFille.addInternalFrameListener(new InternalFrameListener() { public void internalFrameActivated(final InternalFrameEvent _e) {} @@ -451,7 +493,10 @@ public void internalFrameOpened(final InternalFrameEvent _e) {} }); - trPostProjet.fille_ = compFille; + //FIXME ca sert a quoi la ligne du dessous??? + //trPostProjet.fille_ = compFille; + trPostProjet.filleLayout_ = compFille; + BuLib.invokeLater(new Runnable() { public void run() { @@ -462,28 +507,79 @@ } + + //TODO adrien a redefinir +// protected void addFille(final TrPostCourbeTreeModel _model, final String _titre, final ProgressionInterface _prog) { +// final EGGraphe graphe = new EGGraphe(_model); +// graphe.setXAxe(buildDefaultTimeAxe()); +// final FudaaGrapheTimeAnimatedVisuPanel pn = new FudaaGrapheTimeAnimatedVisuPanel(graphe, TrPostCourbeBuilder +// .getSpecActions(graphe, impl_, (TrPostVisuPanel) fille_.getVisuPanel())); +// graphe.setCmd(new CtuluCommandManager()); +// final TrPostCourbeFille fille = new TrPostCourbeFille(pn, _titre, impl_, null); +// fille.setPreferredSize(new Dimension(600, 400)); +// fille.setName("fille" + idxFilleG_++); +// fille.setTitle(_titre + CtuluLibString.ESPACE + CtuluLibString.getString(idxFilleG_)); +// fille.setFrameIcon(EbliResource.EBLI.getToolIcon("curves")); +// // pour charger les icones dans un autre thread. +// pn.getSpecificActions(); +// BuLib.invokeLater(new Runnable() { +// +// public void run() { +// fille.pack(); +// //TODO ne plus gerer de fille mais un Node dans la scene +// impl_.addInternalFrame(fille); +// graphe.restore(); +// } +// }); +// } + /** + * refonte de addFille qui ajoute des widgets + * + */ protected void addFille(final TrPostCourbeTreeModel _model, final String _titre, final ProgressionInterface _prog) { - final EGGraphe graphe = new EGGraphe(_model); - graphe.setXAxe(buildDefaultTimeAxe()); - final FudaaGrapheTimeAnimatedVisuPanel pn = new FudaaGrapheTimeAnimatedVisuPanel(graphe, TrPostCourbeBuilder - .getSpecActions(graphe, impl_, (TrPostVisuPanel) fille_.getVisuPanel())); - graphe.setCmd(new CtuluCommandManager()); - final TrPostCourbeFille fille = new TrPostCourbeFille(pn, _titre, impl_, null); - fille.setPreferredSize(new Dimension(600, 400)); - fille.setName("fille" + idxFilleG_++); - fille.setTitle(_titre + CtuluLibString.ESPACE + CtuluLibString.getString(idxFilleG_)); - fille.setFrameIcon(EbliResource.EBLI.getToolIcon("curves")); - // pour charger les icones dans un autre thread. - pn.getSpecificActions(); - BuLib.invokeLater(new Runnable() { + final EGGraphe graphe = new EGGraphe(_model); + graphe.setXAxe(buildDefaultTimeAxe()); + + /* final FudaaGrapheTimeAnimatedVisuPanel pn = new FudaaGrapheTimeAnimatedVisuPanel(graphe, TrPostCourbeBuilder + .getSpecActions(graphe, impl_, (TrPostVisuPanel) fille_.getVisuPanel())); + */ + graphe.setCmd(new CtuluCommandManager()); + /* + final TrPostCourbeFille fille = new TrPostCourbeFille(pn, _titre, impl_, null); + fille.setPreferredSize(new Dimension(600, 400)); + fille.setName("fille" + idxFilleG_++); + fille.setTitle(_titre + CtuluLibString.ESPACE + CtuluLibString.getString(idxFilleG_)); + fille.setFrameIcon(EbliResource.EBLI.getToolIcon("curves")); + + // pour charger les icones dans un autre thread. + pn.getSpecificActions(); + */ + + //--creation du node associe au graphe --// + final EbliNodeDefault nodeG = new EbliNodeDefault(); + nodeG.setCreator(new EbliWidgetCreatorGraphe(graphe)); + nodeG.setTitle("Graphe " + idxFilleG_++); + nodeG.setPreferedSize(new Dimension(600, 400)); + //FIXME adrien comment recuperer la bonne location ? + nodeG.setPreferedLocation(new Point(20, 20)); + + + + BuLib.invokeLater(new Runnable() { - public void run() { - fille.pack(); - impl_.addInternalFrame(fille); - graphe.restore(); - } - }); - } + public void run() { + // fille.pack(); + //TODO adrien ne plus gerer de fille mais un Node dans la scene + //impl_.addInternalFrame(fille); + + //Ajout du node dans la scene + filleLayout_.addNode(nodeG); + graphe.restore(); + } + }); + } + + protected void addSpecificItemInMainMenu(final BuMenu _menu) { @@ -502,12 +598,23 @@ return new TrPostVisuPanel(impl_, this); } + + /** + * Methode qui parametre la frame layout ainsi que le menu associe. + */ protected void decoreFilleVisu() { - fille_.setFrameIcon(EbliResource.EBLI.getToolIcon("lissage")); +// fille_.setFrameIcon(EbliResource.EBLI.getToolIcon("lissage")); + + // fille_.setClosable(true); + // fille_.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + + //-- realisation idem pour fillelayout --// + filleLayout_.setFrameIcon(EbliResource.EBLI.getToolIcon("lissage")); + //filleLayout_.setTitle(s_.getTitle()); + filleLayout_.setClosable(true); + filleLayout_.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - // fille_.setTitle(s_.getTitle()); - fille_.setClosable(true); - fille_.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + final BuMenuBar menubar = impl_.getMainMenuBar(); final BuMenu menu = new BuMenu(TrResource.getS("Post"), "POST"); menu.setIcon(null); @@ -541,12 +648,19 @@ protected Runnable getRunnableForVisu(final Runnable _other) { return new Runnable() { public void run() { - impl_.addInternalFrame(fille_); - fille_.restaurer(); + //FIXME: ajout le node vue 2d dans la scene et ajouter la scene a impl + // impl_.addInternalFrame(fille_); + + //-- ajout de la frame layout + impl_.addInternalFrame(filleLayout_); + + +// fille_.restaurer(); if (_other != null) { _other.run(); } - fille_.getArbreCalqueModel().getObservable().addObserver(modifyState_); + // fille_.getArbreCalqueModel().getObservable().addObserver(modifyState_); + filleLayout_.getVisuPanel().getArbreCalqueModel().getObservable().addObserver(modifyState_); } }; } @@ -615,7 +729,7 @@ impl_ = _impl; // pour mettre a jour le receveur d'evt impl_.getUndoCmdListener(); - if (fille_ != null) { + if (fille_ != null) { return; // Dans le thread swing } @@ -625,16 +739,35 @@ _impl.setMainMessageAndClear(TrResource .getS("Le fichier des r\xE9sultats a \xE9t\xE9 modifi\xE9: la base de donn\xE9es a \xE9t\xE9 mise \xE0 jour")); } + + //-- lancement du thread d'ouverture du layout avec els widgets calque new CtuluTaskOperationGUI(impl_, TrResource.getS("Ouverture vue 2D...")) { public void act() { final TrPostVisuPanel pnVisu = buildVisuPanel(); - fille_ = new TrPostFille(pnVisu); + + //fille_ = new TrPostFille(pnVisu); + + //--creation de l internalframe layout --// + filleLayout_=new TrPostLayoutFille(); + + //-- ajout du visuPanel au layout --// + filleLayout_.addCalque("Calque principal", pnVisu.getLocation(), pnVisu.getPreferredSize(), pnVisu); + + //-- decoration de la fille layout --// decoreFilleVisu(); + // pour charger les icones dans un thread a part - fille_.getVisuPanel().getController().buildActions(); + // fille_.getVisuPanel().getController().buildActions(); + + //-- construction des actions sans passer par la frame fille --// + filleLayout_.getVisuPanel().getController().buildActions(); + + //FIXME adrien comment remplacer cela? final Runnable other = FudaaSaveLib.restoreMainFille(impl_, getSaveFile(), getOldSaveFile(), fille_, getStateReceiver()); + + BuLib.invokeNow(getRunnableForVisu(other)); } }.start(Thread.MAX_PRIORITY); @@ -708,6 +841,12 @@ if (fille_ != null) { fille_.setClosed(true); } + + //fermetire de la fenetre layout + if(filleLayout_ != null) { + filleLayout_.setClosed(true); + } + } catch (PropertyVetoException e) { // ne rien faire .... } @@ -764,9 +903,9 @@ } - public TrPostFille getFille() { - return fille_; - } +// public TrPostFille getFille() { +// return fille_; +// } public final TrPostCommonImplementation getImpl() { return impl_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |