From: <had...@us...> - 2008-09-08 18:35:11
|
Revision: 3901 http://fudaa.svn.sourceforge.net/fudaa/?rev=3901&view=rev Author: hadouxad Date: 2008-09-08 18:35:19 +0000 (Mon, 08 Sep 2008) Log Message: ----------- - ajout du menu multi-fenetre: permet d activer la fillelayout en cliquant sur son menuitem correspondant => cas ou l utilisateur ferme sa fenetre sans faire gaffe, il peut maintenant la recuperer - Ajout de l action editeur de texte en utilisant ekitcore - possibiliter de mettre: - des formules mathematiaues - gras, soulign?\195?\169,italique... - espaces, passages de lignes - ALARMA! les aligns internes ne marchent pas - REFACTORISATION: methode getWidget et setWidget dans le ebliNode - Repositionnement des widgets dans la scene: miux cal?\195?\169s , calque et sa legende - Traduction des chaines ebli et tr dans les fichiers correspondants - Gestion du cut/copy/paste: fonctionne nickel: - on peut selectionner plusieurs widgets simultanement - On peut copier/couper depuis une fillelayout vers une autre sans prob et vice-versa - Gestion de la position precedentes pour le cut/copy OK - Gestion des multi fenetre: enregistrement des liste cut/copy dans le trpostprojet - GEstion des undo/redo poru le cut/copy/paste - MULTILAYOUT ONGLET:degage des onglets scenes ainsi que des menus correspondant - MULTI LAYOUT FRAME: lors de la suppression, confirmation puis suppression - confirmation suppression - lors de la fermeture degage la reference de la fille - degage les menus d activation des frames Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 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/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerMenuOnly.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/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetSynchroniser.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandSupprimer.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeDuplicate.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionFont.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/actions/EbliWidgetActionRetaillageHorizontal.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageVertical.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/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/tree/EbliJXTreeTableCellRenderer.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetTreeTableNode.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoCut.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoPaste.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 2008-09-08 18:35:19 UTC (rev 3901) @@ -589,4 +589,23 @@ Zoom centr\xE9 sur le point cliqu\xE9=Zoom centered on the clicked point Rectangle dessin\xE9=A rectangle is drawn Zoom sur le rectangle dessin\xE9=Zoom on the drawn rectangle -Zoom arri\xE8re centr\xE9 sur le point cliqu\xE9=Zoom-back centered on the clicked point \ No newline at end of file +Zoom arri\xE8re centr\xE9 sur le point cliqu\xE9=Zoom-back centered on the clicked point +Alignement \xE0 gauche=align to left +en bas=to the bottom +Centrer verticalement=center vertically +Centrer horizontalement=Center horizontally +Alignement \xE0 droite=Align to the right +en haut=to the top +Arri\xE8re plan= Background +Bloquer les objets s\xE9lectionn\xE9s= lock the selected objects +Debloquer les objets s\xE9lectionn\xE9s=unlock the selected objects +Couleur de fond=Background color +Couleur Contour=Foreground color +Configure=Configure +dupliquer les objets s\xE9lectionn\xE9s=duplicate the selected objects +Premier plan=Foreground +Ins\xE9rer une image=Insert a picture +Editeur de texte=text editor +Double-cliquez pour \xE9diter=double click in order to edit +D\xE9grouper=Degroup +Grouper=Group \ No newline at end of file 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-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -21,6 +21,8 @@ void setPreferedLocation(Point p); + + public String toString(); /** @@ -41,4 +43,6 @@ */ public EbliWidget getWidget(); + public void setWidget(EbliWidget _widget); + } 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-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -10,7 +10,9 @@ Point preferedLocation; Dimension preferedSize; String title; - + EbliWidget nodeWidget_; + + public String getTitle() { return title; } @@ -29,14 +31,16 @@ public void setPreferedLocation(Point p) { this.preferedLocation = p; // repositionnement du widget si existant - if (hasWidget()) getCreator().getWidget().setPreferredLocation(p); + if (hasWidget()) + nodeWidget_.setPreferredLocation(p); } public void setPreferedSize(Dimension d) { this.preferedSize = d; // repositionnement du widget si existant - if (hasWidget()) getCreator().getWidget().setPreferredSize(d); + if (hasWidget()) + nodeWidget_.setPreferredSize(d); } public void setCreator(EbliWidgetCreator creator) { @@ -64,7 +68,7 @@ // } public boolean hasWidget() { - return (getCreator() != null && getCreator().getWidget() != null); + return (getCreator() != null && nodeWidget_ != null); } @@ -73,7 +77,7 @@ * @return EbliWidget */ public EbliWidget getWidget() { - return creator.getWidget(); + return nodeWidget_; } public boolean isMovable() { @@ -81,4 +85,8 @@ return (hasWidget() && getPreferedLocation() != null && getWidget().getBounds() != null); } + public void setWidget(EbliWidget _widget) { + nodeWidget_ = _widget; + } + } 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-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -133,16 +133,19 @@ protected Widget attachNodeWidget(EbliNode node) { // -- creation de la widget ici --// - EbliWidget res = node.getCreator().create(this); + node.setWidget(node.getCreator().create(this)); + + // -- remplissage des proprietes - res.setPreferredLocation(node.getPreferedLocation()); - if (node.getPreferedSize() != null) res.setPreferredSize(node.getPreferedSize()); + node.getWidget().setPreferredLocation(node.getPreferedLocation()); + if (node.getPreferedSize() != null) + node.getWidget().setPreferredSize(node.getPreferedSize()); // -- ajout dans la vue layer --// - visu_.addChild(res); + visu_.addChild(node.getWidget()); - return res; + return node.getWidget(); } /** Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -202,9 +202,9 @@ widget_.getEbliScene().addNode(duplique); // -- duplication des map de property graphique de la widget --// - duplique.getCreator().getWidget().propGraphique = n.getCreator().getWidget().duplicateGraphicalProperties(); + duplique.getWidget().propGraphique = n.getWidget().duplicateGraphicalProperties(); // -- duplication de la taille --// - duplique.getCreator().getWidget().setPreferredBounds(n.getCreator().getWidget().getPreferredBounds()); + duplique.getWidget().setPreferredBounds(n.getWidget().getPreferredBounds()); // -- ajout de la commande undo/redo --// ArrayList<EbliNode> ln = new ArrayList<EbliNode>(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerMenuOnly.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerMenuOnly.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerMenuOnly.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -10,7 +10,7 @@ public class EbliWidgetControllerMenuOnly extends EbliWidgetController { public EbliWidgetControllerMenuOnly(EbliWidget widget_) { - super(widget_); + this(widget_, true); } public EbliWidgetControllerMenuOnly(EbliWidget widget_, boolean canDuplicate) { 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-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -5,7 +5,7 @@ EbliWidget create(EbliScene _scene); // FIXME a mettre dans le EbliNode - EbliWidget getWidget(); + // EbliWidget getWidget(); /** * Duplication de l ebliNode en fonction de son creator. Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -1,5 +1,7 @@ package org.fudaa.ebli.visuallibrary; +import java.awt.Point; + import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; /** @@ -11,8 +13,10 @@ public class EbliWidgetCreatorTextEditor implements EbliWidgetCreator { CtuluHtmlEditorPanel editorPane_; - EbliWidgetTextEditor res; - + // EbliWidgetTextEditor res; + EbliWidgetBordure res; + + public EbliWidgetCreatorTextEditor(CtuluHtmlEditorPanel g) { super(); this.editorPane_ = g; @@ -28,7 +32,7 @@ public EbliWidget create(EbliScene _scene) { - res = new EbliWidgetTextEditor(_scene, getG()); + res = new EbliWidgetBordure(new EbliWidgetTextEditor(_scene, getG())); return res; } @@ -39,11 +43,25 @@ } public EbliNode duplicate(EbliNode _nodeAdupliquer) { - return null; + + EbliNode duplique = new EbliNodeDefault(); + CtuluHtmlEditorPanel editor=new CtuluHtmlEditorPanel(); + editor.setDocumentText(getG().getDocumentText()); + duplique.setCreator(new EbliWidgetCreatorTextEditor(editor)); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; } + public EbliWidgetBordure getBordure() { - return null; + return res; } - } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetSynchroniser.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetSynchroniser.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetSynchroniser.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -102,7 +102,7 @@ // -- recuperation du node associe --// EbliNode node = (EbliNode) treeNode.getUserObject(); - if (node != null && node.hasWidget() && node.getCreator().getWidget().isVisible()) { + if (node != null && node.hasWidget() && node.getWidget().isVisible()) { // -- recuperation de la popup du node et ajout a l element du tree a al @@ -111,11 +111,11 @@ // -- cas ou la widget selectionnee est la bordure, il faut recuperer // son contenant --// - if(node.getCreator().getWidget() instanceof EbliWidgetBordure){ - EbliWidgetBordure bordure = (EbliWidgetBordure) node.getCreator().getWidget(); + if (node.getWidget() instanceof EbliWidgetBordure) { + EbliWidgetBordure bordure = (EbliWidgetBordure) node.getWidget(); poppup = bordure.intern_.getController_().getPopup(); }else - poppup=node.getCreator().getWidget().getController_().getPopup(); + poppup = node.getWidget().getController_().getPopup(); poppup.show(arbre_, x, y); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetTextEditor.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -5,10 +5,13 @@ import java.awt.Rectangle; import java.util.EnumSet; +import javax.swing.JLabel; + import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; import org.netbeans.api.visual.action.ActionFactory; import org.netbeans.api.visual.action.InplaceEditorProvider; import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.widget.ComponentWidget; import org.netbeans.api.visual.widget.Widget; import com.memoire.bu.BuBorderLayout; @@ -16,45 +19,45 @@ public class EbliWidgetTextEditor extends EbliWidget implements InplaceEditorProvider<BuPanel> { - // contenu du texte - String content_ = "Double-cliquez pour \xE9diter"; + // editeur de texte CtuluHtmlEditorPanel editorPane_ = new CtuluHtmlEditorPanel(); // ComponentWidget widget; BuPanel conteneur = null; - + // LabelWidget intern_; + ComponentWidget intern_; + + JLabel contenuHTML_ = new JLabel(); + public EbliWidgetTextEditor(EbliScene scene, CtuluHtmlEditorPanel content) { - super(scene, true); + super(scene, false); editorPane_ = content; - // widget = new ComponentWidget(scene, editorPane_) { - // public void notifyStateChanged(ObjectState previousState, ObjectState - // newState) { - // - // setBorder(getScene().getLookFeel().getBorder(newState)); - // } - // }; - // - // setLayout(new FlowLayout(true, SerialAlignment.CENTER, 5)); - // addChild(widget); - // + intern_ = new ComponentWidget(scene, contenuHTML_); + + contenuHTML_.setText(content.getDocumentText()); + // -- ajout en interne du label d affichage --// + this.addChild(intern_); + // -- creation de l action pour editor --// WidgetAction editorAction = ActionFactory.createInplaceEditorAction(this); // -- ajout de l action au widget correspondant --// this.getActions().addAction(editorAction); + + setController_(new EbliWidgetControllerMenuOnly(this)); } - protected void paintWidget() { - Graphics2D g = getGraphics(); + // protected void paintWidget() { + // Graphics2D g = getGraphics(); + // + // Rectangle rec = getClientArea(); + // + // decoupeEcriture(editorPane_.getDocumentText(), g); + // } - Rectangle rec = getClientArea(); - - decoupeEcriture(editorPane_.getDocumentText(), g); - } - /** * Methode qui redessine l edition de texte proprement. * @@ -93,14 +96,16 @@ editorPane_.setSize(rec.width, rec.height); editorPane_.setPreferredSize(new Dimension(rec.width, rec.height)); conteneur.setPreferredSize(new Dimension(rec.width, rec.height)); - + conteneur.setMaximumSize(new Dimension(rec.width, rec.height)); + conteneur.setMinimumSize(new Dimension(rec.width, rec.height)); conteneur.add(editorPane_, BuBorderLayout.CENTER); conteneur.add(editorPane_.getToolBar(true), BuBorderLayout.NORTH); conteneur.add(editorPane_.getMenuBar()); } + // -- on masque l affichage du widgetcomponent --// + contenuHTML_.setText(""); - return conteneur; @@ -119,6 +124,16 @@ public void notifyClosing(org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget, BuPanel editor, boolean commit) { + + // -- mise a jour de intern avec le contenu du ekitcore --// + + contenuHTML_.setText(editorPane_.getDocumentText()); + intern_.repaint(); + intern_.revalidate(); + this.repaint(); + getEbliScene().refresh(); + // intern_.setLabel(label.getText()); + } public void notifyOpened(org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandSupprimer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandSupprimer.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandSupprimer.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -41,8 +41,7 @@ scene_.addNode(nodeSupprime_); // -- repositionnement originel de la widget --// - nodeSupprime_.getCreator().getWidget().setPreferredLocation( - nodeSupprime_.getCreator().getWidget().convertSceneToLocal(location_)); + nodeSupprime_.getWidget().setPreferredLocation(nodeSupprime_.getWidget().convertSceneToLocal(location_)); // -- raffraichissement de la scene --// scene_.refresh(); Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoCut.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoCut.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoCut.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -0,0 +1,57 @@ +package org.fudaa.ebli.visuallibrary.actions; + +import java.util.Iterator; +import java.util.Set; + +import org.fudaa.ctulu.CtuluCommand; +import org.fudaa.ebli.visuallibrary.EbliNode; + +/** + * classe de gestion des undo cut. Gere les undo/redo pour l'action ctrl+x. Pour + * l action paste, un autre undo/redo est g\xE9r\xE9 et permet de g\xE9rer les 2 cas + * copy/cut. + * + * @author Adrien Hadoux + * + * + */ +public class CommandUndoRedoCut implements CtuluCommand { + + Set<EbliNode> nodesCutted_; + + + + + public CommandUndoRedoCut(Set<EbliNode> _nodesCutted) { + super(); + nodesCutted_ = _nodesCutted; + } + + public void redo() { + for (Iterator<EbliNode> it = nodesCutted_.iterator(); it.hasNext();) { + EbliNode node = it.next(); + + // enlever les nodes de la scene + // le node existe toujours apres l'avoir enleve + node.getWidget().getEbliScene().removeNode(node); + } + nodesCutted_.iterator().next().getWidget().getEbliScene().refresh(); + + } + + public void undo() { + for (Iterator<EbliNode> it = nodesCutted_.iterator(); it.hasNext();) { + EbliNode node = it.next(); + + // enlever les nodes de la scene + // le node existe toujours apres l'avoir enleve + node.getWidget().getEbliScene().addNode(node); + } + nodesCutted_.iterator().next().getWidget().getEbliScene().refresh(); + + + } + + + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoPaste.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoPaste.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoPaste.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -0,0 +1,44 @@ +package org.fudaa.ebli.visuallibrary.actions; + +import java.util.Iterator; +import java.util.Set; + +import org.fudaa.ctulu.CtuluCommand; +import org.fudaa.ebli.visuallibrary.EbliNode; + +public class CommandUndoRedoPaste implements CtuluCommand { + + Set<EbliNode> nodesPasted_; + + public CommandUndoRedoPaste(Set<EbliNode> _nodesPasted) { + super(); + nodesPasted_ = _nodesPasted; + } + + public void redo() { + for (Iterator<EbliNode> it = nodesPasted_.iterator(); it.hasNext();) { + EbliNode node = it.next(); + + // enlever les nodes de la scene + // le node existe toujours apres l'avoir enleve + node.getWidget().getEbliScene().addNode(node); + } + nodesPasted_.iterator().next().getWidget().getEbliScene().refresh(); + + } + + public void undo() { + for (Iterator<EbliNode> it = nodesPasted_.iterator(); it.hasNext();) { + EbliNode node = it.next(); + + // enlever les nodes de la scene + // le node existe toujours apres l'avoir enleve + node.getWidget().getEbliScene().removeNode(node); + } + nodesPasted_.iterator().next().getWidget().getEbliScene().refresh(); + + } + + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeDuplicate.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeDuplicate.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeDuplicate.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -30,7 +30,7 @@ // -- redo unitaire execute pour chaque node dupliques --// for (Iterator<EbliNode> it = nodeDuplique_.iterator(); it.hasNext();) { EbliNode node = it.next(); - redo(node.getCreator().getWidget(), node); + redo(node.getWidget(), node); } } @@ -52,7 +52,7 @@ // -- redo unitaire execute pour chaque node dupliques --// for (Iterator<EbliNode> it = nodeDuplique_.iterator(); it.hasNext();) { EbliNode node = it.next(); - undo(node.getCreator().getWidget(), node); + undo(node.getWidget(), node); } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -48,9 +48,9 @@ // -- ajout au premier plan du node --// // scene_.getVisu().addChild(currentNode.getCreator().getWidget()); - currentNode.getCreator().getWidget().bringToBack(); + currentNode.getWidget().bringToBack(); - listeWidget.add(currentNode.getCreator().getWidget()); + listeWidget.add(currentNode.getWidget()); // -- rafraichissement de la scene --// scene_.refresh(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -29,7 +29,7 @@ public EbliWidgetActionBloqueOuDebloqueWidget(String name, Icon ic, String id, EbliScene _scene, boolean bloque) { super(_scene, name, ic, id); - putValue(NAME, "Duplication des \xE9lements s\xE9lectionn\xE9s"); + cmd_ = _scene.getCmdMng(); bloque_ = bloque; } @@ -67,9 +67,11 @@ if (currentNode != null && currentNode.hasWidget()) { // -- bloquage de la widget --// - if (bloque_) currentNode.getCreator().getWidget().getController_().removeActionResizeAndMove(); - else currentNode.getCreator().getWidget().getController_().replaceActionResizeAndMove(); - listeWidget.add(currentNode.getCreator().getWidget()); + if (bloque_) + currentNode.getWidget().getController_().removeActionResizeAndMove(); + else + currentNode.getWidget().getController_().replaceActionResizeAndMove(); + listeWidget.add(currentNode.getWidget()); // -- rafraichissement de la scene --// scene_.refresh(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -26,7 +26,7 @@ CtuluCommandContainer cmd_; public EbliWidgetActionColorBackground(EbliScene _scene) { - super(_scene, EbliResource.EBLI.getString("Couleur Contour"), EbliResource.EBLI.getToolIcon("couleur"), "CONTOUR"); + super(_scene, EbliResource.EBLI.getString("Couleur de fond"), EbliResource.EBLI.getToolIcon("couleur"), "CONTOUR"); cmd_ = _scene.getCmdMng(); @@ -35,7 +35,7 @@ public void actionPerformed(ActionEvent e) { // -- choix de la couleur par l utilisateur --// - Color couleur = BuColorChooser.showDialog(null, "Couleur de fond", Color.black); + Color couleur = BuColorChooser.showDialog(null, EbliResource.EBLI.getString("Couleur de fond"), Color.black); if (couleur != null) { // on met a joru les couleurs pour toutes les widgets selectionnees --// @@ -62,7 +62,7 @@ if (currentNode.hasWidget()) { - EbliWidget widget = currentNode.getCreator().getWidget(); + EbliWidget widget = currentNode.getWidget(); // -- test pour savoir si le widget gere le colorcontour --// if (widget.getColorFond() != null) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -35,7 +35,7 @@ public void actionPerformed(ActionEvent e) { // -- choix de la couleur par l utilisateur --// - Color couleur = BuColorChooser.showDialog(null, "Couleur du contour", Color.black); + Color couleur = BuColorChooser.showDialog(null, EbliResource.EBLI.getString("Couleur du contour"), Color.black); if (couleur != null) { // on met a joru les couleurs pour toutes les widgets selectionnees --// @@ -62,7 +62,7 @@ if (currentNode.hasWidget()) { - EbliWidget widget = currentNode.getCreator().getWidget(); + EbliWidget widget = currentNode.getWidget(); // -- test pour savoir si le widget gere le colorcontour --// if (widget.getColorContour() != null) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -36,7 +36,7 @@ super(_scene, EbliResource.EBLI.getString("dupliquer les objets s\xE9lectionn\xE9s"), CtuluResource.CTULU .getIcon("crystal_copier"), "DUPLICATE"); - putValue(NAME, "Duplication des \xE9lements s\xE9lectionn\xE9s"); + putValue(NAME, EbliResource.EBLI.getString("Duplication des \xE9lements s\xE9lectionn\xE9s")); cmd_ = _scene.getCmdMng(); } @@ -57,7 +57,7 @@ if (currentNode != null && currentNode.hasWidget()) { // -- duplication que si la widget est selectionnee --// - if (currentNode.getCreator().getWidget().getState().isSelected()) { + if (currentNode.getWidget().getState().isSelected()) { listeNodeADupliquer.add(currentNode); @@ -83,10 +83,9 @@ listeNouveauxNodes.add(node); // -- duplication des map de property graphique de la widget --// - node.getCreator().getWidget().setPropGraphique( - currentNode.getCreator().getWidget().duplicateGraphicalProperties()); + node.getWidget().setPropGraphique(currentNode.getWidget().duplicateGraphicalProperties()); // -- duplication de la taille --// - node.getCreator().getWidget().setPreferredBounds(currentNode.getCreator().getWidget().getPreferredBounds()); + node.getWidget().setPreferredBounds(currentNode.getWidget().getPreferredBounds()); // -- rafraichissement de la scene --// sceneDestination_.refresh(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionFont.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionFont.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionFont.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -101,7 +101,7 @@ if (currentNode.hasWidget()) { - EbliWidget widget = currentNode.getCreator().getWidget(); + EbliWidget widget = currentNode.getWidget(); // -- test pour savoir si le widget gere le colorcontour --// if (widget.getFormeFont() != null) { 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-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -45,11 +45,11 @@ if (currentNode != null && currentNode.isMovable()) { // -- ajout au premier plan du node --// - // scene_.getVisu().addChild(currentNode.getCreator().getWidget()); + // scene_.getVisu().addChild(currentNode.getWidget()); - currentNode.getCreator().getWidget().bringToFront(); + currentNode.getWidget().bringToFront(); - listeWidget.add(currentNode.getCreator().getWidget()); + listeWidget.add(currentNode.getWidget()); // -- rafraichissement de la scene --// scene_.refresh(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageHorizontal.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageHorizontal.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageHorizontal.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -59,7 +59,8 @@ // retaillables --// for (Iterator<EbliNode> it = listeNode.iterator(); it.hasNext();) { EbliNode node = it.next(); - if (node.hasWidget() && node.getCreator().getWidget().getController_().isCanResize()) listeNodeAutorises + if (node.hasWidget() && node.getWidget().getController_().isCanResize()) + listeNodeAutorises .add(node); } @@ -67,17 +68,17 @@ Iterator<EbliNode> it = listeNodeAutorises.iterator(); Rectangle tailleAresize = null; if (it.hasNext()) { - tailleAresize = it.next().getCreator().getWidget().getPreferredBounds(); + tailleAresize = it.next().getWidget().getPreferredBounds(); for (; it.hasNext();) { EbliNode currentNode = it.next(); if (typeRetaillage_ == RETAIILLAGE_MAX && currentNode.hasWidget()) { - if (tailleAresize.width < currentNode.getCreator().getWidget().getPreferredBounds().width) tailleAresize = currentNode - .getCreator().getWidget().getPreferredBounds(); + if (tailleAresize.width < currentNode.getWidget().getPreferredBounds().width) + tailleAresize = currentNode.getWidget().getPreferredBounds(); } else if (currentNode.hasWidget()) { - if (tailleAresize.width > currentNode.getCreator().getWidget().getPreferredBounds().width) tailleAresize = currentNode - .getCreator().getWidget().getPreferredBounds(); + if (tailleAresize.width > currentNode.getWidget().getPreferredBounds().width) + tailleAresize = currentNode.getWidget().getPreferredBounds(); } } } @@ -97,15 +98,15 @@ EbliNode currentNode = it2.next(); if (currentNode != null && currentNode.hasWidget()) { - listeWidget.add(currentNode.getCreator().getWidget()); - oldRectangle.add(currentNode.getCreator().getWidget().getPreferredBounds()); + listeWidget.add(currentNode.getWidget()); + oldRectangle.add(currentNode.getWidget().getPreferredBounds()); // -- retaillage --// - currentNode.getCreator().getWidget().setPreferredBounds( + currentNode.getWidget().setPreferredBounds( new Rectangle(new Dimension(tailleAresize.width, - currentNode.getCreator().getWidget().getPreferredBounds().height))); + currentNode.getWidget().getPreferredBounds().height))); - newRectangle.add(currentNode.getCreator().getWidget().getPreferredBounds()); + newRectangle.add(currentNode.getWidget().getPreferredBounds()); // -- rafraichissement de la scene --// scene_.refresh(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageVertical.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageVertical.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageVertical.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -39,10 +39,10 @@ cmd_ = _scene.getCmdMng(); if (_typeRetaillage == RETAIILLAGE_MAX) { - putValue(NAME, "Resize Vertical Max"); + putValue(NAME, EbliResource.EBLI.getString("Resize Vertical Max")); setIcon(EbliResource.EBLI.getToolIcon("aotallest")); } else { - putValue(NAME, "Resize Vertical Min"); + putValue(NAME, EbliResource.EBLI.getString("Resize Vertical Min")); setIcon(CtuluResource.CTULU.getIcon("crystal_rangerpalettes")); } @@ -60,7 +60,8 @@ // retaillables --// for (Iterator<EbliNode> it = listeNode.iterator(); it.hasNext();) { EbliNode node = it.next(); - if (node.hasWidget() && node.getCreator().getWidget().getController_().isCanResize()) listeNodeAutorises + if (node.hasWidget() && node.getWidget().getController_().isCanResize()) + listeNodeAutorises .add(node); } @@ -68,17 +69,17 @@ Iterator<EbliNode> it = listeNodeAutorises.iterator(); Rectangle tailleAresize = null; if (it.hasNext()) { - tailleAresize = it.next().getCreator().getWidget().getPreferredBounds(); + tailleAresize = it.next().getWidget().getPreferredBounds(); for (; it.hasNext();) { EbliNode currentNode = it.next(); if (typeRetaillage_ == RETAIILLAGE_MAX && currentNode.hasWidget()) { - if (tailleAresize.height < currentNode.getCreator().getWidget().getPreferredBounds().height) tailleAresize = currentNode - .getCreator().getWidget().getPreferredBounds(); + if (tailleAresize.height < currentNode.getWidget().getPreferredBounds().height) + tailleAresize = currentNode.getWidget().getPreferredBounds(); } else if (currentNode.hasWidget()) { - if (tailleAresize.height > currentNode.getCreator().getWidget().getPreferredBounds().height) tailleAresize = currentNode - .getCreator().getWidget().getPreferredBounds(); + if (tailleAresize.height > currentNode.getWidget().getPreferredBounds().height) + tailleAresize = currentNode.getWidget().getPreferredBounds(); } } } @@ -98,15 +99,15 @@ EbliNode currentNode = it2.next(); if (currentNode != null && currentNode.hasWidget()) { - listeWidget.add(currentNode.getCreator().getWidget()); - oldRectangle.add(currentNode.getCreator().getWidget().getPreferredBounds()); + listeWidget.add(currentNode.getWidget()); + oldRectangle.add(currentNode.getWidget().getPreferredBounds()); // -- retaillage --// - currentNode.getCreator().getWidget().setPreferredBounds( - new Rectangle(new Dimension(currentNode.getCreator().getWidget().getPreferredBounds().width, + currentNode.getWidget().setPreferredBounds( + new Rectangle(new Dimension(currentNode.getWidget().getPreferredBounds().width, tailleAresize.height))); - newRectangle.add(currentNode.getCreator().getWidget().getPreferredBounds()); + newRectangle.add(currentNode.getWidget().getPreferredBounds()); // -- rafraichissement de la scene --// scene_.refresh(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -20,7 +20,7 @@ public class EbliWidgetActiontextEditor extends EbliWidgetActionSimple { public EbliWidgetActiontextEditor(EbliScene _widget) { - super(_widget, EbliLib.getS("Ins\xE9rer une texte"), BuResource.BU.getIcon("crystal_fonte"), "INSERTIONTEXTE"); + super(_widget, EbliLib.getS("Editeur de texte"), BuResource.BU.getIcon("crystal_editer"), "INSERTIONTEXTE"); } @@ -29,7 +29,10 @@ // -- creation de la widget et ajout dans la scene --// EbliNodeDefault nodeText = new EbliNodeDefault(); nodeText.setTitle("Texte"); - nodeText.setCreator(new EbliWidgetCreatorTextEditor(new CtuluHtmlEditorPanel())); + CtuluHtmlEditorPanel editor = new CtuluHtmlEditorPanel(); + editor.setDocumentText(EbliLib.getS("Double-cliquez pour \xE9diter")); + + nodeText.setCreator(new EbliWidgetCreatorTextEditor(editor)); nodeText.setPreferedSize(new Dimension(200, 200)); nodeText.setPreferedLocation(new Point(270, 225)); scene_.addNode(nodeText); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -228,7 +228,7 @@ */ @Override protected void addLegendToPanel(BCalqueLegendePanel _pnLeg) { - FuLog.warning("J'ajoute un nouveau BCalqueLegendePanel dans la widget legende:" + _pnLeg); + legendePanel_ = _pnLeg; @@ -240,20 +240,12 @@ * * @return EbliNode cree ajoute a la scene. */ - public EbliNode createLegende() { + public EbliNode createLegende(Point _location) { - // legendePanel_.setVisible(true); - // legendePanel_.setSize(150, 300); - // legendePanel_.setPreferredSize(new Dimension(150, 300)); - // legendePanel_.setMinimumSize(new Dimension(150, 300)); - // - // // EbliWidgetCreatorLegende creator = new - // // EbliWidgetCreatorLegende(legendePanel_); - // // legendePanel_.setDoubleBuffered(false); - // // BuLib.setDoubleBuffered(legendePanel_, false); + EbliNodeDefault def = new EbliNodeDefault(); - def.setPreferedLocation(new Point(200, 200)); + def.setPreferedLocation(_location); // def.setPreferedSize(new Dimension(150, 250)); def.setCreator(new EbliWidgetCreatorLegende(legendePanel_)); def.setTitle("L\xE9gende calque"); 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-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -25,6 +25,7 @@ import org.fudaa.ebli.commun.EbliComponentFactory; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BSelecteurListComboBox; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly; @@ -96,7 +97,7 @@ protected void constructMenuMasquer(JPopupMenu _popup, final CtuluCommandContainer cmd_) { - JMenuItem menuItem = _popup.add("Masquer l'objet"); + JMenuItem menuItem = _popup.add(EbliResource.EBLI.getString("Masquer l'objet")); menuItem.setIcon(CtuluResource.CTULU.getIcon("crystal_visibilite")); menuItem.addActionListener(new ActionListener() { @@ -127,8 +128,8 @@ widgetCalque_.nodeLegende.getCreator().getBordure().setVisible(false); widgetUndo2 = widgetCalque_.nodeLegende.getCreator().getBordure(); } else { - widgetCalque_.nodeLegende.getCreator().getWidget().setVisible(false); - widgetUndo2 = widgetCalque_.nodeLegende.getCreator().getWidget(); + widgetCalque_.nodeLegende.getWidget().setVisible(false); + widgetUndo2 = widgetCalque_.nodeLegende.getWidget(); } @@ -164,7 +165,7 @@ } private void constructPopupMenuSpecifique(JPopupMenu _popup) { - JMenuItem menuItem = _popup.add("Ajouter la l\xE9gende"); + JMenuItem menuItem = _popup.add(EbliResource.EBLI.getString("Ajouter la l\xE9gende")); menuItem.setIcon(CtuluResource.CTULU.getIcon("crystal_commentaire")); menuItem.addActionListener(new ActionListener() { @@ -191,12 +192,16 @@ legendeWidget_ = (CalqueLegendeWidgetAdapter) widgetCalque_.calquePanel_.getCqLegend(); } // -- creation de la legende - setNodeLegende(legendeWidget_.createLegende()); - + Point positionLegende = new Point(); + if (widget_.getBounds() != null && widget_.getPreferredLocation() != null) { + positionLegende.x = widget_.getPreferredLocation().x + widget_.getBounds().width + 20; + positionLegende.y = widget_.getPreferredLocation().y; + setNodeLegende(legendeWidget_.createLegende(positionLegende)); + } widget_.getEbliScene().refresh(); } else if (getNodeLegende().hasWidget()) // -- cas ou la legende existe mais est cach\xE9e --// - getNodeLegende().getCreator().getWidget().setVisible(true); + getNodeLegende().getWidget().setVisible(true); // GrapheWidget.this.addChild(widgetLegende); } 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-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -87,8 +87,8 @@ widgetGraphe_.getNodeLegende().getCreator().getBordure().setVisible(false); widgetUndo2 = widgetGraphe_.getNodeLegende().getCreator().getBordure(); } else { - widgetGraphe_.getNodeLegende().getCreator().getWidget().setVisible(false); - widgetUndo2 = widgetGraphe_.getNodeLegende().getCreator().getWidget(); + widgetGraphe_.getNodeLegende().getWidget().setVisible(false); + widgetUndo2 = widgetGraphe_.getNodeLegende().getWidget(); } // -- creation des comamndes undo/redo pour le masquage --// @@ -170,7 +170,7 @@ widget_.getEbliScene().addNode(widgetGraphe_.getNodeLegende()); widgetGraphe_.getNodeLegende().setPreferedSize( - widgetGraphe_.getNodeLegende().getCreator().getWidget() + widgetGraphe_.getNodeLegende().getWidget() .getPreferredSize()); //widgetLegende=WidgetLegendeManager.createLegende(EbliWidgetGraphe. // this.getGraphe(), @@ -178,7 +178,7 @@ widget_.getEbliScene().refresh(); } else if (widgetGraphe_.getNodeLegende().hasWidget()) { // -- cas ou la legende est masquee --// - widgetGraphe_.getNodeLegende().getCreator().getWidget().setVisible(true); + widgetGraphe_.getNodeLegende().getWidget().setVisible(true); } // GrapheWidget.this.addChild(widgetLegende); 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-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -73,6 +73,7 @@ super(scene); panelGraphe_ = _pn; panelGraphe_.setBorder(null); + // FIXME panelGraphe_.remove(CtuluLibSwing.findChildByName(panelGraphe_, "lbTools")); panelGraphe_.getGraphe().getModel().addModelListener(this); @@ -92,7 +93,17 @@ public BufferedImage getImageGraphe() { return imageGraphe; } + + @Override + protected void notifyAdded() { + super.notifyAdded(); + } + @Override + protected void notifyRemoved() { + super.notifyRemoved(); + } + protected void paintWidget() { Rectangle rec = getClientArea(); Graphics2D g = getGraphics(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliJXTreeTableCellRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliJXTreeTableCellRenderer.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliJXTreeTableCellRenderer.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -2,16 +2,9 @@ import java.awt.Color; import java.awt.Component; -import java.awt.Font; import javax.swing.Icon; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JPanel; import javax.swing.JTree; -import javax.swing.UIManager; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeCellRenderer; import org.fudaa.ctulu.CtuluResource; @@ -19,10 +12,7 @@ import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode; -import com.memoire.bu.BuCheckBox; import com.memoire.bu.BuLabel; -import com.memoire.bu.BuPanel; -import com.sun.org.apache.xerces.internal.impl.xs.opti.DefaultNode; /** * Treecell renderer pour l arbre des calques de visualllibrary. * gere uniquement l affichage des icones optimises. @@ -75,13 +65,13 @@ - if(node.getCreator().getWidget().isVisible()) + if (node.getWidget().isVisible()) returnLabel.setIcon(iconLeafEnabled);//=new BuLabel(this.iconLeafEnabled); else returnLabel.setIcon(iconLeafDisabled);//returnLabel=new BuLabel(this.iconLeafDisabled); - returnLabel.setEnabled(node.getCreator().getWidget().isVisible()); + returnLabel.setEnabled(node.getWidget().isVisible()); } } /*else if (!leaf && !((DefaultMutableTreeTableNode) value).isRoot()) { @@ -97,74 +87,60 @@ return returnLabel; } - - - - - - /* - public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, - boolean leaf, int row, boolean hasFocus) { - - BuLabel returnLabel = null; - BuCheckBox returnValue = null; - // cas particulier renderer: on met un checkbox que si on est feuille et pqs root (= cqs ou lqyer depourvu d objet graphique) - if (leaf && !((DefaultMutableTreeNode) value).isRoot()) { - - // -- recuperation du node --// - Object userObject = ((DefaultMutableTreeNode) value).getUserObject(); - - EbliNodeDefault node = null; - if (userObject instanceof EbliNode) { - node = (EbliNodeDefault) (((DefaultMutableTreeNode) value).getUserObject()); - - //System.err.println("c est un EbliNode!!! ROW: " + row); - - // -- creation d'une nouvelle checkbox aui sera ainsi unique pour chaque - // composant - returnValue=new BuCheckBox(); - //leafRenderer.setOpaque(false); - - returnValue.setText(node.getTitle()); - returnValue.setSelected(node.getCreator().getWidget().isVisible()); - - - returnLabel=new BuLabel(this.iconLeafEnabled); - - - - returnLabel.setEnabled(node.getCreator().getWidget().isVisible()); - } - - } else { - returnLabel=new BuLabel(((DefaultMutableTreeNode) value).toString(),this.iconRoot); - //returnValue = nonLeafRenderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); - - } - + /* + * public Component getTreeCellRendererComponent(JTree tree, Object value, + * boolean selected, boolean expanded, boolean leaf, int row, boolean + * hasFocus) { + * + * + * BuLabel returnLabel = null; BuCheckBox returnValue = null; // cas + * particulier renderer: on met un checkbox que si on est feuille et pqs root + * (= cqs ou lqyer depourvu d objet graphique) if (leaf && + * !((DefaultMutableTreeNode) value).isRoot()) { + * + * // -- recuperation du node --// Object userObject = + * ((DefaultMutableTreeNode) value).getUserObject(); + * + * EbliNodeDefault node = null; if (userObject instanceof EbliNode) { node = + * (EbliNodeDefault) (((DefaultMutableTreeNode) value).getUserObject()); + * + * //System.err.println("c est un EbliNode!!! ROW: " + row); + * + * // -- creation d'une nouvelle checkbox aui sera ainsi unique pour chaque // + * composant returnValue=new BuCheckBox(); //leafRenderer.setOpaque(false); + * + * returnValue.setText(node.getTitle()); + * returnValue.setSelected(node.getWidget().isVisible()); + * + * + * returnLabel=new BuLabel(this.iconLeafEnabled); + * + * + * + * returnLabel.setEnabled(node.getWidget().isVisible()); } + * + * } else { returnLabel=new BuLabel(((DefaultMutableTreeNode) + * value).toString(),this.iconRoot); //returnValue = + * nonLeafRenderer.getTreeCellRendererComponent(tree, value, selected, + * expanded, leaf, row, hasFocus); + * + * } + * + * + * //-- creation du panel avec les informations --// leafRenderer=new + * EbliCheckBoxPanel(); + * + * if(returnLabel!=null) leafRenderer.labelRenderer=returnLabel; + * + * if(returnValue!=null ) leafRenderer.checkBox=returnValue; + * + * //-- construction du composant --// leafRenderer.construct(); + * + * // qccessible en fonction du tree + * leafRenderer.setEnabled(tree.isEnabled()); if(selected){ + * leafRenderer.setBackground(Color.BLUE); } else + * leafRenderer.setBackground(Color.WHITE); return leafRenderer; } + */ - //-- creation du panel avec les informations --// - leafRenderer=new EbliCheckBoxPanel(); - - if(returnLabel!=null) - leafRenderer.labelRenderer=returnLabel; - - if(returnValue!=null ) - leafRenderer.checkBox=returnValue; - - //-- construction du composant --// - leafRenderer.construct(); - - // qccessible en fonction du tree - leafRenderer.setEnabled(tree.isEnabled()); - if(selected){ - leafRenderer.setBackground(Color.BLUE); - } - else - leafRenderer.setBackground(Color.WHITE); - return leafRenderer; - } -*/ - } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetTreeTableNode.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetTreeTableNode.java 2008-09-08 18:34:13 UTC (rev 3900) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetTreeTableNode.java 2008-09-08 18:35:19 UTC (rev 3901) @@ -68,7 +68,7 @@ if (_column == 1) { return ((EbliNodeDefault) getUserObject()).getTitle(); } - return Boolean.valueOf(((EbliNodeDefault) getUserObject()).getCreator().getWidget().isVisible()); + return Boolean.valueOf(((EbliNodeDefault) getUserObject()).getWidget().isVisible()); } @Override @@ -83,32 +83,32 @@ ((EbliNode) getUserObject()).setTitle((String) _value); else if (_column == 2) { // -- mise a jour du masquage --// - ((EbliNode) getUserObject()).getCreator().getWidget().setVisible(((Boolean) _value).booleanValue()); + ((EbliNode) getUserObject()).getWidget().setVisible(((Boolean) _value).booleanValue()); // -- reference vers le gestionnaire de commandeundo/redo --// - final CtuluCommandContainer cmd_ = ((EbliNode) getUserObject()).getCreator().getWidget().getEbliScene() + final CtuluCommandContainer cmd_ = ((EbliNode) getUserObject()).getWidget().getEbliScene() .getCmdMng(); ArrayList<EbliWidget> listeWidgetUndo = new ArrayList<EbliWidget>(); - listeWidgetUndo.add(((EbliNode) getUserObject()).getCreator().getWidget()); + listeWidgetUndo.add(((EbliNode) getUserObject()).getWidget()); // -- cas particulier si il s agit d un calque ou d un graphe, on masque // les sous fils --// - if ((((EbliNode) getUserObject()).getCreator().getWidget()) instanceof EbliWidgetBordure - && (((EbliNode) getUserObject()).getCreator().getWidget()).getChildren() != null) { + if ((((EbliNode) getUserObject()).getWidget()) instanceof EbliWidgetBordure + && (((EbliNode) getUserObject()).getWidget()).getChildren() != null) { - if ((((EbliNode) getUserObject()).getCreator().getWidget()).getChildren().get(0) instanceof EbliWidgetVueCalque) { - EbliWidgetVueCalque wid = (EbliWidgetVueCalque) (((EbliNode) getUserObject()).getCreator().getWidget()) + if ((((EbliNode) getUserObject()).getWidget()).getChildren().get(0) instanceof EbliWidgetVueCalque) { + EbliWidgetVueCalque wid = (EbliWidgetVueCalque) (((EbliNode) getUserObject()).getWidget()) .getChildren().get(0); - wid.nodeLegende.getCreator().getWidget().setVisible(((Boolean) _value).booleanValue()); - listeWidgetUndo.add(wid.nodeLegende.getCreator().getWidget()); + wid.nodeLegende.getWidget().setVisible(((Boolean) _value).booleanValue()); + listeWidgetUndo.add(wid.nodeLegende.getWidget()); } else - if ((((EbliNode) getUserObject()).getCreator().getWidget()).getChildren().get(0) instanceof EbliWidgetGraphe) { - EbliWidgetGraphe wid = (EbliWidgetGraphe) (((EbliNode) getUserObject()).getCreator().getWidget()).getChildren().get(0); - wid.getNodeLegende().getCreator().getWidget().setVisible(((Boolean) _value).booleanValue()); - listeWidgetUndo.add(wid.getNodeLegende().getCreator... [truncated message content] |