From: <de...@us...> - 2008-12-10 23:38:42
|
Revision: 4293 http://fudaa.svn.sourceforge.net/fudaa/?rev=4293&view=rev Author: deniger Date: 2008-12-10 23:38:37 +0000 (Wed, 10 Dec 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsCorrectionActivity.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsCorrectionTester.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsDefault.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsI.java branches/Prepro-0.92-SNAPSHOT/dodico/test/org/fudaa/dodico/ef/TestJLineIntersection.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueRepereInteraction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionAbstract.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionMulti.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionSimple.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliLib.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGInteractionSelection.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/EbliSceneController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.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/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoteTester.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/TrPostVisuPanelPersistManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsCorrectionActivity.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsCorrectionActivity.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsCorrectionActivity.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -13,6 +13,7 @@ import java.util.List; import org.fudaa.ctulu.CtuluActivity; +import org.fudaa.ctulu.CtuluVariable; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; @@ -31,7 +32,7 @@ public EfLineIntersectionsResultsI correct(EfLineIntersectionsResultsI _res, EfLineIntersectionsCorrectionTester _tester, int _tidx, ProgressionInterface _prog) { stop_ = false; - if (_tester == null || _res == null || _res.isEmpty()) return _res; + if (_tester == null || _res == null || _res.isEmpty() || !_tester.isEnableFor(_res)) return _res; int nbNew = _res.getNbIntersect() + 15; BitSet isOut = new BitSet(nbNew); final List setIn = new ArrayList(2); @@ -130,5 +131,9 @@ return out_.get(_idxInters); } + public boolean isDataAvailable(CtuluVariable _v) { + return res_.isDataAvailable(_v); + } + } } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsCorrectionTester.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsCorrectionTester.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsCorrectionTester.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -14,6 +14,12 @@ * @version $Id: EfLineIntersectionsCorrectionTester.java,v 1.1 2007-06-13 12:55:42 deniger Exp $ */ public interface EfLineIntersectionsCorrectionTester { + + /** + * @param _res le r\xE9sultat qui sera corrig\xE9 + * @return true si cette correction est active pour le resultat donne + */ + boolean isEnableFor(EfLineIntersectionsResultsI _res); boolean createNews(int _tidx, EfLineIntersection _i1, EfLineIntersection _i2, List _setNewIn); Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsDefault.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsDefault.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -7,6 +7,8 @@ */ package org.fudaa.dodico.ef.operation; +import org.fudaa.ctulu.CtuluVariable; + /** * @author fred deniger * @version $Id: EfLineIntersectionsResultsDefault.java,v 1.1 2007-06-13 12:55:43 deniger Exp $ @@ -52,4 +54,8 @@ return mng_.isSegmentOut(_idxInters); } + public boolean isDataAvailable(CtuluVariable _v) { + return mng_.getGridData().getData().isDefined(_v); + } + } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsI.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsI.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsI.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -7,6 +7,8 @@ */ package org.fudaa.dodico.ef.operation; +import org.fudaa.ctulu.CtuluVariable; + /** * @author fred deniger * @version $Id: EfLineIntersectionsResultsI.java,v 1.1 2007-06-13 12:55:42 deniger Exp $ @@ -28,5 +30,11 @@ boolean isSegmentOut(final int _idxInters); boolean isForMesh(); + + /** + * @param _v la variable a tester + * @return true si des donnees sont disponibles pour la variable _v + */ + boolean isDataAvailable(CtuluVariable _v); } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/dodico/test/org/fudaa/dodico/ef/TestJLineIntersection.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/test/org/fudaa/dodico/ef/TestJLineIntersection.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/dodico/test/org/fudaa/dodico/ef/TestJLineIntersection.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -129,6 +129,8 @@ } protected class DefaultTester implements EfLineIntersectionsCorrectionTester { + + public boolean createNews(int _tidx, EfLineIntersection _i1, EfLineIntersection _i2, List _setNewIn) { EfLineIntersectionParent parent = _i1.getParent(); @@ -144,6 +146,10 @@ return false; } + + public boolean isEnableFor(EfLineIntersectionsResultsI _res) { + return true; + } } private EfDataNode createDataNodes(EfGridInterface _grid) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -12,11 +12,14 @@ import java.awt.Component; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.Image; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.image.CtuluLibImage; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BConfigurableInterface; import org.fudaa.ebli.geometrie.GrBoite; @@ -82,11 +85,35 @@ } } + boolean useCache_; + Image cache_; + + @Override + public void paint(Graphics _g) { + if (useCache_) { + Graphics cg = null; + if (cache_ == null) { + try { + HashMap param = new HashMap(); + CtuluLibImage.setCompatibleImageAsked(param); + cache_ = CtuluLibImage.createImage(getWidth(), getHeight(), param); + cg = cache_.getGraphics(); + } catch (final NullPointerException e) { + cache_ = null; + cg = _g; + } + super.paint(cg); + } + if (cg != _g && cache_ != null) { + _g.drawImage(cache_, 0, 0, this); + } + + } else super.paint(_g); + } + public Color getCouleur() { final BCalque[] cq = getCalques(); - if (cq == null) { - return null; - } + if (cq == null) { return null; } boolean init = false; Color res = null; for (int i = cq.length - 1; i >= 0; i--) { @@ -98,9 +125,7 @@ } else if (!init) { res = c; init = true; - } else if (!c.equals(res)) { - return null; - } + } else if (!c.equals(res)) { return null; } } } return res; @@ -201,9 +226,7 @@ */ public static int getIdx(final String _cqName) { final int idxTmp = _cqName.lastIndexOf('_'); - if (idxTmp < 0) { - return -1; - } + if (idxTmp < 0) { return -1; } try { return Integer.parseInt(_cqName.substring(idxTmp + 1)); } catch (final Exception e) { @@ -219,9 +242,7 @@ private static String findUniqueName(final String _pref, final BCalque _parent, final int _idx) { final BCalque[] cqs = _parent.getCalques(); final String defaultName = _pref + '_' + CtuluLibString.getString(_idx); - if (cqs == null || cqs.length == 0) { - return defaultName; - } + if (cqs == null || cqs.length == 0) { return defaultName; } final String[] name = new String[cqs.length]; final int nb = name.length; boolean found = false; @@ -231,9 +252,7 @@ found = true; } } - if (!found) { - return defaultName; - } + if (!found) { return defaultName; } int lastIdx = 0; String r = null; Arrays.sort(name); @@ -257,15 +276,29 @@ } r = BGroupeCalque.buildName(_pref, lastIdx + 1); } - if (Arrays.binarySearch(name, r) >= 0) { - throw new IllegalArgumentException("cant find unique name " + r); - } + if (Arrays.binarySearch(name, r) >= 0) { throw new IllegalArgumentException("cant find unique name " + r); } if (FuLog.isTrace()) { FuLog.trace("TRL: find unique name " + r); } return r; } - - - + + /** + * @return the useCache + */ + public boolean isUseCache() { + return useCache_; + } + + /** + * @param _useCache the useCache to set + */ + public void setUseCache(boolean _useCache) { + useCache_ = _useCache; + if (!_useCache && cache_ != null) { + cache_.flush(); + cache_ = null; + } + } + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueRepereInteraction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueRepereInteraction.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueRepereInteraction.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -29,17 +29,23 @@ private Point pointDeb_, pointFinPrec_; private final BVueCalque vc_; private double coefZoomClick_ = 1.5; // Coefficient de zoom (AVANT/ARRIERE) + private final BGroupeCalque gcDonnees_; - public ZCalqueRepereInteraction(final BVueCalque _vc) { + public ZCalqueRepereInteraction(final BVueCalque _vc,BGroupeCalque _gcDonnees) { super(); vc_ = _vc; pointDeb_ = null; pointFinPrec_ = null; _vc.addKeyListener(this); + gcDonnees_=_gcDonnees; /* * addMouseListener(this); addMouseMotionListener(this); addMouseWheelListener(this); */ } + + public boolean alwaysPaint() { + return true; + } public String getDescription() { return EbliLib.getS("Zoom") + (zoomMoins_ ? " -" : " +"); @@ -48,8 +54,8 @@ /** * Dessin de l'icone. * - * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null</I>. - * Il est ignore ici. + * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null</I>. Il + * est ignore ici. * @param _g le graphics sur lequel dessiner l'icone * @param _x lieu cible de l'icone (x) * @param _y lieu cible de l'icone (y) @@ -91,26 +97,27 @@ // EVENEMENTS public void mouseClicked(final MouseEvent _evt) {} - public void mouseEntered(final MouseEvent _evt) {} + public void mouseEntered(final MouseEvent _evt) { + // System.err.println(_evt); - public void mouseExited(final MouseEvent _evt) {} + } + public void mouseExited(final MouseEvent _evt) { + // System.err.println(_evt); + + } + public void mousePressed(final MouseEvent _evt) { - if (!isOkLeftEvent(_evt)) { - return; - } + if (!isOkLeftEvent(_evt)) { return; } + gcDonnees_.setUseCache(true); pointDeb_ = _evt.getPoint(); } - public void mouseReleased(final MouseEvent _evt) { - if (!isOkLeftEvent(_evt)) { - return; - } + gcDonnees_.setUseCache(false); + if (!isOkLeftEvent(_evt)) { return; } - if (pointDeb_ == null) { - return; - } + if (pointDeb_ == null) { return; } GrPoint pointO; GrPoint pointE; @@ -134,30 +141,42 @@ } public void mouseDragged(final MouseEvent _evt) { - if (!isOkLeftEvent(_evt)) { - return; - } - if (pointDeb_ == null) { - return; - } +// if (!isOkLeftEvent(_evt)) { return; } +// if (pointDeb_ == null) { return; } final Point pointFin = _evt.getPoint(); - final Graphics g = getGraphics(); - g.setXORMode(getBackground()); - g.setColor(Color.black); - if (pointFinPrec_ != null) { - g.drawLine(pointDeb_.x, pointDeb_.y, pointFinPrec_.x, pointDeb_.y); - g.drawLine(pointFinPrec_.x, pointDeb_.y, pointFinPrec_.x, pointFinPrec_.y); - g.drawLine(pointFinPrec_.x, pointFinPrec_.y, pointDeb_.x, pointFinPrec_.y); - g.drawLine(pointDeb_.x, pointFinPrec_.y, pointDeb_.x, pointDeb_.y); + if (!contains(pointFin)) { + EbliLib.setIn(pointFin, this); } - g.drawLine(pointDeb_.x, pointDeb_.y, pointFin.x, pointDeb_.y); - g.drawLine(pointFin.x, pointDeb_.y, pointFin.x, pointFin.y); - g.drawLine(pointFin.x, pointFin.y, pointDeb_.x, pointFin.y); - g.drawLine(pointDeb_.x, pointFin.y, pointDeb_.x, pointDeb_.y); +// final Graphics g = getGraphics(); +// g.setXORMode(getBackground()); +// g.setColor(Color.black); +// if (pointFinPrec_ != null) { +// g.drawLine(pointDeb_.x, pointDeb_.y, pointFinPrec_.x, pointDeb_.y); +// g.drawLine(pointFinPrec_.x, pointDeb_.y, pointFinPrec_.x, pointFinPrec_.y); +// g.drawLine(pointFinPrec_.x, pointFinPrec_.y, pointDeb_.x, pointFinPrec_.y); +// g.drawLine(pointDeb_.x, pointFinPrec_.y, pointDeb_.x, pointDeb_.y); +// } +// g.drawLine(pointDeb_.x, pointDeb_.y, pointFin.x, pointDeb_.y); +// g.drawLine(pointFin.x, pointDeb_.y, pointFin.x, pointFin.y); +// g.drawLine(pointFin.x, pointFin.y, pointDeb_.x, pointFin.y); +// g.drawLine(pointDeb_.x, pointFin.y, pointDeb_.x, pointDeb_.y); pointFinPrec_ = pointFin; + repaint(); } + + @Override + public void paintComponent(Graphics _g) { + if (pointDeb_ == null|| pointFinPrec_==null) { return; } + _g.setXORMode(getBackground()); + _g.setColor(Color.black); + _g.drawLine(pointDeb_.x, pointDeb_.y, pointFinPrec_.x, pointDeb_.y); + _g.drawLine(pointFinPrec_.x, pointDeb_.y, pointFinPrec_.x, pointFinPrec_.y); + _g.drawLine(pointFinPrec_.x, pointFinPrec_.y, pointDeb_.x, pointFinPrec_.y); + _g.drawLine(pointDeb_.x, pointFinPrec_.y, pointDeb_.x, pointDeb_.y); + } public void mouseMoved(final MouseEvent _evt) {} + private boolean zoomMoins_; private void setZoomMoins(final boolean _b) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionAbstract.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionAbstract.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionAbstract.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -122,17 +122,21 @@ return trace_; } - public void paintAllInImage(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, final GrBoite _clipReel) { + public void paintAllInImage(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { if (isVisible()) { paintDonnees(_g, _versEcran, _versReel, _clipReel); } } + final BGroupeCalque donnees_; + /** * Cr\xE9ation d'un calque de s\xE9lection sans objets s\xE9lectionnables. */ - public ZCalqueSelectionInteractionAbstract() { + public ZCalqueSelectionInteractionAbstract(final BGroupeCalque _donnees) { super(); + donnees_ = _donnees; setDestructible(false); setTypeTrait(TraceLigne.LISSE); setModeSelection(RECTANGLE); @@ -154,13 +158,29 @@ public final void paintComponent(final Graphics _g) { paintDonnees((Graphics2D) _g, getVersEcran(), getVersReel(), getClipReel(_g)); + if (enCours_) { + donnees_.setUseCache(true); + _g.setXORMode(Color.white); + initTrace(_g); + if (mode_ == RECTANGLE) { + tg_.dessineRectangle((Graphics2D) _g, ptOrig_, ptExt_, false); + } else if (mode_ == POLYGONE) { + if (plHelper_.nombre() < 3) { + tg_.dessinePolyligne((Graphics2D) _g, plHelper_, false); + } else { + tg_.dessinePolygone((Graphics2D) _g, plHelper_, false, false); + } + } + } else { + donnees_.setUseCache(false); + } } // // Appel\xE9 avant chaque trac\xE9 pour d\xE9finir le contexte graphique // private void initTrace(final Graphics _g) { - _g.setXORMode(Color.white); + if (tg_ == null) { tg_ = new TraceGeometrie(GrMorphisme.identite()); } @@ -174,8 +194,7 @@ final String old = modificateur_.getControleDesc(); modificateur_.majControleDesc(_e); if (modificateur_.getControleDesc() != old) { - firePropertyChange(ZEbliCalquePanelController.STATE, old, modificateur_ - .getControleDesc()); + firePropertyChange(ZEbliCalquePanelController.STATE, old, modificateur_.getControleDesc()); } } @@ -183,26 +202,25 @@ final String old = modificateur_.getControleDesc(); modificateur_.majControleDesc(_e); if (modificateur_.getControleDesc() != old) { - firePropertyChange(ZEbliCalquePanelController.STATE, old, modificateur_ - .getControleDesc()); + firePropertyChange(ZEbliCalquePanelController.STATE, old, modificateur_.getControleDesc()); } } - private void paintSelectionPath() { - final Graphics2D g = (Graphics2D) getGraphics(); - if (enCours_) { - initTrace(g); - if (mode_ == RECTANGLE) { - tg_.dessineRectangle(g, ptOrig_, ptExt_, false); - } else if (mode_ == POLYGONE) { - if (plHelper_.nombre() < 3) { - tg_.dessinePolyligne(g, plHelper_, false); - } else { - tg_.dessinePolygone(g, plHelper_, false, false); - } - } - } - } + // private void paintSelectionPath() { + // final Graphics2D g = (Graphics2D) getGraphics(); + // if (enCours_) { + // initTrace(g); + // if (mode_ == RECTANGLE) { + // tg_.dessineRectangle(g, ptOrig_, ptExt_, false); + // } else if (mode_ == POLYGONE) { + // if (plHelper_.nombre() < 3) { + // tg_.dessinePolyligne(g, plHelper_, false); + // } else { + // tg_.dessinePolygone(g, plHelper_, false, false); + // } + // } + // } + // } public abstract void addCalqueActif(ZCalqueAffichageDonneesInterface _calque); @@ -230,7 +248,7 @@ /** * Accesseur de la propriete <I>typeTrait </I>. Elle fixe le type de trait (pointille, tirete, ...) en prenant ses * valeurs dans les champs statiques de <I>TraceLigne </I>. - * + * * @see org.fudaa.ebli.trace.TraceLigne */ public final int getTypeTrait() { @@ -259,14 +277,12 @@ * cr\xE9ation */ public final void mouseDragged(final MouseEvent _evt) { - if (!isOkEvent(_evt)) { - return; - } + if (!isOkEvent(_evt)) { return; } final GrPoint ptSo = new GrPoint(_evt.getX(), _evt.getY(), 0.); if (mode_ == RECTANGLE && enCours_) { - paintSelectionPath(); + // paintSelectionPath(); ptExt_ = ptSo; - paintSelectionPath(); + repaint(); } } @@ -288,21 +304,19 @@ // extr\xE9mit\xE9s du polygone en cours de cr\xE9ation // public final void mouseMoved(final MouseEvent _evt) { - if (!isOkEvent(_evt)) { - return; - } + if (!isOkEvent(_evt)) { return; } if (mode_ == POLYGONE && enCours_) { // effacer ancien chemin - paintSelectionPath(); + // paintSelectionPath(); final GrPoint ptSo = new GrPoint(_evt.getX(), _evt.getY(), 0.); listePoints_.remplace(ptSo, listePoints_.nombre() - 1); - paintSelectionPath(); + repaint(); } } /* - * Ev\xE8nements souris Rectangle : <br> PRESSED => Debut de rectangle <br> DRAGGED => Trac\xE9 du rectangle <br> RELEASED => - * Fin du rectangle Polygone : RELEASED => D\xE9but de cr\xE9ation ou nouveau point cr\xE9\xE9 MOVED => Trac\xE9 des 2 droites + * Ev\xE8nements souris Rectangle : <br> PRESSED => Debut de rectangle <br> DRAGGED => Trac\xE9 du rectangle <br> RELEASED + * => Fin du rectangle Polygone : RELEASED => D\xE9but de cr\xE9ation ou nouveau point cr\xE9\xE9 MOVED => Trac\xE9 des 2 droites * DRAGGED => M\xEAme effet 2 RELEASED => Fin du polygone Button Mask : Rien => Remplacement des anciennes s\xE9lections * SHIFT => Ajout des nouvelles s\xE9lections, suppression si d\xE9j\xE0 s\xE9lectionn\xE9 */ @@ -311,9 +325,7 @@ * Methode invoquee quand on appuie sur un bouton de la souris. Rectangle : D\xE9but de cr\xE9ation. */ public final void mousePressed(final MouseEvent _evt) { - if (!isOkLeftEvent(_evt)) { - return; - } + if (!isOkLeftEvent(_evt)) { return; } if (mode_ == RECTANGLE) { enCours_ = true; // initTrace(); @@ -322,7 +334,7 @@ ptExt_ = ptOrig_; // tg_.dessineRectangle((Graphics2D) getGraphics(), ptOrig_, ptExt_, false); listePoints_.ajoute(ptOrig_); - paintSelectionPath(); + repaint(); } } @@ -337,19 +349,13 @@ * Polygone : Saisie d'un point du polygone, d\xE9but de cr\xE9ation ou fin (si 2 released) <br> */ public final void mouseReleased(final MouseEvent _evt) { - if(isGele()) { - return; - } - if(!_evt.isControlDown() && !_evt.isAltDown()&&!isOkLeftEvent(_evt)) { - return; - } + if (isGele()) { return; } + if (!_evt.isControlDown() && !_evt.isAltDown() && !isOkLeftEvent(_evt)) { return; } majControleDesc(_evt); final GrPoint ptSo = new GrPoint(_evt.getX(), _evt.getY(), 0.); // Saisie d'un seul point if (mode_ == PONCTUEL) { - if (_evt.getClickCount() >= 2 && editionAsked()) { - return; - } + if (_evt.getClickCount() >= 2 && editionAsked()) { return; } listePoints_.vide(); listePoints_.ajoute(ptSo); enCours_ = false; @@ -359,7 +365,7 @@ else if (mode_ == RECTANGLE) { if (enCours_) { // effacer ancien trace - paintSelectionPath(); + // paintSelectionPath(); // Effacement du rectangle pr\xE9c\xE9dent listePoints_.ajoute(new GrPoint(ptSo.x_, ptOrig_.y_, 0.)); listePoints_.ajoute(new GrPoint(ptSo.x_, ptSo.y_, 0.)); @@ -372,16 +378,16 @@ // fin de polygone => Creation du point de fin et du polygone if (_evt.getClickCount() == 2) { // Effacer ancien trace - paintSelectionPath(); + // paintSelectionPath(); enCours_ = false; formeSaisie(); } // Saisie d'un nouveau point else { // Effacer ancien trace - paintSelectionPath(); + // paintSelectionPath(); listePoints_.ajoute(ptSo); - paintSelectionPath(); + repaint(); } } // Premier point saisi @@ -391,14 +397,14 @@ listePoints_.ajoute(ptSo); // Le 2ieme point correspond au point flottant avant clic. listePoints_.ajoute(ptSo); - paintSelectionPath(); + repaint(); } } } /** * Dessin de l'icone. - * + * * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null </I>. * Il est ignore ici. * @param _g le graphics sur lequel dessiner l'icone Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionMulti.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionMulti.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionMulti.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -39,8 +39,8 @@ /** * Cr\xE9ation d'un calque de s\xE9lection sans objets s\xE9lectionnables. */ - public ZCalqueSelectionInteractionMulti() { - super(); + public ZCalqueSelectionInteractionMulti( final BGroupeCalque _donnees) { + super(_donnees); } private void clearSelectionsCalquesActifs() { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionSimple.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionSimple.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSelectionInteractionSimple.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -34,8 +34,8 @@ /** * Cr\xE9ation d'un calque de s\xE9lection sans objets s\xE9lectionnables. */ - public ZCalqueSelectionInteractionSimple() { - super(); + public ZCalqueSelectionInteractionSimple( final BGroupeCalque _donnees) { + super(_donnees); } protected boolean editionAsked() { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -135,6 +135,8 @@ cqSelectionI_.setCalqueActif(z); if (cqActif_ != null) { cqActif_.addPropertyChangeListener("mode", this); + // pour eventuellement modifie l'etat de la selection + cqActif_.addPropertyChangeListener("visible", this); } } else { cqSelectionI_.setCalqueActif(null); @@ -153,12 +155,16 @@ if (standardActionGroup_ == null) { buildButtonGroupStandard(); } - if (standardActionGroup_ == null) { + if (standardActionGroup_ == null) { buildButtonGroupSpecifique(); - } - - + } + } + + + public void setUseCacheInDonnees(boolean b){ + pn_.getGcDonnees().setUseCache(b); + } protected EbliActionInterface createRepereAction() { final EbliActionPaletteAbstract plAction = new EbliActionPaletteAbstract(EbliResource.EBLI.getString("Rep\xE8re"), @@ -323,11 +329,10 @@ // this.updateMapKeyStroke(standardActionGroup_); } - public EbliActionInterface[] buildButtonGroupSpecifique() { return null; } - + protected final EbliActionInterface[] getSpecificActionGroup() { return specificActionGroup_; } @@ -345,7 +350,7 @@ public final CtuluUI getUI() { return ui_; } - + /** * A overrider. * @@ -398,7 +403,7 @@ addCalqueInteraction(suivi); // cqAdmin_.add(suivi); // S\xE9lection - cqSelectionI_ = new ZCalqueSelectionInteractionSimple(); + cqSelectionI_ = new ZCalqueSelectionInteractionSimple(pn_.getDonneesCalque()); cqSelectionI_.setTitle(EbliResource.EBLI.getString("Interaction")); cqSelectionI_.setName("cqSELECTION"); cqSelectionI_.setDestructible(false); @@ -407,7 +412,7 @@ pn_.getVueCalque().addKeyListener(cqSelectionI_); addCalqueInteraction(cqSelectionI_); // Calque de zoom - cqZoomI_ = new ZCalqueRepereInteraction(pn_.getVueCalque()); + cqZoomI_ = new ZCalqueRepereInteraction(pn_.getVueCalque(),pn_.getDonneesCalque()); cqZoomI_.addPropertyChangeListener(ZEbliCalquePanelController.STATE, this); cqZoomI_.setTitle(EbliResource.EBLI.getString("Agrandir")); cqZoomI_.setName("cqAGRANDIR"); @@ -445,8 +450,6 @@ return r; } - - /** Methode pour vider la selection. */ public void clearSelections() { cqSelectionI_.clearSelections(); @@ -534,8 +537,7 @@ public void initTabAndSpecificAction() { } - - + protected EbliActionInterface[] getApplicationActions() { return pn_.getApplicationActions(); } @@ -591,7 +593,10 @@ } public void propertyChange(final PropertyChangeEvent _evt) { - if ((_evt.getSource() == cqActif_) || ((cqInteractionActif_ != null) && (_evt.getSource() == cqInteractionActif_))) { + if ("visible".equals(_evt.getPropertyName())) { + activeActionForSelectedLayer(); + } else if ((_evt.getSource() == cqActif_) + || ((cqInteractionActif_ != null) && (_evt.getSource() == cqInteractionActif_))) { updateModeText(); } } @@ -721,6 +726,7 @@ public void valueChanged(final TreeSelectionEvent _evt) { if (cqActif_ != null) { cqActif_.removePropertyChangeListener("mode", this); + cqActif_.removePropertyChangeListener("visible", this); cqActif_.setActionsEnable(false); } cqActif_ = pn_.getArbreCalqueModel().getSelectedCalque(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZebliCalquePersist.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -10,6 +10,7 @@ import org.fudaa.ebli.geometrie.GrBoite; +import com.memoire.fu.FuLog; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.DomDriver; @@ -19,26 +20,26 @@ * * @author Adrien Hadoux */ -public class ZebliCalquePersist { +public class ZebliCalquePersist { /** * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et model... */ protected String directoryPath_; - + protected XStream parser_; - + protected GrBoite zoom_; - -/** - * Fichier principal qui contient une instance de la classe ZEbliCalquesPanelPersistenceManager - */ + + /** + * Fichier principal qui contient une instance de la classe ZEbliCalquesPanelPersistenceManager + */ private static String MAINFILE = "descriptorCalque.xml"; private static String DATA = "datas.xml"; private static String SPECIFIQUEFILE = "SPECIFICDATAS"; public ZebliCalquePersist(String directoryPath) { - directoryPath_=directoryPath; + directoryPath_ = directoryPath; } /** @@ -47,7 +48,7 @@ * @return */ protected XStream getParser() { - if (parser_ == null) parser_ = initXmlParser(); + if (parser_ == null) parser_ = initXmlParser(); return parser_; } @@ -59,14 +60,10 @@ protected XStream initXmlParser() { XStream xstream = new XStream(new DomDriver()); // -- creation des alias pour que ce soit + parlant dans le xml file --// - - return xstream; } - - /** * Path vers els datas classique du calque * @@ -100,105 +97,95 @@ * @param parameters des parametres supplementaires utiles. * @throws IOException */ - public void savePersitCalqueXml(ZEbliCalquesPanel panelTopersist, Map params) { - - ObjectOutputStream out = null; - try { - out = getParser().createObjectOutputStream(new FileWriter(new File(getMainFilePath()))); - - //-- recuperation des datats persistantes specifiques au panel --// - ZEbliCalquesPanelPersistManager dataPersistantes = panelTopersist.getPersistenceManager(); - - //-- enregistrement des don\xE9nes sp\xE9cifiques du calque -// - //TODO je prefere que fillInfoWith renvoie un objet et de donnees et c'est ce dernier qui est sauve - //dans le out, il suffit d'ecrire la nom de classe du persistManager - dataPersistantes.fillInfoWith(panelTopersist,new File(getSpecifiqueDataFilePath())); - - //-- sauvegarde de la classe dataPersistantes dans le fichier specifiqueData - out.writeObject(dataPersistantes); - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } finally { - try { - out.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } + public void savePersitCalqueXml(ZEbliCalquesPanel panelTopersist, Map params) { - + ObjectOutputStream out = null; + try { + out = getParser().createObjectOutputStream(new FileWriter(new File(getMainFilePath()))); + // -- recuperation des datats persistantes specifiques au panel --// + ZEbliCalquesPanelPersistManager dataPersistantes = panelTopersist.getPersistenceManager(); + + // -- enregistrement des don\xE9nes sp\xE9cifiques du calque -// + // TODO je prefere que fillInfoWith renvoie un objet et de donnees et c'est ce dernier qui est sauve + // dans le out, il suffit d'ecrire la nom de classe du persistManager + dataPersistantes.fillInfoWith(panelTopersist, new File(getSpecifiqueDataFilePath())); + + // -- sauvegarde de la classe dataPersistantes dans le fichier specifiqueData + out.writeObject(dataPersistantes); + + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + // TODO il faut generer la classe du persistencemanager -// public ZEbliCalquesPanel generateCalqueInstance(String className) throws ClassNotFoundException, -// InstantiationException, IllegalAccessException { -// if (className.startsWith("class ")) className = className.substring("class ".length()); -// Class myclass = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); -// Object myModel = myclass.newInstance(); -// if (myModel instanceof ZEbliCalquesPanel) return (ZEbliCalquesPanel) myModel; -// return null; -// -// } + // public ZEbliCalquesPanel generateCalqueInstance(String className) throws ClassNotFoundException, + // InstantiationException, IllegalAccessException { + // if (className.startsWith("class ")) className = className.substring("class ".length()); + // Class myclass = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); + // Object myModel = myclass.newInstance(); + // if (myModel instanceof ZEbliCalquesPanel) return (ZEbliCalquesPanel) myModel; + // return null; + // + // } /** * Methode qui remplit le panel fournit en parametre avec les donn\xE9es sauvegardees. * * @param panelToFill */ - public ZEbliCalquesPanel loadPersitCalqueXml(Map param) - { - - ObjectInputStream in = null; - ZEbliCalquesPanel veritablePanel = null; - - try { - // -- Init: on lit les donn\xE9es sp\xE9cifiques pour avoir la bonne classe zeblicalquepanel --// - // in=getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); - - // donnee bidon - // in.readInt(); - // -- lire le type de classe du calque--// - // String className=(String) in.readObject(); - - // -- on creer le type d'objet lu - // ZEbliCalquesPanel panelUseAsStatic; - - // panelUseAsStatic = generateCalqueInstance(className); - - // -- etape 1: on lit les donn\xE9es sp\xE9cifiques pour avoir la data persistantes - in = getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); - ZEbliCalquesPanelPersistManager dataPersistantes = (ZEbliCalquesPanelPersistManager) in.readObject(); - zoom_=dataPersistantes.getZoom(); - // -- etape 2 on creer l'obejt calque correspondant a partir des datas persitantes - veritablePanel = dataPersistantes.generateCalquePanel(param,new File(getSpecifiqueDataFilePath())); - - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } finally { - try { - in.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - return veritablePanel; + public ZEbliCalquesPanel loadPersitCalqueXml(Map param) { + + ObjectInputStream in = null; + ZEbliCalquesPanel veritablePanel = null; + + try { + // -- Init: on lit les donn\xE9es sp\xE9cifiques pour avoir la bonne classe zeblicalquepanel --// + // in=getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); + + // donnee bidon + // in.readInt(); + // -- lire le type de classe du calque--// + // String className=(String) in.readObject(); + + // -- on creer le type d'objet lu + // ZEbliCalquesPanel panelUseAsStatic; + + // panelUseAsStatic = generateCalqueInstance(className); + + // -- etape 1: on lit les donn\xE9es sp\xE9cifiques pour avoir la data persistantes + in = getParser().createObjectInputStream(new FileReader(new File(getMainFilePath()))); + ZEbliCalquesPanelPersistManager dataPersistantes = (ZEbliCalquesPanelPersistManager) in.readObject(); + zoom_ = dataPersistantes.getZoom(); + // -- etape 2 on creer l'obejt calque correspondant a partir des datas persitantes + veritablePanel = dataPersistantes.generateCalquePanel(param, new File(getSpecifiqueDataFilePath())); + + } catch (Exception _e) { + FuLog.error(_e); + } finally { + try { + in.close(); + } catch (IOException _e) { + FuLog.error(_e); + } + } + + return veritablePanel; } -public GrBoite getZoom_() { - return zoom_; -} + public GrBoite getZoom() { + return zoom_; + } -public void setZoom_(GrBoite zoom_) { - this.zoom_ = zoom_; -} + public void setZoom_(GrBoite zoom_) { + this.zoom_ = zoom_; + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliLib.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliLib.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliLib.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -9,6 +9,7 @@ package org.fudaa.ebli.commun; import java.awt.Color; +import java.awt.Point; import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.Arrays; @@ -23,10 +24,10 @@ import javax.swing.JDialog; import javax.swing.KeyStroke; +import org.fudaa.ebli.ressource.EbliResource; + import com.memoire.bu.BuDesktop; -import org.fudaa.ebli.ressource.EbliResource; - /** * Ensemble de methodes utilitaires non classees. * @@ -46,9 +47,31 @@ public static Color getAlphaColor(final Color _init, final int _alpha) { if (_init == null || _alpha <= 0 || _alpha >= 255) { return _init; } return new Color(_init.getRed(), _init.getGreen(), _init.getBlue(), _alpha); + } + /** + * @param _initValue la valeur initiale + * @param _min la valeur min autorisee + * @param _max la valeur max autorisee + * @return la valeur _initValue si elle est comprise entre les bornes min,max. Sinon, min si valeur inferieur et max + * si max + */ + private static int setIn(int _initValue, int _min, int _max) { + if (_initValue < _min) return _min; + if (_initValue > _max) return _max; + return _initValue; } + /** + * @param _p Le point a modifier pour qu'il soi a l'interieur de jc + * @param jc le composant a utiliser + */ + public static void setIn(Point _p, JComponent _jc) { + _p.x = setIn(_p.x, 0, _jc.getWidth()); + _p.y = setIn(_p.y, 0, _jc.getHeight()); + + } + public static String getZoomDesc() { return "<table cellpadding='1'><tr><td>" + EbliLib.getS("Un clic gauche") + "</td><td>:" + EbliLib.getS("Zoom centr\xE9 sur le point cliqu\xE9") + "</tr><tr><td>" + EbliLib.getS("Rectangle dessin\xE9") Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphe.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphe.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -11,6 +11,7 @@ import gnu.trove.TObjectIntIterator; import java.awt.Color; +import java.awt.Cursor; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; @@ -102,6 +103,7 @@ model_.addModelListener(this); cmd_ = new CtuluCommandManager(); repereController_ = new RepereMouseKeyController(this); + setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR)); } private void ajusteXAxe() { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGInteractionSelection.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGInteractionSelection.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGInteractionSelection.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -56,6 +56,7 @@ } private void updateSelection(final int _idxSelected) { + repaint(); boolean b = false; if (_idxSelected < 0) { if (select_.isReplaceMode()) { @@ -84,6 +85,7 @@ a_.repaint(); } lastIndex_ = _idxSelected; + getParent().repaint(); } public void inverseSelection() { 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-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -113,26 +113,6 @@ */ private final EbliSceneController controller_; - // private class ObjectSelectProvider implements SelectProvider { - // - // public boolean isAimingAllowed(final Widget widget, final Point localLocation, final boolean invertSelection) { - // return false; - // } - // - // public boolean isSelectionAllowed(final Widget widget, final Point localLocation, final boolean invertSelection) { - // return findObject(widget) != null; - // } - // - // public void select(final Widget widget, final Point localLocation, final boolean invertSelection) { - // final Object object = findObject(widget); - // - // setFocusedObject(object); - // if (object != null) { - // if (!invertSelection && getSelectedObjects().contains(object)) return; - // userSelectionSuggested(Collections.singleton(object), invertSelection); - // } else userSelectionSuggested(Collections.emptySet(), invertSelection); - // } - // } public static void refreshScene(final Scene _sc) { _sc.validate(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -64,7 +64,8 @@ rectangularSelection_ = ActionFactory.createRectangularSelectAction(scene_, scene_.getInteractionLayer()); // -- ajoute l'action du zoom ( ctrl + clic) - scene_.getActions().addAction(ActionFactory.createCenteredZoomAction(1.1)); + //suppression pour eviter les bugs sioux +// scene_.getActions().addAction(ActionFactory.createCenteredZoomAction(1.1)); scene_.getActions().addAction(rectangularSelection_); // -- ajouter le menu popup de base Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -35,9 +35,7 @@ } public EbliWidgetCreatorVueCalque() { - - - + } public EbliWidgetCreatorVueCalque(ZEbliCalquesPanel calque, GrBoite _initZoom) { @@ -56,8 +54,9 @@ positionLegende.x = _dest.getLocation().x + _dest.getIntern().getPreferredSize().width + 5; positionLegende.y = _dest.getPreferredLocation().y; EbliWidgetVueCalque vue = (EbliWidgetVueCalque) _dest.getIntern(); - vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene(), getBordure().getIntern().getId(),calque_.getCalqueActif()); - ((EbliWidgetControllerCalque) vue.getController()).setLegendeWidget(_legende,calque_.getCalqueActif()); + vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene(), getBordure().getIntern().getId(), + calque_.getCalqueActif()); + ((EbliWidgetControllerCalque) vue.getController()).setLegendeWidget(_legende, calque_.getCalqueActif()); } public EbliWidget create(EbliScene _scene) { @@ -76,7 +75,7 @@ duplicOptions.put("scene", getWidget().getEbliScene()); EbliWidgetCreatorVueCalque creator = new EbliWidgetCreatorVueCalque(getCalque().duplicate(duplicOptions), - /*((EbliWidgetVueCalque)getWidget().getIntern()).getZoom_()*/getCalque().getVueCalque().getViewBoite()); + /* ((EbliWidgetVueCalque)getWidget().getIntern()).getZoom_() */getCalque().getVueCalque().getViewBoite()); duplique.setCreator(creator); // -- ajout de la reference de la legende dans le widget calque --// @@ -98,7 +97,7 @@ public EbliWidgetWithBordure getBordure() { return res; } - + public void initSize(final Dimension rec) { final BCalque[] tousCalques = calque_.getVueCalque().getCalque().getTousCalques(); calque_.getVueCalque().setSize(rec.width, rec.height); @@ -108,6 +107,7 @@ tousCalques[i].setSize(rec.width, rec.height); } } + /** * parametre qui n est rensginee que dans le cas d une duplication. Sinon c est cree des le debut avec le bon * ebliwidgetCalqueLegende qui va. @@ -142,26 +142,27 @@ File createRep = new File(pathUnique); if (createRep.mkdir() || createRep.isDirectory()) { // (new FudaaFilleVisuPersistence(getCalque())).saveZEbliCalquesPanelIn - // getCalque().getPersistenceManager().savePersitCalqueXml(getCalque(), createRep, parameters); - (new ZebliCalquePersist(pathUnique)).savePersitCalqueXml(getCalque(),parameters); + // getCalque().getPersistenceManager().savePersitCalqueXml(getCalque(), createRep, parameters); + (new ZebliCalquePersist(pathUnique)).savePersitCalqueXml(getCalque(), parameters); } - String pathRelative=CtuluLibFile.getRelativeFile(new File(pathUnique), new File((String)parameters.get("pathLayout")), 4); + String pathRelative = CtuluLibFile.getRelativeFile(new File(pathUnique), new File((String) parameters + .get("pathLayout")), 4); return pathRelative; } public void setPersistData(Object data, Map parameters) { - //comment on recupere le dossier ? - //il faut reconstruire le PersistenceManager par reflexion et c'est lui qui produire le ZEbliCalquesPanel + // comment on recupere le dossier ? + // il faut reconstruire le PersistenceManager par reflexion et c'est lui qui produire le ZEbliCalquesPanel if (data == null) calque_ = new ZEbliCalquesPanel(null); else { - String pathCalque = (String)parameters.get("pathLayout")+File.separator+(String) data; + String pathCalque = (String) parameters.get("pathLayout") + File.separator + (String) data; - ZebliCalquePersist persistance=new ZebliCalquePersist(pathCalque); - + ZebliCalquePersist persistance = new ZebliCalquePersist(pathCalque); + calque_ = persistance.loadPersitCalqueXml(parameters); - if(calque_.getVueCalque()!=null && calque_.getVueCalque().getViewBoite()!=null) - initZoom_ = persistance.getZoom_(); + if (calque_ != null && calque_.getVueCalque() != null && calque_.getVueCalque().getViewBoite() != null) initZoom_ = persistance + .getZoom(); } } 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-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -219,7 +219,7 @@ public void notifyOpened(final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, final Widget widget, final BuPanel editor) { editingStart(); - calquePanel_.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1)); +// calquePanel_.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1)); } // public void setColorFond(Color newColor) { 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-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -1,5 +1,6 @@ package org.fudaa.ebli.visuallibrary.graphe; +import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -13,6 +14,7 @@ import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; +import javax.swing.JSplitPane; import javax.swing.JToolBar; import org.fudaa.ctulu.CtuluCommandContainer; @@ -25,6 +27,7 @@ import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGSpecificActions; +import org.fudaa.ebli.courbe.EGTableGraphePanel; import org.fudaa.ebli.courbe.EGTree; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -36,7 +39,6 @@ import org.fudaa.ebli.visuallibrary.actions.CommandMasquer; import org.fudaa.ebli.visuallibrary.actions.EbliActionEditorOneClick; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionConfigure; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRatio; import com.memoire.bu.BuMenuBar; import com.memoire.bu.BuPanel; @@ -71,17 +73,16 @@ public EbliWidgetControllerGraphe(final EbliWidgetGraphe widget_, final EbliNodeDefault nodeLegende) { super(widget_); - + widgetGraphe_ = widget_; labelTrace_ = (JLabel) CtuluLibSwing.findChildByName(getGraphePanel(), "lbTools"); // getGraphePanel().remove(labelTrace_); addActionSpecifiques(); - - + setProportional(true); - + } @Override @@ -120,7 +121,8 @@ * Methode a surcharger si on veut effectuer un traitement particulier apres duplication du widget. */ - public void postActionDuplication(final EbliNode node, final EbliNode duplique, ArrayList<EbliNode> listeNodeUndo) { + public void postActionDuplication(final EbliNode node, final EbliNode duplique, + final ArrayList<EbliNode> listeNodeUndo) { listeNodeUndo.add(duplique); // -- il faut verifier que les le node a bien une legende sinon on n ajoute // pas de legende pour le dupliqu\xE9 --// @@ -134,7 +136,7 @@ // -- on ajoute la legende apres duplication --// - if (((EbliWidgetControllerGraphe)widgetGraphe_.getController()).hasLegende()) { + if (((EbliWidgetControllerGraphe) widgetGraphe_.getController()).hasLegende()) { controllerDuDuplique.ajoutLegende(); listeNodeUndo.add(widgetGrapheDuplic.getNodeLegende()); @@ -147,7 +149,8 @@ } - public EbliNode duplication(final ArrayList<EbliNode> listeNodeUndo, EbliScene sceneDestination) { + @Override + public EbliNode duplication(final ArrayList<EbliNode> listeNodeUndo, final EbliScene sceneDestination) { // -- recuperation du node a dupliquer --// final EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); @@ -176,7 +179,8 @@ return duplique; } - public void suppression(final ArrayList<EbliNode> listeNodeUndo, ArrayList<Point> listLocation) { + @Override + public void suppression(final ArrayList<EbliNode> listeNodeUndo, final ArrayList<Point> listLocation) { final EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); listeNodeUndo.add(n); @@ -286,6 +290,7 @@ * * @param _popup */ + @Override public void constructPopupMenuBaseGraphique(final JPopupMenu _popup) { final JMenuItem menuItem4 = _popup.add(EbliResource.EBLI.getString("Configuration graphique")); @@ -445,12 +450,21 @@ final EGGrapheTreeModel treeModel = (EGGrapheTreeModel) getGraphe().getModel(); tree.setModel(treeModel); tree.setSelectionModel(treeModel.getSelectionModel()); - // JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); - // pane.setDividerLocation(200);// 0.3D); - // pane.setTopComponent(new JScrollPane(tree)); - // final EGTableGraphePanel tablePanel = new EGTableGraphePanel(); - // tablePanel.setGraphe(getGraphe()); - // pane.setBottomComponent(tablePanel); + + final EGTableGraphePanel tablePanel = new EGTableGraphePanel(); + tablePanel.setGraphe(getGraphe()); + tablePanel.addPanelAction(getGraphePanel()); + final JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + + final JScrollPane compTop = new JScrollPane(tree); + compTop.setPreferredSize(new Dimension(150, 400)); + pane.setTopComponent(compTop); + final JScrollPane comp = new JScrollPane(tablePanel); + comp.setPreferredSize(new Dimension(150, 200)); + pane.setBottomComponent(comp); + pane.setDividerLocation(0.5D); + pane.resetToPreferredSizes(); + getGraphePanel().majSelectionListener(tablePanel); // // JSplitPane paneGlobal = new JSplitPane(JSplitPane.VERTICAL_SPLIT); // @@ -459,7 +473,7 @@ // paneGlobal.setTopComponent(getGraphePanel().getInfoPanel()); // paneGlobal.setBottomComponent(new JScrollPane(tree)); - panelTreeGraphe_ = new JScrollPane(tree);// paneGlobal; + panelTreeGraphe_ = pane;// paneGlobal; } return panelTreeGraphe_; 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-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetTitle.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -11,6 +11,7 @@ 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.api.visual.widget.LabelWidget.VerticalAlignment; import org.netbeans.modules.visual.layout.FlowLayout; /** @@ -37,9 +38,10 @@ */ public EbliWidgetTitle(final EbliScene _scene, final EGCourbe _cb, final Point preferedLocation) { super(_scene); - setLayout(new FlowLayout(true, SerialAlignment.LEFT_TOP, 0)); + setLayout(new FlowLayout(true, SerialAlignment.CENTER, 0)); intern_ = new LabelWidget(_scene); intern_.setForeground(_cb.getAspectContour()); + intern_.setVerticalAlignment(VerticalAlignment.CENTER); addChild(intern_); setCourbe(_cb); // -- ajouter l option de remplacer le text dans le label --// Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -125,7 +125,7 @@ } protected void updateState() { - final boolean isAll = support_.isAll(); + final boolean isAll = support_!=null && support_.isAll(); allEdge_.setEnabled(!isAll); clearEdge_.setEnabled(support_.isSomethingToView()); addEdge_.setEnabled((pn_.getCalqueActif() instanceof MvLayerGrid) Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoteTester.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoteTester.java 2008-12-10 14:52:21 UTC (rev 4292) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoteTester.java 2008-12-10 23:38:37 UTC (rev 4293) @@ -16,6 +16,7 @@ import org.fudaa.dodico.ef.operation.EfLineIntersection; import org.fudaa.dodico.ef.operation.EfLineIntersectionParent; import org.fudaa.dodico.ef.operation.EfLineIntersectionsCorrectionTester; +import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; import org.fudaa.dodico.h2d.type.H2dVariableType; import com.memoire.fu.FuLog; @@ -37,6 +38,8 @@ bathy_ = H2dVariableType.BATHYMETRIE; cote_ = H2dVariableType.COTE_EAU; } + + private boolean addIntersection(final int _tidx, final EfLineIntersection _sup1, final EfLineIntersection _min2, final List _setNewIn) { @@ -108,4 +111,8 @@ ... [truncated message content] |