From: <had...@us...> - 2008-08-11 18:47:42
|
Revision: 3761 http://fudaa.svn.sourceforge.net/fudaa/?rev=3761&view=rev Author: hadouxad Date: 2008-08-11 18:47:40 +0000 (Mon, 11 Aug 2008) Log Message: ----------- Mie a jour de la journ?\195?\169e: - duplication - alignement + gestion des commandes undo redo - creation d une classe implementant ctulucommande pour gerer les undio redo de positions de widget - gestion des icones pour le tree - gestion des editeur pour le graphe - gestion des editeur pour le calque ainsi que le tree calque Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionAlign.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/calque/EbliWidgetVueCalque.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/tree/EbliCheckBoxNodeEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliCheckBoxTreeRenderer.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionUndoRedo.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java 2008-08-11 14:17:51 UTC (rev 3760) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java 2008-08-11 18:47:40 UTC (rev 3761) @@ -7,7 +7,7 @@ import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.visuallibrary.layout.OverlayLayoutGap; import org.netbeans.api.visual.action.ActionFactory; -import org.netbeans.api.visual.action.InplaceEditorProvider; + import org.netbeans.api.visual.action.TextFieldInplaceEditor; import org.netbeans.api.visual.action.WidgetAction; import org.netbeans.api.visual.widget.LabelWidget; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionAlign.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionAlign.java 2008-08-11 14:17:51 UTC (rev 3760) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionAlign.java 2008-08-11 18:47:40 UTC (rev 3761) @@ -12,164 +12,178 @@ import javax.swing.AbstractAction; +import org.fudaa.ctulu.CtuluCommand; +import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; +import org.netbeans.api.visual.widget.Widget; /** * Action qui permet de realiser l alignement des composants. * - * - *ATTTENTION CHOIX DE CONCEPTION: - *il faut que les EbliNode soit movables (isMovable()== true) - * pour pouvoir les aligner - * il faut donc lorss de la creation des nodes remplir les infos dimensions et size comme suit: * - * EbliNodeDefault node = new EbliNodeDefault(); - * node.setCreator(new EbliWidgetCreatorGraphe(g)); - * node.setTitle("Graphe"); - * node.setPreferedSize(new Dimension(300, 300)); - * node.setPreferedLocation(new Point(4, 4)); - * scene.addNode(node); - * + *ATTTENTION CHOIX DE CONCEPTION: il faut que les EbliNode soit movables + * (isMovable()== true) pour pouvoir les aligner il faut donc lorss de la + * creation des nodes remplir les infos dimensions et size comme suit: + * + * EbliNodeDefault node = new EbliNodeDefault(); node.setCreator(new + * EbliWidgetCreatorGraphe(g)); node.setTitle("Graphe"); + * node.setPreferedSize(new Dimension(300, 300)); node.setPreferedLocation(new + * Point(4, 4)); scene.addNode(node); + * *@author Adrien Hadoux - * + * */ -public class EbliWidgetActionAlign extends AbstractAction { +public class EbliWidgetActionAlign extends AbstractAction { /** * */ private static final long serialVersionUID = 1L; EbliScene scene_; - public final static int ALIGNLEFT=0; - public final static int ALIGNRIGHT=1; - public final static int ALIGNCENTERHORIZONTAL=2; - public final static int ALIGNCENTERVERTICAL=3; - public final static int ALIGNTOP=4; - public final static int ALIGNBOTTOM=5; + public final static int ALIGNLEFT = 0; + public final static int ALIGNRIGHT = 1; + public final static int ALIGNCENTERHORIZONTAL = 2; + public final static int ALIGNCENTERVERTICAL = 3; + public final static int ALIGNTOP = 4; + public final static int ALIGNBOTTOM = 5; int typeAlignement_; + + + CtuluCommandManager cmd_=new CtuluCommandManager() ; - //liste des positions precedentes pour chaque widgets - List<Point> listPreviousPositions_; - public EbliWidgetActionAlign(EbliScene _scene, int _typeAlignement) { super(); // TODO Auto-generated constructor stub - scene_=_scene; - typeAlignement_=_typeAlignement; - //-- renseignements des infos complementaires --// - putValue(NAME,"Alignement "+traduct(_typeAlignement)); + scene_ = _scene; + typeAlignement_ = _typeAlignement; + // -- renseignements des infos complementaires --// + putValue(NAME, "Alignement " + traduct(_typeAlignement)); - } public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub alignComponents(); + + } + /** - * methode qui recalcule la nouvelle position par rapport a la scene et a l alignement choisiT. + * methode qui recalcule la nouvelle position par rapport a la scene et a l + * alignement choisiT. */ - private Point calculeNewLocation(Point _previousLocation,Dimension _dimensionWidget,Dimension _dimensionScene){ + + private Point calculeNewLocation(Point _previousLocation, + Rectangle _dimensionWidget, Dimension _dimensionScene) { + switch (typeAlignement_) { + case ALIGNLEFT: + return new Point(0, _previousLocation.y); + case ALIGNRIGHT: + return new Point(_dimensionScene.width - _dimensionWidget.width, + _previousLocation.y); + case ALIGNCENTERHORIZONTAL: + return new Point(_dimensionScene.width / 2 - _dimensionWidget.width + / 2, _previousLocation.y); + case ALIGNCENTERVERTICAL: + return new Point(_previousLocation.x, _dimensionScene.height / 2 + - _dimensionWidget.height / 2); + case ALIGNTOP: + return new Point(_previousLocation.x, 0); + case ALIGNBOTTOM: + return new Point(_previousLocation.x, _dimensionScene.height + - _dimensionWidget.height); - switch(typeAlignement_){ - case ALIGNLEFT: return new Point(0,_previousLocation.y); - case ALIGNRIGHT: return new Point(_dimensionScene.width-_dimensionWidget.width,_previousLocation.y); - case ALIGNCENTERHORIZONTAL: return new Point(_dimensionScene.width/2 -_dimensionWidget.width/2 ,_previousLocation.y); - case ALIGNCENTERVERTICAL: return new Point(_previousLocation.x,_dimensionScene.height/2 -_dimensionWidget.height/2); - case ALIGNTOP: return new Point(_previousLocation.x,0); - case ALIGNBOTTOM: return new Point(_previousLocation.x,_dimensionScene.height-_dimensionWidget.height); - - - default: return _previousLocation; + default: + return _previousLocation; } - } - private Point calculeNewLocation(Point _previousLocation,Rectangle _dimensionWidget,Dimension _dimensionScene){ + private String traduct(int _align) { + switch (typeAlignement_) { + case ALIGNLEFT: + return "\xE0 gauche"; + case ALIGNRIGHT: + return "\xE0 droite"; + case ALIGNCENTERHORIZONTAL: + return "centr\xE9 horizontal"; + case ALIGNCENTERVERTICAL: + return "centr\xE9 vertical"; + case ALIGNTOP: + return "en haut"; + case ALIGNBOTTOM: + return "en bas"; - - switch(typeAlignement_){ - case ALIGNLEFT: return new Point(0,_previousLocation.y); - case ALIGNRIGHT: return new Point(_dimensionScene.width-_dimensionWidget.width,_previousLocation.y); - case ALIGNCENTERHORIZONTAL: return new Point(_dimensionScene.width/2 -_dimensionWidget.width/2 ,_previousLocation.y); - case ALIGNCENTERVERTICAL: return new Point(_previousLocation.x,_dimensionScene.height/2 -_dimensionWidget.height/2); - case ALIGNTOP: return new Point(_previousLocation.x,0); - case ALIGNBOTTOM: return new Point(_previousLocation.x,_dimensionScene.height-_dimensionWidget.height); - - - default: return _previousLocation; + default: + return ""; } - - } - - private String traduct(int _align){ - switch(typeAlignement_){ - case ALIGNLEFT: return "\xE0 gauche"; - case ALIGNRIGHT: return "\xE0 droite"; - case ALIGNCENTERHORIZONTAL: return "centr\xE9 horizontal"; - case ALIGNCENTERVERTICAL: return "centr\xE9 vertical"; - case ALIGNTOP: return "en haut"; - case ALIGNBOTTOM: return "en bas"; - - - default: return ""; - } - } - /** * action alignement qui realise l alignements de tous les composants */ - public void alignComponents(){ + public void alignComponents() { - //-- reinitialisation de la liste des historique des positions --// - listPreviousPositions_=new ArrayList<Point>(); - - //-- recuperation de la liste des widgets selectionnees --// - Set<EbliNode> listeNode = (Set<EbliNode>) scene_.getSelectedObjects();//scene_.getNodes(); - //-- parcours des nodes - for(Iterator<EbliNode> it=listeNode.iterator();it.hasNext();){ + // -- recuperation de la liste des widgets selectionnees --// - EbliNode currentNode=it.next(); - if(currentNode!=null && currentNode.isMovable()){ + Set<EbliNode> listeNode = (Set<EbliNode>) scene_.getSelectedObjects();// scene_ + // . + // getNodes + // ( + // ) + // ; - //-- deplacement que si la widget est selectionnee --// - if(currentNode.getCreator().getWidget().getState().isSelected()){ + // -- parcours des nodes + for (Iterator<EbliNode> it = listeNode.iterator(); it.hasNext();) { - //-- enregistrement de la previous position --// - listPreviousPositions_.add(currentNode.getPreferedLocation()); + EbliNode currentNode = it.next(); + if (currentNode != null && currentNode.isMovable()) { - //-- calcul de la nouvelle position du node en fonction de l alignement choisi --// - Point newLocation=calculeNewLocation(currentNode.getCreator().getWidget().getLocation(), currentNode.getCreator().getWidget().getBounds(),scene_.getView().getSize()); + // -- deplacement que si la widget est selectionnee --// + if (currentNode.getCreator().getWidget().getState() + .isSelected()) { - //-- tentative de modification de la position du node --// + // -- enregistrement de la previous position --// + Point previousLocation=currentNode.getPreferedLocation(); + + // -- calcul de la nouvelle position du node en fonction de + // l alignement choisi --// + Point newLocation = calculeNewLocation(currentNode + .getCreator().getWidget().getLocation(), + currentNode.getCreator().getWidget().getBounds(), + scene_.getView().getSize()); + + // -- tentative de modification de la position du node --// currentNode.setPreferedLocation(newLocation); currentNode.getCreator().getWidget().revalidate(); currentNode.getCreator().getWidget().repaint(); + + //-- enregistrement de la commande undo redo --// + + //--creation d une commande undo redo --// + EbliWidgetActionUndoRedo cmd=new EbliWidgetActionUndoRedo(newLocation,previousLocation,currentNode.getCreator().getWidget()); + + //-- ajout de la commande undo redo --// + if (cmd_ != null) + cmd_.addCmd(cmd); } } } - //-- rafraichissement de la scene --// + // -- rafraichissement de la scene --// scene_.refresh(); - } - - - } 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-11 14:17:51 UTC (rev 3760) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java 2008-08-11 18:47:40 UTC (rev 3761) @@ -39,7 +39,7 @@ EbliNode currentNode=it.next(); if(currentNode!=null && currentNode.isMovable()){ - //-- deplacement au premier plan que si la widget est selectionnee --// + //-- deplacement au premier plan que si la widget est selectionnee if(currentNode.getCreator().getWidget().getState().isSelected()){ //-- ajout au premier plan du node --// Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionUndoRedo.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionUndoRedo.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionUndoRedo.java 2008-08-11 18:47:40 UTC (rev 3761) @@ -0,0 +1,41 @@ +package org.fudaa.ebli.visuallibrary.actions; + +import java.awt.Point; + +import org.fudaa.ctulu.CtuluCommand; + +import org.fudaa.ebli.visuallibrary.EbliWidget; + +/** + * classe qui permet de faire du undo redo de positions d une widget + * @author genesis + * + */ +public class EbliWidgetActionUndoRedo implements CtuluCommand{ + + EbliWidget widget_; + Point oldPos_; + Point newPos_; + + + + public EbliWidgetActionUndoRedo(Point newPos_, Point oldPos_, + EbliWidget widget_) { + super(); + this.newPos_ = newPos_; + this.oldPos_ = oldPos_; + this.widget_ = widget_; + } + + + public void redo() { + // TODO Auto-generated method stub + widget_.setPreferredLocation(newPos_); + } + + public void undo() { + // TODO Auto-generated method stub + widget_.setPreferredLocation(oldPos_); + } + +} 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-08-11 14:17:51 UTC (rev 3760) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java 2008-08-11 18:47:40 UTC (rev 3761) @@ -1,5 +1,6 @@ package org.fudaa.ebli.visuallibrary.calque; +import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Graphics2D; @@ -12,6 +13,7 @@ import javax.swing.JFrame; import javax.swing.JLabel; +import org.fudaa.ebli.calque.BArbreCalque; import org.fudaa.ebli.calque.BCalque; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.visuallibrary.EbliScene; @@ -21,107 +23,117 @@ import org.netbeans.api.visual.action.WidgetAction; import org.netbeans.api.visual.widget.Widget; +import sun.swing.BakedArrayList; + +import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuButton; import com.memoire.bu.BuPanel; -public class EbliWidgetVueCalque extends EbliWidget implements InplaceEditorProvider<BuPanel>{ +public class EbliWidgetVueCalque extends EbliWidget implements + InplaceEditorProvider<BuPanel> { - ZEbliCalquesPanel vue_; + ZEbliCalquesPanel vue_; - public EbliWidgetVueCalque(EbliScene scene, ZEbliCalquesPanel vue) { - super(scene); - vue_ = vue; - setPreferredSize(new Dimension(200, 200)); - setMinimumSize(new Dimension(200, 200)); - - //-- creation de l action pour editor --// - WidgetAction editorAction = ActionFactory.createInplaceEditorAction(this); + public EbliWidgetVueCalque(EbliScene scene, ZEbliCalquesPanel vue) { + super(scene); + vue_ = vue; + setPreferredSize(new Dimension(200, 200)); + setMinimumSize(new Dimension(200, 200)); - // -- ajout de l action au widget correspondant --// - this.getActions().addAction(editorAction); - - } + // -- creation de l action pour editor --// + WidgetAction editorAction = ActionFactory + .createInplaceEditorAction(this); - @Override - protected void paintWidget() { - Rectangle rec = getClientArea(); - Graphics2D g = getGraphics(); - g.translate(rec.x, rec.y); - // GrBoite b = vue_.getVueCalque().getViewBoite(); - // vue_.getVueCalque().changeRepere(this, b); - //TODO a ameliorer - BCalque[] tousCalques = vue_.getVueCalque().getCalque().getTousCalques(); - vue_.getVueCalque().setSize(rec.width, rec.height); - vue_.getVueCalque().getCalque().setSize(rec.width, rec.height); - for (int i = 0; i < tousCalques.length; i++) { - tousCalques[i].setSize(rec.width, rec.height); - } - vue_.restaurer(); - vue_.getVueCalque().paintImage(g, Collections.EMPTY_MAP); - g.translate(-rec.x, -rec.y); - } + // -- ajout de l action au widget correspondant --// + this.getActions().addAction(editorAction); - - //-- methodes implements InplaceEditorProvider --// - - /** - * Methode appeleee pour creer un editor correspondant - */ -public BuPanel createEditorComponent( - org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - Widget widget) { - // TODO Auto-generated method stub - - - - final BuPanel panelTest=new BuPanel(new FlowLayout(FlowLayout.CENTER)); - panelTest.add(new JLabel("test panel")); - BuButton boutonTest =new BuButton("bouton cool"); - boutonTest.addActionListener(new ActionListener(){ + } - public void actionPerformed(ActionEvent e) { - // TODO Auto-generated method stub - panelTest.add(new JLabel("bouton appuy\xE9")); - panelTest.validate(); - JFrame frameTruc=new JFrame(); - frameTruc.getContentPane().add(new JLabel("bouton appuy\xE9")); - frameTruc.setSize(200,200); - frameTruc.setVisible(true); + @Override + protected void paintWidget() { + Rectangle rec = getClientArea(); + Graphics2D g = getGraphics(); + g.translate(rec.x, rec.y); + // GrBoite b = vue_.getVueCalque().getViewBoite(); + // vue_.getVueCalque().changeRepere(this, b); + // TODO a ameliorer + BCalque[] tousCalques = vue_.getVueCalque().getCalque() + .getTousCalques(); + vue_.getVueCalque().setSize(rec.width, rec.height); + vue_.getVueCalque().getCalque().setSize(rec.width, rec.height); + for (int i = 0; i < tousCalques.length; i++) { + tousCalques[i].setSize(rec.width, rec.height); } - - }); - panelTest.add(boutonTest); - - - return panelTest; -} + vue_.restaurer(); + vue_.getVueCalque().paintImage(g, Collections.EMPTY_MAP); + g.translate(-rec.x, -rec.y); + } -public EnumSet<org.netbeans.api.visual.action.InplaceEditorProvider.ExpansionDirection> getExpansionDirections( - org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - Widget widget, BuPanel editor) { - // TODO Auto-generated method stub - return null; -} + // -- methodes implements InplaceEditorProvider --// -public Rectangle getInitialEditorComponentBounds( - org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - Widget widget, BuPanel editor, Rectangle viewBounds) { - // TODO Auto-generated method stub - return null; -} + /** + * Methode appeleee pour creer un editor correspondant + */ + public BuPanel createEditorComponent( + org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, + Widget widget) { + // TODO Auto-generated method stub -public void notifyClosing( - org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - Widget widget, BuPanel editor, boolean commit) { - // TODO Auto-generated method stub - -} + final BuPanel panelTest = new BuPanel(new FlowLayout(FlowLayout.CENTER)); + panelTest.add(new JLabel("test panel")); + BuButton boutonTest = new BuButton("bouton cool"); + boutonTest.addActionListener(new ActionListener() { -public void notifyOpened( - org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - Widget widget, BuPanel editor) { - // TODO Auto-generated method stub - -} + public void actionPerformed(ActionEvent e) { + // TODO Auto-generated method stub + panelTest.add(new JLabel("bouton appuy\xE9")); + panelTest.validate(); + JFrame frameTruc = new JFrame(); + frameTruc.getContentPane().add(new JLabel("bouton appuy\xE9")); + frameTruc.setSize(200, 200); + frameTruc.setVisible(true); + } + }); + panelTest.add(boutonTest); + BuPanel res = new BuPanel(new BuBorderLayout()); + res.add(vue_); + res + .add(new BArbreCalque(vue_.getArbreCalqueModel()), + BorderLayout.EAST); + // panelTest.add(vue_); + + return /* panelTest */res; + } + + public EnumSet<org.netbeans.api.visual.action.InplaceEditorProvider.ExpansionDirection> getExpansionDirections( + org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, + Widget widget, BuPanel editor) { + // TODO Auto-generated method stub + return null; + } + + public Rectangle getInitialEditorComponentBounds( + org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, + Widget widget, BuPanel editor, Rectangle viewBounds) { + return new Rectangle(viewBounds.x, viewBounds.y, viewBounds.width + 200, + viewBounds.height); + // TODO Auto-generated method stub + //return null; + } + + public void notifyClosing( + org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, + Widget widget, BuPanel editor, boolean commit) { + // TODO Auto-generated method stub + + } + + public void notifyOpened( + org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, + Widget widget, BuPanel editor) { + // TODO Auto-generated method stub + + } + } 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-08-11 14:17:51 UTC (rev 3760) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java 2008-08-11 18:47:40 UTC (rev 3761) @@ -5,6 +5,7 @@ import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; import java.util.EnumSet; import javax.swing.JFrame; @@ -15,6 +16,7 @@ import javax.swing.JPopupMenu; import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ctulu.gui.CtuluPopupListener; import org.fudaa.ebli.courbe.EGAxe; import org.fudaa.ebli.courbe.EGConfigureActionPalette; import org.fudaa.ebli.courbe.EGFillePanel; @@ -171,8 +173,15 @@ menu.setName("menu du graphe"); menu.setText("menu du graphe"); // creation du panel Egfille correspondant - EGFillePanel panelGraphe=new EGFillePanel(this.graphe); + final EGFillePanel panelGraphe=new EGFillePanel(this.graphe); + new CtuluPopupListener(new CtuluPopupListener.PopupReceiver() { + public void popup(MouseEvent _evt) { + panelGraphe.popupMenu(_evt.getX(), _evt.getY()); + + } + },panelGraphe); + //--remplissage du menu --// panelGraphe.fillSpecificMenu(menu); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliCheckBoxNodeEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliCheckBoxNodeEditor.java 2008-08-11 14:17:51 UTC (rev 3760) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliCheckBoxNodeEditor.java 2008-08-11 18:47:40 UTC (rev 3761) @@ -3,13 +3,10 @@ import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.util.EventObject; import javax.swing.AbstractCellEditor; -import javax.swing.JCheckBox; import javax.swing.JTree; import javax.swing.event.ChangeEvent; import javax.swing.tree.DefaultMutableTreeNode; @@ -29,8 +26,11 @@ */ public class EbliCheckBoxNodeEditor extends AbstractCellEditor implements TreeCellEditor { - EbliCheckBoxTreeRenderer renderer = new EbliCheckBoxTreeRenderer(); + +private static final long serialVersionUID = 4576652808917382435L; +EbliCheckBoxTreeRenderer renderer = new EbliCheckBoxTreeRenderer(); + ChangeEvent changeEvent = null; EbliWidgetJXTree tree; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliCheckBoxTreeRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliCheckBoxTreeRenderer.java 2008-08-11 14:17:51 UTC (rev 3760) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliCheckBoxTreeRenderer.java 2008-08-11 18:47:40 UTC (rev 3761) @@ -125,7 +125,11 @@ // qccessible en fonction du tree leafRenderer.setEnabled(tree.isEnabled()); - + if(selected){ + leafRenderer.setBackground(Color.BLUE); + } + else + leafRenderer.setBackground(Color.WHITE); return leafRenderer; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |