From: <had...@us...> - 2008-08-07 13:56:07
|
Revision: 3725 http://fudaa.svn.sourceforge.net/fudaa/?rev=3725&view=rev Author: hadouxad Date: 2008-08-07 13:56:12 +0000 (Thu, 07 Aug 2008) Log Message: ----------- AFFECT?\195?\137 - # 40: L?\195?\169gende pour les courbe 1d http://mantis.genesis-groupe.com//view.php?id=40 - les widget fleches directionnelle et bi directionnelle (a ameliorer) - les classes modeles et tree - les methodes de gestion des listener eblinodelistener pour la scene - la classe exemple testGraphe - exemple testgraphe pour voir le fonctionnement du lien tree scene Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorRectangle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorVue2d.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeListener.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetDBLFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTree.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTreeModel.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java 2008-08-06 22:00:30 UTC (rev 3724) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -14,5 +14,7 @@ EbliNode duplicate(Map options); Point getLocation(); + + public String toString(); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-08-06 22:00:30 UTC (rev 3724) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -5,6 +5,8 @@ import java.util.Map; public class EbliNodeDefault implements EbliNode { + + EbliWidgetCreator creator; Point p; Dimension d; @@ -52,5 +54,10 @@ // TODO Auto-generated method stub return d; } + + public String toString() { + // TODO Auto-generated method stub + return title; + } } Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeListener.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeListener.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeListener.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -0,0 +1,9 @@ +package org.fudaa.ebli.visuallibrary; + +public interface EbliNodeListener { + + void nodeAdded(EbliNode node); + + void noderemoved(EbliNode node); + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeListener.java ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-08-06 22:00:30 UTC (rev 3724) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -4,6 +4,10 @@ import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; import javax.swing.JComponent; import javax.swing.JMenuItem; @@ -33,6 +37,12 @@ */ private LayerWidget visu_; + + /** + * la liste des listener associes a la scene + */ + List<EbliNodeListener> listenerList ; + public EbliScene() { super(); @@ -45,6 +55,7 @@ // -- ajouter le menu popup de base setMenuBase(); + } @@ -58,7 +69,8 @@ @Override protected void notifyNodeAdded(EbliNode node, Widget widget) { - // node.widgetCreated((EbliWidget)widget); + //-- notifier tous les listener que le noeud a ete attache --// + notifyAllListenerNodeAdded(node); } @Override @@ -94,6 +106,8 @@ // -- ajout dans la vue layer --// visu_.addChild(res); + + return res; } @@ -181,5 +195,49 @@ } })); } + + + /** + * Methode qui permet d ajouter un listener + * @param listener + */ + public void addEbliNodeListener(EbliNodeListener listener){ + // init si necessaire + if(listenerList==null) + listenerList= new ArrayList<EbliNodeListener>(); + //ajout + listenerList.add(listener); + } + /** + * Methode qui permet d envoyer le signal du node ajout\xE9 a tous les listener + * @param listener + */ + public void notifyAllListenerNodeAdded(EbliNode node){ + if(listenerList==null) + return; + + for(Iterator<EbliNodeListener> it=listenerList.iterator();it.hasNext();){ + EbliNodeListener listener=it.next(); + listener.nodeAdded(node); + } + + } + + /** + * Methode qui permet d envoyer le signal du node retir\xE9 a tous les listener + * @param listener + */ + public void notifyAllListenerNodeRemoved(EbliNode node){ + if(listenerList==null) + return; + + for(Iterator<EbliNodeListener> it=listenerList.iterator();it.hasNext();){ + EbliNodeListener listener=it.next(); + listener.noderemoved(node); + } + + } + + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-08-06 22:00:30 UTC (rev 3724) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -5,6 +5,8 @@ EbliWidget create(EbliScene _scene); + EbliWidget getWidget(); + // void widgetCreated(EbliWidget w); //void nodeRemoved(); Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -0,0 +1,36 @@ +package org.fudaa.ebli.visuallibrary; + +public class EbliWidgetCreatorDblFleche implements EbliWidgetCreator { + + + int orientation; + + EbliWidgetDBLFleche res; + + public EbliWidgetCreatorDblFleche(int orientation) { + super(); + this.orientation = orientation; + + } + + public int getG() { + return orientation; + } + + public void setG(int orientation) { + this.orientation = orientation; + } + + public EbliWidget create(EbliScene _scene) { + res= new EbliWidgetDBLFleche(_scene, orientation); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -0,0 +1,34 @@ +package org.fudaa.ebli.visuallibrary; + +public class EbliWidgetCreatorFleche implements EbliWidgetCreator { + + int orientation; + + EbliWidgetFleche res; + + public EbliWidgetCreatorFleche(int orientation) { + super(); + this.orientation = orientation; + + } + + public int getG() { + return orientation; + } + + public void setG(int orientation) { + this.orientation = orientation; + } + + public EbliWidget create(EbliScene _scene) { + res= new EbliWidgetFleche(_scene, orientation); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorGraphe.java 2008-08-06 22:00:30 UTC (rev 3724) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorGraphe.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -9,6 +9,7 @@ public class EbliWidgetCreatorGraphe implements EbliWidgetCreator { EGGraphe g; + EbliWidgetGraphe res; public EbliWidgetCreatorGraphe(EGGraphe g) { super(); @@ -18,7 +19,7 @@ public EbliWidget create(EbliScene _scene) { // TODO Auto-generated method stub // creation de la widget correspondante - EbliWidgetGraphe res= new EbliWidgetGraphe(_scene, null, g); + res= new EbliWidgetGraphe(_scene, null, g); // ajout des listener d ecoute du graphe new EbliWidgetGrapheController(res); @@ -26,5 +27,10 @@ return res; } + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorLegende.java 2008-08-06 22:00:30 UTC (rev 3724) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorLegende.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -5,7 +5,7 @@ public class EbliWidgetCreatorLegende implements EbliWidgetCreator { EGGraphe g; - + EbliWidget res; public EbliWidgetCreatorLegende(EGGraphe g) { super(); this.g = g; @@ -20,7 +20,13 @@ } public EbliWidget create(EbliScene _scene) { - return WidgetLegendeManager.createLegende(g, _scene, null); + res= WidgetLegendeManager.createLegende(g, _scene, null); + return res; } + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorRectangle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorRectangle.java 2008-08-06 22:00:30 UTC (rev 3724) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorRectangle.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -6,7 +6,8 @@ public class EbliWidgetCreatorRectangle implements EbliWidgetCreator { String label_; - + EbliWidgetRectangle res; + public EbliWidgetCreatorRectangle(String g) { super(); this.label_ = g; @@ -21,9 +22,14 @@ } public EbliWidget create(EbliScene _scene) { - EbliWidgetRectangle res= new EbliWidgetRectangle(_scene, getG()); + res= new EbliWidgetRectangle(_scene, getG()); return res; } + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorVue2d.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorVue2d.java 2008-08-06 22:00:30 UTC (rev 3724) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorVue2d.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -6,14 +6,21 @@ public class EbliWidgetCreatorVue2d implements EbliWidgetCreator { ZEbliCalquesPanel calque; - + EbliWidgetVue2D res; + public EbliWidgetCreatorVue2d(ZEbliCalquesPanel calque) { super(); this.calque = calque; } public EbliWidget create(EbliScene _scene) { - return new EbliWidgetVue2D(_scene, calque); + res= new EbliWidgetVue2D(_scene, calque); + return res; } + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + } Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetDBLFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetDBLFleche.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetDBLFleche.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -0,0 +1,112 @@ +package org.fudaa.ebli.visuallibrary; + + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.geom.GeneralPath; +import java.util.ArrayList; + +import org.fudaa.ebli.courbe.EGCourbe; +import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceIconModel; +import org.fudaa.ebli.trace.TraceLigne; +import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.action.ConnectProvider; +import org.netbeans.api.visual.action.TextFieldInplaceEditor; +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.anchor.AnchorFactory; +import org.netbeans.api.visual.anchor.AnchorShape; +import org.netbeans.api.visual.anchor.AnchorShapeFactory; +import org.netbeans.api.visual.layout.LayoutFactory.SerialAlignment; +import org.netbeans.api.visual.widget.ConnectionWidget; +import org.netbeans.api.visual.widget.LabelWidget; +import org.netbeans.api.visual.widget.Scene; +import org.netbeans.api.visual.widget.Widget; +import org.netbeans.api.visual.widget.LabelWidget.VerticalAlignment; +import org.netbeans.modules.visual.layout.FlowLayout; +import org.netbeans.modules.visual.layout.OverlayLayout; + +/** + * Legende Widget qui permet de construire une fleche double + * + * @author Adrien Hadoux + * + */ +public class EbliWidgetDBLFleche extends EbliWidget { + + + Insets inGaps_; + int largeurFleche = 15; + + public final static int ORIENTATION_NORTH=0; + public final static int ORIENTATION_SOUTH=1; + public final static int ORIENTATION_EAST=2; + public final static int ORIENTATION_WEST=3; + public final static int ORIENTATION_DIAG1=4; + public final static int ORIENTATION_DIAG2=5; + public final static int ORIENTATION_DIAG3=6; + public final static int ORIENTATION_DIAG4=7; + + + Point positionInit; + Point positionDest; + + ConnectionWidget shapeWidget; + AnchorShape shape; + + /** + * @param _scene + */ + public EbliWidgetDBLFleche(EbliScene _scene, int orientation) { + super(_scene); + + + //-- creation de la fleche --// + shapeWidget = new ConnectionWidget (_scene); + shape = AnchorShapeFactory.createTriangleAnchorShape(largeurFleche, true, false, 0); + //shape = AnchorShapeFactory.createArrowAnchorShape(45, 17); + + determinePosition(orientation); + + + shapeWidget.setSourceAnchor (AnchorFactory.createFixedAnchor(positionInit)); + shapeWidget.setTargetAnchor (AnchorFactory.createFixedAnchor(positionDest)); + shapeWidget.setSourceAnchorShape (shape); + shapeWidget.setTargetAnchorShape (shape); + addChild(shapeWidget); + + } + + + + + public void determinePosition(int orientation){ + positionInit=new Point(); + positionDest=new Point(); + + switch(orientation){ + case ORIENTATION_NORTH: positionInit.x=25;positionInit.y=0;positionDest.x=25;positionDest.y=50;break; + case ORIENTATION_SOUTH: positionInit.x=25;positionInit.y=0;positionDest.x=25;positionDest.y=50;break; + case ORIENTATION_WEST: positionInit.x=0;positionInit.y=25;positionDest.x=50;positionDest.y=25;break; + case ORIENTATION_EAST: positionInit.x=0;positionInit.y=25;positionDest.x=50;positionDest.y=25;break; + case ORIENTATION_DIAG1: positionInit.x=0;positionInit.y=0;positionDest.x=50;positionDest.y=50;break; + case ORIENTATION_DIAG2: positionInit.x=0;positionInit.y=0;positionDest.x=50;positionDest.y=50;break; + case ORIENTATION_DIAG3: positionInit.x=0;positionInit.y=50;positionDest.x=50;positionDest.y=50;break; + case ORIENTATION_DIAG4: positionInit.x=0;positionInit.y=50;positionDest.x=50;positionDest.y=0;break; + + } + } + + + + + + + + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetDBLFleche.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFleche.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFleche.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -0,0 +1,113 @@ +package org.fudaa.ebli.visuallibrary; + + + + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Polygon; +import java.awt.Rectangle; +import java.awt.geom.GeneralPath; +import java.util.ArrayList; + +import org.fudaa.ebli.courbe.EGCourbe; +import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceIconModel; +import org.fudaa.ebli.trace.TraceLigne; +import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.action.ConnectProvider; +import org.netbeans.api.visual.action.TextFieldInplaceEditor; +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.anchor.AnchorFactory; +import org.netbeans.api.visual.anchor.AnchorShape; +import org.netbeans.api.visual.anchor.AnchorShapeFactory; +import org.netbeans.api.visual.layout.LayoutFactory.SerialAlignment; +import org.netbeans.api.visual.widget.ConnectionWidget; +import org.netbeans.api.visual.widget.LabelWidget; +import org.netbeans.api.visual.widget.Scene; +import org.netbeans.api.visual.widget.Widget; +import org.netbeans.api.visual.widget.LabelWidget.VerticalAlignment; +import org.netbeans.modules.visual.layout.FlowLayout; +import org.netbeans.modules.visual.layout.OverlayLayout; + +/** + * Legende Widget qui permet de construire une fleche + * + * @author Adrien Hadoux + * + */ +public class EbliWidgetFleche extends EbliWidget { + + + Insets inGaps_; + int largeurBorder = 15; + int espaceInterieur = 5; + public static int ORIENTATION_NORTH=0; + public static int ORIENTATION_SOUTH=1; + public static int ORIENTATION_EAST=2; + public static int ORIENTATION_WEST=3; + + + + /** + * @param _scene + */ + public EbliWidgetFleche(EbliScene _scene, int orientation) { + super(_scene); + inGaps_ = new Insets(largeurBorder + espaceInterieur, largeurBorder + + espaceInterieur, largeurBorder + espaceInterieur, + largeurBorder + espaceInterieur); + // Ce layout permet de placer le texte + + setLayout(new OverlayLayoutGap(inGaps_)); + + + + } + + + + + /*protected Rectangle calculateClientArea() { + Rectangle res = this.getPreferredBounds(); + // TODO Auto-generated method stub + return new Rectangle(0, 0, 2 * (largeurBorder + espaceInterieur) + + res.width, 2 * (largeurBorder + espaceInterieur) + res.height); + }*/ + + protected void paintWidget() { + Graphics2D g = getGraphics(); + + Rectangle rec = getClientArea(); + g.translate(rec.x, rec.y); + // la ligne + + TraceLigne l = new TraceLigne(); + + l.setEpaisseur(largeurBorder); + + + //FIXME prob fleche pas tres jolie + l.dessineFleche(g,(int)( l.getEpaisseur() / 2),(int)( rec.height/2), (int)(rec.width-l.getEpaisseur()/2), (int)(rec.height/2)); + + + + + + g.translate(-rec.x, -rec.y); + + + + + } + + + + + + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFleche.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTree.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTree.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTree.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -0,0 +1,40 @@ +package org.fudaa.ebli.visuallibrary; + +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_; + + + + public EbliWidgetJXTree(EbliWidgetJXTreeModel newModel) { + super(newModel.getModeleTree()); + // TODO Auto-generated constructor stub + model_=newModel; + + //-- selection unique des elments du + + } + + public EbliWidgetJXTreeModel getModel_() { + return model_; + } + + public void setModel_(EbliWidgetJXTreeModel model_) { + this.model_ = model_; + } + + public void valueChanged(TreeSelectionEvent e) { + // TODO Auto-generated method stub + + } + + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTree.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTreeModel.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTreeModel.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -0,0 +1,111 @@ +package org.fudaa.ebli.visuallibrary; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import javax.swing.event.TreeModelListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.MutableTreeNode; +import javax.swing.tree.TreeModel; +import javax.swing.tree.TreePath; + + +/** + * Modele du Jxtree: + * contient l'ensemble des infos du tree + * les infos sont des node referencant les widgets + * @author Adrien Hadoux + * + */ +public class EbliWidgetJXTreeModel implements EbliNodeListener{ + +public static String NAMELAYER="Layer"; + +//-- noeud aui se trouve au sommet --// +DefaultMutableTreeNode nodeRoot_; + +//-- modele du tree --// +DefaultTreeModel modeleTree; + +//-- scene principale pour recuperer la liste des noeuds --// +//EbliScene scene; + +public EbliWidgetJXTreeModel(int numLayer/*, EbliScene scene*/) { + + // TODO Auto-generated constructor stub + + nodeRoot_=new DefaultMutableTreeNode(NAMELAYER+numLayer); + + //this.scene=scene; + + //-- construction de la hierarchie des nodes a partir des nodes de la scene --// + //constructModelNode(); + + + modeleTree=new DefaultTreeModel(nodeRoot_); +} + + +public DefaultTreeModel getModeleTree() { + return modeleTree; +} + + +public void setModeleTree(DefaultTreeModel modeleTree) { + this.modeleTree = modeleTree; +} + + +public void setNodeRoot_(DefaultMutableTreeNode nodeRoot_) { + this.nodeRoot_ = nodeRoot_; +} + + +/** + * methode qui construit la hierarchie des nodes a partir de la scene + */ +/* + public DefaultMutableTreeNode constructModelNode(){ + + //-- recuperation de la liste des nodes de scene --// + ArrayList<EbliNode> listeNodes=new ArrayList<EbliNode>(scene.getNodes()); + + for(Iterator<EbliNode> it=listeNodes.iterator();it.hasNext();){ + //-- pqr lq suite on pourra faire un test si le noeud est sous element, par exemple la legende par rapport au graphe --// + EbliNode node=it.next(); + nodeRoot_.add(new DefaultMutableTreeNode(node)); + } + return nodeRoot_; + } +*/ + +public DefaultMutableTreeNode getNodeRoot_() { + return nodeRoot_; +} + +public void addNode(EbliNode node){ +nodeRoot_.add(new DefaultMutableTreeNode(node)); + +//-- rafraichissement du modele --// +modeleTree.reload(); + +} + + +public void nodeAdded(EbliNode node) { + addNode(node); + + +} + + +public void noderemoved(EbliNode node) { + // TODO Auto-generated method stub + +} + + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetJXTreeModel.java ___________________________________________________________________ Added: svn:mime-type + text/plain 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-06 22:00:30 UTC (rev 3724) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java 2008-08-07 13:56:12 UTC (rev 3725) @@ -45,11 +45,15 @@ + espaceInterieur, largeurBorder + espaceInterieur, largeurBorder + espaceInterieur); // Ce layout permet de placer le texte + setLayout(new OverlayLayoutGap(inGaps_)); + intern = new LabelWidget(_scene); intern.setVerticalAlignment(VerticalAlignment.CENTER); + intern.setLabel(label); - + + //-- layout du texte --// addChild(intern); // -- ajouter l option de remplacer le text dans le label --// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |