From: <had...@us...> - 2008-10-23 16:30:44
|
Revision: 4092 http://fudaa.svn.sourceforge.net/fudaa/?rev=4092&view=rev Author: hadouxad Date: 2008-10-23 16:30:33 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Correction de tout plein de bugs Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.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/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManager.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/actions/TrPostActionFusionCalques.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/visuallibrary/creator/ShapeCreatorDblFleche.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java 2008-10-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -152,8 +152,8 @@ /** * Cote d'eau. */ - public static final H2dVariableType COTE_EAU = new H2dVariableType(H2dResource.getS("Cote eau"), "SL", "zw") { - + // public static final H2dVariableType COTE_EAU = new H2dVariableType(H2dResource.getS("Cote eau"), "SL", "zw") { + public static final H2dVariableType COTE_EAU = new H2dVariableType(H2dResource.getS("Surface libre"), "SL", "zw") { public boolean canBeTransient() { return true; } 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-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -18,6 +18,7 @@ import javax.swing.JScrollPane; import javax.swing.JSplitPane; +import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluResource; @@ -208,18 +209,40 @@ // -- on prend la location du node au moment de la suppression pour // pouvoir la retablir dans le undo --// // n.setPreferedLocation(widget_.getPreferredLocation()); - // -- on enregistre la commande undo redo --// - cmd_ - .addCmd(new CommandSupprimer(n, widget_.getEbliScene(), widget_.convertLocalToScene(widget_.getLocation()))); + // -- on enleve le node de la scene --// widget_.getEbliScene().removeNode(n); // -- on supprime le node legende associe --// - if (widgetCalque_.nodeLegende != null) { + if (hasLegende()) { widget_.getEbliScene().removeNode(widgetCalque_.nodeLegende); legendeWidget_ = null; + + final CtuluCommand commande1= new CommandSupprimer(n, widget_.getEbliScene(), widget_.convertLocalToScene(widget_.getLocation())); + final CtuluCommand commande2= new CommandSupprimer(widgetCalque_.nodeLegende, widget_.getEbliScene(), widget_.convertLocalToScene(widgetCalque_.nodeLegende.getWidget().getLocation())); + cmd_.addCmd(new CtuluCommand(){ + + @Override + public void redo() { + // TODO Auto-generated method stub + commande1.redo(); + commande2.redo(); + } + + @Override + public void undo() { + // TODO Auto-generated method stub + commande1.undo(); + commande2.undo(); + } + + }); } + else{ + // -- on enregistre la commande undo redo unitaire --// + cmd_.addCmd(new CommandSupprimer(n, widget_.getEbliScene(), widget_.convertLocalToScene(widget_.getLocation()))); + } // -- raffraichissement de la scene --// widget_.getEbliScene().refresh(); 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-10-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -22,103 +22,133 @@ */ public final class EbliWidgetFusionCalques extends EbliWidgetGroup implements PropertyChangeListener { - public final ArrayList<EbliWidgetVueCalque> listeWidgetCalque_ = new ArrayList<EbliWidgetVueCalque>(); + public final ArrayList<EbliWidgetVueCalque> listeWidgetCalque_ = new ArrayList<EbliWidgetVueCalque>(); - public EbliWidgetFusionCalques(final EbliScene _scene) { - super(_scene); - // calquePanel_.getVueCalque().getAbstractCalque().addPropertyChangeListener( - // "versReel", listener); + public EbliWidgetFusionCalques(final EbliScene _scene) { + super(_scene); + // calquePanel_.getVueCalque().getAbstractCalque().addPropertyChangeListener( + // "versReel", listener); - } + } - public void addChildCalque(final EbliWidget child) { + public void addChildCalque(final EbliWidget child) { - addChild(child); + addChild(child); - final EbliWidgetVueCalque widgetCalque = (EbliWidgetVueCalque) child.getIntern(); - listeWidgetCalque_.add(widgetCalque); + final EbliWidgetVueCalque widgetCalque = (EbliWidgetVueCalque) child.getIntern(); + listeWidgetCalque_.add(widgetCalque); - // -- ajout du listener des calques sur this --// - widgetCalque.calquePanel_.getVueCalque().addPropertyChangeListener("repere", this); - // widgetCalque.calquePanel_.getVueCalque().getAbstractCalque(). - // addPropertyChangeListener("versReel", this); - } - boolean noCyclePropertieChange = true; - public void propertyChange(final PropertyChangeEvent _evt) { + // widgetCalque.calquePanel_.getVueCalque().getAbstractCalque(). + // addPropertyChangeListener("versReel", this); - if (!noCyclePropertieChange) return; - noCyclePropertieChange = false; - // listeWidgetCalque_.get(0).calquePanel_.getVueCalque().changeViewBoite( - // _source, _boite, _rapide) - final BVueCalque vueCalque = (BVueCalque) _evt.getSource(); - final GrBoite boite = vueCalque.getViewBoite(); - for (final Iterator<Widget> it = getChildren().iterator(); it.hasNext();) { - final EbliWidgetVueCalque widget = (EbliWidgetVueCalque) ((EbliWidget) it.next()).getIntern(); - if (widget.calquePanel_.getVueCalque() != vueCalque) { - widget.calquePanel_.getVueCalque().changeRepere(widget.calquePanel_, boite, 0, 0); - } - widget.image = null; - widget.repaint(); - } - noCyclePropertieChange = true; - getEbliScene().refresh(); - } + } + boolean noCyclePropertieChange = true; - /** - * Surcharge de la methode de ebli, utilisse pour virer les property change listener - */ - @Override - public void removePropertyChangeListenerFormWidget(final EbliWidget child) { - EbliWidgetVueCalque widgetCalque; - if (child instanceof EbliWidgetVueCalque) widgetCalque = (EbliWidgetVueCalque) child; - else widgetCalque = (EbliWidgetVueCalque) ((EbliWidget) child.getChildren().get(0)).getIntern(); - widgetCalque.calquePanel_.getVueCalque().getAbstractCalque().removePropertyChangeListener("repere", this); + /** + * Methode a appelee a la fin des ajout de widget pour synchroniser les zooms de tous les calques du groupe. + * Il faut le faire dans l'ordre inverse afin de pr\xE9server le zoom de la widget initiale. + */ + public void synchronyseZoom(){ + //-- on conserve le zoom du calque initial et on l'appllique avant de synchronizer les zooms --// + EbliWidgetVueCalque calqueInitialeZoom=listeWidgetCalque_.get(listeWidgetCalque_.size()-1); + final GrBoite boite = calqueInitialeZoom.getViewBoite(); + calqueInitialeZoom.calquePanel_.getVueCalque().addPropertyChangeListener("repere", this); + calqueInitialeZoom.calquePanel_.getVueCalque().changeRepere(calqueInitialeZoom.calquePanel_, boite, 0, 0); + + +// for(int i=0;i<listeWidgetCalque_.size();i++){ +// //-- mise a jour de la boite pour le calque originel (le reste suivra) --// +// listeWidgetCalque_.get(i).calquePanel_.getVueCalque().changeRepere(listeWidgetCalque_.get(i).calquePanel_, boite, 0, 0); +// listeWidgetCalque_.get(i).image = null; +// listeWidgetCalque_.get(i).repaint(); +// } + getEbliScene().refresh(); + // -- ajout du listener des calques sur this --// + + for(int i=0;i<listeWidgetCalque_.size()-1;i++){ + EbliWidgetVueCalque widgetCalque=listeWidgetCalque_.get(i); + widgetCalque.calquePanel_.getVueCalque().addPropertyChangeListener("repere", this); + } - } + } - ZCalqueSondeSynchroniserFusion managerSondesFusion_; + - /** - * Methode a appeler a la fin de la creation de la sonde fusion pour ajouter l action sonde fusion dans chaque - * calques. - */ - public void synchroniseSondeFusion() { + public void propertyChange(final PropertyChangeEvent _evt) { - // -- creation du manager de sonde fusion qui synchronise toute ses sondes - // --// - managerSondesFusion_ = new ZCalqueSondeSynchroniserFusion(); + if (!noCyclePropertieChange) return; + noCyclePropertieChange = false; + // listeWidgetCalque_.get(0).calquePanel_.getVueCalque().changeViewBoite( + // _source, _boite, _rapide) + final BVueCalque vueCalque = (BVueCalque) _evt.getSource(); + final GrBoite boite = vueCalque.getViewBoite(); + for (final Iterator<Widget> it = getChildren().iterator(); it.hasNext();) { + final EbliWidgetVueCalque widget = (EbliWidgetVueCalque) ((EbliWidget) it.next()).getIntern(); + if (widget.calquePanel_.getVueCalque() != vueCalque) { + widget.calquePanel_.getVueCalque().changeRepere(widget.calquePanel_, boite, 0, 0); + } + widget.image = null; + widget.repaint(); + } + noCyclePropertieChange = true; + getEbliScene().refresh(); + } - for (final EbliWidgetVueCalque widget : listeWidgetCalque_) { - final ZEbliCalquesPanel panel = widget.calquePanel_; + /** + * Surcharge de la methode de ebli, utilisse pour virer les property change listener + */ + @Override + public void removePropertyChangeListenerFormWidget(final EbliWidget child) { + EbliWidgetVueCalque widgetCalque; + if (child instanceof EbliWidgetVueCalque) widgetCalque = (EbliWidgetVueCalque) child; + else widgetCalque = (EbliWidgetVueCalque) ((EbliWidget) child.getChildren().get(0)).getIntern(); + widgetCalque.calquePanel_.getVueCalque().getAbstractCalque().removePropertyChangeListener("repere", this); - // -- il faut initialiser les actions specifiques si pas deja fait pour - // activer les interactions--// - panel.getController().initSpecificActions(); + } - // --recuperation de la sonde du calque --// - final ZCalqueSondeInteraction sonde = panel.getController().getCalqueSondeInteraction(); + ZCalqueSondeSynchroniserFusion managerSondesFusion_; - // -- ajout de la sonde dans le manager - managerSondesFusion_.addZCalqueSondeInteraction(sonde, widget); - } - // -- ajout dans les toolbars de tous les calques de la meme action --// - // for (EbliWidgetVueCalque widget : listeWidgetCalque_) { - // - // ((EbliWidgetControllerCalque) - // widget.getController()).getToolbarComponent().add( - // new CalqueActionSonde(sondeFusion)); - // - // } - } + /** + * Methode a appeler a la fin de la creation de la sonde fusion pour ajouter l action sonde fusion dans chaque + * calques. + */ + public void synchroniseSondeFusion() { - /** - * Methode a appeler au ungroup ou undo sur la fusion. Desynchronise les sondes des calques. - */ - public void desynchroniseSondeFusion() { - managerSondesFusion_.removeAllListenningSonde(); - } + // -- creation du manager de sonde fusion qui synchronise toute ses sondes + // --// + managerSondesFusion_ = new ZCalqueSondeSynchroniserFusion(); + for (final EbliWidgetVueCalque widget : listeWidgetCalque_) { + final ZEbliCalquesPanel panel = widget.calquePanel_; + + // -- il faut initialiser les actions specifiques si pas deja fait pour + // activer les interactions--// + panel.getController().initSpecificActions(); + + // --recuperation de la sonde du calque --// + final ZCalqueSondeInteraction sonde = panel.getController().getCalqueSondeInteraction(); + + // -- ajout de la sonde dans le manager + managerSondesFusion_.addZCalqueSondeInteraction(sonde, widget); + } + // -- ajout dans les toolbars de tous les calques de la meme action --// + // for (EbliWidgetVueCalque widget : listeWidgetCalque_) { + // + // ((EbliWidgetControllerCalque) + // widget.getController()).getToolbarComponent().add( + // new CalqueActionSonde(sondeFusion)); + // + // } + } + + /** + * Methode a appeler au ungroup ou undo sur la fusion. Desynchronise les sondes des calques. + */ + public void desynchroniseSondeFusion() { + managerSondesFusion_.removeAllListenningSonde(); + } + } 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-10-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -40,210 +40,218 @@ public class EbliWidgetVueCalque extends EbliWidget implements /* EditProvider */InplaceEditorProvider<BuPanel> { - ZEbliCalquesPanel calquePanel_; + ZEbliCalquesPanel calquePanel_; - public EbliNode nodeLegende = null; + public EbliNode nodeLegende = null; - Window frame_; + Window frame_; - BufferedImage image; - public GrBoite initZoom_; + BufferedImage image; + public GrBoite initZoom_; - BuPanel conteneurEditor; + BuPanel conteneurEditor; - // GrBoite zoom_; - public EbliWidgetVueCalque(final EbliScene _scene, final ZEbliCalquesPanel _vue) { - this(_scene, _vue, null); + // GrBoite zoom_; + public EbliWidgetVueCalque(final EbliScene _scene, final ZEbliCalquesPanel _vue) { + this(_scene, _vue, null); - } + } - /** - * TODO a am\xE9liorer avec une Map - * - * @param _scene - * @param _vue - * @param _initZoom - */ - public EbliWidgetVueCalque(final EbliScene _scene, final ZEbliCalquesPanel _vue, final GrBoite _initZoom) { - super(_scene); - calquePanel_ = _vue; - initZoom_ = _initZoom; - calquePanel_.setBorder(null); + /** + * TODO a am\xE9liorer avec une Map + * + * @param _scene + * @param _vue + * @param _initZoom + */ + public EbliWidgetVueCalque(final EbliScene _scene, final ZEbliCalquesPanel _vue, final GrBoite _initZoom) { + super(_scene); + calquePanel_ = _vue; + initZoom_ = _initZoom; + calquePanel_.setBorder(null); - setPreferredSize(new Dimension(500, 400)); - initSize(new Rectangle(0, 0, 500, 400)); - calquePanel_.getArbreCalqueModel().getObservable().addObserver(new Observer() { + setPreferredSize(new Dimension(500, 400)); + initSize(new Rectangle(0, 0, 500, 400)); + calquePanel_.getArbreCalqueModel().getObservable().addObserver(new Observer() { - public void update(final Observable _o, final Object _arg) { - if (!isInEditMode() && "t".equals(_arg)) { - image = null; - // repaint(); - } + public void update(final Observable _o, final Object _arg) { + if (!isInEditMode() && "t".equals(_arg)) { + image = null; + // repaint(); + } - } - }); + } + }); - } + } - public BuPanel createEditorComponent( - final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, final Widget widget) { - return calquePanel_; - } + public BuPanel createEditorComponent( + final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, final Widget widget) { + return calquePanel_; + } - /** - * appel\xE9 lors de la fermeture de l editeur. Il faut redessiner la widget. - */ - public void notifyClosing(final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - final Widget widget, final BuPanel editor, final boolean commit) { - editingStop(); - // zoom_ = calquePanel_.getVueCalque().getViewBoite(); - image = null; + /** + * appel\xE9 lors de la fermeture de l editeur. Il faut redessiner la widget. + */ + public void notifyClosing(final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, + final Widget widget, final BuPanel editor, final boolean commit) { + editingStop(); + // zoom_ = calquePanel_.getVueCalque().getViewBoite(); + image = null; - getEbliScene().refresh(); - // calquePanel_.setBorder(BuBorders.EMPTY1111); - this.repaint(); - } + getEbliScene().refresh(); + // calquePanel_.setBorder(BuBorders.EMPTY1111); + this.repaint(); + } - /** - * @return une interface non null si la widget peut etre animee - */ - @Override - public EbliAnimatedInterface getAnimatedInterface() { - if (calquePanel_ instanceof EbliAnimatedInterface) return (EbliAnimatedInterface) calquePanel_; - return null; - } + /** + * @return une interface non null si la widget peut etre animee + */ + @Override + public EbliAnimatedInterface getAnimatedInterface() { + if (calquePanel_ instanceof EbliAnimatedInterface) return (EbliAnimatedInterface) calquePanel_; + return null; + } - @Override - public Color getColorFond() { - return null; - } + @Override + public Color getColorFond() { + return null; + } - private void initSize(final Rectangle rec) { - final BCalque[] tousCalques = calquePanel_.getVueCalque().getCalque().getTousCalques(); - calquePanel_.getVueCalque().setSize(rec.width, rec.height); - // calquePanel_.setPreferredSize(new Dimension(rec.width, rec.height)); - calquePanel_.getVueCalque().getCalque().setSize(rec.width, rec.height); - for (int i = 0; i < tousCalques.length; i++) { - tousCalques[i].setSize(rec.width, rec.height); - } - } + private void initSize(final Rectangle rec) { + final BCalque[] tousCalques = calquePanel_.getVueCalque().getCalque().getTousCalques(); + calquePanel_.getVueCalque().setSize(rec.width, rec.height); + // calquePanel_.setPreferredSize(new Dimension(rec.width, rec.height)); + calquePanel_.getVueCalque().getCalque().setSize(rec.width, rec.height); + for (int i = 0; i < tousCalques.length; i++) { + tousCalques[i].setSize(rec.width, rec.height); + } + } - public GrBoite getViewBoite() { - return calquePanel_.getVueCalque().getViewBoite(); - } + public GrBoite getViewBoite() { + return calquePanel_.getVueCalque().getViewBoite(); + } - public EbliWidgetControllerCalque getCalqueController() { - return (EbliWidgetControllerCalque) getController(); - } + public EbliWidgetControllerCalque getCalqueController() { + return (EbliWidgetControllerCalque) getController(); + } - boolean first_ = true; + boolean first_ = true; - @SuppressWarnings("unchecked") - @Override - protected void paintWidget() { + @SuppressWarnings("unchecked") + @Override + protected void paintWidget() { - final Rectangle rec = getClientArea(); - rec.width -= 1; - rec.height -= 1; - final Graphics2D g = getGraphics(); + final Rectangle rec = getClientArea(); - if (frame_ == null) { - initSize(rec); - if (first_) { - first_ = false; - if (initZoom_ != null && initZoom_.getDeltaX() > 0 && initZoom_.getDeltaY() > 0) { - calquePanel_.getVueCalque().changeRepere(this, initZoom_); - initZoom_ = null; - } else calquePanel_.restaurer(); - } - // if (zoom_ != null) { - // // image=null; - // calquePanel_.getVueCalque().changeRepere(this, zoom_); - // - // } else calquePanel_.restaurer(); - } - // mode edition - if (image == null || image.getWidth() != rec.width || image.getHeight() != rec.height) { - FuLog.debug("EWI: recreate image"); - final Map params = new HashMap(); - CtuluLibImage.setCompatibleImageAsked(params); - // a ameliorer: il ne faudrait pas recreer l'image a chaque fois - image = calquePanel_.produceImage(rec.width, rec.height, params); - } - g.drawImage(image, rec.x, rec.y, rec.width, rec.height, null); - } + rec.width -= 1; + rec.height -= 1; - public EnumSet<org.netbeans.api.visual.action.InplaceEditorProvider.ExpansionDirection> getExpansionDirections( - final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, final Widget widget, - final BuPanel editor) { - return null; - } + if(rec.width>0 && rec.height>0){ + final Graphics2D g = getGraphics(); - public Rectangle getInitialEditorComponentBounds( - final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, final Widget widget, - final BuPanel editor, final Rectangle viewBounds) { - return convertLocalToScene(getClientArea()); - } + if (frame_ == null) { + initSize(rec); + if (first_) { + first_ = false; + if (initZoom_ != null && initZoom_.getDeltaX() > 0 && initZoom_.getDeltaY() > 0) { + calquePanel_.getVueCalque().changeRepere(this, initZoom_); + initZoom_ = null; + } else calquePanel_.restaurer(); + } + // if (zoom_ != null) { + // // image=null; + // calquePanel_.getVueCalque().changeRepere(this, zoom_); + // + // } else calquePanel_.restaurer(); + } - public void notifyOpened(final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - final Widget widget, final BuPanel editor) { - editingStart(); - calquePanel_.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1)); - } + // mode edition + if (image == null || image.getWidth() != rec.width || image.getHeight() != rec.height) { + FuLog.debug("EWI: recreate image"); + final Map params = new HashMap(); + CtuluLibImage.setCompatibleImageAsked(params); + // a ameliorer: il ne faudrait pas recreer l'image a chaque fois - // public void setColorFond(Color newColor) { - // couleurFond = newColor; - // repaint(); - // } - // - // public void update(Observable _o, Object _arg) { - // image = null; - // getEbliScene().refresh(); - // } - @Override - public boolean canRotate() { - return false; - } + image = calquePanel_.produceImage(rec.width, rec.height, params); - @Override - public boolean canColorForeground() { - return false; - } + } + g.drawImage(image, rec.x, rec.y, rec.width, rec.height, null); - @Override - public boolean canColorBackground() { - return false; - } + } + } - @Override - public boolean canTraceLigneModel() { - return false; - } + public EnumSet<org.netbeans.api.visual.action.InplaceEditorProvider.ExpansionDirection> getExpansionDirections( + final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, final Widget widget, + final BuPanel editor) { + return null; + } - @Override - public boolean canFont() { - return false; - } + public Rectangle getInitialEditorComponentBounds( + final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, final Widget widget, + final BuPanel editor, final Rectangle viewBounds) { + return convertLocalToScene(getClientArea()); + } - @Override - public List<EbliWidgetAnimatedItem> getAnimatedItems() { - final BCalque[] cqs = calquePanel_.getVueCalque().getCalque().getTousCalques(); - final List<EbliWidgetAnimatedItem> res = new ArrayList<EbliWidgetAnimatedItem>(20); - for (int i = 0; i < cqs.length; i++) { - if (cqs[i].isVisible() && cqs[i] instanceof EbliAnimationAdapterInterface) { - res.add(new EbliWidgetAnimatedItem((EbliAnimationAdapterInterface) cqs[i], cqs[i], getId(), cqs[i].getName(), - cqs[i].getTitle())); - } - } - return res; - } + public void notifyOpened(final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, + final Widget widget, final BuPanel editor) { + editingStart(); + calquePanel_.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1)); + } - @Override - public boolean isAnimatedItemAlive(final String _id) { - final BCalque cq = calquePanel_.getVueCalque().getCalque().getCalqueParNom(_id); - return cq != null && cq.isVisible(); - } + // public void setColorFond(Color newColor) { + // couleurFond = newColor; + // repaint(); + // } + // + // public void update(Observable _o, Object _arg) { + // image = null; + // getEbliScene().refresh(); + // } + @Override + public boolean canRotate() { + return false; + } + @Override + public boolean canColorForeground() { + return false; + } + + @Override + public boolean canColorBackground() { + return false; + } + + @Override + public boolean canTraceLigneModel() { + return false; + } + + @Override + public boolean canFont() { + return false; + } + + @Override + public List<EbliWidgetAnimatedItem> getAnimatedItems() { + final BCalque[] cqs = calquePanel_.getVueCalque().getCalque().getTousCalques(); + final List<EbliWidgetAnimatedItem> res = new ArrayList<EbliWidgetAnimatedItem>(20); + for (int i = 0; i < cqs.length; i++) { + if (cqs[i].isVisible() && cqs[i] instanceof EbliAnimationAdapterInterface) { + res.add(new EbliWidgetAnimatedItem((EbliAnimationAdapterInterface) cqs[i], cqs[i], getId(), cqs[i].getName(), + cqs[i].getTitle())); + } + } + return res; + } + + @Override + public boolean isAnimatedItemAlive(final String _id) { + final BCalque cq = calquePanel_.getVueCalque().getCalque().getCalqueParNom(_id); + return cq != null && cq.isVisible(); + } + } Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorDblFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorDblFleche.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorDblFleche.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -0,0 +1,45 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Shape; +import java.awt.geom.GeneralPath; +import java.awt.geom.Rectangle2D; +import java.util.Map; + +/** + * Creation de la double fleche. + * @author Adrien Hadoux + * + */ + +public class ShapeCreatorDblFleche implements ShapeCreator { + + public Shape createShapeFor(final Rectangle2D.Float rec, final Map options, final float largeurTrait) { + final Float ratioHeadW = (Float) options.get("arrow.ratioHeadW"); + final Float ratioBaseH = (Float) options.get("arrow.ratioBaseH"); + final float rb = ratioBaseH == null ? 0.3f : ratioBaseH.floatValue(); + final float rh = ratioHeadW == null ? 0.3f : ratioHeadW.floatValue(); + final float middleH = rec.y + rec.height / 2f; + final float hauteurBase = rec.height * rb; + final float largeurHead = rec.width * rh; + final GeneralPath path = new GeneralPath(); + //-- debut pointe fleche --// + path.moveTo(rec.x+ largeurTrait / 2, middleH ); + path.lineTo(rec.x +largeurHead,rec.y+ largeurTrait / 2); + path.lineTo(rec.x +largeurHead, middleH - hauteurBase / 2); + + //-- fleche classique --// + path.lineTo(rec.x + rec.width - largeurHead, middleH - hauteurBase / 2); + path.lineTo(rec.x + rec.width - largeurHead, rec.y + largeurTrait / 2); + path.lineTo(rec.x + rec.width - largeurTrait / 2, middleH); + path.lineTo(rec.x + rec.width - largeurHead, rec.y + rec.height - largeurTrait / 2); + path.lineTo(rec.x + rec.width - largeurHead, middleH + hauteurBase / 2); + + //--fin fleche + path.lineTo(rec.x+largeurHead, middleH + hauteurBase / 2); + path.lineTo(rec.x+largeurHead, rec.y + rec.height - largeurTrait / 2); + path.lineTo(rec.x+ largeurTrait / 2, middleH); + + path.closePath(); + return path; + } + } \ No newline at end of file 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-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -13,6 +13,7 @@ import javax.swing.JPopupMenu; import javax.swing.JScrollPane; +import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ctulu.gui.CtuluLibSwing; @@ -140,17 +141,36 @@ // -- on prend la location du node au moment de la suppression pour // pouvoir la retablir dans le undo --// // n.setPreferedLocation(widget_.getPreferredLocation()); - // -- on enregistre la commande undo redo --// - cmd_ - .addCmd(new CommandSupprimer(n, widget_.getEbliScene(), widget_.convertLocalToScene(widget_.getLocation()))); + // -- on enleve le node de la scene --// widget_.getEbliScene().removeNode(n); // -- on supprime le node legende associe --// - if (widgetGraphe_.getNodeLegende() != null) { + if (hasLegende()) { widget_.getEbliScene().removeNode(widgetGraphe_.getNodeLegende()); + final CtuluCommand commande1=new CommandSupprimer(n, widget_.getEbliScene(), widget_.convertLocalToScene(widget_.getLocation())); + final CtuluCommand commande2= new CommandSupprimer(widgetGraphe_.getNodeLegende(), widget_.getEbliScene(), widget_.convertLocalToScene(widgetGraphe_.getNodeLegende().getWidget().getLocation())); + cmd_.addCmd(new CtuluCommand(){ + @Override + public void redo() { + // TODO Auto-generated method stub + commande1.redo(); + commande2.redo(); + } + + @Override + public void undo() { + // TODO Auto-generated method stub + commande1.undo(); + commande2.undo(); + } + + }); + }else{ + // -- on enregistre la commande undo redo unitaire --// + cmd_.addCmd(new CommandSupprimer(n, widget_.getEbliScene(), widget_.convertLocalToScene(widget_.getLocation()))); } // -- raffraichissement de la scene --// widget_.getEbliScene().refresh(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java 2008-10-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -102,7 +102,7 @@ final Rectangle rec = getClientArea(); final Graphics2D g = getGraphics(); // g.translate(rec.x, rec.y); - + if(rec.width>0 && rec.height>0){ if (frame_ == null) { getGraphe().setSize(rec.width - 1, rec.height - 1); // getGraphe().computeMarges(g); @@ -119,7 +119,7 @@ } g.drawImage(imageGraphe, rec.x, rec.y, rec.width - 1, rec.height - 1, null); - + } // g.translate(-rec.x, -rec.y); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManager.java 2008-10-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManager.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -26,243 +26,280 @@ */ public class WidgetLegendeManager { - // public static int LENGHT_PER_LEGENDE = 15; - // public static int WIDTH_PER_LEGENDEICON = 100; - // public static int WIDTH_PER_LEGENDETEXT = 120; - // public static int MAX_BORDURE = 12; + // public static int LENGHT_PER_LEGENDE = 15; + // public static int WIDTH_PER_LEGENDEICON = 100; + // public static int WIDTH_PER_LEGENDETEXT = 120; + // public static int MAX_BORDURE = 12; - // public static Dimension createSizeForWidget(int _nbLibelles){ - // return new Dimension(WIDTH_PER_LEGENDEICON + WIDTH_PER_LEGENDETEXT, _nbLibelles - // * (LENGHT_PER_LEGENDE + MAX_BORDURE / 2)); - // } + // public static Dimension createSizeForWidget(int _nbLibelles){ + // return new Dimension(WIDTH_PER_LEGENDEICON + WIDTH_PER_LEGENDETEXT, _nbLibelles + // * (LENGHT_PER_LEGENDE + MAX_BORDURE / 2)); + // } - /** - * Creation de la classe widget specifique au calque. Permet de gerer le resize via le changement de font - */ - public static class WidgetCalqueLegende extends EbliWidget { + /** + * Creation de la classe widget specifique au calque. Permet de gerer le resize via le changement de font + */ + public static class WidgetCalqueLegende extends EbliWidget { - Font oldFont_; + Font oldFont_; - public WidgetCalqueLegende(final EbliScene scene, final boolean _controller) { - super(scene, _controller); - oldFont_ = getFormeFont(); - } + public WidgetCalqueLegende(final EbliScene scene, final boolean _controller) { + super(scene, _controller); + oldFont_ = getFormeFont(); + } - protected Rectangle resizeMaxLegende() { - this.getGraphics().setFont(getFormeFont()); - int maxHeight = 0; - int maxWidth = 0; - // -- mise a jour de la widget avec la nouvelle font - final List<Widget> listePlage = getChildren(); - for (final Iterator<Widget> it = listePlage.iterator(); it.hasNext();) { - final Widget widget = it.next(); - // -- test si il s agit d un widget plage --// - if (widget instanceof EbliWidget && widget.getChildren().size() == 2) { - final EbliWidget new_widget = (EbliWidget) widget; + protected Rectangle resizeMaxLegende() { + this.getGraphics().setFont(getFormeFont()); + int maxHeight = 0; + int maxWidth = 0; + // -- mise a jour de la widget avec la nouvelle font + final List<Widget> listePlage = getChildren(); + for (final Iterator<Widget> it = listePlage.iterator(); it.hasNext();) { + final Widget widget = it.next(); + // -- test si il s agit d un widget plage --// + if (widget instanceof EbliWidget && widget.getChildren().size() == 2) { + final EbliWidget new_widget = (EbliWidget) widget; - EbliWidgetTitle tw = null; + EbliWidgetTitle tw = null; - if (new_widget.getChildren().get(0) instanceof EbliWidgetTitle) tw = (EbliWidgetTitle) new_widget - .getChildren().get(0); - else if (new_widget.getChildren().get(1) instanceof EbliWidgetTitle) tw = (EbliWidgetTitle) new_widget - .getChildren().get(1); + if (new_widget.getChildren().get(0) instanceof EbliWidgetTitle) tw = (EbliWidgetTitle) new_widget + .getChildren().get(0); + else if (new_widget.getChildren().get(1) instanceof EbliWidgetTitle) tw = (EbliWidgetTitle) new_widget + .getChildren().get(1); - if (tw != null) { - // -- recuperation des tailles des font pour les textes saisies + if (tw != null) { + // -- recuperation des tailles des font pour les textes saisies - final FontMetrics ftm = this.getGraphics().getFontMetrics(); + final FontMetrics ftm = this.getGraphics().getFontMetrics(); - final int newWidth = ftm.stringWidth(tw.intern_.getLabel()); - final int newHeight = ftm.getHeight(); - if (maxWidth < newWidth) maxWidth = newWidth; - maxHeight = newHeight; - } - } + final int newWidth = ftm.stringWidth(tw.intern_.getLabel()); + final int newHeight = ftm.getHeight(); + if (maxWidth < newWidth) maxWidth = newWidth; + maxHeight = newHeight; + } + } - } - final Rectangle newBounds = new Rectangle(); - newBounds.height /* + */= maxHeight; - newBounds.width /* + */= maxWidth; + } + final Rectangle newBounds = new Rectangle(); + newBounds.height /* + */= maxHeight; + newBounds.width /* + */= maxWidth; - return newBounds; - } + return newBounds; + } + + + boolean suppressionOccured=false; + + public void majSuppression(){ + suppressionOccured=true; + repaint(); + } + - @Override - protected void paintWidget() { + @Override + protected void paintWidget() { - // -- mise a jour de la fonte que si il y a eu une modification --// - if (oldFont_ != getFormeFont()) { + // -- mise a jour de la fonte que si il y a eu une modification --// + if (oldFont_ != getFormeFont() || suppressionOccured) { + suppressionOccured=false; + // -- calcul des max height et width pour resize les composants --// + final Rectangle newBounds = resizeMaxLegende(); - // -- calcul des max height et width pour resize les composants --// - final Rectangle newBounds = resizeMaxLegende(); + // -- mise a jour de la widget avec la nouvelle font + final List<Widget> listePlage = getChildren(); + for (final Iterator<Widget> it = listePlage.iterator(); it.hasNext();) { + final Widget widget = it.next(); + // -- test si il s agit d un widget plage --// + if (widget instanceof EbliWidget && widget.getChildren().size() == 2) { + final EbliWidget new_widget = (EbliWidget) widget; - // -- mise a jour de la widget avec la nouvelle font - final List<Widget> listePlage = getChildren(); - for (final Iterator<Widget> it = listePlage.iterator(); it.hasNext();) { - final Widget widget = it.next(); - // -- test si il s agit d un widget plage --// - if (widget instanceof EbliWidget && widget.getChildren().size() == 2) { - final EbliWidget new_widget = (EbliWidget) widget; + EbliWidgetLine lw = null; + EbliWidgetTitle tw = null; - EbliWidgetLine lw = null; - EbliWidgetTitle tw = null; + if (new_widget.getChildren().get(0) instanceof EbliWidgetLine) lw = (EbliWidgetLine) new_widget + .getChildren().get(0); + else tw = (EbliWidgetTitle) new_widget.getChildren().get(0); - if (new_widget.getChildren().get(0) instanceof EbliWidgetLine) lw = (EbliWidgetLine) new_widget - .getChildren().get(0); - else tw = (EbliWidgetTitle) new_widget.getChildren().get(0); + if (new_widget.getChildren().get(1) instanceof EbliWidgetLine) lw = (EbliWidgetLine) new_widget + .getChildren().get(1); + else tw = (EbliWidgetTitle) new_widget.getChildren().get(1); + if (lw != null && tw != null) { - if (new_widget.getChildren().get(1) instanceof EbliWidgetLine) lw = (EbliWidgetLine) new_widget - .getChildren().get(1); - else tw = (EbliWidgetTitle) new_widget.getChildren().get(1); - if (lw != null && tw != null) { + tw.getIntern_().setFont(getFormeFont()); - tw.getIntern_().setFont(getFormeFont()); + // resize du composant texte + final Rectangle internBounds = tw.getIntern_().getBounds(); + // internBounds.height += (getFormeFont().getSize() - + // oldFont_.getSize()) * 2; + // internBounds.width += (getFormeFont().getSize() - + // oldFont_.getSize()) * 12; + internBounds.width = newBounds.width; + internBounds.height = (newBounds.height); + tw.getIntern_().setPreferredBounds(internBounds); - // resize du composant texte - final Rectangle internBounds = tw.getIntern_().getBounds(); - // internBounds.height += (getFormeFont().getSize() - - // oldFont_.getSize()) * 2; - // internBounds.width += (getFormeFont().getSize() - - // oldFont_.getSize()) * 12; - internBounds.width = newBounds.width; - internBounds.height = (newBounds.height); - tw.getIntern_().setPreferredBounds(internBounds); + // resize pour le logo: forme carr\xE9 + final Rectangle boundsLogo = lw.getBounds(); + // boundsLogo.height = internBounds.height; + // boundsLogo.width = internBounds.height; + boundsLogo.height = (newBounds.height); + boundsLogo.width = (newBounds.height); + lw.setPreferredBounds(boundsLogo); - // resize pour le logo: forme carr\xE9 - final Rectangle boundsLogo = lw.getBounds(); - // boundsLogo.height = internBounds.height; - // boundsLogo.width = internBounds.height; - boundsLogo.height = (newBounds.height); - boundsLogo.width = (newBounds.height); - lw.setPreferredBounds(boundsLogo); + } + } - } - } + } + // Resize de la widget - } - // Resize de la widget + // Rectangle newBounds = getParentWidget().getBounds(); + // newBounds.height += (listePlage.size() + 1) * + // (getFormeFont().getSize() - oldFont_.getSize()) * 2; + // newBounds.width += (getFormeFont().getSize() - oldFont_.getSize()) * + // 12; + // getParentWidget().setPreferredBounds(newBounds); + final Rectangle newBoundConteneurs = getParentWidget().getBounds(); + newBoundConteneurs.height = (int) ((listePlage.size() + 1) * newBounds.height * 1.5);// ( + newBoundConteneurs.width = (int) (newBounds.width * 1.5); + getParentWidget().setPreferredBounds(newBoundConteneurs); + getEbliScene().refresh(); + oldFont_ = getFormeFont(); - // Rectangle newBounds = getParentWidget().getBounds(); - // newBounds.height += (listePlage.size() + 1) * - // (getFormeFont().getSize() - oldFont_.getSize()) * 2; - // newBounds.width += (getFormeFont().getSize() - oldFont_.getSize()) * - // 12; - // getParentWidget().setPreferredBounds(newBounds); - final Rectangle newBoundConteneurs = getParentWidget().getBounds(); - newBoundConteneurs.height = (int) ((listePlage.size() + 1) * newBounds.height * 1.5);// ( - newBoundConteneurs.width = (int) (newBounds.width * 1.5); - getParentWidget().setPreferredBounds(newBoundConteneurs); - getEbliScene().refresh(); - oldFont_ = getFormeFont(); + } - } + } - } + @Override + public boolean canRotate() { + return false; + } - @Override - public boolean canRotate() { - return false; - } + @Override + public boolean canColorForeground() { + return false; + } - @Override - public boolean canColorForeground() { - return false; - } + @Override + public boolean canColorBackground() { + return true; + } - @Override - public boolean canColorBackground() { - return true; - } + @Override + public boolean canTraceLigneModel() { + return false; + } - @Override - public boolean canTraceLigneModel() { - return false; - } + @Override + public boolean canFont() { + return true; + } - @Override - public boolean canFont() { - return true; - } + } - } + /** + * Creation de la legende + * + * @param g + * @param scene + * @param PreferredLocation peut etre null + * @return + */ + public static EbliWidget createLegende(final EGGraphe g, final EbliScene scene, final Point PreferredLocation) { + final EGCourbe[] cs = g.getModel().getCourbes(); + final WidgetCalqueLegende res = new WidgetCalqueLegende(scene, false); + res.setLayout(new FlowLayout(true, SerialAlignment.CENTER, 5));// a + // modifier + // pour + // setter + // le gap + // res.setLayout(new OverlayLayout()); + for (int i = 0; i < cs.length; i++) { + final EbliWidget line = new EbliWidget(scene); + line.setLayout(new FlowLayout(false, SerialAlignment.CENTER, 5)); - /** - * Creation de la legende - * - * @param g - * @param scene - * @param PreferredLocation peut etre null - * @return - */ - public static EbliWidget createLegende(final EGGraphe g, final EbliScene scene, final Point PreferredLocation) { - final EGCourbe[] cs = g.getModel().getCourbes(); - final WidgetCalqueLegende res = new WidgetCalqueLegende(scene, false); - res.setLayout(new FlowLayout(true, SerialAlignment.CENTER, 5));// a - // modifier - // pour - // setter - // le gap - // res.setLayout(new OverlayLayout()); - for (int i = 0; i < cs.length; i++) { - final EbliWidget line = new EbliWidget(scene); - line.setLayout(new FlowLayout(false, SerialAlignment.CENTER, 5)); + // creation de la widget titre + final EbliWidgetTitle tw = new EbliWidgetTitle(scene, cs[i], null); - // creation de la widget titre - final EbliWidgetTitle tw = new EbliWidgetTitle(scene, cs[i], null); + // creation de la widget ligne + final EbliWidgetLine lw = new EbliWidgetLine(scene, cs[i], null); + line.setUseBorder(false); + lw.setUseBorder(false); + tw.setUseBorder(false); - // creation de la widget ligne - final EbliWidgetLine lw = new EbliWidgetLine(scene, cs[i], null); - line.setUseBorder(false); - lw.setUseBorder(false); - tw.setUseBorder(false); + lw.setEnabled(false); + line.addChild(lw); + line.addChild(tw); + res.addChild(line); - lw.setEnabled(false); - line.addChild(lw); - line.addChild(tw); - res.addChild(line); + // -- ajouter le listener EGGraphe pour ecouter et \xE9ettre a jour els + // l\xE9gendes --// + g.getModel().addModelListener(new EGGrapheModelListener() { - // -- ajouter le listener EGGraphe pour ecouter et \xE9ettre a jour els - // l\xE9gendes --// - g.getModel().addModelListener(new EGGrapheModelListener() { + public void structureChanged() { + if(g.getModel().contains(lw.cb_)){ + line.repaint(); + tw.majLabel(); + }else{ + //-- il faut supprimer --// + res.removeChild(line); + res.majSuppression(); + } - public void structureChanged() { - line.repaint(); - tw.majLabel(); + } - } + public void courbeContentChanged(final EGObject _c, final boolean restore) { + if(g.getModel().contains(lw.cb_)){ + line.repaint(); + tw.majLabel(); + }else{ + //-- il faut supprimer --// + res.removeChild(line); + res.majSuppression(); + } + } - public void courbeContentChanged(final EGObject _c, final boolean restore) { - line.repaint(); - tw.majLabel(); + public void courbeAspectChanged(final EGObject _c, final boolean _visibil) { + if(g.getModel().contains(lw.cb_)){ + line.repaint(); + tw.majLabel(); + }else{ + //-- il faut supprimer --// + res.removeChild(line); + res.majSuppression(); + } + } - } + public void axeContentChanged(final EGAxe _c) { + if(g.getModel().contains(lw.cb_)){ + line.repaint(); + tw.majLabel(); + }else{ + //-- il faut supprimer --// + res.removeChild(line); + res.majSuppression(); + } + } - public void courbeAspectChanged(final EGObject _c, final boolean _visibil) { - line.repaint(); - tw.majLabel(); + public void axeAspectChanged(final EGAxe _c) { + if(g.getModel().contains(lw.cb_)){ + line.repaint(); + tw.majLabel(); + }else{ + //-- il faut supprimer --// + res.removeChild(line); + res.majSuppression(); + } + } + }); - } + } - public void axeContentChanged(final EGAxe _c) { - line.repaint(); - tw.majLabel(); - } + res.setController(new EbliWidgetControllerMenuOnly(res, false)); - public void axeAspectChanged(final EGAxe _c) { - line.repaint(); - tw.majLabel(); - } - }); + // -- prendre en compte le resize automatique --// + res.oldFont_ = new Font("Helvetica", Font.BOLD, 40); + res.repaint(); - } + return res; + } - res.setController(new EbliWidgetControllerMenuOnly(res, false)); - - // -- prendre en compte le resize automatique --// - res.oldFont_ = new Font("Helvetica", Font.BOLD, 40); - res.repaint(); - - return res; - } - } 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-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -51,6 +51,7 @@ import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorTextLabel; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorCircle; +import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorDblFleche; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorEllipse; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorFleche; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorLine; @@ -319,7 +320,21 @@ return nodeFleche; } + + public EbliNode addDblFleche() { + // -- ajout du rectangle --// + final EbliNodeDefault nodeFleche = new EbliNodeDefault(); + nodeFleche.setTitle("Double Fleche"); + nodeFleche.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorDblFleche())); + nodeFleche.setPreferedSize(new Dimension(100, 50)); + nodeFleche.setPreferedLocation(new Point(350, 125)); + // ajout du node au layout + addNode(nodeFleche); + + return nodeFleche; + } + /** * Methode generique d ajout d un node widget a la scene. * @@ -405,7 +420,7 @@ .getToolIcon("crystal_bu_scrollpane_corner"), "WIDGETDBLFLECHE") { @Override public void actionPerformed(final ActionEvent _evt) { - addFleche(); + addDblFleche(); } }); // -- palette Ellipse --// 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-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -500,7 +500,7 @@ */ public String formatInfoSource(final TrPostSource _src) { // --ajout dans la liste des titres --// - return formatName(_src.getTitle()) + " | Fichier: " + formatFichier(_src.getFile()); + return "Fichier: " + formatFichier(_src.getFile())+" |"+formatName(_src.getTitle()) ; } public String formatFichier(final File file) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java 2008-10-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -337,6 +337,8 @@ // parent.setChildConstraint(findWidget, new Rectangle2D.Float(rMinX, rMinY, rMaxX, rMaxY)); } + + final EbliWidgetGroupCreator creator = new EbliWidgetGroupCreator(); parent.setGroup(true); @@ -350,7 +352,8 @@ // -- synchronisation des sondes des fusions --// parent.synchroniseSondeFusion(); - + //-- synchronisation du zoom --// + parent.synchronyseZoom(); scene_.addNode(node); if (pn != null && boite != null) { pn.getVueCalque().changeRepere(pn, boite, 0, 0); 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-23 11:14:24 UTC (rev 4091) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-23 16:30:33 UTC (rev 4092) @@ -438,7 +438,7 @@ final List<TrPostUserVariableSaver> liste = new XmlArrayList(new VariablesStreamStrategy(new File(path),trprojet_.listeSrc_)); - if (init) clearDatas(liste); + //if (init) clearDatas(liste); return liste; } @@ -446,9 +446,10 @@ private void clearDatas(final List<TrPostUserVariableSaver> list) { // CtuluRemoveContentDirectory.contentDirectoryRemover(getDirectoryCurves()); if (list == null) return; - while (list.size() != 0) - list.remove(0); - + for(Iterator<TrPostUserVariableSaver> it=list.iterator();it.hasNext();){ + it.next(); + it.remove(); + } } /** @@ -674,7 +675,12 @@ // -- etape 1: creation du repertoire des graphe et calques --// final String pathVariables = projet_.getAbsolutePath() + File.separator + "Variables"; try { - new File(pathVariables).mkdir(); + File fileVar= new File(pathVariables); + + if(fileVar.isDirectory()){ + CtuluRemoveContentDirectory.contentDirectoryRemover(fileVar); + }else + fileVar.mkdir(); } catch (final Exception e) { // pas grave on continue FuLog.debug("Le repertoire des variables existe deja"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |