You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(46) |
Jul
(37) |
Aug
(154) |
Sep
(140) |
Oct
(132) |
Nov
(104) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(113) |
Feb
(73) |
Mar
(102) |
Apr
(106) |
May
(114) |
Jun
(67) |
Jul
(116) |
Aug
(48) |
Sep
(108) |
Oct
(296) |
Nov
(56) |
Dec
(53) |
2010 |
Jan
(95) |
Feb
(31) |
Mar
(40) |
Apr
(12) |
May
(10) |
Jun
(27) |
Jul
(19) |
Aug
(81) |
Sep
(48) |
Oct
(45) |
Nov
(40) |
Dec
(7) |
2011 |
Jan
(16) |
Feb
(32) |
Mar
(55) |
Apr
(38) |
May
(24) |
Jun
(37) |
Jul
(12) |
Aug
(16) |
Sep
(97) |
Oct
(90) |
Nov
(101) |
Dec
(89) |
2012 |
Jan
(18) |
Feb
(2) |
Mar
(54) |
Apr
(69) |
May
(97) |
Jun
(131) |
Jul
(70) |
Aug
(48) |
Sep
(48) |
Oct
(119) |
Nov
(194) |
Dec
(60) |
2013 |
Jan
(73) |
Feb
(35) |
Mar
(42) |
Apr
(28) |
May
(7) |
Jun
(17) |
Jul
(27) |
Aug
(10) |
Sep
(38) |
Oct
(12) |
Nov
(4) |
Dec
(16) |
2014 |
Jan
(33) |
Feb
(37) |
Mar
(19) |
Apr
(3) |
May
(47) |
Jun
(26) |
Jul
(22) |
Aug
|
Sep
(10) |
Oct
(30) |
Nov
(24) |
Dec
(19) |
2015 |
Jan
(13) |
Feb
(16) |
Mar
(36) |
Apr
(19) |
May
(5) |
Jun
(5) |
Jul
(3) |
Aug
(11) |
Sep
(22) |
Oct
(7) |
Nov
(14) |
Dec
|
2016 |
Jan
|
Feb
(26) |
Mar
(13) |
Apr
(61) |
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
(27) |
Nov
(14) |
Dec
(21) |
2017 |
Jan
(30) |
Feb
(4) |
Mar
(3) |
Apr
(5) |
May
(69) |
Jun
(29) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <emm...@us...> - 2008-09-29 08:47:50
|
Revision: 4002 http://fudaa.svn.sourceforge.net/fudaa/?rev=4002&view=rev Author: emmanuel_martin Date: 2008-09-29 08:47:46 +0000 (Mon, 29 Sep 2008) Log Message: ----------- changement mineur Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-29 07:56:38 UTC (rev 4001) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-29 08:47:46 UTC (rev 4002) @@ -318,13 +318,16 @@ private EGAxeHorizontal axeX_; private EGAxeVertical axeY_; // Vue de la courbe - EGCourbeSimple courbeVue_; + private EGCourbeSimple courbeVue_; // Gestion de la selection - CtuluListSelection listSelection_; + private CtuluListSelection listSelection_; // Model du tableau - CtuluTable tableauVue_; + private CtuluTable tableauVue_; + // Selection update + private boolean disable; public CourbeRepresentation() { + disable = false; model_.addTableModelListener(this); // Construction de la courbe \\ setPreferredSize(new Dimension(650,450)); @@ -465,16 +468,18 @@ */ public void listeSelectionChanged(CtuluListSelectionEvent _e) { // Un changement de selection a \xE9t\xE9 effectu\xE9 dans la courbe \\ - //Suppression de l'\xE9coute des changement de selection de le tableau - tableauVue_.getSelectionModel().removeListSelectionListener(this); - // Changement de selection dans le tableau - int[] selectedIndex = ((CtuluListSelectionInterface)_e.getSource()).getSelectedIndex(); - ListSelectionModel lstTableauSelect = tableauVue_.getSelectionModel(); - lstTableauSelect.clearSelection(); - for(int i=0; i<selectedIndex.length;i++) - lstTableauSelect.addSelectionInterval(selectedIndex[i], selectedIndex[i]); - // R\xE9activation de l'\xE9coute de changement de selection de le tableau - tableauVue_.getSelectionModel().addListSelectionListener(this); + if (!disable) { + // Suppression de l'\xE9coute des changement de selection de le tableau + disable=true; + // Changement de selection dans le tableau + int[] selectedIndex=((CtuluListSelectionInterface)_e.getSource()).getSelectedIndex(); + ListSelectionModel lstTableauSelect=tableauVue_.getSelectionModel(); + lstTableauSelect.clearSelection(); + for (int i=0; i<selectedIndex.length; i++) + lstTableauSelect.addSelectionInterval(selectedIndex[i], selectedIndex[i]); + // R\xE9activation de l'\xE9coute de changement de selection de le tableau + disable=false; + } } /* (non-Javadoc) @@ -482,19 +487,21 @@ */ public void valueChanged(ListSelectionEvent _e) { // Un changement de selection a \xE9t\xE9 effectu\xE9 dans le tableau \\ - //Suppression de l'\xE9coute des changement de selection de la courbe - listSelection_.removeListeSelectionListener(this); - // Changement de selection de la courbe - CtuluListSelection lst = new CtuluListSelection(); - ListSelectionModel lstSelect = tableauVue_.getSelectionModel(); - listSelection_.clear(); - for(int i=0; i<tableauVue_.getRowCount();i++) - if(lstSelect.isSelectedIndex(i)) - lst.add(i); - if(!lst.isEmpty()) - listSelection_.setSelection(lst); - // R\xE9activation de l'\xE9coute de changement de selection de la courbe - listSelection_.addListeSelectionListener(this); + if (!disable) { + // Suppression de l'\xE9coute des changement de selection de la courbe + disable=true; + // Changement de selection de la courbe + CtuluListSelection lst=new CtuluListSelection(); + ListSelectionModel lstSelect=tableauVue_.getSelectionModel(); + listSelection_.clear(); + for (int i=0; i<tableauVue_.getRowCount(); i++) + if (lstSelect.isSelectedIndex(i)) + lst.add(i); + if (!lst.isEmpty()) + listSelection_.setSelection(lst); + // R\xE9activation de l'\xE9coute de changement de selection de la courbe + disable=false; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-09-29 07:56:44
|
Revision: 4001 http://fudaa.svn.sourceforge.net/fudaa/?rev=4001&view=rev Author: emmanuel_martin Date: 2008-09-29 07:56:38 +0000 (Mon, 29 Sep 2008) Log Message: ----------- correction d'un bug dans l'?\195?\169dition de profile dans prepro. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java 2008-09-28 21:25:27 UTC (rev 4000) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java 2008-09-29 07:56:38 UTC (rev 4001) @@ -52,7 +52,7 @@ final int[] _selectedAtomic, final boolean _useAttribute) { super(_formatter, _zone, _selectedAtomic); g_ = _zone; - modeles_ = _useAttribute ? _zone.getModels() : null; + modeles_ = _useAttribute ? _zone.getModels() : new GISAttributeModel[0]; } protected void apply(final CtuluCommandComposite _cmp) {} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-28 21:25:30
|
Revision: 4000 http://fudaa.svn.sourceforge.net/fudaa/?rev=4000&view=rev Author: deniger Date: 2008-09-28 21:25:27 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java 2008-09-28 21:25:07 UTC (rev 3999) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java 2008-09-28 21:25:27 UTC (rev 4000) @@ -101,29 +101,6 @@ fenetre = ls.get(indiceFilleelect); } return fenetre.controller_.getSceneCourante(); - // EbliScene dest = null; - // // -- on recherche si dans la fille selectionne il existe plusieurs sous - // // layout --// - // if (fenetre.controller_.listeScenes_.size() <= 1) { - // dest = fenetre.controller_.getSceneCourante(); - // } else { - // - // // recuperation de toutes les noms des frames post du projet --// - // String[] listeLayout = formatteLayout(fenetre.controller_); - // - // BuDialogChoice chooser = new BuDialogChoice(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - // TrResource.TR.getS("S\xE9lectionnez"), TrResource.TR.getS("S\xE9lectionnez le layout de la fen\xEAtre") - // + fenetre.getTitle() + TrResource.TR.getS(" dans laquelle dupliquer l'objet "), listeLayout); - // - // int response = chooser.activate(); - // - // if (response == 0) { - // int indiceLayoutelect = chooser.getSelectedIndex(); - // dest = fenetre.controller_.getScene(indiceLayoutelect); - // } - // - // } - } // public String[] formatteLayout(TrPostLayoutPanelController _controller) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java 2008-09-28 21:25:07 UTC (rev 3999) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataVecteur.java 2008-09-28 21:25:27 UTC (rev 4000) @@ -48,8 +48,8 @@ vx = x_.getValue(_idxElt); vy = y_.getValue(_idxElt); } else { - vx = EfInterpolator.interpolate(_idxElt, _x, _y, x_, y_, true, _grid); - vy = EfInterpolator.interpolate(_idxElt, _x, _y, x_, y_, false, _grid); + vx = EfInterpolator.interpolateDangerous(_idxElt, _x, _y, x_, _grid); + vy = EfInterpolator.interpolateDangerous(_idxElt, _x, _y, y_, _grid); } _target.e_.x_ = _x + vx; _target.e_.y_ = _y + vy; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2008-09-28 21:25:07 UTC (rev 3999) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2008-09-28 21:25:27 UTC (rev 4000) @@ -527,11 +527,11 @@ protected InterpolationVectorContainer createVectorInterpolation() { if (vectors_ == null) { vectors_ = new InterpolationVectorContainer(); - if (fleches_ != null) { - for (int i = 0; i < fleches_.length; i++) { - vectors_.addVxVy(fleches_[i].getVx(), fleches_[i].getVy()); - } - } + // if (fleches_ != null) { + // for (int i = 0; i < fleches_.length; i++) { + // vectors_.addVxVy(fleches_[i].getVx(), fleches_[i].getVy()); + // } + // } } return vectors_; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-28 21:25:17
|
Revision: 3999 http://fudaa.svn.sourceforge.net/fudaa/?rev=3999&view=rev Author: deniger Date: 2008-09-28 21:25:07 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/save/TrPostProjetSaver.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/save/TrPostProjetSaver.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/save/TrPostProjetSaver.java 2008-09-28 21:24:55 UTC (rev 3998) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/save/TrPostProjetSaver.java 2008-09-28 21:25:07 UTC (rev 3999) @@ -77,7 +77,7 @@ final File zip = getSaveFile(); final CtuluAnalyze ana = new CtuluAnalyze(); boolean res = true; - if (zip.exists()) { + if (zip!=null && zip.exists()) { FudaaSaveZipLoader loader = null; try { loader = new FudaaSaveZipLoader(zip); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-28 21:24:58
|
Revision: 3998 http://fudaa.svn.sourceforge.net/fudaa/?rev=3998&view=rev Author: deniger Date: 2008-09-28 21:24:55 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 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-09-28 21:21:54 UTC (rev 3997) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-28 21:24:55 UTC (rev 3998) @@ -230,9 +230,11 @@ public JMenu[] getSpecificMenus() { if (menus_ == null) { menus_ = new JMenu[] { controller_.createMenu() }; + menus_[0].setText(getTitle()); } return menus_; } + @Override public JComponent[] getSpecificTools() { @@ -469,7 +471,10 @@ @Override public void setTitle(final String _title) { super.setTitle(_title); - if (ecrasePrevious_) previousTitleFrame = title; + if (ecrasePrevious_) { + previousTitleFrame = title; + if(menus_!=null) menus_[0].setText(_title); + } else ecrasePrevious_ = true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-28 21:22:05
|
Revision: 3997 http://fudaa.svn.sourceforge.net/fudaa/?rev=3997&view=rev Author: deniger Date: 2008-09-28 21:21:54 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineFlowrateResult.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/H2dParameters.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/lock_16.png branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/unlock_16.png Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineFlowrateResult.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineFlowrateResult.java 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineFlowrateResult.java 2008-09-28 21:21:54 UTC (rev 3997) @@ -9,18 +9,15 @@ import java.io.IOException; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluLibGeometrie; import org.fudaa.ctulu.CtuluVariable; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; -import org.fudaa.ctulu.interpolation.InterpolationVectorContainer; - import org.fudaa.dodico.ef.EfData; -import org.fudaa.dodico.ef.EfDataInterpolationAdapter; import org.fudaa.dodico.ef.EfGridData; +import com.memoire.fu.FuLog; + /** * Une classe permettant de calculer le d\xE9bit \xE0 partir d'un profil. * @@ -112,49 +109,49 @@ * @param _h la hauteur d'eau * @return le d\xE9bit */ - double getQ(int _idxPtOnProfil, EfData _norme, EfData _theta, EfData _h, EfLineIntersectionsResultsI _res) { + double getQ(int _idxPtOnProfil, EfData _vx, EfData _vy, EfData _h, EfLineIntersectionsResultsI _res) { if (_idxPtOnProfil >= _res.getNbIntersect() - 1) return 0; // le point 1 int idx = _idxPtOnProfil; calculator_.x1_ = _res.getIntersect(idx).getX(); calculator_.y1_ = _res.getIntersect(idx).getY(); - double n = _res.getIntersect(idx).getValueBadInterpolation(_norme); - double t = _res.getIntersect(idx).getValueBadInterpolation(_theta); - calculator_.vx1_ = InterpolationVectorContainer.getVx(n, t); - calculator_.vy1_ = InterpolationVectorContainer.getVy(n, t); + // double n = _res.getIntersect(idx).getValueBadInterpolation(_vx); + // double t = _res.getIntersect(idx).getValueBadInterpolation(_vy); + calculator_.vx1_ = _res.getIntersect(idx).getValueBadInterpolation(_vx);// InterpolationVectorContainer.getVx(n, t); + calculator_.vy1_ = _res.getIntersect(idx).getValueBadInterpolation(_vy); calculator_.h1_ = _res.getIntersect(idx).getValueBadInterpolation(_h); idx++; calculator_.x2_ = _res.getIntersect(idx).getX(); calculator_.y2_ = _res.getIntersect(idx).getY(); - n = _res.getIntersect(idx).getValueBadInterpolation(_norme); - t = _res.getIntersect(idx).getValueBadInterpolation(_theta); - calculator_.vx2_ = InterpolationVectorContainer.getVx(n, t); - calculator_.vy2_ = InterpolationVectorContainer.getVy(n, t); +// n = _res.getIntersect(idx).getValueBadInterpolation(_vx); +// t = _res.getIntersect(idx).getValueBadInterpolation(_vy); + calculator_.vx2_ = _res.getIntersect(idx).getValueBadInterpolation(_vx); + calculator_.vy2_ = _res.getIntersect(idx).getValueBadInterpolation(_vy); calculator_.h2_ = _res.getIntersect(idx).getValueBadInterpolation(_h); return calculator_.getQ(); } public double getQ(EfGridData _data, int _tidx, ProgressionInterface _prog) { - EfData norme = null; - EfData theta = null; + EfData vx = null; + EfData vy = null; EfData h = null; try { - EfData vx = _data.getData(vx_, _tidx); - EfData vy = _data.getData(vy_, _tidx); - norme = new EfDataInterpolationAdapter.Norm(vx, vy); - theta = new EfDataInterpolationAdapter.Theta(vx, vy); + vx = _data.getData(vx_, _tidx); + vy = _data.getData(vy_, _tidx); + // norme = new EfDataInterpolationAdapter.Norm(vx, vy); + // theta = new EfDataInterpolationAdapter.Theta(vx, vy); h = _data.getData(h_, _tidx); } catch (IOException _evt) { FuLog.error(_evt); } - if (norme == null || theta == null || h == null) return 0; + if (vx == null || vy == null || h == null) return 0; double q = 0; EfLineIntersectionsResultsI res = res_.createResults(_tidx, _prog); ProgressionUpdater up = new ProgressionUpdater(_prog); up.setValue(10, res.getNbIntersect() - 1); for (int i = 0; i < res.getNbIntersect() - 1; i++) { - if (res.isSegmentIn(i)) q += getQ(i, norme, theta, h, res); + if (res.isSegmentIn(i)) q += getQ(i, vx, vy, h, res); up.majAvancement(); } return q; Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/H2dParameters.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/H2dParameters.java 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/H2dParameters.java 2008-09-28 21:21:54 UTC (rev 3997) @@ -242,11 +242,11 @@ public static InterpolationVectorContainer createDefaultVectorContainer() { InterpolationVectorContainer defaultC = new InterpolationVectorContainer(); - defaultC.addVxVy(H2dVariableType.VENT_X, H2dVariableType.VENT_Y); - defaultC.addVxVy(H2dVariableType.VITESSE_U, H2dVariableType.VITESSE_V); - defaultC.addVxVy(H2dVariableType.VITESSE_NORMALE, H2dVariableType.VITESSE_TANGENTIELLE); - defaultC.addVxVy(H2dVariableType.DEBIT_NORMAL, H2dVariableType.DEBIT_TANGENTIEL); - defaultC.addVxVy(H2dVariableType.DEBIT_X, H2dVariableType.DEBIT_Y); +// defaultC.addVxVy(H2dVariableType.VENT_X, H2dVariableType.VENT_Y); +// defaultC.addVxVy(H2dVariableType.VITESSE_U, H2dVariableType.VITESSE_V); +// defaultC.addVxVy(H2dVariableType.VITESSE_NORMALE, H2dVariableType.VITESSE_TANGENTIELLE); +// defaultC.addVxVy(H2dVariableType.DEBIT_NORMAL, H2dVariableType.DEBIT_TANGENTIEL); +// defaultC.addVxVy(H2dVariableType.DEBIT_X, H2dVariableType.DEBIT_Y); return defaultC; } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 2008-09-28 21:21:54 UTC (rev 3997) @@ -621,4 +621,6 @@ Cliquez sur le graphe pour s\xE9lectionner le x voulu.=Click on the graph in order to select the proper x Fermer la palette pour quitter le mode s\xE9lection du graphe=Close the graphical ui in order to quit the graph's selection mode X s\xE9lectionn\xE9:=Selected X: -Interpolation Fusion=Fusion interpolation \ No newline at end of file +Interpolation Fusion=Fusion interpolation +Bloquer la taille et la position de la frame=Lock the size and the location of the frame +D\xE9bloquer la taille et la position de la frame=Unlock the size and the location of the frame \ No newline at end of file Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/lock_16.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/unlock_16.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-09-28 21:21:54 UTC (rev 3997) @@ -115,17 +115,16 @@ // -- raffraichissement de la scene --// widget_.getEbliScene().refresh(); } - + postActionDuplication(n, duplique); } }); } - + /** - * Methode a surcharger si on veut effectuer un traitement particulier apres - * duplication du widget. + * Methode a surcharger si on veut effectuer un traitement particulier apres duplication du widget. */ public void postActionDuplication(EbliNode node, EbliNode duplique) { @@ -246,17 +245,15 @@ } }); - + _popup.addSeparator(); constructMenuMasquer(_popup, cmd_); - + constructMenuBloquer(_popup, cmd_); + constructMenuSupprimer(_popup, cmd_); if (canDuplicate_) { + _popup.addSeparator(); constructMenuDupliquer(_popup, cmd_); } - constructMenuBloquer(_popup, cmd_); - - constructMenuSupprimer(_popup, cmd_); - } /** @@ -305,9 +302,9 @@ } public String getDescription() { - + return description_; - + } public BuMenuBar getMenubarComponent() { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java 2008-09-28 08:49:32 UTC (rev 3996) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java 2008-09-28 21:21:54 UTC (rev 3997) @@ -25,7 +25,7 @@ final CtuluCommandContainer cmd_; boolean bloque_ = true; EbliWidget widget_; - + public EbliWidgetActionBloqueOuDebloqueWidget(String name, Icon ic, String id, EbliWidget _widget, boolean bloque) { super(_widget.getEbliScene(), name, ic, id); @@ -34,20 +34,26 @@ bloque_ = bloque; } + @SuppressWarnings("serial") public static class Bloque extends EbliWidgetActionBloqueOuDebloqueWidget { public Bloque(EbliWidget _widget) { - super(EbliResource.EBLI.getString("Bloquer la frame"), CtuluResource.CTULU - .getIcon("crystal_tuer"), "BLOQUEWIDGET", _widget, true); + super(EbliResource.EBLI.getString("Bloquer la frame"), EbliResource.EBLI.getIcon("lock_16"), "BLOQUEWIDGET", + _widget, true); + setDefaultToolTip(EbliResource.EBLI.getString("Bloquer la taille et la position de la frame")); + } } + @SuppressWarnings("serial") public static class DeBloque extends EbliWidgetActionBloqueOuDebloqueWidget { public DeBloque(EbliWidget _widget) { - super(EbliResource.EBLI.getString("Debloquer la frame"), CtuluResource.CTULU - .getIcon("crystal_valider"), "DEBLOQUEWIDGET", _widget, false); + super(EbliResource.EBLI.getString("Debloquer la frame"), EbliResource.EBLI.getIcon("unblock_16"), + "DEBLOQUEWIDGET", _widget, false); + setDefaultToolTip(EbliResource.EBLI.getString("D\xE9bloquer la taille et la position de la frame")); + } } @@ -55,40 +61,32 @@ public void actionPerformed(ActionEvent e) { EbliWidgetController controller = null; - - - if (widget_ instanceof EbliWidgetBordureSingle) { - controller = ((EbliWidgetBordureSingle) widget_).getBordureController(); - } else - if (widget_.getParentWidget() instanceof EbliWidgetBordureSingle) { - controller = ((EbliWidgetBordureSingle) widget_.getParentWidget()).getBordureController(); - } else - controller = widget_.getController(); - - - if (bloque_) { + if (widget_ instanceof EbliWidgetBordureSingle) { + + controller = ((EbliWidgetBordureSingle) widget_).getBordureController(); + } else if (widget_.getParentWidget() instanceof EbliWidgetBordureSingle) { + controller = ((EbliWidgetBordureSingle) widget_.getParentWidget()).getBordureController(); + } else controller = widget_.getController(); + + if (bloque_) { controller.removeActionResizeAndMove(); - + // -- on change l action du bouton du controller --// // -- ACHTUNG!! il faut toujours utilsier el controller de la widget car // le controlelr de la bordure ne contient pas de menus widget_.getController().boutonBloque.setAction(new EbliWidgetActionBloqueOuDebloqueWidget.DeBloque(widget_)); widget_.getController().isBlocked = true; - - } else { - controller.replaceActionResizeAndMove(); - // -- on change l action du bouton du controller --// + + } else { + controller.replaceActionResizeAndMove(); + // -- on change l action du bouton du controller --// widget_.getController().boutonBloque.setAction(new EbliWidgetActionBloqueOuDebloqueWidget.Bloque(widget_)); - widget_.getController().isBlocked = false; - } - // -- rafraichissement de la scene --// - scene_.refresh(); + widget_.getController().isBlocked = false; + } + // -- rafraichissement de la scene --// + scene_.refresh(); - - - - // -- enregistrement de la commande undoRedo --// if (cmd_ != null) { cmd_.addCmd(new CommandUndoRedoBloque(controller, bloque_)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-28 08:49:43
|
Revision: 3996 http://fudaa.svn.sourceforge.net/fudaa/?rev=3996&view=rev Author: deniger Date: 2008-09-28 08:49:32 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 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-09-27 19:06:59 UTC (rev 3995) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-09-28 08:49:32 UTC (rev 3996) @@ -1051,6 +1051,7 @@ // -- creation du menu POST de base --// setMenuPost(); + impl_.addInternalFrame(filleLayout); // pour charger les icones dans un thread a part // fille_.getVisuPanel().getController().buildActions(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-27 19:07:05
|
Revision: 3995 http://fudaa.svn.sourceforge.net/fudaa/?rev=3995&view=rev Author: hadouxad Date: 2008-09-27 19:06:59 +0000 (Sat, 27 Sep 2008) Log Message: ----------- - Importation des structures scopeS,t et gene idfferenciation des structure en fonction des graphes debut mise en place du lnf substance Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaLookPreferencesPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.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/rubar/TrRubarTarageCourbesManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/lib/asm-all-2.2.2.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/forms-1.2.0.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/laf-plugin-50.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/laf-widget.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance-baseline.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance-swingx.jar branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeT.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/asm-all-2.2.2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/forms-1.2.0.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/laf-plugin-50.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/laf-widget.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance-baseline.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance-swingx.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -60,6 +60,14 @@ return listeVariales_.get(_i); } + public List<Double> getListValueForVariable(int i) { + return data_.get(getVariable(i)); + } + + public double getValueOfvariable(int indexVar,int indexValue){ + return getListValueForVariable(indexVar).get(indexValue); + } + public void addValueForVariable(double value, int indexVariable) { data_.get(listeVariales_.get(indexVariable)).add(value); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -41,6 +41,7 @@ import org.fudaa.dodico.telemac.io.ScopeGENEFileFormat; import org.fudaa.dodico.telemac.io.ScopeSFileFormat; import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.dodico.telemac.io.ScopeTFileFormat; import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionSimple; @@ -50,6 +51,7 @@ import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.impl.FudaaGuiLib; import org.fudaa.fudaa.commun.impl.FudaaImportCsvPanel; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import com.memoire.bu.BuFileFilter; import com.memoire.bu.BuResource; @@ -121,6 +123,8 @@ */ void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog); + public boolean isSpatial(); + } public static class ExportAction extends EbliActionSimple { @@ -134,7 +138,7 @@ } public void actionPerformed(final ActionEvent _e) { - EGExporter.startExport(graphe_, impl_, getFileFormatForExport()); + EGExporter.startExport(graphe_, impl_, getFileFormatForExport(graphe_)); } } @@ -158,7 +162,7 @@ } public void actionPerformed(final ActionEvent _e) { - final FileFormat[] ft = getFileFormatForImportEvol(); + final FileFormat[] ft = getFileFormatForImportEvol(target_); Arrays.sort(ft); final BuFileFilter[] filters = FileFormat.createFilters(ft); final CtuluFileChooser fileChooser = FudaaGuiLib.getFileChooser(BuResource.BU.getString("Importer"), filters, @@ -184,7 +188,7 @@ } } - public static FileFormat[] getFileFormatForImportEvol() { + public static FileFormat[] getFileFormatForImportEvol(final FudaaCourbeImporter.Target target) { final ArrayList r = new ArrayList(10); r.add(TelemacLiquideFileFormat.getInstance()); r.add(EvolutionFileFormat.getInstance()); @@ -192,7 +196,11 @@ r.add(CLTransitoireFileFormat.getInstance()); r.add(RubarTARFileFormat.getInstance()); r.add(RubarCLIFileFormat.getInstance()); + if (target != null && target.isSpatial()) r.add(ScopeSFileFormat.getInstance()); + else + if (target != null) + r.add(ScopeTFileFormat.getInstance()); r.add(ScopeGENEFileFormat.getInstance()); final FileFormat[] rf = new FileFormat[r.size()]; @@ -207,14 +215,18 @@ * * @return */ - public static List<CtuluWriter> getFileFormatForExport() { + public static List<CtuluWriter> getFileFormatForExport(EGGraphe graphe) { final ArrayList<CtuluWriter> liste = new ArrayList<CtuluWriter>(10); liste.add(new CtuluTableExcelWriter()); liste.add(new CtuluTableCsvWriter()); // --ajout des formats scope --// + if (graphe.getModel() instanceof MvProfileTreeModel) liste.add(new FudaaWriterScopeS()); + else + liste.add(new FudaaWriterScopeT()); + liste.add(new FudaaWriterScopeGENE()); return liste; } Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeT.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeT.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -0,0 +1,17 @@ +package org.fudaa.fudaa.commun.courbe; + +import org.fudaa.dodico.telemac.io.ScopeTFileFormat; + +public class FudaaWriterScopeT extends FudaaWriterScopeS { + + + ScopeTFileFormat format_; + String extension_ = ".scopT"; + + public FudaaWriterScopeT() { + format_ = ScopeTFileFormat.getInstance(); + filter_ = format_.createFileFilter(); + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaLookPreferencesPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaLookPreferencesPanel.java 2008-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaLookPreferencesPanel.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -25,7 +25,20 @@ import org.fudaa.fudaa.tr.common.TrResource; -import com.memoire.bu.*; +import com.memoire.bu.BuAbstractPreferencesPanel; +import com.memoire.bu.BuColorIcon; +import com.memoire.bu.BuComboBox; +import com.memoire.bu.BuCommonInterface; +import com.memoire.bu.BuGridLayout; +import com.memoire.bu.BuLabel; +import com.memoire.bu.BuOptionItem; +import com.memoire.bu.BuOptionRenderer; +import com.memoire.bu.BuPanel; +import com.memoire.bu.BuPreferences; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuTextField; +import com.memoire.bu.BuTextureIcon; +import com.memoire.bu.BuVerticalLayout; import com.memoire.fu.FuLib; /** @@ -93,6 +106,8 @@ .isEnabled("ASPECT_KUNSTSTOFF"))); optionsStr_.put("ASPECT_LIQUID", new BuOptionItem("Liquid", BuResource.BU.getMenuIcon(aspectStr), options_ .isEnabled("ASPECT_LIQUID"))); + optionsStr_.put("ASPECT_SUBSTANCE", new BuOptionItem("Substance", BuResource.BU.getMenuIcon(aspectStr), options_ + .isEnabled("ASPECT_SUBSTANCE"))); optionsStr_.put("ASPECT_MAC", new BuOptionItem("Mac", BuResource.BU.getMenuIcon(aspectStr), options_ .isEnabled("ASPECT_MAC"))); optionsStr_.put("ASPECT_METAL", new BuOptionItem("Metal", BuResource.BU.getMenuIcon(aspectStr), options_ @@ -153,7 +168,7 @@ // Aspect lbGenAspAspect_ = new BuLabel(getS("Aspect:"), SwingConstants.RIGHT); - items = new BuOptionItem[10]; + items = new BuOptionItem[11]; int i = 0; items[i++] = optionsStr_.get(getAspectDefaut()); // items[ i++]=optionsStr_.get("ASPECT_AMIGA"); @@ -161,6 +176,7 @@ items[i++] = optionsStr_.get("ASPECT_GTK"); // items[ i++]=optionsStr_.get("ASPECT_KUNSTSTOFF"); items[i++] = optionsStr_.get("ASPECT_LIQUID"); + items[i++] = optionsStr_.get("ASPECT_SUBSTANCE"); items[i++] = optionsStr_.get("ASPECT_MAC"); items[i++] = optionsStr_.get("ASPECT_METAL"); items[i++] = optionsStr_.get("ASPECT_MOTIF"); Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java 2008-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -1,51 +0,0 @@ -package org.fudaa.fudaa.tr.common; - -import org.fudaa.ctulu.CtuluCommandManager; -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.dodico.mesure.EvolutionReguliereInterface; -import org.fudaa.dodico.telemac.io.ScopeStructure; -import org.fudaa.ebli.courbe.EGGraphe; -import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; -import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; - -/** - * Manager pour gerer l'importation de courbes au format scope. - * - * @author Adrien Hadoux - * - */ -public class TrCourbeSpatialManager implements FudaaCourbeImporter.Target { - - EGGraphe graphe_; - MvProfileTreeModel modelGraphe_; - /** - * indique si la courbe a importer est correcte - */ - private boolean enabled = true; - TrCommonImplementation impl_; - - - public TrCourbeSpatialManager(EGGraphe _graphe, TrCommonImplementation _impl) { - super(); - graphe_ = _graphe; - impl_ = _impl; - if (_graphe.getModel() instanceof MvProfileTreeModel) - modelGraphe_ = (MvProfileTreeModel) _graphe.getModel(); - else - enabled = false; - } - - public void importCourbes(EvolutionReguliereInterface[] _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { - } - - public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { - if (!enabled) { - impl_.error("Le graphe n'est pas compatible. Il ne s'agit pas de profil spatiaux."); - return; - } else { - // blablabli recup de ma structure - - } - } - -} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -464,5 +464,10 @@ public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { } + + public boolean isSpatial() { + return false; + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java 2008-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileFormatManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -13,11 +13,7 @@ import java.util.Map; import java.util.TreeMap; -import com.memoire.bu.BuInformationsSoftware; -import com.memoire.bu.BuMenu; - import org.fudaa.ctulu.fileformat.FileFormat; - import org.fudaa.dodico.dunes.io.DunesFileFormat; import org.fudaa.dodico.h2d.type.H2dFileFormatType; import org.fudaa.dodico.reflux.io.CorEleBthFileFormat; @@ -30,12 +26,14 @@ import org.fudaa.dodico.telemac.TelemacDicoFileFormat; import org.fudaa.dodico.telemac.io.SerafinFileFormat; import org.fudaa.dodico.trigrid.TrigridFileFormat; - import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.tr.reflux.TrRefluxImplHelper; import org.fudaa.fudaa.tr.rubar.TrRubarImplHelper; import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper; +import com.memoire.bu.BuInformationsSoftware; +import com.memoire.bu.BuMenu; + /** * @author deniger * @version $Id: TrFileFormatManager.java,v 1.30 2007-06-20 12:23:38 deniger Exp $ @@ -53,7 +51,7 @@ } public static FileFormat getFileFormatImportForId(final String _id) { - final FileFormat[] ftsImport = FudaaCourbeImporter.getFileFormatForImportEvol(); + final FileFormat[] ftsImport = FudaaCourbeImporter.getFileFormatForImportEvol(null); for (int i = ftsImport.length - 1; i >= 0; i--) { if (ftsImport[i].getID().equals(_id)) { return ftsImport[i]; Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java (from rev 3994, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -0,0 +1,99 @@ +package org.fudaa.fudaa.tr.common; + +import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.mesure.EvolutionReguliereInterface; +import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.dodico.telemac.io.ScopeStructure.Gene; +import org.fudaa.dodico.telemac.io.ScopeStructure.SorT; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; + +/** + * Manager pour gerer l'importation de courbes au format scope. + * + * @author Adrien Hadoux + * + */ +public class TrImportCourbeScopeManager implements FudaaCourbeImporter.Target { + + EGGraphe graphe_; + MvProfileTreeModel modelGraphe_; + /** + * indique si la courbe a importer est correcte + */ + private boolean enabled = true; + TrCommonImplementation impl_; + + + public TrImportCourbeScopeManager(EGGraphe _graphe, TrCommonImplementation _impl) { + super(); + graphe_ = _graphe; + impl_ = _impl; + // if (_graphe.getModel() instanceof MvProfileTreeModel) + modelGraphe_ = (MvProfileTreeModel) _graphe.getModel(); + // else + // enabled = false; + } + + public void importCourbes(EvolutionReguliereInterface[] _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + + // do nothing + + + + } + + public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + // if (!enabled) { + // impl_.error( + // "Le graphe n'est pas compatible. Il ne s'agit pas de profil spatiaux."); + // return; + // } else { + // -- import des courbes dans le graphe --// + + if(_crb instanceof ScopeStructure.SorT) + importCourbesSorT((SorT) _crb, _mng, _prog); + else + importCourbesGENE((Gene) _crb, _mng, _prog); + // } + } + + /** + * Methode d import depuis format scope S ou t + * + * @param _crb + * @param _mng + * @param _prog + */ + public void importCourbesSorT(ScopeStructure.SorT s, CtuluCommandManager _mng, ProgressionInterface _prog) { + + // -- on parcours toutes les variables --// + for (int i = 0; i < s.getNbVariables(); i++) { + + // --on recherche si cette variable n'existe pas deja dans le graphe --// + // graphe_.getModel().get + + } + + + } + + + /** + * Methode d import depusi scope GENE + * + * @param _crb + * @param _mng + * @param _prog + */ + public void importCourbesGENE(ScopeStructure.Gene s, CtuluCommandManager _mng, ProgressionInterface _prog) { + + } + + public boolean isSpatial() { + return graphe_.getModel() instanceof MvProfileTreeModel; + } + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrImportCourbeScopeManager.java ___________________________________________________________________ Added: svn:mergeinfo + 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-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -39,7 +39,7 @@ import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; -import org.fudaa.fudaa.tr.common.TrCourbeSpatialManager; +import org.fudaa.fudaa.tr.common.TrImportCourbeScopeManager; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.netbeans.api.visual.widget.Widget; @@ -563,7 +563,7 @@ listeActions.add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); //--ajout des actions import export format scope --// - listeActions.add(new FudaaCourbeImporter.ImportAction(new TrCourbeSpatialManager(_graphe.getGraphe(), + listeActions.add(new FudaaCourbeImporter.ImportAction(new TrImportCourbeScopeManager(_graphe.getGraphe(), projet_.impl_), projet_.impl_, creator.getGraphe().getCmd())); listeActions.add( new FudaaCourbeImporter.ExportAction(creator.getGraphe(), projet_.impl_)); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java 2008-09-27 16:20:25 UTC (rev 3994) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java 2008-09-27 19:06:59 UTC (rev 3995) @@ -152,4 +152,8 @@ public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { } + public boolean isSpatial() { + return false; + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-09-27 16:20:33
|
Revision: 3994 http://fudaa.svn.sourceforge.net/fudaa/?rev=3994&view=rev Author: bmarchan Date: 2008-09-27 16:20:25 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Correction pour que le graphe suive l'agrandissement de fenetre. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-26 22:34:47 UTC (rev 3993) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-27 16:20:25 UTC (rev 3994) @@ -7,6 +7,7 @@ */ package org.fudaa.ebli.calque.edition; +import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Dimension; @@ -18,6 +19,7 @@ import javax.swing.AbstractButton; import javax.swing.Action; +import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JTabbedPane; import javax.swing.JTable; @@ -325,10 +327,9 @@ public CourbeRepresentation() { model_.addTableModelListener(this); // Construction de la courbe \\ + setPreferredSize(new Dimension(650,450)); EGGrapheSimpleModel grapheModel=new EGGrapheSimpleModel(); grapheVue_=new EGGraphe(grapheModel); - grapheVue_.setPreferredSize(new Dimension(400, 600)); - grapheVue_.setSize(grapheVue_.getPreferredSize()); // Axe des X axeX_=new EGAxeHorizontal(false); axeX_.setTitre(EbliLib.getS("Abscisse curviligne")); @@ -385,7 +386,9 @@ left.add(buttons, BuBorderLayout.NORTH); left.add(scrollPane, BuBorderLayout.CENTER); BuSplit2Pane splitPane = new BuSplit2Pane(left, pnD, BuSplit2Pane.HORIZONTAL); - add(splitPane); + setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); + setLayout(new BorderLayout(0,0)); + add(splitPane,BorderLayout.CENTER); } public int getNbValues() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-26 22:34:58
|
Revision: 3993 http://fudaa.svn.sourceforge.net/fudaa/?rev=3993&view=rev Author: deniger Date: 2008-09-26 22:34:47 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestEGGraphe.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.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/TrIsoLineAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizard.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizardListValue.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionDuplicate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostAnalyze.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDataCreationPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspector.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorReaderReflux.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorReaderRubar.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInspectorReaderSerafin.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/TrPostMultiSourceActivator.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProfileAction.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/TrPostProjetChooser.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarEdgesResults.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLimniMng.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSource.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.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/TrPostSourceReflux.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceRubar.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceSerafin.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTimeFmtPanel.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 branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardProfilSpatial.java branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/mv/TestProfile.java branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/tr/Test3D.java branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/tr/TestJTrPostProject.java branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/tr/TrTestPostWatcherRubar.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluCommandAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarSpecificAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/save/ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/save/TrPostProjetSaver.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSrc.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/TrPostSourceActivator.java Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluCommandAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluCommandAction.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluCommandAction.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -0,0 +1,86 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ctulu; + +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.KeyStroke; + +import com.memoire.bu.BuResource; + +/** + * @author deniger + */ +@SuppressWarnings("serial") +public abstract class CtuluCommandAction extends AbstractAction { + + /** + * Action de undo + * + * @author deniger + */ + public static class Undo extends CtuluCommandAction { + + public Undo(CtuluCommandManager _mng) { + super(CtuluLib.getS("D\xE9faire"), BuResource.BU.getIcon("defaire"), _mng); + putValue(Action.ACTION_COMMAND_KEY, KeyStroke.getKeyStroke("ctrl z")); + } + + @Override + protected void updateState() { + setEnabled(mng_.canUndo()); + } + + public void actionPerformed(ActionEvent _e) { + mng_.undo(); + + } + + } + + /** + * action de redo. + * + * @author deniger + */ + public static class Redo extends CtuluCommandAction { + + public Redo(CtuluCommandManager _mng) { + super(CtuluLib.getS("Refaire"), BuResource.BU.getIcon("refaire"), _mng); + putValue(Action.ACTION_COMMAND_KEY, KeyStroke.getKeyStroke("ctrl shift Z")); + } + + @Override + protected void updateState() { + setEnabled(mng_.canRedo()); + } + + public void actionPerformed(ActionEvent _e) { + mng_.redo(); + } + + } + + final CtuluCommandManager mng_; + + protected CtuluCommandAction(String _name, Icon _icon, CtuluCommandManager _mng) { + super(_name, _icon); + putValue(Action.SHORT_DESCRIPTION, getValue(Action.NAME)); + mng_ = _mng; + mng_.setListener(new CtuluCmdMngListener() { + + public void undoredoStateChange(CtuluCommandManager _source) { + updateState(); + } + }); + } + + protected void updateState() {} + +} 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-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -113,7 +113,7 @@ public ZCalquePoint getIsoLayer() { return null; } - + /** * @author Fred Deniger * @version $Id: ZEbliCalquesPanel.java,v 1.55 2007-06-05 08:58:38 deniger Exp $ @@ -274,6 +274,10 @@ this(_cq, new ZEbliCalquePanelController(_ui)); } + public CtuluUI getCtuluUI() { + return getController().getUI(); + } + BuLabel info_; /** @@ -858,8 +862,7 @@ } protected void removeCalqueLegend() { - if(getCqLegend()!=null) - getCqInfos().remove(getCqLegend()); + if (getCqLegend() != null) getCqInfos().remove(getCqLegend()); // getCqLegend().setVisible(false); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestEGGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestEGGraphe.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestEGGraphe.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -146,12 +146,12 @@ g.axeUpdated(); g.fullRepaint(); -// EventQueue.invokeLater(new Runnable() { -// public void run() { -// g.axeUpdated(); -// // g.restore(); -// -// } -// }); + EventQueue.invokeLater(new Runnable() { + public void run() { + g.axeUpdated(); + // g.restore(); + + } + }); } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -83,7 +83,7 @@ public final CtuluUI ui_; - public MvProfileBuilder(final MvProfileTarget _data, final CtuluUI _ui, final ZEbliCalquesPanel _panel, + public MvProfileBuilder(final MvProfileTarget _data, final ZEbliCalquesPanel _panel, EfLineIntersectionsCorrectionTester _tester) { super(); data_ = _data; @@ -91,7 +91,7 @@ tester_ = _tester; initVar_ = CtuluLibSwing.createListModel(data_.getVars()); act_ = new EfLineIntersectorActivity(data_.getData(), data_.getInterpolator()); - ui_ = _ui; + ui_ = panel_.getCtuluUI(); timeModel_ = _data.getTimeModel(); } @@ -235,8 +235,7 @@ } /** - * Methode qui permet d ajouter une courbe spatiale poru un grapeh deja - * existant. + * Methode qui permet d ajouter une courbe spatiale poru un grapeh deja existant. * * @author Adrien Hadoux * @param _prog @@ -244,129 +243,129 @@ */ public MvProfileFillePanel actAddGroupForExistingModel(final ProgressionInterface _prog, final MvExportChooseVarAndTime _selected) { - int[] time = _selected.getSelectedTimeStepIdx(); - final CtuluVariable[] vs = _selected.getSelectedVar(); + int[] time = _selected.getSelectedTimeStepIdx(); + final CtuluVariable[] vs = _selected.getSelectedVar(); - final int nbVar = vs == null ? 0 : vs.length; - final boolean isTime = timeModel_ != null; - if (time == null) { - time = new int[] { 0 }; - } - boolean addXYForNode = false; - boolean addXYForMesh = false; - for (int i = initVar_.getSize() - 1; i >= 0; i--) { - if (data_.getData().isElementVar((CtuluVariable) initVar_.getElementAt(i))) { - addXYForMesh = true; - } else { - addXYForNode = true; + final int nbVar = vs == null ? 0 : vs.length; + final boolean isTime = timeModel_ != null; + if (time == null) { + time = new int[] { 0 }; } - // les 2 sont a true - if (addXYForMesh && addXYForNode) { - break; + boolean addXYForNode = false; + boolean addXYForMesh = false; + for (int i = initVar_.getSize() - 1; i >= 0; i--) { + if (data_.getData().isElementVar((CtuluVariable) initVar_.getElementAt(i))) { + addXYForMesh = true; + } else { + addXYForNode = true; + } + // les 2 sont a true + if (addXYForMesh && addXYForNode) { + break; + } } - } - final int nbTIme = time.length; - final MvProfileTreeModel tree = new MvProfileTreeModel(this.data_, tester_); - if (addXYForNode) { - tree.setNodesResults(getNodeResultsMng(_prog), getNodeResultBuilder(_prog)); - } - if (addXYForMesh) { - tree.setMeshesResults(getMeshResultsMng(_prog), getMeshesResultBuilder(_prog)); + final int nbTIme = time.length; + final MvProfileTreeModel tree = new MvProfileTreeModel(this.data_, tester_); + if (addXYForNode) { + tree.setNodesResults(getNodeResultsMng(_prog), getNodeResultBuilder(_prog)); + } + if (addXYForMesh) { + tree.setMeshesResults(getMeshResultsMng(_prog), getMeshesResultBuilder(_prog)); - } - final EGGroup grCoord = new EGGroup(); - final String s = EbliLib.getS("Coordonn\xE9es"); - grCoord.setTitle(s); - final EGAxeVertical yCoordonnees = new EGAxeVertical(); - yCoordonnees.setTitre(s); - yCoordonnees.setUnite("m"); - grCoord.setAxeY(yCoordonnees); - final String sep = " - "; - if (addXYForNode) { - final EGCourbeChild courbeChild = new MVProfileCourbeCoordinate(grCoord, new MvProfileCoordinatesModel( - getNodeResultsMng(_prog).getDefaultRes(), true)); - final EGCourbeChild courbeChild2 = new MVProfileCourbeCoordinate(grCoord, new MvProfileCoordinatesModel( - getNodeResultsMng(_prog).getDefaultRes(), false)); - if (addXYForNode && addXYForMesh) { - courbeChild.setTitle(courbeChild.getTitle() + sep + MvResource.getS("Noeuds")); - courbeChild2.setTitle(courbeChild2.getTitle() + sep + MvResource.getS("Noeuds")); } - grCoord.addEGComponent(courbeChild); + final EGGroup grCoord = new EGGroup(); + final String s = EbliLib.getS("Coordonn\xE9es"); + grCoord.setTitle(s); + final EGAxeVertical yCoordonnees = new EGAxeVertical(); + yCoordonnees.setTitre(s); + yCoordonnees.setUnite("m"); + grCoord.setAxeY(yCoordonnees); + final String sep = " - "; + if (addXYForNode) { + final EGCourbeChild courbeChild = new MVProfileCourbeCoordinate(grCoord, new MvProfileCoordinatesModel( + getNodeResultsMng(_prog).getDefaultRes(), true)); + final EGCourbeChild courbeChild2 = new MVProfileCourbeCoordinate(grCoord, new MvProfileCoordinatesModel( + getNodeResultsMng(_prog).getDefaultRes(), false)); + if (addXYForNode && addXYForMesh) { + courbeChild.setTitle(courbeChild.getTitle() + sep + MvResource.getS("Noeuds")); + courbeChild2.setTitle(courbeChild2.getTitle() + sep + MvResource.getS("Noeuds")); + } + grCoord.addEGComponent(courbeChild); - grCoord.addEGComponent(courbeChild2); + grCoord.addEGComponent(courbeChild2); - } - if (addXYForMesh) { - final EGCourbeChild courbeChild = new MVProfileCourbeCoordinate(grCoord, new MvProfileCoordinatesModel( - getMeshResultsMng(_prog).getDefaultRes(), true)); - final EGCourbeChild courbeChild2 = new MVProfileCourbeCoordinate(grCoord, new MvProfileCoordinatesModel( - getMeshResultsMng(_prog).getDefaultRes(), false)); - if (addXYForNode && addXYForMesh) { - courbeChild.setTitle(courbeChild.getTitle() + sep + MvResource.getS("Elements")); - courbeChild2.setTitle(courbeChild2.getTitle() + sep + MvResource.getS("Elements")); } - grCoord.addEGComponent(courbeChild); + if (addXYForMesh) { + final EGCourbeChild courbeChild = new MVProfileCourbeCoordinate(grCoord, new MvProfileCoordinatesModel( + getMeshResultsMng(_prog).getDefaultRes(), true)); + final EGCourbeChild courbeChild2 = new MVProfileCourbeCoordinate(grCoord, new MvProfileCoordinatesModel( + getMeshResultsMng(_prog).getDefaultRes(), false)); + if (addXYForNode && addXYForMesh) { + courbeChild.setTitle(courbeChild.getTitle() + sep + MvResource.getS("Elements")); + courbeChild2.setTitle(courbeChild2.getTitle() + sep + MvResource.getS("Elements")); + } + grCoord.addEGComponent(courbeChild); - grCoord.addEGComponent(courbeChild2); + grCoord.addEGComponent(courbeChild2); - } - grCoord.setVisible(false); - tree.add(grCoord); - // map permettant de stocker la correspondance var -> groupe - final Map varGroup = new HashMap(); - if (vs != null) { - for (int i = 0; i < nbVar; i++) { - // pas null - final CtuluVariable var = vs[i]; - MvProfileCourbeGroup gri = null; - // dans ce cas, on va g\xE9rer les variables parents: inutile de creer des groupe different - // pour des variables de meme type - Color c = null; - boolean mustAddGr = true; - if (var instanceof H2dVariableType) { - H2dVariableType parent = ((H2dVariableType) var).getParentVariable(); - if (parent == null) { - parent = (H2dVariableType) var; + } + grCoord.setVisible(false); + tree.add(grCoord); + // map permettant de stocker la correspondance var -> groupe + final Map varGroup = new HashMap(); + if (vs != null) { + for (int i = 0; i < nbVar; i++) { + // pas null + final CtuluVariable var = vs[i]; + MvProfileCourbeGroup gri = null; + // dans ce cas, on va g\xE9rer les variables parents: inutile de creer des groupe different + // pour des variables de meme type + Color c = null; + boolean mustAddGr = true; + if (var instanceof H2dVariableType) { + H2dVariableType parent = ((H2dVariableType) var).getParentVariable(); + if (parent == null) { + parent = (H2dVariableType) var; + } + c = MvProfileFillePanel.getColorFor(i, parent); + gri = (MvProfileCourbeGroup) varGroup.get(parent); + if (gri == null) { + gri = MvProfileFillePanel.createGroupFor(parent); + varGroup.put(parent, gri); + } else { + mustAddGr = false; + } } - c = MvProfileFillePanel.getColorFor(i, parent); - gri = (MvProfileCourbeGroup) varGroup.get(parent); if (gri == null) { - gri = MvProfileFillePanel.createGroupFor(parent); - varGroup.put(parent, gri); - } else { - mustAddGr = false; + gri = MvProfileFillePanel.createGroupFor(var); } - } - if (gri == null) { - gri = MvProfileFillePanel.createGroupFor(var); - } - if (c == null) { - c = MvProfileFillePanel.getColorFor(i, var); - } - // on doit construire les courbes - for (int t = 0; t < nbTIme; t++) { - final MVProfileCourbeModel model = new MVProfileCourbeModel(var, data_.getData(), time[t], getResBuilder(var, - _prog), _prog); - EGCourbeChild child; - if (isTime) { - model.setTitle(var.toString() + CtuluLibString.ESPACE + timeModel_.getElementAt(time[t])); - child = new MvProfileCourbeTime(gri, model, timeModel_); - } else { - child = new MvProfileCourbe(gri, model); + if (c == null) { + c = MvProfileFillePanel.getColorFor(i, var); } - child.setAspectContour(c); - gri.addEGComponent(child); + // on doit construire les courbes + for (int t = 0; t < nbTIme; t++) { + final MVProfileCourbeModel model = new MVProfileCourbeModel(var, data_.getData(), time[t], getResBuilder(var, + _prog), _prog); + EGCourbeChild child; + if (isTime) { + model.setTitle(var.toString() + CtuluLibString.ESPACE + timeModel_.getElementAt(time[t])); + child = new MvProfileCourbeTime(gri, model, timeModel_); + } else { + child = new MvProfileCourbe(gri, model); + } + child.setAspectContour(c); + gri.addEGComponent(child); + } + if (mustAddGr) { + tree.add(gri); + } } - if (mustAddGr) { - tree.add(gri); - } } - } - return new MvProfileFillePanel(tree, ui_); + return new MvProfileFillePanel(tree, ui_); } - + protected void close() { if (tmp_ != null) { tmp_.detruire(); @@ -383,23 +382,17 @@ } protected EfLineIntersectionsResultsI getRes(final CtuluVariable _o, final int _tidx, final ProgressionInterface _prog) { - if (data_.getData().isElementVar(_o)) { - return getMeshResults(_prog, _tidx); - } + if (data_.getData().isElementVar(_o)) { return getMeshResults(_prog, _tidx); } return getNodeResults(_prog, _tidx); } protected EfLineIntersectionsResultsBuilder getResBuilder(final CtuluVariable _o, final ProgressionInterface _prog) { - if (data_.getData().isElementVar(_o)) { - return getMeshesResultBuilder(_prog); - } + if (data_.getData().isElementVar(_o)) { return getMeshesResultBuilder(_prog); } return getNodeResultBuilder(_prog); } public EfLineIntersectionsResultsI getDefaultRes(final CtuluVariable _o, final ProgressionInterface _prog) { - if (data_.getData().isElementVar(_o)) { - return getMeshResultsMng(_prog).getDefaultRes(); - } + if (data_.getData().isElementVar(_o)) { return getMeshResultsMng(_prog).getDefaultRes(); } return getNodeResultsMng(_prog).getDefaultRes(); } @@ -415,9 +408,7 @@ protected abstract void stepOne(); protected void update(final LineString _s, final boolean _zoom) { - if (panel_ == null) { - return; - } + if (panel_ == null) { return; } if (_s == null) { if (tmp_ != null) { tmp_.setVisible(false); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -26,7 +26,7 @@ public MvProfileBuilderFromLine(final MvProfileTarget _data, final CtuluUI _ui, final LineString _line, final ZEbliCalquesPanel _panel, EfLineIntersectionsCorrectionTester _tester) { - super(_data, _ui, _panel, _tester); + super(_data, _panel, _tester); selectedLine_ = _line; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -73,7 +73,7 @@ public MvProfileBuilderFromTree(final MvProfileTarget _data, final CtuluUI _ui, final LineString _selected, final ZEbliCalquesPanel _panel, EfLineIntersectionsCorrectionTester _tester) { - super(_data, _ui, _panel, _tester); + super(_data, _panel, _tester); lineTreeModel_ = new CalqueFindCourbeTreeModel(null, _panel.getDonneesCalque()); initSelected_ = _selected; calque_ = _panel; 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-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -431,7 +431,7 @@ alreadyOpened.getFrame().setState(Frame.NORMAL); alreadyOpened.getFrame().requestFocus(); // pour Rubar - alreadyOpened.getCurrentProject().activate(_f); +// alreadyOpened.getCurrentProject().activate(_f); return alreadyOpened; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -29,11 +29,11 @@ public TrIsoLineAction(final TrPostVisuPanel _dest) { super(TrResource.getS("Rechercher les isolignes"), null, "FIND_ISOS"); dest_ = _dest; - project_ = dest_.srcCont_; + project_ = dest_.projet_; } public void actionPerformed(final ActionEvent _e) { - final BuWizardDialog dialog = new BuWizardDialog(dest_.getImpl().getFrame(), new TrIsoLineWizard(dest_, project_)); + final BuWizardDialog dialog = new BuWizardDialog(dest_.getImpl().getFrame(), new TrIsoLineWizard(dest_)); dialog.pack(); dialog.setModal(true); dialog.setLocationRelativeTo(dest_.getImpl().getFrame()); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizard.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizard.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizard.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -49,28 +49,34 @@ */ public class TrIsoLineWizard extends BuWizardTask { + BuCheckBox cbOneLayer_; + BuComboBox cbVariables_; + + CtuluListEditorPanel ctuluListEditorPanel_; CtuluVariable currentVariable_; final TrPostVisuPanel dest_; - BuList listTimes_; + MvExportPanelFilter filter_; - BuPanel pnValues_; + BuLabel lbTime_; - BuPanel pnVars_; + BuList listTimes_; BuPanel pnFinish_; - final TrPostProjet project_; + BuPanel pnValues_; + BuPanel pnVars_; + BuTextField tfPrec_; + final TrIsoLineWizardListValue values_; - Map varIsoValues_ = new HashMap(); + Map<CtuluVariable, List> varIsoValues_ = new HashMap<CtuluVariable, List>(); - public TrIsoLineWizard(final TrPostVisuPanel _dest, final TrPostProjet _project) { + public TrIsoLineWizard(final TrPostVisuPanel _dest) { super(); dest_ = _dest; - project_ = _project; - final ListModel newVarListModel = project_.getSource().getNewVarListModel(); + final ListModel newVarListModel = dest_.getSource().getNewVarListModel(); // rien ! Object selected = getSelectedVarInLayer(); // on recherche si la variable selectionn\xE9 dans le calque courant est bien dispo @@ -85,7 +91,7 @@ cbModel.setSelectedItem(selected); cbVariables_ = new BuComboBox(cbModel); - final ListModel time = project_.getSource().getNewTimeListModel(); + final ListModel time = dest_.getSource().getNewTimeListModel(); final int idx = getSelectedTimeInLayer(); listTimes_ = new BuList(time); listTimes_.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); @@ -105,12 +111,34 @@ } - BuLabel lbTime_; + private void buildFinishPn() { + if (pnFinish_ != null) { return; } + pnFinish_ = new BuPanel(new BuBorderLayout(0, 10)); + BuPanel pnCommon = new BuPanel(); + pnCommon.setLayout(new BuGridLayout(2, 5, 5)); + tfPrec_ = BuTextField.createDoubleField(); + final CtuluValueValidator min = new CtuluValueValidator.DoubleMin(0); + tfPrec_.setValueValidator(min); + tfPrec_.setToolTipText(min.getDescription()); + tfPrec_.setValue(new Double(1E-4)); + pnCommon.add(new BuLabel(TrLib.getString("Pr\xE9cision des isolignes"))); + pnCommon.add(tfPrec_); + pnCommon.add(new BuLabel(TrLib.getString("Cr\xE9er un calque par valeur"))); + cbOneLayer_ = new BuCheckBox(); + pnCommon.add(cbOneLayer_); + pnFinish_.add(pnCommon, BuBorderLayout.NORTH); + pnCommon = new BuPanel(); + pnCommon.setLayout(new BuVerticalLayout(1)); + pnCommon.add(new BuLabel(TrLib + .getString("Utiliser un filtre pour extraire les isoslignes que sur une partie du maillage:"))); + filter_ = TrExportPanelFilterFactory.buildFilterForEachTimeStep(dest_.getCurrentSelection(), dest_.getSource()); + pnCommon.add(filter_.getComponent()); + pnFinish_.add(pnCommon, BuBorderLayout.CENTER); + } + private void buildFirstPn() { - if (pnVars_ != null) { - return; - } + if (pnVars_ != null) { return; } pnVars_ = new BuPanel(); pnVars_.setLayout(new BuVerticalLayout(5)); BuPanel pn = new BuPanel(new BuBorderLayout()); @@ -135,9 +163,7 @@ } private void buildValuesPn() { - if (pnValues_ != null) { - return; - } + if (pnValues_ != null) { return; } pnValues_ = new BuPanel(); pnValues_.setLayout(new BuBorderLayout(5, 5, false, true)); final BuButton bt = new BuButton(BuResource.BU.getIcon("effacer")); @@ -155,45 +181,37 @@ pnValues_.add(ctuluListEditorPanel_, BuBorderLayout.CENTER); } - CtuluListEditorPanel ctuluListEditorPanel_; - BuCheckBox cbOneLayer_; - MvExportPanelFilter filter_; - - private void buildFinishPn() { - if (pnFinish_ != null) { - return; + public void doTask() { + final H2dVariableType var = (H2dVariableType) cbVariables_.getSelectedItem(); + final int[] times = listTimes_.getSelectedIndices(); + final TDoubleHashSet set = new TDoubleHashSet(values_.getRowCount()); + for (int i = 0; i < values_.getRowCount(); i++) { + set.add(Double.parseDouble((String) values_.getValueAt(i))); } - pnFinish_ = new BuPanel(new BuBorderLayout(0, 10)); - BuPanel pnCommon = new BuPanel(); - pnCommon.setLayout(new BuGridLayout(2, 5, 5)); - tfPrec_ = BuTextField.createDoubleField(); - final CtuluValueValidator min = new CtuluValueValidator.DoubleMin(0); - tfPrec_.setValueValidator(min); - tfPrec_.setToolTipText(min.getDescription()); - tfPrec_.setValue(new Double(1E-4)); - pnCommon.add(new BuLabel(TrLib.getString("Pr\xE9cision des isolignes"))); - pnCommon.add(tfPrec_); - pnCommon.add(new BuLabel(TrLib.getString("Cr\xE9er un calque par valeur"))); - cbOneLayer_ = new BuCheckBox(); - pnCommon.add(cbOneLayer_); - pnFinish_.add(pnCommon, BuBorderLayout.NORTH); - pnCommon = new BuPanel(); - pnCommon.setLayout(new BuVerticalLayout(1)); - pnCommon.add(new BuLabel(TrLib - .getString("Utiliser un filtre pour extraire les isoslignes que sur une partie du maillage:"))); - filter_ = TrExportPanelFilterFactory.buildFilterForEachTimeStep(dest_.getCurrentSelection(), project_.getSource()); - pnCommon.add(filter_.getComponent()); - pnFinish_.add(pnCommon, BuBorderLayout.CENTER); + final double[] values = set.toArray(); + Arrays.sort(values); + final TrIsoLineAdder trIsoLineAdder = new TrIsoLineAdder(dest_.getSource(), dest_, values, times, var, + ((Double) tfPrec_.getValue()).doubleValue()); + trIsoLineAdder.setUseOnValueByLayer(cbOneLayer_.isSelected()); + trIsoLineAdder.setFilter(filter_.getFilter(dest_.getSource())); + trIsoLineAdder.go(); + done_ = true; + } + /** + * @return + * @see org.fudaa.fudaa.tr.post.TrPostVisuPanel#getProjet() + */ + public TrPostProjet getProjet() { + return dest_.getProjet(); } private int getSelectedTimeInLayer() { final BCalque cq = dest_.getCalqueActif(); - if (cq instanceof BSelecteurListTimeTarget) { - return ((BSelecteurListTimeTarget) cq).getTimeListSelectionModel().getMaxSelectionIndex(); - } - return project_.getSource().getNbTimeStep() - 1; + if (cq instanceof BSelecteurListTimeTarget) { return ((BSelecteurListTimeTarget) cq).getTimeListSelectionModel() + .getMaxSelectionIndex(); } + return dest_.getSource().getNbTimeStep() - 1; } private Object getSelectedVarInLayer() { @@ -201,55 +219,19 @@ if (cq instanceof BSelecteurListTarget) { final BSelecteurListTarget selecteurListTarget = (BSelecteurListTarget) cq; final int idx = selecteurListTarget.getListSelectionModel().getMaxSelectionIndex(); - if (idx >= 0) { - return selecteurListTarget.getListModel().getElementAt(idx); - } + if (idx >= 0) { return selecteurListTarget.getListModel().getElementAt(idx); } } return H2dVariableType.HAUTEUR_EAU; } - boolean isCurrentValide() { - if (current_ == 0) { - final boolean res = !listTimes_.isSelectionEmpty(); - if (res) { - lbTime_.setText(CtuluLibString.ESPACE); - } else { - lbTime_.setText(TrLib.getString("S\xE9lectionner au moins un pas de temps")); - } - return res; - } - return true; + /** + * @return + * @see org.fudaa.fudaa.tr.post.TrPostVisuPanel#getSource() + */ + public TrPostSource getSource() { + return dest_.getSource(); } - void varChanged() { - // on sauvegarde les anciennes valeurs - varIsoValues_.put(currentVariable_, values_.getValuesInList()); - currentVariable_ = (CtuluVariable) cbVariables_.getSelectedItem(); - final List saved = (List) varIsoValues_.get(currentVariable_); - if (saved == null) { - values_.updateOrCreateValues(); - } else { - values_.setData(saved); - } - } - - public void doTask() { - final H2dVariableType var = (H2dVariableType) cbVariables_.getSelectedItem(); - final int[] times = listTimes_.getSelectedIndices(); - final TDoubleHashSet set = new TDoubleHashSet(values_.getRowCount()); - for (int i = 0; i < values_.getRowCount(); i++) { - set.add(Double.parseDouble((String) values_.getValueAt(i))); - } - final double[] values = set.toArray(); - Arrays.sort(values); - final TrIsoLineAdder trIsoLineAdder = new TrIsoLineAdder(project_.getSource(), dest_, values, times, var, - ((Double) tfPrec_.getValue()).doubleValue()); - trIsoLineAdder.setUseOnValueByLayer(cbOneLayer_.isSelected()); - trIsoLineAdder.setFilter(filter_.getFilter(project_.getSource())); - trIsoLineAdder.go(); - done_ = true; - } - public JComponent getStepComponent() { // pour prendre en compte les modifications dans le tableau au cas ou la cellule serait toujours en \xE9dition if (ctuluListEditorPanel_ != null) { @@ -277,22 +259,16 @@ } public String getStepText() { - if (current_ == 0) { - return TrLib.getString("Vous devez choisir une variable et un ou plusieurs pas de temps"); - } - if (current_ == 1) { - return TrLib.getString("Choisir les valeurs \xE0 utiliser pour construire les isolignes"); - } - if (current_ == 2) { - return "+ " - + TrLib.getString("La pr\xE9cision permet de prendre en compte les impr\xE9cisions num\xE9riques.") - + CtuluLibString.LINE_SEP_SIMPLE - + " " - + TrLib - .getString("2 valeurs seront suppos\xE9es \xE9gales si leur diff\xE9rence est inf\xE9rieure \xE0 la pr\xE9cision ci-dessus.") - + CtuluLibString.LINE_SEP_SIMPLE + CtuluLibString.ESPACE + CtuluLibString.LINE_SEP_SIMPLE + "+ " - + TrLib.getString("La case \xE0 cocher permet de cr\xE9er un calque par valeurs sp\xE9cifi\xE9es pr\xE9c\xE9demment."); - } + if (current_ == 0) { return TrLib.getString("Vous devez choisir une variable et un ou plusieurs pas de temps"); } + if (current_ == 1) { return TrLib.getString("Choisir les valeurs \xE0 utiliser pour construire les isolignes"); } + if (current_ == 2) { return "+ " + + TrLib.getString("La pr\xE9cision permet de prendre en compte les impr\xE9cisions num\xE9riques.") + + CtuluLibString.LINE_SEP_SIMPLE + + " " + + TrLib + .getString("2 valeurs seront suppos\xE9es \xE9gales si leur diff\xE9rence est inf\xE9rieure \xE0 la pr\xE9cision ci-dessus.") + + CtuluLibString.LINE_SEP_SIMPLE + CtuluLibString.ESPACE + CtuluLibString.LINE_SEP_SIMPLE + "+ " + + TrLib.getString("La case \xE0 cocher permet de cr\xE9er un calque par valeurs sp\xE9cifi\xE9es pr\xE9c\xE9demment."); } return CtuluLibString.EMPTY_STRING; } @@ -303,9 +279,7 @@ } else if (current_ == 1) { return TrLib.getString("Choisir les valeurs des isolignes"); - } else if (current_ == 2) { - return TrLib.getString("Pr\xE9cision et calques"); - } + } else if (current_ == 2) { return TrLib.getString("Pr\xE9cision et calques"); } return CtuluLibString.EMPTY_STRING; } @@ -313,10 +287,35 @@ return TrLib.getString("Rechercher les isolignes"); } + boolean isCurrentValide() { + if (current_ == 0) { + final boolean res = !listTimes_.isSelectionEmpty(); + if (res) { + lbTime_.setText(CtuluLibString.ESPACE); + } else { + lbTime_.setText(TrLib.getString("S\xE9lectionner au moins un pas de temps")); + } + return res; + } + return true; + } + public void nextStep() { if (isCurrentValide()) { super.nextStep(); } } + void varChanged() { + // on sauvegarde les anciennes valeurs + varIsoValues_.put(currentVariable_, values_.getValuesInList()); + currentVariable_ = (CtuluVariable) cbVariables_.getSelectedItem(); + final List saved = varIsoValues_.get(currentVariable_); + if (saved == null) { + values_.updateOrCreateValues(); + } else { + values_.setData(saved); + } + } + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizardListValue.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizardListValue.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineWizardListValue.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -39,7 +39,7 @@ try { final int idx = support_.listTimes_.getSelectedIndex(); if (idx >= 0) { - currentData_ = support_.project_.getSource().getData(support_.currentVariable_, idx); + currentData_ = support_.getSource().getData(support_.currentVariable_, idx); } } catch (final IOException _evt) { FuLog.error(_evt); @@ -80,9 +80,7 @@ } public void initFor(final EfData _data, final List _l) { - if (_data == null || _l == null) { - return; - } + if (_data == null || _l == null) { return; } _l.clear(); final NumberIterator it = new NumberIterator(); it.init(_data.getMin(), _data.getMax(), 10); @@ -99,7 +97,7 @@ final CtuluVariable var = (CtuluVariable) support_.cbVariables_.getModel().getSelectedItem(); if (idx >= 0 && var != null) { try { - currentData_ = support_.project_.getSource().getData(var, idx); + currentData_ = support_.getSource().getData(var, idx); if (currentData_ != null) { initFor(currentData_, newValue); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -43,7 +43,6 @@ import org.fudaa.fudaa.tr.common.TrResource; import com.memoire.bu.BuDialogError; -import com.memoire.fu.FuLog; /** * Action qui: - recupere la liste des calques potentiels - recupere la liste des graphes potentiels - propose a l @@ -52,6 +51,7 @@ * * @author Adrien Hadoux */ +@SuppressWarnings("serial") public abstract class TrPostActionAddPointFromWidgetCalque extends EbliWidgetActionSimple { /** @@ -125,10 +125,10 @@ @Override public void executeAction(TrPostCommonImplementation _impl, EGGraphe _graphe, TrPostVisuPanel _calque) { - /** - * @see TrPostWizardProfilSpatiaux.java pour savoir comment fusionenr une - * courbe spatiale dans un graphe existant. methode doTask() - */ + /** + * @see TrPostWizardProfilSpatiaux.java pour savoir comment fusionenr une courbe spatiale dans un graphe existant. + * methode doTask() + */ } @@ -138,9 +138,9 @@ // creation automatique d un graphe avec les spatiales poru le calque // vhoisi - new MvProfileBuilderFromTree(_calqueChoisi.getProjet(), impl_, ((ZCalqueAffichageDonneesInterface) _calqueChoisi - .getArbreCalqueModel().getSelectedCalque()).getSelectedLine(), _calqueChoisi, new MvProfileCoteTester()) - .start(); + new MvProfileBuilderFromTree(TrPostProfileAction.createProfileAdapter(_calqueChoisi), impl_, + ((ZCalqueAffichageDonneesInterface) _calqueChoisi.getArbreCalqueModel().getSelectedCalque()) + .getSelectedLine(), _calqueChoisi, new MvProfileCoteTester()).start(); } @@ -244,10 +244,10 @@ // -- creation d un nouveau graphe --// if (boxCalques_ != null) { - TrPostVisuPanel calqueChoisi = (TrPostVisuPanel) listeCalquesPossibles.get(boxCalques_.getSelectedIndex()); + TrPostVisuPanel calqueChoisi = (TrPostVisuPanel) listeCalquesPossibles.get(boxCalques_.getSelectedIndex()); - // -- methode appelee qui doit creer un graphe avec la selection --// - createNewGraphe(calqueChoisi); + // -- methode appelee qui doit creer un graphe avec la selection --// + createNewGraphe(calqueChoisi); } else { createNewGraphe(listeCalquesPossibles.get(0)); } @@ -257,7 +257,7 @@ } else { rechercheGrapheAndCalque(); - + // -- affichage de al dialog --// constructDialog().setVisible(true); } @@ -318,13 +318,10 @@ * TrResource .getS("Il n'y a pas de graphes disponibles.")).activate(); return; } */ - } public abstract boolean isCorrectGraph(EGGrapheModel _model); - - /** * construit l interface * @@ -332,19 +329,19 @@ */ public JComponent constructInterface(boolean chooserCalque, boolean closeDialog, boolean valideAjoutCourbe, boolean canCreate) { - + JPanel content = new JPanel(new BorderLayout()); - + if (chooserCalque) { - boxCalques_ = new JComboBox(); - for (Iterator<JLabel> it = listeObjetsCalques.iterator(); it.hasNext();) { - boxCalques_.addItem(it.next()); + boxCalques_ = new JComboBox(); + for (Iterator<JLabel> it = listeObjetsCalques.iterator(); it.hasNext();) { + boxCalques_.addItem(it.next()); + } + boxCalques_.setRenderer(new GrapheCellRenderer()); + boxCalques_.setBorder(BorderFactory.createTitledBorder(TrResource.TR.getString("Liste des calques de la scene"))); + content.add(boxCalques_, BorderLayout.NORTH); + } - boxCalques_.setRenderer(new GrapheCellRenderer()); - boxCalques_.setBorder(BorderFactory.createTitledBorder(TrResource.TR.getString("Liste des calques de la scene"))); - content.add(boxCalques_, BorderLayout.NORTH); - - } jlisteGraphesChoix = new JList(modelGraphesPossibles); jlisteGraphesChoix.setCellRenderer(new GrapheCellRenderer()); @@ -356,16 +353,15 @@ jlisteGraphesSelections.setCellRenderer(new GrapheCellRenderer()); JPanel panelControle = new JPanel(new FlowLayout(FlowLayout.CENTER)); - - + select = new JButton(TrResource.TR.getString("Ajouter"), EbliResource.EBLI.getIcon("crystal22_avancervite")); unselect = new JButton(TrResource.TR.getString("Enlever"), EbliResource.EBLI.getIcon("crystal22_reculervite")); select.addActionListener(this); unselect.addActionListener(this); if (closeDialog) { - quitter = new JButton(TrResource.TR.getString("Quitter"), EbliResource.EBLI.getIcon("crystal_detruire")); - quitter.addActionListener(this); - panelControle.add(quitter); + quitter = new JButton(TrResource.TR.getString("Quitter"), EbliResource.EBLI.getIcon("crystal_detruire")); + quitter.addActionListener(this); + panelControle.add(quitter); } if (canCreate) { creationNewGraphe = new JButton(TrResource.TR.getString("Cr\xE9er un nouveau graphe"), EbliResource.EBLI @@ -393,26 +389,15 @@ box.add(boxButton); box.add(jlisteGraphesSelections); - - content.add(box, BorderLayout.CENTER); - - - - - - - content.add(panelControle, BorderLayout.SOUTH); - + return content; } public JDialog constructDialog() { - - frame_ = new JDialog(); frame_.setContentPane(constructInterface(true, true, true, true)); @@ -425,11 +410,8 @@ return frame_; } - - /** - * Methode qui construit le panel de selection ou creation des graphes pour - * les points du calque selectionnes + * Methode qui construit le panel de selection ou creation des graphes pour les points du calque selectionnes * * @return */ @@ -437,24 +419,22 @@ rechercheGrapheAndCalque(); return constructInterface(true, closeDialog, valideAjoutCourbe, canCreate); } - + public JComponent getInterfacePartielle(boolean closeDialog, boolean valideAjoutCourbe, boolean canCreate) { rechercheGrapheAndCalque(); - + return constructInterface(false, closeDialog, valideAjoutCourbe, canCreate); } - - + public void setEnabled(boolean enabled) { - if (this.boxCalques_ != null) - this.boxCalques_.setEnabled(enabled); + if (this.boxCalques_ != null) this.boxCalques_.setEnabled(enabled); this.jlisteGraphesChoix.setEnabled(enabled); this.jlisteGraphesSelections.setEnabled(enabled); this.select.setEnabled(enabled); this.unselect.setEnabled(enabled); } - + public abstract void setTitleForFrame(); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -3,6 +3,7 @@ import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import java.util.Set; import org.fudaa.ctulu.CtuluResource; @@ -62,17 +63,14 @@ scene_.refresh(); - String previousDescr = ""; - if (currentNode.getWidget() != null) - previousDescr = currentNode.getWidget().getController().getDescription(); - + if (currentNode.getWidget() != null) previousDescr = currentNode.getWidget().getController().getDescription(); + // -- ajout du node dans la scene destination --// sceneDestination.addNode(currentNode); - if (previousDescr != null) - currentNode.getWidget().getController().setDescription(previousDescr); - + if (previousDescr != null) currentNode.getWidget().getController().setDescription(previousDescr); + // -- rafraichissement de la scene --// sceneDestination.refresh(); @@ -88,17 +86,19 @@ private EbliScene selectionneSceneNode() { TrPostLayoutFille fenetre = null; - if (projet_.listeFillesLayout.size() <= 1) { - fenetre = projet_.getSelectedFilleLayout(); + TrPostCommonImplementation impl = projet_.getImpl(); + List<TrPostLayoutFille> ls = impl.getAllLayoutFille(); + if (ls.size() == 1) { + fenetre = ls.get(0); } else { // recuperation de toutes les noms des frames post du projet --// - String[] listeFillesLayout = formatteFilles(); + String[] listeFillesLayout = TrPostActionDuplicate.formatteFilles(ls); int indiceFilleelect = CtuluLibSwing.chooseValue(listeFillesLayout, projet_.getImpl().getFrame(), TrLib .getString("Dupliquer l'objet"), TrLib.getString("S\xE9lectionnez la fen\xEAtre dans laquelle dupliquer l'objet"), true); if (indiceFilleelect < 0) return null; - fenetre = projet_.listeFillesLayout.get(indiceFilleelect); + fenetre = ls.get(indiceFilleelect); } return fenetre.controller_.getSceneCourante(); // EbliScene dest = null; @@ -126,22 +126,13 @@ } - public String[] formatteFilles() { - String[] noms = new String[projet_.listeFillesLayout.size()]; - int cpt = 0; - for (Iterator<TrPostLayoutFille> it = projet_.listeFillesLayout.iterator(); it.hasNext();) { - noms[cpt++] = it.next().getTitle(); - } - return noms; - } + // public String[] formatteLayout(TrPostLayoutPanelController _controller) { + // String[] noms = new String[_controller.listeScenes_.size()]; + // + // for (int cpt = 0; cpt < _controller.listeScenes_.size(); cpt++) { + // noms[cpt] = "Layout " + (cpt + 1); + // } + // return noms; + // } -// public String[] formatteLayout(TrPostLayoutPanelController _controller) { -// String[] noms = new String[_controller.listeScenes_.size()]; -// -// for (int cpt = 0; cpt < _controller.listeScenes_.size(); cpt++) { -// noms[cpt] = "Layout " + (cpt + 1); -// } -// return noms; -// } - } Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSrc.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSrc.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSrc.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -1,73 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import java.awt.event.ActionEvent; -import java.util.Iterator; - -import org.fudaa.ebli.commun.EbliActionSimple; - -import com.memoire.bu.BuDialogConfirmation; -import com.memoire.bu.BuDialogMessage; -import com.memoire.bu.BuResource; -import com.memoire.fu.FuLog; - -public class TrPostActionChangeSrc extends EbliActionSimple { - /** - * projet en cours contenant les multi projets. - */ - TrPostProjet projet_; - - /** - * Activator multi source permettant de gerer une nouvelle source pour - * trpostProjet - */ - TrPostMultiSourceActivator multiProjectActivator_; - - public TrPostActionChangeSrc(TrPostProjet _projet) { - super("Changer de donn\xE9es", BuResource.BU.getIcon("crystal_valider"), "Changer de donn\xE9es"); - projet_ = _projet; - - // -- creation de l activator multi-source avec le projet param --// - this.multiProjectActivator_ = new TrPostMultiSourceActivator(_projet); - } - - public void actionPerformed(ActionEvent e) { - - - // -- recuperation de la source a supprimer --// - - // -- cas rien de selectionnee --// - if (projet_.filleProjetctManager_.listProjets_.getSelectedRow() == -1) { - new BuDialogMessage(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - "Il faut selectionner le fichier dans la liste avant de cliquer.").activate(); - } else { - - // -- recupeation de la source a enlever --// - TrPostSource src = (TrPostSource) projet_.getSource(projet_.filleProjetctManager_.listProjets_.getSelectedRow()); - - // -- demande confirmationa l user --// - int confirmation = new BuDialogConfirmation(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - "\xCAtes-vous sur de vouloir changer les donn\xE9es par celles \n du fichier " + src.getTitle() + " ?") - .activate(); - - if (confirmation == 0) { - if (projet_.changeSource(src)) { - new BuDialogMessage(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - "Les donn\xE9es ont \xE9t\xE9 correctement charg\xE9es.").activate(); - } else { - new BuDialogMessage(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - "Les donn\xE9es n'ont pas \xE9t\xE9 correctement charg\xE9es.").activate(); - } - - testAfficheMesSimu(); - } - } - - } - - public void testAfficheMesSimu() { - int i = 0; - for (Iterator<TrPostSource> it = projet_.listeSrc_.iterator(); it.hasNext();) { - TrPostSource src = it.next(); - } - } -} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionDuplicate.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionDuplicate.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionDuplicate.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -1,6 +1,7 @@ package org.fudaa.fudaa.tr.post; import java.util.Iterator; +import java.util.List; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionDuplicate; @@ -9,101 +10,96 @@ import com.memoire.bu.BuDialogChoice; /** - * Refonte de l action duplicate qui g\xE8re le multi-layout. Chooser qui demande - * la fille layout puis autre chooser qui demande l'onglet. Si la fille est - * unique pas de chooser idem pour l onglet de la fille selectionnee. + * Refonte de l action duplicate qui g\xE8re le multi-layout. Chooser qui demande la fille layout puis autre chooser qui + * demande l'onglet. Si la fille est unique pas de chooser idem pour l onglet de la fille selectionnee. * * @author Adrien Hadoux - * */ +@SuppressWarnings("serial") public class TrPostActionDuplicate extends EbliWidgetActionDuplicate { - TrPostProjet projet_; - + public TrPostActionDuplicate(EbliScene _scene, TrPostProjet _projet) { super(_scene); - + projet_ = _projet; } - - -/** - * surcharge de la methode. Envoie de la liste des frame layout + interne - * layout si il y e na plusieurs + /** + * surcharge de la methode. Envoie de la liste des frame layout + interne layout si il y e na plusieurs */ protected EbliScene selectionneSceneNode() { TrPostLayoutFille fenetre = null; EbliScene dest = null; + TrPostCommonImplementation impl = projet_.getImpl(); + List<TrPostLayoutFille> ls = impl.getAllLayoutFille(); - if (projet_.listeFillesLayout.size() <= 1) { - fenetre = projet_.getSelectedFilleLayout(); + if (ls.size() == 1) { + fenetre = ls.get(0); } else { - - - // recuperation de toutes les noms des frames post du projet --// - String[] listeFillesLayout = formatteFilles(); - - BuDialogChoice chooser = new BuDialogChoice(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), - TrResource.TR.getS("S\xE9lectionnez"), TrResource.TR - .getS("S\xE9lectionnez la fen\xEAtre dans laquelle dupliquer l'objet "), listeFillesLayout); - int response = chooser.activate(); + // recuperation de toutes les noms des frames post du projet --// + String[] listeFillesLayout = formatteFilles(ls); - if (response == 0) { - int indiceFilleelect = chooser.getSelectedIndex(); - fenetre = projet_.listeFillesLayout.get(indiceFilleelect); + BuDialogChoice chooser = new BuDialogChoice(impl.getApp(), impl.getInformationsSoftware(), TrResource.TR + .getS("S\xE9lectionnez"), TrResource.TR.getS("S\xE9lectionnez la fen\xEAtre dans laquelle dupliquer l'objet "), + listeFillesLayout); + + int response = chooser.activate(); + + if (response == 0) { + int indiceFilleelect = chooser.getSelectedIndex(); + fenetre = ls.get(indiceFilleelect); + } + } - - } - + // -- on recherche si dans la fille selectionne il existe plusieurs sous // layout --// -// if (fenetre.controller_.listeScenes_.size() <= 1) { - dest = fenetre.controller_.getSceneCourante(); -// } else { -// -// // recuperation de toutes les noms des frames post du projet --// -// String[] listeLayout = formatteLayout(fenetre.controller_); -// -// BuDialogChoice chooser = new BuDialogChoice(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), -// TrResource.TR.getS("S\xE9lectionnez"), TrResource.TR.getS("S\xE9lectionnez le layout de la fen\xEAtre") -// + fenetre.getTitle() -// + TrResource.TR.getS(" dans laquelle dupliquer l'objet "), listeLayout); -// -// int response = chooser.activate(); -// -// if (response == 0) { -// int indiceLayoutelect = chooser.getSelectedIndex(); -// dest = fenetre.controller_.getScene(indiceLayoutelect); -// } -// -// -// -// } - - + // if (fenetre.controller_.listeScenes_.size() <= 1) { + dest = fenetre.controller_.getSceneCourante(); + // } else { + // + // // recuperation de toutes les noms des frames post du projet --// + // String[] listeLayout = formatteLayout(fenetre.controller_); + // + // BuDialogChoice chooser = new BuDialogChoice(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), + // TrResource.TR.getS("S\xE9lectionnez"), TrResource.TR.getS("S\xE9lectionnez le layout de la fen\xEAtre") + // + fenetre.getTitle() + // + TrResource.TR.getS(" dans laquelle dupliquer l'objet "), listeLayout); + // + // int response = chooser.activate(); + // + // if (response == 0) { + // int indiceLayoutelect = chooser.getSelectedIndex(); + // dest = fenetre.controller_.getScene(indiceLayoutelect); + // } + // + // + // + // } + return dest; } - - public String[] formatteFilles() { - String[] noms = new String[projet_.listeFillesLayout.size()]; - int cpt=0; - for (Iterator<TrPostLayoutFille> it = projet_.listeFillesLayout.iterator(); it.hasNext();) { + + public static String[] formatteFilles(List<TrPostLayoutFille> ls) { + String[] noms = new String[ls.size()]; + int cpt = 0; + for (Iterator<TrPostLayoutFille> it = ls.iterator(); it.hasNext();) { noms[cpt++] = it.next().getTitle(); } return noms; } - -// public String[] formatteLayout(TrPostLayoutPanelController _controller) { -// String[] noms = new String[_controller.listeScenes_.size()]; -// -// for (int cpt = 0; cpt < _controller.listeScenes_.size(); cpt++) { -// noms[cpt] = "Layout " + (cpt + 1); -// } -// return noms; -// } - + + // public String[] formatteLayout(TrPostLayoutPanelController _controller) { + // String[] noms = new String[_controller.listeScenes_.size()]; + // + // for (int cpt = 0; cpt < _controller.listeScenes_.size(); cpt++) { + // noms[cpt] = "Layout " + (cpt + 1); + // } + // return noms; + // } + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostAnalyze.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostAnalyze.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostAnalyze.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -64,7 +64,7 @@ protected void loadPost(final File _f) { final Map m = new HashMap(); - src_ = TrPostSourceActivator.activeSourceAction(_f, ui_, prefId_, ui_.getMainProgression(), m); + src_ = TrPostSourceBuilder.activeSourceAction(_f, ui_, prefId_, ui_.getMainProgression(), m); ipobo_ = (int[]) m.get("IPOBO"); iparams_ = (int[]) m.get("IPARAMS"); if (src_ == null) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-09-26 15:21:04 UTC (rev 3992) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-09-26 22:34:47 UTC (rev 3993) @@ -9,7 +9,11 @@ import java.awt.event.ActionEvent; import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.swing.JInternalFrame; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; @@ -36,6 +40,42 @@ return c_; } + /** + * @return toutes les fenetres de PostLayout + */ + public List<TrPostLayoutFille> getAllLayoutFille() { + JInternalFrame[] allInternalFrames = get... [truncated message content] |
From: <had...@us...> - 2008-09-26 15:21:15
|
Revision: 3992 http://fudaa.svn.sourceforge.net/fudaa/?rev=3992&view=rev Author: hadouxad Date: 2008-09-26 15:21:04 +0000 (Fri, 26 Sep 2008) Log Message: ----------- exportation scopeS, scopeGen Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeKeyWord.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeKeyWord.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeKeyWord.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeKeyWord.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -15,8 +15,8 @@ public final static String TYPE_COURBE_SPATIALE = "ScopT"; public final static String TYPE_COURBE_MIXTE = "SCOPGENE"; public final static String SYMBOL_VALUE_UNDEFINED = "*"; + public final static long VALUE_UNDEFINED = 9999999; - public ScopeKeyWord() { } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderGene.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -185,10 +185,11 @@ for (int i = 0; i < nbFields; i++) { // on inscrit la valeur pour la variable du pas de temps // correspondant - double value =0; + double value = key.VALUE_UNDEFINED; if (!key.isUndefined(in_.stringField(i))) value = in_.doubleField(i); - + + structure.addValueForVariableAtPdt(value, i, valuePasDetemps); } } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeReaderSorT.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -134,9 +134,11 @@ if (!key.isBlocCommentaireSorT(in_.getLine())) { // -- on recupere toutes les valeurs de la variable --// for (int i = 0; i < structure.getNbVariables(); i++) { - double val = in_.doubleField(i); + double value = key.VALUE_UNDEFINED; + if (!key.isUndefined(in_.stringField(i))) + value = in_.doubleField(i); // ajout dans la map - structure.addValueForVariable(val, i); + structure.addValueForVariable(value, i); } } in_.readFields(); Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -84,6 +84,23 @@ public double getX(int i) { return getAllX().get(i); } + + + private void insertX(double x) { + getAllX().add(x); + } + /** + * Methode qui insert le x dans les variables que si il n'existe pas deja. + * + * @param x + */ + public void insertNewX(double x) { + + for (int i = 0; i < getAllX().size(); i++) + if (x == getX(i)) + return; + insertX(x); + } /** * Retourne le nombre de valeur pour chaque variables @@ -111,8 +128,11 @@ for (int i = 0; i < getNbVariables(); i++) { if (i > 0) brochetteVal += " "; + if (data_.get(listeVariales_.get(i)).get(indiceValue) != KEY.VALUE_UNDEFINED) brochetteVal += data_.get(listeVariales_.get(i)).get(indiceValue); - + else + brochetteVal += KEY.SYMBOL_VALUE_UNDEFINED; + } return brochetteVal; } @@ -171,11 +191,43 @@ public void addVariable(String ligne) { ligne = ligne.replace(KEY.getBlocCommentaireGENE(), ""); listeVariales_.add(ligne); - - - + } + + + + public List<Double> getAllX(String pdt) { + return data_.get(pdt).get(0); } + + /** + * retourne un x sp\xE9cifi\xE9. + * + * @param i + * @return + */ + public double getX(int i, String pdt) { + return getAllX(pdt).get(i); + } + + private void insertX(double x, String pdt) { + getAllX(pdt).add(x); + } + + /** + * Methode qui insert le x dans les variables que si il n'existe pas deja. + * + * @param x + */ + public void insertNewX(double x, String pdt) { + + for (int i = 0; i < getAllX(pdt).size(); i++) + if (x == getX(i, pdt)) + return; + insertX(x, pdt); + } + + public void addPasDeTemps(String ligne) { ligne = ligne.replace(KEY.getBlocCommentaireGENE(), ""); @@ -258,7 +310,10 @@ ArrayList<Double> listeValueOfVar = getListValueForVariableForPDT(pasDetemps, i); if (i != 0) ligneBrochette += " "; + if (listeValueOfVar.get(indiceValue) != KEY.VALUE_UNDEFINED) ligneBrochette += listeValueOfVar.get(indiceValue); + else + ligneBrochette += KEY.SYMBOL_VALUE_UNDEFINED; } return ligneBrochette; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -29,8 +29,8 @@ import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.ctulu.gui.CtuluTableCsvWriter; import org.fudaa.ctulu.gui.CtuluTableExcelWriter; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.ctulu.gui.CtuluWriter; -import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; @@ -215,7 +215,7 @@ // --ajout des formats scope --// liste.add(new FudaaWriterScopeS()); - + liste.add(new FudaaWriterScopeGENE()); return liste; } Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -0,0 +1,160 @@ +package org.fudaa.fudaa.commun.courbe; + +import java.io.File; +import java.io.IOException; + +import jxl.write.WriteException; + +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gui.CtuluTableModelInterface; +import org.fudaa.ctulu.gui.CtuluWriter; +import org.fudaa.dodico.telemac.io.ScopeGENEFileFormat; +import org.fudaa.dodico.telemac.io.ScopeKeyWord; +import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.ebli.courbe.EGAxeHorizontal; +import org.fudaa.ebli.courbe.EGCourbe; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGExportData; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.courbe.EGObject; + +import com.memoire.bu.BuFileFilter; + +/** + * Writer, passe de la structure Eggraphe a la structure scopeGENE. + * + * @author Adrien Hadoux + * + */ +public class FudaaWriterScopeGENE implements CtuluWriter { + + ScopeGENEFileFormat format_; + File destination_; + ScopeStructure.Gene structure_; + String extension_ = ".scopGENE"; + BuFileFilter filter_; + + + public FudaaWriterScopeGENE(){ + format_ = ScopeGENEFileFormat.getInstance(); + filter_ = format_.createFileFilter(); + + } + + public BuFileFilter getFilter() { + return filter_; + } + + public String getMostPopularExtension() { + return extension_; + } + + public void setFile(File _f) { + destination_ = _f; + + } + + public void setModel(CtuluTableModelInterface _model) { + + structure_ = new ScopeStructure.Gene(); + + //-- data qui contient les courbes choisies --// + EGExportData data = (EGExportData) _model; + EGGraphe graphe_ = data.getGraphe(); + EGCourbe[] listeChoixUser = data.getCourbes(); + + //-- on ajoute un pas de temps qui decrit le graphe --// + String keyPDt="contenu graphe"; + structure_.addPasDeTemps(keyPDt); + + + + //--on ajoute tous les x donn\xE9s de la courbe= UNION DE TOUTES LES COURBES--// + final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); + for (int i = listeChoixUser.length - 1; i >= 0; i--) { + final EGCourbe c = listeChoixUser[i]; + for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { + final double x = c.getModel().getX(j); + // if ( (h.containsPoint(x))) { + // -- on ajoute le x pour les variables x si il n existe pas deja --// + structure_.insertNewX(x,keyPDt); + // } + } + } + + //-- ON INSERE LES Y CORRESPONDANTS POUR CHAQUE VARIABLES--// + for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { + final EGObject ci = graphe_.getModel().getEGObject(i); + if (ci instanceof EGGroup) { + EGGroup groupe = (EGGroup) ci; + + boolean hasAlreadyRegistered=false; + + + for (int k = 0; k < groupe.getChildCount(); k++) { + EGCourbeChild courbe = groupe.getCourbeAt(k); + + boolean selected = false; + for (int j = 0; !selected && j < listeChoixUser.length; j++) + if (listeChoixUser[j] == courbe) + selected = true; + + if (selected) { + + // -- il y a au moins une courbe selectionnee pour la variable, on + // va donc enregistrer la variable dans la structure + if (!hasAlreadyRegistered) { + hasAlreadyRegistered = true; + structure_.addVariable(groupe.getTitle()); + } + + // --ajout des valeurs pour chaque X--/ + for (int g = 0; g < structure_.getAllX(keyPDt).size(); g++) { + //-- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis --// + double x = structure_.getX(g,keyPDt); + + //-- on v\xE9rifie que le x existe pour la courbe actuelle --// + boolean xExistForCourbe = false; + int emplacementYcorrespondant = -1; + for (int l = 0; !xExistForCourbe && l < courbe.getModel().getNbValues(); l++) { + if (courbe.getModel().getX(l) == x) { + xExistForCourbe = true; + emplacementYcorrespondant = l; + } + } + + //double yInterpole = courbe.interpol(x); + + // -- si le x existe dans la courbe alors on inscrit son y + // correspondant pour la bonne variable--// + if (xExistForCourbe) + structure_.addValueForVariableAtPdt(courbe.getModel().getY(emplacementYcorrespondant), structure_.getNbVariables()-1, keyPDt); + else + // -- on enregistre une valeure foireuse. + structure_.addValueForVariableAtPdt(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables()-1, keyPDt); + } + + } + } + + + + } + + } + + + + } + + public void write(ProgressionInterface _p) throws IOException, WriteException { + format_.getLastVersionInstance(null).write(destination_, structure_, null); + + } + + public boolean allowFormatData() { + return false; + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java 2008-09-26 13:19:23 UTC (rev 3991) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java 2008-09-26 15:21:04 UTC (rev 3992) @@ -8,6 +8,7 @@ import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluTableModelInterface; import org.fudaa.ctulu.gui.CtuluWriter; +import org.fudaa.dodico.telemac.io.ScopeKeyWord; import org.fudaa.dodico.telemac.io.ScopeSFileFormat; import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.ebli.courbe.EGAxeHorizontal; @@ -20,6 +21,13 @@ import com.memoire.bu.BuFileFilter; + +/** + * Writer, passe de la structure Eggraphe a la structure scopeS. + * + * @author Adrien Hadoux + * + */ public class FudaaWriterScopeS implements CtuluWriter { ScopeSFileFormat format_; @@ -48,55 +56,190 @@ } + public void setModel(CtuluTableModelInterface _model) { + setModelVersionInterpoleY(_model); + } + + /** + * Cette version recupere l'union des X de toutes les courebs pour chaque + * variable du graphe. Ecrit le y du x si x appartient a la courbe sinon ecrit + * la valeur interpol\xE9e de x + * + * @param _model + */ + public void setModelVersionInterpoleY(CtuluTableModelInterface _model) { + + structure_ = new ScopeStructure.SorT(); + + // -- data qui contient les courbes choisies --// + EGExportData data = (EGExportData) _model; + EGGraphe graphe_ = data.getGraphe(); + EGCourbe[] listeChoixUser = data.getCourbes(); + + // -- on ajoute la var des x, debut de chaque ligne de valeurs --// + structure_.addVariable("X"); + + // --on ajoute tous les x donn\xE9s de la courbe= UNION DE TOUTES LES + // COURBES--// + final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); + for (int i = listeChoixUser.length - 1; i >= 0; i--) { + final EGCourbe c = listeChoixUser[i]; + for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { + final double x = c.getModel().getX(j); + // if ( (h.containsPoint(x))) { + // -- on ajoute le x pour les variables x si il n existe pas deja --// + structure_.insertNewX(x); + // } + } + } + + // -- ON INSERE LES Y CORRESPONDANTS POUR CHAQUE VARIABLES--// + for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { + final EGObject ci = graphe_.getModel().getEGObject(i); + if (ci instanceof EGGroup) { + EGGroup groupe = (EGGroup) ci; + + boolean hasAlreadyRegistered = false; + + for (int k = 0; k < groupe.getChildCount(); k++) { + EGCourbeChild courbe = groupe.getCourbeAt(k); + + boolean selected = false; + for (int j = 0; !selected && j < listeChoixUser.length; j++) + if (listeChoixUser[j] == courbe) + selected = true; + + if (selected) { + + // -- il y a au moins une courbe selectionnee pour la variable, on + // va donc enregistrer la variable dans la structure + if (!hasAlreadyRegistered) { + hasAlreadyRegistered = true; + structure_.addVariable(groupe.getTitle()); + } + + // --ajout des valeurs pour chaque X--/ + for (int g = 0; g < structure_.getAllX().size(); g++) { + // -- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis + // --// + double x = structure_.getX(g); + + // -- on v\xE9rifie que le x existe pour la courbe actuelle --// + // boolean xExistForCourbe = false; + // int emplacementYcorrespondant = -1; + // for (int l = 0; !xExistForCourbe && l < + // courbe.getModel().getNbValues(); l++) { + // if (courbe.getModel().getX(l) == x) { + // xExistForCourbe = true; + // emplacementYcorrespondant = l; + // } + // } + + double yInterpole = courbe.interpol(x); + + // -- si le x existe dans la courbe alors on inscrit son y + // correspondant pour la bonne variable--// + + structure_.addValueForVariable(yInterpole, structure_ + .getNbVariables() - 1); + + } + + } + } + + } + + } + + } + + + /** + * Cette version recupere l'union des X de toutes les courebs pour chaque + * variable du graphe. Ecrit le y du x que si x de l'union appartient a la courbe + * + * @param _model + */ + public void setModelVersionUnionXcoubesY(CtuluTableModelInterface _model) { + structure_ = new ScopeStructure.SorT(); //-- data qui contient les courbes choisies --// EGExportData data = (EGExportData) _model; EGGraphe graphe_ = data.getGraphe(); - EGCourbe[] liste=data.getCourbes(); + EGCourbe[] listeChoixUser = data.getCourbes(); //-- on ajoute la var des x, debut de chaque ligne de valeurs --// structure_.addVariable("X"); - //--on ajoute tous les x donn\xE9s de la courbe--// + - + //--on ajoute tous les x donn\xE9s de la courbe= UNION DE TOUTES LES COURBES--// final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); - for (int i = liste.length - 1; i >= 0; i--) { - final EGCourbe c = liste[i]; + for (int i = listeChoixUser.length - 1; i >= 0; i--) { + final EGCourbe c = listeChoixUser[i]; for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { final double x = c.getModel().getX(j); - if ( (h.containsPoint(x))) { - //-- on ajoute le x pour les variables x --// - structure_.addValueForVariable(x,0); - } + // if ( (h.containsPoint(x))) { + // -- on ajoute le x pour les variables x si il n existe pas deja --// + structure_.insertNewX(x); + // } } } - + //-- ON INSERE LES Y CORRESPONDANTS POUR CHAQUE VARIABLES--// for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { final EGObject ci = graphe_.getModel().getEGObject(i); if (ci instanceof EGGroup) { EGGroup groupe = (EGGroup) ci; - structure_.addVariable(groupe.getTitle()); + boolean hasAlreadyRegistered = false; + for (int k = 0; k < groupe.getChildCount(); k++) { EGCourbeChild courbe = groupe.getCourbeAt(k); boolean selected = false; - for (int j = 0; !selected && j < liste.length; j++) - if (liste[j] == courbe) + for (int j = 0; !selected && j < listeChoixUser.length; j++) + if (listeChoixUser[j] == courbe) selected = true; if (selected) { + + // -- il y a au moins une courbe selectionnee pour la variable, on + // va donc enregistrer la variable dans la structure + if (!hasAlreadyRegistered) { + hasAlreadyRegistered = true; + structure_.addVariable(groupe.getTitle()); + } + // --ajout des valeurs pour chaque X--/ for (int g = 0; g < structure_.getAllX().size(); g++) { //-- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis --// double x = structure_.getX(g); - double yInterpole = courbe.interpol(x); - structure_.addValueForVariable(yInterpole, structure_.getNbVariables() - 1); + + //-- on v\xE9rifie que le x existe pour la courbe actuelle --// + boolean xExistForCourbe = false; + int emplacementYcorrespondant = -1; + for (int l = 0; !xExistForCourbe && l < courbe.getModel().getNbValues(); l++) { + if (courbe.getModel().getX(l) == x) { + xExistForCourbe = true; + emplacementYcorrespondant = l; + } + } + + //double yInterpole = courbe.interpol(x); + + // -- si le x existe dans la courbe alors on inscrit son y + // correspondant pour la bonne variable--// + if (xExistForCourbe) + structure_.addValueForVariable(courbe.getModel().getY(emplacementYcorrespondant), structure_ + .getNbVariables() - 1); + else + // -- on enregistre une valeure foireuse. + structure_.addValueForVariable(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables() - 1); } } @@ -112,13 +255,16 @@ } + + + public void write(ProgressionInterface _p) throws IOException, WriteException { format_.getLastVersionInstance(null).write(destination_, structure_, null); } public boolean allowFormatData() { - return true; + return false; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-09-26 13:19:28
|
Revision: 3991 http://fudaa.svn.sourceforge.net/fudaa/?rev=3991&view=rev Author: emmanuel_martin Date: 2008-09-26 13:19:23 +0000 (Fri, 26 Sep 2008) Log Message: ----------- n?\195?\168me mise ?\195?\160 jour de l'?\195?\169dition de profile Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-26 10:52:47 UTC (rev 3990) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-26 13:19:23 UTC (rev 3991) @@ -21,6 +21,9 @@ import javax.swing.JComponent; import javax.swing.JTabbedPane; import javax.swing.JTable; +import javax.swing.ListSelectionModel; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.AbstractTableModel; @@ -31,6 +34,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.CtuluListSelectionEvent; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluListSelectionListener; @@ -212,7 +216,7 @@ * @version $Id: EbliSingleObjectEditorPanel.java,v 1.10.6.2 2008-04-01 * 07:28:15 emartin Exp $ */ - public class CourbeRepresentation extends BuPanel implements TableModelListener, CtuluListSelectionListener { + public class CourbeRepresentation extends BuPanel implements TableModelListener, CtuluListSelectionListener, ListSelectionListener { /** * Cette classe donne un acc\xE8s restraint au model 'model_'. Concr\xE8tement @@ -313,6 +317,8 @@ private EGAxeVertical axeY_; // Vue de la courbe EGCourbeSimple courbeVue_; + // Gestion de la selection + CtuluListSelection listSelection_; // Model du tableau CtuluTable tableauVue_; @@ -336,6 +342,8 @@ axeY_.setUnite(EbliLib.getS("m\xE8tre")); // Calcule des x generateCoordX(); + axeX_.setBounds(0, lengthPolyligne_); + axeY_.setBounds(0, maxZ_); // La courbe EGCourbeModelProfile courbeModel=new EGCourbeModelProfile(this, ""); courbeVue_=new EGCourbeSimple(axeY_, courbeModel); @@ -343,6 +351,8 @@ grapheModel.addCourbe(courbeVue_, new CtuluCommandManager()); // Conteneur de graphe EGFillePanel pnD=new EGFillePanel(grapheVue_); + listSelection_ = pnD.getSelection(); + listSelection_.addListeSelectionListener(this); // Construction des boutons \\ EbliActionInterface[] actions=pnD.getSpecificActions(); Container buttons=new Container(); @@ -354,8 +364,6 @@ actionsKept.add(tmpAction[i]); for (int i=0; i<actions.length; i++) { if(actions[i] != null && actionsKept.contains(actions[i].getValue(Action.ACTION_COMMAND_KEY))){ - if(actions[i].getValue(Action.ACTION_COMMAND_KEY)=="SELECT") - pnD.addSelectionListener(this); AbstractButton button = actions[i].buildButton(EbliComponentFactory.INSTANCE); button.setText(""); buttons.add(button); @@ -365,6 +373,7 @@ LimitedTableRepresentation tableau = new LimitedTableRepresentation(model_.xyFormatter_); tableauVue_ = new CtuluTable(); tableauVue_.setModel(tableau); + tableauVue_.getSelectionModel().addListSelectionListener(this); // Met le bon \xE9diteurs dans le tableau pour l'attribut z tableauVue_.getColumnModel().getColumn(1) .setCellEditor(model_.modeles_[zInd_].getAttribute().getEditor().createTableEditorComponent()); @@ -428,8 +437,10 @@ } if(oldLengthPolyligne != lengthPolyligne_) axeX_.setBounds(0, lengthPolyligne_); - if(oldMaxZ != maxZ_) - axeY_.setBounds(0, maxZ_); + if(grapheVue_.isAutoRestore()){ + if(oldMaxZ != maxZ_) + axeY_.setBounds(0, maxZ_); + } } /* @@ -440,16 +451,48 @@ */ public void tableChanged(TableModelEvent e) { generateCoordX(); - grapheVue_.fullRepaint(); + if(grapheVue_.isAutoRestore()) + grapheVue_.restore(); + else + grapheVue_.fullRepaint(); } /* (non-Javadoc) * @see org.fudaa.ctulu.CtuluListSelectionListener#listeSelectionChanged(org.fudaa.ctulu.CtuluListSelectionEvent) */ public void listeSelectionChanged(CtuluListSelectionEvent _e) { - tableauVue_.setRowSelectionInterval(((CtuluListSelectionInterface)_e.getSource()).getMinIndex(), - ((CtuluListSelectionInterface)_e.getSource()).getMaxIndex()); + // Un changement de selection a \xE9t\xE9 effectu\xE9 dans la courbe \\ + //Suppression de l'\xE9coute des changement de selection de le tableau + tableauVue_.getSelectionModel().removeListSelectionListener(this); + // Changement de selection dans le tableau + int[] selectedIndex = ((CtuluListSelectionInterface)_e.getSource()).getSelectedIndex(); + ListSelectionModel lstTableauSelect = tableauVue_.getSelectionModel(); + lstTableauSelect.clearSelection(); + for(int i=0; i<selectedIndex.length;i++) + lstTableauSelect.addSelectionInterval(selectedIndex[i], selectedIndex[i]); + // R\xE9activation de l'\xE9coute de changement de selection de le tableau + tableauVue_.getSelectionModel().addListSelectionListener(this); } + + /* (non-Javadoc) + * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent) + */ + public void valueChanged(ListSelectionEvent _e) { + // Un changement de selection a \xE9t\xE9 effectu\xE9 dans le tableau \\ + //Suppression de l'\xE9coute des changement de selection de la courbe + listSelection_.removeListeSelectionListener(this); + // Changement de selection de la courbe + CtuluListSelection lst = new CtuluListSelection(); + ListSelectionModel lstSelect = tableauVue_.getSelectionModel(); + listSelection_.clear(); + for(int i=0; i<tableauVue_.getRowCount();i++) + if(lstSelect.isSelectedIndex(i)) + lst.add(i); + if(!lst.isEmpty()) + listSelection_.setSelection(lst); + // R\xE9activation de l'\xE9coute de changement de selection de la courbe + listSelection_.addListeSelectionListener(this); + } } private CtuluCommandContainer cmd_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-09-26 10:53:00
|
Revision: 3990 http://fudaa.svn.sourceforge.net/fudaa/?rev=3990&view=rev Author: bmarchan Date: 2008-09-26 10:52:47 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-26 10:24:20 UTC (rev 3989) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-26 10:52:47 UTC (rev 3990) @@ -381,7 +381,7 @@ } /** - * Projection orthonorm\xE9e d'un point sur un plan quelconque d\xE9finit par 3 points. + * Projection orthogonale d'un point sur un plan quelconque d\xE9finit par 3 points. * @param _plan Les points 3D du plan. * @param _pt Le point 3D \xE0 projeter. * @return LE point 3D sur le plan de projection. @@ -391,9 +391,15 @@ if (_plan==null||_pt==null||_plan.length<3||_plan[0]==null||_plan[1]==null||_plan[2]==null) return null; // On nomme : a, b, c les trois points d\xE9finissant le plan - double xa=_plan[0].getX(), ya=_plan[0].getY(), za=_plan[0].getZ(); - double xb=_plan[1].getX(), yb=_plan[1].getY(), zb=_plan[1].getZ(); - double xc=_plan[2].getX(), yc=_plan[2].getY(), zc=_plan[2].getZ(); + double xa=_plan[0].getX(); + double ya=_plan[0].getY(); + double za=_plan[0].getZ(); + double xb=_plan[1].getX(); + double yb=_plan[1].getY(); + double zb=_plan[1].getZ(); + double xc=_plan[2].getX(); + double yc=_plan[2].getY(); + double zc=_plan[2].getZ(); // Teste que les trois points d\xE9finissant le plan sont diff\xE9rents if ((xa==xb&&ya==yb&&za==zb)||(xb==xc&&yb==yc&&zb==zc)||(xa==xc&&ya==yc&&za==zc)) return null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-09-26 10:24:34
|
Revision: 3989 http://fudaa.svn.sourceforge.net/fudaa/?rev=3989&view=rev Author: emmanuel_martin Date: 2008-09-26 10:24:20 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Correction d'un bug sur la projection d'un point dans un plan ; amm?\195?\169lioration d'un l'?\195?\169ditino de profile ; correction d'un bug dans l'?\195?\169dition de profile. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-26 09:28:40 UTC (rev 3988) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-26 10:24:20 UTC (rev 3989) @@ -387,7 +387,7 @@ * @return LE point 3D sur le plan de projection. */ public static GISPoint projectOnPlane(GISPoint[] _plan, GISPoint _pt) { - // Teste si on a toute les donn\xE9es + // Teste si on a toutes les donn\xE9es if (_plan==null||_pt==null||_plan.length<3||_plan[0]==null||_plan[1]==null||_plan[2]==null) return null; // On nomme : a, b, c les trois points d\xE9finissant le plan @@ -417,7 +417,7 @@ double yw = zu*xv - xu*zv; double zw = xu*yv - yu*xv; // On calcul k qui est d\xE9fini tel que : vecteur(ip) = k * w - double k = ((xa+xi)*xw+(ya+yi)*yw+(za+zi)*zw)/(xw*xw+yw*yw+zw*zw); + double k = ((xa-xi)*xw+(ya-yi)*yw+(za-zi)*zw)/(xw*xw+yw*yw+zw*zw); // Calcul des coordonn\xE9es de p xp = xi + k*xw; yp = yi + k*yw; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java 2008-09-26 09:28:40 UTC (rev 3988) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java 2008-09-26 10:24:20 UTC (rev 3989) @@ -88,7 +88,7 @@ if (selectedAtomic_ == null) { isFerme_ = zone_.getGeometry(idx_) instanceof LinearRing; } - modeles_ = _useAttribute ? _zone.getAtomicAttributeSubModel(_idx) : null; + modeles_ = _useAttribute ? _zone.getAtomicAttributeSubModel(_idx) : new GISAttributeModel[0]; g_ = _zone.getCoordinateSequence(idx_); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-26 09:28:40 UTC (rev 3988) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-26 10:24:20 UTC (rev 3989) @@ -59,6 +59,7 @@ import com.memoire.bu.BuLabel; import com.memoire.bu.BuPanel; import com.memoire.bu.BuScrollPane; +import com.memoire.bu.BuSplit2Pane; import com.memoire.fu.FuLog; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.CoordinateSequence; @@ -280,7 +281,7 @@ public String getColumnName(int _column) { switch (_column) { case 0: - return EbliLib.getS("curviligne"); + return EbliLib.getS(EbliLib.getS("Abscisse")); case 1: return model_.getColumnName(zCol_); default: @@ -310,6 +311,8 @@ // Axes du la courbe private EGAxeHorizontal axeX_; private EGAxeVertical axeY_; + // Vue de la courbe + EGCourbeSimple courbeVue_; // Model du tableau CtuluTable tableauVue_; @@ -322,20 +325,20 @@ grapheVue_.setSize(grapheVue_.getPreferredSize()); // Axe des X axeX_=new EGAxeHorizontal(false); - axeX_.setTitre("distance"); - axeX_.setUnite("m\xE8tre"); + axeX_.setTitre(EbliLib.getS("Abscisse curviligne")); + axeX_.setUnite(EbliLib.getS("m\xE8tre")); axeX_.setGraduations(true); grapheVue_.setXAxe(axeX_); // Axe des Y axeY_=new EGAxeVertical(); axeY_.setGraduations(true); - axeY_.setTitre("Z"); - axeY_.setUnite("m\xE8tre"); + axeY_.setTitre(model_.getColumnName(zCol_)); + axeY_.setUnite(EbliLib.getS("m\xE8tre")); // Calcule des x generateCoordX(); // La courbe EGCourbeModelProfile courbeModel=new EGCourbeModelProfile(this, ""); - EGCourbeSimple courbeVue_=new EGCourbeSimple(axeY_, courbeModel); + courbeVue_=new EGCourbeSimple(axeY_, courbeModel); courbeVue_.setAspectContour(Color.BLUE); grapheModel.addCourbe(courbeVue_, new CtuluCommandManager()); // Conteneur de graphe @@ -365,17 +368,15 @@ // Met le bon \xE9diteurs dans le tableau pour l'attribut z tableauVue_.getColumnModel().getColumn(1) .setCellEditor(model_.modeles_[zInd_].getAttribute().getEditor().createTableEditorComponent()); - // Ajout au panel + // Ajout au panel \\ BuScrollPane scrollPane = new BuScrollPane(tableauVue_); BuPanel left = new BuPanel(); left.setLayout(new BuBorderLayout()); scrollPane.setPreferredSize(new Dimension(130, 335)); left.add(buttons, BuBorderLayout.NORTH); left.add(scrollPane, BuBorderLayout.CENTER); - setLayout(new BuBorderLayout()); - add(left, BuBorderLayout.WEST); - add(pnD, BuBorderLayout.CENTER); - setPreferredSize(new Dimension(150, 250)); + BuSplit2Pane splitPane = new BuSplit2Pane(left, pnD, BuSplit2Pane.HORIZONTAL); + add(splitPane); } public int getNbValues() { @@ -487,6 +488,7 @@ idx_=_idx; zone_=_zone.getGeomData(); modeleSrc_=_zone; + zInd_ = -1; // Construction de la table des attributs globaux (globalAttr_) \\ setLayout(new BuBorderLayout()); if (_editAttribut) { @@ -536,21 +538,22 @@ found=model_.modeles_[k].getAttribute()==zAttr; k++; } - if (found) // forc\xE9ment vrai parce que zAttr est non null + if (found){ // forc\xE9ment vrai parce que zAttr est non null zInd_=--k; - // construction de zCol_ - zCol_=zInd_+3; // zInd_ + colonne index, x et y - // Gestionnaire d'onglet - tabbedPane_=new JTabbedPane(); - // Les onglets - tableRep_=new TableRepresentation(_editAttribut, _editVertexAttribut, _xyFormatter); - courbeRep_=new CourbeRepresentation(); - // Ajout - tabbedPane_.add(EbliLib.getS("Table"), tableRep_); - tabbedPane_.add(EbliLib.getS("Courbe"), courbeRep_); - add(tabbedPane_, BuBorderLayout.CENTER); + // construction de zCol_ + zCol_=zInd_+3; // zInd_ + colonne index, x et y + // Gestionnaire d'onglet + tabbedPane_=new JTabbedPane(); + // Les onglets + tableRep_=new TableRepresentation(_editAttribut, _editVertexAttribut, _xyFormatter); + courbeRep_=new CourbeRepresentation(); + // Ajout + tabbedPane_.add(EbliLib.getS("Table"), tableRep_); + tabbedPane_.add(EbliLib.getS("Courbe"), courbeRep_); + add(tabbedPane_, BuBorderLayout.CENTER); + } } - else { + if(zInd_ == -1) { model_=new EbliAtomicCoordinatesTableModel.Line(_xyFormatter, modeleSrc_.getGeomData(), idx_, null, _editVertexAttribut, modeleSrc_); tableRep_=new TableRepresentation(_editAttribut, _editVertexAttribut, _xyFormatter); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-09-26 09:28:53
|
Revision: 3988 http://fudaa.svn.sourceforge.net/fudaa/?rev=3988&view=rev Author: hadouxad Date: 2008-09-26 09:28:40 +0000 (Fri, 26 Sep 2008) Log Message: ----------- import/export de graphes Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluExportDataInterface.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluFileChooserCsvExcel.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluTableCsvWriter.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluTableExcelWriter.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGExportData.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGExporter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaCommonImplementation.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluFileChooserWriter.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluWriter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluExportDataInterface.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluExportDataInterface.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluExportDataInterface.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -9,6 +9,7 @@ + /** * Une interface permettant de reconnaitre les internal frames qui ont des donn\xE9es \xE0 exporter. * @author Fred Deniger @@ -31,5 +32,7 @@ * @param _impl l'impl parent. */ void startExport(CtuluUI _impl); + + } Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluFileChooserCsvExcel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluFileChooserCsvExcel.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluFileChooserCsvExcel.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -11,13 +11,13 @@ import javax.swing.JFileChooser; -import com.memoire.bu.BuFileFilter; -import com.memoire.bu.BuResource; - import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ctulu.CtuluUI; +import com.memoire.bu.BuFileFilter; +import com.memoire.bu.BuResource; + /** * @author Fred Deniger * @version $Id: CtuluFileChooserCsvExcel.java,v 1.6 2007-06-14 11:58:18 deniger Exp $ @@ -28,6 +28,8 @@ final BuFileFilter ftXsl_; + + final CtuluUI ui_; public CtuluFileChooserCsvExcel(CtuluUI _ui) { @@ -60,12 +62,21 @@ return null; } File f = getSelectedFile(); + + + completeExtension(f); + + + return f; + } + + private void completeExtension(File f){ final javax.swing.filechooser.FileFilter filter = getFileFilter(); final String name = f.getName(); if (name.indexOf('.') < 0) { f = new File(f.getAbsolutePath() + (filter == ftXsl_ ? ".xls" : ".txt")); } - return f; } + } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluFileChooserWriter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluFileChooserWriter.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluFileChooserWriter.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -0,0 +1,82 @@ +package org.fudaa.ctulu.gui; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.JFileChooser; + +import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.CtuluUI; + +import com.memoire.bu.BuResource; + +/** + * Chooser G\xE9n\xE9rique qui complete tous les formats en ajoutant les interfaces + * CtuluWriter appropri\xE9es. + * + * @author Adrien Hadoux + * + */ +public class CtuluFileChooserWriter extends CtuluFileChooser { + + + + final List<CtuluWriter> listWriter_; + final CtuluUI ui_; + + public CtuluFileChooserWriter(CtuluUI _ui, final List<CtuluWriter> _listWriter) { + + ui_ = _ui; + + if(_listWriter!=null) + listWriter_ = _listWriter; + else{ + // -- on ajoute par defaut les import export csv et excel --// + listWriter_=new ArrayList<CtuluWriter>(); + listWriter_.add(new CtuluTableExcelWriter()); + listWriter_.add(new CtuluTableCsvWriter()); + } + for (CtuluWriter writer : listWriter_) { + writer.getFilter().setExtensionListInDescription(true); + addChoosableFileFilter(writer.getFilter()); + } + setDialogType(JFileChooser.SAVE_DIALOG); + setApproveButtonToolTipText(CtuluLib.getS("L'extension du fichier sera automatiquement compl\xE9t\xE9e")); + CtuluFileChooserTestWritable tester = new CtuluFileChooserTestWritable(_ui); + tester.setAppendExtension(true, null); + setTester(tester); + + + } + + /** + * retourne le writter selectionn\xE9 + * + * @return + */ + public CtuluWriter getSelectedWriter() { + for (CtuluWriter writer : listWriter_) + if (writer.getFilter() == getFileFilter()) + return writer; + return null; + } + + public File getDestFile() { + final int res = showDialog(ui_.getParentComponent(), BuResource.BU.getString("Continuer")); + if (res != JFileChooser.APPROVE_OPTION) { + return null; + } + File f = getSelectedFile(); + + + + return completeExtension(f); + } + + private File completeExtension(File f) { + f = new File(f.getAbsolutePath() + getSelectedWriter().getMostPopularExtension()); + return f; + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluTableCsvWriter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluTableCsvWriter.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluTableCsvWriter.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -7,23 +7,27 @@ */ package org.fudaa.ctulu.gui; +import java.io.File; import java.io.IOException; import org.fudaa.ctulu.CsvWriter; import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.CtuluResource; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; +import com.memoire.bu.BuFileFilter; + /** * @author Fred Deniger * @version $Id: CtuluTableCsvWriter.java,v 1.5 2007-03-30 15:35:20 deniger Exp $ */ -public class CtuluTableCsvWriter { +public class CtuluTableCsvWriter implements CtuluWriter { CtuluTableModelInterface table_; CsvWriter w_; boolean writeHeader_ = true; - + BuFileFilter ftCsv_ = new BuFileFilter(new String[] { "txt", "csv" }, CtuluResource.CTULU.getString("Texte CSV")); /** * @param _w * @param _table @@ -34,6 +38,10 @@ w_.setSepChar(';'); table_ = _table; } + + public CtuluTableCsvWriter() { + super(); + } public void write(final ProgressionInterface _prog) throws IOException { try { @@ -77,4 +85,33 @@ writeHeader_ = _writeHeader; } + public BuFileFilter getFilter() { + return ftCsv_; + } + + public void setFile(File _f) { + CsvWriter c; + try { + c = new CsvWriter(_f); + w_ = c; + w_.setSepChar(';'); + } catch (IOException e) { + e.printStackTrace(); + } + + } + + public void setModel(CtuluTableModelInterface _model) { + table_ = _model; + } + + String extension_ = ".txt"; + public String getMostPopularExtension() { + return extension_; + } + + public boolean allowFormatData() { + return true; + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluTableExcelWriter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluTableExcelWriter.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluTableExcelWriter.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -24,11 +24,13 @@ import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; +import com.memoire.bu.BuFileFilter; + /** * @author Fred Deniger * @version $Id: CtuluTableExcelWriter.java,v 1.7 2007-04-16 16:33:53 deniger Exp $ */ -public class CtuluTableExcelWriter { +public class CtuluTableExcelWriter implements CtuluWriter { CtuluTableModelInterface table_; @@ -44,6 +46,10 @@ dest_ = _dest; } + public CtuluTableExcelWriter() { + super(); + } + /** * @param _p le receveur de l'avancement * @throws IOException @@ -94,4 +100,28 @@ } } + + BuFileFilter ftXsl_ = new BuFileFilter(new String[] { "xls" }, CtuluResource.CTULU.getString("Fichier excel")); + + public BuFileFilter getFilter() { + return ftXsl_; + } + + public void setFile(File f) { + dest_ = f; + } + + public void setModel(CtuluTableModelInterface _model) { + table_ = _model; + } + + String extension_ = ".xls"; + public String getMostPopularExtension() { + return extension_; + } + + public boolean allowFormatData() { + return true; + } + } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluWriter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluWriter.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluWriter.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -0,0 +1,66 @@ +package org.fudaa.ctulu.gui; + +import java.io.File; +import java.io.IOException; + +import jxl.write.WriteException; + +import org.fudaa.ctulu.ProgressionInterface; + +import com.memoire.bu.BuFileFilter; + +/** + * interface qui gere l'export dans les formats donn\xE9s + * + * @author Adrien Hadoux + * + */ +public interface CtuluWriter { + + /** + * indique le fichier ou ecrire les donn\xE9es + * + * @param f + */ + public void setFile(File f); + + + /** + * g\xE9n\xE8re le fichier en \xE9crivant le model de donn\xE9es. + * + * @param _p + * @throws IOException + * @throws WriteException + */ + public void write(final ProgressionInterface _p) throws IOException, WriteException; + + /** + * r\xE9cup\xE8re les filtres g\xE9r\xE9s par le writer + * + * @return + */ + public BuFileFilter getFilter(); + + /** + * ins\xE8re le mod\xE8le de donn\xE9es. + * + * @param model + */ + public void setModel(CtuluTableModelInterface model); + + + /** + * donne l'extension de fichier la plus fr\xE9quente. + * + * @return + */ + public String getMostPopularExtension(); + + /** + * indique si le wizard peut proposer des formattages de donnees. + * + * @return + */ + public boolean allowFormatData(); + +} Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -16,9 +16,10 @@ public final static ScopeKeyWord KEY = new ScopeKeyWord(); public abstract void printResults(); - + /** - * Structure pour les fichiers s ou t + * Structure pour les fichiers s ou t Par convention les x sont les premieres + * variables. * * @author Adrien * @@ -64,6 +65,27 @@ } /** + * Recupere la liste des x. Par convention les x sont les premieres + * variables. + * + * @return + */ + public List<Double> getAllX() { + return data_.get(listeVariales_.get(0)); + } + + + /** + * retourne un x sp\xE9cifi\xE9. + * + * @param i + * @return + */ + public double getX(int i) { + return getAllX().get(i); + } + + /** * Retourne le nombre de valeur pour chaque variables * * @return Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGExportData.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGExportData.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGExportData.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -15,8 +15,6 @@ import jxl.write.Number; import jxl.write.WritableCell; -import com.memoire.bu.BuTask; - import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.ProgressionInterface; @@ -161,6 +159,9 @@ EGCourbe[] cs_; EGGraphe g_; + + + int maxCol_; int maxLine_; @@ -168,7 +169,15 @@ cs_ = _cs; g_ = _g; } + + public EGCourbe[] getCourbes() { + return cs_; + } + public EGGraphe getGraphe() { + return g_; + } + public String getColumnName(final int _i) { return column_[_i]; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGExporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGExporter.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGExporter.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -27,15 +27,6 @@ import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; -import com.memoire.bu.BuBorders; -import com.memoire.bu.BuCheckBox; -import com.memoire.bu.BuList; -import com.memoire.bu.BuPanel; -import com.memoire.bu.BuScrollPane; -import com.memoire.bu.BuVerticalLayout; -import com.memoire.fu.FuLog; - -import org.fudaa.ctulu.CsvWriter; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluResource; @@ -44,14 +35,20 @@ import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluCellTextRenderer; import org.fudaa.ctulu.gui.CtuluDialogPanel; -import org.fudaa.ctulu.gui.CtuluFileChooserCsvExcel; +import org.fudaa.ctulu.gui.CtuluFileChooserWriter; import org.fudaa.ctulu.gui.CtuluLibDialog; import org.fudaa.ctulu.gui.CtuluLibSwing; -import org.fudaa.ctulu.gui.CtuluTableCsvWriter; -import org.fudaa.ctulu.gui.CtuluTableExcelWriter; - +import org.fudaa.ctulu.gui.CtuluWriter; import org.fudaa.ebli.commun.EbliLib; +import com.memoire.bu.BuBorders; +import com.memoire.bu.BuCheckBox; +import com.memoire.bu.BuList; +import com.memoire.bu.BuPanel; +import com.memoire.bu.BuScrollPane; +import com.memoire.bu.BuVerticalLayout; +import com.memoire.fu.FuLog; + /** * @author Fred Deniger * @version $Id: EGExporter.java,v 1.19 2007-06-14 12:00:22 deniger Exp $ @@ -66,9 +63,11 @@ } } - public static void startExport(final EGGraphe _target, final CtuluUI _impl) { + public static void startExport(final EGGraphe _target, final CtuluUI _impl, final List<CtuluWriter> _listWriter) { - final CtuluFileChooserCsvExcel ch = new CtuluFileChooserCsvExcel(_impl); + + + final CtuluFileChooserWriter ch = new CtuluFileChooserWriter(_impl, _listWriter); final Frame f = CtuluLibSwing.getFrameAncestorHelper(_impl.getParentComponent()); final File destFile = ch.getDestFile(); if (destFile == null) { @@ -87,14 +86,14 @@ .getS("Aucune donn\xE9e \xE0 exporter")); } try { - if (ch.isExcelChoosen()) { - final CtuluTableExcelWriter c = new CtuluTableExcelWriter(d, destFile); - c.write(_proj); - } else { - final CsvWriter c = new CsvWriter(destFile); - final CtuluTableCsvWriter w = new CtuluTableCsvWriter(c, d); - w.write(_proj); - } + // -- recuperation du writer + CtuluWriter writer=ch.getSelectedWriter(); + + writer.setFile(destFile); + writer.setModel(d); + writer.write(_proj); + + } catch (final Exception _e) { FuLog.error(_e); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFille.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGFille.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -22,8 +22,6 @@ import javax.swing.JMenu; import javax.swing.SwingUtilities; -import com.memoire.bu.*; - import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluExportDataInterface; import org.fudaa.ctulu.CtuluLibString; @@ -33,7 +31,6 @@ import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.ctulu.gui.CtuluPopupListener; import org.fudaa.ctulu.image.CtuluImageProducer; - import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; import org.fudaa.ebli.commun.EbliComponentFactory; @@ -41,6 +38,17 @@ import org.fudaa.ebli.impression.EbliFilleImprimable; import org.fudaa.ebli.impression.EbliPrinter; +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuCommonInterface; +import com.memoire.bu.BuCutCopyPasteInterface; +import com.memoire.bu.BuDesktop; +import com.memoire.bu.BuInformationsDocument; +import com.memoire.bu.BuLabel; +import com.memoire.bu.BuMenu; +import com.memoire.bu.BuPanel; +import com.memoire.bu.BuSplit2Pane; +import com.memoire.bu.BuUndoRedoInterface; + /** * @author Fred Deniger * @version $Id: EGFille.java,v 1.26 2007-06-28 09:26:47 deniger Exp $ @@ -78,7 +86,8 @@ } public void startExport(final CtuluUI _impl) { - EGExporter.startExport(getGraphe(), _impl); + + EGExporter.startExport(getGraphe(), _impl, null); } /** Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -11,6 +11,7 @@ import java.io.File; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.Map; import javax.swing.filechooser.FileFilter; @@ -26,6 +27,9 @@ import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.ctulu.gui.CtuluFileChooser; import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluTableCsvWriter; +import org.fudaa.ctulu.gui.CtuluTableExcelWriter; +import org.fudaa.ctulu.gui.CtuluWriter; import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; @@ -130,7 +134,7 @@ } public void actionPerformed(final ActionEvent _e) { - EGExporter.startExport(graphe_, impl_); + EGExporter.startExport(graphe_, impl_, getFileFormatForExport()); } } @@ -196,4 +200,23 @@ return rf; } + + /** + * Methode statique qui retourne les writer possible pour l exportation des + * courbes + * + * @return + */ + public static List<CtuluWriter> getFileFormatForExport() { + final ArrayList<CtuluWriter> liste = new ArrayList<CtuluWriter>(10); + + liste.add(new CtuluTableExcelWriter()); + liste.add(new CtuluTableCsvWriter()); + + // --ajout des formats scope --// + liste.add(new FudaaWriterScopeS()); + + return liste; + } + } Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeS.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -0,0 +1,124 @@ +package org.fudaa.fudaa.commun.courbe; + +import java.io.File; +import java.io.IOException; + +import jxl.write.WriteException; + +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gui.CtuluTableModelInterface; +import org.fudaa.ctulu.gui.CtuluWriter; +import org.fudaa.dodico.telemac.io.ScopeSFileFormat; +import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.ebli.courbe.EGAxeHorizontal; +import org.fudaa.ebli.courbe.EGCourbe; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGExportData; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.courbe.EGObject; + +import com.memoire.bu.BuFileFilter; + +public class FudaaWriterScopeS implements CtuluWriter { + + ScopeSFileFormat format_; + File destination_; + ScopeStructure.SorT structure_; + String extension_ = ".scopS"; + BuFileFilter filter_; + + + public FudaaWriterScopeS(){ + format_ = ScopeSFileFormat.getInstance(); + filter_ = format_.createFileFilter(); + + } + + public BuFileFilter getFilter() { + return filter_; + } + + public String getMostPopularExtension() { + return extension_; + } + + public void setFile(File _f) { + destination_ = _f; + + } + + public void setModel(CtuluTableModelInterface _model) { + + structure_ = new ScopeStructure.SorT(); + + //-- data qui contient les courbes choisies --// + EGExportData data = (EGExportData) _model; + EGGraphe graphe_ = data.getGraphe(); + EGCourbe[] liste=data.getCourbes(); + + //-- on ajoute la var des x, debut de chaque ligne de valeurs --// + structure_.addVariable("X"); + //--on ajoute tous les x donn\xE9s de la courbe--// + + + final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); + for (int i = liste.length - 1; i >= 0; i--) { + final EGCourbe c = liste[i]; + for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { + final double x = c.getModel().getX(j); + if ( (h.containsPoint(x))) { + //-- on ajoute le x pour les variables x --// + structure_.addValueForVariable(x,0); + } + } + } + + + for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { + final EGObject ci = graphe_.getModel().getEGObject(i); + if (ci instanceof EGGroup) { + EGGroup groupe = (EGGroup) ci; + + structure_.addVariable(groupe.getTitle()); + + for (int k = 0; k < groupe.getChildCount(); k++) { + EGCourbeChild courbe = groupe.getCourbeAt(k); + + boolean selected = false; + for (int j = 0; !selected && j < liste.length; j++) + if (liste[j] == courbe) + selected = true; + + if (selected) { + // --ajout des valeurs pour chaque X--/ + for (int g = 0; g < structure_.getAllX().size(); g++) { + //-- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis --// + double x = structure_.getX(g); + double yInterpole = courbe.interpol(x); + structure_.addValueForVariable(yInterpole, structure_.getNbVariables() - 1); + } + + } + } + + + + } + + } + + + + } + + public void write(ProgressionInterface _p) throws IOException, WriteException { + format_.getLastVersionInstance(null).write(destination_, structure_, null); + + } + + public boolean allowFormatData() { + return true; + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaCommonImplementation.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaCommonImplementation.java 2008-09-25 20:31:07 UTC (rev 3987) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/impl/FudaaCommonImplementation.java 2008-09-26 09:28:40 UTC (rev 3988) @@ -45,10 +45,6 @@ import javax.swing.plaf.InternalFrameUI; import javax.swing.plaf.basic.BasicInternalFrameUI; -import com.memoire.bu.*; -import com.memoire.fu.Fu; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.CtuluExportDataInterface; import org.fudaa.ctulu.CtuluIOOperationSynthese; @@ -65,12 +61,10 @@ import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.ctulu.image.CtuluImageExport; import org.fudaa.ctulu.image.CtuluImageProducer; - import org.fudaa.ebli.impression.EbliFillePrevisualisation; import org.fudaa.ebli.impression.EbliMiseEnPageDialog; import org.fudaa.ebli.impression.EbliMiseEnPagePreferencesPanel; import org.fudaa.ebli.impression.EbliPageable; - import org.fudaa.fudaa.commun.FudaaAstuces; import org.fudaa.fudaa.commun.FudaaAstucesAbstract; import org.fudaa.fudaa.commun.FudaaBrowserControl; @@ -83,6 +77,35 @@ import org.fudaa.fudaa.commun.undo.FudaaUndoCmdMngListener; import org.fudaa.fudaa.ressource.FudaaResource; +import com.memoire.bu.BuAbstractPreferencesPanel; +import com.memoire.bu.BuBrowserPreferencesPanel; +import com.memoire.bu.BuButton; +import com.memoire.bu.BuColumn; +import com.memoire.bu.BuCommonImplementation; +import com.memoire.bu.BuDesktopPreferencesPanel; +import com.memoire.bu.BuDialogWarning; +import com.memoire.bu.BuGlassPaneStop; +import com.memoire.bu.BuInformationsSoftware; +import com.memoire.bu.BuInsets; +import com.memoire.bu.BuLanguagePreferencesPanel; +import com.memoire.bu.BuLib; +import com.memoire.bu.BuLookPreferencesPanel; +import com.memoire.bu.BuMainPanel; +import com.memoire.bu.BuMenu; +import com.memoire.bu.BuMenuBar; +import com.memoire.bu.BuMenuInterface; +import com.memoire.bu.BuMenuItem; +import com.memoire.bu.BuPreferences; +import com.memoire.bu.BuPreferencesDialog; +import com.memoire.bu.BuPreferencesMainPanel; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuTask; +import com.memoire.bu.BuToolBar; +import com.memoire.bu.BuToolButton; +import com.memoire.bu.BuUserPreferencesPanel; +import com.memoire.fu.Fu; +import com.memoire.fu.FuLog; + /** * @author deniger * @version $Id: FudaaCommonImplementation.java,v 1.10 2007-06-11 13:08:24 deniger Exp $ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-25 20:31:19
|
Revision: 3987 http://fudaa.svn.sourceforge.net/fudaa/?rev=3987&view=rev Author: deniger Date: 2008-09-25 20:31:07 +0000 (Thu, 25 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphe.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestEGGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 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-09-25 19:42:20 UTC (rev 3986) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphe.java 2008-09-25 20:31:07 UTC (rev 3987) @@ -53,7 +53,7 @@ * @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); @@ -123,9 +123,7 @@ } private void computeXRange() { - if (xRange_ != null) { - return; - } + if (xRange_ != null) { return; } xRange_ = new CtuluRange(); final EGGrapheModel m = getModel(); if (FuLog.isDebug()) { @@ -247,7 +245,11 @@ public void componentShown(final ComponentEvent _e) {} - public EGMarges computeMarges(Graphics2D _gr ) { + public EGMarges computeMarges() { + return computeMarges((Graphics2D) getGraphics()); + } + + public EGMarges computeMarges(Graphics2D _gr) { final EGMarges m = new EGMarges(); final EGAxeHorizontal xaxe = transformer_.getXAxe(); if (xaxe == null) { @@ -330,9 +332,7 @@ } public void dessine(final Graphics _g, final int _w, final int _h, final boolean _fill) { - if (!isVisible()) { - return; - } + if (!isVisible()) { return; } final Graphics2D g2d = (Graphics2D) _g; BuLib.setAntialiasing(g2d); final Color old = _g.getColor(); @@ -348,7 +348,7 @@ g2d.setColor(Color.black); final EGGrapheModel model = getModel(); final int nbElement = model.getNbEGObject(); - transformer_.initFor(g2d,this); + transformer_.initFor(g2d, this); // dessine axe horizontal final Shape oldClip = g2d.getClip(); // g2d.clip(new Rectangle(xMarge, yMarge, wMarge, hMarge)); @@ -403,9 +403,7 @@ final EGAxeVertical v = (EGAxeVertical) iterator.key(); v.dessine(g2d, transformer_, iterator.value()); } - if (transformer_.getXAxe() == null) { - return; - } + if (transformer_.getXAxe() == null) { return; } transformer_.getXAxe().dessine(g2d, transformer_); g2d.setColor(old); @@ -459,9 +457,9 @@ } public void setModel(EGGrapheModel model) { - model_ = model; + model_ = model; } - + public EGObject getObject(final int _i) { return getModel().getEGObject(_i); } @@ -471,9 +469,7 @@ } public int getOffSet(final EGAxeVertical _axe) { - if (axeOffset_ != null) { - return axeOffset_.get(_axe); - } + if (axeOffset_ != null) { return axeOffset_.get(_axe); } return 0; } @@ -526,9 +522,7 @@ public boolean isVerticalAxisConfigurationMod(final EGObject[] _o) { if (objectInitAxe_ != null && _o != null && _o.length > 0) { for (int i = _o.length - 1; i >= 0; i--) { - if (objectInitAxe_.containsKey(_o[i])) { - return true; - } + if (objectInitAxe_.containsKey(_o[i])) { return true; } } } return false; @@ -565,9 +559,7 @@ public void restore() { updateRepere(); - if (transformer_.getXAxe() == null) { - return; - } + if (transformer_.getXAxe() == null) { return; } restoreAxeX(); final Map axeYRange = new HashMap(); final EGGrapheModel m = getModel(); @@ -629,7 +621,7 @@ } public void setRapide(final boolean _b) { - // on ne fait rien + // on ne fait rien } public final void setUserXRange(final CtuluRange _rangeSpecByUser) { @@ -746,9 +738,7 @@ } public void useOneAxe(final EGAxeVertical[] _axes, final String _s, final CtuluRange _r) { - if (_axes == null || _axes.length < 2) { - return; - } + if (_axes == null || _axes.length < 2) { return; } final EGAxeVertical newAxe = new EGAxeVertical(_axes[0]); String t = _s; if (_s == null) { @@ -829,7 +819,7 @@ final BufferedImage i = CtuluLibImage.createImage(_w, _h, _params); final Graphics2D g2d = i.createGraphics(); CtuluLibImage.setBestQuality(g2d); - if(CtuluLibImage.mustFillBackground(_params)){ + if (CtuluLibImage.mustFillBackground(_params)) { g2d.setColor(Color.WHITE); g2d.fillRect(0, 0, _w, _h); } @@ -856,7 +846,7 @@ final int width = (int) (transformer_.getWSansMarges() * factor / 2); final int height = (int) (transformer_.getHSansMarges() * factor / 2); /* - * int width = (int) (factor * getWidth() / 2); int height = (int) (factor * getHeight() / 2); + * int width = (int) (factor getWidth() / 2); int height = (int) (factor getHeight() / 2); */setZoomOn(new Point(x + width, y + height), new Point(x - width, y - height)); } @@ -867,63 +857,55 @@ } public EGGraphe duplicate() { - EGGrapheDuplicator duplicator=new EGGrapheDuplicator(); + EGGrapheDuplicator duplicator = new EGGrapheDuplicator(); EGGraphe duplic = new EGGraphe(this.getModel().duplicate(duplicator)); duplic.autoRestore_ = this.autoRestore_; duplic.cache_ = null; - //on ne partage pas les undo/redo + // on ne partage pas les undo/redo duplic.cmd_ = new CtuluCommandManager(); - //TODO: il y a soucis: les axes verticaux sont dupliqu\xE9 de partout et on n'a plus les ref + // TODO: il y a soucis: les axes verticaux sont dupliqu\xE9 de partout et on n'a plus les ref // -- copie des axes --// - if(this.axeOffset_!=null){ - duplic.axeOffset_=new TObjectIntHashMap(); - int[] values=this.axeOffset_.getValues(); - Object[] liste=this.axeOffset_.keys(); + 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(duplicator.duplicateAxeV(axe), value); } } - duplic.coeffLarger_=this.coeffLarger_; + 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();) { - Object objet = it.next(); + + Set set = this.objectInitAxe_.keySet(); + Object[] vals = this.objectInitAxe_.values().toArray(); + int cpt = 0; + for (Iterator it = set.iterator(); it.hasNext();) { + Object objet = it.next(); if (objet instanceof EGAxeVertical) { - EGAxeVertical axe = (EGAxeVertical) objet; - duplic.objectInitAxe_.put(duplicator.duplicateAxeV(axe), vals[cpt++]); - } + EGAxeVertical axe = (EGAxeVertical) objet; + duplic.objectInitAxe_.put(duplicator.duplicateAxeV(axe), vals[cpt++]); + } // else if (objet instanceof meshviewer.profile.MvProfileCourbeGroup) { // meshviewer.profile.MvProfileCourbeGroup profcourbe = objet; // // } - - - else if (objet instanceof EGGroup) { - EGGroup groupe = (EGGroup) objet; - duplic.objectInitAxe_.put(groupe.duplicate(duplicator), vals[cpt++]); - } - } - if (this.xRange_ != null) - duplic.xRange_ = new CtuluRange(this.xRange_); - if (this.transformer_ != null) - duplic.transformer_ = this.transformer_.duplicate(duplicator); - if (this.xRangeSpecByUser_ != null) - duplic.xRangeSpecByUser_ = new CtuluRange(this.xRangeSpecByUser_); + else if (objet instanceof EGGroup) { + EGGroup groupe = (EGGroup) objet; + duplic.objectInitAxe_.put(groupe.duplicate(duplicator), vals[cpt++]); + } + } + if (this.xRange_ != null) duplic.xRange_ = new CtuluRange(this.xRange_); + if (this.transformer_ != null) duplic.transformer_ = this.transformer_.duplicate(duplicator); + if (this.xRangeSpecByUser_ != null) duplic.xRangeSpecByUser_ = new CtuluRange(this.xRangeSpecByUser_); - - -} + } return duplic; } - } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestEGGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestEGGraphe.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestEGGraphe.java 2008-09-25 20:31:07 UTC (rev 3987) @@ -0,0 +1,157 @@ +/** + * @creation 21 juin 2004 + * @modification $Date: 2007-01-17 10:45:17 $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.ebli.all; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; + +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JTree; +import javax.swing.WindowConstants; + +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuPanel; +import com.memoire.bu.BuScrollPane; + +import org.fudaa.ctulu.iterator.LogarithmicNumberIterator; + +import org.fudaa.ebli.courbe.EGAxeHorizontal; +import org.fudaa.ebli.courbe.EGAxeVertical; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGCourbeModelDefault; +import org.fudaa.ebli.courbe.EGFillePanel; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.trace.TraceLigne; +import org.fudaa.ebli.trace.TraceLigneModel; + +/** + * @author Fred Deniger + * @version $Id: TestGraphe2.java,v 1.8 2007-01-17 10:45:17 deniger Exp $ + */ +public final class TestEGGraphe { + + private TestEGGraphe() { + super(); + } + + /** + * @param _args non utilise + */ + public static void main(final String[] _args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + launch(); + } + }); + + } + + private static void launch() { + final EGGrapheTreeModel grapheModel = new EGGrapheTreeModel(); + final EGGraphe g = new EGGraphe(grapheModel); + final EGAxeHorizontal x = new EGAxeHorizontal(false); + x.setTitre("temps"); + x.setUnite("sec"); + x.setBounds(0.0001, 1000000); + x.setAxisIterator(new LogarithmicNumberIterator()); + x.setGraduations(true); + g.setXAxe(x); + EGGroup gr = new EGGroup(); + gr.setTitle("gr 1"); + EGCourbeModelDefault m = new EGCourbeModelDefault(new double[] { 0.0001, 3, 4, 1000000 }, new double[] { 10000, 4, + 5, 3 }); + EGCourbeChild c = new EGCourbeChild(gr); + m.setTitle("toto bleue"); + c.setModel(m); + c.setAspectContour(Color.cyan); + + gr.addEGComponent(c); + + m = new EGCourbeModelDefault(new double[] { 0.0002, 5, 7, 900000 }, new double[] { 0.001, 1, 3, 4 }); + c = new EGCourbeChild(gr); + c.setAspectContour(Color.RED); + m.setTitle("toto rouge"); + c.setModel(m); + + gr.addEGComponent(c); + + EGAxeVertical y = new EGAxeVertical(); + y.setGraduations(true); + y.setGrille(new TraceLigneModel(TraceLigne.LISSE, 1, Color.LIGHT_GRAY)); + y.setDroite(true); + y.setAxisIterator(new LogarithmicNumberIterator()); + y.setBounds(0.0001, 10000); + y.setLineColor(Color.blue); + y.setTitre("essai 2"); + gr.setAxeY(y); + grapheModel.add(gr); + gr = new EGGroup(); + gr.setTitle("gr 2"); + m = new EGCourbeModelDefault(new double[] { 1, 8, 9, 10 }, new double[] { 10, 4, 2, 24 }); + c = new EGCourbeChild(gr); + c.setAspectContour(Color.yellow); + m.setTitle("toto jaune"); + c.setModel(m); + gr.addEGComponent(c); + y = new EGAxeVertical(); + y.setGraduations(true); + y.setBounds(0, 55); + y.setTitre("essai 1"); + gr.setAxeY(y); + gr.addEGComponent(c); + m = new EGCourbeModelDefault(new double[] { 1, 3, 4, 5 }, new double[] { 14, 54, 25, 43 }); + c = new EGCourbeChild(gr); + m.setTitle("toto vert"); + c.setAspectContour(Color.green); + c.setModel(m); + gr.addEGComponent(c); + grapheModel.add(gr); + final JFrame f = new JFrame(); + f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + final BuPanel p = new BuPanel(); + p.setLayout(new BuBorderLayout()); + + g.setPreferredSize(new Dimension(200, 300)); + g.setSize(g.getPreferredSize()); + final JTree t = new JTree(grapheModel); + t.setSelectionModel(grapheModel.getSelectionModel()); + t.setRootVisible(false); + p.add(new BuScrollPane(t), BuBorderLayout.EAST); + p.doLayout(); + f.setContentPane(p); + final EGFillePanel pn = new EGFillePanel(g); + + p.add(pn, BuBorderLayout.CENTER); + final JMenu menu = new JMenu(); + menu.setName("essai"); + menu.setText("essai"); + pn.fillSpecificMenu(menu); + final JMenuBar b = new JMenuBar(); + b.add(menu); + f.setJMenuBar(b); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + f.pack(); + f.setVisible(true); + g.axeUpdated(); + g.fullRepaint(); + +// EventQueue.invokeLater(new Runnable() { +// public void run() { +// g.axeUpdated(); +// // g.restore(); +// +// } +// }); + } +} \ No newline at end of file Copied: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java (from rev 3965, branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 2008-09-25 20:31:07 UTC (rev 3987) @@ -0,0 +1,486 @@ +/** + * @creation 21 juin 2004 + * @modification $Date: 2007-01-17 10:45:17 $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.ebli.all; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.event.ActionEvent; + +import javax.swing.Box; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JToolBar; +import javax.swing.JTree; +import javax.swing.WindowConstants; +import javax.swing.table.DefaultTableModel; + +import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.CtuluUIDefault; +import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.iterator.LogarithmicNumberIterator; +import org.fudaa.ebli.calque.BCalqueLegende; +import org.fudaa.ebli.calque.BVueCalque; +import org.fudaa.ebli.calque.ZCalqueLigneBrisee; +import org.fudaa.ebli.calque.ZEbliCalquesPanel; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.courbe.EGAxeHorizontal; +import org.fudaa.ebli.courbe.EGAxeVertical; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGCourbeModelDefault; +import org.fudaa.ebli.courbe.EGFillePanel; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.trace.TraceLigne; +import org.fudaa.ebli.trace.TraceLigneModel; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorDblFleche; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorFleche; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorShape; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorTextEditor; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorTextLabel; +import org.fudaa.ebli.visuallibrary.EbliWidgetDBLFleche; +import org.fudaa.ebli.visuallibrary.EbliWidgetShape; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionAlign; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionBackGround; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionColorBackground; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionColorForeground; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionConfigure; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionDuplicate; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionFont; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionForeGround; +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.EbliWidgetCreatorVueCalque; +import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorCircle; +import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorEllipse; +import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorFleche; +import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; +import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorLegende; +import org.fudaa.ebli.visuallibrary.tree.EbliWidgetJXTreeTableModel; +import org.jdesktop.swingx.JXTreeTable; +import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.border.BorderFactory; +import org.netbeans.api.visual.model.ObjectState; +import org.netbeans.api.visual.widget.ComponentWidget; + +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuPanel; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuScrollPane; + +/** + * @author Fred Deniger + * @version $Id: TestGraphe2.java,v 1.8 2007-01-17 10:45:17 deniger Exp $ + */ +public final class TestVisualLibrary { + + private TestVisualLibrary() { + super(); + } + + private static EGGraphe createGraphe() { + final EGGrapheTreeModel grapheModel = new EGGrapheTreeModel(); + final EGGraphe g = new EGGraphe(grapheModel); + final EGAxeHorizontal x = new EGAxeHorizontal(false); + x.setTitre("temps"); + x.setUnite("sec"); + x.setBounds(0.0001, 1000000); + x.setAxisIterator(new LogarithmicNumberIterator()); + x.setGraduations(true); + g.setXAxe(x); + EGGroup gr = new EGGroup(); + gr.setTitle("gr 1"); + EGCourbeModelDefault m = new EGCourbeModelDefault(new double[] { 0.0001, 3, 4, 1000000 }, new double[] { 10000, 4, + 5, 3 }); + EGCourbeChild c = new EGCourbeChild(gr); + m.setTitle("toto bleue"); + c.setModel(m); + c.setAspectContour(Color.cyan); + + gr.addEGComponent(c); + + m = new EGCourbeModelDefault(new double[] { 0.0002, 5, 7, 900000 }, new double[] { 0.001, 1, 3, 4 }); + c = new EGCourbeChild(gr); + c.setAspectContour(Color.RED); + m.setTitle("toto rouge"); + c.setModel(m); + + gr.addEGComponent(c); + + EGAxeVertical y = new EGAxeVertical(); + y.setGraduations(true); + y.setGrille(new TraceLigneModel(TraceLigne.LISSE, 1, Color.LIGHT_GRAY)); + y.setDroite(true); + y.setAxisIterator(new LogarithmicNumberIterator()); + y.setBounds(0.0001, 10000); + y.setLineColor(Color.blue); + y.setTitre("essai 2"); + gr.setAxeY(y); + grapheModel.add(gr); + gr = new EGGroup(); + gr.setTitle("gr 2"); + m = new EGCourbeModelDefault(new double[] { 1, 8, 9, 10 }, new double[] { 10, 4, 2, 24 }); + c = new EGCourbeChild(gr); + c.setAspectContour(Color.yellow); + m.setTitle("toto jaune"); + c.setModel(m); + gr.addEGComponent(c); + y = new EGAxeVertical(); + y.setGraduations(true); + y.setBounds(0, 55); + y.setTitre("essai 1"); + gr.setAxeY(y); + gr.addEGComponent(c); + m = new EGCourbeModelDefault(new double[] { 1, 3, 4, 5 }, new double[] { 14, 54, 25, 43 }); + c = new EGCourbeChild(gr); + m.setTitle("toto vert"); + c.setAspectContour(Color.green); + c.setModel(m); + gr.addEGComponent(c); + grapheModel.add(gr); + return g; + } + + /** + * @param _args + * non utilise + */ + public static void main(final String[] _args) { + EGGraphe g = createGraphe(); + final EGFillePanel pn = new EGFillePanel(g); + + // creation de la scene EBLI + final EbliScene scene = new EbliScene(); + + // -- construction du jtree + + // etape 1 construction du model + // EbliWidgetJXTreeModel model = new EbliWidgetJXTreeModel(1/* ,scene */); + + // etape 2 SUPER IMPORTANT: ajout du model comme listener de la scene + // scene.addEbliNodeListener(model); + + // etape 3 creation du jtree + + // tree.setCellEditor(new EbliCheckBoxNodeEditor(tree)); + // tree.setEditable(true); + + // -- creation d un noeud Graphe --// + final EbliNodeDefault nodeG = new EbliNodeDefault(); + nodeG.setCreator(new EbliWidgetCreatorGraphe(g)); + nodeG.setTitle("Graphe"); + nodeG.setPreferedSize(new Dimension(200, 250)); + nodeG.setPreferedLocation(new Point(12, 420)); + scene.addNode(nodeG); + + EbliNodeDefault node; + // -- creation d un noeud legende --// + EbliNodeDefault nodeLegende = new EbliNodeDefault(); + nodeLegende.setTitle("Legende"); + nodeLegende.setCreator(new EbliWidgetCreatorLegende(g)); + nodeLegende.setPreferedSize(new Dimension(100, 100)); + nodeLegende.setPreferedLocation(new Point(4, 270)); + scene.addNode(nodeLegende); + + // -- creation de la vue calque + final TestModelLigneBrisee m = TestModelLigneBrisee.buildDefault(); + ZCalqueLigneBrisee br = new ZCalqueLigneBrisee(m); + br.setTitle("test"); + br.setLineModel(0, new TraceLigneModel(TraceLigne.LISSE, 5, Color.RED)); + BVueCalque vueC = new BVueCalque(br); + vueC.setSize(new Dimension(200, 200)); + final EbliNodeDefault nodeCalque = new EbliNodeDefault(); + nodeCalque.setTitle("Vue Calque"); + nodeCalque.setPreferedSize(new Dimension(400, 200)); + nodeCalque.setPreferedLocation(new Point(250, 170)); + // JFrame fr = new JFrame(); + + ZEbliCalquesPanel ebliCalquesPanel = new ZEbliCalquesPanel(br, new CtuluUIDefault()); + // fr.setContentPane(ebliCalquesPanel); + // ebliCalquesPanel.setPreferredSize(new Dimension(400, 400)); + // fr.setPreferredSize(new Dimension(400, 400)); + // fr.setVisible(true); + nodeCalque.setCreator(new EbliWidgetCreatorVueCalque(ebliCalquesPanel)); + scene.addNode(nodeCalque); + // scene.addChild(new ComponentWidget(scene, + // test.getVisuPanel().getVueCalque())); + + // -- ajout du rectangle --// + final EbliNodeDefault nodeRect = new EbliNodeDefault(); + nodeRect.setTitle("Rectangle"); + nodeRect.setCreator(new EbliWidgetCreatorTextLabel("Test recangle")); + nodeRect.setPreferedSize(new Dimension(200, 100)); + nodeRect.setPreferedLocation(new Point(350, 125)); + scene.addNode(nodeRect); + + // -- ajout du fleche double sens diagonale--// + node = new EbliNodeDefault(); + node.setTitle("Fleche Double"); + node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_DIAG1)); + node.setPreferedSize(new Dimension(100, 100)); + node.setPreferedLocation(new Point(450, 125)); + scene.addNode(node); + + // -- ajout du fleche double sens nord--// + final EbliNodeDefault nodeDbl = new EbliNodeDefault(); + nodeDbl.setTitle("Fleche Double"); + nodeDbl.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_WEST)); + nodeDbl.setPreferedSize(new Dimension(100, 100)); + nodeDbl.setPreferedLocation(new Point(450, 125)); + scene.addNode(nodeDbl); + + // -- ajout du fleche sens unique--// + final EbliNodeDefault nodeFleche = new EbliNodeDefault(); + nodeFleche.setTitle("Fleche"); + nodeFleche.setCreator(new EbliWidgetCreatorFleche(0)); + nodeFleche.setPreferedSize(new Dimension(100, 100)); + nodeFleche.setPreferedLocation(new Point(250, 525)); + scene.addNode(nodeFleche); + + EbliWidget widget = nodeFleche.getWidget(); + widget.removeFromParent(); + node.getWidget().addChild(widget); + + EbliNodeDefault nodeShape = new EbliNodeDefault(); + nodeShape.setTitle("Shape fleche"); + nodeShape.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorFleche())); + nodeShape.setPreferedSize(new Dimension(100, 100)); + nodeShape.setPreferedLocation(new Point(250, 225)); + scene.addNode(nodeShape); + + ((EbliWidgetShape) nodeShape.getWidget()).setRotation(Math.PI / 2); + ((EbliWidgetShape) nodeShape.getWidget()).repaint(); + scene.refresh(); + + nodeShape = new EbliNodeDefault(); + nodeShape.setTitle("Shape cercle"); + nodeShape.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorCircle())); + nodeShape.setPreferedSize(new Dimension(100, 100)); + nodeShape.setPreferedLocation(new Point(270, 225)); + scene.addNode(nodeShape); + scene.refresh(); + + + nodeShape = new EbliNodeDefault(); + nodeShape.setTitle("Shape cercle"); + nodeShape.setCreator(new EbliWidgetCreatorTextEditor(new CtuluHtmlEditorPanel())); + nodeShape.setPreferedSize(new Dimension(400, 400)); + nodeShape.setPreferedLocation(new Point(370, 225)); + scene.addNode(nodeShape); + scene.refresh(); + + nodeShape = new EbliNodeDefault(); + nodeShape.setTitle("Shape Elipse"); + nodeShape.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorEllipse())); + nodeShape.setPreferedSize(new Dimension(100, 100)); + nodeShape.setPreferedLocation(new Point(290, 225)); + scene.addNode(nodeShape); + + scene.refresh(); + /* + * nodeLegende = new EbliNodeDefault(); + * nodeLegende.setTitle("Legende calque"); + * + * nodeLegende.setCreator(new EbliWidgetCreatorCalqueLegende(new + * BCalqueLegende().getLegendePanel(0))); nodeLegende.setPreferedSize(new + * Dimension(200, 100)); nodeLegende.setPreferedLocation(new Point(10, 10)); + * // ajout du node au scene.addNode(nodeLegende); + * + * scene.refresh(); + */ + // node.getWidget().setState(state) + // if(node.getWidget().) + + // WidgetLegendeManagerOLD.createWidgetLegendeGraphe(this, visu, courbe, + // graphe.getClientArea()); + + /* + * // ajout iconenode IconNodeWidget iconNode = new IconNodeWidget(scene); + * iconNode.setImage(CtuluResource.CTULU.getImage("crystal_non")); + * iconNode.setLabel("MyIconNode"); // this.addChild (iconNode); + * iconNode.getActions().addAction( + * ActionFactory.createCenteredZoomAction(1.1)); + * iconNode.getActions().addAction(ActionFactory.createPanAction()); // + * assign HoverAction - the actual hovered widget is held by the scene + * iconNode.getActions().addAction(scene.createWidgetHoverAction()); // + * MoveAction has to be after the hover action // otherwise MoveAction will + * always consume the event and HoverAction // will never be invoked + * iconNode.getActions().addAction(ActionFactory.createMoveAction()); + * iconNode.setPreferredLocation(new Point(400, 150)); + */ + + JTable table = new JTable(); + table.setModel(new DefaultTableModel(new Object[][] { { "11", "12" }, { "21", "22" } }, new Object[] { "First", + "Second" })); + ComponentWidget widgetJtable = new ComponentWidget(scene, new JScrollPane(table)) { + public void notifyStateChanged(ObjectState previousState, ObjectState newState) { + + setBorder(BorderFactory.createResizeBorder(10)); + + } + }; + widgetJtable.setBorder(BorderFactory.createResizeBorder(10)); + widgetJtable.setPreferredLocation(new Point(500, 300)); + widgetJtable.getActions().addAction(ActionFactory.createResizeAction()); + // scene.addChild(widgetJtable); + + final JFrame f = new JFrame(); + f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + f.setSize(new Dimension(1024, 768)); + final BuPanel p = new BuPanel(); + p.setLayout(new BuBorderLayout()); + EbliWidgetJXTreeTableModel tree = new EbliWidgetJXTreeTableModel(scene); + + JXTreeTable view = new JXTreeTable(tree); + + +// view.setTreeCellRenderer(EbliWidgetCellRendererBuilder.getNodeIconCellRenderer()); + p.add(new JScrollPane(view), BuBorderLayout.WEST); + g.setPreferredSize(new Dimension(200, 300)); + g.setSize(g.getPreferredSize()); + final JTree t = new JTree((EGGrapheTreeModel) g.getModel()); + t.setSelectionModel(((EGGrapheTreeModel) g.getModel()).getSelectionModel()); + t.setRootVisible(false); + + Box boxEast = Box.createVerticalBox(); + boxEast.add(new BuScrollPane(t)); + p.add(new JScrollPane(boxEast), BuBorderLayout.EAST); + f.setLayout(new BorderLayout()); + + // f.setContentPane(p); + f.add(p, BorderLayout.CENTER); + // fin + p.add(new JScrollPane(scene.createView()), BuBorderLayout.CENTER); + + // ajout de la vue sattelite en bas \xE4 gauche + boxEast.add(scene.createSatelliteView()); + + final JMenu menu = new JMenu(); + menu.setName("essai"); + menu.setText("essai"); + pn.fillSpecificMenu(menu); + final JMenuBar b = new JMenuBar(); + b.add(menu); + f.setJMenuBar(b); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + // f.pack(); + f.setVisible(true); + scene.setFont(CtuluLibSwing.getMiniFont()); + + // -- ajout par la suite --/ + /* + * node = new EbliNodeDefault(); node.setTitle("BOUDOUM"); + * node.setCreator(new EbliWidgetCreatorRectangle("BOUDOUM")); + * + * node.setD(new Dimension(100, 100)); node.setP(new Point(450,20)); + * scene.addNode(node); + */ + + JToolBar bar = new JToolBar(); + f.add(bar, BorderLayout.PAGE_START); + // om met en place le undo/redo + scene.setCmdMng(new CtuluCommandManager()); + bar.add(new EbliActionSimple("undo", BuResource.BU.getToolIcon("defaire"), "UNDO") { + @Override + public void actionPerformed(ActionEvent _e) { + if (scene.getCmdMng().canUndo()) scene.getCmdMng().undo(); + } + }); + bar.add(new EbliActionSimple("redo", BuResource.BU.getToolIcon("refaire"), "REDO") { + @Override + public void actionPerformed(ActionEvent _e) { + if (scene.getCmdMng().canRedo()) scene.getCmdMng().redo(); + } + }); + bar.addSeparator(); + bar.add(new EbliWidgetActionAlign.Left(scene)); + bar.add(new EbliWidgetActionAlign.Right(scene)); + bar.add(new EbliWidgetActionAlign.Middle(scene)); + bar.add(new EbliWidgetActionAlign.Center(scene)); + bar.add(new EbliWidgetActionAlign.Top(scene)); + bar.add(new EbliWidgetActionAlign.Bottom(scene)); + + bar.add(new EbliWidgetActionConfigure(scene)); + + /** + * Action qui recupere les noeuds de l arbre selectionnes et indique la + * widget comme target. + */ + /* + * BConfigurePaletteAction action = new + * BConfigurePaletteAction(view.getTreeSelectionModel()) { + * + * protected Object getTarget(final TreeSelectionModel _m) { final + * TreePath[] p = _m.getSelectionPaths(); + * + * if (p != null) { final Object[] targets = new Object[p.length]; // p est + * non null for (int i = p.length - 1; i >= 0; i--) { targets[i] = p[i] == + * null ? null : ((EbliNode) ((EbliWidgetTreeTableNode) + * p[i].getLastPathComponent()) .getUserObject()).getWidget(); + * + * + * FuLog.warning("je suis la target selectionne title: " + + * targets[i].toString()); } + * + * + * + * return targets; } return null; } + * + * }; bar.add(action); + */ + bar = new JToolBar(); + f.add(bar, BorderLayout.PAGE_END); + + bar.add(new EbliWidgetActionDuplicate(scene)); + + bar.add(new EbliWidgetActionForeGround(scene)); + + bar.add(new EbliWidgetActionBackGround(scene)); + + bar.add(new EbliWidgetActionColorForeground(scene)); + + bar.add(new EbliWidgetActionColorBackground.ForScene(scene)); + + bar.add(new EbliWidgetActionRetaillageHorizontal(scene, EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MIN)); + bar.add(new EbliWidgetActionRetaillageHorizontal(scene, EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MAX)); + bar.add(new EbliWidgetActionRetaillageVertical(scene, EbliWidgetActionRetaillageVertical.RETAIILLAGE_MIN)); + bar.add(new EbliWidgetActionRetaillageVertical(scene, EbliWidgetActionRetaillageVertical.RETAIILLAGE_MAX)); + + bar.add(new EbliWidgetActionImageChooser(scene)); + +// bar.add(new EbliWidgetActiontextEditor(scene)); + + + p.doLayout(); + + // -- creation de l action pour les fonts --// + EbliWidgetActionFont actionFont = new EbliWidgetActionFont(scene); + + // -- ajout de la combo des font dans la toolbar --// + bar.add(actionFont.getFonts()); + + bar.add(actionFont.getSizeFonts()); + + + boxEast.add(new BCalqueLegende()); + + + + } +} \ No newline at end of file Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java ___________________________________________________________________ Added: svn:mergeinfo + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-25 19:42:28
|
Revision: 3986 http://fudaa.svn.sourceforge.net/fudaa/?rev=3986&view=rev Author: deniger Date: 2008-09-25 19:42:20 +0000 (Thu, 25 Sep 2008) Log Message: ----------- Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Deleted: 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-09-25 16:48:48 UTC (rev 3985) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-09-25 19:42:20 UTC (rev 3986) @@ -1,486 +0,0 @@ -/** - * @creation 21 juin 2004 - * @modification $Date: 2007-01-17 10:45:17 $ - * @license GNU General Public License 2 - * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail de...@fu... - */ -package org.fudaa.ebli.all; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Point; -import java.awt.event.ActionEvent; - -import javax.swing.Box; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JToolBar; -import javax.swing.JTree; -import javax.swing.WindowConstants; -import javax.swing.table.DefaultTableModel; - -import org.fudaa.ctulu.CtuluCommandManager; -import org.fudaa.ctulu.CtuluUIDefault; -import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; -import org.fudaa.ctulu.gui.CtuluLibSwing; -import org.fudaa.ctulu.iterator.LogarithmicNumberIterator; -import org.fudaa.ebli.calque.BCalqueLegende; -import org.fudaa.ebli.calque.BVueCalque; -import org.fudaa.ebli.calque.ZCalqueLigneBrisee; -import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.commun.EbliActionSimple; -import org.fudaa.ebli.courbe.EGAxeHorizontal; -import org.fudaa.ebli.courbe.EGAxeVertical; -import org.fudaa.ebli.courbe.EGCourbeChild; -import org.fudaa.ebli.courbe.EGCourbeModelDefault; -import org.fudaa.ebli.courbe.EGFillePanel; -import org.fudaa.ebli.courbe.EGGraphe; -import org.fudaa.ebli.courbe.EGGrapheTreeModel; -import org.fudaa.ebli.courbe.EGGroup; -import org.fudaa.ebli.trace.TraceLigne; -import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.ebli.visuallibrary.EbliNodeDefault; -import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.EbliWidget; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorDblFleche; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorFleche; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorShape; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorTextEditor; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorTextLabel; -import org.fudaa.ebli.visuallibrary.EbliWidgetDBLFleche; -import org.fudaa.ebli.visuallibrary.EbliWidgetShape; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionAlign; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionBackGround; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionColorBackground; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionColorForeground; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionConfigure; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionDuplicate; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionFont; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionForeGround; -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.EbliWidgetCreatorVueCalque; -import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorCircle; -import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorEllipse; -import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorFleche; -import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; -import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorLegende; -import org.fudaa.ebli.visuallibrary.tree.EbliWidgetJXTreeTableModel; -import org.jdesktop.swingx.JXTreeTable; -import org.netbeans.api.visual.action.ActionFactory; -import org.netbeans.api.visual.border.BorderFactory; -import org.netbeans.api.visual.model.ObjectState; -import org.netbeans.api.visual.widget.ComponentWidget; - -import com.memoire.bu.BuBorderLayout; -import com.memoire.bu.BuPanel; -import com.memoire.bu.BuResource; -import com.memoire.bu.BuScrollPane; - -/** - * @author Fred Deniger - * @version $Id: TestGraphe2.java,v 1.8 2007-01-17 10:45:17 deniger Exp $ - */ -public final class TestGraphe2 { - - private TestGraphe2() { - super(); - } - - private static EGGraphe createGraphe() { - final EGGrapheTreeModel grapheModel = new EGGrapheTreeModel(); - final EGGraphe g = new EGGraphe(grapheModel); - final EGAxeHorizontal x = new EGAxeHorizontal(false); - x.setTitre("temps"); - x.setUnite("sec"); - x.setBounds(0.0001, 1000000); - x.setAxisIterator(new LogarithmicNumberIterator()); - x.setGraduations(true); - g.setXAxe(x); - EGGroup gr = new EGGroup(); - gr.setTitle("gr 1"); - EGCourbeModelDefault m = new EGCourbeModelDefault(new double[] { 0.0001, 3, 4, 1000000 }, new double[] { 10000, 4, - 5, 3 }); - EGCourbeChild c = new EGCourbeChild(gr); - m.setTitle("toto bleue"); - c.setModel(m); - c.setAspectContour(Color.cyan); - - gr.addEGComponent(c); - - m = new EGCourbeModelDefault(new double[] { 0.0002, 5, 7, 900000 }, new double[] { 0.001, 1, 3, 4 }); - c = new EGCourbeChild(gr); - c.setAspectContour(Color.RED); - m.setTitle("toto rouge"); - c.setModel(m); - - gr.addEGComponent(c); - - EGAxeVertical y = new EGAxeVertical(); - y.setGraduations(true); - y.setGrille(new TraceLigneModel(TraceLigne.LISSE, 1, Color.LIGHT_GRAY)); - y.setDroite(true); - y.setAxisIterator(new LogarithmicNumberIterator()); - y.setBounds(0.0001, 10000); - y.setLineColor(Color.blue); - y.setTitre("essai 2"); - gr.setAxeY(y); - grapheModel.add(gr); - gr = new EGGroup(); - gr.setTitle("gr 2"); - m = new EGCourbeModelDefault(new double[] { 1, 8, 9, 10 }, new double[] { 10, 4, 2, 24 }); - c = new EGCourbeChild(gr); - c.setAspectContour(Color.yellow); - m.setTitle("toto jaune"); - c.setModel(m); - gr.addEGComponent(c); - y = new EGAxeVertical(); - y.setGraduations(true); - y.setBounds(0, 55); - y.setTitre("essai 1"); - gr.setAxeY(y); - gr.addEGComponent(c); - m = new EGCourbeModelDefault(new double[] { 1, 3, 4, 5 }, new double[] { 14, 54, 25, 43 }); - c = new EGCourbeChild(gr); - m.setTitle("toto vert"); - c.setAspectContour(Color.green); - c.setModel(m); - gr.addEGComponent(c); - grapheModel.add(gr); - return g; - } - - /** - * @param _args - * non utilise - */ - public static void main(final String[] _args) { - EGGraphe g = createGraphe(); - final EGFillePanel pn = new EGFillePanel(g); - - // creation de la scene EBLI - final EbliScene scene = new EbliScene(); - - // -- construction du jtree - - // etape 1 construction du model - // EbliWidgetJXTreeModel model = new EbliWidgetJXTreeModel(1/* ,scene */); - - // etape 2 SUPER IMPORTANT: ajout du model comme listener de la scene - // scene.addEbliNodeListener(model); - - // etape 3 creation du jtree - - // tree.setCellEditor(new EbliCheckBoxNodeEditor(tree)); - // tree.setEditable(true); - - // -- creation d un noeud Graphe --// - final EbliNodeDefault nodeG = new EbliNodeDefault(); - nodeG.setCreator(new EbliWidgetCreatorGraphe(g)); - nodeG.setTitle("Graphe"); - nodeG.setPreferedSize(new Dimension(200, 250)); - nodeG.setPreferedLocation(new Point(12, 420)); - scene.addNode(nodeG); - - EbliNodeDefault node; - // -- creation d un noeud legende --// - EbliNodeDefault nodeLegende = new EbliNodeDefault(); - nodeLegende.setTitle("Legende"); - nodeLegende.setCreator(new EbliWidgetCreatorLegende(g)); - nodeLegende.setPreferedSize(new Dimension(100, 100)); - nodeLegende.setPreferedLocation(new Point(4, 270)); - scene.addNode(nodeLegende); - - // -- creation de la vue calque - final TestModelLigneBrisee m = TestModelLigneBrisee.buildDefault(); - ZCalqueLigneBrisee br = new ZCalqueLigneBrisee(m); - br.setTitle("test"); - br.setLineModel(0, new TraceLigneModel(TraceLigne.LISSE, 5, Color.RED)); - BVueCalque vueC = new BVueCalque(br); - vueC.setSize(new Dimension(200, 200)); - final EbliNodeDefault nodeCalque = new EbliNodeDefault(); - nodeCalque.setTitle("Vue Calque"); - nodeCalque.setPreferedSize(new Dimension(400, 200)); - nodeCalque.setPreferedLocation(new Point(250, 170)); - // JFrame fr = new JFrame(); - - ZEbliCalquesPanel ebliCalquesPanel = new ZEbliCalquesPanel(br, new CtuluUIDefault()); - // fr.setContentPane(ebliCalquesPanel); - // ebliCalquesPanel.setPreferredSize(new Dimension(400, 400)); - // fr.setPreferredSize(new Dimension(400, 400)); - // fr.setVisible(true); - nodeCalque.setCreator(new EbliWidgetCreatorVueCalque(ebliCalquesPanel)); - scene.addNode(nodeCalque); - // scene.addChild(new ComponentWidget(scene, - // test.getVisuPanel().getVueCalque())); - - // -- ajout du rectangle --// - final EbliNodeDefault nodeRect = new EbliNodeDefault(); - nodeRect.setTitle("Rectangle"); - nodeRect.setCreator(new EbliWidgetCreatorTextLabel("Test recangle")); - nodeRect.setPreferedSize(new Dimension(200, 100)); - nodeRect.setPreferedLocation(new Point(350, 125)); - scene.addNode(nodeRect); - - // -- ajout du fleche double sens diagonale--// - node = new EbliNodeDefault(); - node.setTitle("Fleche Double"); - node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_DIAG1)); - node.setPreferedSize(new Dimension(100, 100)); - node.setPreferedLocation(new Point(450, 125)); - scene.addNode(node); - - // -- ajout du fleche double sens nord--// - final EbliNodeDefault nodeDbl = new EbliNodeDefault(); - nodeDbl.setTitle("Fleche Double"); - nodeDbl.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_WEST)); - nodeDbl.setPreferedSize(new Dimension(100, 100)); - nodeDbl.setPreferedLocation(new Point(450, 125)); - scene.addNode(nodeDbl); - - // -- ajout du fleche sens unique--// - final EbliNodeDefault nodeFleche = new EbliNodeDefault(); - nodeFleche.setTitle("Fleche"); - nodeFleche.setCreator(new EbliWidgetCreatorFleche(0)); - nodeFleche.setPreferedSize(new Dimension(100, 100)); - nodeFleche.setPreferedLocation(new Point(250, 525)); - scene.addNode(nodeFleche); - - EbliWidget widget = nodeFleche.getWidget(); - widget.removeFromParent(); - node.getWidget().addChild(widget); - - EbliNodeDefault nodeShape = new EbliNodeDefault(); - nodeShape.setTitle("Shape fleche"); - nodeShape.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorFleche())); - nodeShape.setPreferedSize(new Dimension(100, 100)); - nodeShape.setPreferedLocation(new Point(250, 225)); - scene.addNode(nodeShape); - - ((EbliWidgetShape) nodeShape.getWidget()).setRotation(Math.PI / 2); - ((EbliWidgetShape) nodeShape.getWidget()).repaint(); - scene.refresh(); - - nodeShape = new EbliNodeDefault(); - nodeShape.setTitle("Shape cercle"); - nodeShape.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorCircle())); - nodeShape.setPreferedSize(new Dimension(100, 100)); - nodeShape.setPreferedLocation(new Point(270, 225)); - scene.addNode(nodeShape); - scene.refresh(); - - - nodeShape = new EbliNodeDefault(); - nodeShape.setTitle("Shape cercle"); - nodeShape.setCreator(new EbliWidgetCreatorTextEditor(new CtuluHtmlEditorPanel())); - nodeShape.setPreferedSize(new Dimension(400, 400)); - nodeShape.setPreferedLocation(new Point(370, 225)); - scene.addNode(nodeShape); - scene.refresh(); - - nodeShape = new EbliNodeDefault(); - nodeShape.setTitle("Shape Elipse"); - nodeShape.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorEllipse())); - nodeShape.setPreferedSize(new Dimension(100, 100)); - nodeShape.setPreferedLocation(new Point(290, 225)); - scene.addNode(nodeShape); - - scene.refresh(); - /* - * nodeLegende = new EbliNodeDefault(); - * nodeLegende.setTitle("Legende calque"); - * - * nodeLegende.setCreator(new EbliWidgetCreatorCalqueLegende(new - * BCalqueLegende().getLegendePanel(0))); nodeLegende.setPreferedSize(new - * Dimension(200, 100)); nodeLegende.setPreferedLocation(new Point(10, 10)); - * // ajout du node au scene.addNode(nodeLegende); - * - * scene.refresh(); - */ - // node.getWidget().setState(state) - // if(node.getWidget().) - - // WidgetLegendeManagerOLD.createWidgetLegendeGraphe(this, visu, courbe, - // graphe.getClientArea()); - - /* - * // ajout iconenode IconNodeWidget iconNode = new IconNodeWidget(scene); - * iconNode.setImage(CtuluResource.CTULU.getImage("crystal_non")); - * iconNode.setLabel("MyIconNode"); // this.addChild (iconNode); - * iconNode.getActions().addAction( - * ActionFactory.createCenteredZoomAction(1.1)); - * iconNode.getActions().addAction(ActionFactory.createPanAction()); // - * assign HoverAction - the actual hovered widget is held by the scene - * iconNode.getActions().addAction(scene.createWidgetHoverAction()); // - * MoveAction has to be after the hover action // otherwise MoveAction will - * always consume the event and HoverAction // will never be invoked - * iconNode.getActions().addAction(ActionFactory.createMoveAction()); - * iconNode.setPreferredLocation(new Point(400, 150)); - */ - - JTable table = new JTable(); - table.setModel(new DefaultTableModel(new Object[][] { { "11", "12" }, { "21", "22" } }, new Object[] { "First", - "Second" })); - ComponentWidget widgetJtable = new ComponentWidget(scene, new JScrollPane(table)) { - public void notifyStateChanged(ObjectState previousState, ObjectState newState) { - - setBorder(BorderFactory.createResizeBorder(10)); - - } - }; - widgetJtable.setBorder(BorderFactory.createResizeBorder(10)); - widgetJtable.setPreferredLocation(new Point(500, 300)); - widgetJtable.getActions().addAction(ActionFactory.createResizeAction()); - // scene.addChild(widgetJtable); - - final JFrame f = new JFrame(); - f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - f.setSize(new Dimension(1024, 768)); - final BuPanel p = new BuPanel(); - p.setLayout(new BuBorderLayout()); - EbliWidgetJXTreeTableModel tree = new EbliWidgetJXTreeTableModel(scene); - - JXTreeTable view = new JXTreeTable(tree); - - -// view.setTreeCellRenderer(EbliWidgetCellRendererBuilder.getNodeIconCellRenderer()); - p.add(new JScrollPane(view), BuBorderLayout.WEST); - g.setPreferredSize(new Dimension(200, 300)); - g.setSize(g.getPreferredSize()); - final JTree t = new JTree((EGGrapheTreeModel) g.getModel()); - t.setSelectionModel(((EGGrapheTreeModel) g.getModel()).getSelectionModel()); - t.setRootVisible(false); - - Box boxEast = Box.createVerticalBox(); - boxEast.add(new BuScrollPane(t)); - p.add(new JScrollPane(boxEast), BuBorderLayout.EAST); - f.setLayout(new BorderLayout()); - - // f.setContentPane(p); - f.add(p, BorderLayout.CENTER); - // fin - p.add(new JScrollPane(scene.createView()), BuBorderLayout.CENTER); - - // ajout de la vue sattelite en bas \xE4 gauche - boxEast.add(scene.createSatelliteView()); - - final JMenu menu = new JMenu(); - menu.setName("essai"); - menu.setText("essai"); - pn.fillSpecificMenu(menu); - final JMenuBar b = new JMenuBar(); - b.add(menu); - f.setJMenuBar(b); - f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - // f.pack(); - f.setVisible(true); - scene.setFont(CtuluLibSwing.getMiniFont()); - - // -- ajout par la suite --/ - /* - * node = new EbliNodeDefault(); node.setTitle("BOUDOUM"); - * node.setCreator(new EbliWidgetCreatorRectangle("BOUDOUM")); - * - * node.setD(new Dimension(100, 100)); node.setP(new Point(450,20)); - * scene.addNode(node); - */ - - JToolBar bar = new JToolBar(); - f.add(bar, BorderLayout.PAGE_START); - // om met en place le undo/redo - scene.setCmdMng(new CtuluCommandManager()); - bar.add(new EbliActionSimple("undo", BuResource.BU.getToolIcon("defaire"), "UNDO") { - @Override - public void actionPerformed(ActionEvent _e) { - if (scene.getCmdMng().canUndo()) scene.getCmdMng().undo(); - } - }); - bar.add(new EbliActionSimple("redo", BuResource.BU.getToolIcon("refaire"), "REDO") { - @Override - public void actionPerformed(ActionEvent _e) { - if (scene.getCmdMng().canRedo()) scene.getCmdMng().redo(); - } - }); - bar.addSeparator(); - bar.add(new EbliWidgetActionAlign.Left(scene)); - bar.add(new EbliWidgetActionAlign.Right(scene)); - bar.add(new EbliWidgetActionAlign.Middle(scene)); - bar.add(new EbliWidgetActionAlign.Center(scene)); - bar.add(new EbliWidgetActionAlign.Top(scene)); - bar.add(new EbliWidgetActionAlign.Bottom(scene)); - - bar.add(new EbliWidgetActionConfigure(scene)); - - /** - * Action qui recupere les noeuds de l arbre selectionnes et indique la - * widget comme target. - */ - /* - * BConfigurePaletteAction action = new - * BConfigurePaletteAction(view.getTreeSelectionModel()) { - * - * protected Object getTarget(final TreeSelectionModel _m) { final - * TreePath[] p = _m.getSelectionPaths(); - * - * if (p != null) { final Object[] targets = new Object[p.length]; // p est - * non null for (int i = p.length - 1; i >= 0; i--) { targets[i] = p[i] == - * null ? null : ((EbliNode) ((EbliWidgetTreeTableNode) - * p[i].getLastPathComponent()) .getUserObject()).getWidget(); - * - * - * FuLog.warning("je suis la target selectionne title: " + - * targets[i].toString()); } - * - * - * - * return targets; } return null; } - * - * }; bar.add(action); - */ - bar = new JToolBar(); - f.add(bar, BorderLayout.PAGE_END); - - bar.add(new EbliWidgetActionDuplicate(scene)); - - bar.add(new EbliWidgetActionForeGround(scene)); - - bar.add(new EbliWidgetActionBackGround(scene)); - - bar.add(new EbliWidgetActionColorForeground(scene)); - - bar.add(new EbliWidgetActionColorBackground.ForScene(scene)); - - bar.add(new EbliWidgetActionRetaillageHorizontal(scene, EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MIN)); - bar.add(new EbliWidgetActionRetaillageHorizontal(scene, EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MAX)); - bar.add(new EbliWidgetActionRetaillageVertical(scene, EbliWidgetActionRetaillageVertical.RETAIILLAGE_MIN)); - bar.add(new EbliWidgetActionRetaillageVertical(scene, EbliWidgetActionRetaillageVertical.RETAIILLAGE_MAX)); - - bar.add(new EbliWidgetActionImageChooser(scene)); - -// bar.add(new EbliWidgetActiontextEditor(scene)); - - - p.doLayout(); - - // -- creation de l action pour les fonts --// - EbliWidgetActionFont actionFont = new EbliWidgetActionFont(scene); - - // -- ajout de la combo des font dans la toolbar --// - bar.add(actionFont.getFonts()); - - bar.add(actionFont.getSizeFonts()); - - - boxEast.add(new BCalqueLegende()); - - - - } -} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-09-25 16:48:56
|
Revision: 3985 http://fudaa.svn.sourceforge.net/fudaa/?rev=3985&view=rev Author: bmarchan Date: 2008-09-25 16:48:48 +0000 (Thu, 25 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java Property Changed: ---------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-25 15:56:11 UTC (rev 3984) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-25 16:48:48 UTC (rev 3985) @@ -391,34 +391,39 @@ if (_plan==null||_pt==null||_plan.length<3||_plan[0]==null||_plan[1]==null||_plan[2]==null) return null; // On nomme : a, b, c les trois points d\xE9finissant le plan - double xa=_plan[0].getX(), ya=_plan[0].getY(), za=_plan[0].getZ(), - xb=_plan[1].getX(), yb=_plan[1].getY(), zb=_plan[1].getZ(), - xc=_plan[2].getX(), yc=_plan[2].getY(), zc=_plan[2].getZ(); + double xa=_plan[0].getX(), ya=_plan[0].getY(), za=_plan[0].getZ(); + double xb=_plan[1].getX(), yb=_plan[1].getY(), zb=_plan[1].getZ(); + double xc=_plan[2].getX(), yc=_plan[2].getY(), zc=_plan[2].getZ(); // Teste que les trois points d\xE9finissant le plan sont diff\xE9rents if ((xa==xb&&ya==yb&&za==zb)||(xb==xc&&yb==yc&&zb==zc)||(xa==xc&&ya==yc&&za==zc)) return null; // On nomme : i le point \xE0 projeter ; p le point projet\xE9. - double xi=_pt.getX(), yi=_pt.getY(), zi=_pt.getZ(), - xp, yp, zp; + double xi=_pt.getX(); + double yi=_pt.getY(); + double zi=_pt.getZ(); + double xp; + double yp; + double zp; // Calcul du vecteur ab nomm\xE9 v - double xv = xb - xa, - yv = yb - ya, - zv = zb - za; + double xv = xb - xa; + double yv = yb - ya; + double zv = zb - za; // Calcul du vecteur ac nomm\xE9 u - double xu = xc - xa, - yu = yc - ya, - zu = zc - za; + double xu = xc - xa; + double yu = yc - ya; + double zu = zc - za; // Calcul du vecteur w d\xE9fini comme le produit vectoriel entre v et u - double xw = yu*zv - zu*yv, - yw = zu*xv - xu*zv, - zw = xu*yv - yu*xv; + double xw = yu*zv - zu*yv; + double yw = zu*xv - xu*zv; + double zw = xu*yv - yu*xv; // On calcul k qui est d\xE9fini tel que : vecteur(ip) = k * w double k = ((xa+xi)*xw+(ya+yi)*yw+(za+zi)*zw)/(xw*xw+yw*yw+zw*zw); // Calcul des coordonn\xE9es de p xp = xi + k*xw; yp = yi + k*yw; zp = zi + k*zw; - return new GISPoint(xp, yp, zp); + + return (GISPoint)GISGeometryFactory.INSTANCE.createPoint(xp, yp, zp); } public static Envelope computeEnveloppe(final GISDataModel[] _models, final ProgressionInterface _prog) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java 2008-09-25 15:56:11 UTC (rev 3984) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java 2008-09-25 16:48:48 UTC (rev 3985) @@ -25,7 +25,7 @@ /** * @author Fred Deniger - * @version $Id: TestJGIS.java,v 1.6 2007-05-21 10:28:31 deniger Exp $ + * @version $Id$ */ public class TestJGIS extends TestCase { @@ -36,10 +36,15 @@ public void testProjectOnPlane(){ // Cas g\xE9n\xE9ral GISPoint[] plan = {new GISPoint(1, 0, 0), new GISPoint(0, 1, 0), new GISPoint(0, 0, 1)}; - GISPoint result = GISLib.projectOnPlane(plan, new GISPoint(0, 0, 0)); + GISPoint result = GISLib.projectOnPlane(plan, new GISPoint(0., 0., 0.)); assertEquals(result.getX(), 1/3., 0.0000001); assertEquals(result.getY(), 1/3., 0.0000001); assertEquals(result.getZ(), 1/3., 0.0000001); + // Point sur plan : Le point retour est le m\xEAme que le point en entr\xE9e. + GISPoint res2=GISLib.projectOnPlane(plan, result); + assertEquals(result.getX(),res2.getX(), 0.0000001); + assertEquals(result.getY(),res2.getY(), 0.0000001); + assertEquals(result.getZ(),res2.getZ(), 0.0000001); // Test de robustesse : valeur null assertNull(GISLib.projectOnPlane(null, new GISPoint(0, 0, 0))); assertNull(GISLib.projectOnPlane(plan, null)); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-09-25 15:56:19
|
Revision: 3984 http://fudaa.svn.sourceforge.net/fudaa/?rev=3984&view=rev Author: emmanuel_martin Date: 2008-09-25 15:56:11 +0000 (Thu, 25 Sep 2008) Log Message: ----------- correction d'un bug dans l'?\195?\169dition d'une g?\195?\169om?\195?\169trie. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-25 15:22:17 UTC (rev 3983) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2008-09-25 15:56:11 UTC (rev 3984) @@ -526,7 +526,7 @@ add(pnAttrGlobaux, BuBorderLayout.NORTH); // Contruction du model de donn\xE9es commun aux deux repr\xE9sentations GISAttributeDouble zAttr=zone_.getAttributeIsZ(); - if (!(zone_.getGeometry(idx_) instanceof GISPoint)&&zAttr!=null) { + if (!(zone_.getGeometry(idx_) instanceof GISPoint)&&zAttr!=null&&zAttr.isAtomicValue()) { model_=new EbliAtomicCoordinatesTableModel.Line(_xyFormatter, modeleSrc_.getGeomData(), idx_, null, _editVertexAttribut, modeleSrc_); boolean found=false; @@ -551,6 +551,8 @@ add(tabbedPane_, BuBorderLayout.CENTER); } else { + model_=new EbliAtomicCoordinatesTableModel.Line(_xyFormatter, modeleSrc_.getGeomData(), idx_, null, _editVertexAttribut, + modeleSrc_); tableRep_=new TableRepresentation(_editAttribut, _editVertexAttribut, _xyFormatter); add(tableRep_, BuBorderLayout.CENTER); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fa...@us...> - 2008-09-25 15:22:25
|
Revision: 3983 http://fudaa.svn.sourceforge.net/fudaa/?rev=3983&view=rev Author: fargeix Date: 2008-09-25 15:22:17 +0000 (Thu, 25 Sep 2008) Log Message: ----------- Am?\195?\169lioration des interfaces de lecture des r?\195?\169sultats Modified Paths: -------------- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatGenerationBateaux.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleCategories.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleElement.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteTrajet.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsDureesParcours.java Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java 2008-09-25 15:22:02 UTC (rev 3982) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java 2008-09-25 15:22:17 UTC (rev 3983) @@ -696,14 +696,14 @@ r.addMenuItem("Historique", "HISTORIQUETABLEAU", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); - r.addMenuItem("Dur\xE9es de parcours", "GRAPHEDUREEPARCOURS", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); + r.addMenuItem("Dur\xE9es de parcours", "GRAPHEDUREEPARCOURS", FudaaResource.FUDAA.getIcon("crystal_graphe"), false); //r4.addMenuItem("Occupations globales", "TABLEAUOCCUPGLOBAL", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); //r4.addMenuItem("Occupations par quais", "TABLEAUOCCUPQUAI", FudaaResource.FUDAA.getIcon("crystal_graphe"), false); r5.addMenuItem("Attentes par \xE9l\xE9ment", "ATTENTEGENERALESELEMENTTABLEAU", FudaaResource.FUDAA .getIcon("crystal_graphe"), false); - r5.addMenuItem("Attentes par bateau", "ATTENTEGENERALESCATEGORIETABLEAU", FudaaResource.FUDAA + r5.addMenuItem("Attentes par cat\xE9gorie de bateaux", "ATTENTEGENERALESCATEGORIETABLEAU", FudaaResource.FUDAA .getIcon("crystal_graphe"), false); r5.addMenuItem("Attentes par trajet", "ATTENTESPECIALISEE", FudaaResource.FUDAA.getIcon("crystal_graphe"), false); r.addSubMenu(r5, false); Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatGenerationBateaux.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatGenerationBateaux.java 2008-09-25 15:22:02 UTC (rev 3982) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatGenerationBateaux.java 2008-09-25 15:22:17 UTC (rev 3983) @@ -104,7 +104,7 @@ ChartPanel histo3d_; - String titreTableau_[] = { "Cat\xE9gorie", "Nombre de bateaux" }; + String titreTableau_[] = { "Cat\xE9gorie", "Nombre de bateaux g\xE9n\xE9r\xE9s" }; /** * Panel tabbed qui g\xE8re les 2 onglets, ie les 2 versions d'affichage des r\xE9sultats: @@ -117,6 +117,11 @@ BuPanel panelGestionTableau_ = new BuPanel(); /** + * Panel cniotenant le camembert + */ + BuPanel panelCamembert_ = new BuPanel(new BorderLayout()); + + /** * panel de gestion du tableau et des diff\xE9rents boutons */ BuPanel panelTableau_ = new BuPanel(); @@ -132,6 +137,11 @@ BuPanel optionPanel_ = new BuPanel(); /** + * Panel de gestion des boutons du camembert + */ + BuPanel controlPanelCamembert_ = new BuPanel(); + + /** * Panel de gestion des boutons des courbes */ BuPanel controlPanelCourbes_ = new BuPanel(); @@ -159,14 +169,15 @@ /** * buoton de generation des resultats */ - private final BuButton exportationExcel_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "Excel"); + private final BuButton exportationExcel_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "Exporter"); - final BuButton exportationgraphe_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "exportation image"); + final BuButton exportationgraphe_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "Exporter"); - final BuButton exportationHisto_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "exportation image"); - private final BuButton quitter_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "quitter"); - private final BuButton quitter2_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "quitter"); - private final BuButton quitter3_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "quitter"); + final BuButton exportationHisto_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "Exporter"); + private final BuButton quitter_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "Quitter"); + private final BuButton quitter2_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "Quitter"); + private final BuButton quitter3_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "Quitter"); + private final BuButton quitter4_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "Quitter"); Border raisedBevel_ = BorderFactory.createRaisedBevelBorder(); Border loweredBevel_ = BorderFactory.createLoweredBevelBorder(); @@ -181,7 +192,7 @@ * constructeur de la sous fenetre de gestion des resultats: */ Sinavi3ResultatGenerationBateaux(final Sinavi3DataSimulation _donnees) { - super("Generation bateaux", true, true, true, true); + super("Bateaux g\xE9n\xE9r\xE9s", true, true, true, true); // recuperation des donn\xE9es de la simulation donnees_ = _donnees; @@ -208,16 +219,13 @@ - //-- creation des camemberts --// - camembert_= creerCamembert(); - - + //-- creatiion de l'histo 3d --// histo3d_=creerHisto3d(); // ajout du tableau dans le panel tabbed - panelPrincipal_.addTab("tableau", FudaaResource.FUDAA.getIcon("crystal_arbre"), panelGestionTableau_); + panelPrincipal_.addTab("R\xE9sultats d\xE9taill\xE9s", FudaaResource.FUDAA.getIcon("crystal_arbre"), panelGestionTableau_); - panelPrincipal_.addTab("Camembert", FudaaResource.FUDAA.getIcon("crystal_graphe"), camembert_); + panelPrincipal_.addTab("R\xE9partition par cat\xE9gorie", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelCamembert_); @@ -248,13 +256,19 @@ // panel qui contient les differents boutons this.controlPanel_.add(quitter_); - this.controlPanel_.add(new JLabel("Selectionnez la cat\xE9gorie \xE0 visualiser: ")); + this.controlPanel_.add(new JLabel(" Cat\xE9gorie \xE0 visualiser:")); this.controlPanel_.add(this.ListeNavires_); this.controlPanel_.add(exportationExcel_); this.panelGestionTableau_.add(this.controlPanel_, BorderLayout.SOUTH); + + //panel du cammbert + camembert_= creerCamembert(); + this.panelCamembert_.add(camembert_,BorderLayout.CENTER); + this.controlPanelCamembert_.add(quitter4_); + this.panelCamembert_.add(this.controlPanelCamembert_, BorderLayout.SOUTH); // etape 2: remplissage du comboliste avec les noms des navires - this.ListeNavires_.addItem("Tous"); + this.ListeNavires_.addItem("toutes"); for (int i = 0; i < donnees_.listeBateaux_.listeNavires_.size(); i++) { this.ListeNavires_.addItem("" + donnees_.listeBateaux_.retournerNavire(i).nom); } @@ -276,7 +290,7 @@ // bouton qui permet de generer le contenu du tableau en ficheir excel: this.exportationExcel_ - .setToolTipText("permet d'importer le contenu des donn\xE9es dans un fichier excel que l'on pourra par la suite imprimer"); + .setToolTipText("Exporte le contenu du tableau au format xls"); exportationExcel_.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { File fichier; @@ -316,23 +330,22 @@ ******************************************************************************************************************/ // Box panoption=Box.createVerticalBox(); - final JTabbedPane panoption = new JTabbedPane(); + final Box panoption = Box.createVerticalBox(); // panoption.setLayout(new GridLayout(2,1)); // JScrollPane pcnasc=new JScrollPane(panoption); this.optionPanel_.add(panoption); final Box bVert2 = Box.createVerticalBox(); + panoption.add(bVert2); // bVert2.add(new JLabel("Affichage navires:")); // bVert2.setBorder(this.bordnormal_); for (int i = 0; i < this.tableauChoixNavires_.length; i++) { bVert2.add(this.tableauChoixNavires_[i]); } final TitledBorder bordure1 = BorderFactory.createTitledBorder(BorderFactory - .createEtchedBorder(EtchedBorder.LOWERED), "bateaux"); + .createEtchedBorder(EtchedBorder.LOWERED), "Cat\xE9gories"); bVert2.setBorder(bordure1); - final JScrollPane pcnasc = new JScrollPane(bVert2); - panoption.addTab("bateaux", pcnasc); - + this.optionPanel_.setBorder(this.compound_); /******************************************************************************************************************* @@ -351,7 +364,7 @@ this.panelCourbe_.add(this.graphe_, BorderLayout.CENTER); // etape 5: bouton de generation du fichier image - exportationgraphe_.setToolTipText("permet de g\xE9n\xE9rer un fichier image \xE0 partir du graphe"); + exportationgraphe_.setToolTipText("Exporte le graphe au format image"); exportationgraphe_.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { @@ -380,7 +393,7 @@ this.panelHisto_.add(this.histo_, BorderLayout.CENTER); // etape 5: bouton de generation du fichier image - exportationHisto_.setToolTipText("permet de g\xE9n\xE9rer un fichier image \xE0 partir de l'histogramme"); + exportationHisto_.setToolTipText("Exporte l'histogramme au format image"); exportationHisto_.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { @@ -394,9 +407,10 @@ this.panelHisto_.add(this.controlPanelHisto_, BorderLayout.SOUTH); /** listener des boutons quitter */ - this.quitter_.setToolTipText("cliquez sur ce bouton pour fermer la sous fen\xEAtre"); - this.quitter2_.setToolTipText("cliquez sur ce bouton pour fermer la sous fen\xEAtre"); - this.quitter3_.setToolTipText("cliquez sur ce bouton pour fermer la sous fen\xEAtre"); + this.quitter_.setToolTipText("Ferme la sous-fen\xEAtre"); + this.quitter2_.setToolTipText("Ferme la sous-fen\xEAtre"); + this.quitter3_.setToolTipText("Ferme la sous-fen\xEAtre"); + this.quitter4_.setToolTipText("Ferme la sous-fen\xEAtre"); final ActionListener actionQuitter = new ActionListener() { public void actionPerformed(ActionEvent e) { Sinavi3ResultatGenerationBateaux.this.windowClosed(); @@ -405,21 +419,22 @@ this.quitter_.addActionListener(actionQuitter); this.quitter2_.addActionListener(actionQuitter); this.quitter3_.addActionListener(actionQuitter); + this.quitter4_.addActionListener(actionQuitter); // ajout d'un menuBar // petite barre de menu agreable - final JMenuBar menuBar = new JMenuBar(); + /*final JMenuBar menuBar = new JMenuBar(); final JMenu menuFile = new JMenu("Fichier"); final JMenuItem menuFileExit = new JMenuItem("Quitter"); final JMenu menuOption = new JMenu("Options"); - final JMenu menuInfo = new JMenu("A propos de"); + final JMenu menuInfo = new JMenu("A propos de");*/ // menuFile.set.setLabel("Fichier"); // menuOption.setLabel("Options"); // menuFileExit.setLabel("Quitter"); // menuInfo.setLabel("A propos de"); - menuFileExit.addActionListener(new ActionListener() { + /*menuFileExit.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { Sinavi3ResultatGenerationBateaux.this.windowClosed(); } @@ -428,7 +443,7 @@ menuBar.add(menuFile); menuBar.add(menuOption); menuBar.add(menuInfo); - setJMenuBar(menuBar); + setJMenuBar(menuBar);*/ } @@ -520,10 +535,13 @@ String g = ""; g += "graphe\n{\n"; - g += " titre \" G\xE9n\xE9ration bateaux \"\n"; - g += " sous-titre \" Nombres de bateaux par cat\xE9gories \"\n"; + g += " titre \"G\xE9n\xE9ration de bateaux\"\n"; + g += " sous-titre \"Etude par cat\xE9gorie de bateaux\"\n"; g += " animation non\n"; g += " legende " + "oui" + "\n"; + + g += " marges\n {\n"; + g += " gauche 100\n"; g += " droite 100\n"; g += " haut 50\n"; g += " bas 30\n }\n"; /* * g += " marges\n {\n"; g += " gauche " + ((Integer)preference.dlgParamAff.tfMargeG.getValue()).intValue() + "\n"; * g += " droite " + ((Integer)preference.dlgParamAff.tfMargeD.getValue()).intValue() + "\n"; g += " haut " + @@ -532,8 +550,8 @@ */ g += " axe\n {\n"; // abscisses - g += " titre \" cat." + "\"\n"; - g += " unite \" Cat\xE9gories \"\n"; + g += " titre \"Cat\xE9gorie" + "\"\n"; + g += " unite \"num\xE9ro\"\n"; g += " orientation " + "horizontal" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -542,8 +560,8 @@ g += " }\n"; g += " axe\n {\n"; // Ordonn\xE9es - g += " titre \" nb.bateaux" + "\"\n"; - g += " unite \" bateaux \"\n"; + g += " titre \"Bateaux" + "\"\n"; + g += " unite \"nombre\"\n"; g += " orientation " + "vertical" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -615,10 +633,13 @@ String g = ""; g += "graphe\n{\n"; - g += " titre \" G\xE9n\xE9ration bateaux \"\n"; - g += " sous-titre \" Nombres de bateaux par cat\xE9gories \"\n"; + g += " titre \"G\xE9n\xE9ration de bateaux\"\n"; + g += " sous-titre \"Etude par cat\xE9gorie de bateaux\"\n"; g += " animation non\n"; g += " legende " + "oui" + "\n"; + + g += " marges\n {\n"; + g += " gauche 100\n"; g += " droite 100\n"; g += " haut 50\n"; g += " bas 30\n }\n"; /* * g += " marges\n {\n"; g += " gauche " + ((Integer)preference.dlgParamAff.tfMargeG.getValue()).intValue() + "\n"; * g += " droite " + ((Integer)preference.dlgParamAff.tfMargeD.getValue()).intValue() + "\n"; g += " haut " + @@ -627,8 +648,8 @@ */ g += " axe\n {\n"; // abscisses - g += " titre \" cat." + "\"\n"; - g += " unite \" Categories \"\n"; + g += " titre \"Cat\xE9gorie" + "\"\n"; + g += " unite \"num\xE9ro\"\n"; g += " orientation " + "horizontal" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -637,8 +658,8 @@ g += " }\n"; g += " axe\n {\n"; // Ordonn\xE9es - g += " titre \" nb.bateaux" + "\"\n"; - g += " unite \"" + " bateaux" + "\"\n"; + g += " titre \"Bateaux" + "\"\n"; + g += " unite \"" + "nombre" + "\"\n"; g += " orientation " + "vertical" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -749,7 +770,7 @@ - return Sinavi3JFreeChartCamembert.creerCamembert(FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.ResultatsGenerationNavires), noms, "G\xE9n\xE9rations de bateaux par cat\xE9gorie"); + return Sinavi3JFreeChartCamembert.creerCamembert(FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.ResultatsGenerationNavires), noms, "G\xE9n\xE9ration de bateaux par cat\xE9gorie"); } @@ -789,7 +810,7 @@ tabNavires[cpt++]=this.donnees_.params_.ResultatsCompletsSimulation.ResultatsGenerationNavires[i]; - Sinavi3JFreeChartCamembert.modifierCamembert(camembert_, FonctionsSimu.diviserSimu(tabNavires), noms, "G\xE9n\xE9rations de bateaux par cat\xE9gories"); + Sinavi3JFreeChartCamembert.modifierCamembert(camembert_, FonctionsSimu.diviserSimu(tabNavires), noms, "G\xE9n\xE9ration de bateaux par cat\xE9gorie"); } @@ -800,7 +821,7 @@ for(int i=0;i<donnees_.listeBateaux_.listeNavires_.size();i++) noms[cpt++]=donnees_.listeBateaux_.retournerNavire(i).nom; - return Sinavi3JFreeChartCamembert.creerHisto3d(this.donnees_.params_.ResultatsCompletsSimulation.ResultatsGenerationNavires, "G\xE9n\xE9rations de bateaux par cat\xE9gories",noms); + return Sinavi3JFreeChartCamembert.creerHisto3d(this.donnees_.params_.ResultatsCompletsSimulation.ResultatsGenerationNavires, "G\xE9n\xE9ration de bateaux par cat\xE9gorie",noms); } /** Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleCategories.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleCategories.java 2008-09-25 15:22:02 UTC (rev 3982) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleCategories.java 2008-09-25 15:22:17 UTC (rev 3983) @@ -9,6 +9,7 @@ import java.awt.BorderLayout; import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.Point; import java.awt.event.ActionEvent; @@ -21,6 +22,7 @@ import javax.swing.BorderFactory; import javax.swing.Box; +import javax.swing.ButtonGroup; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JFileChooser; @@ -28,7 +30,9 @@ import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; +import javax.swing.JRadioButton; import javax.swing.JScrollPane; +import javax.swing.JTabbedPane; import javax.swing.JTextField; import javax.swing.border.Border; import javax.swing.border.EtchedBorder; @@ -108,15 +112,24 @@ JCheckBox choixTotalAttente_ = new JCheckBox("Attente totale", true); - JCheckBox choixSecurite_ = new JCheckBox("Attentes s\xE9curit\xE9", true); - JCheckBox choixAcces_ = new JCheckBox("Attentes acc\xE8s", true); - JCheckBox choixOccupation_ = new JCheckBox("Attentes occupation", true); - JCheckBox choixPannes_ = new JCheckBox("Attentes indispo", true); + JCheckBox choixSecurite_ = new JCheckBox("Attentes de s\xE9curit\xE9", true); + JCheckBox choixAcces_ = new JCheckBox("Attentes d'acc\xE8s", true); + JCheckBox choixOccupation_ = new JCheckBox("Attentes d'occupation", true); + JCheckBox choixPannes_ = new JCheckBox("Attentes d'indisponibilit\xE9", true); + + BuPanel optionPanelgraph_ = new BuPanel(); + JRadioButton choixTotalAttente2_ = new JRadioButton("Attentes totales", true); + JRadioButton choixSecurite2_ = new JRadioButton("Attentes de s\xE9curit\xE9", false); + JRadioButton choixAcces2_ = new JRadioButton("Attentes d'acc\xE8s", false); + JRadioButton choixOccupation2_ = new JRadioButton("Attentes d'occupation", false); + JRadioButton choixPannes2_ = new JRadioButton("Attentes d'indisponibilit\xE9", false); // checkbox desz differents types d elements: - JCheckBox choixChenal_ = new JCheckBox("voir biefs", true); + JCheckBox choixChenal_ = new JCheckBox("Biefs", true); + JCheckBox choixChenal2_ = new JCheckBox("Biefs", true); - JCheckBox choixEcluse_ = new JCheckBox("voir ecluses", true); + JCheckBox choixEcluse_ = new JCheckBox("Ecluses ", true); + JCheckBox choixEcluse2_ = new JCheckBox("Ecluses ", true); JCheckBox choixMax_ = new JCheckBox("Attente max", true); JCheckBox choixMoy_ = new JCheckBox("Attente moyenne", true); @@ -124,7 +137,7 @@ boolean seuil_ = false; JTextField valSeuil_ = new JTextField(6); - JCheckBox valideSeuil_ = new JCheckBox("seuil", false); + JCheckBox valideSeuil_ = new JCheckBox("Afficher le seuil", false); float valeurSeuil = 0; /** @@ -144,6 +157,11 @@ BuTabbedPane panelPrincipalAffichage_ = new BuTabbedPane(); /** + * Panel tabbed qui g\xE8re les 2 onglets de repr\xE9sentations graphiques + */ + BuTabbedPane panelGraphAffichage_ = new BuTabbedPane(); + + /** * Panel cniotenant le tableau et les boutns de controles */ BuPanel panelGestionTableau_ = new BuPanel(); @@ -169,6 +187,11 @@ BuPanel controlPanelHisto_ = new BuPanel(); /** + * panel de gestion des repr\xE9sentations graphiques + */ + BuPanel panelGraph_ = new BuPanel(); + + /** * panel de gestion des courbes */ BuPanel panelCourbe_ = new BuPanel(); @@ -186,16 +209,16 @@ /** * buoton de generation des resultats */ - private final BuButton exportationExcel_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "Excel"); + private final BuButton exportationExcel_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "Exporter"); - final BuButton exportationgraphe_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "exportation image"); + final BuButton exportationgraphe_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "Exporter"); - final BuButton exportationHisto_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "exportation image"); - private final BuButton quitter_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "quitter"); - private final BuButton quitter2_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "quitter"); - private final BuButton quitter3_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "quitter"); - private final BuButton lancerRecherche_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_oui"), "Recherche"); - private final BuButton lancerOptions_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_oui"), "modifier"); + final BuButton exportationHisto_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), "Exporter"); + private final BuButton quitter_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "Quitter"); + private final BuButton quitter2_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "Quitter"); + private final BuButton quitter3_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "Quitter"); + private final BuButton lancerRecherche_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_oui"), "Rechercher"); + private final BuButton lancerOptions_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_oui"), "Modifier"); private final BuButton validerSeuil_ = new BuButton(/* FudaaResource.FUDAA.getIcon("crystal22_oui"), */"valider seuil"); private final BuButton validerElem_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_oui"), "Ok"); @@ -227,18 +250,18 @@ this.panelPrincipal_.setLayout(new BorderLayout()); this.getContentPane().add(this.panelPrincipal_/* ,BorderLayout.CENTER */); this.panelPrincipal_.add(this.selectionPanel_, BorderLayout.NORTH); - this.panelPrincipal_.add(this.optionPanel_, BorderLayout.WEST); + // this.panelPrincipal_.add(this.optionPanel_, BorderLayout.WEST); this.panelPrincipal_.add(this.panelPrincipalAffichage_, BorderLayout.CENTER); // ajout du tableau dans le panel tabbed - panelPrincipalAffichage_.addTab("tableau", FudaaResource.FUDAA.getIcon("crystal_arbre"), panelGestionTableau_); + panelPrincipalAffichage_.addTab("R\xE9sultats d\xE9taill\xE9s", FudaaResource.FUDAA.getIcon("crystal_arbre"), panelGestionTableau_); // ajout des courbes dans le panel de la sous fenetre - panelPrincipalAffichage_.addTab("Graphe", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelCourbe_); + //panelPrincipalAffichage_.addTab("Graphe", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelCourbe_); + panelPrincipalAffichage_.addTab("Exploitation graphique", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelGraph_); + //panelPrincipalAffichage_.addTab("Histogramme", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelHisto_); - panelPrincipalAffichage_.addTab("Histogramme", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelHisto_); - // remplissage du comboliste avec les noms des navires // this.ListeNavires_.addItem("Tous"); for (int i = 0; i < donnees_.listeBateaux_.listeNavires_.size(); i++) { @@ -248,10 +271,10 @@ /******************************************************************************************************************* * gestion du panel de selection ******************************************************************************************************************/ - this.selectionPanel_.setLayout(new GridLayout(2, 1)); + this.selectionPanel_.setLayout(new GridLayout(1, 1)); - selectionPanel1 = new BuPanel(); - selectionPanel1.add(new JLabel("Attentes \xE0 cumuler pour la cat\xE9gorie de bateaux:")); + selectionPanel1 = new BuPanel(new FlowLayout(FlowLayout.LEFT)); + selectionPanel1.add(new JLabel("Attentes \xE0 cumuler pour la cat\xE9gorie de bateaux")); // selectionPanel1.add(new JLabel("Element de depart:")); // selectionPanel1.add(this.ListeTypesDepart_); // selectionPanel1.add(this.ListeElementDepart_); @@ -259,22 +282,25 @@ // selectionPanel1.add(new JLabel("Element d'arrivee:")); // selectionPanel1.add(this.ListeTypesArrivee_); // selectionPanel1.add(this.ListeElementArrivee_); - selectionPanel1.setBorder(this.bordnormal_); + // selectionPanel1.setBorder(this.bordnormal_); this.selectionPanel_.add(selectionPanel1); - final BuPanel selectionPanel2 = new BuPanel(); - selectionPanel2.add(new JLabel("sens du trajet: ")); - selectionPanel2.add(this.Sens_); + // final BuPanel selectionPanel2 = new BuPanel(new FlowLayout(FlowLayout.LEFT)); + selectionPanel1.add(new JLabel(" dans le sens")); + selectionPanel1.add(this.Sens_); // selectionPanel2.add(new JLabel("H.Min ")); // selectionPanel2.add(new JLabel("Horaire de fin: ")); // selectionPanel2.add(this.horaireFin_); // selectionPanel2.add(new JLabel("H.Min ")); - selectionPanel2.add(lancerRecherche_); + selectionPanel1.add(lancerRecherche_); - selectionPanel2.setBorder(this.bordnormal_); - this.selectionPanel_.add(selectionPanel2); + // selectionPanel2.setBorder(this.bordnormal_); + // this.selectionPanel_.add(selectionPanel2); - this.selectionPanel_.setBorder(this.compound_); + //this.selectionPanel_.setBorder(this.compound_); + final TitledBorder bordurea = BorderFactory.createTitledBorder(BorderFactory + .createEtchedBorder(EtchedBorder.LOWERED), "D\xE9finition de la recherche"); + this.selectionPanel_.setBorder(bordurea); // listener des liste box final ActionListener RemplissageElement = new ActionListener() { @@ -362,7 +388,7 @@ panoption.add(bVert); // bVert.add(new JLabel("Options Affichage:")); bVert.add(new JLabel("")); - bVert.add(this.choixNbNavires_); + // bVert.add(this.choixNbNavires_); bVert.setBorder(this.bordnormal_); // bVert.add(this.choixMarees_); bVert.add(this.choixSecurite_); @@ -371,7 +397,7 @@ bVert.add(this.choixPannes_); bVert.add(this.choixTotalAttente_); final TitledBorder bordure1 = BorderFactory.createTitledBorder(BorderFactory - .createEtchedBorder(EtchedBorder.LOWERED), "Options Affichage"); + .createEtchedBorder(EtchedBorder.LOWERED), "Types d'attentes"); bVert.setBorder(bordure1); // bVert.add(lancerOptions_); panoption.add(new JLabel("")); @@ -385,20 +411,23 @@ bVert2.add(this.choixEcluse_); final TitledBorder bordure2 = BorderFactory.createTitledBorder(BorderFactory - .createEtchedBorder(EtchedBorder.LOWERED), "type \xE9l\xE9ment"); + .createEtchedBorder(EtchedBorder.LOWERED), "Types d'\xE9l\xE9ments"); bVert2.setBorder(bordure2); - final Box bVert3 = Box.createVerticalBox(); - final TitledBorder bordure3 = BorderFactory.createTitledBorder(BorderFactory + /* + * final Box bVert3 = Box.createVerticalBox(); + * final TitledBorder bordure3 = BorderFactory.createTitledBorder(BorderFactory .createEtchedBorder(EtchedBorder.LOWERED), "attente"); - bVert3.setBorder(bordure3); - bVert3.add(this.choixMin_); - bVert3.add(this.choixMoy_); - bVert3.add(this.choixMax_); - this.choixMin_.addActionListener(this); - this.choixMoy_.addActionListener(this); - this.choixMax_.addActionListener(this); - panoption.add(bVert3); + * bVert3.setBorder(bordure3); + * bVert3.add(this.choixMin_); + * bVert3.add(this.choixMoy_); + * bVert3.add(this.choixMax_); + * this.choixMin_.addActionListener(this); + * this.choixMoy_.addActionListener(this); + * this.choixMax_.addActionListener(this); + * panoption.add(bVert3); + */ + this.optionPanel_.setBorder(this.compound_); this.optionPanel_.add(panoption); @@ -417,7 +446,60 @@ this.choixEcluse_.addActionListener(this); // lancerOptions_.addActionListener(this); + /******************************************************************************************************************* + * gestion du panel des options graphiques + ******************************************************************************************************************/ + + final Box panoptiongraph = Box.createVerticalBox(); + final Box bVertgraph = Box.createVerticalBox(); + panoptiongraph.add(bVertgraph); + + ButtonGroup bg=new ButtonGroup(); + bg.add(choixSecurite2_); + bg.add(choixAcces2_); + bg.add(choixOccupation2_); + bg.add(choixPannes2_); + bg.add(this.choixTotalAttente2_); + bg.add(choixAcces2_); + + bVertgraph.add(new JLabel("")); + final TitledBorder borduregraph1 = BorderFactory.createTitledBorder(BorderFactory + .createEtchedBorder(EtchedBorder.LOWERED), "Types d'attentes"); + bVertgraph.setBorder(borduregraph1); + bVertgraph.add(this.choixSecurite2_); + bVertgraph.add(this.choixAcces2_); + bVertgraph.add(this.choixOccupation2_); + bVertgraph.add(this.choixPannes2_); + bVertgraph.add(this.choixTotalAttente2_); + + panoptiongraph.add(new JLabel("")); + final Box bVertgraph2 = Box.createVerticalBox(); + panoptiongraph.add(bVertgraph2); + bVertgraph2.setBorder(this.bordnormal_); + bVertgraph2.add(this.choixChenal2_); + + bVertgraph2.add(this.choixEcluse2_); + + final TitledBorder borduregraph2 = BorderFactory.createTitledBorder(BorderFactory + .createEtchedBorder(EtchedBorder.LOWERED), "Types d'\xE9l\xE9ments"); + bVertgraph2.setBorder(borduregraph2); + + this.optionPanelgraph_.setBorder(this.compound_); + this.optionPanelgraph_.add(panoptiongraph); + + // listener des checkbox de choix des options d affichage + + this.choixAcces2_.addActionListener(this); + this.choixSecurite2_.addActionListener(this); + this.choixTotalAttente2_.addActionListener(this); + this.choixOccupation2_.addActionListener(this); + this.choixPannes2_.addActionListener(this); + this.choixChenal2_.addActionListener(this); + this.choixEcluse2_.addActionListener(this); + + + /******************************************************************************************************************* * gestion du panel tableau panelGestionTableau_ ******************************************************************************************************************/ @@ -429,6 +511,7 @@ // ajout au centre du panel qui contiendra le tableau d affichage this.panelGestionTableau_.add(asc, BorderLayout.CENTER); + this.panelGestionTableau_.add(this.optionPanel_, BorderLayout.WEST); // panel qui contient les differents boutons this.controlPanel_.add(quitter_); @@ -464,7 +547,7 @@ // bouton qui permet de generer le contenu du tableau en ficheir excel: this.exportationExcel_ - .setToolTipText("permet d'importer le contenu des donn\xE9es dans un fichier excel que l'on pourra par la suite imprimer"); + .setToolTipText("Exporte le contenu du tableau au format xls"); exportationExcel_.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { File fichier; @@ -500,6 +583,15 @@ }); /******************************************************************************************************************* + * gestion du panel courbes panelGraph_ + ******************************************************************************************************************/ + this.panelGraph_.setLayout(new BorderLayout()); + this.panelGraph_.add(this.optionPanelgraph_, BorderLayout.WEST); + this.panelGraph_.add(this.panelGraphAffichage_, BorderLayout.CENTER); + panelGraphAffichage_.addTab("Graphe", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelCourbe_); + panelGraphAffichage_.addTab("Histogramme", FudaaResource.FUDAA.getIcon("crystal_graphe"), panelHisto_); + + /******************************************************************************************************************* * gestion du panel courbes panelCourbe_ ******************************************************************************************************************/ // etape 1: architecture de la frame @@ -515,7 +607,7 @@ this.panelCourbe_.add(this.graphe_, BorderLayout.CENTER); // etape 5: bouton de generation du fichier image - exportationgraphe_.setToolTipText("permet de g\xE9n\xE9rer un fichier image \xE0 partir du graphe"); + exportationgraphe_.setToolTipText("Exporte le graphe au format image"); exportationgraphe_.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { @@ -546,7 +638,7 @@ this.panelHisto_.add(/* this.histo_ */panneauHisto, BorderLayout.CENTER); // etape 5: bouton de generation du fichier image - exportationHisto_.setToolTipText("permet de g\xE9n\xE9rer un fichier image \xE0 partir de l'histogramme"); + exportationHisto_.setToolTipText("Exporte l'histogramme au format image"); exportationHisto_.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { @@ -581,15 +673,15 @@ // etape 6: creation du panel des boutons des courbes: this.controlPanelHisto_.add(quitter3_); this.controlPanelHisto_.add(exportationHisto_); - this.controlPanelHisto_.add(new JLabel(" seuil:")); + this.controlPanelHisto_.add(new JLabel(" Seuil:")); this.controlPanelHisto_.add(valSeuil_); this.controlPanelHisto_.add(valideSeuil_); this.panelHisto_.add(this.controlPanelHisto_, BorderLayout.SOUTH); /** listener des boutons quitter */ - this.quitter_.setToolTipText("cliquez sur ce bouton pour fermer la sous fen\xEAtre"); - this.quitter2_.setToolTipText("cliquez sur ce bouton pour fermer la sous fen\xEAtre"); - this.quitter3_.setToolTipText("cliquez sur ce bouton pour fermer la sous fen\xEAtre"); + this.quitter_.setToolTipText("Ferme la sous-fen\xEAtre"); + this.quitter2_.setToolTipText("Ferme la sous-fen\xEAtre"); + this.quitter3_.setToolTipText("Ferme la sous-fen\xEAtre"); final ActionListener actionQuitter = new ActionListener() { public void actionPerformed(ActionEvent e) { Sinavi3ResultatsAttenteGeneraleCategories.this.windowClosed(); @@ -601,7 +693,7 @@ // ajout d'un menuBar // petite barre de menu agreable - final JMenuBar menuBar = new JMenuBar(); + /* final JMenuBar menuBar = new JMenuBar(); final JMenu menuFile = new JMenu("Fichier"); final JMenuItem menuFileExit = new JMenuItem("Quitter"); final JMenu menuOption = new JMenu("Options"); @@ -622,7 +714,7 @@ menuBar.add(menuOption); menuBar.add(menuInfo); setJMenuBar(menuBar); - +*/ } /** @@ -1013,11 +1105,11 @@ String affichageGraphe() { int nbElements = 0; - if (this.choixChenal_.isSelected()) { + if (this.choixChenal2_.isSelected()) { nbElements += this.donnees_.listeBief_.listeBiefs_.size(); } - if (this.choixEcluse_.isSelected()) { + if (this.choixEcluse2_.isSelected()) { nbElements += this.donnees_.listeEcluse_.listeEcluses_.size(); } @@ -1035,7 +1127,7 @@ String g = ""; g += "graphe\n{\n"; - g += " titre \" Attente de la cat\xE9gorie " + (String) this.ListeNavires_.getSelectedItem(); + g += " titre \"Attentes pour la cat\xE9gorie " + (String) this.ListeNavires_.getSelectedItem(); if (this.Sens_.getSelectedIndex() == 0) { g += " dans le sens avalant"; } else if (this.Sens_.getSelectedIndex() == 1) { @@ -1045,20 +1137,23 @@ } g += " \"\n"; - if (this.choixSecurite_.isSelected()) { - g += " sous-titre \" Attentes de S\xE9curit\xE9 \"\n"; - } else if (this.choixAcces_.isSelected()) { - g += " sous-titre \" Attentes d' Acc\xE8s \"\n"; - } else if (this.choixOccupation_.isSelected()) { - g += " sous-titre \" Attentes Occupation \"\n"; - } else if (this.choixPannes_.isSelected()) { - g += " sous-titre \" Attentes de Pannes \"\n"; - } else if (this.choixTotalAttente_.isSelected()) { - g += " sous-titre \" Attente totale \"\n"; + if (this.choixSecurite2_.isSelected()) { + g += " sous-titre \"Attentes de s\xE9curit\xE9\"\n"; + } else if (this.choixAcces2_.isSelected()) { + g += " sous-titre \"Attentes d'acc\xE8s\"\n"; + } else if (this.choixOccupation2_.isSelected()) { + g += " sous-titre \"Attentes d'occupation\"\n"; + } else if (this.choixPannes2_.isSelected()) { + g += " sous-titre \"Attentes d'indisponibilit\xE9\"\n"; + } else if (this.choixTotalAttente2_.isSelected()) { + g += " sous-titre \"Attentes totales\"\n"; } g += " animation non\n"; g += " legende " + "oui" + "\n"; + + g += " marges\n {\n"; + g += " gauche 100\n"; g += " droite 100\n"; g += " haut 50\n"; g += " bas 30\n }\n"; /* * g += " marges\n {\n"; g += " gauche " + ((Integer)preference.dlgParamAff.tfMargeG.getValue()).intValue() + "\n"; * g += " droite " + ((Integer)preference.dlgParamAff.tfMargeD.getValue()).intValue() + "\n"; g += " haut " + @@ -1067,8 +1162,8 @@ */ g += " axe\n {\n"; // abscisses - g += " titre \" cat." + "\"\n"; - g += " unite \" Categories \"\n"; + g += " titre \"El\xE9ment" + "\"\n"; + g += " unite \"num\xE9ro\"\n"; g += " orientation " + "horizontal" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -1079,8 +1174,8 @@ g += " }\n"; g += " axe\n {\n"; // Ordonn\xE9es - g += " titre \" dur\xE9es" + "\"\n"; - g += " unite \"" + " H.Min" + "\"\n"; + g += " titre \"Dur\xE9e" + "\"\n"; + g += " unite \"" + "h.min" + "\"\n"; g += " orientation " + "vertical" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -1101,16 +1196,16 @@ g += " courbe\n {\n"; g += " titre \""; - if (this.choixSecurite_.isSelected()) { - g += " attentes S\xE9curit\xE9 maxi"; - } else if (this.choixAcces_.isSelected()) { - g += "attentes Acc\xE8s maxi"; - } else if (this.choixOccupation_.isSelected()) { - g += " attentes Occupations maxi"; - } else if (this.choixPannes_.isSelected()) { - g += " attentes Indispo maxi"; - } else if (this.choixTotalAttente_.isSelected()) { - g += " attentes totale maxi"; + if (this.choixSecurite2_.isSelected()) { + g += "attentes de s\xE9curit\xE9 maximales"; + } else if (this.choixAcces2_.isSelected()) { + g += "attentes d'acc\xE8s maximales"; + } else if (this.choixOccupation2_.isSelected()) { + g += "attentes d'occupation maximales"; + } else if (this.choixPannes2_.isSelected()) { + g += "attentes d'indisponibilit\xE9 maximales"; + } else if (this.choixTotalAttente2_.isSelected()) { + g += "attentes totales maximales"; } // g += "dur\xE9es maxi"; /* @@ -1131,30 +1226,30 @@ */ compteurElem = 0; for (int n = 0; n < this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories.length; n++) { - if ((this.choixChenal_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 0) - || (this.choixEcluse_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 1) + if ((this.choixChenal2_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 0) + || (this.choixEcluse2_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 1) ) { g += (compteurElem + 1) + " "; compteurElem++; - if (this.choixSecurite_.isSelected()) { + if (this.choixSecurite2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteSecuMaxi); - } else if (this.choixAcces_.isSelected()) { + } else if (this.choixAcces2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteAccesMaxi); - } else if (this.choixOccupation_.isSelected()) { + } else if (this.choixOccupation2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteOccupMaxi); - } else if (this.choixPannes_.isSelected()) { + } else if (this.choixPannes2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attentePanneMaxi); - } else if (this.choixTotalAttente_.isSelected()) { + } else if (this.choixTotalAttente2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteTotaleMaxi); @@ -1187,16 +1282,16 @@ g += " courbe\n {\n"; g += " titre \""; - if (this.choixSecurite_.isSelected()) { - g += " attentes S\xE9curit\xE9 moyenne"; - } else if (this.choixAcces_.isSelected()) { - g += "attentes Acc\xE8s moyenne"; - } else if (this.choixOccupation_.isSelected()) { - g += " attentes Occupations moyenne"; - } else if (this.choixPannes_.isSelected()) { - g += " attentes Indispo moyenne"; - } else if (this.choixTotalAttente_.isSelected()) { - g += " attentes totale moyenne"; + if (this.choixSecurite2_.isSelected()) { + g += "attentes de s\xE9curit\xE9 moyennes"; + } else if (this.choixAcces2_.isSelected()) { + g += "attentes d'acc\xE8s moyennes"; + } else if (this.choixOccupation2_.isSelected()) { + g += "attentes d'occupation moyennes"; + } else if (this.choixPannes2_.isSelected()) { + g += "attentes d'indisponibilit\xE9 moyennes"; + } else if (this.choixTotalAttente2_.isSelected()) { + g += "attentes totales moyennes"; } /* @@ -1217,35 +1312,35 @@ */ compteurElem = 0; for (int n = 0; n < this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories.length; n++) { - if ((this.choixChenal_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 0) - || (this.choixEcluse_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 1) + if ((this.choixChenal2_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 0) + || (this.choixEcluse2_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 1) ) { g += (compteurElem + 1)// numero de la cat\xE9gorie + " "; compteurElem++; - if (this.choixSecurite_.isSelected()) { + if (this.choixSecurite2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteSecuTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].nbNaviresAttenteSecu)); - } else if (this.choixAcces_.isSelected()) { + } else if (this.choixAcces2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteAccesTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].nbNaviresAttenteAcces)); - } else if (this.choixOccupation_.isSelected()) { + } else if (this.choixOccupation2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteOccupTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].nbNaviresAtenteOccup)); - } else if (this.choixPannes_.isSelected()) { + } else if (this.choixPannes2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attentePanneTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].nbNaviresAttentePanne)); - } else if (this.choixTotalAttente_.isSelected()) { + } else if (this.choixTotalAttente2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteMegaTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ @@ -1267,16 +1362,16 @@ g += " courbe\n {\n"; g += " titre \""; - if (this.choixSecurite_.isSelected()) { - g += " attentes S\xE9curit\xE9 mini"; - } else if (this.choixAcces_.isSelected()) { - g += "attentes Acc\xE8s mini"; - } else if (this.choixOccupation_.isSelected()) { - g += " attentes Occupations mini"; - } else if (this.choixPannes_.isSelected()) { - g += " attentes Indispo mini"; - } else if (this.choixTotalAttente_.isSelected()) { - g += " attentes totale mini"; + if (this.choixSecurite2_.isSelected()) { + g += "attentes de s\xE9curit\xE9 minimales"; + } else if (this.choixAcces2_.isSelected()) { + g += "attentes d'acc\xE8s minimales"; + } else if (this.choixOccupation2_.isSelected()) { + g += "attentes d'occupation minimales"; + } else if (this.choixPannes2_.isSelected()) { + g += "attentes d'indisponibilit\xE9 minimales"; + } else if (this.choixTotalAttente2_.isSelected()) { + g += "attentes totales minimales"; } g += "\"\n"; @@ -1294,8 +1389,8 @@ */ compteurElem = 0; for (int n = 0; n < this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories.length; n++) { - if ((this.choixChenal_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 0) - || (this.choixEcluse_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 1) + if ((this.choixChenal2_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 0) + || (this.choixEcluse2_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 1) ) { @@ -1303,23 +1398,23 @@ + " "; compteurElem++; - if (this.choixSecurite_.isSelected()) { + if (this.choixSecurite2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteSecuMini); - } else if (this.choixAcces_.isSelected()) { + } else if (this.choixAcces2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteAccesMini); - } else if (this.choixOccupation_.isSelected()) { + } else if (this.choixOccupation2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteOccupMini); - } else if (this.choixPannes_.isSelected()) { + } else if (this.choixPannes2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attentePanneMini); - } else if (this.choixTotalAttente_.isSelected()) { + } else if (this.choixTotalAttente2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteTotaleMini); @@ -1362,11 +1457,11 @@ String affichageHistogramme() { int nbElements = 0; - if (this.choixChenal_.isSelected()) { + if (this.choixChenal2_.isSelected()) { nbElements += this.donnees_.listeBief_.listeBiefs_.size(); } - if (this.choixEcluse_.isSelected()) { + if (this.choixEcluse2_.isSelected()) { nbElements += this.donnees_.listeEcluse_.listeEcluses_.size(); } @@ -1384,7 +1479,7 @@ String g = ""; g += "graphe\n{\n"; - g += " titre \" Attente de la cat\xE9gorie " + (String) this.ListeNavires_.getSelectedItem();/* +" \"\n"; */ + g += " titre \"Attentes pour la cat\xE9gorie " + (String) this.ListeNavires_.getSelectedItem();/* +" \"\n"; */ if (this.Sens_.getSelectedIndex() == 0) { g += " dans le sens avalant"; } else if (this.Sens_.getSelectedIndex() == 1) { @@ -1394,20 +1489,23 @@ } g += " \"\n"; - if (this.choixSecurite_.isSelected()) { - g += " sous-titre \" Attentes de S\xE9curit\xE9 \"\n"; - } else if (this.choixAcces_.isSelected()) { - g += " sous-titre \" Attentes d' Acc\xE8s \"\n"; - } else if (this.choixOccupation_.isSelected()) { - g += " sous-titre \" Attentes Occupation \"\n"; - } else if (this.choixPannes_.isSelected()) { - g += " sous-titre \" Attentes de Indispo \"\n"; - } else if (this.choixTotalAttente_.isSelected()) { - g += " sous-titre \" Attente totale \"\n"; + if (this.choixSecurite2_.isSelected()) { + g += " sous-titre \"Attentes de s\xE9curit\xE9\"\n"; + } else if (this.choixAcces2_.isSelected()) { + g += " sous-titre \"Attentes d'acc\xE8s\"\n"; + } else if (this.choixOccupation2_.isSelected()) { + g += " sous-titre \"Attentes d'occupation\"\n"; + } else if (this.choixPannes2_.isSelected()) { + g += " sous-titre \"Attentes d'indisponibilit\xE9\"\n"; + } else if (this.choixTotalAttente2_.isSelected()) { + g += " sous-titre \"Attentes totales\"\n"; } g += " animation non\n"; g += " legende " + "oui" + "\n"; + + g += " marges\n {\n"; + g += " gauche 100\n"; g += " droite 100\n"; g += " haut 50\n"; g += " bas 30\n }\n"; /* * g += " marges\n {\n"; g += " gauche " + ((Integer)preference.dlgParamAff.tfMargeG.getValue()).intValue() + "\n"; * g += " droite " + ((Integer)preference.dlgParamAff.tfMargeD.getValue()).intValue() + "\n"; g += " haut " + @@ -1416,8 +1514,8 @@ */ g += " axe\n {\n"; // abscisses - g += " titre \" cat." + "\"\n"; - g += " unite \" Categories \"\n"; + g += " titre \"El\xE9ment" + "\"\n"; + g += " unite \"num\xE9ro\"\n"; g += " orientation " + "horizontal" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -1429,8 +1527,8 @@ g += " }\n"; g += " axe\n {\n"; // Ordonn\xE9es - g += " titre \" dur\xE9es" + "\"\n"; - g += " unite \"" + " H.Min" + "\"\n"; + g += " titre \"Dur\xE9e" + "\"\n"; + g += " unite \"" + "h.min" + "\"\n"; g += " orientation " + "vertical" + "\n"; g += " graduations oui\n"; g += " minimum " + 0 + "\n"; @@ -1451,16 +1549,16 @@ g += " courbe\n {\n"; g += " titre \""; - if (this.choixSecurite_.isSelected()) { - g += " attentes S\xE9curit\xE9 maxi"; - } else if (this.choixAcces_.isSelected()) { - g += "attentes Acc\xE8s maxi"; - } else if (this.choixOccupation_.isSelected()) { - g += " attentes Occupations maxi"; - } else if (this.choixPannes_.isSelected()) { - g += " attentes Indispo maxi"; - } else if (this.choixTotalAttente_.isSelected()) { - g += " attentes totale maxi"; + if (this.choixSecurite2_.isSelected()) { + g += "Attentes de s\xE9curit\xE9 maximales"; + } else if (this.choixAcces2_.isSelected()) { + g += "Attentes d'acc\xE8s maximales"; + } else if (this.choixOccupation2_.isSelected()) { + g += "Attentes d'occupation maximales"; + } else if (this.choixPannes2_.isSelected()) { + g += "Attentes d'indisponibilit\xE9 maximales"; + } else if (this.choixTotalAttente2_.isSelected()) { + g += "Attentes totales maximales"; } // g += "dur\xE9es maxi"; /* @@ -1481,31 +1579,31 @@ */ compteurElem = 0; for (int n = 0; n < this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories.length; n++) { - if ((this.choixChenal_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 0) - || (this.choixEcluse_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 1) + if ((this.choixChenal2_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 0) + || (this.choixEcluse2_.isSelected() && this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].typeElement == 1) ) { g += (compteurElem + 1)// numero de la cat\xE9gorie + " "; compteurElem++; - if (this.choixSecurite_.isSelected()) { + if (this.choixSecurite2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteSecuMaxi); - } else if (this.choixAcces_.isSelected()) { + } else if (this.choixAcces2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteAccesMaxi); - } else if (this.choixOccupation_.isSelected()) { + } else if (this.choixOccupation2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteOccupMaxi); - } else if (this.choixPannes_.isSelected()) { + } else if (this.choixPannes2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attentePanneMaxi); - } else if (this.choixTotalAttente_.isSelected()) { + } else if (this.choixTotalAttente2_.isSelected()) { g += Sinavi3TraduitHoraires .traduitMinutesEnHeuresMinutes((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[n].tableauAttenteCategories[this.ListeNavires_ .getSelectedIndex()].attenteTotaleMaxi); @@ -1538,16 +1636,16 @@ g += " courbe\n {\n"; g += " titre \""; - if (this.choixSecurite_.isSelected()) { - g += " attentes S\xE9curit\xE9 moyenne"; - } else if (this.choixAcces_.isSelected()) { - g += "attentes Acc\xE8s moyenne"; - } else if (this.choixOccupation_.isSelected()) { - g += " attentes Occupations moyenne"; - } else if (this.choixPannes_.isSelected()) { - g += " attentes Indispo moyenne"; - } else if (this.choixTotalAttente_.isSelected()) { - g += " attentes totale moyenne"; + if (this.choixSecurite2_.isSelected()) { + g += "attentes de s\xE9curit\xE9 moyennes"; + } else if (this.choixAcces2_.isSelected()) { + g += "attentes d'acc\xE8s moyennes"; + } else if (this.choixOccupation2_.isSelected()) { + g += "attentes d'occupation moyennes"; + } else if (this.choixPannes2_.isSelected()) { + g += "attentes d'indisponibilit\xE9 moyennes"; + } else if ... [truncated message content] |
From: <had...@us...> - 2008-09-25 15:22:19
|
Revision: 3982 http://fudaa.svn.sourceforge.net/fudaa/?rev=3982&view=rev Author: hadouxad Date: 2008-09-25 15:22:02 +0000 (Thu, 25 Sep 2008) Log Message: ----------- - fonction sonde ok - preparation des outils pour l'import export de graphe Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.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/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.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/rubar/TrRubarTarageCourbesManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheTreeCellRenderer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -14,25 +14,25 @@ import javax.swing.table.AbstractTableModel; -import com.vividsolutions.jts.algorithm.SIRtreePointInRing; -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.LinearRing; - import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.gis.GISGeometryFactory; import org.fudaa.ctulu.gis.GISLib; - import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.geometrie.GrMorphisme; import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.palette.BPalettePlage; +import org.fudaa.ebli.palette.BPaletteInfo.InfoData; import org.fudaa.ebli.trace.TraceIcon; import org.fudaa.ebli.trace.TraceIconModel; +import com.vividsolutions.jts.algorithm.SIRtreePointInRing; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Envelope; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.LinearRing; + /** * Un calque d'affichage de point avec un icone. * @@ -91,6 +91,11 @@ } } + + public void fillWithInterpolateInfo(final InfoData _m) { + + } + /** * @author Fred Deniger * @version $Id: ZCalquePoint.java,v 1.51 2007-05-04 13:49:42 deniger Exp $ Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -1,20 +1,32 @@ package org.fudaa.ebli.calque; import java.awt.BorderLayout; +import java.awt.Frame; import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; +import java.util.Map; +import javax.swing.Icon; +import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluUIDialog; import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.ebli.palette.BPaletteInfo.InfoData; import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetVueCalque; +import org.fudaa.ebli.visuallibrary.graphe.GrapheTreeCellRenderer; import org.jdesktop.swingx.JXTreeTable; import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode; import org.jdesktop.swingx.treetable.DefaultTreeTableModel; @@ -32,24 +44,43 @@ //private List<ZCalqueSondeInterface> listeTarget_; final List<ZCalqueSondeInteraction> listeSondeInteractions_ = new ArrayList<ZCalqueSondeInteraction>(); - final List<String> listeNodeCalques = new ArrayList<String>(); - + + ArrayList<EbliWidgetVueCalque> listeWidgetCalque_ = new ArrayList<EbliWidgetVueCalque>(); + + /** + * Liste des panelTableModel qui contiennent les infos des calques. + */ + ArrayList<DataSonde> listInfoData_ = new ArrayList<DataSonde>(); + + /** + * HahMap qui contient les infos mises a jour des positions des sondes. + */ + + + public ZCalqueSondeSynchroniserFusion() { + } int cpt = 1; - public void addZCalqueSondeInteraction(ZCalqueSondeInteraction si/* - * , EbliNode - * node - */) { + public void addZCalqueSondeInteraction(ZCalqueSondeInteraction si, EbliWidgetVueCalque _widget) { // -- ajout de la sonde dans le manager --// listeSondeInteractions_.add(si); - - listeNodeCalques.add("calque " + (cpt++)); + + // -- ajout de la widget --// + listeWidgetCalque_.add(_widget); + + // -- ajout du model de la palete info du calque --// + // listTableModel_.add(_widget.getCalqueController().getVisuPanel(). + // getController().getPaletteInfo().getTableModel()); + + //-- init des datas --// + listInfoData_.add(new DataSonde()); + // -- enregistrement aupres de la sonde du manager comme listener --// si.addZCalqueSondeListener(this); - + } /** @@ -60,91 +91,309 @@ for (ZCalqueSondeInteraction sondeInteraction : listeSondeInteractions_) sondeInteraction.removeZCalqueSondeListener(this); } - + /** * lorsque c'est appel\xE9, met a jour les sondes pour tous les autre * zcalquesondeInteraction. */ public void notifySondeMoved(ZCalqueSondeInteraction _activator, MouseEvent _e) { - for (ZCalqueSondeInteraction sondeInteraction : listeSondeInteractions_) { - if (sondeInteraction != _activator && sondeInteraction.getTarget() != null) { - // -- on recupere le point et on met a jour les sondes --// + if (structureModel_ == null) + structureModel_ = constructStructureModel(); + + for (int i=0;i<listeSondeInteractions_.size();i++) { + + ZCalqueSondeInteraction sondeInteraction=listeSondeInteractions_.get(i); + if (/* sondeInteraction != _activator && */sondeInteraction.getTarget() != null) { + // -- on recupere le point et on met a jour les sondes --// final GrPoint pt = new GrPoint(_e.getX(), _e.getY(), 0); pt.autoApplique(((BCalque) sondeInteraction.getTarget()).getVersReel()); // -- on replace la sonde des autres calques --// ZCalqueSondeInterface objet = sondeInteraction.getTarget(); + objet.setSondeEnable(true); objet.changeSonde(pt); + + //--remplissage des infos specifiques a la sonde --// + ZCalquePoint isoLayer = listeWidgetCalque_.get(i).getCalqueController().getVisuPanel().getIsoLayer(); + isoLayer.fillWithInterpolateInfo(listInfoData_.get(i)); + + // -- mise a jour du model avec les nouvelles infos + // structureModel_.fillWithInfos(i, listInfoData_.get(i)); } } + buildDialog(); - + // structureModel_ = constructStructureModel(); + // treeTableNodes_.setTreeTableModel(structureModel_); + // treeTableNodes_.expandAll(); + structureModel_.reload(); } - + JDialog dialog_; public void buildDialog() { if (dialog_ != null) { dialog_.setVisible(true); return; } - -// CtuluUIDialog ui = new CtuluUIDialog(listeSondeInteractions_); -// final Frame f = CtuluLibSwing.getFrameAncestorHelper(ui.getParentComponent()); - dialog_ = new JDialog(/*f*/); + // CtuluUIDialog ui_ = new + // CtuluUIDialog(listeWidgetCalque_.get(0).getCalqueController + // ().getVisuPanel()); + CtuluUIDialog ui = new CtuluUIDialog(listeWidgetCalque_.get(0).getEbliScene().getView()); + final Frame f = CtuluLibSwing.getFrameAncestorHelper(ui.getParentComponent()); + dialog_ = new JDialog(f); + dialog_.addWindowListener(new WindowAdapter() { - public void windowClosed(WindowEvent _e) { - // on desactive l action de suivi sur le graphe - dialog_ = null; - } + public void windowClosed(WindowEvent _e) { + // on desactive l action de suivi sur le graphe + dialog_ = null; + } - public void windowClosing(WindowEvent _e) { - dialog_ = null; - } - }); - - + public void windowClosing(WindowEvent _e) { + dialog_ = null; + } + }); + + dialog_.setModal(false); dialog_.pack(); dialog_.setTitle(getTitle()); JPanel container=new JPanel(new BorderLayout()); - container.add(new JScrollPane(buildComponent()),BorderLayout.CENTER); + container.add(buildComponent(), BorderLayout.CENTER); container - .add( - new JLabel( - "<html> <body><b>" + getTitle() + "</b> </body></html>"), + .add(new JLabel("<html> <body><b><center>" + getTitle() + "</center></b> </body></html>"), BorderLayout.NORTH); dialog_.setContentPane(container); - dialog_.setSize(250, 400); - // dialog_.setLocationRelativeTo(CtuluLibSwing.getFrameAncestor(ui. - // getParentComponent())); + dialog_.setSize(400, 250); + dialog_.setLocationRelativeTo(CtuluLibSwing.getFrameAncestor(ui.getParentComponent())); dialog_.setVisible(true); - + } - + public String getTitle() { return EbliResource.EBLI.getString("-- Interpolation r\xE9sultats -- "); } - + + JXTreeTable treeTableNodes_; public JComponent buildComponent() { JPanel container = new JPanel(new BorderLayout()); - JXTreeTable treeTableNodes_ = new JXTreeTable(constructStructureModel()); - container.add(treeTableNodes_, BorderLayout.CENTER); + if (structureModel_ == null) + structureModel_ = constructStructureModel(); + treeTableNodes_ = new JXTreeTable(structureModel_); + + // treeTableNodes.setRowHeight(60); + treeTableNodes_.getColumn(0).setMinWidth(100); + treeTableNodes_.setTreeCellRenderer(new GrapheTreeCellRenderer()); + JPanel containerTree = new JPanel(new BorderLayout()); + containerTree.add(treeTableNodes_, BorderLayout.CENTER); + container.add(new JScrollPane(containerTree), BorderLayout.CENTER); container.add(treeTableNodes_.getTableHeader(), BorderLayout.NORTH); return container; } + - public DefaultTreeTableModel constructStructureModel() { + TreeTableModelGraphe structureModel_; + + public TreeTableModelGraphe constructStructureModel() { DefaultMutableTreeTableNode root = new DefaultMutableTreeTableNode("Sonde pour la fusion des calques"); - for (String titre : listeNodeCalques) - root.add(new DefaultMutableTreeTableNode(titre)); - - DefaultTreeTableModel model = new DefaultTreeTableModel(); + for (int i = 0; i < listeWidgetCalque_.size(); i++) { + EbliWidgetVueCalque widget = listeWidgetCalque_.get(i); + JLabel label = new JLabel(); + label.setText(getTitleCalque(widget)); + label.setIcon(getIconCalque(widget)); + DefaultMutableTreeTableNode nodeCalque = new DefaultMutableTreeTableNode(label); + root.add(nodeCalque); + + fillWithInfos(i, nodeCalque, listInfoData_.get(i)); + + + // -- parcours des donn\xE9es + + } + TreeTableModelGraphe model = new TreeTableModelGraphe(); model.setRoot(root); return model; } + + public String getTitleCalque(EbliWidgetVueCalque _widget) { + return ((EbliNode) _widget.getEbliScene().findObject(_widget)).getTitle(); + } + + public Icon getIconCalque(EbliWidgetVueCalque _widget) { + return new ImageIcon(_widget.getCalqueController().getVisuPanel().produceImage(60, 30, new HashMap())); + } + + + + public class DataSonde implements InfoData { + private Map<String, Object> mapValueSonde = new HashMap<String, Object>(); + public ArrayList<String> listOrdonneetitres_ = new ArrayList<String>(); + private String valueEmpty = "N/A"; + + public DataSonde() { + // -- init de la map sonde avec les valeurs par defaut --// + + listOrdonneetitres_.add("X"); + listOrdonneetitres_.add("Y"); + listOrdonneetitres_.add("El\xE9ment englobant"); + listOrdonneetitres_.add("Bathym\xE9trie"); + listOrdonneetitres_.add("Cote eau"); + listOrdonneetitres_.add("Hauteur d'eau"); + listOrdonneetitres_.add("Nombre de Froude"); + listOrdonneetitres_.add("Vitesse"); + listOrdonneetitres_.add("Vitesse u"); + listOrdonneetitres_.add("Vitesse v"); + + for (String key : listOrdonneetitres_) { + mapValueSonde.put(key, valueEmpty); + + } + + + + + } + + public boolean isTitleSet() { + return false; + } + + public void put(String _key, String _value) { + mapValueSonde.put(_key, _value); + if (!listOrdonneetitres_.contains(_key)) + listOrdonneetitres_.add(_key); + } + + public void setTitle(String _title) { + } + + + } + + public class SondeCouple { + public String name; + public int indiceData_; + + public SondeCouple(String _name, int indiceData) { + super(); + name = _name; + indiceData_ = indiceData; + } + + public Object getValue() { + return listInfoData_.get(indiceData_).mapValueSonde.get(name); + } + + } + + + public class TreeTableModelGraphe extends DefaultTreeTableModel { + String[] titre_; + + // -- data correspondant au x donn\xE9 --// + double[] dataY_ = new double[0]; + + public TreeTableModelGraphe() { + String[] val = { "Nom", "Valeur" }; + titre_ = val; + } + + public int getColumnCount() { + + return titre_.length; + } + + @Override + public boolean isCellEditable(Object _node, int _column) { + return false; + } + + public String getColumnName(int _columnIndex) { + return titre_[_columnIndex]; + } + + public int getRowCount() { + return listeWidgetCalque_.size(); + + } + + public Object getValueAt(Object node, int column) { + Object res = new DefaultMutableTreeTableNode("n/a"); + if (node instanceof DefaultMutableTreeTableNode) { + DefaultMutableTreeTableNode defNode = (DefaultMutableTreeTableNode) node; + if (defNode.getUserObject() instanceof JLabel) { + if (column == 0) + return defNode.getUserObject(); + else + return ""; + } else if (defNode.getUserObject() instanceof SondeCouple) { + SondeCouple couple = (SondeCouple) defNode.getUserObject(); + if (column == 0) + return couple.name; + else if (column == 1) + return couple.getValue(); + else + return ""; + } + else + return ""; + } + return res; + } + + public DefaultMutableTreeTableNode getTreeNodeCalque(int i) { + return (DefaultMutableTreeTableNode) getRoot().getChildAt(i); + + } + + public void reload() { + + this.modelSupport.fireTreeStructureChanged(treeTableNodes_.getPathForRow(0)); +// treeTableNodes_.collapseAll(); +// treeTableNodes_.expandAll(); + } + + + /** + * met a jour les nodes childre ndu node calque pour le jtree. + * + * @param _treenode + */ + + + + + } + + public void fillWithInfos(int indice, DefaultMutableTreeTableNode treenode, DataSonde data_) { + + // on enleve les children + // Enumeration<? extends MutableTreeTableNode> children = + // treenode.children(); + // ArrayList<MutableTreeTableNode> listChildren = new + // ArrayList<MutableTreeTableNode>(); + // while (children.hasMoreElements()) { + // MutableTreeTableNode node = children.nextElement(); + // listChildren.add(node); + // + // } + // for (MutableTreeTableNode node : listChildren) { + // node.removeFromParent(); + // } + // -- on ajoute les nouveaux + for (Iterator<String> it = data_.listOrdonneetitres_.iterator(); it.hasNext();) { + String key = it.next(); + Object value = data_.mapValueSonde.get(key); + DefaultMutableTreeTableNode node = new DefaultMutableTreeTableNode( + new SondeCouple(key, indice)); + treenode.add(node); + } + } + + + } 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-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -44,6 +44,7 @@ import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BConfigurePaletteAction; import org.fudaa.ebli.geometrie.GrBoite; +import org.fudaa.ebli.palette.BPaletteInfo; import org.fudaa.ebli.palette.BPaletteInfoAbstractAction; import org.fudaa.ebli.palette.PaletteEditAction; import org.fudaa.ebli.repere.BControleRepereTexte; @@ -334,6 +335,15 @@ public final CtuluUI getUI() { return ui_; } + + /** + * A overrider. + * + * @return + */ + public BPaletteInfo getPaletteInfo() { + return null; + } protected void removePaletteAction() { navigationActionGroup_ = removePaletteAction(navigationActionGroup_); 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-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -110,6 +110,10 @@ } } + public ZCalquePoint getIsoLayer() { + return null; + } + /** * @author Fred Deniger * @version $Id: ZEbliCalquesPanel.java,v 1.55 2007-06-05 08:58:38 deniger Exp $ Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -23,13 +23,13 @@ import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumnModel; +import org.fudaa.ebli.commun.EbliLib; + import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuPanel; import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuTextField; -import org.fudaa.ebli.commun.EbliLib; - /** * Un panel affichant les infos envoyes. * @@ -115,6 +115,11 @@ protected Component parent_; protected JTable table_; protected transient PanelTableModel tableModel_; + + public PanelTableModel getTableModel() { + return tableModel_; + } + protected JTextField txtTitle_; public BPaletteInfo() { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -85,9 +85,11 @@ */ public void synchroniseSondeFusion() { + // -- creation du manager de sonde fusion qui synchronise toute ses sondes // --// managerSondesFusion_ = new ZCalqueSondeSynchroniserFusion(); + for (EbliWidgetVueCalque widget : listeWidgetCalque_) { ZEbliCalquesPanel panel = widget.calquePanel_; @@ -99,7 +101,7 @@ ZCalqueSondeInteraction sonde = panel.getController().getCalqueSondeInteraction(); // -- ajout de la sonde dans le manager - managerSondesFusion_.addZCalqueSondeInteraction(sonde); + managerSondesFusion_.addZCalqueSondeInteraction(sonde, widget); } // -- ajout dans les toolbars de tous les calques de la meme action --// // for (EbliWidgetVueCalque widget : listeWidgetCalque_) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -37,4 +37,7 @@ } return this; } + + + } \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheTreeCellRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheTreeCellRenderer.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheTreeCellRenderer.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -0,0 +1,68 @@ +package org.fudaa.ebli.visuallibrary.graphe; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; + +import javax.swing.JLabel; +import javax.swing.JTree; +import javax.swing.UIManager; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.TreeCellRenderer; + +import org.fudaa.ebli.calque.ZCalqueSondeSynchroniserFusion.SondeCouple; +import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode; + +/** + * Tree cell Renderer classique pour afficher les icones mignature a cot\xE9 des + * objets + * + * @author genesis + * + */ +public class GrapheTreeCellRenderer extends JLabel implements TreeCellRenderer { + private final Color HIGHLIGHT_COLOR = UIManager.getColor("Tree.selectionBackground"); + private DefaultTreeCellRenderer rendererClassique_ = new DefaultTreeCellRenderer(); + JLabel defaultZone_ = new JLabel(""); + + public GrapheTreeCellRenderer() { + setOpaque(true); + setIconTextGap(12); + setSize(150, 100); + setMinimumSize(new Dimension(150, 100)); + + } + + public Component getTreeCellRendererComponent(JTree _tree, Object _value, boolean _selected, boolean _expanded, + boolean _leaf, int _row, boolean _hasFocus) { + + + + DefaultMutableTreeTableNode node= (DefaultMutableTreeTableNode) _value; + + if(node.getUserObject() instanceof JLabel){ + JLabel entry = (JLabel) node.getUserObject(); + + setText(entry.getText()); + setIcon(entry.getIcon()); + if (_selected) { + setBackground(HIGHLIGHT_COLOR); + setForeground(Color.white); + } else { + setBackground(Color.white); + setForeground(Color.black); + } + return this; + } + else if (node.getUserObject() instanceof SondeCouple){ + SondeCouple entry = (SondeCouple) node.getUserObject(); + defaultZone_.setText(entry.name); + return defaultZone_; + } + else + return rendererClassique_.getTreeCellRendererComponent(_tree, _value, _selected, _expanded, _leaf, _row, + _hasFocus); + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -15,9 +15,6 @@ import javax.swing.filechooser.FileFilter; -import com.memoire.bu.BuFileFilter; -import com.memoire.bu.BuResource; - import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.CtuluLib; @@ -30,7 +27,6 @@ import org.fudaa.ctulu.gui.CtuluFileChooser; import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; - import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; @@ -38,18 +34,22 @@ import org.fudaa.dodico.reflux.io.CrbFileFormat; import org.fudaa.dodico.rubar.io.RubarCLIFileFormat; import org.fudaa.dodico.rubar.io.RubarTARFileFormat; +import org.fudaa.dodico.telemac.io.ScopeGENEFileFormat; +import org.fudaa.dodico.telemac.io.ScopeSFileFormat; +import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; - import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGExporter; import org.fudaa.ebli.courbe.EGGraphe; - import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.impl.FudaaGuiLib; import org.fudaa.fudaa.commun.impl.FudaaImportCsvPanel; +import com.memoire.bu.BuFileFilter; +import com.memoire.bu.BuResource; + /** * @author fred deniger * @version $Id: FudaaCourbeImporter.java,v 1.8 2007-06-29 15:09:42 deniger Exp $ @@ -95,7 +95,10 @@ if (op.getSource() == null) { _ui.warn(FudaaLib.getS("Import"), FudaaLib.getS("Pas de courbes \xE0 importer")); } else { + if (op.getSource() instanceof EvolutionReguliereInterface[]) _target.importCourbes((EvolutionReguliereInterface[]) op.getSource(), _mng, prog); + else + _target.importCourbes((ScopeStructure) op.getSource(), _mng, prog); } } _ui.unsetMainMessage(); @@ -107,9 +110,16 @@ public interface Target { void importCourbes(EvolutionReguliereInterface[] _crb, CtuluCommandManager _mng, ProgressionInterface _prog); + + /** + * a utiliser pour les formats scope + * + */ + void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog); + } - private static class ExportAction extends EbliActionSimple { + public static class ExportAction extends EbliActionSimple { final EGGraphe graphe_; final CtuluUI impl_; @@ -130,7 +140,7 @@ new ExportAction(_graphe, _imp) }; } - private static class ImportAction extends EbliActionSimple { + public static class ImportAction extends EbliActionSimple { final FudaaCourbeImporter.Target target_; final FudaaCommonImplementation ui_; final CtuluCommandManager mng_; @@ -178,6 +188,9 @@ r.add(CLTransitoireFileFormat.getInstance()); r.add(RubarTARFileFormat.getInstance()); r.add(RubarCLIFileFormat.getInstance()); + r.add(ScopeSFileFormat.getInstance()); + r.add(ScopeGENEFileFormat.getInstance()); + final FileFormat[] rf = new FileFormat[r.size()]; r.toArray(rf); return rf; Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeSpatialManager.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -0,0 +1,51 @@ +package org.fudaa.fudaa.tr.common; + +import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.mesure.EvolutionReguliereInterface; +import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; + +/** + * Manager pour gerer l'importation de courbes au format scope. + * + * @author Adrien Hadoux + * + */ +public class TrCourbeSpatialManager implements FudaaCourbeImporter.Target { + + EGGraphe graphe_; + MvProfileTreeModel modelGraphe_; + /** + * indique si la courbe a importer est correcte + */ + private boolean enabled = true; + TrCommonImplementation impl_; + + + public TrCourbeSpatialManager(EGGraphe _graphe, TrCommonImplementation _impl) { + super(); + graphe_ = _graphe; + impl_ = _impl; + if (_graphe.getModel() instanceof MvProfileTreeModel) + modelGraphe_ = (MvProfileTreeModel) _graphe.getModel(); + else + enabled = false; + } + + public void importCourbes(EvolutionReguliereInterface[] _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + } + + public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + if (!enabled) { + impl_.error("Le graphe n'est pas compatible. Il ne s'agit pas de profil spatiaux."); + return; + } else { + // blablabli recup de ma structure + + } + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -19,15 +19,11 @@ import javax.swing.JComboBox; import javax.swing.tree.TreePath; -import com.memoire.bu.BuResource; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluRange; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluDialogPanel; - import org.fudaa.dodico.h2d.H2dEvolutionFrontiereLiquide; import org.fudaa.dodico.h2d.H2dParameters; import org.fudaa.dodico.h2d.type.H2dVariableType; @@ -35,7 +31,7 @@ import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.mesure.EvolutionReguliereAbstract; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; - +import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbe; @@ -45,11 +41,13 @@ import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGObject; import org.fudaa.ebli.palette.BPalettePlageDefault; - import org.fudaa.fudaa.commun.courbe.FudaaCourbeCreateGroupPanel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; +import com.memoire.bu.BuResource; +import com.memoire.fu.FuLog; + /** * Il est suppose qu'il n'y a qu'un seul graphe dessine. * @@ -464,4 +462,7 @@ fireGlobalChanged(); } + public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -526,11 +526,16 @@ public void fillWithInfo(final InfoData _m) { _m.setTitle(getTitle()); if (isSondeActive()) { - getIsoModelAbstract().fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.x_, sondePt_.y_, getTitle()); + fillWithInterpolateInfo(_m); } else { modele_.fillWithInfo(_m, this); } } + + + public void fillWithInterpolateInfo(final InfoData _m) { + getIsoModelAbstract().fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.x_, sondePt_.y_, getTitle()); + } public final String getDataDescription() { return getTitle(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -16,6 +16,7 @@ import org.fudaa.ctulu.CtuluUI; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; +import org.fudaa.ebli.palette.BPaletteInfo; import org.fudaa.fudaa.sig.layer.FSigVisuPanel; import org.fudaa.fudaa.sig.layer.FSigVisuPanelController; @@ -79,7 +80,11 @@ } return tabPalettes_; } - + + public BPaletteInfo getPaletteInfoModel() { + return ((BPaletteInfo) mapTabPalettes_.get("INFOS").buildContentPane()); + } + @Override public FSigVisuPanel getVisuPanel() { return super.getVisuPanel(); 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-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -37,7 +37,9 @@ import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorLegende; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; +import org.fudaa.fudaa.tr.common.TrCourbeSpatialManager; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.netbeans.api.visual.widget.Widget; @@ -559,6 +561,12 @@ // TODO trop dangereux... // listeActions.add(new TrPostCourbeAddPointsAction(projet_.impl_, _graphe.getGraphe(), _calque)); listeActions.add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); + + //--ajout des actions import export format scope --// + listeActions.add(new FudaaCourbeImporter.ImportAction(new TrCourbeSpatialManager(_graphe.getGraphe(), + projet_.impl_), projet_.impl_, creator.getGraphe().getCmd())); + listeActions.add( new FudaaCourbeImporter.ExportAction(creator.getGraphe(), projet_.impl_)); + _controller.addFonctionsSpecific(listeActions); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java 2008-09-25 15:13:21 UTC (rev 3981) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarTarageCourbesManager.java 2008-09-25 15:22:02 UTC (rev 3982) @@ -13,19 +13,18 @@ import javax.swing.Action; -import com.memoire.bu.BuInformationsDocument; - +import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluHtmlWriter; import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluHelpComponent; - import org.fudaa.dodico.h2d.resource.H2dResource; import org.fudaa.dodico.h2d.rubar.H2dRubarTarageListener; import org.fudaa.dodico.h2d.rubar.H2dRubarTarageMng; import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.dodico.mesure.EvolutionReguliereAbstract; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; - +import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGAxeVertical; @@ -33,7 +32,6 @@ import org.fudaa.ebli.courbe.EGFilleSimple; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGTableGraphePanel; - import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.tr.common.TrCourbeUseAction; @@ -41,6 +39,8 @@ import org.fudaa.fudaa.tr.common.TrResource; import org.fudaa.fudaa.tr.common.TrRubarCourbeTarageUseFinder; +import com.memoire.bu.BuInformationsDocument; + /** * @author Fred Deniger * @version $Id: TrRubarTarageCourbesManager.java,v 1.25 2007-04-30 14:22:40 deniger Exp $ @@ -149,4 +149,7 @@ return true; } + public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-09-25 15:13:29
|
Revision: 3981 http://fudaa.svn.sourceforge.net/fudaa/?rev=3981&view=rev Author: emmanuel_martin Date: 2008-09-25 15:13:21 +0000 (Thu, 25 Sep 2008) Log Message: ----------- Ajout de la projection d'un point sur un plan et de son teste. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-25 13:34:36 UTC (rev 3980) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-25 15:13:21 UTC (rev 3981) @@ -9,6 +9,10 @@ import java.util.List; +import org.fudaa.ctulu.CtuluLibGeometrie; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.ProgressionUpdater; +import org.fudaa.ctulu.gui.CtuluValueEditorDefaults; import org.geotools.feature.AttributeType; import com.vividsolutions.jts.algorithm.CGAlgorithms; @@ -22,11 +26,6 @@ import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.LinearRing; -import org.fudaa.ctulu.CtuluLibGeometrie; -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.ctulu.ProgressionUpdater; -import org.fudaa.ctulu.gui.CtuluValueEditorDefaults; - /** * @author deniger * @version $Id$ @@ -388,7 +387,38 @@ * @return LE point 3D sur le plan de projection. */ public static GISPoint projectOnPlane(GISPoint[] _plan, GISPoint _pt) { - return null; + // Teste si on a toute les donn\xE9es + if (_plan==null||_pt==null||_plan.length<3||_plan[0]==null||_plan[1]==null||_plan[2]==null) + return null; + // On nomme : a, b, c les trois points d\xE9finissant le plan + double xa=_plan[0].getX(), ya=_plan[0].getY(), za=_plan[0].getZ(), + xb=_plan[1].getX(), yb=_plan[1].getY(), zb=_plan[1].getZ(), + xc=_plan[2].getX(), yc=_plan[2].getY(), zc=_plan[2].getZ(); + // Teste que les trois points d\xE9finissant le plan sont diff\xE9rents + if ((xa==xb&&ya==yb&&za==zb)||(xb==xc&&yb==yc&&zb==zc)||(xa==xc&&ya==yc&&za==zc)) + return null; + // On nomme : i le point \xE0 projeter ; p le point projet\xE9. + double xi=_pt.getX(), yi=_pt.getY(), zi=_pt.getZ(), + xp, yp, zp; + // Calcul du vecteur ab nomm\xE9 v + double xv = xb - xa, + yv = yb - ya, + zv = zb - za; + // Calcul du vecteur ac nomm\xE9 u + double xu = xc - xa, + yu = yc - ya, + zu = zc - za; + // Calcul du vecteur w d\xE9fini comme le produit vectoriel entre v et u + double xw = yu*zv - zu*yv, + yw = zu*xv - xu*zv, + zw = xu*yv - yu*xv; + // On calcul k qui est d\xE9fini tel que : vecteur(ip) = k * w + double k = ((xa+xi)*xw+(ya+yi)*yw+(za+zi)*zw)/(xw*xw+yw*yw+zw*zw); + // Calcul des coordonn\xE9es de p + xp = xi + k*xw; + yp = yi + k*yw; + zp = zi + k*zw; + return new GISPoint(xp, yp, zp); } public static Envelope computeEnveloppe(final GISDataModel[] _models, final ProgressionInterface _prog) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java 2008-09-25 13:34:36 UTC (rev 3980) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestJGIS.java 2008-09-25 15:13:21 UTC (rev 3981) @@ -14,16 +14,15 @@ import junit.framework.TestCase; +import org.fudaa.ctulu.CtuluCommandComposite; +import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.gis.mif.MIFStringTokenizer; + import com.vividsolutions.jts.algorithm.NonRobustLineIntersector; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.LinearRing; import com.vividsolutions.jts.geom.Polygon; -import org.fudaa.ctulu.CtuluCommandComposite; -import org.fudaa.ctulu.CtuluLibString; -import org.fudaa.ctulu.gis.mif.MIFFileTokenizer; -import org.fudaa.ctulu.gis.mif.MIFStringTokenizer; - /** * @author Fred Deniger * @version $Id: TestJGIS.java,v 1.6 2007-05-21 10:28:31 deniger Exp $ @@ -34,6 +33,24 @@ } + public void testProjectOnPlane(){ + // Cas g\xE9n\xE9ral + GISPoint[] plan = {new GISPoint(1, 0, 0), new GISPoint(0, 1, 0), new GISPoint(0, 0, 1)}; + GISPoint result = GISLib.projectOnPlane(plan, new GISPoint(0, 0, 0)); + assertEquals(result.getX(), 1/3., 0.0000001); + assertEquals(result.getY(), 1/3., 0.0000001); + assertEquals(result.getZ(), 1/3., 0.0000001); + // Test de robustesse : valeur null + assertNull(GISLib.projectOnPlane(null, new GISPoint(0, 0, 0))); + assertNull(GISLib.projectOnPlane(plan, null)); + plan[1] = null; + assertNull(GISLib.projectOnPlane(plan, new GISPoint(0, 0, 0))); + // Test de robustesse : plan mal d\xE9fini + plan[1] = plan[0]; + assertNull(GISLib.projectOnPlane(plan, new GISPoint(0, 0, 0))); + GISPoint[] plan2 = {new GISPoint(0, 1, 0), new GISPoint(0, 0, 1)}; + assertNull(GISLib.projectOnPlane(plan2, new GISPoint(0, 0, 0))); + } public void testLTrim(){ assertEquals("", MIFStringTokenizer.ltrim("\t\t")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-09-25 13:34:40
|
Revision: 3980 http://fudaa.svn.sourceforge.net/fudaa/?rev=3980&view=rev Author: bmarchan Date: 2008-09-25 13:34:36 +0000 (Thu, 25 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-25 13:34:19 UTC (rev 3979) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-09-25 13:34:36 UTC (rev 3980) @@ -380,6 +380,16 @@ return d; } + + /** + * Projection orthonorm\xE9e d'un point sur un plan quelconque d\xE9finit par 3 points. + * @param _plan Les points 3D du plan. + * @param _pt Le point 3D \xE0 projeter. + * @return LE point 3D sur le plan de projection. + */ + public static GISPoint projectOnPlane(GISPoint[] _plan, GISPoint _pt) { + return null; + } public static Envelope computeEnveloppe(final GISDataModel[] _models, final ProgressionInterface _prog) { final ProgressionUpdater up = new ProgressionUpdater(_prog); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-09-25 13:34:26
|
Revision: 3979 http://fudaa.svn.sourceforge.net/fudaa/?rev=3979&view=rev Author: emmanuel_martin Date: 2008-09-25 13:34:19 +0000 (Thu, 25 Sep 2008) Log Message: ----------- exemple d'utilisation du package courbe. Added Paths: ----------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheSimple.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheTree.java Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheSimple.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheSimple.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheSimple.java 2008-09-25 13:34:19 UTC (rev 3979) @@ -0,0 +1,164 @@ +/* + * @creation 25 sept. 2008 + * @modification $Date:$ + * @license GNU General Public License 2 + * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.ebli.all; + +import java.awt.Color; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.GridLayout; + +import javax.swing.JFrame; + +import org.fudaa.ctulu.iterator.LogarithmicNumberIterator; +import org.fudaa.ebli.commun.EbliActionInterface; +import org.fudaa.ebli.commun.EbliComponentFactory; +import org.fudaa.ebli.courbe.EGAxeHorizontal; +import org.fudaa.ebli.courbe.EGAxeVertical; +import org.fudaa.ebli.courbe.EGCourbeModelDefault; +import org.fudaa.ebli.courbe.EGCourbeSimple; +import org.fudaa.ebli.courbe.EGFillePanel; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheSimpleModel; +import org.fudaa.ebli.trace.TraceLigne; +import org.fudaa.ebli.trace.TraceLigneModel; + +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuPanel; + +/** + * Tutorial sur la cr\xE9ation de graphe avec une seule courbe. + * + * L'objectif de ce code est d'afficher une fen\xEAtre avec en son centre une + * zone avec un rep\xE8re (axe x et y) et une s\xE9rie d'action disponible sous + * forme de boutons \xE0 gauche du graphe. + * Un diagramme de classe simplifi\xE9 du package src:org.fudaa.ebli.courbe est + * disponible dans le package test:org.fudaa.ebli.all + * + * Ce tutorial en accompagne un autre permettant de r\xE9aliser un graphe + * avec plusieurs courbes. + * + * @author Emmanuel MARTIN + * @version $Id:$ + */ +public class TestGrapheSimple { + + private TestGrapheSimple(){} + + public static void main(final String[] _args) { + // Graphe model et graphe vue \\ + /* + * Chaque notion est d\xE9compos\xE9 en deux formes : le model et la vue. + * Ainsi le graphe (le conteneur g\xE9rant l'affichage des courbes dans + * le rep\xE8re) est d\xE9compos\xE9 en graphe model et graphe vue. + * Nous ne voulons afficher qu'une courbe. Le model choisi pour le + * graphe est donc EGGrapheSimpleModel. + * Il existe plusieurs model de graphe (notamment EGGrapheSimpleModel) + * chacun implementant l'interface EGGrapheModel. + */ + EGGrapheSimpleModel grapheModel = new EGGrapheSimpleModel(); + /* + * La vue choisie pour ce model se nomme EGGraphe. Il n'y en a qu'une + * quelque soit le model de graphe choisi. + */ + EGGraphe grapheVue = new EGGraphe(grapheModel); + + // Axe x et axe y\\ + /* + * Pour afficher les courbes, notre graphe vue a besoin d'un rep\xE8re + * (axe x et axe y). La premi\xE8re difficult\xE9e est ici. + * Les deux axes ne sont pas r\xE9f\xE9renc\xE9 au m\xEAme endroit. L'axe des x + * est poss\xE9d\xE9 par le graphe vue, et donc est commun \xE0 l'ensemble des + * courbes. L'axe des y est poss\xE9d\xE9 par la vue de la courbe. Dans + * notre cas cette distinction n'a pas d'int\xE9ret. Dans le cas de + * l'affichage de plusieurs courbe, cette architecture est utile. + */ + EGAxeHorizontal axeX = new EGAxeHorizontal(false); + axeX.setTitre("temps"); + axeX.setUnite("sec"); + axeX.setBounds(0.0001, 1000000); // Minimum et maximum de l'axe + /* + * L'instruction suivante permet de choisir le type de graduation + * de l'axe (lin\xE9aire, logarithmique, etc...). Si cette fonction + * n'est pas appel\xE9e, le type par defaut est lin\xE9aire. + */ + axeX.setAxisIterator(new LogarithmicNumberIterator()); + axeX.setGraduations(true); + grapheVue.setXAxe(axeX); + /* + * Nous cr\xE9ons l'axe des y, mais l'utilisons lors de la cr\xE9ation de la courbe vue. + * L'axe des y poss\xE8de les m\xEAmes propri\xE9t\xE9s que l'axe des x. + */ + EGAxeVertical axeY = new EGAxeVertical(); + axeY.setGraduations(true); + /* + * La grille permet de dessiner des lignes horizontales (d\xE9crites par + * TraceLigneModel).Dans le cas o\xF9 c'est utilis\xE9 par l'axe des x, ces lignes + * seront verticales formant ainsi une grille compl\xE8te. + */ + axeY.setGrille(new TraceLigneModel(TraceLigne.LISSE, 1, Color.LIGHT_GRAY)); + axeY.setAxisIterator(new LogarithmicNumberIterator()); + axeY.setBounds(0.0001, 10000); + axeY.setLineColor(Color.blue); + axeY.setTitre("Axe Y 1"); + + // Courbe \\ + /* + * Courbe : + * Comme pour le graphe, les courbes sont divis\xE9es en courbe model et + * courbe vue. + * Les deux tableaux de doubles pass\xE9s en param\xE8tres du model sont les + * coordonn\xE9es x et les coordonn\xE9es y de la courbe. + */ + EGCourbeModelDefault courbeModel=new EGCourbeModelDefault(new double[]{0.0001, 3, 4, 1000000}, new double[]{10000, 4, 5, 3}); + EGCourbeSimple courbeVue = new EGCourbeSimple(axeY, courbeModel); + courbeVue.setAspectContour(Color.cyan); + grapheModel.addCourbe(courbeVue, null); + + // EGFillePanel et boutons \\ + /* + * EGFillePanel est le 'manager' qui contient le graphe vue. Il permet + * de g\xE9n\xE9rer des boutons pour interagir avec le graphe. Cette g\xE9n\xE9ration + * peut prendre plusieurs forme, ici nous utiliserons la fonction + * getSpecificActions qui retourne une s\xE9rie d'action permettant de + * cr\xE9er les boutons \xE0 ajouter \xE0 l'interface. + * Une autre utilisation de ces boutons est faite + * dans le tutorial TestGrapheTree. + */ + EGFillePanel egPanel = new EGFillePanel(grapheVue); + // Construction des boutons + EbliActionInterface[] actions = egPanel.getSpecificActions(); + Container containerBoutons = new Container(); + containerBoutons.setLayout(new GridLayout(12, 1)); + // Pour chaque action, on g\xE9n\xE8re un bouton correspondant + for (int i=0; i<actions.length; i++) { + if(actions[i] != null) // Certaines actions sont null pour indiquer un groupe diff\xE9rent d'action ; inutilis\xE9 ici + // Ajout du bouton correspondant \xE0 l'action dans le container + containerBoutons.add(actions[i].buildButton(EbliComponentFactory.INSTANCE)); + } + + // Construction de la fen\xEAtre \\ + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + BuPanel panel = new BuPanel(); + panel.setLayout(new BuBorderLayout()); + panel.add(egPanel, BuBorderLayout.CENTER); + panel.add(containerBoutons, BuBorderLayout.WEST); + + grapheVue.setPreferredSize(new Dimension(500, 500)); + grapheVue.setSize(grapheVue.getPreferredSize()); + + frame.add(panel); + frame.pack(); + frame.setVisible(true); + /* + * Il est n\xE9c\xE9ssaire de redimmensionner la fen\xEAtre pour que les + * courbes se dessines. + */ + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheSimple.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheTree.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheTree.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheTree.java 2008-09-25 13:34:19 UTC (rev 3979) @@ -0,0 +1,225 @@ +/* + * @creation 25 sept. 2008 + * @modification $Date:$ + * @license GNU General Public License 2 + * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.ebli.all; + +import java.awt.Color; +import java.awt.Dimension; + +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JTree; + +import org.fudaa.ctulu.iterator.LogarithmicNumberIterator; +import org.fudaa.ebli.courbe.EGAxeHorizontal; +import org.fudaa.ebli.courbe.EGAxeVertical; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGCourbeModelDefault; +import org.fudaa.ebli.courbe.EGFillePanel; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.trace.TraceLigne; +import org.fudaa.ebli.trace.TraceLigneModel; + +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuPanel; +import com.memoire.bu.BuScrollPane; + +/** + * Tutorial sur la cr\xE9ation de graphe avec un arbre de courbe. + * + * L'objectif de ce code est d'afficher une fen\xEAtre avec en son centre une + * zone avec un rep\xE8re (axe x et y) et une ou plusieurs courbes affich\xE9es, + * dans un menu une s\xE9rie d'action r\xE9alisables sur le graphe et les courbes, + * et enfin \xE0 la droite une s\xE9rie de courbes repr\xE9sent\xE9es sous forme d'arbre + * permettant de choisir la courbe selectionn\xE9e. + * Un diagramme de classe simplifi\xE9 du package src:org.fudaa.ebli.courbe est + * disponible dans le package test:org.fudaa.ebli.all + * + * Ce tutorial en accompagne un autre permettant de r\xE9aliser un graphe + * simple. C'est \xE0 dire ne poss\xE9dant qu'une seule courbe, sans notion + * d'arbre de courbe. + * + * Ce tutorial reprend quasi int\xE9gralement le code fourni par Fred Deniger + * dans TestGraphe2.java + * + * @author Emmanuel MARTIN + * @version $Id:$ + */ +public class TestGrapheTree { + + private TestGrapheTree(){} + + public static void main(final String[] _args) { + // Graphe model et graphe vue \\ + /* + * Chaque notion est d\xE9compos\xE9 en deux formes : le model et la vue. + * Ainsi le graphe (le conteneur g\xE9rant l'affichage des courbes dans + * le rep\xE8re) est d\xE9compos\xE9 en graphe model et graphe vue. + * Nous voulons pouvoir afficher plusieurs courbes. Le model choisi + * pour le graphe est donc EGGrapheTreeModel. + * Il existe plusieurs model de graphe (notamment EGGrapheSimpleModel) + * chacun implementant l'interface EGGrapheModel. + */ + EGGrapheTreeModel grapheModel = new EGGrapheTreeModel(); + /* + * La vue choisie pour ce model se nomme EGGraphe. Il n'y en a qu'une + * quelque soit le model de graphe choisi. + */ + EGGraphe grapheVue = new EGGraphe(grapheModel); + + // Axe x \\ + /* + * Pour afficher les courbes, notre graphe vue a besoin d'un rep\xE8re + * (axe x et axe y). La premi\xE8re difficult\xE9e est ici. + * Les deux axes ne sont pas r\xE9f\xE9renc\xE9 au m\xEAme endroit. L'axe des x + * est poss\xE9d\xE9 par le graphe vue, et donc est commun \xE0 l'ensemble des + * courbes. L'axe des y est poss\xE9d\xE9 par un groupe de courbe de l'arbre. + * Ainsi il n'y aura qu'un seul axe des x sur le rep\xE8re, mais plusieurs + * axes des y (un pour chaque groupe). + */ + EGAxeHorizontal axeX = new EGAxeHorizontal(false); + axeX.setTitre("temps"); + axeX.setUnite("sec"); + axeX.setBounds(0.0001, 1000000); // Minimum et maximum de l'axe + /* + * L'instruction suivante permet de choisir le type de graduation + * de l'axe (lin\xE9aire, logarithmique, etc...). Si cette fonction + * n'est pas appel\xE9e, le type par defaut est lin\xE9aire. + */ + axeX.setAxisIterator(new LogarithmicNumberIterator()); + axeX.setGraduations(true); + grapheVue.setXAxe(axeX); + + // Groupes, courbes et axe y \\ + /* + * Cr\xE9ation d'un des deux groupes de courbes que nous allons placer dans + * l'arbre. Ces groupes poss\xE8dent une s\xE9rie de courbes, un axe y et un + * titre. + */ + EGGroup groupe = new EGGroup(); + groupe.setTitle("groupe 1"); + /* + * Courbe : + * Comme pour le graphe, les courbes sont divis\xE9es en courbe model et + * courbe vue. + * Les deux tableaux de doubles pass\xE9s en param\xE8tres du model sont les + * coordonn\xE9es x et les coordonn\xE9es y de la courbe. Le titre d'un + * model correspond au nom qui sera affich\xE9 dans l'arbre pour cette + * courbe. + * La vue utilis\xE9e ici est sp\xE9cialement cr\xE9e pour pouvoir + * s'int\xE9grer au groupe auquel elle apartient. + */ + // Premi\xE8re courbe de ce groupe + EGCourbeModelDefault courbeModel=new EGCourbeModelDefault(new double[]{0.0001, 3, 4, 1000000}, new double[]{10000, 4, 5, 3}); + courbeModel.setTitle("Coubre bleue"); + EGCourbeChild courbeVue = new EGCourbeChild(groupe); + courbeVue.setModel(courbeModel); + courbeVue.setAspectContour(Color.cyan); + groupe.addEGComponent(courbeVue); + // Seconde courbe de ce groupe + courbeModel = new EGCourbeModelDefault(new double[] { 0.0002, 5, 7, 900000 }, new double[] { 0.001, 1, 3, 4 }); + courbeModel.setTitle("Courbe rouge"); + courbeVue = new EGCourbeChild(groupe); + courbeVue.setAspectContour(Color.RED); + courbeVue.setModel(courbeModel); + groupe.addEGComponent(courbeVue); + /* + * L'axe des y poss\xE8de les m\xEAmes propri\xE9t\xE9s que l'axe des x. + */ + EGAxeVertical axeY = new EGAxeVertical(); + axeY.setGraduations(true); + /* + * La grille permet de dessiner des lignes horizontales (d\xE9crites par + * TraceLigneModel).Dans le cas o\xF9 c'est utilis\xE9 par l'axe des x, ces lignes + * seront verticales formant ainsi une grille compl\xE8te. + */ + axeY.setGrille(new TraceLigneModel(TraceLigne.LISSE, 1, Color.LIGHT_GRAY)); + axeY.setAxisIterator(new LogarithmicNumberIterator()); + axeY.setBounds(0.0001, 10000); + axeY.setLineColor(Color.blue); + axeY.setTitre("Axe Y 1"); + groupe.setAxeY(axeY); + grapheModel.add(groupe); + // Construction du second groupe + groupe = new EGGroup(); + groupe.setTitle("groupe 2"); + // Premi\xE8re courbe de ce second groupe + courbeModel = new EGCourbeModelDefault(new double[] { 1, 8, 9, 10 }, new double[] { 10, 4, 2, 24 }); + courbeModel.setTitle("Courbe jaune"); + courbeVue = new EGCourbeChild(groupe); + courbeVue.setAspectContour(Color.yellow); + courbeVue.setModel(courbeModel); + groupe.addEGComponent(courbeVue); + // Seconde courbe de ce second groupe + courbeModel = new EGCourbeModelDefault(new double[] { 1, 3, 4, 5 }, new double[] { 14, 54, 25, 43 }); + courbeModel.setTitle("Courbe vert"); + courbeVue = new EGCourbeChild(groupe); + courbeVue.setAspectContour(Color.green); + courbeVue.setModel(courbeModel); + groupe.addEGComponent(courbeVue); + // Axe des y de ce second groupe + axeY = new EGAxeVertical(); + axeY.setDroite(true); // Emplacement de l'axe \xE0 droite du graphe. + axeY.setGraduations(true); + axeY.setBounds(0, 55); + axeY.setTitre("Axe Y 2"); + groupe.setAxeY(axeY); + grapheModel.add(groupe); + + // La vue de l'arbre \\ + /* + * C'est le graphe model qui contient les groupes. On peut donc le + * consid\xE9rer \xE9galement comme le model de l'arbre. + * Donc la vue de l'abre (ici un simple JTree) viendra utilise le + * graphe model. + */ + JTree arbreVue = new JTree(grapheModel); + arbreVue.setSelectionModel(grapheModel.getSelectionModel()); + arbreVue.setRootVisible(false); + + // EGFillePanel et menu\\ + /* + * EGFillePanel est le 'manager' qui contient le graphe vue. Il permet + * de g\xE9n\xE9rer des boutons pour interagir avec le graphe. Cette g\xE9n\xE9ration + * peut prendre plusieurs forme, ici nous utiliserons la fonction + * fillSpecificMenu qui rempli le menu pass\xE9 en param\xE8tre de tout les + * boutons n\xE9c\xE9ssaires. Une autre utilisation de ces boutons est faite + * dans le tutorial TestGrapheSimple. + */ + EGFillePanel egPanel = new EGFillePanel(grapheVue); + JMenu menu = new JMenu(); + menu.setName("Nom menu"); + menu.setText("Texte menu"); + egPanel.fillSpecificMenu(menu); + JMenuBar menuBarre = new JMenuBar(); + menuBarre.add(menu); + + // Construction de la fen\xEAtre \\ + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setJMenuBar(menuBarre); + + BuPanel panel = new BuPanel(); + panel.setLayout(new BuBorderLayout()); + panel.add(egPanel, BuBorderLayout.CENTER); + panel.add(new BuScrollPane(arbreVue), BuBorderLayout.EAST); + + grapheVue.setPreferredSize(new Dimension(200, 300)); + grapheVue.setSize(grapheVue.getPreferredSize()); + + frame.getContentPane().add(panel); + frame.pack(); + frame.setVisible(true); + /* + * Il est n\xE9c\xE9ssaire de redimmensionner la fen\xEAtre pour que les + * courbes se dessines. + */ + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/test/org/fudaa/ebli/all/TestGrapheTree.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-24 21:17:49
|
Revision: 3978 http://fudaa.svn.sourceforge.net/fudaa/?rev=3978&view=rev Author: deniger Date: 2008-09-24 21:17:45 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java 2008-09-24 21:15:55 UTC (rev 3977) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java 2008-09-24 21:17:45 UTC (rev 3978) @@ -2,7 +2,6 @@ import java.awt.Dimension; import java.awt.Font; -import java.awt.FontMetrics; import java.awt.Rectangle; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |