From: <de...@us...> - 2008-08-24 22:26:30
|
Revision: 3832 http://fudaa.svn.sourceforge.net/fudaa/?rev=3832&view=rev Author: deniger Date: 2008-08-24 22:26:37 +0000 (Sun, 24 Aug 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BCalqueLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFillePanel.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/EbliWidgetCreatorRectangleTexte.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliActionEditorOneClick.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/EbliWidgetCreatorCalqueLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.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 branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetRubar.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanelRubar.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetComponent.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BCalqueLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BCalqueLegende.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BCalqueLegende.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -141,10 +141,14 @@ final BCalqueLegendePanel pnLeg = new BCalqueLegendePanel(_cq, _titre); pnLeg.setName("pnLEGENDE_" + name); cqAffPanels_.put(_cq, pnLeg); - pnLegendes_.add(pnLeg); + addLegendToPanel(pnLeg); return pnLeg; } + protected void addLegendToPanel(final BCalqueLegendePanel pnLeg) { + pnLegendes_.add(pnLeg); + } + protected void isRestoreFromProperties(BCalqueAffichage _cq) { default_.initFrom(_cq.getLegendProperties()); super.setFont(_cq.getLegendProperties().getFont()); @@ -272,7 +276,7 @@ updateProperties(_finalPanel.aff_); cqAffPanels_.put(_finalPanel.aff_, _finalPanel); _finalPanel.aff_.setLegende(this); - pnLegendes_.add(_finalPanel); + addLegendToPanel(_finalPanel); pnLegendes_.revalidate(); if (!lockRefresh_) { repaint(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -68,8 +68,8 @@ /** * Fenetre d'affichage de calques contenant des services de base. (position souris, zoom fenetre, selection, - * transformations spatiales). Il est possible d'ajouter des boutons grace aux methodes <code>addButtonGroup</code>. - * Par defaut, 3 groupes de boutons sont proposes : selection, standard et navigation. Ils peuvent etre supprimes ou + * transformations spatiales). Il est possible d'ajouter des boutons grace aux methodes <code>addButtonGroup</code>. Par + * defaut, 3 groupes de boutons sont proposes : selection, standard et navigation. Ils peuvent etre supprimes ou * modifies avec les methodes remove * * @version $Id: ZEbliCalquesPanel.java,v 1.55 2007-06-05 08:58:38 deniger Exp $ @@ -171,9 +171,7 @@ } protected BuMenu createMenu(final BCalque _cq) { - if (_cq == null) { - return null; - } + if (_cq == null) { return null; } BuMenu m = null; if (_cq.isGroupeCalque()) { m = new ThemeMenu(_cq, _cq.getTitle(), _cq.getName()); @@ -246,7 +244,7 @@ private BGroupeCalque gcDonnees_; public void setGcDonnees_(BGroupeCalque gcDonnees_) { - + this.gcDonnees_ = gcDonnees_; } @@ -343,9 +341,7 @@ } modelArbre_.refresh(); - if (_controller == null) { - throw new IllegalArgumentException(); - } + if (_controller == null) { throw new IllegalArgumentException(); } controller_ = _controller; controller_.setView(this); } @@ -577,9 +573,7 @@ } public int print(final Graphics _g, final PageFormat _format, final int _numPage) { - if (_numPage != 0) { - return Printable.NO_SUCH_PAGE; - } + if (_numPage != 0) { return Printable.NO_SUCH_PAGE; } final BVueCalque bv = getVueCalque(); final Graphics2D g2d = (Graphics2D) _g; g2d.setColor(Color.black); @@ -809,13 +803,9 @@ /** * Ajoute les calques d'informations. - * - * @param _g le maillage associe */ protected BGroupeCalque addCqInfos() { - if (getCqInfos() != null) { - return getCqInfos(); - } + if (getCqInfos() != null) { return getCqInfos(); } final BGroupeCalque gr = new BGroupeCalque(); gr.setName("gpInfo"); gr.setTitle(EbliLib.getS("infos")); @@ -828,6 +818,29 @@ return gr; } + protected BGroupeCalque addCqInfos(final BCalqueLegende l) { + if (getCqInfos() != null) { return getCqInfos(); } + final BGroupeCalque gr = new BGroupeCalque(); + gr.setName("gpInfo"); + gr.setTitle(EbliLib.getS("infos")); + l.setDestructible(false); + l.setTitle(EbliLib.getS("L\xE9gende")); + l.setName("cqLegende"); + gr.add(l); + vc_.getCalque().enPremier(gr); + return gr; + } + + public void addCqLegende(final BCalqueLegende _leg) { + if (getCqInfos() != null) { + removeCalqueLegend(); + _leg.setName("cqLegende"); + getCqInfos().add(_leg); + } else { + addCqInfos(_leg); + } + } + protected final void removeCqInfos() { vc_.getCalque().detruire(getCqInfos()); } @@ -836,31 +849,23 @@ * @return le calque legende */ public final BCalqueLegende getCqLegend() { - if (getCqInfos() == null) - addCqInfos(); + if (getCqInfos() == null) addCqInfos(); return (BCalqueLegende) getCqInfos().getCalqueParNom("cqLegende"); } protected void removeCalqueLegend() { - getCqInfos().remove(getCqLegend()); + if(getCqLegend()!=null) + getCqInfos().remove(getCqLegend()); // getCqLegend().setVisible(false); } - + public void addCalqueLegend() { getCqInfos().add(getCqLegend()); getCqLegend().setVisible(true); } public void setInfoPaletteActive() { - getController().setInfoPaletteActive(); - - } - - - /** - * Methdoe a surhcarger puor le cas des widgets. - */ - public void addWidgetLegendeCalque() { + getController().setInfoPaletteActive(); } @@ -874,23 +879,18 @@ return selection; } - - public ZEbliCalquesPanel duplicate() { + public ZEbliCalquesPanel duplicate(Map options) { /* * ZEbliCalquesPanel duplic = new ZEbliCalquesPanel(new CtuluUIDefault()); * - * // --pas besoin de duplication des groupes de calques --// - * duplic.gcDonnees_ = new BGroupeCalque(); + * // --pas besoin de duplication des groupes de calques --// duplic.gcDonnees_ = new BGroupeCalque(); * - * // -- mais le contenu si --// BCalque[] contenuAdupliquer = - * this.getDonneesCalque().getCalques(); + * // -- mais le contenu si --// BCalque[] contenuAdupliquer = this.getDonneesCalque().getCalques(); * - * // -- ajout des calques dupliques un a un --// for (int i = 0; i < - * contenuAdupliquer.length; i++) { + * // -- ajout des calques dupliques un a un --// for (int i = 0; i < contenuAdupliquer.length; i++) { * duplic.addCalque(contenuAdupliquer[i].duplicate()); } */ return null; } - - + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFillePanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFillePanel.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFillePanel.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -89,6 +89,8 @@ addMouseListener(_a.getRepereController()); addMouseWheelListener(_a.getRepereController()); lbTools_ = new JLabel(); + //le nom est important et r\xE9utilis\xE9 par d'autres + lbTools_.setName("lbTools"); lbTools_.setFont(BuLib.deriveFont("Label", Font.PLAIN, -2)); lbTools_.setPreferredSize(new Dimension(200, 20)); lbTools_.setSize(new Dimension(100, 20)); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -2,11 +2,14 @@ import java.awt.Dimension; import java.awt.Point; +import java.util.HashMap; import java.util.Map; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; +import com.sun.org.apache.bcel.internal.generic.GETSTATIC; + public class EbliNodeDefault implements EbliNode { EbliWidgetCreator creator; @@ -41,9 +44,10 @@ .setCreator(new EbliWidgetCreatorGraphe(((EbliWidgetCreatorGraphe) getCreator()).getGraphe().duplicate())); } else if (creator instanceof EbliWidgetCreatorVueCalque) { - + Map duplicOptions=new HashMap(); + duplicOptions.put("scene", getCreator().getWidget().getEbliScene()); duplique.setCreator(new EbliWidgetCreatorVueCalque(((EbliWidgetCreatorVueCalque) getCreator()).getCalque() - .duplicate())); + .duplicate(duplicOptions))); } else if (creator instanceof EbliWidgetCreatorShape) { Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetComponent.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetComponent.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetComponent.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -0,0 +1,190 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ebli.visuallibrary; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.geom.AffineTransform; + +import javax.swing.JComponent; + +import org.netbeans.api.visual.widget.Scene; + +/** + * @author deniger + */ +public class EbliWidgetComponent extends EbliWidget { + + private Component component; + private boolean componentAdded; + private boolean widgetAdded; + private double zoomFactor = Double.MIN_VALUE; + private ComponentSceneListener validateListener; + private ComponentComponentListener componentListener; + private boolean componentVisible = false; + + /** + * Creates a component widget. + * + * @param scene the scene + * @param component the AWT/Swing component + */ + public EbliWidgetComponent(EbliScene scene, Component component) { + super(scene); + this.component = component; + validateListener = null; + componentListener = new ComponentComponentListener(); + setComponentVisible(true); + } + + /** + * Returns a AWT/Swing component. + * + * @return the AWT/Swing component + */ + public final Component getComponent() { + return component; + } + + /** + * Returns whether the component should be visible. + * + * @return true if the component is visible + */ + public final boolean isComponentVisible() { + return componentVisible; + } + + /** + * Sets whether the component should be visible. + * + * @param componentVisible if true, then the component is visible + */ + public final void setComponentVisible(boolean componentVisible) { + if (this.componentVisible == componentVisible) return; + this.componentVisible = componentVisible; + attach(); + revalidate(); + } + + protected final void notifyAdded() { + widgetAdded = true; + attach(); + } + + protected final void notifyRemoved() { + widgetAdded = false; + } + + private void attach() { + if (validateListener != null) return; + validateListener = new ComponentSceneListener(); + getScene().addSceneListener(validateListener); + } + + private void detach() { + if (validateListener == null) return; + getScene().removeSceneListener(validateListener); + validateListener = null; + } + + /** + * Calculates a client area from the preferred size of the component. + * + * @return the calculated client area + */ + protected final Rectangle calculateClientArea() { + Dimension preferredSize = component.getPreferredSize(); + zoomFactor = getScene().getZoomFactor(); + preferredSize.width = (int) Math.floor(preferredSize.width / zoomFactor); + preferredSize.height = (int) Math.floor(preferredSize.height / zoomFactor); + return new Rectangle(preferredSize); + } + + private void addComponent() { + Scene scene = getScene(); + if (!componentAdded) { + scene.getView().add(component); + scene.getView().revalidate(); + component.addComponentListener(componentListener); + componentAdded = true; + } + component.removeComponentListener(componentListener); + component.setBounds(scene.convertSceneToView(convertLocalToScene(getClientArea()))); + component.addComponentListener(componentListener); + component.repaint(); + } + + private void removeComponent() { + Scene scene = getScene(); + if (componentAdded) { + component.removeComponentListener(componentListener); + scene.getView().remove(component); + scene.getView().revalidate(); + componentAdded = false; + } + } + + /** + * Paints the component widget. + */ + protected final void paintWidget() { + if (!componentVisible) { + boolean isDoubleBuffered = component instanceof JComponent && component.isDoubleBuffered(); + if (isDoubleBuffered) ((JComponent) component).setDoubleBuffered(false); + Graphics2D graphics = getGraphics(); + Rectangle bounds = getClientArea(); + AffineTransform previousTransform = graphics.getTransform(); + graphics.translate(bounds.x, bounds.y); + double zoomFactor = getScene().getZoomFactor(); + graphics.scale(1 / zoomFactor, 1 / zoomFactor); + component.print(graphics); + graphics.setTransform(previousTransform); + if (isDoubleBuffered) ((JComponent) component).setDoubleBuffered(isDoubleBuffered); + } + } + + private final class ComponentSceneListener implements Scene.SceneListener { + + public void sceneRepaint() {} + + public void sceneValidating() { + double newZoomFactor = getScene().getZoomFactor(); + if (Math.abs(newZoomFactor - zoomFactor) != 0.0) { + revalidate(); + zoomFactor = newZoomFactor; + } + } + + public void sceneValidated() { + if (widgetAdded && componentVisible) addComponent(); + else { + removeComponent(); + detach(); + } + } + } + + private final class ComponentComponentListener implements ComponentListener { + + public void componentResized(ComponentEvent e) { + revalidate(); + } + + public void componentMoved(ComponentEvent e) { + revalidate(); + } + + public void componentShown(ComponentEvent e) {} + + public void componentHidden(ComponentEvent e) {} + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorRectangleTexte.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorRectangleTexte.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorRectangleTexte.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -1,6 +1,5 @@ package org.fudaa.ebli.visuallibrary; -import org.fudaa.ebli.courbe.EGGraphe; public class EbliWidgetCreatorRectangleTexte implements EbliWidgetCreator { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetRectangle.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -19,7 +19,7 @@ * Legende Widget qui permet de construire des rectangles avec du texte * * @author Adrien Hadoux - * + * TODO a generaliser avec autre chose qu'un LabelWidget */ public class EbliWidgetRectangle extends EbliWidget implements TextFieldInplaceEditor { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliActionEditorOneClick.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliActionEditorOneClick.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliActionEditorOneClick.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -46,6 +46,8 @@ */ public State mouseClicked(Widget widget, WidgetMouseEvent event) { if (event.getButton() == MouseEvent.BUTTON1 /*&& event.getClickCount() == 2*/) { + Point p=event.getPoint(); + if(widget.getClientArea().contains(p)) if (openEditor(widget)) return State.createLocked(widget, this); } 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-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -15,7 +15,7 @@ /** * Classe qui genere une widget editeur de texte. - * + * TODO a enlever * @author Adrien Hadoux * */ Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorCalqueLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorCalqueLegende.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorCalqueLegende.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -1,42 +1,39 @@ package org.fudaa.ebli.visuallibrary.calque; -import java.awt.Dimension; - import org.fudaa.ebli.calque.BCalqueLegendePanel; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetComponent; import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; public class EbliWidgetCreatorCalqueLegende implements EbliWidgetCreator { BCalqueLegendePanel calque; - EbliWidgetCalqueLegende res; - - - public BCalqueLegendePanel getCalque() { - return calque; - } + EbliWidget res; - public void setCalque(BCalqueLegendePanel calque) { - this.calque = calque; - } - - - public EbliWidgetCreatorCalqueLegende(BCalqueLegendePanel legende) { super(); this.calque = legende; } public EbliWidget create(EbliScene _scene) { - res = new EbliWidgetCalqueLegende(_scene, calque); - res.setPreferredSize(new Dimension(200, 200)); + // calque.setPreferredSize(new Dimension(200, 200)); + res = new EbliWidgetComponent(_scene, calque); + res.setCheckClipping(true); return res; } + public BCalqueLegendePanel getCalque() { + return calque; + } + public EbliWidget getWidget() { // TODO Auto-generated method stub return res; } + public void setCalque(BCalqueLegendePanel calque) { + this.calque = calque; + } + } 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-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -66,10 +66,11 @@ // GrBoite zoom_; - public EbliWidgetVueCalque(EbliScene scene, ZEbliCalquesPanel vue) { - super(scene); - calquePanel_ = vue; - calquePanel_.setBorder(BuBorders.EMPTY1111); + public EbliWidgetVueCalque(EbliScene _scene, ZEbliCalquesPanel _vue) { + super(_scene); + calquePanel_ = _vue; + calquePanel_.setBorder(null); +// calquePanel_.setBorder(BuBorders.EMPTY1111); // FIXME a enlever par la suite setPreferredSize(new Dimension(500, 400)); @@ -85,6 +86,7 @@ WidgetAction editorAction = new EbliActionEditorOneClick<BuPanel>(this); // -- ajout de l action au widget correspondant --// this.getActions().addAction(editorAction); + _vue.addCqLegende(new EbliWidgetCalqueLegende(_scene)); } @@ -120,7 +122,7 @@ image = null; getEbliScene().refresh(); - calquePanel_.setBorder(BuBorders.EMPTY1111); +// calquePanel_.setBorder(BuBorders.EMPTY1111); this.repaint(); } @@ -193,6 +195,8 @@ protected void paintWidget() { Rectangle rec = getClientArea(); + rec.width-=1; + rec.height-=1; Graphics2D g = getGraphics(); if (frame_ == null) { @@ -268,7 +272,7 @@ // EbliWidgetVueCalque.this.getEbliScene().addNode(nodeLegende); // methode qui permet d ajouter une legemde - calquePanel_.addWidgetLegendeCalque(); +// calquePanel_.addWidgetLegendeCalque(); EbliWidgetVueCalque.this.getEbliScene().refresh(); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -22,6 +22,7 @@ import javax.swing.SwingUtilities; import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.ctulu.image.CtuluLibImage; import org.fudaa.ebli.courbe.EGAxe; import org.fudaa.ebli.courbe.EGConfigureActionPalette; @@ -48,7 +49,6 @@ * widget qui contient un objet graphe * * @author adrien hadoux - * */ public class EbliWidgetGraphe extends EbliWidget implements /* EditProvider */InplaceEditorProvider<BuPanel>, EGGrapheModelListener { @@ -58,7 +58,7 @@ EGFillePanel panelGraphe_; BuPanel conteneurEditor; - + private EbliNodeDefault nodeLegende = null; public Color couleurContour = Color.black; @@ -76,23 +76,21 @@ public EbliWidgetGraphe(EbliScene scene, Point preferredLocation, EGFillePanel _pn) { super(scene); panelGraphe_ = _pn; + panelGraphe_.setBorder(null); + panelGraphe_.remove(CtuluLibSwing.findChildByName(panelGraphe_, "lbTools")); // WidgetAction editorAction = ActionFactory.createEditAction(this); // WidgetAction editorAction = // ActionFactory.createInplaceEditorAction(this); WidgetAction editorAction = new EbliActionEditorOneClick<BuPanel>(this); // -- ajout de l action au widget correspondant --// this.getActions().addAction(editorAction); - - + panelGraphe_.getGraphe().getModel().addModelListener(this); - + } public EbliWidgetGraphe(EbliScene scene, Point preferredLocation, EGGraphe _graphe) { this(scene, preferredLocation, new EGFillePanel(_graphe)); - // -- creation de l action pour editor --// - // WidgetAction editorAction = - // ActionFactory.createInplaceEditorAction(this); } @@ -101,7 +99,7 @@ protected void paintWidget() { Rectangle rec = getClientArea(); Graphics2D g = getGraphics(); - g.translate(rec.x, rec.y); +// g.translate(rec.x, rec.y); if (frame_ == null) { getGraphe().setSize(rec.width - 1, rec.height - 1); @@ -109,20 +107,18 @@ // getGraphe().dessine(g, rec.width - 1, rec.height - 1, false); } - // mode edition if (image == null || image.getWidth() != rec.width || image.getHeight() != rec.height) { FuLog.debug("EWI: recreate image"); Map params = new HashMap(); CtuluLibImage.setCompatibleImageAsked(params); // a ameliorer: il ne faudrait pas recreer l'image a chaque fois - image = getGraphe().produceImage(rec.width, rec.height, params); + image = getGraphe().produceImage(rec.width-1, rec.height-1, params); } - g.drawImage(image, rec.x, rec.y, rec.width, rec.height, null); - + g.drawImage(image, rec.x, rec.y, rec.width-1, rec.height-1, null); - g.translate(-rec.x, -rec.y); +// g.translate(-rec.x, -rec.y); } /** @@ -133,19 +129,17 @@ public JPopupMenu getPopupMenu(Widget widget, Point localLocation) { JPopupMenu popup = new JPopupMenu(); - - // -- Menu sp\xF6cifiques a l'application--// + // -- Menu sp\xF6cifiques a l'application--// constructPopupMenuSpecifique(popup); - + // -- creation du menu commun a tous les widgets constructPopupMenuBase(popup); - return popup; } })); } - + /** * ajoutant la possibilit\xE9 de configurer la courbe ainsi que la l\xE9gende * @@ -179,7 +173,7 @@ nodeLegende.setPreferedSize(new Dimension(100, 100)); EbliWidgetGraphe.this.getEbliScene().addNode(nodeLegende); - //widgetLegende=WidgetLegendeManager.createLegende(EbliWidgetGraphe. + // widgetLegende=WidgetLegendeManager.createLegende(EbliWidgetGraphe. // this.getGraphe(), // EbliWidgetGraphe.this.getScene_(),nouvellePosition); EbliWidgetGraphe.this.getEbliScene().refresh(); @@ -192,41 +186,37 @@ }); // -- creation du menu config de la courbe - + _popup.add(new EGConfigureActionPalette(getGraphe().getModel())); - } public BuPanel createEditorComponent( org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget) { - conteneurEditor = new BuPanel(new BorderLayout()); - conteneurEditor.add(this.panelGraphe_, BorderLayout.CENTER); + // conteneurEditor = new BuPanel(new BorderLayout()); + // conteneurEditor.add(this.panelGraphe_, BorderLayout.CENTER); - BuButton fonctionsCompletes = new BuButton("Ouvrir dans une fen\xEAtre", BuResource.BU.getIcon("crystal_valider")); - fonctionsCompletes.addActionListener(new ActionListener() { + // BuButton fonctionsCompletes = new BuButton("Ouvrir dans une fen\xEAtre", BuResource.BU.getIcon("crystal_valider")); + // fonctionsCompletes.addActionListener(new ActionListener() { + // + // public void actionPerformed(ActionEvent e) { + // // Cree la frame de docking associee au graphe + // edit(EbliWidgetGraphe.this); + // } + // + // }); + // conteneurEditor.add(fonctionsCompletes, BorderLayout.SOUTH); - public void actionPerformed(ActionEvent e) { - // Cree la frame de docking associee au graphe - edit(EbliWidgetGraphe.this); - } - - }); - conteneurEditor.add(fonctionsCompletes, BorderLayout.SOUTH); - - return conteneurEditor; + return panelGraphe_; } - public void notifyClosing(org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - Widget widget, BuPanel editor, boolean commit) { - } + Widget widget, BuPanel editor, boolean commit) {} // TODO a changer pour ne recreer tout plein de listener a chaque fois /** - * Ancienne version de edit(). genere une frame complete pour prametrer le - * graphe. + * Ancienne version de edit(). genere une frame complete pour prametrer le graphe. */ public void edit(Widget _widget) { if (frame_ != null) frame_.toFront(); @@ -256,7 +246,7 @@ image = null; getEbliScene().refresh(); frame_ = null; - + // YODA:RAJOUTER LE GRAPHE DANS EDITOR TU DOIS CAR DANS FRAME IL // EST conteneurEditor.add(panelGraphe_, BorderLayout.CENTER); @@ -270,7 +260,6 @@ } - public EnumSet<org.netbeans.api.visual.action.InplaceEditorProvider.ExpansionDirection> getExpansionDirections( org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget, BuPanel editor) { return null; @@ -279,14 +268,14 @@ public Rectangle getInitialEditorComponentBounds( org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget, BuPanel editor, Rectangle viewBounds) { - return null; + Rectangle rec= convertLocalToScene(getClientArea()); + rec.width-=1; + rec.height-=1; + return rec; } - - public void notifyOpened(org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, - Widget widget, BuPanel editor) { - } + Widget widget, BuPanel editor) {} public void axeAspectChanged(EGAxe _c) { // il faut indiquer que l image a ete modifiee donc la forcer a se repaindre @@ -295,25 +284,25 @@ } public void axeContentChanged(EGAxe _c) { - // il faut indiquer que l image a ete modifiee donc la forcer a se repaindre + // il faut indiquer que l image a ete modifiee donc la forcer a se repaindre this.image = null; this.repaint(); } public void courbeAspectChanged(EGObject _c, boolean _visibil) { - // il faut indiquer que l image a ete modifiee donc la forcer a se repaindre + // il faut indiquer que l image a ete modifiee donc la forcer a se repaindre this.image = null; this.repaint(); } public void courbeContentChanged(EGObject _c, boolean restore) { - // il faut indiquer que l image a ete modifiee donc la forcer a se repaindre + // il faut indiquer que l image a ete modifiee donc la forcer a se repaindre this.image = null; this.repaint(); } public void structureChanged() { - // il faut indiquer que l image a ete modifiee donc la forcer a se repaindre + // il faut indiquer que l image a ete modifiee donc la forcer a se repaindre this.image = null; this.repaint(); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -463,7 +463,7 @@ bar.add(new EbliWidgetActionImageChooser(scene)); - bar.add(new EbliWidgetActiontextEditor(scene)); +// bar.add(new EbliWidgetActiontextEditor(scene)); p.doLayout(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -134,8 +134,8 @@ infoSoft = new BuInformationsSoftware(); infoSoft.name = "prepro"; - infoSoft.version = "0.92-MAQUETTE"; - infoSoft.date = "2008-08-18"; + infoSoft.version = "0.92-MAQUETTE-V2"; + infoSoft.date = "2008-08-26"; infoSoft.rights = TrResource.getS("Tous droits r\xE9serv\xE9s") + ". CETMEF (c)2003-2007"; infoSoft.contact = "fre...@fu..."; infoSoft.license = "GPL2"; 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-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -26,6 +26,8 @@ import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGSpecificActions; +import org.fudaa.ebli.courbe.EGTree; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionConfigure; @@ -45,12 +47,10 @@ import com.memoire.bu.BuToolBar; import com.memoire.bu.BuUndoRedoInterface; - /** * InternalFrame qui contient la scene EbliScene. * * @author Adrien Hadoux - * */ public class TrPostLayoutFille extends BuInternalFrame implements CtuluFilleWithComponent, CtuluUndoRedoInterface, BuUndoRedoInterface, BuCutCopyPasteInterface, ObjectSceneListener { @@ -76,12 +76,11 @@ * Toolbar modifiable qui se met a jour selon la selection de la widget. */ BuToolBar toolBarModifiable_ = new BuToolBar(); - + BuMenuBar menuModifiable_ = new BuMenuBar(); - + /** - * Scroll qui contient le tree a droite. Ce panel est modifi\xE9 des que l on - * change de type d elements. + * Scroll qui contient le tree a droite. Ce panel est modifi\xE9 des que l on change de type d elements. */ JScrollPane panelTreeModifiable_; @@ -89,12 +88,12 @@ * Panel qui contient le tree modifiable */ JPanel conteneurTree_; - + /** * bouton qui permet de masquer/afficher le tree */ JButton toggleTree_; - + /** * Constructeur de la fenetre. */ @@ -104,18 +103,16 @@ // creation de la scene EBLI controller_ = new TrPostLayoutPanelController(new TrPostScene(), _projet); setContentPane(controller_.getPanel()); - + // -- enregistrement de this comem listener de la scene pour le type d objet // selection changed--// controller_.getScene().addObjectSceneListener(this, ObjectSceneEventType.OBJECT_SELECTION_CHANGED); - - - + // -- ajout de la toolbar et du menu en haut --// toolBarModifiable_.setFloatable(false); this.add(toolBarModifiable_, BorderLayout.NORTH); this.setJMenuBar(menuModifiable_); - + // -- init du panel de choix des trees --// panelTreeModifiable_ = new JScrollPane(controller_.createTree()); @@ -127,9 +124,8 @@ * @param _preferedDimension * @param _calque * @return - * @see org.fudaa.fudaa.tr.post.TrPostLayoutPanelController#addCalque(java.lang.String, - * java.awt.Point, java.awt.Dimension, - * org.fudaa.ebli.calque.ZEbliCalquesPanel) + * @see org.fudaa.fudaa.tr.post.TrPostLayoutPanelController#addCalque(java.lang.String, java.awt.Point, + * java.awt.Dimension, org.fudaa.ebli.calque.ZEbliCalquesPanel) */ public EbliNode addCalque(String _title, Point _preferredLocation, Dimension _preferedDimension, ZEbliCalquesPanel _calque) { @@ -165,30 +161,28 @@ 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)); toggleTree_.setText("Composants"); - + panelTreeModifiable_ = new JScrollPane(controller_.createTree()); - // right.add(panelTreeModifiable_, BorderLayout.CENTER); + // 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); - + // --verification qu il n existe pas de composant sur la scene auquel cas, // selection automatique pour modification --// - if(controller_!=null){ - Set<EbliNode> noeudContenus = (Set<EbliNode>) controller_.getScene().getObjects(); - if(noeudContenus.size()==1) - getScene().setSelectedObjects(noeudContenus); - getScene().refresh(); + if (controller_ != null) { + Set<EbliNode> noeudContenus = (Set<EbliNode>) controller_.getScene().getObjects(); + if (noeudContenus.size() == 1) getScene().setSelectedObjects(noeudContenus); + getScene().refresh(); + } } - } return right; } @@ -229,8 +223,7 @@ } /** - * Methode utilisee dans la classe fille TrPostFille pour recuperer le calque - * principal et enregistrer. + * Methode utilisee dans la classe fille TrPostFille pour recuperer le calque principal et enregistrer. * * @return */ @@ -238,8 +231,7 @@ return getCalquePrincipal(); } - public void majComponent(Object _o) { - } + public void majComponent(Object _o) {} public void redo() { final CtuluCommandManager c = getCmdMng(); @@ -248,8 +240,7 @@ } } - public void setActive(final boolean _b) { - } + public void setActive(final boolean _b) {} public void undo() { final CtuluCommandManager c = getCmdMng(); @@ -258,47 +249,43 @@ } } - // liste des noeuds copies Set<EbliNode> nodesCopyied = null; // liste des noeuuds coupes Set<EbliNode> nodesCutted = null; + public void copy() { JOptionPane.showMessageDialog(null, "copy()"); // on copie la widget selectionnee // ie on fait une duplication partielle // on ajoute pas tout de suite le noeud dans la scene - - - //--recuperation des noeuds a copier --// + + // --recuperation des noeuds a copier --// nodesCopyied = (Set<EbliNode>) getScene().getSelectedObjects(); - + // -- reinit de la commande cut si on voulait faire un ctrl+x nodesCutted = null; } public void cut() { JOptionPane.showMessageDialog(null, "cut()"); - + // --recuperation des noeuds a copier --// nodesCutted = (Set<EbliNode>) getScene().getSelectedObjects(); - // enlever les nodes de la scene for (Iterator<EbliNode> it = nodesCutted.iterator(); it.hasNext();) { EbliNode node = it.next(); // le node existe toujours apres l'avoir enleve getScene().removeNode(node); - - - + } - + // reinit de la liste des noeuds a copier au cas ou on change d avis nodesCopyied = null; - + } public void duplicate() { @@ -306,26 +293,24 @@ } public void paste() { - - //TODO a ameliorer : TENIR COMPTE DE LA POSITION DE LA SOURIS - + + // TODO a ameliorer : TENIR COMPTE DE LA POSITION DE LA SOURIS + JOptionPane.showMessageDialog(null, "paste()"); - + // --recuperation des noeuds copies --// if (nodesCopyied != null) { - - - for (Iterator<EbliNode> it = nodesCopyied.iterator(); it.hasNext();) { - EbliNode node = it.next(); - // --duplication du node --// - node.duplicate(null); - } - // reinititalisation de la liste + + for (Iterator<EbliNode> it = nodesCopyied.iterator(); it.hasNext();) { + EbliNode node = it.next(); + // --duplication du node --// + node.duplicate(null); + } + // reinititalisation de la liste nodesCopyied = null; - - }else if (nodesCutted != null) { - - + + } else if (nodesCutted != null) { + for (Iterator<EbliNode> it = nodesCutted.iterator(); it.hasNext();) { EbliNode node = it.next(); // --ajout du node --// @@ -333,73 +318,56 @@ } // reinit de la liste nodesCutted = null; + } } - } // ---methode du listener d ecoute de la scene /** - * Called to notify that an object was added to an object scene. This is - * called when an object-widget mapping is registered in an ObjectScene only. - * At the moment of the call, the object is still not reqistered in the - * Graph*Scene classes yet. Therefore do not use the methods of Graph*Scene. + * Called to notify that an object was added to an object scene. This is called when an object-widget mapping is + * registered in an ObjectScene only. At the moment of the call, the object is still not reqistered in the Graph*Scene + * classes yet. Therefore do not use the methods of Graph*Scene. * * @param event * @param addedObject */ - public void objectAdded(ObjectSceneEvent event, Object addedObject) { - } + public void objectAdded(ObjectSceneEvent event, Object addedObject) {} /** - * Called to notify that an object was removed from an object scene. This is - * called when an object-widget mapping is unregistered in an ObjectScene and - * Graph*Scene classes. At the moment of the call, a widget (visual - * representation of the object) is still in the scene. Therefore do not rely - * on a tree of widgets of the scene. + * Called to notify that an object was removed from an object scene. This is called when an object-widget mapping is + * unregistered in an ObjectScene and Graph*Scene classes. At the moment of the call, a widget (visual representation + * of the object) is still in the scene. Therefore do not rely on a tree of widgets of the scene. * - * @param event - * the object scene event - * @param removedObject - * the removed object + * @param event the object scene event + * @param removedObject the removed object */ - public void objectRemoved(ObjectSceneEvent event, Object removedObject) { - } + public void objectRemoved(ObjectSceneEvent event, Object removedObject) {} /** - * Called to notify that the object state of an object is changed. This method - * is always called before any other ObjectSceneListener method is called. + * Called to notify that the object state of an object is changed. This method is always called before any other + * ObjectSceneListener method is called. * - * @param event - * the object scene event - * @param changedObject - * the object with changed object state - * @param previousState - * the previous object state - * @param newState - * the new object state + * @param event the object scene event + * @param changedObject the object with changed object state + * @param previousState the previous object state + * @param newState the new object state */ public void objectStateChanged(ObjectSceneEvent event, Object changedObject, ObjectState previousState, - ObjectState newState) { - } + ObjectState newState) {} /** * Called to notify that the object-selection is changed. * - * @param event - * the object scene event - * @param previousSelection - * the set of previously selected objects - * @param newSelection - * the set of newly selected objects + * @param event the object scene event + * @param previousSelection the set of previously selected objects + * @param newSelection the set of newly selected objects */ public void selectionChanged(ObjectSceneEvent event, Set<Object> previousSelection, Set<Object> newSelection) { - - + // cas ou de multiples objets sont selectionnes, on ne fait rien pour le // moment // A voir pour une fonctionnalit\xE9 magique - if (newSelection != null && newSelection.size() > 1) - return; + if (newSelection != null && newSelection.size() > 1) return; else if (newSelection == null || newSelection.size() == 0) { // -- cas particulier: on met le tree des calques et pas de toolbar --// changeTreeScene(); @@ -407,132 +375,118 @@ return; } EbliNode node = (EbliNode) newSelection.iterator().next(); - + + // TODO a gerer de maniere Generique + // 3 cas pour le moment: graphe ou calque ou rien - if(!node.hasWidget()) - return; + if (!node.hasWidget()) return; if (node.getCreator() instanceof EbliWidgetCreatorVueCalque) { - // -- etape 1: ajout du tree de calque dans fudaaImplementation --// changeTreeCalque(((EbliWidgetCreatorVueCalque) node.getCreator()).getCalque()); - + // -- etape 2: rechargement de la toolbar specifique dans this --// changeToolbarCalque(((EbliWidgetCreatorVueCalque) node.getCreator()).getCalque()); - - + } else if (node.getCreator() instanceof EbliWidgetCreatorGraphe) { - - + // -- etape 1: ajout du tree de graphe dans fudaaImplementation --// changeTreeGraphe(((EbliWidgetCreatorGraphe) node.getCreator()).getGraphe()); // -- etape 2: rechargement de la toolbar specifique dans this --// changeToolbarGraphe(((EbliWidgetCreatorGraphe) node.getCreator()).getGraphePanel()); } else { - + // -- etape 1: on fout eventuellement le tree des layouts --// changeTreeScene(); // -- etape 2: rechargement de la toolbar specifique dans this --// changeToolbarScene(); } - + } /** * Called to notify that the object-highlighting is changed. * - * @param event - * the object scene event - * @param previousHighlighting - * the set of previously highlighted objects - * @param newHighlighting - * the set of newly highlighted objects + * @param event the object scene event + * @param previousHighlighting the set of previously highlighted objects + * @param newHighlighting the set of newly highlighted objects */ - public void highlightingChanged(ObjectSceneEvent event, Set<Object> previousHighlighting, Set<Object> newHighlighting) { - } + public void highlightingChanged(ObjectSceneEvent event, Set<Object> previousHighlighting, Set<Object> newHighlighting) {} /** * Called to notify that the object-hovering is changed. * - * @param event - * the object scene event - * @param previousHoveredObject - * the previous hovered object; null if there was no hovered object - * @param newHoveredObject - * the new hovered object; null if there is no hovered object + * @param event the object scene event + * @param previousHoveredObject the previous hovered object; null if there was no hovered object + * @param newHoveredObject the new hovered object; null if there is no hovered object */ - public void hoverChanged(ObjectSceneEvent event, Object previousHoveredObject, Object newHoveredObject) { - } + public void hoverChanged(ObjectSceneEvent event, Object previousHoveredObject, Object newHoveredObject) {} /** * Called to notify that the object-focus is changed. * - * @param event - * the object scene event - * @param previousFocusedObject - * the previously focused object; null if there was no focused object - * @param newFocusedObject - * the newly focused object; null if there is no focused object + * @param event the object scene event + * @param previousFocusedObject the previously focused object; null if there was no focused object + * @param newFocusedObject the newly focused object; null if there is no focused object */ - public void focusChanged(ObjectSceneEvent event, Object previousFocusedObject, Object newFocusedObject) { - } + public void focusChanged(ObjectSceneEvent event, Object previousFocusedObject, Object newFocusedObject) {} - { - } + {} /** - * Methode qui met a jour le tree de droite avec le tree du calque - * selectionne. + * Methode qui met a jour le tree de droite avec le tree du calque selectionne. * * @param calque */ private void changeTreeCalque(ZEbliCalquesPanel _calque) { - conteneurTree_.remove(panelTreeModifiable_); - + // JComponent component = EbliWidgetEditCreator.createView(new // BArbreCalque(_calque.getArbreCalqueModel()), // EbliResource.EBLI.getToolIcon("arbre"), "Calques", false); + //TODO dangereux car chaque arbre s'enregistre en tant que listener du calque et il ne d\xE9sabonne jamais. panelTreeModifiable_ = new JScrollPane(new BArbreCalque(_calque.getArbreCalqueModel())); // panelTreeModifiable_ = new JScrollPane(component); - + this.toggleTree_.setText("Calques"); - + conteneurTree_.add(panelTreeModifiable_, BorderLayout.CENTER); // mise a jour du panel conteneurTree_.validate(); panelTreeModifiable_.revalidate(); } - + /** - * Methode qui met a jour le tree de droite avec le tree du graphe - * selectionne. + * Methode qui met a jour le tree de droite avec le tree du graphe selectionne. * * @param _graphe */ private void changeTreeGraphe(EGGraphe _graphe) { - conteneurTree_.remove(panelTreeModifiable_); // JComponent component = EbliWidgetEditCreator.createView(new // JTree((EGGrapheTreeModel) _graphe.getModel()), // EbliResource.EBLI.getToolIcon("arbre"), "Courbes", false); - - //POUR TOI LA FORCE AVOIR LE SELECTION MODEL A TOI ATTACHER TU DOIS// - JTree yoda = new JTree((EGGrapheTreeModel) _graphe.getModel()); - yoda.setSelectionModel(((EGGrapheTreeModel) _graphe.getModel()).getSelectionModel()); - panelTreeModifiable_ = new JScrollPane(yoda); - if (this.toggleTree_ != null) - this.toggleTree_.setText("Courbes"); + + // POUR TOI LA FORCE AVOIR LE SELECTION MODEL A TOI ATTACHER TU DOIS// + // utiliser EGTree + EGTree tree = new EGTree(); + tree.setExpandsSelectedPaths(true); + tree.setActions(new EGSpecificActions(_graphe)); + EGGrapheTreeModel treeModel = (EGGrapheTreeModel) _graphe.getModel(); + tree.setModel(treeModel); + tree.setSelectionModel(treeModel.getSelectionModel()); + panelTreeModifiable_ = new JScrollPane(tree); + if (this.toggleTree_ != null) this.toggleTree_.setText("Courbes"); // panelTreeModifiable_ = new JScrollPane(component); conteneurTree_.add(panelTreeModifiable_, BorderLayout.CENTER); // mise a jour du panel conteneurTree_.validate(); panelTreeModifiable_.revalidate(); - + } - + /** * Met a jour le tree a droite si ni un graphe ni un calque n est selectionn\xE9. */ @@ -543,28 +497,26 @@ // EbliResource.EBLI // .getToolIcon("arbre"), "Composants", false); - panelTreeModifiable_ = new JScrollPane(controller_.createTree()); - if (this.toggleTree_ != null) - this.toggleTree_.setText("Liste des composants"); + panelTreeModifiable_ = new JScrollPane(controller_.createTree()); + if (this.toggleTree_ != null) this.toggleTree_.setText("Liste des composants"); // panelTreeModifiable_ = new JScrollPane(component); conteneurTree_.add(panelTreeModifiable_, BorderLayout.CENTER); // mise a jour du panel conteneurTree_.validate(); panelTreeModifiable_.revalidate(); } - - + /** * Methode qui modifie la toolbar associee au calque selectionne * * @param _calque */ private void changeToolbarCalque(ZEbliCalquesPanel _calque) { - + // nettoyage de la toolbar toolBarModifiable_.removeAll(); menuModifiable_.removeAll(); - + // ajout des tool specifiques du calque List actions = _calque.getController().getActions(); for (Iterator iterator = actions.iterator(); iterator.hasNext();) { @@ -575,29 +527,28 @@ toolBarModifiable_.add(object.buildToolButton(EbliComponentFactory.INSTANCE)); } } - + // ajout des menus specifiques pour le calque JMenu[] specificMenus = _calque.getSpecificMenus(EbliLib.getS("Vue 2D")); for (int i = 0; i < specificMenus.length; i++) { menuModifiable_.add(specificMenus[i]); } - + // mise a jour des params toolBarModifiable_.revalidate(); menuModifiable_.revalidate(); this.setJMenuBar(menuModifiable_); this.revalidate(); - + } - + private void changeToolbarGraphe(EGFillePanel _graphe) { // nettoyage de la toolbar toolBarModifiable_.removeAll(); menuModifiable_.removeAll(); - - + // ajout des toolbar specifiques du calque EbliActionInterface[] specificInterfaces = _graphe.getSpecificActions(); for (int i = 0; i < specificInterfaces.length; i++) { @@ -608,24 +559,24 @@ toolBarModifiable_.add(object.buildToolButton(EbliComponentFactory.INSTANCE)); } } - + // ajout des menus specifiques JMenu menu = new JMenu("Menu graphe"); _graphe.fillSpecificMenu(menu); menuModifiable_.add(menu); - + // mise a jour des params toolBarModifiable_.revalidate(); menuModifiable_.revalidate(); this.setJMenuBar(menuModifiable_); this.revalidate(); } - + private void changeToolbarScene() { // nettoyage de la toolbar toolBarModifiable_.removeAll(); menuModifiable_.removeAll(); - + toolBarModifiable_.add(new EbliWidgetActionConfigure(controller_.getScene())); JMenu menu = new JMenu("Configurer"); menu.add(new EbliWidgetActionConfigure(controller_.getScene())); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -39,6 +39,7 @@ import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionImageChooser; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRetaillageHorizontal; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRetaillageVertical; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorCalqueLegende; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorCircle; @@ -429,7 +430,7 @@ "WIDGETRECALQUE") { public void actionPerformed(ActionEvent _evt) { - TrPostVisuPanel pnVisu =new TrPostVisuPanel(projet_.getImpl(),projet_); + TrPostVisuPanel pnVisu =new TrPostVisuPanel(projet_.getImpl(),projet_,new EbliWidgetCalqueLegende(getScene())); addCalque("Calque principal", pnVisu.getLocation(), pnVisu.getPreferredSize(), pnVisu); } }); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -15,6 +15,7 @@ import java.beans.PropertyVetoException; import java.io.File; import java.io.IOException; +import java.util.Map; import java.util.Observable; import java.util.Observer; import java.util.Set; @@ -59,12 +60,14 @@ import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.dodico.h2d.type.H2dVariableTypeCreated; import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; @@ -468,7 +471,7 @@ final TrPostProjet trPostProjet = new TrPostProjet(projection, impl_); // creation du panel de visualisation du posttraitement - final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl_, trPostProjet, projection.getNbFleche() == 0); + final TrPostVisuPanel pnVisu = new TrPostVisuPanel(impl_, trPostProjet, projection.getNbFleche() == 0,new BCalqueLegende()); // creation de l internalframe qui contient le panel de visu // final TrPostFille compFille = new TrPostFille(pnVisu); @@ -642,7 +645,7 @@ } protected TrPostVisuPanel buildVisuPanel() { - return new TrPostVisuPanel(impl_, this); + return new TrPostVisuPanel(impl_, this,new EbliWidgetCalqueLegende(filleLayout_.getScene())); } /** @@ -808,12 +811,13 @@ new CtuluTaskOperationGUI(impl_, TrResource.getS("Ouverture vue 2D...")) { public void act() { + filleLayout_ = new TrPostLayoutFille(TrPostProjet.this); final TrPostVisuPanel pnVisu = buildVisuPanel(); // fille_ = new TrPostFille(pnVisu); // --creation de l internalframe layout --// - filleLayout_ = new TrPostLayoutFille(TrPostProjet.this); + // -- ajout du visuPanel au layout --// filleLayout_.addCalque("Calque principal", pnVisu.getLocation(), pnVisu.getPreferredSize(), pnVisu); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetRubar.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetRubar.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetRubar.java 2008-08-24 22:26:37 UTC (rev 3832) @@ -19,6 +19,7 @@ import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.h2d.resource.H2dResource; +import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.fudaa.tr.common.TrResource; @@ -127,6 +128,6 @@ } protected TrPostVisuPanel buildVisuPanel() { - return new TrPostVisuPanelRubar(super.impl_, this); + return new TrPostVisuPanelRubar(super.impl_, this,new BCalqueLegende()); } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceComparatorBuilder.java 2008-08-21 20:14:24 UTC (rev 3831) +++ branches/Prepr... [truncated message content] |