|
From: <had...@us...> - 2008-08-29 17:05:39
|
Revision: 3853
http://fudaa.svn.sourceforge.net/fudaa/?rev=3853&view=rev
Author: hadouxad
Date: 2008-08-29 17:05:47 +0000 (Fri, 29 Aug 2008)
Log Message:
-----------
- synchronisation graphe/tree ok
- WidgetBordure: surcharge de get et setProperty:
les proprietes graphiques autre que le ligneModel et le contour sont envoyes a son widget conteneur, lui ne gete que le cadre.
- Personalisation propre de la widget text grace a precedent
- Personalisation propre des widget legende
-les l?\195?\169gendes sont retaill?\195?\169es automatiqument que si on change leur font
- pour les legendes calques, les icones sont retailles pa rapport a la taille de la fonte
- gestion undo sur la font des legendes
- BUG lorsque la police depasse 20
- proposer le popupmenu dans l'arbre des widgets.
- la popup du widget est recuperee et est affichee au niveau de l arbre demand?\195?\169
- synchronisation ok
- Resolution du bug d'affichage pour tree des differents widget selectionnees
l affichage est propre et les composant bien raffraichis
- le bouton de la satelliteview est vir?\195?\169
- il est plac?\195?\169 dans le scrollpaneSlector, un clic dessus ouvre la vue satelite.
- la vue sattellite par defaut n est pas visible il faudra cliquer sur le bouton pour l afficher
-ajoute d'une action permettant d'interdire le d?\195?\169placement et le retaillage. Cette action, devra virer les 2
actions correspondante de la widget. (design pattern template pour gerer les 2 actions)
- l action inverse a ete cree
- les comandes undo/redo sur ces actions ont ete realisees
Modified Paths:
--------------
branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuMainPanel.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/EbliWidget.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordure.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/EbliWidgetSynchroniser.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeUndoRedoGraphicalProperties.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/EbliWidgetEditCreator.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/WidgetConfigure.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetPlageTitle.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetTitle.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManager.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java
Added Paths:
-----------
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoBloque.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/calque/EbliWidgetControllerLegendeCalque.java
Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuMainPanel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuMainPanel.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuMainPanel.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -30,6 +30,9 @@
protected BuSplit3Pane splitpane_;
private BuColumn leftcolumn_;
private BuColumn rightcolumn_;
+ private BuScrollPane scrollDesktop_;
+
+
private boolean swapped_ ;
public BuMainPanel() {
@@ -41,6 +44,14 @@
}
+ public BuScrollPane getScrollDesktop_() {
+ return scrollDesktop_;
+ }
+
+ public void setScrollDesktop_(BuScrollPane scrollDesktop_) {
+ this.scrollDesktop_ = scrollDesktop_;
+ }
+
public BuMainPanel(JComponent _middle, boolean _useScroll) {
super();
@@ -70,10 +81,10 @@
if (middle instanceof BuDesktop) {
desktop_ = (BuDesktop) middle;
if (!desktop_.isTabbed() && _useScroll) {
- BuScrollPane sp = new BuScrollPane(desktop_);
- sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
- sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
- middle = sp;
+ scrollDesktop_ = new BuScrollPane(desktop_);
+ scrollDesktop_.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ scrollDesktop_.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+ middle = scrollDesktop_;
}
}
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-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -55,7 +55,7 @@
}
final private WidgetAction alignWithMoveAction;
-
+ final private WidgetAction alignWithResizeAction;
/**
* Le gestionnaire de commande associe \xE0 la scene
*/
@@ -88,6 +88,10 @@
alignWithMoveAction = ActionFactory.createAlignWithMoveAction(visu_, interactionLayer_, ActionFactory
.createDefaultAlignWithMoveDecorator(), false);
+
+ alignWithResizeAction = ActionFactory.createAlignWithResizeAction(visu_, interactionLayer_, ActionFactory
+ .createDefaultAlignWithMoveDecorator(), false);
+
rectangularSelection_=ActionFactory.createRectangularSelectAction(this, interactionLayer_);
// -- ajoute l'action du zoom ( ctrl + clic)
getActions().addAction(ActionFactory.createCenteredZoomAction(1.1));
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -30,9 +30,17 @@
* Map contenant tous les objets graphiques de la widget generique. key: lineModel => le lignemodel du ebliWidget.
* key: color => couleur de fond.
*/
- public Map propGraphique;
+ protected Map<String, Object> propGraphique;
+ public Map<String, Object> getPropGraphique() {
+ return propGraphique;
+ }
+
+ public void setPropGraphique(Map<String, Object> propGraphique) {
+ this.propGraphique = propGraphique;
+ }
+
protected EbliWidgetController controller_;
@@ -255,9 +263,9 @@
getEbliScene().refresh();
}
- public Map duplicateGraphicalProperties() {
+ public Map<String, Object> duplicateGraphicalProperties() {
- Map mapDupliquee = new HashMap<String, Object>();
+ Map<String, Object> mapDupliquee = new HashMap<String, Object>();
mapDupliquee.put(LINEMODEL, new TraceLigneModel(getTraceLigneModel()));
mapDupliquee.put(COLORCONTOUR, getColorContour());
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordure.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordure.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordure.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -1,10 +1,16 @@
package org.fudaa.ebli.visuallibrary;
+import java.awt.Color;
+import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Rectangle;
+import java.util.HashMap;
+import java.util.Map;
import org.fudaa.ebli.trace.TraceLigne;
+import org.fudaa.ebli.trace.TraceLigneModel;
+import org.fudaa.ebli.visuallibrary.actions.CommandeUndoRedoGraphicalProperties;
import org.fudaa.ebli.visuallibrary.layout.OverlayLayoutGap;
/**
@@ -87,4 +93,115 @@
}
+ /**
+ * surcharge des methodes getProperty pour recuperer les proprietes graphiques
+ * et les dipatcher a son conteneur
+ */
+ public Object getProperty(String _key) {
+
+ // -- la bordure ne gere que tracemodel et couleur contour, le reste est
+ // dispatch\xE9 a son conteneur --//
+ if (_key.equals(ROTATION)) {
+
+ double radian = intern_.getRotation();
+ return Integer.valueOf((int) (radian * 180 / Math.PI));
+
+ }
+ else if (_key.equals(FONT)) {
+ return intern_.propGraphique.get(_key);
+ } else if (_key.equals(COLORFOND)) {
+ return intern_.propGraphique.get(_key);
+ }
+ else
+ return propGraphique.get(_key);
+ }
+
+/**
+ * Methode directement appelee apres modification des parametres renvoye par
+ * le getproperty. Ajoute les anciens parametres dans la commande undo/redo.
+ */
+ public boolean setProperty(String _key, Object prop) {
+
+ // --cas particulier si il s agit du tracelignemodel: il faut mettre a jour
+ // l ancien lignemodel --//
+ if (_key.equals(LINEMODEL)) {
+ getTraceLigneModel().updateData((TraceLigneModel) prop);
+ prop = getTraceLigneModel();
+ } else if (_key.equals(ROTATION) && prop instanceof Integer) {
+ // -- cas particulier si il s agit de la rotation --//
+ // -- il faut transformer les degres en radian --//
+ int degre = ((Integer) prop).intValue();
+ double radian = degre * Math.PI / 180;
+ prop = new Double(radian);
+
+ }
+
+ // -- creation de la commande undo/redo --//
+ CommandeUndoRedoGraphicalProperties undoRedo = new CommandeUndoRedoGraphicalProperties();
+
+ // -- ajout de la widget en question ainsi que la oldpropertie --//
+ undoRedo.addWidget(this);
+
+
+ // --mise a jout de la map de proprietes --//
+ if (_key.equals(LINEMODEL) || _key.equals(COLORCONTOUR)) {
+ undoRedo.addOldPropertie(this.duplicateGraphicalProperties());
+ propGraphique.put(_key, prop);
+ // -- ajout de la nouvelle propertie --//
+ undoRedo.addNewPropertie(propGraphique);
+ } else {
+ undoRedo.addOldPropertie(intern_.duplicateGraphicalProperties());
+ intern_.propGraphique.put(_key, prop);
+ // -- ajout de la nouvelle propertie --//
+ undoRedo.addNewPropertie(intern_.propGraphique);
+ }
+
+
+ // -- enregistrement de la commande undo/redo --//
+ if (getEbliScene().cmdMng_ != null) {
+ getEbliScene().cmdMng_.addCmd(undoRedo);
+ }
+
+ // -- mise a jour des parametres de la map --//
+ refreshMyProperties();
+
+ return true;
+ }
+
+ /**
+ * surcharge des getter et setter graphical properties pour rediriger les
+ * infos vers les widgets contenu
+ */
+ public Map<String, Object> getPropGraphique() {
+
+ Map<String, Object> mapMeltingPot = new HashMap<String, Object>();
+ mapMeltingPot.put(COLORCONTOUR, getColorContour());
+ mapMeltingPot.put(LINEMODEL, getTraceLigneModel());
+
+ // -- les autres valeurs conernent le contenu --//
+ mapMeltingPot.put(ROTATION, intern_.getRotation());
+ mapMeltingPot.put(FONT, intern_.getFormeFont());
+ mapMeltingPot.put(COLORFOND, intern_.getColorFond());
+
+ return mapMeltingPot;
+ }
+
+
+ /**
+ * surcharge des getter et setter graphical properties pour rediriger les
+ * infos vers les widgets contenu
+ */
+ public void setPropGraphique(Map<String, Object> propGraphique) {
+ this.propGraphique.put(COLORCONTOUR, propGraphique.get(COLORCONTOUR));
+ this.propGraphique.put(LINEMODEL, propGraphique.get(LINEMODEL));
+
+
+ // -- on redirige les proprietes font,couleur de fond et rotation --//
+ this.intern_.setFormeFont((Font) propGraphique.get(FONT));
+ this.intern_.setColorFond((Color) propGraphique.get(COLORFOND));
+ this.intern_.setRotation((Double) propGraphique.get(ROTATION));
+
+ }
+
+
}
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-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -20,6 +20,7 @@
import org.fudaa.ebli.visuallibrary.actions.WidgetConfigure;
import org.netbeans.api.visual.action.ActionFactory;
import org.netbeans.api.visual.action.PopupMenuProvider;
+import org.netbeans.api.visual.action.WidgetAction;
import org.netbeans.api.visual.widget.Widget;
import com.memoire.bu.BuResource;
@@ -33,25 +34,18 @@
public class EbliWidgetController {
protected boolean canDuplicate_ = true;
- public boolean isCanDuplicate_() {
- return canDuplicate_;
- }
-
- public boolean isCanMove_() {
- return canMove_;
- }
-
- public boolean isCanResize_() {
- return canResize_;
- }
-
protected boolean canMove_ = true;
protected boolean canResize_ = true;
-
private String description_;
-
protected EbliWidget widget_;
+ /**
+ * action de la widget recuperable et eventuellement supprimable
+ */
+ WidgetAction actionMove_;
+ WidgetAction actionResize_;
+ WidgetAction actionSelect_;
+
public EbliWidgetController(EbliWidget widget_) {
this(widget_, true, true, true);
@@ -78,23 +72,60 @@
}
+
+ public boolean isCanDuplicate_() {
+ return canDuplicate_;
+ }
+
+ public boolean isCanMove_() {
+ return canMove_;
+ }
+
+ public boolean isCanResize_() {
+ return canResize_;
+ }
+
+
/**
* methode qui cree les actions par defaut pour la widget.
*
*/
public void createdefaultAction() {
// -- construction des actions --//
- widget_.getActions().addAction(widget_.getEbliScene().createSelectAction());
+ actionSelect_ = widget_.getEbliScene().createSelectAction();
+ widget_.getActions().addAction(actionSelect_);
+
+ actionResize_ = ActionFactory.createResizeAction();
if (canResize_)
- widget_.getActions().addAction(ActionFactory.createResizeAction());
+ widget_.getActions().addAction(actionResize_);
widget_.getActions().addAction(widget_.getEbliScene().createWidgetHoverAction());
+
+ actionMove_ = widget_.getEbliScene().getMoveAction();
if (canMove_)
- widget_.getActions().addAction(widget_.getEbliScene().getMoveAction());
+ widget_.getActions().addAction(actionMove_);
}
+
+ /**
+ * Methode appelee pour bloquer une widget: l'empecher de se deplacer.
+ */
+ public void removeActionResizeAndMove(){
+ widget_.getActions().removeAction(actionMove_);
+ widget_.getActions().removeAction(actionSelect_);
+
+ }
+ /**
+ * fonction inverse de la precedente.
+ */
+ public void replaceActionResizeAndMove() {
+ widget_.getActions().addAction(actionMove_);
+ widget_.getActions().addAction(actionSelect_);
+
+ }
+
public String getDescription_() {
return description_;
}
@@ -121,7 +152,7 @@
widget_.setVisible(false);
cmd_.addCmd(new CommandMasquer(widget_));
}
-
+ widget_.getEbliScene().refresh();
}
});
@@ -226,6 +257,12 @@
}
+
+ PopupMenuProvider providerPopup_ = null;
+ protected JPopupMenu popupMenu_ = null;
+ public JPopupMenu getPopup() {
+ return popupMenu_;
+ }
/**
* Methode generique qui fait apparaitre un menuItem propre au composant et
* offre les op\xE9rations de base on ouvre le menu via le clic droit ou le
@@ -233,18 +270,21 @@
*/
public void setMenu() {
- widget_.getActions().addAction(ActionFactory.createPopupMenuAction(new PopupMenuProvider() {
+
+ popupMenu_ = new JPopupMenu();
+
+ // -- construction du menu pour les graphismees --//
+ constructPopupMenuBaseGraphique(popupMenu_);
+ // -- creation du menu commun a tous les widgets
+ constructPopupMenuBase(popupMenu_);
+
+
+ providerPopup_=new PopupMenuProvider() {
public JPopupMenu getPopupMenu(Widget widget, Point localLocation) {
- JPopupMenu popup = new JPopupMenu();
-
- // -- construction du menu pour les graphismees --//
- constructPopupMenuBaseGraphique(popup);
- // -- creation du menu commun a tous les widgets
- constructPopupMenuBase(popup);
-
- return popup;
+ return popupMenu_;
}
- }));
+ };
+ widget_.getActions().addAction(ActionFactory.createPopupMenuAction(providerPopup_));
}
/**
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-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetSynchroniser.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -1,12 +1,16 @@
package org.fudaa.ebli.visuallibrary;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import javax.swing.DefaultListSelectionModel;
+import javax.swing.JPopupMenu;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.TreePath;
import org.fudaa.ebli.visuallibrary.tree.EbliWidgetJXTreeTableModel;
import org.jdesktop.swingx.JXTreeTable;
@@ -42,7 +46,8 @@
* booleen qui permet d eviter de realiser des cycles entre la selection des
* nodes sur le tree et sur la scene.
*/
- boolean noCycle = true;
+ boolean noCycleScene = true;
+ boolean noCycleTree = false;
public EbliWidgetSynchroniser(EbliWidgetJXTreeTableModel treeModel, JXTreeTable arbre) {
super();
@@ -55,9 +60,72 @@
arbre_.addTreeSelectionListener(this);
+ // -- gestion des popupMenus sur le jtree --//
+ arbre_.addMouseListener(new MouseAdapter() {
+ public void mousePressed(MouseEvent e) {
+ if (e.isPopupTrigger() && e.getClickCount() == 1) {
+ affichePopupNode(e.getX(), e.getY());
+ }
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ if (e.isPopupTrigger() && e.getClickCount() == 1) {
+ affichePopupNode(e.getX(), e.getY());
+ }
+ }
+ });
+
+
}
+ /**
+ * Methode qui affiche la popup du node selectionn\xE9. entree: la position ou
+ * afficher la popup
+ *
+ * @param x
+ * @param y
+ */
+ public void affichePopupNode(int x, int y) {
+ // Get the tree element under the mouse
+ TreePath clickedElement = arbre_.getPathForLocation(x, y);
+ // Update the selection if necessary
+ // updateSelection(clickedElement);
+
+ // Display the name of the selected tree element in the selection field
+ MutableTreeTableNode treeNode = null;
+ if (clickedElement != null)
+ treeNode = (MutableTreeTableNode) clickedElement.getLastPathComponent();
+
+ if (treeNode != null) {
+
+ // -- recuperation du node associe --//
+ EbliNode node = (EbliNode) treeNode.getUserObject();
+
+ if (node != null && node.hasWidget() && node.getCreator().getWidget().isVisible()) {
+
+
+ // -- recuperation de la popup du node et ajout a l element du tree a al
+ // bonne location--//
+ JPopupMenu poppup =null;
+
+ // -- 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();
+ poppup = bordure.intern_.getController_().getPopup();
+ }else
+ poppup=node.getCreator().getWidget().getController_().getPopup();
+
+ poppup.show(arbre_, x, y);
+
+
+ }
+
+ }
+
+ }
+
public void focusChanged(ObjectSceneEvent event, Object previousFocusedObject, Object newFocusedObject) {
}
@@ -82,21 +150,33 @@
* correspondand dans le tree.
*/
public void selectionChanged(ObjectSceneEvent event, Set<Object> previousSelection, Set<Object> newSelection) {
- FuLog.warning("NOCYCLE DE SCENE " + noCycle);
- if (noCycle) {
+ FuLog.warning("NOCYCLE DE SCENE " + noCycleScene);
+
+
+
+
+
+ if (noCycleScene) {
// on bloque l'effet cycle
- noCycle = false;
+ noCycleScene = false;
- if (newSelection != null && newSelection.size() != 0) {
+ final Set<Object> newSelection_ = newSelection;
+
+ if (newSelection_ != null && newSelection_.size() != 0) {
- DefaultListSelectionModel model = new DefaultListSelectionModel();
+ DefaultListSelectionModel model = (DefaultListSelectionModel) arbre_.getSelectionModel();// new
+ // DefaultListSelectionModel
- for (Iterator<Object> it = newSelection.iterator(); it.hasNext();) {
+ // -- mise a jour de la selection a vide--//
+ model.clearSelection();
+
+ FuLog.warning("ITERATOR CHERIE");
+ for (Iterator<Object> it = newSelection_.iterator(); it.hasNext();) {
// -- recuperation du node selectionne --//
- EbliNode nodeSelect = (EbliNode) it.next();
+ final EbliNode nodeSelect = (EbliNode) it.next();
MutableTreeTableNode treeNode=treeModel_.findTreeTableNode(nodeSelect);
@@ -109,7 +189,7 @@
// getRoot(), treeNode), treeModel_
// .getIndexOfChild(treeModel_.getRoot(), treeNode));
- arbre_.setSelectionModel(model);
+ // arbre_.setSelectionModel(model);
}
arbre_.validate();
@@ -122,10 +202,15 @@
}
+ // -- verification que le tree a toujours son treeselectionlistener --//
+ // arbre_.addTreeSelectionListener(this);
+
+
+ // -- on signale que le danger du cycle est termin\xE9
+ noCycleScene = true;
}
- // -- on signale que le danger du cycle est termin\xE9
- noCycle = true;
+
}
@@ -133,13 +218,13 @@
* signal envoye par l arbre lors du changement de selection.
*/
public void valueChanged(TreeSelectionEvent e) {
- FuLog.warning("NOCYCLE DE TREE " + noCycle);
- if (noCycle) {
+ FuLog.warning("NOCYCLE DE TREE " + noCycleScene);
+ if (noCycleScene) {
- noCycle = false;
+ noCycleScene = false;
if (arbre_.getSelectedRows() != null && arbre_.getSelectedRows().length != 0) {
- Set<Object> listeNodeSelect=new HashSet<Object>();
+ final Set<Object> listeNodeSelect = new HashSet<Object>();
@@ -151,7 +236,7 @@
MutableTreeTableNode treeNode = (MutableTreeTableNode) treeModel_.getChild(treeModel_.getRoot(), indices[i]);
- EbliNode nodeSelect = (EbliNode) treeNode.getUserObject();
+ final EbliNode nodeSelect = (EbliNode) treeNode.getUserObject();
FuLog.warning("tree selection: " + nodeSelect);
listeNodeSelect.add(nodeSelect);
@@ -167,11 +252,12 @@
// mise a jour de la scene
scene_.refresh();
}
+ // -- on signale que le danger du cycle est termin\xE9
+ noCycleScene = true;
}
- // -- on signale que le danger du cycle est termin\xE9
- noCycle = true;
+
}
Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoBloque.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoBloque.java (rev 0)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandUndoRedoBloque.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -0,0 +1,55 @@
+package org.fudaa.ebli.visuallibrary.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.fudaa.ctulu.CtuluCommand;
+import org.fudaa.ebli.visuallibrary.EbliWidget;
+
+/**
+ * Commande undo/redo sur le blocage des widgets.
+ *
+ * @author Adrien Hadoux
+ *
+ */
+
+
+
+public class CommandUndoRedoBloque implements CtuluCommand {
+
+ ArrayList<EbliWidget> widget_;
+ boolean bloque_ = true;
+
+
+
+
+
+ public CommandUndoRedoBloque(ArrayList<EbliWidget> widget, boolean bloque) {
+ super();
+ this.widget_ = widget;
+ bloque_ = bloque;
+ }
+
+ public void undo() {
+
+ for (Iterator<EbliWidget> it = widget_.iterator(); it.hasNext();) {
+ if (bloque_)
+ it.next().getController_().replaceActionResizeAndMove();
+ else
+ it.next().getController_().removeActionResizeAndMove();
+ }
+
+ widget_.get(0).getEbliScene().refresh();
+ }
+
+ public void redo() {
+ for (Iterator<EbliWidget> it = widget_.iterator(); it.hasNext();) {
+ if (bloque_)
+ it.next().getController_().removeActionResizeAndMove();
+ else
+ it.next().getController_().replaceActionResizeAndMove();
+ }
+ widget_.get(0).getEbliScene().refresh();
+ }
+
+}
\ No newline at end of file
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeUndoRedoGraphicalProperties.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeUndoRedoGraphicalProperties.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/CommandeUndoRedoGraphicalProperties.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -61,7 +61,7 @@
if (nb == 0)
return;
for (int i = 0; i < nb; i++) {
- widgets_.get(i).propGraphique = oldGraphicalProperties.get(i);
+ widgets_.get(i).setPropGraphique(oldGraphicalProperties.get(i));
}
refreshScene();
@@ -75,7 +75,7 @@
if (nb == 0)
return;
for (int i = 0; i < nb; i++) {
- widgets_.get(i).propGraphique = newGraphicalProperties.get(i);
+ widgets_.get(i).setPropGraphique(newGraphicalProperties.get(i));
}
refreshScene();
Added: 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 (rev 0)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -0,0 +1,100 @@
+package org.fudaa.ebli.visuallibrary.actions;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.swing.Icon;
+
+import org.fudaa.ctulu.CtuluCommandContainer;
+import org.fudaa.ctulu.CtuluResource;
+import org.fudaa.ebli.commun.EbliActionSimple;
+import org.fudaa.ebli.ressource.EbliResource;
+import org.fudaa.ebli.visuallibrary.EbliNode;
+import org.fudaa.ebli.visuallibrary.EbliScene;
+import org.fudaa.ebli.visuallibrary.EbliWidget;
+
+/**
+ * Action qui empeche les widgets de se resize et d'etre deplacee
+ *
+ * @author Adrien Hadoux
+ *
+ */
+public abstract class EbliWidgetActionBloqueOuDebloqueWidget extends EbliActionSimple {
+
+ private static final long serialVersionUID = 1L;
+ EbliScene scene_;
+ final CtuluCommandContainer cmd_;
+ boolean bloque_ = true;
+
+
+
+ public EbliWidgetActionBloqueOuDebloqueWidget(String name, Icon ic, String id, EbliScene _scene, boolean bloque) {
+ super(name, ic, id);
+
+ scene_ = _scene;
+ putValue(NAME, "Duplication des \xE9lements s\xE9lectionn\xE9s");
+ cmd_ = _scene.getCmdMng();
+ bloque_ = bloque;
+ }
+
+
+
+ public static class Bloque extends EbliWidgetActionBloqueOuDebloqueWidget{
+
+ public Bloque(EbliScene _scene) {
+ super(EbliResource.EBLI.getString("Bloquer les objets s\xE9lectionn\xE9s "), CtuluResource.CTULU
+ .getIcon("crystal_tuer"),
+ "BLOQUEWIDGET", _scene, true);
+ }
+
+ }
+
+ public static class DeBloque extends EbliWidgetActionBloqueOuDebloqueWidget {
+
+ public DeBloque(EbliScene _scene) {
+ super(EbliResource.EBLI.getString("Debloquer les objets s\xE9lectionn\xE9s "), CtuluResource.CTULU
+ .getIcon("crystal_valider"), "DEBLOQUEWIDGET", _scene, false);
+ }
+
+ }
+
+
+ public void actionPerformed(ActionEvent e) {
+ // TODO Auto-generated method stub
+
+ // -- recuperation de la liste des nodes de la scene --//
+ Set<EbliNode> listeNode = (Set<EbliNode>) scene_.getSelectedObjects();
+
+ // -- liste des widget selectionnees --//
+ ArrayList<EbliWidget> listeWidget = new ArrayList<EbliWidget>();
+
+ // -- parcours des nodes
+ for (Iterator<EbliNode> it = listeNode.iterator(); it.hasNext();) {
+
+ EbliNode currentNode = it.next();
+ 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());
+
+ // -- rafraichissement de la scene --//
+ scene_.refresh();
+
+ }
+
+ }
+
+ // -- enregistrement de la commande undoRedo --//
+ if (cmd_ != null) {
+ cmd_.addCmd(new CommandUndoRedoBloque(listeWidget, bloque_));
+ }
+
+ }
+
+}
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-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -96,7 +96,7 @@
widget.setColorFond(newColor);
// -- ajout de la nouvelle graphicalProperty --//
- newGraphicalProperties.add(widget.propGraphique);
+ newGraphicalProperties.add(widget.getPropGraphique());
}
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-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -97,7 +97,7 @@
widget.setColorContour(newColor);
//-- ajout de la nouvelle graphicalProperty --//
- newGraphicalProperties.add(widget.propGraphique);
+ newGraphicalProperties.add(widget.getPropGraphique());
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -83,8 +83,8 @@
listeNouveauxNodes.add(node);
// -- duplication des map de property graphique de la widget --//
- node.getCreator().getWidget().propGraphique = currentNode.getCreator().getWidget()
- .duplicateGraphicalProperties();
+ node.getCreator().getWidget().setPropGraphique(
+ currentNode.getCreator().getWidget().duplicateGraphicalProperties());
// -- duplication de la taille --//
node.getCreator().getWidget().setPreferredBounds(currentNode.getCreator().getWidget().getPreferredBounds());
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-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionFont.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -121,7 +121,7 @@
widget.setFormeFont(newFont);
// -- ajout de la nouvelle graphicalProperty --//
- newGraphicalProperties.add(widget.propGraphique);
+ newGraphicalProperties.add(widget.getPropGraphique());
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetEditCreator.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetEditCreator.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetEditCreator.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -47,6 +47,10 @@
*/
public static final EbliWidgetEditCreator INSTANCE = new EbliWidgetEditCreator();
+
+
+
+
public Window createFrame(ZEbliCalquesPanel pn, String title) {
JFrame frame = new JFrame(title);
@@ -72,6 +76,7 @@
// pn.setPreferredSize(pn.getPreferredSize());
final DefaultDockingPort globalPort = createDockingPort();
JComponent centerComponent = createView(pn, EbliResource.EBLI.getToolIcon("lissage"), EbliLib.getS("Vue 2D"));
+
DockingManager.dock(centerComponent, (DockingPort) globalPort);
JComponent rightComponent = createView(new JScrollPane(new BArbreCalque(pn.getArbreCalqueModel())),
EbliResource.EBLI.getToolIcon("arbre"), "arbre", true);
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/WidgetConfigure.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/WidgetConfigure.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/WidgetConfigure.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -20,10 +20,14 @@
import org.fudaa.ebli.controle.BSelecteurTargetInterface;
import org.fudaa.ebli.visuallibrary.EbliWidget;
import org.fudaa.ebli.visuallibrary.EbliWidgetBordure;
+import org.fudaa.ebli.visuallibrary.EbliWidgetImage;
import org.fudaa.ebli.visuallibrary.EbliWidgetShape;
+import org.fudaa.ebli.visuallibrary.EbliWidgetTextLabel;
+import org.fudaa.ebli.visuallibrary.calque.EbliWidgetVueCalque;
import org.fudaa.ebli.visuallibrary.creator.ShapeCreator;
import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorEllipse;
import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorFleche;
+import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetGraphe;
/**
* classe qui permet de creer les selecteurs necessaires pour la configuration.
@@ -158,10 +162,32 @@
boolean police_ = true;
if (found instanceof EbliWidgetBordure) {
- colorFonds_ = false;
rotations_ = false;
- police_ = false;
+
+ // -- droit en fonction du type du contenu --//
+ if (found.getChildren() != null && found.getChildren().size() != 0) {
+
+ //-- cas pour graphe et calques --//
+ if (found.getChildren().get(0) instanceof EbliWidgetVueCalque
+ || found.getChildren().get(0) instanceof EbliWidgetGraphe) {
+ colorFonds_ = false;
+
+ police_ = false;
+ }
+ else //-- cas image --//
+ if (found.getChildren().get(0) instanceof EbliWidgetImage) {
+ colorFonds_ = false;
+
+ police_ = false;
+ }else {//-- cas legendes --//
+
+ colorFonds_=false;
+
+ }
+
}
+
+ }
else if (found instanceof EbliWidgetShape) {
police_ = false;
//-- test du shapeCreator --//
@@ -170,7 +196,25 @@
rotations_ = false;
}
+ } else if (found instanceof EbliWidgetTextLabel) {
+ rotations_ = false;
+ colorFonds_ = false;
+ lineModel_ = false;
}
+ else if(found instanceof EbliWidgetImage ){
+ rotations_ = false;
+ colorFonds_ = false;
+ lineModel_ = false;
+ police_ = false;
+ colorsContours_=false;
+ }else{
+ //-- cas des legendes: juste font et color contour pour resizer le tout --//
+ rotations_ = false;
+ colorFonds_ = false;
+ lineModel_ = false;
+ colorsContours_ = false;
+
+ }
palette = new BConfigurableComposite(found.getConfigureInterfaces(lineModel_, colorsContours_, colorFonds_,
rotations_, police_), "palette");
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -6,7 +6,11 @@
import java.awt.Component;
import java.awt.Dimension;
+import java.awt.Font;
import java.awt.Point;
+import java.awt.Rectangle;
+import java.util.Iterator;
+import java.util.List;
import javax.swing.JLabel;
@@ -22,14 +26,15 @@
import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly;
import org.netbeans.api.visual.layout.LayoutFactory.SerialAlignment;
import org.netbeans.api.visual.widget.LabelWidget;
+import org.netbeans.api.visual.widget.Widget;
import org.netbeans.modules.visual.layout.FlowLayout;
import com.memoire.fu.FuLog;
/**
- * Test d'un widget pour afficher la legende A remplacer.
+ * La classe de gestion des legendes pour le calque.
*
- * @author deniger
+ * @author Adrien Hadoux
*/
public class EbliWidgetCalqueLegende extends BCalqueLegende {
@@ -94,6 +99,77 @@
}
/**
+ * Creation de la classe widget specifique au calque. Permet de gerer le
+ * resize via le changement de font
+ *
+ */
+ public static class WidgetCalqueLegende extends EbliWidget {
+
+ Font oldFont_;
+
+ public WidgetCalqueLegende(EbliScene scene, boolean _controller) {
+ super(scene, _controller);
+ oldFont_ = getFormeFont();
+ }
+
+ protected void paintWidget() {
+
+ // -- mise a jour de la fonte que si il y a eu une modification --//
+ if (oldFont_ != getFormeFont()) {
+
+
+ // -- mise a jour de la widget avec la nouvelle font
+ List<Widget> listePlage = getChildren();
+ for (Iterator<Widget> it = listePlage.iterator(); it.hasNext();) {
+ Widget widget = it.next();
+ // -- test si il s agit d un widget plage --//
+ if (widget instanceof EbliWidgetPlageTitle) {
+ EbliWidgetPlageTitle new_widget = (EbliWidgetPlageTitle) widget;
+ new_widget.getIntern_().setFont(getFormeFont());
+
+ // resize du composant texte
+ Rectangle newBounds = new_widget.getIntern_().getBounds();
+ newBounds.height += (getFormeFont().getSize() - oldFont_.getSize()) * 2;
+ newBounds.width += (getFormeFont().getSize() - oldFont_.getSize()) * 12;
+ new_widget.getIntern_().setPreferredBounds(newBounds);
+
+ // resize pour le logo: forme carr\xE9
+ Rectangle boundsLogo = new_widget.getLogo_().getBounds();
+ boundsLogo.height = newBounds.height;
+ boundsLogo.width = newBounds.height;
+ new_widget.getLogo_().setPreferredBounds(boundsLogo);
+ // setPreferredSize(new Dimension(newBounds.width,
+ // newBounds.height));
+
+ } else if (widget instanceof LabelWidget) {
+ LabelWidget new_widget = (LabelWidget) widget;
+ new_widget.setFont(getFormeFont());
+
+ // resize du composant
+ Rectangle newBounds = new_widget.getBounds();
+ newBounds.height += (getFormeFont().getSize() - oldFont_.getSize()) * 2;
+ newBounds.width += (getFormeFont().getSize() - oldFont_.getSize()) * 12;
+ new_widget.setPreferredBounds(newBounds);
+ }
+
+ }
+ // Resize de la widget
+
+ Rectangle newBounds = getParentWidget().getBounds();
+ newBounds.height += (listePlage.size() + 1) * (getFormeFont().getSize() - oldFont_.getSize()) * 2;
+ newBounds.width += (getFormeFont().getSize() - oldFont_.getSize()) * 12;
+ getParentWidget().setPreferredBounds(newBounds);
+ getEbliScene().refresh();
+ oldFont_ = getFormeFont();
+
+ }
+
+ }
+
+ }
+
+
+ /**
* Mananger statique qui se charge de creer \xE9a widget associee au calque.
*
* @param _calqueLegende
@@ -107,7 +183,7 @@
// --creation de la widget conteneur --//
BPalettePlageInterface listeplages = null;
- EbliWidget widgetLegende_ = new EbliWidget(_scene, false);
+ WidgetCalqueLegende widgetLegende_ = new WidgetCalqueLegende(_scene, false);
widgetLegende_.setLayout(new FlowLayout(true, SerialAlignment.CENTER, 5));
if (_calqueLegende != null) {
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-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -131,14 +131,14 @@
public void setMenu() {
widget_.getActions().addAction(ActionFactory.createPopupMenuAction(new PopupMenuProvider() {
public JPopupMenu getPopupMenu(Widget widget, Point localLocation) {
- JPopupMenu popup = new JPopupMenu();
+ popupMenu_ = new JPopupMenu();
// -- Menu sp\xF6cifiques a l'application--//
- constructPopupMenuSpecifique(popup);
+ constructPopupMenuSpecifique(popupMenu_);
// -- creation du menu commun a tous les widgets
- constructPopupMenuBase(popup);
+ constructPopupMenuBase(popupMenu_);
- return popup;
+ return popupMenu_;
}
}));
}
Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java (rev 0)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerLegendeCalque.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -0,0 +1,18 @@
+package org.fudaa.ebli.visuallibrary.calque;
+
+import org.fudaa.ebli.visuallibrary.EbliWidget;
+import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly;
+
+/**
+ * controller specifique aux legendes. gere
+ *
+ * @author genesis
+ *
+ */
+public class EbliWidgetControllerLegendeCalque extends EbliWidgetControllerMenuOnly {
+
+ public EbliWidgetControllerLegendeCalque(EbliWidget widget_) {
+ super(widget_);
+ }
+
+}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetPlageTitle.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetPlageTitle.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetPlageTitle.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -3,6 +3,7 @@
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
+import java.awt.Rectangle;
import org.fudaa.ebli.trace.BPlageInterface;
import org.fudaa.ebli.visuallibrary.EbliScene;
@@ -35,6 +36,7 @@
public internWidget(Scene scene) {
super(scene);
+ setLayout(new FlowLayout(false, SerialAlignment.CENTER, 0));
}
public String getText(Widget widget) {
@@ -54,6 +56,22 @@
}
internWidget intern_;
+ public internWidget getIntern_() {
+ return intern_;
+ }
+
+ public void setIntern_(internWidget intern_) {
+ this.intern_ = intern_;
+ }
+
+ public EbliWidget getLogo_() {
+ return logo_;
+ }
+
+ public void setLogo_(EbliWidget logo_) {
+ this.logo_ = logo_;
+ }
+
EbliWidget logo_;
/**
* @param _scene
@@ -69,8 +87,13 @@
protected void paintWidget() {
Graphics2D g = getGraphics();
g.setColor(plage_.getCouleur());
- g.fillRect(0, 0, EbliWidgetCalqueLegende.WIDTH_PER_LEGENDEICON,
- EbliWidgetCalqueLegende.LENGHT_PER_LEGENDE);
+ Rectangle newBounds = getBounds();
+ g.fillRect(0, 0, newBounds.width/*
+ * EbliWidgetCalqueLegende.WIDTH_PER_LEGENDEICON
+ */, newBounds.height/*
+ * EbliWidgetCalqueLegende.
+ * LENGHT_PER_LEGENDE
+ */);
}
};
logo_.setPreferredSize(new Dimension(EbliWidgetCalqueLegende.WIDTH_PER_LEGENDEICON,
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-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -104,7 +104,6 @@
//
// });
// conteneurEditor.add(fonctionsCompletes, BorderLayout.SOUTH);
-
return calquePanel_;
}
@@ -143,7 +142,7 @@
// -- centrer la vue par rapport a la frame principal car si le widget est
// en bas a droite, c'est la merde!
frame_.setLocationRelativeTo(this.getScene().getView());
- calquePanel_.getVueCalque().changeRepere(this, gr);
+ calquePanel_.getVueCalque().changeRepere(this, gr);
frame_.setVisible(true);
frame_.addWindowListener(new WindowAdapter() {
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-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -103,19 +103,21 @@
public void setMenu() {
widget_.getActions().addAction(ActionFactory.createPopupMenuAction(new PopupMenuProvider() {
public JPopupMenu getPopupMenu(Widget widget, Point localLocation) {
- JPopupMenu popup = new JPopupMenu();
+ popupMenu_ = new JPopupMenu();
// -- Menu sp\xF6cifiques a l'application--//
- constructPopupMenuSpecifique(popup);
+ constructPopupMenuSpecifique(popupMenu_);
// -- creation du menu commun a tous les widgets
- constructPopupMenuBase(popup);
+ constructPopupMenuBase(popupMenu_);
- return popup;
+ return popupMenu_;
}
}));
}
+
+ private static int indiceLegende = 1;
/**
* ajoutant la possibilit\xE9 de configurer la courbe ainsi que la l\xE9gende
*
@@ -144,6 +146,9 @@
// -- creation d'un node legende --//
widgetGraphe_.setNodeLegende(new EbliNodeDefault());
+ // -- non de la legende --//
+ widgetGraphe_.getNodeLegende().setTitle("L\xE9gende " + (indiceLegende++));
+
widgetGraphe_.getNodeLegende().setCreator(
new EbliWidgetCreatorLegende(((EbliWidgetGraphe) widget_)
.getGraphe()));
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetTitle.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetTitle.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetTitle.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -26,17 +26,25 @@
EGCourbe cb_;
- LabelWidget intern;
+ LabelWidget intern_;
+ public LabelWidget getIntern_() {
+ return intern_;
+ }
+
+ public void setIntern_(LabelWidget intern_) {
+ this.intern_ = intern_;
+ }
+
/**
* @param _scene
*/
public EbliWidgetTitle(EbliScene _scene, EGCourbe _cb,Point preferedLocation) {
super(_scene);
setLayout(new FlowLayout(true, SerialAlignment.LEFT_TOP, 0));
- intern = new LabelWidget(_scene);
- intern.setForeground(_cb.getAspectContour());
- addChild(intern);
+ intern_ = new LabelWidget(_scene);
+ intern_.setForeground(_cb.getAspectContour());
+ addChild(intern_);
setCourbe(_cb);
setPreferredSize(new Dimension(WidgetLegendeManager.WIDTH_PER_LEGENDETEXT,
WidgetLegendeManager.LENGHT_PER_LEGENDE));
@@ -47,15 +55,15 @@
WidgetAction editorAction = ActionFactory.createInplaceEditorAction (this);
//-- ajout de l action au label correspondant --//
- intern.getActions ().addAction (editorAction);
+ intern_.getActions ().addAction (editorAction);
//setEnabled(false);
}
public void majLabel(){
- intern.setForeground(cb_.getAspectContour());
- intern.setLabel(cb_.getTitle());
- intern.setToolTipText(cb_.getTitle());
+ intern_.setForeground(cb_.getAspectContour());
+ intern_.setLabel(cb_.getTitle());
+ intern_.setToolTipText(cb_.getTitle());
}
// @Override
@@ -76,7 +84,7 @@
public void setCourbe(EGCourbe _cb) {
this.cb_ = _cb;
if (cb_ != null) {
- intern.setLabel(cb_.getTitle());
+ intern_.setLabel(cb_.getTitle());
}
}
@@ -93,7 +101,7 @@
String texte = formatte(text);
((LabelWidget) widget).setLabel(texte);
cb_.setTitle(texte);
- intern.setToolTipText(texte);
+ intern_.setToolTipText(texte);
}
/**
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManager.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManager.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/WidgetLegendeManager.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -1,7 +1,11 @@
package org.fudaa.ebli.visuallibrary.graphe;
import java.awt.Dimension;
+import java.awt.Font;
import java.awt.Point;
+import java.awt.Rectangle;
+import java.util.Iterator;
+import java.util.List;
import org.fudaa.ebli.courbe.EGAxe;
import org.fudaa.ebli.courbe.EGCourbe;
@@ -12,6 +16,7 @@
import org.fudaa.ebli.visuallibrary.EbliWidget;
import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly;
import org.netbeans.api.visual.layout.LayoutFactory.SerialAlignment;
+import org.netbeans.api.visual.widget.Widget;
import org.netbeans.modules.visual.layout.FlowLayout;
/**
@@ -33,7 +38,84 @@
* (LENGHT_PER_LEGENDE + MAX_BORDURE / 2));
}
+
+
+
/**
+ * Creation de la classe widget specifique au calque. Permet de gerer le
+ * resize via le changement de font
+ *
+ */
+ public static class WidgetCalqueLegende extends EbliWidget {
+
+ Font oldFont_;
+
+ public WidgetCalqueLegende(EbliScene scene, boolean _controller) {
+ super(scene, _controller);
+ oldFont_ = getFormeFont();
+ }
+
+ protected void paintWidget() {
+
+ // -- mise a jour de la fonte que si il y a eu une modification --//
+ if (oldFont_ != getFormeFont()) {
+
+ // -- mise a jour de la widget avec la nouvelle font
+ List<Widget> listePlage = getChildren();
+ for (Iterator<Widget> it = listePlage.iterator(); it.hasNext();) {
+ Widget widget = it.next();
+ // -- test si il s agit d un widget plage --//
+ if (widget instanceof EbliWidget && widget.getChildren().size() == 2) {
+ EbliWidget new_widget = (EbliWidget) widget;
+
+ EbliWidgetLine lw = null;
+ EbliWidgetTitle tw = null;
+
+ if (new_widget.getChildren().get(0) instanceof EbliWidgetLine)
+ lw = (EbliWidgetLine) new_widget.getChildren().get(0);
+ else
+ tw = (EbliWidgetTitle) new_widget.getChildren().get(0);
+
+ if (new_widget.getChildren().get(1) instanceof EbliWidgetLine)
+ lw = (EbliWidgetLine) new_widget.getChildren().get(1);
+ else
+ tw = (EbliWidgetTitle) new_widget.getChildren().get(1);
+ if (lw != null && tw != null) {
+
+ tw.getIntern_().setFont(getFormeFont());
+
+ // resize du composant texte
+ Rectangle newBounds = tw.getIntern_().getBounds();
+ newBounds.height += (getFormeFont().getSize() - oldFont_.getSize()) * 2;
+ newBounds.width += (getFormeFont().getSize() - oldFont_.getSize()) * 12;
+ tw.getIntern_().setPreferredBounds(newBounds);
+
+ // resize pour le logo: forme carr\xE9
+ Rectangle boundsLogo = lw.getBounds();
+ boundsLogo.height = newBounds.height;
+ boundsLogo.width = newBounds.height;
+ lw.setPreferredBounds(boundsLogo);
+
+ }
+ }
+
+ }
+ // Resize de la widget
+
+ Rectangle newBounds = getParentWidget().getBounds();
+ newBounds.height += (listePlage.size() + 1) * (getFormeFont().getSize() - oldFont_.getSize()) * 2;
+ newBounds.width += (getFormeFont().getSize() - oldFont_.getSize()) * 12;
+ getParentWidget().setPreferredBounds(newBounds);
+ getEbliScene().refresh();
+ oldFont_ = getFormeFont();
+
+ }
+
+ }
+
+ }
+
+ /**
* Creation de la legende
*
* @param g
@@ -44,7 +126,7 @@
*/
public static EbliWidget createLegende(final EGGraphe g, final EbliScene scene, final Point PreferredLocation) {
final EGCourbe[] cs = g.getModel().getCourbes();
- final EbliWidget res = new EbliWidget(scene, false);
+ final WidgetCalqueLegende res = new WidgetCalqueLegende(scene, false);
res.setLayout(new FlowLayout(true, SerialAlignment.CENTER, 5));// a
// modifier
// pour
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-08-29 16:15:44 UTC (rev 3852)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-08-29 17:05:47 UTC (rev 3853)
@@ -165,25 +165,49 @@
JXCollapsiblePane pane = new JXCollapsiblePane();
JButton toggle = new JButton(pane.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
toggle.setText("Overview");
+ pane.setCollapsed(true);
+ // -- ajout du bouton comme scrollpane selector --//
+ JPanel selector = new JPanel();
+ selector.add(projet_.impl_.getMainPanel().getScrollDesktop_().getCorner(JScrollPane.LOWER_RIGHT_CORNER));
+ selector.add(toggle);
+ projet_.impl_.getMainPanel().getScrollDesktop_().setCorner(JScrollPane.LOWER_RIGHT_CORNER, toggle);// selector
+ // )
+ // ;
+
+
JPanel over = new JPanel(new BorderLayout());
- over.add(toggle, BorderLayout.NORTH);
+ // over.add(toggle, BorderLayout.NORTH);
over.add(pane, BorderLayout.CENTER);
pane.add(getScene().createSatelliteView());
right.add(over, BorderLayout.NORTH);
- pane = new JXCollapsiblePane();
- toggleTree_ = new JButton(pane.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
+ // pane = new JXCollapsiblePane();
+ // toggleTree_ = new
+ // JButton(pane.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
+ // toggleTree_.setText("Composants");
+ //
+ // panelTreeModifiable_ = new JScrollPane(contrRoller_.createTree());
+ // // right.add(panelTreeModifiable_, BorderLayout.CENTER);
+ // conteneurTree_ = new JPanel(new BorderLayout());
+ // conteneurTree_.add(toggleTree_, BorderLayout.NORTH);
+ // conteneurTree_.add(pane, BorderLayout.CENTER);
+ // pane.add(panelTreeModifiable_);
+ // right.add(conteneurTree_, BorderLayout.CENTER);
+
+
+ toggleTree_ = new JButton("Arbre");
toggleTree_.setText("Composants");
panelTreeModifiable_ = new JScrollPane(controller_.createTree());
// right.add(panelTreeModifiable_, BorderLayout.CENTER);
conteneurTree_ = new JPanel(new BorderLayout());
- conteneurTree_.add(toggleTree_, BorderLayout.NORTH);
- conteneurTree_.add(pane, BorderLayout.CENTER);
- pane.add(panelTreeModifiable_);
+ // conteneurTree_.add(toggleTree_, BorderLayout.NORTH);
+ conteneurTree_.add(panelTreeModifiable_, BorderLayout.CENTER);
+
right.add(conteneurTree_, BorderLayout.CENTER);
+
// -- ajout du bouton qui permet de g\xE9rer tous les resultats
BuButton boutonGestionMultiSrc = new BuButton("Gestion des projets");
@@ -209,6 +233,10 @@
getScene().refresh();
}
}
+
+
+
+
return right;
}
@@ -476,8 +504,11 @@
// panelTreeModifiable_ = new JScrollPane(component);
this.toggleTree_.setText("Calques");
-
+
conteneurTree_.add(panelTreeModifiable_, BorderLayout.CENTER);
+ // conteneurTree_.add(, BorderLayout.SOUTH);
+
+
...
[truncated message content] |