From: <had...@us...> - 2008-08-18 11:41:46
|
Revision: 3820 http://fudaa.svn.sourceforge.net/fudaa/?rev=3820&view=rev Author: hadouxad Date: 2008-08-18 11:41:45 +0000 (Mon, 18 Aug 2008) Log Message: ----------- Duplication des elements ci dessous: GRAPHES: methode duplicate( ) EGAxeHorizontal EGAxeVertical EGCourbe EGCourbeChild : utilise un objet surfacePainter_ EGGroup TraceBox EGCourbeSurfacePainter EGCourbeSimple: utilise un objet surfacePainter_ EGRepere MODELS: methode duplicate( ) EGModel EGCourbeModelDefault FudaaCourbeDefautModel FudaaCourbeTimeModel MvProfileCoordinatesModel TrTelemacBoundaryCourbeModel TrTelemacWeirCourbeModel EGGrapheModel EGGrapheSimpleModel EGGrapheTreeModel Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontal.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVertical.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeSimple.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeSurfacePainter.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/EGGrapheModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGObject.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGRepere.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/trace/TraceBox.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeTime.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontal.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontal.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontal.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -12,9 +12,6 @@ import java.awt.FontMetrics; import java.awt.Graphics2D; -import com.memoire.fu.Fu; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluNumberFormatDefault; import org.fudaa.ctulu.CtuluNumberFormatI; @@ -23,7 +20,10 @@ import org.fudaa.ctulu.iterator.NumberIntegerIterator; import org.fudaa.ctulu.iterator.TickIterator; +import com.memoire.fu.Fu; +import com.memoire.fu.FuLog; + /** * @author Fred Deniger * @version $Id: EGAxeHorizontal.java,v 1.17 2007-05-04 13:49:41 deniger Exp $ @@ -343,5 +343,10 @@ * public final void setIntegerStep(boolean _isIntegerStep){ isIntegerStep_ = _isIntegerStep; * if(axisIterator_!=null) axisIterator_=null; } */ + + public EGAxeHorizontal duplicate() { + return new EGAxeHorizontal(this); + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVertical.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVertical.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVertical.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -12,14 +12,14 @@ import java.awt.Graphics2D; import java.awt.geom.AffineTransform; -import com.memoire.fu.Fu; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluRange; import org.fudaa.ctulu.iterator.TickIterator; +import com.memoire.fu.Fu; +import com.memoire.fu.FuLog; + /** * @author Fred Deniger * @version $Id: EGAxeVertical.java,v 1.22 2007-05-04 13:49:41 deniger Exp $ @@ -354,5 +354,9 @@ } return false; } + + public EGAxeVertical duplicate() { + return new EGAxeVertical(this); + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -24,8 +24,6 @@ import javax.swing.SwingConstants; import javax.swing.tree.TreeNode; -import com.vividsolutions.jts.geom.Envelope; - import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluLibGeometrie; @@ -33,7 +31,6 @@ import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; import org.fudaa.ctulu.gui.CtuluLibSwing; - import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BConfigurableComposite; import org.fudaa.ebli.controle.BConfigurableInterface; @@ -51,6 +48,8 @@ import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; +import com.vividsolutions.jts.geom.Envelope; + /** * Cette Courbe suppose que tous les x du mod\xE8le sont rang\xE9es dans l'ordre croissant. * @@ -244,6 +243,8 @@ } protected abstract EGParent getEGParent(); + + public abstract EGCourbe duplicate(); protected Font getFont() { return font_; @@ -856,5 +857,9 @@ public String toString() { return getTitle(); } + + + + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -6,6 +6,7 @@ */ package org.fudaa.ebli.courbe; +import java.awt.Font; import java.util.Enumeration; import javax.swing.tree.TreeNode; @@ -30,6 +31,9 @@ super(_model); parent_ = _m; } + + + boolean setYaxe(final EGAxeVertical _v) { FuLog.warning(new Throwable()); @@ -79,5 +83,33 @@ public void setParentGroup(final EGGroup _g) { parent_ = _g; } + + + public EGCourbe duplicate() { + + EGCourbeChild duplic = null; + + + if (this.getModel() != null) + duplic = new EGCourbeChild(this.parent_.duplicate(), this.getModel().duplicate()); + else + duplic = new EGCourbeChild(this.parent_.duplicate(), null); + + + duplic.isVisible_ = this.isVisible_; + + + duplic.displayTitleOnCurve_ = this.displayTitleOnCurve_; + duplic.font_ = new Font(this.font_.getFamily(), this.font_.getStyle(), this.font_.getSize()); + duplic.tbox_ = this.tbox_.duplicate(); + + + // -- duplication du egCourbeSurfacePainter --// + duplic.surfacePainter_ = this.surfacePainter_.duplicate(); + + return duplic; + } + + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -11,7 +11,6 @@ import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; - import org.fudaa.ebli.palette.BPaletteInfo.InfoData; /** @@ -206,4 +205,17 @@ public boolean setValues(final int[] _idx, final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { return false; } + + public EGModel duplicate() { + + EGCourbeModelDefault duplic = new EGCourbeModelDefault(this.x_, this.y_); + if (this.nom_ != null) + duplic.nom_ = this.nom_; + duplic.ymax_ = this.ymax_; + duplic.ymin_ = this.ymin_; + duplic.yrangeComute_ = this.yrangeComute_; + + + return duplic; + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeSimple.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeSimple.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeSimple.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -7,9 +7,10 @@ */ package org.fudaa.ebli.courbe; +import java.awt.Font; + import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; - import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; @@ -58,4 +59,20 @@ public void setParent(final EGParent _eventDispatcher) { eventDispatcher_ = _eventDispatcher; } + + @Override + public EGCourbe duplicate() { + EGCourbeSimple duplic = new EGCourbeSimple(this.v_.duplicate(), this.getModel().duplicate()); + + duplic.isVisible_ = this.isVisible_; + + duplic.displayTitleOnCurve_ = this.displayTitleOnCurve_; + duplic.font_ = new Font(this.font_.getFamily(), this.font_.getStyle(), this.font_.getSize()); + duplic.tbox_ = this.tbox_.duplicate(); + + // -- duplication du egCourbeSurfacePainter --// + duplic.surfacePainter_ = this.surfacePainter_.duplicate(); + + return duplic; + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeSurfacePainter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeSurfacePainter.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeSurfacePainter.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -16,7 +16,6 @@ import javax.swing.DefaultComboBoxModel; import org.fudaa.ctulu.CtuluLib; - import org.fudaa.ebli.commun.EbliLib; /** @@ -318,6 +317,28 @@ model_ = _model; } + public EGCourbeSurfacePainter duplicate() { + EGCourbeSurfacePainter duplic = new EGCourbeSurfacePainter(this.targetCourbe_.duplicate(), this.model_.duplicate()); + duplic.alpha_ = this.alpha_; + duplic.delegateCourbe_ = new DelegateCourbe(duplic.model_); + duplic.down_ = this.down_; + duplic.maxIdx_ = this.maxIdx_; + duplic.minIdx_ = this.minIdx_; + duplic.delegatePalier_ = new DelegatePalier(((int) Math.floor(targetCourbe_.getYMin()))); + duplic.selectedPainter_ = this.selectedPainter_; + // painter.painter_= + duplic.setSelectedPainter(this.selectedPainter_); + duplic.up_ = this.up_; + // painter.x_ = CtuluLibArray.copy(this.x_); + // painter.y_ = CtuluLibArray.copy(this.y_); + + + + return duplic; + + } + + protected int getAlpha() { return alpha_; } 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-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphe.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -33,28 +33,27 @@ import javax.swing.JComponent; -import com.memoire.bu.BuLib; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluRange; import org.fudaa.ctulu.image.CtuluImageProducer; import org.fudaa.ctulu.image.CtuluLibImage; - import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.commun.EbliPreferences; import org.fudaa.ebli.palette.BPaletteInfo; import org.fudaa.ebli.repere.RepereMouseKeyController; import org.fudaa.ebli.repere.RepereMouseKeyTarget; +import com.memoire.bu.BuLib; +import com.memoire.fu.FuLog; + /** * @author Fred Deniger * @version $Id: EGGraphe.java,v 1.26 2007-05-22 14:19:04 deniger Exp $ */ public class EGGraphe extends JComponent implements ComponentListener, EGGrapheModelListener, RepereMouseKeyTarget, - CtuluImageProducer { +CtuluImageProducer { public static final Font DEFAULT_FONT = new Font("SansSerif", Font.PLAIN, 10); @@ -626,7 +625,7 @@ } public void setRapide(final boolean _b) { - // on ne fait rien + // on ne fait rien } public final void setUserXRange(final CtuluRange _rangeSpecByUser) { @@ -830,11 +829,11 @@ g2d.setColor(Color.WHITE); g2d.fillRect(0, 0, _w, _h); } - + if (getWidth() != _w || getHeight() != _h) { g2d.scale(CtuluLibImage.getRatio(_w, getWidth()), CtuluLibImage.getRatio(_h, getHeight())); } - + print(g2d); g2d.dispose(); i.flush(); @@ -863,4 +862,48 @@ } + public EGGraphe duplicate() { + + EGGraphe duplic = new EGGraphe(this.getModel().duplicate()); + duplic.autoRestore_ = this.autoRestore_; + duplic.cache_ = null; + duplic.cmd_ = this.cmd_; + + // -- copie des axes --// + if(this.axeOffset_!=null){ + duplic.axeOffset_=new TObjectIntHashMap(); + int[] values=this.axeOffset_.getValues(); + Object[] liste=this.axeOffset_.keys(); + for (int i = 0; i < liste.length; i++) { + int value = values[i]; + EGAxeVertical axe = (EGAxeVertical) liste[i]; + duplic.axeOffset_.put(axe.duplicate(), value); + } + } + duplic.coeffLarger_=this.coeffLarger_; + + if (this.objectInitAxe_ != null) { + duplic.objectInitAxe_ = new HashMap(); + + Set set = this.objectInitAxe_.keySet(); + Object[] vals = this.objectInitAxe_.values().toArray() ; + int cpt = 0; + for (Iterator it = set.iterator(); it.hasNext();) { + EGAxeVertical axe = (EGAxeVertical) it.next(); + duplic.objectInitAxe_.put(axe.duplicate(), vals[cpt++]); + } + } + if (this.xRange_ != null) + duplic.xRange_ = new CtuluRange(this.xRange_); + if (this.transformer_ != null) + duplic.transformer_ = this.transformer_.duplicate(); + if (this.xRangeSpecByUser_ != null) + duplic.xRangeSpecByUser_ = new CtuluRange(this.xRangeSpecByUser_); + + + + return duplic; +} + + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -12,7 +12,6 @@ import javax.swing.JComboBox; import org.fudaa.ctulu.CtuluCommandManager; - import org.fudaa.ebli.commun.EbliActionInterface; /** @@ -141,5 +140,10 @@ * @param _c la courbe a dupliquer */ void duplicateCourbe(CtuluCommandManager _mng, EGCourbe _c); + + /** + * methode qui permet de dupliquer les models de courbe + */ + public EGGrapheModel duplicate(); } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -13,6 +13,7 @@ import java.awt.Component; import java.util.ArrayList; import java.util.Arrays; +import java.util.Iterator; import java.util.List; import javax.swing.AbstractListModel; @@ -23,15 +24,14 @@ import javax.swing.table.AbstractTableModel; import javax.swing.table.TableModel; -import com.memoire.bu.BuComboBox; - import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLibString; - import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliLib; +import com.memoire.bu.BuComboBox; + /** * @author Fred Deniger * @version $Id: EGGrapheSimpleModel.java,v 1.19 2007-05-04 13:49:42 deniger Exp $ @@ -756,4 +756,36 @@ } + public EGGrapheModel duplicate() { + + + //--duplication de la liste des courbes --// + ArrayList<EGCourbeSimple> listeElements = new ArrayList<EGCourbeSimple>(); + + for (Iterator<EGCourbeSimple> it = this.element_.iterator(); it.hasNext();) { + EGCourbeSimple courbe = it.next(); + listeElements.add((EGCourbeSimple) courbe.duplicate()); + } + + EGGrapheSimpleModel duplic = new EGGrapheSimpleModel((EGCourbeSimple[]) listeElements.toArray()); + + duplic.axeX_ = this.axeX_.duplicate(); + // duplication du listselectionModel + try { + duplic.selection_ = (DefaultListSelectionModel) this.selection_.clone(); + } catch (CloneNotSupportedException e) { + + // -- si ce n'est pas duplicable, en cree un par defaut --// + duplic.selection_ = new DefaultListSelectionModel(); + + } + + // -- pas besoin de dupliquer le tableModel, il ne fait que gerer la liste + // elements --// + duplic.tableModel_ = new SimpleTableModel(); + + + return duplic; + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -29,16 +29,15 @@ import javax.swing.tree.TreePath; import javax.swing.tree.TreeSelectionModel; -import com.memoire.bu.BuComboBox; - import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.gui.CtuluTreeComboboxModel; import org.fudaa.ctulu.gui.CtuluTreeComboboxRenderer; - import org.fudaa.ebli.commun.EbliActionInterface; +import com.memoire.bu.BuComboBox; + /** * @author Fred Deniger * @version $Id: EGGrapheTreeModel.java,v 1.14 2007-05-04 13:49:41 deniger Exp $ @@ -1065,4 +1064,14 @@ internFireCourbeChanged((EGObject) _path.getLastPathComponent()); } + public EGGrapheModel duplicate() { + EGGrapheTreeModel duplic = new EGGrapheTreeModel(); + duplic.axeX_ = this.axeX_.duplicate(); + duplic.selectionModel_.setSelectionMode(this.selectionModel_.getSelectionMode()); + + + + return duplic; + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -23,7 +23,6 @@ import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; - import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BConfigurableInterface; import org.fudaa.ebli.controle.BSelecteurTextField; @@ -47,6 +46,12 @@ super(); comp_ = new ArrayList(10); } + + public EGGroup(List l) { + super(); + comp_ = l; + } + private EGParent.TreeNodes getEgParent() { return n_; @@ -504,5 +509,37 @@ public String toString() { return EbliLib.getS("Groupe") + CtuluLibString.ESPACE + title_; } + + public EGGroup duplicate() { + + + //-- duplication de comp --// + + ArrayList liste = new ArrayList(this.comp_.size()); + for(Iterator it=this.comp_.iterator();it.hasNext();){ + Object item=it.next(); + if (item instanceof EGCourbeChild) { + + // -- !!! reccurence !!! egcourbechild se duplique provoquqnt la + // duplication de eggroup et ainsi de suite --// + liste.add(((EGCourbeChild) item).duplicate()); + }else + // FIXME: adrien si c est pas instance de egcourbeChild, c estquoi ??? + // dans ce cas on duplique ?? + liste.add(item); + + } + + // -- duplication de l objet --// + EGGroup duplic = new EGGroup(liste); + duplic.isVisible_ = this.isVisible_; + duplic.title_ = this.title_; + duplic.n_ = this.n_; + duplic.y_ = this.y_.duplicate(); + + + return duplic; + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -10,7 +10,6 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.collection.CourbeInterface; - import org.fudaa.ebli.palette.BPaletteInfo; /** @@ -182,5 +181,12 @@ * @param _selectedPt la s\xE9lection */ void fillWithInfo(final BPaletteInfo.InfoData _table, final CtuluListSelectionInterface _selectedPt); + + /** + * methode qui permet de dupliquer le model + * + * @return + */ + EGModel duplicate(); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGObject.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGObject.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGObject.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -16,7 +16,6 @@ import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; - import org.fudaa.ebli.controle.BConfigurePaletteTargetInterface; import org.fudaa.ebli.controle.BSelecteurTargetInterface; import org.fudaa.ebli.palette.BPaletteInfo; @@ -60,6 +59,8 @@ public abstract EGAxeVertical getAxeY(); + + public abstract EGAxeHorizontal getAxeX(); public abstract void monter(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGRepere.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGRepere.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGRepere.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -114,4 +114,15 @@ return h_; } + + public EGRepere duplicate() { + + EGRepere duplic = new EGRepere(); + duplic.h_ = this.h_; + duplic.w_ = this.w_; + duplic.xAxe_ = this.xAxe_.duplicate(); + return duplic; + + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/trace/TraceBox.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/trace/TraceBox.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/trace/TraceBox.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -166,4 +166,21 @@ public void setVPosition(final int _position) { vPosition_ = _position; } + + public TraceBox duplicate() { + TraceBox duplic = new TraceBox(); + duplic.colorBoite_ = this.colorBoite_; + duplic.colorFond_ = this.colorFond_; + duplic.colorText_ = this.colorText_; + duplic.drawBox_ = this.drawBox_; + duplic.drawFond_ = this.drawFond_; + duplic.hMargin_ = this.hMargin_; + duplic.hPosition_ = this.hPosition_; + duplic.traceLigne_ = new TraceLigne(this.traceLigne_); + duplic.vMargin_ = this.vMargin_; + duplic.vPosition_ = this.vPosition_; + + return duplic; + } + } \ No newline at end of file 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-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -37,7 +37,8 @@ } else if (creator instanceof EbliWidgetCreatorDblFleche) { duplique.setCreator(new EbliWidgetCreatorDblFleche(((EbliWidgetCreatorDblFleche) getCreator()).getG())); } else if (creator instanceof EbliWidgetCreatorGraphe) { - duplique.setCreator(new EbliWidgetCreatorGraphe(((EbliWidgetCreatorGraphe) getCreator()).getGraphe())); + duplique + .setCreator(new EbliWidgetCreatorGraphe(((EbliWidgetCreatorGraphe) getCreator()).getGraphe().duplicate())); } else if (creator instanceof EbliWidgetCreatorVueCalque) { duplique.setCreator(new EbliWidgetCreatorVueCalque(((EbliWidgetCreatorVueCalque) getCreator()).getCalque())); } else if (creator instanceof EbliWidgetCreatorShape) { 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-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -459,7 +459,7 @@ bar.add(actionFont.getSizeFonts()); + - } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -11,12 +11,9 @@ import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; - import org.fudaa.dodico.mesure.EvolutionReguliereInterface; - import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; - import org.fudaa.fudaa.commun.FudaaLib; /** @@ -158,4 +155,8 @@ public boolean setValues(final int[] _idx, final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { return false; } + + public EGModel duplicate() { + return new FudaaCourbeDefautModel(this.e_.getCopy(this.e_.getListener())); + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -8,9 +8,9 @@ package org.fudaa.fudaa.commun.courbe; import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; - import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; @@ -192,4 +192,17 @@ yRange_ = null; } + public EGModel duplicate() { + FudaaCourbeTimeModel duplic = new FudaaCourbeTimeModel(this.time_); + if (this.yRange_ != null) + duplic.yRange_ = new CtuluRange(this.yRange_); + if(this.nom_!=null) + duplic.nom_ = nom_; + if (this.y_ != null) + duplic.y_ = CtuluLibArray.copy(y_); + + + return duplic; + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -10,10 +10,9 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.ProgressionInterface; - import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsBuilder; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; - +import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; /** @@ -179,4 +178,14 @@ public void fillWithInfo(final InfoData _table, final CtuluListSelectionInterface _selectedPt) {} + public EGModel duplicate() { + + MvProfileCoordinatesModel duplic = new MvProfileCoordinatesModel(this.res_, isX_); + duplic.title_ = this.title_; + duplic.ymax_ = this.ymax_; + duplic.ymin_ = this.ymin_; + + return duplic; + } + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeTime.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeTime.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeTime.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -15,14 +15,13 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import com.memoire.bu.BuResource; - import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluVariable; - import org.fudaa.ebli.animation.EbliAnimationAdapterInterface; import org.fudaa.ebli.controle.BSelecteurListTimeTarget; +import com.memoire.bu.BuResource; + /** * @author fred deniger * @version $Id: MvProfileCourbeTime.java,v 1.6 2007-05-04 13:59:49 deniger Exp $ @@ -43,13 +42,16 @@ selection_.addListSelectionListener(this); } - MvProfileCourbe duplicate() { + public MvProfileCourbe duplicate() { final MvProfileCourbeTime res = new MvProfileCourbeTime((MvProfileCourbeGroup) getParent(), getM().duplicate(), time_); res.setAspectContour(getAspectContour()); res.getM().setTitle(getTitle() + CtuluLibString.ESPACE + BuResource.BU.getString("Copie")); return res; } + + + public void contentsChanged(final ListDataEvent _e) { updateTitle(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -8,13 +8,12 @@ package org.fudaa.fudaa.tr.telemac; import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluListSelectionInterface; - import org.fudaa.dodico.h2d.telemac.H2dTelemacBordParFrontiere; import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundary; import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundaryCondition; import org.fudaa.dodico.h2d.type.H2dVariableType; - import org.fudaa.ebli.courbe.EGCourbeModelDefault; import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; @@ -247,4 +246,13 @@ public void fillWithInfo(final InfoData _table, final CtuluListSelectionInterface _selectedPt) {} + public EGModel duplicate() { + + return new TrTelemacBoundaryCourbeModel(this.nom_, this.fr_, this.b_, this.t_, + CtuluLibArray.copy(this.x_)); + + } + + + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java 2008-08-18 08:51:17 UTC (rev 3819) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java 2008-08-18 11:41:45 UTC (rev 3820) @@ -8,12 +8,11 @@ package org.fudaa.fudaa.tr.telemac; import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluListSelectionInterface; - import org.fudaa.dodico.h2d.resource.H2dResource; import org.fudaa.dodico.h2d.telemac.H2dTelemacSeuil; import org.fudaa.dodico.h2d.telemac.H2dTelemacSeuilMng; - import org.fudaa.ebli.courbe.EGCourbeModelDefault; import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; @@ -166,4 +165,8 @@ } public void fillWithInfo(final InfoData _table, final CtuluListSelectionInterface _selectedPt) {} + + public EGModel duplicate() { + return new TrTelemacWeirCourbeModel(this.i_, this.mng_, this.cote_, CtuluLibArray.copy(this.x_)); + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |