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: <bma...@us...> - 2009-02-11 10:57:36
|
Revision: 4455 http://fudaa.svn.sourceforge.net/fudaa/?rev=4455&view=rev Author: bmarchan Date: 2009-02-11 10:57:27 +0000 (Wed, 11 Feb 2009) Log Message: ----------- Correction jonction de 2 multipoints. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZSceneEditor.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZSceneEditor.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZSceneEditor.java 2009-02-11 09:59:58 UTC (rev 4454) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZSceneEditor.java 2009-02-11 10:57:27 UTC (rev 4455) @@ -137,7 +137,7 @@ * Pour 2 polylignes, selection de 2 sommets extremit\xE9. */ public void joinSelectedObjects() { - int[] idxs=getScene().getLayerSelectionMulti().getIdxSelected(); + int[] idxs=getScene().getSelectionHelper().getSelectedIndexes(); ZCalqueEditable cq=(ZCalqueEditable)getScene().getLayerForId(idxs[0]); cq.joinSelectedObjects(mng_); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2009-02-11 10:00:03
|
Revision: 4454 http://fudaa.svn.sourceforge.net/fudaa/?rev=4454&view=rev Author: emmanuel_martin Date: 2009-02-11 09:59:58 +0000 (Wed, 11 Feb 2009) Log Message: ----------- Correction d'un bug relatif ?\195?\160 la tache #128 Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/CutCopyPasteManager.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/CutCopyPasteManager.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/CutCopyPasteManager.java 2009-02-10 17:30:15 UTC (rev 4453) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/CutCopyPasteManager.java 2009-02-11 09:59:58 UTC (rev 4454) @@ -45,7 +45,7 @@ * G\xE8re les fonctions de couper/coller/copier de la fen\xEAtre 2d. * * @author Emmanuel MARTIN - * @version $Id:$ + * @version $Id$ */ public class CutCopyPasteManager { /** La fen\xEAtre 2d \xE0 g\xE9rer. */ @@ -213,7 +213,7 @@ modelCache.getGeomData().setAttributes(modelSource.getGeomData().getAttributes(), null); // Remplissage du mod\xE8le for (int i=0; i<entry.getValue().size(); i++) { - int idxGeom=zScene_.sceneId2LayerId(entry.getValue().get(i)); + int idxGeom=entry.getValue().get(i); Geometry geom=modelSource.getGeomData().getGeometry(idxGeom); GISAttributeModel[] models=modelSource.getGeomData().getModels(); Object[] data=new Object[models.length]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-02-10 17:30:20
|
Revision: 4453 http://fudaa.svn.sourceforge.net/fudaa/?rev=4453&view=rev Author: hadouxad Date: 2009-02-10 17:30:15 +0000 (Tue, 10 Feb 2009) Log Message: ----------- lot 4 Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuVfsOperations.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluHtmlEditorPanel.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java 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/ScopeSFileFormat.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaEditorInterne.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/ressource/fudaa_en.fr_txt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrExplorer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrResource.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/dialogSpec/TrPostWizardCreateScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFilter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFormat.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuVfsOperations.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuVfsOperations.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuVfsOperations.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -18,6 +18,8 @@ import javax.swing.JOptionPane; +import org.fudaa.ctulu.CtuluRemoveContentDirectory; + import com.memoire.fu.FuComparator; import com.memoire.fu.FuLog; import com.memoire.vfs.VfsFile; @@ -275,7 +277,20 @@ boolean failed=false; if(TRACE&&FuLog.isTrace()) FuLog.trace("BVO: delete "+src); - try { failed=!src.delete(); } + try { + if(src.isDirectory()){ + try{ + CtuluRemoveContentDirectory.contentDirectoryRemover(src); + failed=!src.delete(); + //failed=false; + }catch(Exception e){ + failed=true; + } + } + else + failed=!src.delete(); + + } catch(Exception ex) { failed=true; } if(failed) { Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluRemoveContentDirectory.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -71,8 +71,10 @@ File[] listing2 = ToDel.listFiles(); - if(listing2==null || listing2.length==0) + if(listing2==null || listing2.length==0){ + ToDel.delete(); return; + } for (int i= 0;i<listing2.length; i++) { // ...verifie si c'est un fichier if (listing2[i].isFile()) { Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluHtmlEditorPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluHtmlEditorPanel.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluHtmlEditorPanel.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -103,7 +103,7 @@ pn.add(ctuluHtmlEditorPanel.getToolBar(true), BuBorderLayout.NORTH); ctuluHtmlEditorPanel.setFrame(f); f.setJMenuBar(ctuluHtmlEditorPanel.getMenuBar()); - + f.setContentPane(pn); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.pack(); Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeGENEFileFormat.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -12,6 +12,9 @@ import org.fudaa.dodico.fichiers.FileFormatSoftware; import org.fudaa.dodico.mesure.EvolutionFileFormatVersion; + +import com.memoire.bu.BuIcon; + /** * Manager de fichiers au format scope. Utilis\xE9 pour la cr\xE9ation des graphes. au * format SCOPGENE @@ -32,7 +35,7 @@ private ScopeGENEFileFormat() { super(1); - extensions_ = new String[] { ScopeKeyWord.TYPE_COURBE_MIXTE }; + extensions_ = new String[] { ScopeKeyWord.TYPE_COURBE_MIXTE,ScopeKeyWord.TYPE_COURBE_MIXTE2,ScopeKeyWord.TYPE_COURBE_MIXTE3,ScopeKeyWord.TYPE_COURBE_MIXTE4,ScopeKeyWord.TYPE_COURBE_MIXTE5 }; id_ = "SCOPE"; nom_ = "Scope"; description_ = DodicoLib.getS("Comporte les d\xE9finitions de courbes temporelles et spatiales."); @@ -55,4 +58,7 @@ return super.read(_f, _prog); } + + + } \ No newline at end of file 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 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeKeyWord.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -11,9 +11,26 @@ private final String version_ = "1.0"; private final String blocCommentaireSorT_ = "'"; private final String blocCommentaireGene_ = "/"; + public final static String TYPE_COURBE_TEMPORELLE = "ScopS"; + public final static String TYPE_COURBE_TEMPORELLE2 = "scops"; + public final static String TYPE_COURBE_TEMPORELLE3 = "SCOPS"; + public final static String TYPE_COURBE_TEMPORELLE4 = "SCOPES"; + public final static String TYPE_COURBE_TEMPORELLE5 = "scopes"; + public final static String TYPE_COURBE_SPATIALE = "ScopT"; + public final static String TYPE_COURBE_SPATIALE2 = "scopt"; + public final static String TYPE_COURBE_SPATIALE3 = "scopet"; + public final static String TYPE_COURBE_SPATIALE4 = "SCOPT"; + public final static String TYPE_COURBE_SPATIALE5 = "SCOPET"; + public final static String TYPE_COURBE_MIXTE = "SCOPGENE"; + public final static String TYPE_COURBE_MIXTE2 = "scopgene"; + public final static String TYPE_COURBE_MIXTE3= "scopegene"; + public final static String TYPE_COURBE_MIXTE4 = "SCOPEGENE"; + public final static String TYPE_COURBE_MIXTE5= "ScopGEn"; + + public final static String SYMBOL_VALUE_UNDEFINED = "*"; public final static long VALUE_UNDEFINED = 9999999; Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeSFileFormat.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -32,7 +32,7 @@ private ScopeSFileFormat() { super(1); - extensions_ = new String[] { ScopeKeyWord.TYPE_COURBE_TEMPORELLE }; + extensions_ = new String[] { ScopeKeyWord.TYPE_COURBE_TEMPORELLE,ScopeKeyWord.TYPE_COURBE_TEMPORELLE2,ScopeKeyWord.TYPE_COURBE_TEMPORELLE3,ScopeKeyWord.TYPE_COURBE_TEMPORELLE4,ScopeKeyWord.TYPE_COURBE_TEMPORELLE5}; id_ = "SCOPE"; nom_ = "Scope"; description_ = DodicoLib.getS("Comporte les d\xE9finitions de courbes temporelles et spatiales."); Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeTFileFormat.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -32,7 +32,7 @@ private ScopeTFileFormat() { super(1); - extensions_ = new String[] { ScopeKeyWord.TYPE_COURBE_SPATIALE }; + extensions_ = new String[] { ScopeKeyWord.TYPE_COURBE_SPATIALE,ScopeKeyWord.TYPE_COURBE_SPATIALE2,ScopeKeyWord.TYPE_COURBE_SPATIALE3,ScopeKeyWord.TYPE_COURBE_SPATIALE4,ScopeKeyWord.TYPE_COURBE_SPATIALE5 }; id_ = "SCOPE"; nom_ = "Scope"; description_ = DodicoLib.getS("Comporte les d\xE9finitions de courbes temporelles et spatiales."); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -153,10 +153,10 @@ fileChoosen_=fileToReload; //-- on avance \xE0 l'\xE9tape 2 directement --// - if(replayData_ && fileChoosen_!=null){ + if(replayData_ || fileChoosen_!=null){ panelFichier_=buildFilePanel(); this.filePath_.setText(""+fileChoosen_.getAbsolutePath()); - typeFormat_=devineTypeWithExtension(fileChoosen_.getName()); + typeFormat_=devineTypeWithExtension(fileChoosen_); if(typeFormat_==-1) typeFormat_=selectType("Choix du format", impl.getFrame()); try{ @@ -172,19 +172,26 @@ } - public int devineTypeWithExtension(String name){ - - for(int i=0;i<ScopeSFileFormat.getInstance().getExtensions().length;i++) - if(name.contains(ScopeSFileFormat.getInstance().getExtensions()[i]) || name.contains(ScopeSFileFormat.getInstance().getExtensions()[i].toLowerCase())) - return 0; - for(int i=0;i<ScopeTFileFormat.getInstance().getExtensions().length;i++) - if(name.contains(ScopeSFileFormat.getInstance().getExtensions()[i])|| name.contains(ScopeSFileFormat.getInstance().getExtensions()[i].toLowerCase())) + public int devineTypeWithExtension(File _file){ + BuFileFilter filterScopeS=ScopeSFileFormat.getInstance().createFileFilter(); + BuFileFilter filterScopeT=ScopeTFileFormat.getInstance().createFileFilter(); + BuFileFilter filterScopeGENE=ScopeGENEFileFormat.getInstance().createFileFilter(); + +// for(int i=0;i<ScopeSFileFormat.getInstance().getExtensions().length;i++) +// if(name.contains(ScopeSFileFormat.getInstance().getExtensions()[i]) || name.contains(ScopeSFileFormat.getInstance().getExtensions()[i].toLowerCase())) + + if(filterScopeS.accept(_file)) + return 0; +// for(int i=0;i<ScopeTFileFormat.getInstance().getExtensions().length;i++) +// if(name.contains(ScopeSFileFormat.getInstance().getExtensions()[i])|| name.contains(ScopeSFileFormat.getInstance().getExtensions()[i].toLowerCase())) + if(filterScopeT.accept(_file)) return 1; - for(int i=0;i<ScopeGENEFileFormat.getInstance().getExtensions().length;i++){ - String ext=ScopeGENEFileFormat.getInstance().getExtensions()[i]; - if(name.contains(ScopeGENEFileFormat.getInstance().getExtensions()[i])|| name.contains(ScopeGENEFileFormat.getInstance().getExtensions()[i].toLowerCase())) - return 2; - } +// for(int i=0;i<ScopeGENEFileFormat.getInstance().getExtensions().length;i++){ +// String ext=ScopeGENEFileFormat.getInstance().getExtensions()[i]; +// if(name.contains(ScopeGENEFileFormat.getInstance().getExtensions()[i])|| name.contains(ScopeGENEFileFormat.getInstance().getExtensions()[i].toLowerCase())) + if(filterScopeGENE.accept(_file)) + return 2; + return -1; @@ -307,7 +314,7 @@ typeFormat_=i; //-- si -1, c'est qu'on a choisi le filtre all, il faut alors le determiner --// - typeFormat_=devineTypeWithExtension(initFile.getName()); + typeFormat_=devineTypeWithExtension(initFile); //-- si le format vaut toujours -1, il faut pr\xE9ciser avec le bouton radio --// if(typeFormat_==-1){ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaEditorInterne.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaEditorInterne.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/exec/FudaaEditorInterne.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -7,17 +7,36 @@ */ package org.fudaa.fudaa.commun.exec; +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; import java.io.File; import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; +import javax.swing.AbstractButton; +import javax.swing.Action; +import javax.swing.JButton; import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; import javax.swing.JScrollPane; +import javax.swing.KeyStroke; import com.memoire.bu.BuEditorPane; +import com.memoire.bu.BuMenu; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuToolBar; import com.memoire.fu.FuLog; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.commun.EbliComponentFactory; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.fudaa.commun.FudaaLib; +import org.fudaa.fudaa.ressource.FudaaResource; /** * @author deniger * @version $Id: FudaaEditorInterne.java,v 1.13 2006-09-19 15:01:53 deniger Exp $ @@ -59,8 +78,53 @@ edit.setText(r); final JFrame f = new JFrame(_f.getAbsolutePath()); f.getContentPane().add("Center", new JScrollPane(edit)); + + BuToolBar toolbar=new BuToolBar(); + + EbliActionSimple actionSave=new EbliActionSimple(FudaaResource.FUDAA.getString("Enregistrer"),EbliResource.EBLI.getIcon("enregistrer"),"SAUVERTEXT"){ + public void actionPerformed(ActionEvent _e) { + String text=edit.getText(); + + FileOutputStream out = null; + try { + out = new FileOutputStream(_f); + out.write(text.getBytes()); + } + catch (final IOException _io) { + FuLog.warning(_io); + return; + } + finally { + try { + if (out != null) { + out.close(); + + JOptionPane.showMessageDialog(null, FudaaResource.FUDAA.getString("Modifications correctements enregistr\xE9es")); + } + } + catch (final IOException _io) { + FuLog.warning("can close io for " + _f.getAbsolutePath()); + } + } + } + }; + //actionSave.setKey(KeyStroke.getKeyStroke(KeyEvent.VK_S,InputEvent.CTRL_DOWN_MASK)); + AbstractButton bouton=actionSave.buildToolButton(EbliComponentFactory.INSTANCE); + bouton.setMnemonic(KeyEvent.VK_S); + + JMenu menu=new JMenu(FudaaResource.FUDAA.getString("Fichier")); + JMenuItem item=(JMenuItem) actionSave.buildMenuItem(EbliComponentFactory.INSTANCE); + item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,InputEvent.CTRL_DOWN_MASK)); + menu.add(item); + JMenuBar barre=new JMenuBar(); + barre.add(menu); + f.setJMenuBar(barre); + toolbar.add(bouton); + toolbar.setFloatable(false); + // f.getContentPane().add("North",toolbar); f.setSize(400, 300); f.show(); + } public String getCmd(){ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/ressource/fudaa_en.fr_txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/ressource/fudaa_en.fr_txt 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/ressource/fudaa_en.fr_txt 2009-02-10 17:30:15 UTC (rev 4453) @@ -323,4 +323,5 @@ R\xE9sultats de la derni\xE8re op\xE9ration=Results of the last task Des variables d\xE9pendantes seront \xE9galement supprim\xE9es. Voulez-vous continuer ?=Some dependant variables will be also deleted. Do you want to continue ? Sauvegarde des donn\xE9es=Data saving -Sauvegarde donn\xE9es compl\xE9mentaires=Visualisation data saving \ No newline at end of file +Sauvegarde donn\xE9es compl\xE9mentaires=Visualisation data saving +Modifications correctements enregistr\xE9es=Modifications saved with sucess 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 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -10,6 +10,7 @@ import ghm.followgui.FollowApp; import java.awt.Component; +import java.awt.EventQueue; import java.awt.Frame; import java.awt.Window; import java.awt.event.WindowAdapter; @@ -31,11 +32,15 @@ import org.fudaa.ctulu.gui.CtuluLibDialog; import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.fichiers.FileFormatSoftware; +import org.fudaa.ebli.courbe.EGFillePanel; +import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.fudaa.commun.FudaaLib; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.commun.impl.Fudaa; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.save.FudaaSaveLib; import org.fudaa.fudaa.ressource.FudaaResource; +import org.fudaa.fudaa.tr.common.TrApplicationManager; import org.fudaa.fudaa.tr.common.TrBugCommentGenerator; import org.fudaa.fudaa.tr.common.TrCommonImplementation; import org.fudaa.fudaa.tr.common.TrFileFormatManager; @@ -44,6 +49,9 @@ import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrPreferences; import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.ScopCourbeTreeModel; +import org.fudaa.fudaa.tr.post.TrPostProjet; +import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardImportScope; import org.fudaa.fudaa.tr.reflux.TrRefluxImplHelper; import org.fudaa.fudaa.tr.rubar.TrRubarImplHelper; import org.fudaa.fudaa.tr.telemac.TrTelemacImplHelper; @@ -56,6 +64,7 @@ import com.memoire.bu.BuPreferences; import com.memoire.bu.BuRegistry; import com.memoire.bu.BuResource; +import com.memoire.bu.BuWizardDialog; import com.memoire.fu.Fu; import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; @@ -409,6 +418,13 @@ * Methode appelee pour generer le trpost avec le ficheir de layout ouvert. */ public TrPostImplementation openLayoutPost(final File _f) { + + //-- version scop ou non --// + if(TrApplicationManager.isScopFormat(_f)){ + return openScopPost(_f); + + } + final TrPostImplementation alreadyOpened = findPostWithOpenedFile(_f); if (alreadyOpened != null) { alreadyOpened.setMainErrorAndClear(TrLib.getMessageAlreadyOpen(_f)); @@ -437,7 +453,43 @@ return post; } + + /** + * Methode appelee pour generer le trpost avec le fichier scop choisi (S, T ou GENE) + */ + public TrPostImplementation openScopPost(final File _f) { + final TrPostImplementation alreadyOpened = findPostWithOpenedFile(_f); + if (alreadyOpened != null) { + alreadyOpened.setMainErrorAndClear(TrLib.getMessageAlreadyOpen(_f)); + alreadyOpened.getFrame().setVisible(true); + alreadyOpened.getFrame().setState(Frame.NORMAL); + alreadyOpened.getFrame().requestFocus(); + // pour Rubar + // alreadyOpened.getCurrentProject().activate(_f); + return alreadyOpened; + } + + final TrPostImplementation post = (TrPostImplementation) launch(null, TrLauncherDefault.this, + new TrPostImplementation()); + BuLib.invokeLater(new Runnable() { + + public void run() { + if (_f != null) { + + post.cmdOuvrirScopFile(_f); + + + } + } + + }); + + return post; + + } + + public TrPostImplementation openPost(final File _f) { final TrPostImplementation alreadyOpened = findPostWithOpenedFile(_f); if (alreadyOpened != null) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrApplicationManager.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -24,6 +24,9 @@ import org.fudaa.dodico.reflux.io.INPFileFormat; import org.fudaa.dodico.rubar.io.RubarPARFileFormat; import org.fudaa.dodico.telemac.TelemacDicoFileFormat; +import org.fudaa.dodico.telemac.io.ScopeGENEFileFormat; +import org.fudaa.dodico.telemac.io.ScopeSFileFormat; +import org.fudaa.dodico.telemac.io.ScopeTFileFormat; import org.fudaa.dodico.telemac.io.SerafinFileFilter; import org.fudaa.dodico.telemac.io.SerafinFileFormat; import org.fudaa.fudaa.commun.FudaaLib; @@ -560,6 +563,22 @@ } return null; } + + + protected String ouvrirScop(final VfsFile _f, final AbstractButton _lb) { + // --si le format est du type *.POST + if (isScopFormat(_f)) { + final String res = TrResource.getPostName(); + if (_lb == null) { + launcher_.openLayoutPost(_f); + } else { + _lb.setIcon(TrResource.getScopIcon()); + } + return res; + } + return null; + } + protected String ouvrirPost(final VfsFile _f, final AbstractButton _lb) { if (isPostFormat(_f)) { @@ -581,6 +600,10 @@ String res = ouvrirEditor(_f, _lb); if (res != null) { return res; } + + //-- tentative ouverture fichier scop --// + res=ouvrirScop(_f, _lb); + if (res != null) { return res; } // -- tentative ouverture fichier type layout --// res = ouvrirPostLayout(_f, _lb); if (res != null) { return res; } @@ -864,7 +887,31 @@ public boolean isPostLayoutFormat(final File _file) { return TrPostFileFormat.getInstance().createFileFilter().accept(_file); } - + +/** + * Test si le format est scope. + * @param _file + * @return + */ + public static boolean isScopFormat(final File _file) { + boolean ok=false; + BuFileFilter scopeSFilter=ScopeSFileFormat.getInstance().createFileFilter(); + BuFileFilter scopeTFilter=ScopeTFileFormat.getInstance().createFileFilter(); + BuFileFilter scopeGENEFilter=ScopeGENEFileFormat.getInstance().createFileFilter(); + + ok=scopeSFilter.accept(_file); + if(ok) + return ok; + ok=scopeTFilter.accept(_file); + if(ok) + return ok; + ok=scopeGENEFilter.accept(_file); + + return ok; + + + } + /** * @param _file le fichier a tester * @return true si supporte par l'editeur Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrExplorer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrExplorer.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrExplorer.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -17,12 +17,16 @@ import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.fileformat.FileFormat; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.commun.FudaaUI; +import org.fudaa.fudaa.commun.exec.FudaaEditor; import org.fudaa.fudaa.commun.exec.FudaaExec; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.impl.FudaaExplorer; import org.fudaa.fudaa.tr.post.persist.TrPostFileFilter; +import org.fudaa.fudaa.tr.post.persist.TrPostFileFormat; import com.memoire.bu.BuActionEnabler; import com.memoire.bu.BuFileFilter; @@ -40,390 +44,420 @@ */ public class TrExplorer extends FudaaExplorer { - /** - * Classe permettant d'executer une commande dans un repertoire. - * - * @author Fred Deniger - * @version $Id: TrExplorer.java,v 1.23 2007-04-30 14:22:42 deniger Exp $ - */ - public class ExplorerMenuItem extends BuMenuItem { + /** + * Classe permettant d'executer une commande dans un repertoire. + * + * @author Fred Deniger + * @version $Id: TrExplorer.java,v 1.23 2007-04-30 14:22:42 deniger Exp $ + */ + public class ExplorerMenuItem extends BuMenuItem { - boolean dir_; + boolean dir_; - FudaaExec exec_; + FudaaExec exec_; - public ExplorerMenuItem(final FudaaExec _exe, final boolean _dir) { - exec_ = _exe; - dir_ = _dir; - setAction(exec_.getAction()); - } + public ExplorerMenuItem(final FudaaExec _exe, final boolean _dir) { + exec_ = _exe; + dir_ = _dir; + setAction(exec_.getAction()); + } - @Override - protected void fireActionPerformed(final ActionEvent _event) { - if (dir_) { - File dir = TrExplorer.this.getSelectedDirectory(); - if (dir == null) { - dir = getCurrentDirectory(); - } - if (dir == null) { - ui_.error(CtuluLib.getS("S\xE9lectionner au moins un dossier")); - return; - } - exec_.execInDir(dir, ui_, getRefreshRunnable()); - } else { - File f = getSelectedFile(); - // on prend le repertoire parent - if (f == null) { - f = getCurrentDirectory(); - } - if (f == null) { - ui_.error(CtuluLib.getS("S\xE9lectionner au moins un fichier")); - return; - } - exec_.execOnFile(f, ui_, getRefreshRunnable()); - } - } + @Override + protected void fireActionPerformed(final ActionEvent _event) { + if (dir_) { + File dir = TrExplorer.this.getSelectedDirectory(); + if (dir == null) { + dir = getCurrentDirectory(); + } + if (dir == null) { + ui_.error(CtuluLib.getS("S\xE9lectionner au moins un dossier")); + return; + } + exec_.execInDir(dir, ui_, getRefreshRunnable()); + } else { + File f = getSelectedFile(); + // on prend le repertoire parent + if (f == null) { + f = getCurrentDirectory(); + } + if (f == null) { + ui_.error(CtuluLib.getS("S\xE9lectionner au moins un fichier")); + return; + } + exec_.execOnFile(f, ui_, getRefreshRunnable()); + } + } - public final FudaaExec getExec() { - return exec_; - } - } + public final FudaaExec getExec() { + return exec_; + } + } - /** - * @return le dernier rep selon la pref "trexplorer.last.dir" - */ - public static String getLastDir() { - return TrPreferences.TR.getStringProperty("superviseur.last.dir", FuLib.getUserHome()); - } + /** + * @return le dernier rep selon la pref "trexplorer.last.dir" + */ + public static String getLastDir() { + return TrPreferences.TR.getStringProperty("superviseur.last.dir", FuLib.getUserHome()); + } - protected TrApplicationManager appli_; - protected FudaaUI ui_; + protected TrApplicationManager appli_; + protected FudaaUI ui_; - /** - * @param _impl l'impl parente - * @param _appli le manager d'appli - */ - public TrExplorer(final FudaaCommonImplementation _impl, final TrApplicationManager _appli) { - this(_impl, _appli, VfsFile.createFile(getLastDir())); - } + /** + * @param _impl l'impl parente + * @param _appli le manager d'appli + */ + public TrExplorer(final FudaaCommonImplementation _impl, final TrApplicationManager _appli) { + this(_impl, _appli, VfsFile.createFile(getLastDir())); + } - /** - * @param _impl l'impl parente - * @param _appli le manager d'appli - * @param _path le chemin initial - */ - public TrExplorer(final FudaaCommonImplementation _impl, final TrApplicationManager _appli, final VfsFile _path) { - super(_impl, true, _path); + /** + * @param _impl l'impl parente + * @param _appli le manager d'appli + * @param _path le chemin initial + */ + public TrExplorer(final FudaaCommonImplementation _impl, final TrApplicationManager _appli, final VfsFile _path) { + super(_impl, true, _path); - ui_ = _impl; - // miAntBuild_ = null; - // miCvsAdd_ = null; - // miCvsCommit_ = null; - // miCvsUpdate_ = null; - // miMake_ = null; - setAppliManager(_appli); - createFilters(); - viewer_.setFileRenderer(new TrFileRenderer(_appli, ui_)); - } + ui_ = _impl; + // miAntBuild_ = null; + // miCvsAdd_ = null; + // miCvsCommit_ = null; + // miCvsUpdate_ = null; + // miMake_ = null; + setAppliManager(_appli); + createFilters(); + viewer_.setFileRenderer(new TrFileRenderer(_appli, ui_)); + } - private void buildMenuForDir() { - pmDirs_.removeAll(); - appli_.buildCmdForMenuDir(pmDirs_, this); - pmDirs_.addSeparator(); - pmDirs_.addMenuItem(FudaaLib.getS("Ajouter aux favoris"), "ADD_FAVORITES", getNoneIcon(), true); - pmDirs_.addSeparator(); - pmDirs_.addMenuItem(BuResource.BU.getString("Cr\xE9er un r\xE9pertoire..."), "CREER_REPERTOIRE", BuResource.BU - .getIcon("creer"), true); - pmDirs_.addMenuItem(BuResource.BU.getString("Renommer..."), "RENOMMER_REPERTOIRE", BuResource.BU - .getIcon("renommer"), true); - pmDirs_.addMenuItem(BuResource.BU.getString("D\xE9truire..."), "DETRUIRE_REPERTOIRE", BuResource.BU - .getIcon("detruire"), true); - } + private void buildMenuForDir() { + pmDirs_.removeAll(); + appli_.buildCmdForMenuDir(pmDirs_, this); + pmDirs_.addSeparator(); + pmDirs_.addMenuItem(FudaaLib.getS("Ajouter aux favoris"), "ADD_FAVORITES", getNoneIcon(), true); + pmDirs_.addSeparator(); + pmDirs_.addMenuItem(BuResource.BU.getString("Cr\xE9er un r\xE9pertoire..."), "CREER_REPERTOIRE", BuResource.BU + .getIcon("creer"), true); + pmDirs_.addMenuItem(BuResource.BU.getString("Renommer..."), "RENOMMER_REPERTOIRE", BuResource.BU + .getIcon("renommer"), true); + pmDirs_.addMenuItem(BuResource.BU.getString("D\xE9truire..."), "DETRUIRE_REPERTOIRE", BuResource.BU + .getIcon("detruire"), true); + } - /** - * @return - */ - private BuIcon getNoneIcon() { - return BuResource.BU.getIcon("aucun"); - } + /** + * @return + */ + private BuIcon getNoneIcon() { + return BuResource.BU.getIcon("aucun"); + } - private void buildMenuForFiles() { - pmFiles_.removeAll(); - miOuvrirFichier_ = pmFiles_.addMenuItem(BuResource.BU.getString("Ouvrir"), "OUVRIR_FICHIER", true); - appli_.buildCmdForMenuFile(pmFiles_, this); - pmFiles_.addSeparator(); - pmFiles_.addMenuItem(BuResource.BU.getString("Tout s\xE9lectionner"), "TOUTSELECTIONNER", true); - pmFiles_.addSeparator(); - pmFiles_.addMenuItem(BuResource.BU.getString("Renommer..."), "RENOMMER_FICHIER", true); - pmFiles_.addMenuItem(BuResource.BU.getString("D\xE9truire..."), "DETRUIRE_FICHIER", true); - } + private void buildMenuForFiles() { + pmFiles_.removeAll(); + miOuvrirFichier_ = pmFiles_.addMenuItem(BuResource.BU.getString("Ouvrir"), "OUVRIR_FICHIER", true); + appli_.buildCmdForMenuFile(pmFiles_, this); + pmFiles_.addSeparator(); + pmFiles_.addMenuItem(BuResource.BU.getString("Tout s\xE9lectionner"), "TOUTSELECTIONNER", true); + pmFiles_.addSeparator(); + pmFiles_.addMenuItem(BuResource.BU.getString("Renommer..."), "RENOMMER_FICHIER", true); + pmFiles_.addMenuItem(BuResource.BU.getString("D\xE9truire..."), "DETRUIRE_FICHIER", true); + } - private void createFilters() { - final Object o = filters_.getSelectedItem(); - final FileFormat[] fts = TrFileFormatManager.getFormatToFilter(appli_.getSoftId()); - final int nb = fts.length; - for (int i = 0; i < nb; i++) { - addFilter(appli_.getFileFilterFor(fts[i])); - } - final BuFileFilter txt = appli_.getTxtFileFilter(); - addFilter(txt); - filters_.setSelectedItem(o); - } + private void createFilters() { + final Object o = filters_.getSelectedItem(); + final FileFormat[] fts = TrFileFormatManager.getFormatToFilter(appli_.getSoftId()); + final int nb = fts.length; + for (int i = 0; i < nb; i++) { + addFilter(appli_.getFileFilterFor(fts[i])); + } + final BuFileFilter txt = appli_.getTxtFileFilter(); + addFilter(txt); + filters_.setSelectedItem(o); + } - /** - * @param _mng le nouveau gestion des appli. - */ - private void setAppliManager(final TrApplicationManager _mng) { - appli_ = _mng; - buildMenuForDir(); - buildMenuForFiles(); - } + /** + * @param _mng le nouveau gestion des appli. + */ + private void setAppliManager(final TrApplicationManager _mng) { + appli_ = _mng; + buildMenuForDir(); + buildMenuForFiles(); + } - @Override - protected void fireFileAction(final String _action) { - if ("OUVRIR".equals(_action)) { - appli_.ouvrir(getSelectedFile()); - } - } + @Override + protected void fireFileAction(final String _action) { + if ("OUVRIR".equals(_action)) { + appli_.ouvrir(getSelectedFile()); + } + } - @Override - protected void updateMenuCurrent() { + @Override + protected void updateMenuCurrent() { - } + } - /** - * Pour etre accessible depuis inner classes. - */ - @Override - protected void updateMenuDirs() { - super.updateMenuDirs(); - } + /** + * Pour etre accessible depuis inner classes. + */ + @Override + protected void updateMenuDirs() { + super.updateMenuDirs(); + } - @Override - protected void updateMenuFiles() { - final int l = files_.getSelectedValues().length; - BuActionEnabler.setEnabledForAction(pmFiles_, "OUVRIR_FICHIER", l == 1); - BuActionEnabler.setEnabledForAction(pmFiles_, "DETRUIRE_FICHIER", l >= 1); - BuActionEnabler.setEnabledForAction(pmFiles_, "RENOMMER_FICHIER", l == 1); - pmFiles_.computeMnemonics(); - appli_.updateOuvrirMenu(miOuvrirFichier_, l, getSelectedFile()); - appli_.updateMenuFiles(l, getSelectedFile()); - } - /** - * Methode appelee lors d'un changement des applications utilisee. - */ - public void applicationPreferencesChanged() { - buildMenuForDir(); - buildMenuForFiles(); - } + BuMenuItem itemEditSetupLayout_=null; - public BuMenuItem createDirAction(final FudaaExec _ex) { - return new ExplorerMenuItem(_ex, true); - } + @Override + protected void updateMenuFiles() { + final int l = files_.getSelectedValues().length; + BuActionEnabler.setEnabledForAction(pmFiles_, "OUVRIR_FICHIER", l == 1); + BuActionEnabler.setEnabledForAction(pmFiles_, "DETRUIRE_FICHIER", l >= 1); + BuActionEnabler.setEnabledForAction(pmFiles_, "RENOMMER_FICHIER", l == 1); + pmFiles_.computeMnemonics(); + appli_.updateOuvrirMenu(miOuvrirFichier_, l, getSelectedFile()); - public ExplorerMenuItem createFileAction(final FudaaExec _ex) { - return new ExplorerMenuItem(_ex, false); - } + + //-- on degage l'editeur de texte specifique setup post si existe --// + if(itemEditSetupLayout_!=null && pmFiles_.getComponentIndex(itemEditSetupLayout_)!=-1) + pmFiles_.remove(itemEditSetupLayout_); + + //-- on v\xE9rifie qu'il s'agit d'un fichier de type POST, si oui on ajoute --// + final File selection=getSelectedFile(); + if(TrPostFileFilter.acceptDirectoryPOST(selection)){ + EbliActionSimple action=new EbliActionSimple(TrResource.getS("Editer le fichier Setup"),EbliResource.EBLI.getIcon("text"),"EDITSETUP"){ + public void actionPerformed(ActionEvent event){ + //-- recuperation du fichier setup --// + File setup=TrPostFileFormat.getInstance().getSetupFromMainDirectory(selection); + if(setup!=null) + FudaaEditor.getInstance().edit(setup); + + + } + }; + //-- on ajoute l'editeur du fichier setup en deuxieme position --// + itemEditSetupLayout_=new BuMenuItem(action); + pmFiles_.add(itemEditSetupLayout_, 1); + } + - /** - * @return le gestion de l'application - */ - public final TrApplicationManager getAppliManager() { - return appli_; - } + - Runnable refresh_; + appli_.updateMenuFiles(l, getSelectedFile()); +} - public Runnable getRefreshRunnable() { - if (refresh_ == null) { - refresh_ = new Runnable() { +/** + * Methode appelee lors d'un changement des applications utilisee. + */ +public void applicationPreferencesChanged() { + buildMenuForDir(); + buildMenuForFiles(); +} - public void run() { - refresh(); - } +public BuMenuItem createDirAction(final FudaaExec _ex) { + return new ExplorerMenuItem(_ex, true); +} - }; - } - return refresh_; - } +public ExplorerMenuItem createFileAction(final FudaaExec _ex) { + return new ExplorerMenuItem(_ex, false); +} - /** - * Sauvegarde le dernier rep. - */ - public void saveLastDir() { - if (getCurrentDirectory() != null && getCurrentDirectory().getAbsolutePath() != null) { - TrPreferences.TR.putStringProperty("superviseur.last.dir", getCurrentDirectory().getAbsolutePath()); - } - } - - - /** - * Surcharge du filtrage des fichiers et repertoires de l'explorer. - * Dans le cas du tr, cela affiche els repertoire .POST propre au post traitement dasn la vue des fichiers. - * @author Adrien Hadoux - */ - protected void updateLists0(final VfsFile _dir, BuFileFilter _filter, final Cursor _cursor, final VfsFile _sel, - final boolean _showing) { - if (EventQueue.isDispatchThread()) throw new RuntimeException("In swing thread. " + "Use updateLists() instead"); +/** + * @return le gestion de l'application + */ +public final TrApplicationManager getAppliManager() { + return appli_; +} - // long before=System.currentTimeMillis(); - // FuLog.debug("BEX: showing="+_showing); +Runnable refresh_; - if (!updating_) throw new RuntimeException("updating_ should be true"); +public Runnable getRefreshRunnable() { + if (refresh_ == null) { + refresh_ = new Runnable() { - last_ = _dir; - setProgression(10); + public void run() { + refresh(); + } - // Cursor old_cursor=null; - Runnable runnable = null; + }; + } + return refresh_; +} - runnable = new Runnable() { - public void run() { - if (!WAIT_CURSOR.equals(_cursor)) setCursor(WAIT_CURSOR); +/** + * Sauvegarde le dernier rep. + */ +public void saveLastDir() { + if (getCurrentDirectory() != null && getCurrentDirectory().getAbsolutePath() != null) { + TrPreferences.TR.putStringProperty("superviseur.last.dir", getCurrentDirectory().getAbsolutePath()); + } +} - current_.setText(FuLib.reducedPath(_dir.getAbsolutePath())); - current_.setToolTipText(_dir.getAbsolutePath()); - current_.revalidate(); - updateMenuCurrent(); - } - }; - if (_showing) SwingUtilities.invokeLater(runnable); - else - runnable.run(); +/** + * Surcharge du filtrage des fichiers et repertoires de l'explorer. + * Dans le cas du tr, cela affiche els repertoire .POST propre au post traitement dasn la vue des fichiers. + * @author Adrien Hadoux + */ +protected void updateLists0(final VfsFile _dir, BuFileFilter _filter, final Cursor _cursor, final VfsFile _sel, + final boolean _showing) { + if (EventQueue.isDispatchThread()) throw new RuntimeException("In swing thread. " + "Use updateLists() instead"); - // FuLog.debug("read "+(System.currentTimeMillis()-before)); - timestamp_ = _dir.lastModified();// System.currentTimeMillis(); + // long before=System.currentTimeMillis(); + // FuLog.debug("BEX: showing="+_showing); - String[] els = _dir.list(); - liststamp_ = liststamp(els); - // FuLog.debug("update liststamp="+liststamp_+" for "+_dir); - if (els == null) els = STRING0; - // FuLog.debug("%%% DIR="+_dir+" ["+els.length+"]"); + if (!updating_) throw new RuntimeException("updating_ should be true"); - setProgression(20); + last_ = _dir; + setProgression(10); - int l = els.length; + // Cursor old_cursor=null; + Runnable runnable = null; - final VfsFile[] dirs = new VfsFile[l + 1]; - final VfsFile[] files = new VfsFile[l]; - int nb_dirs = 0; - int nb_files = 0; + runnable = new Runnable() { + public void run() { + if (!WAIT_CURSOR.equals(_cursor)) setCursor(WAIT_CURSOR); - VfsFile pf = _dir.getParentVfsFile(); - // FuLog.debug("%%% PF="+pf); - if (pf instanceof VfsFileFile) { - String p = pf.getAbsolutePath(); - pf = new Root(p, p, ".."); - } + current_.setText(FuLib.reducedPath(_dir.getAbsolutePath())); + current_.setToolTipText(_dir.getAbsolutePath()); + current_.revalidate(); + updateMenuCurrent(); + } + }; - if (pf != null) { - pf.setViewName(".."); - dirs[0] = pf; - nb_dirs++; - } + if (_showing) SwingUtilities.invokeLater(runnable); + else + runnable.run(); - setProgression(30); + // FuLog.debug("read "+(System.currentTimeMillis()-before)); + timestamp_ = _dir.lastModified();// System.currentTimeMillis(); - // cleanFilters(); - // addFilter(filter); - // filters_.setSelectedItem(filter); + String[] els = _dir.list(); + liststamp_ = liststamp(els); + // FuLog.debug("update liststamp="+liststamp_+" for "+_dir); + if (els == null) els = STRING0; + // FuLog.debug("%%% DIR="+_dir+" ["+els.length+"]"); - for (int i = 0; i < l; i++) { - if (els[i].startsWith(".")) continue; - if (els[i].endsWith("~")) continue; - if ("CVS".equals(els[i])) continue; + setProgression(20); - VfsFile f = _dir.createChild(els[i]); + int l = els.length; - - - if (f == null) {} + final VfsFile[] dirs = new VfsFile[l + 1]; + final VfsFile[] files = new VfsFile[l]; + int nb_dirs = 0; + int nb_files = 0; - //--cas particulier: si le fichier est un repertoire .POST - //-- on place les repertoire .POST avec les fichiers --// - else - if(TrPostFileFilter.acceptDirectoryPOST(f)){ - - files[nb_files] = f; - nb_files++; - } - - - else if (f.isDirectory()) { - dirs[nb_dirs] = f; - nb_dirs++; - } else if (f.isFile()) { - // if(viewer_!=null) - // { - // String n=f.getName(); - // int p=n.lastIndexOf('.'); - // if(p>0) - // { - // String e=n.substring(p+1).toLowerCase(); - // addFilter(new BuFileFilter(e,_("Fichiers")+ - // " "+e.toUpperCase()),true); - // } - // } + VfsFile pf = _dir.getParentVfsFile(); + // FuLog.debug("%%% PF="+pf); + if (pf instanceof VfsFileFile) { + String p = pf.getAbsolutePath(); + pf = new Root(p, p, ".."); + } - if ((_filter == null) || _filter.accept(f)) { - files[nb_files] = f; - nb_files++; - } - } else { - // FuLog.debug("BEX: ignore entry "+f); - } - } + if (pf != null) { + pf.setViewName(".."); + dirs[0] = pf; + nb_dirs++; + } - // FuLog.debug("sort "+(System.currentTimeMillis()-before)); - els = null; - setProgression(40); - FuSort.sort(dirs, 0, nb_dirs); - setProgression(50); - FuSort.sort(files, 0, nb_files, getSorter()); + setProgression(30); - final int fnb_dirs = nb_dirs; - final int fnb_files = nb_files; + // cleanFilters(); + // addFilter(filter); + // filters_.setSelectedItem(filter); - - - - - if (_sel != null) _sel.build(); + for (int i = 0; i < l; i++) { + if (els[i].startsWith(".")) continue; + if (els[i].endsWith("~")) continue; + if ("CVS".equals(els[i])) continue; - runnable = new Runnable() { - public void run() { - // FuLog.debug("model"); - // dirs_.setEnabled(true); - dirs_.setEmptyText("No directory"); - dirs_.setModel(new Model(dirs, fnb_dirs)); - dirs_.revalidate(); - setProgression(60); + VfsFile f = _dir.createChild(els[i]); - // files_.setEnabled(true); - files_.setEmptyText("No file"); - files_.setModel(new Model(files, fnb_files)); - files_.revalidate(); - setProgression(70); - setProgression(80); - // FuLog.debug("end"); - repaint(); - if ((_sel != null) && !_sel.isDirectory()) files_.setSelectedValue(_sel, true); - if (!WAIT_CURSOR.equals(_cursor)) setCursor(_cursor); + if (f == null) {} - setProgression(100); - updating_ = false; - } - }; + //--cas particulier: si le fichier est un repertoire .POST + //-- on place les repertoire .POST avec les fichiers --// + else + if(TrPostFileFilter.acceptDirectoryPOST(f)){ - if (_showing) SwingUtilities.invokeLater(runnable); - else - runnable.run(); - // FuLog.debug("end "+(System.currentTimeMillis()-before)); - } + files[nb_files] = f; + nb_files++; + } - + + else if (f.isDirectory()) { + dirs[nb_dirs] = f; + nb_dirs++; + } else if (f.isFile()) { + // if(viewer_!=null) + // { + // String n=f.getName(); + // int p=n.lastIndexOf('.'); + // if(p>0) + // { + // String e=n.substring(p+1).toLowerCase(); + // addFilter(new BuFileFilter(e,_("Fichiers")+ + // " "+e.toUpperCase()),true); + // } + // } + + if ((_filter == null) || _filter.accept(f)) { + files[nb_files] = f; + nb_files++; + } + } else { + // FuLog.debug("BEX: ignore entry "+f); + } + } + + // FuLog.debug("sort "+(System.currentTimeMillis()-before)); + els = null; + setProgression(40); + FuSort.sort(dirs, 0, nb_dirs); + setProgression(50); + FuSort.sort(files, 0, nb_files, getSorter()); + + final int fnb_dirs = nb_dirs; + final int fnb_files = nb_files; + + + + + + if (_sel != null) _sel.build(); + + runnable = new Runnable() { + public void run() { + // FuLog.debug("model"); + // dirs_.setEnabled(true); + dirs_.setEmptyText("No directory"); + dirs_.setModel(new Model(dirs, fnb_dirs)); + dirs_.revalidate(); + setProgression(60); + + // files_.setEnabled(true); + files_.setEmptyText("No file"); + files_.setModel(new Model(files, fnb_files)); + files_.revalidate(); + setProgression(70); + + setProgression(80); + // FuLog.debug("end"); + repaint(); + + if ((_sel != null) && !_sel.isDirectory()) files_.setSelectedValue(_sel, true); + if (!WAIT_CURSOR.equals(_cursor)) setCursor(_cursor); + + setProgression(100); + updating_ = false; + } + }; + + if (_showing) SwingUtilities.invokeLater(runnable); + else + runnable.run(); + // FuLog.debug("end "+(System.currentTimeMillis()-before)); +} + + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrFileRenderer.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -112,9 +112,12 @@ if (mng_.isPostFormat(_file)) { return TrResource.getPostIcon(); } if (mng_.isPostLayoutFormat(_file)) { return TrResource.getPostLayoutIcon(); } if (mng_.getTxtFileFilter().accept(_file)) { return BuResource.BU.getToolIcon("texte"); } + if(TrApplicationManager.isScopFormat(_file)){ return TrResource.getScopIcon(); } }else - if(TrPostFileFilter.acceptDirectoryPOST(_file)) - { return TrResource.getPostLayoutIcon(); } + if(TrPostFileFilter.acceptDirectoryPOST(_file)){ + return TrResource.getPostLayoutIcon(); + } + return super.getIcon(_file); } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrResource.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrResource.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrResource.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -8,6 +8,7 @@ */ package org.fudaa.fudaa.tr.common; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.fudaa.fdico.FDicoResource; import org.fudaa.fudaa.ressource.FudaaResource; @@ -62,6 +63,10 @@ return TrResource.TR.getIcon("crystal16_browser.png"); } + public static BuIcon getScopIcon() { + return EbliResource.EBLI.getIcon("curves"); + } + public static String getPostName() { return TrResource.getS("Post"); } 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 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -21,13 +21,19 @@ import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gui.CtuluLibDialog; import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; +import org.fudaa.ebli.courbe.EGFillePanel; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.fudaa.tr.common.TrApplicationManager; import org.fudaa.fudaa.tr.common.TrCommonImplementation; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.fudaa.fudaa.tr.post.actions.TrPostActionChooseAndCreateCalque; +import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardCreateScope; +import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardImportScope; import com.memoire.bu.BuLib; import com.memoire.bu.BuMenu; +import com.memoire.bu.BuWizardDialog; /** * @author Fred Deniger @@ -40,6 +46,9 @@ public final TrPostProjet getCurrentProject() { return c_; } + public final void setCurrentProject(TrPostProjet _c) { + c_=_c; + } /** * @return toutes les fenetres de PostLayout @@ -294,6 +303,7 @@ * @param _f */ public void cmdOuvrirLayoutFile(final File _f) { + if (c_ == null) { // setProjet(new TrPostProjet(TrPostCommonImplementation.this)); c_ = new TrPostProjet(TrPostCommonImplementation.this); @@ -311,12 +321,91 @@ } BuLib.invokeLater(new Runnable() { public void run() { + c_.getManager().loadProject(true, _f); } }); } + +public void cmdOuvrirScopFile(final File _f) { + + if (c_ == null) { + // setProjet(new TrPostProjet(TrPostCommonImplementation.this)); + c_ = new TrPostProjet(TrPostCommonImplementation.this); + c_.active(TrPostCommonImplementation.this); + BuLib.invokeNowOrLater(new Runnable() { + public void run() { + setEnabledForAction("ENREGISTRER", true); + setEnabledForAction("ENREGISTRERSOUS", true); + setEnabledForAction("IMPORTER", true); + setEnabledForAction(getImportResultsAct(), true); + setEnabledForAction("IMPORT_PROJECT", true); + setEnabledForAction("RECHERCHER", true); + } + }); + } + BuLib.invokeLater(new Runnable() { + public void run() { + + if(TrPostCommonImplementation.this.getCurrentProject()==null) + TrPostCommonImplementation.this.setCurrentProject(new TrPostProjet(TrPostCommonImplementation.this)); + + // -- creation de la trpostlayoutFille --// + final TrPostLayoutFille postFrame = new TrPostLayoutFille(getCurrentProject()); + // -- sauvegarde du persitant --// + TrPostCommonImplementation.this.addInternalFrame(postFrame); + + + //-- creation du wizard scop --// + ScopCourbeTreeModel modelGraphe=new ScopCourbeTreeModel(); + final TrPostWizardCreateScope wizard = new TrPostWizardCreateScope(TrPostCommonImplementation.this.getCurrentProject(),modelGraphe ,_f); + final BuWizardDialog DialogWizard = new BuWizardDialog(TrPostCommonImplementation.this.getFrame(), wizard); + // --affichage du wizard --// + DialogWizard.setSize(600, 600); + DialogWizard.setLocationRelativeTo(TrPostCommonImplementation.this.getFrame()); + DialogWizard.setVisible(true); + + //-- TODO: ajout d'une frame ??? --// + +// final EGGraphe graphe = new EGGraphe(modelGraphe); +// TrPostCommonImplementation.this.getCurrentProject().addGrapheNodeInCurrentScene(new EGFillePanel(graphe), _f.getName()); + } + }); + + } + + +// /** +// * Methode appelee pour creer un projet .SCOP +// * +// * @param _f +// */ +// public void cmdOuvrirScopFile(final File _f) { +// if (c_ == null) { +// // setProjet(new TrTrPostCommonImplementation.thisProjet(TrTrPostCommonImplementation.thisCommonImplementation.this)); +// c_ = new TrPostProjet(TrPostCommonImplementation.this); +// c_.active(TrPostCommonImplementation.this); +// BuLib.invokeNowOrLater(new Runnable() { +// public void run() { +// setEnabledForAction("ENREGISTRER", true); +// setEnabledForAction("ENREGISTRERSOUS", true); +// setEnabledForAction("IMPORTER", true); +// setEnabledForAction(getImportResultsAct(), true); +// setEnabledForAction("IMPORT_PROJECT", true); +// setEnabledForAction("RECHERCHER", true); +// } +// }); +// } +// BuLib.invokeLater(new Runnable() { +// public void run() { +// c_.getManager().loadProject(true, _f); +// } +// }); +// +// } + @Override public void cmdOuvrirFile(final File _f) { final TrPostCommonImplementation alreadyOpen = getLauncher().findPostWithOpenedFile(_f); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCreateScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCreateScope.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCreateScope.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -1,6 +1,7 @@ package org.fudaa.fudaa.tr.post.dialogSpec; import java.awt.event.ActionEvent; +import java.io.File; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGFillePanel; @@ -56,6 +57,15 @@ super(projet_, target); modelTarget_ = target; } + + /** + *Constructeur utilis\xE9 pour le pr\xE9chargement avec un fichier d\xE9ja connu + */ + public TrPostWizardCreateScope(final TrPostProjet projet_, final TrPostCourbeTreeModel target,File fileTocharge) { + super(projet_, target,false,fileTocharge); + modelTarget_ = target; + } + /** * Creation du graphe widget Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFilter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFilter.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFilter.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -84,6 +84,9 @@ * @author Adrien Hadoux */ public static boolean acceptDirectoryPOST(final File _f){ + + if(_f==null) + return false; if(!_f.isDirectory() || !_f.getName().contains("."+DEFAULT_EXTENSION)) return false; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFormat.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFormat.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostFileFormat.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -71,4 +71,25 @@ public FileWriteOperationAbstract createWriter() { return null; } + + + public File getSetupFromMainDirectory(File mainDir){ + + if(mainDir!=null && mainDir.isDirectory() && mainDir.exists()){ + + if(TrPostFileFilter.acceptDirectoryPOST(mainDir)){ + + String path=mainDir.getAbsolutePath(); + path+=File.separator+TrPostPersistenceManager.setupProject; + File setup=new File(path); + + if(setup!=null && setup.exists() && setup.isFile()) + return setup; + } + + } + return null; + + } + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2009-02-10 16:55:27 UTC (rev 4452) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2009-02-10 17:30:15 UTC (rev 4453) @@ -880,6 +880,7 @@ if (fileVar.isDirectory()) { CtuluRemoveContentDirectory.contentDirectoryRemover(fileVar); + } else fileVar.mkdir(); } catch (final Exception e) { // pas grave on continue This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-02-10 16:55:33
|
Revision: 4452 http://fudaa.svn.sourceforge.net/fudaa/?rev=4452&view=rev Author: bmarchan Date: 2009-02-10 16:55:27 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Tache #157 : Nouveau format libre Sinusx Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxFileFormat.java Added Paths: ----------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterAbstract.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV20.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV21.java Removed Paths: ------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxFileFormat.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxFileFormat.java 2009-02-10 10:42:29 UTC (rev 4451) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxFileFormat.java 2009-02-10 16:55:27 UTC (rev 4452) @@ -17,6 +17,7 @@ import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.fichiers.FileFormatSoftware; +import com.sun.java_cup.internal.version; /** * @author deniger @@ -25,6 +26,8 @@ public final class SinusxFileFormat extends FileFormatUnique { static final SinusxFileFormat INSTANCE = new SinusxFileFormat(); + + private String version_="2.1"; /** * @return singleton @@ -41,6 +44,18 @@ description_ = DodicoLib.getS("Comporte les d\xE9finitions de points,polylignes et polygones"); software_ = FileFormatSoftware.TELEMAC_IS; } + + /** + * Change de version de fichier. + * @param _version "2.0" : Le fichier est \xE9crit en format fixe. "2.1" : Format libre. + */ + public void setVersionName(String _version) { + version_=_version; + } + + public String getVersionName() { + return version_; + } public FileReadOperationAbstract createReader() { return new SinusxReader(this); @@ -50,8 +65,11 @@ return super.write(_f, _source, _prog); } - public FileWriteOperationAbstract createWriter() { - return new SinusxWriter(this); + public SinusxWriterAbstract createWriter() { + if ("2.0".equals(version_)) + return new SinusxWriterV20(this); + else + return new SinusxWriterV21(this); } } \ No newline at end of file Deleted: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriter.java 2009-02-10 10:42:29 UTC (rev 4451) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriter.java 2009-02-10 16:55:27 UTC (rev 4452) @@ -1,303 +0,0 @@ -/* - * @creation 2002-11-21 - * @modification $Date: 2007-05-04 13:47:27 $ - * @license GNU General Public License 2 - * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail de...@fu... - */ -package org.fudaa.dodico.telemac.io; - -import java.io.IOException; -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Locale; - -import org.fudaa.ctulu.CtuluActivity; -import org.fudaa.ctulu.CtuluLibString; -import org.fudaa.ctulu.ProgressionUpdater; -import org.fudaa.ctulu.fileformat.FileFormatVersionInterface; -import org.fudaa.ctulu.gis.GISAttributeConstants; -import org.fudaa.ctulu.gis.GISCoordinateSequenceFactory; -import org.fudaa.ctulu.gis.GISDataModel; -import org.fudaa.ctulu.gis.GISGeometry; -import org.fudaa.ctulu.gis.GISLib; -import org.fudaa.ctulu.gis.GISMultiPoint; -import org.fudaa.ctulu.gis.GISPolygone; -import org.fudaa.ctulu.gis.GISPolyligne; -import org.fudaa.ctulu.gis.GISVisitorDefault; -import org.fudaa.dodico.fortran.FileOpWriterCharSimpleAbstract; -import org.fudaa.dodico.h2d.resource.H2dResource; - -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.CoordinateSequence; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.LinearRing; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.geom.Polygon; - -/** - * @version $Id: SinusxWriter.java,v 1.24 2007-05-04 13:47:27 deniger Exp $ - * @author Fred Deniger - */ -public class SinusxWriter extends FileOpWriterCharSimpleAbstract implements CtuluActivity { - - boolean stop_; - - public void stop() { - stop_ = true; - } - - class SinusxObjectIdentifier extends GISVisitorDefault { - - boolean isClosed_; - boolean isLigne_; - boolean isNiveau_; - boolean isPt_; - - public boolean visitPoint(final Point _p) { - isPt_ = true; - isLigne_ = false; - isClosed_ = false; - isNiveau_ = false; - return true; - } - - public boolean visitPolygone(final LinearRing _p) { - isPt_ = false; - isLigne_ = true; - isClosed_ = true; - isNiveau_ = ((GISPolygone) _p).isNiveau() || GISLib.isNiveau(_p.getCoordinateSequence()); - return true; - } - - public boolean visitPolygoneWithHole(final Polygon _p) { - isPt_ = false; - isLigne_ = false; - isClosed_ = false; - isNiveau_ = false; - return true; - } - - public boolean visitPolyligne(final LineString _p) { - isPt_ = false; - isLigne_ = true; - isClosed_ = false; - isNiveau_ = ((GISPolyligne) _p).isNiveau() || GISLib.isNiveau(_p.getCoordinateSequence()); - return true; - } - } - private final String pointPlus_ = "+"; - - /** 1 formate selon les spec de sinusx. */ - private final String unString_ = "+1.000000E+00"; - - /** 0 formate selon les spec de sinusx. */ - private final String zeroString_ = "+0.000000E+00"; - - final String bi_; - - final String bs_; - - final DecimalFormat formate_ = new DecimalFormat("0.000000E00", new DecimalFormatSymbols(Locale.US)); - - final String idxoy_; - final SinusxKeyWord key_ = new SinusxKeyWord(); - final FileFormatVersionInterface v_; - - /** - * @param _v la version utilisee. - */ - public SinusxWriter(final FileFormatVersionInterface _v) { - v_ = _v; - bs_ = key_.getBlocSep(); - bi_ = key_.getBlocInfos(); - idxoy_ = key_.getIdPlanXoy(); - } - - private String courbeDefaut(final int _nb) { - final StringBuffer r = new StringBuffer(250); - for (int i = 0; i < _nb; i++) { - r.append(CtuluLibString.ESPACE).append(zeroString_); - } - return r.toString(); - } - - private void writeCoordinateSequence(final CoordinateSequence _s, final ProgressionUpdater _up, final boolean _ferme) - throws IOException { - int n = _s.size(); - if (_ferme) { - n--; - } - for (int k = 0; k < n; k++) { - writelnToOut(CtuluLibString.ESPACE + formate_.format(_s.getX(k)) + CtuluLibString.ESPACE - + formate_.format(_s.getY(k)) + CtuluLibString.ESPACE - + formate_.format(_s.getOrdinate(k, CoordinateSequence.Z)) + " A"); - if (_up != null) { - _up.majAvancement(); - } - if (stop_) { - return; - } - } - } - - private void writeEntete(final int _idx, final String _nom, final String _spec, final boolean _ferme) - throws IOException { - final StringBuffer buf = new StringBuffer(); - if (_idx == 0) { - buf.append(repereDefaut()); - } - buf.append(lineSep_); - buf.append(key_.getBlocNomEntite()).append(CtuluLibString.ESPACE).append(_nom); - buf.append(lineSep_); - // DEBUG:A voir - buf.append(bi_).append(CtuluLibString.ESPACE).append(_ferme ? key_.getCourbeFermee() : key_.getCourbeNonFermee()) - .append(CtuluLibString.ESPACE).append(key_.getCourbeReliee()); - buf.append(lineSep_); - // if(ferme) buf_.append(COURBE_NON_RELIEE) - if (_spec != null) { - buf.append(bi_).append(CtuluLibString.ESPACE).append(_spec); - buf.append(lineSep_); - } - buf.append(bi_).append(CtuluLibString.ESPACE).append(idxoy_); - writelnToOut(buf.toString()); - } - - protected void internalWrite(final Object _o) { - if (_o instanceof GISDataModel[][]) { - writeZones((GISDataModel[][]) _o); - } else { - donneesInvalides((GISDataModel[][]) _o); - } - } - - protected String profilDefaut() { - return CtuluLibString.ESPACE + zeroString_ + CtuluLibString.ESPACE + zeroString_ + CtuluLibString.ESPACE - + unString_ + CtuluLibString.ESPACE + unString_; - } - - protected String repereDefaut() { - return CtuluLibString.ESPACE + zeroString_ + CtuluLibString.ESPACE + zeroString_ + CtuluLibString.ESPACE - + zeroString_ + CtuluLibString.ESPACE + unString_ + CtuluLibString.ESPACE + unString_ + CtuluLibString.ESPACE - + unString_ + " 1"; - } - - /** - * @return la version - */ - public FileFormatVersionInterface getVersion() { - return v_; - } - - /** - * @param _zones les zones a ecrire. - */ - public void writeZones(final GISDataModel[][] _zones) { - if (_zones == null) { - analyze_.addFatalError(H2dResource.getS("Les donn\xE9es sont nulles")); - return; - } - final SinusxObjectIdentifier identifieur = new SinusxObjectIdentifier(); - final ProgressionUpdater up = new ProgressionUpdater(progress_); - if (progress_ != null) { - progress_.setProgression(0); - } - up.majProgessionStateOnly(); - int nbPoints=0; - for(int i=0;i<_zones.length;i++) - for(int j=0;j<_zones[i].length;j++) - for(int k=0;k<_zones[i][j].getNumGeometries();k++) - nbPoints+=_zones[i][j].getGeometry(k).getNumPoints(); - up.setValue(5, nbPoints); - - final String bc = key_.getBlocCommentaire(); - try { - writelnToOut(bc + "\t" + H2dResource.getS("Fichier g\xE9n\xE9r\xE9 par Fudaa")); - final String date = new SimpleDateFormat("yyyy-M-d k:mm:ss").format(Calendar.getInstance().getTime()); - writelnToOut(bc + "\tVersion " + key_.getVersion() + " - Date " + date); - writelnToOut(bc); - writelnToOut(bc); - writelnToOut(bc); - String spec; - formate_.setPositivePrefix(pointPlus_); - - // Points - GISDataModel[] models=_zones[0]; - for (int j=0; j<models.length; j++) { - if (stop_) - return; - final StringBuffer buf=new StringBuffer(50); - buf.append(bs_).append(' '); - buf.append(key_.getTypeSemis()); - writeToOut(buf.toString()); - writeEntete(j, "semis", null, false); - Coordinate[] coord=new Coordinate[models[j].getNumGeometries()]; - for (int k=0; k<coord.length; k++) - coord[k]=models[j].getGeometry(k).getCoordinate(); - writeCoordinateSequence(new GISCoordinateSequenceFactory().create(coord), up, false); - } - // Polylignes - models=_zones[1]; - for (int j=0; j<models.length; j++) { - final int nbPoly=models[j].getNumGeometries(); - int attName=models[j].getIndiceOf(GISAttributeConstants.TITRE); - for (int polyIdx=0; polyIdx<nbPoly; polyIdx++) { - if (stop_) - return; - final StringBuffer buf=new StringBuffer(); - buf.append(bs_).append(CtuluLibString.ESPACE); - final LineString geom=(LineString)models[j].getGeometry(polyIdx); - ((GISGeometry)geom).accept(identifieur); - final boolean ferme=identifieur.isClosed_; - - final String nom; - if (attName==-1) - nom=((ferme) ? "polygone":"polyligne")+CtuluLibString.ESPACE+(j+1)+"-"+(polyIdx+1); - else - nom=(String)models[j].getValue(attName, polyIdx); - - if (identifieur.isNiveau_) { - buf.append(key_.getTypeCourbeNiveau()); - spec=formate_.format(geom.getCoordinateSequence().getOrdinate(0, 2)); - } - else { - buf.append(key_.getTypeCourbe()); - spec=courbeDefaut(key_.getCourbeNBIndic()); - } - writeToOut(buf.toString()); - writeEntete(j+polyIdx, nom, spec, ferme); - writeCoordinateSequence(geom.getCoordinateSequence(), up, ferme); - } - } - // Multipoint - models=_zones[2]; - for (int j=0; j<models.length; j++) { - int attName=models[j].getIndiceOf(GISAttributeConstants.TITRE); - final int nbPoly=models[j].getNumGeometries(); - for (int polyIdx=0; polyIdx<nbPoly; polyIdx++) { - if (stop_) - return; - final StringBuffer buf=new StringBuffer(); - buf.append(bs_).append(CtuluLibString.ESPACE); - final GISMultiPoint geom=(GISMultiPoint)models[j].getGeometry(polyIdx); - - final String nom; - if (attName==-1) - nom="semis"+CtuluLibString.ESPACE+(j+1)+"-"+(polyIdx+1); - else - nom=(String)models[j].getValue(attName, polyIdx); - - buf.append(key_.getTypeSemis()); - spec=null; - writeToOut(buf.toString()); - writeEntete(j+polyIdx, nom, spec, false); - writeCoordinateSequence(geom.getCoordinateSequence(), up, false); - } - } - } catch (final IOException e) { - analyze_.manageException(e); - } - } -} \ No newline at end of file Copied: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterAbstract.java (from rev 4451, branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriter.java) =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterAbstract.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterAbstract.java 2009-02-10 16:55:27 UTC (rev 4452) @@ -0,0 +1,287 @@ +/* + * @creation 2002-11-21 + * @modification $Date: 2007-05-04 13:47:27 $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.dodico.telemac.io; + +import java.io.IOException; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Locale; + +import org.fudaa.ctulu.CtuluActivity; +import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.ProgressionUpdater; +import org.fudaa.ctulu.fileformat.FileFormatVersionInterface; +import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISCoordinateSequenceFactory; +import org.fudaa.ctulu.gis.GISDataModel; +import org.fudaa.ctulu.gis.GISGeometry; +import org.fudaa.ctulu.gis.GISLib; +import org.fudaa.ctulu.gis.GISMultiPoint; +import org.fudaa.ctulu.gis.GISPolygone; +import org.fudaa.ctulu.gis.GISPolyligne; +import org.fudaa.ctulu.gis.GISVisitorDefault; +import org.fudaa.dodico.fortran.FileOpWriterCharSimpleAbstract; +import org.fudaa.dodico.h2d.resource.H2dResource; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.LinearRing; +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.Polygon; + +/** + * @version $Id: SinusxWriter.java,v 1.24 2007-05-04 13:47:27 deniger Exp $ + * @author Fred Deniger + */ +public abstract class SinusxWriterAbstract extends FileOpWriterCharSimpleAbstract implements CtuluActivity { + + boolean stop_; + + public void stop() { + stop_ = true; + } + + class SinusxObjectIdentifier extends GISVisitorDefault { + + boolean isClosed_; + boolean isLigne_; + boolean isNiveau_; + boolean isPt_; + + public boolean visitPoint(final Point _p) { + isPt_ = true; + isLigne_ = false; + isClosed_ = false; + isNiveau_ = false; + return true; + } + + public boolean visitPolygone(final LinearRing _p) { + isPt_ = false; + isLigne_ = true; + isClosed_ = true; + isNiveau_ = ((GISPolygone) _p).isNiveau() || GISLib.isNiveau(_p.getCoordinateSequence()); + return true; + } + + public boolean visitPolygoneWithHole(final Polygon _p) { + isPt_ = false; + isLigne_ = false; + isClosed_ = false; + isNiveau_ = false; + return true; + } + + public boolean visitPolyligne(final LineString _p) { + isPt_ = false; + isLigne_ = true; + isClosed_ = false; + isNiveau_ = ((GISPolyligne) _p).isNiveau() || GISLib.isNiveau(_p.getCoordinateSequence()); + return true; + } + } + private final String pointPlus_ = "+"; + + /** 1 formate selon les spec de sinusx. */ + private final String unString_ = "+1.000000E+00"; + + /** 0 formate selon les spec de sinusx. */ + private final String zeroString_ = "+0.000000E+00"; + + final String bi_; + + final String bs_; + + final DecimalFormat formate_ = new DecimalFormat("0.000000E00", new DecimalFormatSymbols(Locale.US)); + + final String idxoy_; + final SinusxKeyWord key_ = new SinusxKeyWord(); + final FileFormatVersionInterface v_; + + /** + * @param _v la version utilisee. + */ + public SinusxWriterAbstract(final FileFormatVersionInterface _v) { + v_ = _v; + bs_ = key_.getBlocSep(); + bi_ = key_.getBlocInfos(); + idxoy_ = key_.getIdPlanXoy(); + } + + private String courbeDefaut(final int _nb) { + final StringBuffer r = new StringBuffer(250); + for (int i = 0; i < _nb; i++) { + r.append(CtuluLibString.ESPACE).append(zeroString_); + } + return r.toString(); + } + + protected abstract void writeCoordinateSequence(final CoordinateSequence _s, final ProgressionUpdater _up, final boolean _ferme) + throws IOException; + + private void writeEntete(final int _idx, final String _nom, final String _spec, final boolean _ferme) + throws IOException { + final StringBuffer buf = new StringBuffer(); + if (_idx == 0) { + buf.append(repereDefaut()); + } + buf.append(lineSep_); + buf.append(key_.getBlocNomEntite()).append(CtuluLibString.ESPACE).append(_nom); + buf.append(lineSep_); + // DEBUG:A voir + buf.append(bi_).append(CtuluLibString.ESPACE).append(_ferme ? key_.getCourbeFermee() : key_.getCourbeNonFermee()) + .append(CtuluLibString.ESPACE).append(key_.getCourbeReliee()); + buf.append(lineSep_); + // if(ferme) buf_.append(COURBE_NON_RELIEE) + if (_spec != null) { + buf.append(bi_).append(CtuluLibString.ESPACE).append(_spec); + buf.append(lineSep_); + } + buf.append(bi_).append(CtuluLibString.ESPACE).append(idxoy_); + writelnToOut(buf.toString()); + } + + protected void internalWrite(final Object _o) { + if (_o instanceof GISDataModel[][]) { + writeZones((GISDataModel[][]) _o); + } else { + donneesInvalides((GISDataModel[][]) _o); + } + } + + protected String profilDefaut() { + return CtuluLibString.ESPACE + zeroString_ + CtuluLibString.ESPACE + zeroString_ + CtuluLibString.ESPACE + + unString_ + CtuluLibString.ESPACE + unString_; + } + + protected String repereDefaut() { + return CtuluLibString.ESPACE + zeroString_ + CtuluLibString.ESPACE + zeroString_ + CtuluLibString.ESPACE + + zeroString_ + CtuluLibString.ESPACE + unString_ + CtuluLibString.ESPACE + unString_ + CtuluLibString.ESPACE + + unString_ + " 1"; + } + + /** + * @return la version + */ + public FileFormatVersionInterface getVersion() { + return v_; + } + + /** + * @param _zones les zones a ecrire. + */ + public void writeZones(final GISDataModel[][] _zones) { + if (_zones == null) { + analyze_.addFatalError(H2dResource.getS("Les donn\xE9es sont nulles")); + return; + } + final SinusxObjectIdentifier identifieur = new SinusxObjectIdentifier(); + final ProgressionUpdater up = new ProgressionUpdater(progress_); + if (progress_ != null) { + progress_.setProgression(0); + } + up.majProgessionStateOnly(); + int nbPoints=0; + for(int i=0;i<_zones.length;i++) + for(int j=0;j<_zones[i].length;j++) + for(int k=0;k<_zones[i][j].getNumGeometries();k++) + nbPoints+=_zones[i][j].getGeometry(k).getNumPoints(); + up.setValue(5, nbPoints); + + final String bc = key_.getBlocCommentaire(); + try { + writelnToOut(bc + "\t" + H2dResource.getS("Fichier g\xE9n\xE9r\xE9 par Fudaa")); + final String date = new SimpleDateFormat("yyyy-M-d k:mm:ss").format(Calendar.getInstance().getTime()); + writelnToOut(bc + "\tVersion " + v_.getVersionName() + " - Date " + date); + writelnToOut(bc); + writelnToOut(bc); + writelnToOut(bc); + String spec; + formate_.setPositivePrefix(pointPlus_); + + // Points + GISDataModel[] models=_zones[0]; + for (int j=0; j<models.length; j++) { + if (stop_) + return; + final StringBuffer buf=new StringBuffer(50); + buf.append(bs_).append(' '); + buf.append(key_.getTypeSemis()); + writeToOut(buf.toString()); + writeEntete(j, "semis", null, false); + Coordinate[] coord=new Coordinate[models[j].getNumGeometries()]; + for (int k=0; k<coord.length; k++) + coord[k]=models[j].getGeometry(k).getCoordinate(); + writeCoordinateSequence(new GISCoordinateSequenceFactory().create(coord), up, false); + } + // Polylignes + models=_zones[1]; + for (int j=0; j<models.length; j++) { + final int nbPoly=models[j].getNumGeometries(); + int attName=models[j].getIndiceOf(GISAttributeConstants.TITRE); + for (int polyIdx=0; polyIdx<nbPoly; polyIdx++) { + if (stop_) + return; + final StringBuffer buf=new StringBuffer(); + buf.append(bs_).append(CtuluLibString.ESPACE); + final LineString geom=(LineString)models[j].getGeometry(polyIdx); + ((GISGeometry)geom).accept(identifieur); + final boolean ferme=identifieur.isClosed_; + + final String nom; + if (attName==-1) + nom=((ferme) ? "polygone":"polyligne")+CtuluLibString.ESPACE+(j+1)+"-"+(polyIdx+1); + else + nom=(String)models[j].getValue(attName, polyIdx); + + if (identifieur.isNiveau_) { + buf.append(key_.getTypeCourbeNiveau()); + spec=formate_.format(geom.getCoordinateSequence().getOrdinate(0, 2)); + } + else { + buf.append(key_.getTypeCourbe()); + spec=courbeDefaut(key_.getCourbeNBIndic()); + } + writeToOut(buf.toString()); + writeEntete(j+polyIdx, nom, spec, ferme); + writeCoordinateSequence(geom.getCoordinateSequence(), up, ferme); + } + } + // Multipoint + models=_zones[2]; + for (int j=0; j<models.length; j++) { + int attName=models[j].getIndiceOf(GISAttributeConstants.TITRE); + final int nbPoly=models[j].getNumGeometries(); + for (int polyIdx=0; polyIdx<nbPoly; polyIdx++) { + if (stop_) + return; + final StringBuffer buf=new StringBuffer(); + buf.append(bs_).append(CtuluLibString.ESPACE); + final GISMultiPoint geom=(GISMultiPoint)models[j].getGeometry(polyIdx); + + final String nom; + if (attName==-1) + nom="semis"+CtuluLibString.ESPACE+(j+1)+"-"+(polyIdx+1); + else + nom=(String)models[j].getValue(attName, polyIdx); + + buf.append(key_.getTypeSemis()); + spec=null; + writeToOut(buf.toString()); + writeEntete(j+polyIdx, nom, spec, false); + writeCoordinateSequence(geom.getCoordinateSequence(), up, false); + } + } + } catch (final IOException e) { + analyze_.manageException(e); + } + } +} \ No newline at end of file Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterAbstract.java ___________________________________________________________________ Added: svn:mergeinfo + /branches/Br_FudaaModeleur_TF/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriter.java:3445-3850 /branches/FudaaModeleur_TC1/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriter.java:3861-3891 Added: svn:eol-style + native Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV20.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV20.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV20.java 2009-02-10 16:55:27 UTC (rev 4452) @@ -0,0 +1,50 @@ +/* + * @creation 10 f\xE9vr. 2009 + * @modification $Date:$ + * @license GNU General Public License 2 + * @copyright (c)1998-2009 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.dodico.telemac.io; + +import java.io.IOException; + +import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.ProgressionUpdater; +import org.fudaa.ctulu.fileformat.FileFormatVersionInterface; + +import com.vividsolutions.jts.geom.CoordinateSequence; + +/** + * Une classe pour ecrire les fichiers Sinusx sous un format fixe. Version 2.0 + * @author Bertrand Marchand + * @version $Id:$ + */ +public class SinusxWriterV20 extends SinusxWriterAbstract { + + /** + * @param _v + */ + public SinusxWriterV20(FileFormatVersionInterface _v) { + super(_v); + } + + protected void writeCoordinateSequence(final CoordinateSequence _s, final ProgressionUpdater _up, final boolean _ferme) + throws IOException { + int n=_s.size(); + if (_ferme) { + n--; + } + for (int k=0; k<n; k++) { + writelnToOut(CtuluLibString.ESPACE+formate_.format(_s.getX(k))+CtuluLibString.ESPACE+formate_.format(_s.getY(k)) + +CtuluLibString.ESPACE+formate_.format(_s.getOrdinate(k, CoordinateSequence.Z))+" A"); + if (_up!=null) { + _up.majAvancement(); + } + if (stop_) { + return; + } + } + } + +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV20.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV21.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV21.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV21.java 2009-02-10 16:55:27 UTC (rev 4452) @@ -0,0 +1,58 @@ +/* + * @creation 10 f\xE9vr. 2009 + * @modification $Date:$ + * @license GNU General Public License 2 + * @copyright (c)1998-2009 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.dodico.telemac.io; + +import java.io.IOException; + +import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.ProgressionUpdater; +import org.fudaa.ctulu.fileformat.FileFormatVersionInterface; + +import com.vividsolutions.jts.geom.CoordinateSequence; + +/** + * Une classe pour ecrire les fichiers Sinusx sous un format libre. Version 2.1. + * @author Bertrand Marchand + * @version $Id:$ + */ +public class SinusxWriterV21 extends SinusxWriterAbstract { + + /** + * @param _v + */ + public SinusxWriterV21(FileFormatVersionInterface _v) { + super(_v); + } + + /** + * Ecriture des coordonn\xE9es. Elles sont \xE9crites en format libre, pour ne plus avoir de pb avec les troncatures. + */ + protected void writeCoordinateSequence(final CoordinateSequence _s, final ProgressionUpdater _up, final boolean _ferme) + throws IOException { + int n=_s.size(); + if (_ferme) { + n--; + } + for (int k=0; k<n; k++) { + // Attention : La premi\xE8re valeur est inscrite avec un '+' ou '-' obligatoire pour la relecture. C'est ce qui atteste qu'on est + // sur une ligne de coordonn\xE9es. + String x=""+_s.getX(k); + if (x.charAt(0)!='-' && x.charAt(0)!='+') x="+"+x; + + writelnToOut(CtuluLibString.ESPACE+x+CtuluLibString.ESPACE+_s.getY(k) + +CtuluLibString.ESPACE+_s.getOrdinate(k, CoordinateSequence.Z)+" A"); + if (_up!=null) { + _up.majAvancement(); + } + if (stop_) { + return; + } + } + } + +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxWriterV21.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: <emm...@us...> - 2009-02-10 10:42:34
|
Revision: 4451 http://fudaa.svn.sourceforge.net/fudaa/?rev=4451&view=rev Author: emmanuel_martin Date: 2009-02-10 10:42:29 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Petite stabilisation Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/controller/Controller1d.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/controller/ControllerBief.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/controller/Controller1d.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/controller/Controller1d.java 2009-02-10 09:33:45 UTC (rev 4450) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/controller/Controller1d.java 2009-02-10 10:42:29 UTC (rev 4451) @@ -409,7 +409,7 @@ @Override public void internalFrameActivated(InternalFrameEvent e) { - controllerBief_.removeAllBiefs(); + controllerBief_.removeAllBiefs(false); controllerBief_.updateFrom2d(); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/controller/ControllerBief.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/controller/ControllerBief.java 2009-02-10 09:33:45 UTC (rev 4450) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/controller/ControllerBief.java 2009-02-10 10:42:29 UTC (rev 4451) @@ -169,8 +169,17 @@ /** * Supprime les biefs donn\xE9es en param\xE8tre. + * Par defaut avec undoRedo. */ public void removeBief(int[] _idx){ + removeBief(_idx, true); + } + + /** + * Supprime les biefs donn\xE9es en param\xE8tre. + * Si _undoRedo est \xE0 vrai, l'action pourra \xEAtre annul\xE9e. + */ + public void removeBief(int[] _idx, boolean _undoRedo){ Arrays.sort(_idx); CtuluCommandComposite cmd=new CtuluCommandComposite(FudaaLib.getS("Suppression de biefs")); for(int i=_idx.length-1;i>=0;i--) { @@ -178,17 +187,26 @@ biefSelectionModel_.clearSelection(); biefSet_.removeBief(biefSet_.getBiefName(_idx[i]), cmd); } - getCommandManager().addCmd(cmd.getSimplify()); + if(_undoRedo) + getCommandManager().addCmd(cmd.getSimplify()); } /** * Supprime tous les biefs. + * Par defaut avec undoRedo. */ public void removeAllBiefs() { + removeAllBiefs(true); + } + + /** + * Supprime tous les biefs. Si _undoRedo est \xE0 vrai, l'action pourra \xEAtre annul\xE9e. + */ + public void removeAllBiefs(boolean _undoRedo) { int[] idx=new int[biefSet_.getNbBief()]; for(int i=0;i<idx.length;i++) idx[i]=i; - removeBief(idx); + removeBief(idx, _undoRedo); } /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java 2009-02-10 09:33:45 UTC (rev 4450) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java 2009-02-10 10:42:29 UTC (rev 4451) @@ -955,7 +955,7 @@ * mettre \xE0 jour (qui correspond \xE9galement \xE0 la g\xE9om\xE9trie modifi\xE9). */ private void updateGeom(int _idxPoint, ZModeleLigneBrisee _model, int _idxGeomVolatile, int _idxAtt) { - if(_idxGeomVolatile==-1||_idxAtt==-1) + if(_idxGeomVolatile==-1||_idxAtt==-1||_model.getNombre()<=_idxGeomVolatile) return; CoordinateSequence seqGeomV=_model.getGeomData().getCoordinateSequence(_idxGeomVolatile); CoordinateSequence seqProf=profilsListen_.getGeomData().getCoordinateSequence(_idxPoint); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java 2009-02-10 09:33:45 UTC (rev 4450) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java 2009-02-10 10:42:29 UTC (rev 4451) @@ -101,19 +101,11 @@ } /** - * Marge d'acceptation avant de consid\xE9r\xE9 un point comme \xE9tant un point de - * rupture. La valeur est la diff\xE9rence des coefficients directeurs des - * segments avant et apr\xE8s le point. - * En donnant la valeur en radian de l'angle minimal : tolerance_=Math.tan(#ValeurDegr\xE9#) - * Avec #ValeurDegr\xE9# C [0;PI/2[ - * En donnant la valeur en radian de l'angle maximal : tolerance_=Math.tan(Math.PI-#ValeurDegr\xE9#) - * Avec #ValeurDegr\xE9# C ]PI/2;PI] - * En donnant la valeur en degr\xE9 de l'angle minimal : tolerance_=Math.tan(#ValeurDegr\xE9#*Math.PI/2/90) - * Avec #ValeurDegr\xE9# C [0;90[ - * En donnant la valeur en degr\xE9 de l'angle maximal : tolerance_=Math.tan((180-#ValeurDegr\xE9#)*Math.PI/2/90) - * Avec #ValeurDegr\xE9# C ]90;180] + * Marge d'acceptation avant de consid\xE9rer un point comme \xE9tant un point de + * rupture. La valeur est l'angle maximal au dela duquel il sera lin\xE9aris\xE9. + * Il est en radian. */ - static final double tolerance_=Math.tan(89*Math.PI/2/90); + static final double _tolerance=Math.PI-Math.PI/6; /** Le biefContainer contenant le bief contenant les profils utilis\xE9s. */ private BiefContainer biefContainer_; @@ -275,56 +267,17 @@ /// D\xE9termination des points de ruptures. \\\ idxRuptures_.clear(); - double coefDirecteur=0; - // coefDirX : Indique si le coefficient directeur est calcul\xE9 sur les x - // ou sur les y (au d\xE9nominateur). - boolean coefDirX; - // Initialisation : calcul du premier cofficient directeur \\ - int idx=1; - // Calcul du coefficient directeur - if (seq.getX(idx)!=seq.getX(idx-1)) { - // Calcul sur les x - coefDirX=true; - coefDirecteur=(seq.getY(idx)-seq.getY(idx-1))/(seq.getX(idx)-seq.getX(idx-1)); - } - else { - // Calcul sur les y - coefDirX=false; - coefDirecteur=0; - } - // Coeur : Calcul de tous les coefficients directeur et m\xE9morisation des - // ruptures \\ - for (idx=2; idx<seq.size(); idx++) { - double newCoefDirecteur; - boolean newCoefDirX; - // Calcul du coefficient directeur - if (seq.getX(idx)!=seq.getX(idx-1)) { - // Calcul sur les x - newCoefDirX=true; - newCoefDirecteur=(seq.getY(idx)-seq.getY(idx-1))/(seq.getX(idx)-seq.getX(idx-1)); - } - else { - // Calcul sur les y - newCoefDirX=false; - newCoefDirecteur=0; - } - // D\xE9tection des ruptures - if (coefDirX!=newCoefDirX||Math.abs(coefDirecteur-newCoefDirecteur)>tolerance_) - idxRuptures_.add(idx-1); - // Pr\xE9paration de l'it\xE9ration suivante - coefDirecteur=newCoefDirecteur; - coefDirX=newCoefDirX; - } + for (int i=1; i<seq.size()-1; i++) + if(UtilsProfil1d.getAngle(seq.getCoordinate(i-1), seq.getCoordinate(i), seq.getCoordinate(i+1))<_tolerance) + idxRuptures_.add(i); // Lin\xE9arisation du profil - if(idxRuptures_.size()>0) { - int[] idxRuptures=new int[idxRuptures_.size()+2]; - idxRuptures[0]=0; - Iterator<Integer> it=idxRuptures_.iterator(); - for(int i=0;i<idxRuptures_.size();i++) - idxRuptures[i+1]=it.next(); - idxRuptures[idxRuptures.length-1]=seq.size()-1; - LibUtils.linearisePolyligne(biefContainer_.getZoneProfils(), idxProfilSelected_, idxRuptures, null); - } + int[] idxRuptures=new int[idxRuptures_.size()+2]; + idxRuptures[0]=0; + Iterator<Integer> it=idxRuptures_.iterator(); + for (int i=0; i<idxRuptures_.size(); i++) + idxRuptures[i+1]=it.next(); + idxRuptures[idxRuptures.length-1]=seq.size()-1; + LibUtils.linearisePolyligne(biefContainer_.getZoneProfils(), idxProfilSelected_, idxRuptures, null); } catch(ProfilContainerException _exp) { // Remise dans un \xE9tat coh\xE9rent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-02-10 09:33:50
|
Revision: 4450 http://fudaa.svn.sourceforge.net/fudaa/?rev=4450&view=rev Author: bmarchan Date: 2009-02-10 09:33:45 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Tache #161, #160 : Affichage d'un attrribut atomique sous forme de labels. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/TableModelModeleAdapter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dAxe.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dTrace.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCloud.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dConstraintLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dContour.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dDirectionLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dLevel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dProfile.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dZone.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dAxe.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java Added Paths: ----------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneShowLabelAction.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -167,6 +167,15 @@ }; /** + * Un attribut label, atomique. + */ + public final static GISAttributeString LABEL = new GISAttributeString(CtuluLib.getS("Label"), true) { + public String getID() { + return "ATTRIBUTE_LABEL"; + } + }; + + /** * Un attribut bathy, atomique. */ public final static GISAttributeDouble BATHY = new GISAttributeDouble(CtuluLib.getS("z"), true) { @@ -189,7 +198,7 @@ /** La liste des attributs syst\xE8mes. */ protected final static List<GISAttribute> attrs_= - Arrays.asList(new GISAttribute[]{BATHY,TITRE,NATURE,VISIBILITE,ETAT_GEOM,COMMENTAIRE_HYDRO}); + Arrays.asList(new GISAttribute[]{BATHY,TITRE,NATURE,VISIBILITE,ETAT_GEOM,COMMENTAIRE_HYDRO,LABEL}); private GISAttributeConstants() {} 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 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -630,11 +630,6 @@ * @see {@link #createAttributeFrom(GISAttributeInterface, boolean)} */ public static GISAttributeInterface createAttributeFrom(final AttributeType _type) { - final GISAttributeInterface known = GISAttributeConstants.getConstantAttribute(_type.getName()); - if (known != null && known.getDataClass().equals(_type.getType())) { - return known; - } - String name=_type.getName(); Class<?> clazz=_type.getType(); boolean isAtomic=false; @@ -660,6 +655,11 @@ name=name.substring(3); isAtomic=true; } + + final GISAttributeInterface known = GISAttributeConstants.getConstantAttribute(name); + if (known != null && known.getDataClass().equals(clazz)) { + return known; + } return createAttributeFrom(name, clazz, isAtomic); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -12,8 +12,10 @@ import gnu.trove.TObjectIntHashMap; import java.awt.Color; +import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.geom.Rectangle2D; import org.fudaa.ctulu.CtuluExpr; import org.fudaa.ctulu.CtuluLib; @@ -21,6 +23,7 @@ import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.gis.GISAttributeInterface; +import org.fudaa.ctulu.gis.GISAttributeModel; import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface; import org.fudaa.ctulu.gis.GISGeometryFactory; import org.fudaa.ctulu.gis.GISLib; @@ -120,8 +123,9 @@ protected ZSelectionTrace traceAtomic_; /** Le mod\xE8le pour le trac\xE9 de surfaces */ protected TraceSurfaceModel surfModel_; + /** L'attribut utilis\xE9 pour afficher les labels */ + protected GISAttributeInterface attrLabels_=null; - /** * Le seul constructeur, avec le mod\xE8le. * @param _modele le modele du calque @@ -410,6 +414,18 @@ } /** + * D\xE9finit l'attribut atomique pris pour afficher les labels. + * @param _att L'attribut. Si Null : Pas d'affichage de labels. + */ + public void setAttributForLabels(GISAttributeInterface _att) { + if (_att==null || !_att.isAtomicValue()) + attrLabels_=null; + else + attrLabels_=_att; + repaint(); + } + + /** * Indique si la s\xE9lection est vide. * @return true Si aucun objet ni aucun point en mode atomique selectionn\xE9. */ @@ -550,7 +566,7 @@ modele_.point(ptOri, i, nbPoints - 1); ptOri.autoApplique(versEcran); } - + // on trace les icones apres pour qu'ils soient dessin\xE9s au-dessus des lignes. if (icone != null) { for (int i = nombre - 1; i >= 0; i--) { @@ -572,6 +588,7 @@ continue; } if (!isRapide()) initTrace(iconeModel, i); + final GrPoint ptDest = new GrPoint(); for (int j = nbPoints - 1; j >= 0; j--) { // le point de dest est initialise @@ -584,6 +601,66 @@ } } } + + // Enfin les labels sur les atomiques. + if (attrLabels_!=null && !isRapide()) { + GISZoneCollection geomData = modeleDonnees().getGeomData(); + int idxLabels=geomData.getIndiceOf(attrLabels_); + + if (idxLabels!=-1) { + final FontMetrics fm = _g.getFontMetrics(); + final Color fgColor = _g.getColor(); + final Color bgColor = getBackground(); + + for (int i=nombre-1; i>=0; i--) { + // il n'y a pas de points pour cette ligne + if (modele_.getNbPointForGeometry(i)<=0) { + continue; + } + // La g\xE9ometrie n'est pas visible + if (!modele_.isGeometryVisible(i)) + continue; + + modele_.getDomaineForGeometry(i, bPoly); + // Si la boite du polygone n'est pas dans la boite d'affichage on + // passe + if (bPoly.intersectionXY(clip)==null) { + continue; + } + final int nbPoints=modele_.getNbPointForGeometry(i); + if (nbPoints<=0) { + continue; + } + + GISAttributeModel mdl=(GISAttributeModel)geomData.getModel(idxLabels).getObjectValueAt(i); + + final GrPoint ptDest=new GrPoint(); + for (int j=nbPoints-1; j>=0; j--) { + modele_.point(ptDest, i, j); + if (!_clipReel.contientXY(ptDest)) { + continue; + } + + Object o=mdl.getObjectValueAt(j); + if (o==null) + continue; + String s=o.toString().trim(); + if (s.equals("")) + continue; + + ptDest.autoApplique(versEcran); + final Rectangle2D rec=fm.getStringBounds(s, _g); + double x=ptDest.x_-rec.getWidth()/2; + double y=ptDest.y_-3; + rec.setFrame(x, y-fm.getAscent(), rec.getWidth(), fm.getAscent()+2); + _g.setColor(bgColor); + _g.fill(rec); + _g.setColor(fgColor); + _g.drawString(s, (int)x, (int)y); + } + } + } + } } public void paintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -12,16 +12,18 @@ import gnu.trove.TObjectIntHashMap; import java.awt.Color; +import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.geom.Rectangle2D; import org.fudaa.ctulu.CtuluExpr; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.CtuluListSelectionInterface; -import org.fudaa.ctulu.gis.GISZoneListener; import org.fudaa.ctulu.gis.GISAttributeInterface; +import org.fudaa.ctulu.gis.GISAttributeModel; import org.fudaa.ctulu.gis.GISGeometryFactory; import org.fudaa.ctulu.gis.GISLib; import org.fudaa.ctulu.gis.GISZoneCollection; @@ -126,6 +128,8 @@ protected ZSelectionTrace traceAtomic_; /** On dessine une fl\xE8che sur chaque ligne pour indiquer le sens de celle-ci. */ protected boolean showLineOrientation_; + /** L'attribut utilis\xE9 pour afficher les labels */ + protected GISAttributeInterface attrLabels_=null; /** * @@ -478,6 +482,18 @@ return isAtomicMode_; } + /** + * D\xE9finit l'attribut atomique pris pour afficher les labels. + * @param _att L'attribut. Si Null : Pas d'affichage de labels. + */ + public void setAttributForLabels(GISAttributeInterface _att) { + if (_att==null || !_att.isAtomicValue()) + attrLabels_=null; + else + attrLabels_=_att; + repaint(); + } + public boolean isConfigurable() { return true; } @@ -661,6 +677,67 @@ } } } + + // Enfin les labels sur les atomiques. + if (attrLabels_!=null && !isRapide()) { + GISZoneCollection geomData = getModele().getGeomData(); + int idxLabels=geomData.getIndiceOf(attrLabels_); + + if (idxLabels!=-1) { + final FontMetrics fm = _g.getFontMetrics(); + final Color fgColor = _g.getColor(); + final Color bgColor = getBackground(); + + for (int i=nombre-1; i>=0; i--) { + // il n'y a pas de points pour cette ligne + if (modele_.getNbPointForGeometry(i)<=0) { + continue; + } + // La g\xE9ometrie n'est pas visible + if (!modele_.isGeometryVisible(i)) + continue; + + modele_.getDomaineForGeometry(i, bPoly); + // Si la boite du polygone n'est pas dans la boite d'affichage on + // passe + if (bPoly.intersectionXY(clip)==null) { + continue; + } + final int nbPoints=modele_.getNbPointForGeometry(i); + if (nbPoints<=0) { + continue; + } + + GISAttributeModel mdl=(GISAttributeModel)geomData.getModel(idxLabels).getObjectValueAt(i); + + final GrPoint ptDest=new GrPoint(); + for (int j=nbPoints-1; j>=0; j--) { + modele_.point(ptDest, i, j); + if (!_clipReel.contientXY(ptDest)) { + continue; + } + + // Les labels : Uniquement si le string correspondant n'est pas "". + Object o=mdl.getObjectValueAt(j); + if (o==null) + continue; + String s=o.toString().trim(); + if (s.equals("")) + continue; + + ptDest.autoApplique(versEcran); + final Rectangle2D rec=fm.getStringBounds(s, _g); + double x=ptDest.x_-rec.getWidth()/2; + double y=ptDest.y_-3; + rec.setFrame(x, y-fm.getAscent(), rec.getWidth(), fm.getAscent()+2); + _g.setColor(bgColor); + _g.fill(rec); + _g.setColor(fgColor); + _g.drawString(s, (int)x, (int)y); + } + } + } + } } public void paintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, 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 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -37,7 +37,6 @@ import javax.swing.event.TableModelListener; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.TableCellEditor; import javax.swing.table.TableColumnModel; import javax.swing.table.TableModel; @@ -82,7 +81,6 @@ import com.memoire.bu.BuResource; import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuSplit2Pane; -import com.memoire.bu.BuTableCellRenderer; import com.memoire.fu.FuLog; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.CoordinateSequence; @@ -307,13 +305,12 @@ public class CourbeRepresentation extends BuPanel implements TableModelListener, CtuluListSelectionListener, ListSelectionListener { /** - * Cette classe donne un acc\xE8s restraint au model 'model_'. Concr\xE8tement - * seules trois colonnes sont visibles : index, curviligne et z. Et seul z est \xE9ditable. + * Cette classe donne un acc\xE8s restraint au model 'model_'. Le X et Y sont remplac\xE9s par un asbcisse curviligne. * * @author Emmanuel MARTIN * @version $Id:$ */ - protected class LimitedTableRepresentation extends AbstractTableModel implements TableModelListener { + protected class LimitedTableModel extends AbstractTableModel implements TableModelListener { /** * Le renderer des cellules du tableau. @@ -324,6 +321,8 @@ if(value instanceof Double) return super.getTableCellRendererComponent(table, xyFormatter_.getXYFormatter().format((Double) value), isSelected, hasFocus, row, column); + if(value instanceof Boolean) + return table.getDefaultRenderer(Boolean.class).getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); else return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); } @@ -334,13 +333,13 @@ /** * @param _xyFormatter le formateur pour la colonne des curvilignes */ - public LimitedTableRepresentation(EbliFormatterInterface _xyFormatter){ + public LimitedTableModel(EbliFormatterInterface _xyFormatter){ xyFormatter_=_xyFormatter; modelData_.addTableModelListener(this); } public int getColumnCount() { - return 3; + return modelData_.getColumnCount()-1; } public int getRowCount() { @@ -352,24 +351,22 @@ case 0: return _rowIndex+1; case 1: - return /*xyFormatter_.getXYFormatter().format(*/getX(_rowIndex);//); - case 2: - return getY(_rowIndex); + return getX(_rowIndex); default: - return null; + return modelData_.getValueAt(_rowIndex, _columnIndex+1); } } public boolean isCellEditable(final int _rowIndex, final int _columnIndex) { if (_columnIndex<2) return false; -// return modelData_.isCellEditable(_rowIndex, _columnIndex); - return true; + + return modelData_.isCellEditable(_rowIndex, _columnIndex+1); } public void setValueAt(final Object _value, final int _rowIndex, final int _columnIndex) { - if(_columnIndex == 2) - setY(_rowIndex, (Double)_value, null); + if(_columnIndex >= 2) + modelData_.setValueAt(_value, _rowIndex, _columnIndex+1); } public String getColumnName(int _column) { @@ -378,10 +375,8 @@ return EbliLib.getS(EbliLib.getS("Index")); case 1: return EbliLib.getS(EbliLib.getS("Abscisse")); - case 2: - return modelData_.getColumnName(zCol_); default: - return null; + return modelData_.getColumnName(_column+1); } } @@ -391,10 +386,8 @@ return Integer.class; case 1: return Double.class; - case 2: - return Double.class; default: - return null; + return modelData_.getColumnClass(_columnIndex); } } @@ -405,15 +398,23 @@ fireTableChanged(new TableModelEvent((TableModel)_e.getSource(), _e.getFirstRow(), _e.getLastRow(), col, _e.getType())); } - public void updateCellEditor(final JTable _table) { - final TableColumnModel cols = _table.getColumnModel(); - // Editor : Abscisse, Z - final TableCellEditor ed = xyFormatter_.createTableEditorComponent(); - cols.getColumn(1).setCellEditor(ed); - cols.getColumn(2).setCellEditor(ed); - // Renderer : Abscisse, Z - cols.getColumn(1).setCellRenderer(new Renderer()); - cols.getColumn(2).setCellRenderer(new Renderer()); + public void updateCellEditor(JTable _table) { + TableColumnModel cols=_table.getColumnModel(); + + // Renderer \\ + Renderer renderer=new Renderer(); + for(int i=0;i<cols.getColumnCount();i++) + cols.getColumn(i).setCellRenderer(renderer); + + // Editors \\ + // Colonnes des attributs + if (modelData_!=null) { + for (int i=3; i<modelData_.getColumnCount(); i++) { + CtuluValueEditorI editor=modelData_.getAttribute(i).getEditor(); + if (editor!=null) + cols.getColumn(i-1).setCellEditor(editor.createTableEditorComponent()); + } + } } } @@ -436,12 +437,12 @@ private CtuluTable tableauVue_; // Selection update private boolean disable; - /** Indice de la colonne z. */ + /** Indice de la colonne z sur le modele data global. */ protected int zCol_; public CourbeRepresentation() { disable = false; - zCol_=zone_.getIndiceOf(zone_.getAttributeIsZ())+3; // l'index + les colonnes index, x et y + zCol_=/*zone_.getIndiceOf(zone_.getAttributeIsZ())+*/3; // l'index + les colonnes index, x et y modelData_.addTableModelListener(this); // Construction de la courbe \\ setPreferredSize(new Dimension(650,450)); @@ -491,7 +492,7 @@ } } // Construction du tableau \\ - LimitedTableRepresentation tableau = new LimitedTableRepresentation(modelData_.getFormatter()); + LimitedTableModel tableau = new LimitedTableModel(modelData_.getFormatter()); tableauVue_ = new CtuluTable(); tableauVue_.setModel(tableau); tableauVue_.getSelectionModel().addListSelectionListener(this); @@ -584,8 +585,11 @@ 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]); + if (selectedIndex!=null && selectedIndex.length>0) { + for (int i=0; i<selectedIndex.length; i++) + lstTableauSelect.addSelectionInterval(selectedIndex[i], selectedIndex[i]); + tableauVue_.scrollRectToVisible(tableauVue_.getCellRect(selectedIndex[selectedIndex.length-1], 0, false)); + } // R\xE9activation de l'\xE9coute de changement de selection de le tableau disable=false; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/TableModelModeleAdapter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/TableModelModeleAdapter.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/TableModelModeleAdapter.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -522,6 +522,13 @@ } /** + * Retourne l'attribut pour la colonne + */ + public GISAttributeInterface getAttribute(int _columnIndex) { + return mapColonne_.get(_columnIndex).attribute; + } + + /** * Retourne l'index de la g\xE9om\xE9trie selectionn\xE9e. */ public int getSelectedGeometry() { @@ -586,7 +593,7 @@ return "y"; default: if(mapColonne_!=null) - return mapColonne_.get(columnIndex).attribute.getLongName(); + return mapColonne_.get(columnIndex).attribute.getName(); else return null; } @@ -704,7 +711,7 @@ // Mise \xE0 jour de mapColonne \\ int idxColonne=3; GISAttributeInterface attrZ=zone_.getAttributeIsZ(); - // Cas particulier : attribut z atomique + // Cas particulier : attribut z atomique est lis en debut des attributs atomiques. if (attrZ!=null&&attrZ.isAtomicValue()) { int idxAttr=zone_.getIndiceOf(attrZ); mapColonne_.put(idxColonne++, new AttributeInformation(attrZ, (GISAttributeModel)zone_.getValue(idxAttr, idxSelected_), Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -22,6 +22,7 @@ import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.modeleur.action.CalqueDeleteCalqueAction; import org.fudaa.fudaa.modeleur.action.CalqueNewCalqueAction; +import org.fudaa.fudaa.modeleur.action.SceneShowLabelAction; import org.fudaa.fudaa.modeleur.layer.MdlLayer1dAxe; import org.fudaa.fudaa.modeleur.layer.MdlLayer1dBank; import org.fudaa.fudaa.modeleur.layer.MdlLayer1dLimiteStockage; @@ -93,10 +94,11 @@ protected EbliActionInterface[] getActionsInterface(){ EbliActionInterface[] actions=super.getActionsInterface(); - EbliActionInterface[] allActions=new EbliActionInterface[actions.length+1]; + EbliActionInterface[] allActions=new EbliActionInterface[actions.length+2]; for(int i=0;i<actions.length;i++) allActions[i]=actions[i]; - allActions[allActions.length-1]=new SceneShowOrientationAction(gisEditor_.getPanel().getArbreCalqueModel()); + allActions[allActions.length-2]=new SceneShowOrientationAction(gisEditor_.getPanel().getArbreCalqueModel()); + allActions[allActions.length-1]=new SceneShowLabelAction(gisEditor_.getPanel().getArbreCalqueModel()); return allActions; } Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneShowLabelAction.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneShowLabelAction.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneShowLabelAction.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -0,0 +1,85 @@ +/* + * @creation 14 nov. 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.fudaa.modeleur.action; + +import javax.swing.event.TreeModelEvent; +import javax.swing.event.TreeModelListener; + +import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ebli.calque.BArbreCalqueModel; +import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BCalqueVisitor; +import org.fudaa.ebli.calque.ZCalqueLigneBrisee; +import org.fudaa.ebli.calque.ZCalqueMultiPoint; +import org.fudaa.ebli.commun.EbliActionChangeState; +import org.fudaa.ebli.commun.EbliLib; + +import com.memoire.bu.BuResource; + +/** + * Une action pour afficher les labels dans les calques. + * @author Bertrand Marchand + * @version $Id$ + */ +public class SceneShowLabelAction extends EbliActionChangeState implements TreeModelListener { + + protected BArbreCalqueModel treeModel_; + + public SceneShowLabelAction(BArbreCalqueModel _treeModel) { + super(EbliLib.getS("Afficher les labels sur les sommets"), null, "SHOW_LABELS"); + treeModel_=_treeModel; + treeModel_.addTreeModelListener(this); + setEnabled(true); + setSelected(true); + } + + private void applyConf(){ + treeModel_.getRootCalque().apply(new BCalqueVisitor(){ + public boolean visit(BCalque _cq) { + if(_cq instanceof ZCalqueLigneBrisee) + ((ZCalqueLigneBrisee)_cq).setAttributForLabels(isSelected()?GISAttributeConstants.LABEL:null); + else if(_cq instanceof ZCalqueMultiPoint) + ((ZCalqueMultiPoint)_cq).setAttributForLabels(isSelected()?GISAttributeConstants.LABEL:null); + return true; + } + }); + } + + /* (non-Javadoc) + * @see javax.swing.event.TreeModelListener#treeNodesChanged(javax.swing.event.TreeModelEvent) + */ + public void treeNodesChanged(TreeModelEvent e) { + } + + /* (non-Javadoc) + * @see javax.swing.event.TreeModelListener#treeNodesInserted(javax.swing.event.TreeModelEvent) + */ + public void treeNodesInserted(TreeModelEvent e) { + applyConf(); + } + + /* (non-Javadoc) + * @see javax.swing.event.TreeModelListener#treeNodesRemoved(javax.swing.event.TreeModelEvent) + */ + public void treeNodesRemoved(TreeModelEvent e) { + } + + /* (non-Javadoc) + * @see javax.swing.event.TreeModelListener#treeStructureChanged(javax.swing.event.TreeModelEvent) + */ + public void treeStructureChanged(TreeModelEvent e) { + } + + /* (non-Javadoc) + * @see org.fudaa.ebli.commun.EbliActionChangeState#changeAction() + */ + @Override + public void changeAction() { + applyConf(); + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneShowLabelAction.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dAxe.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dAxe.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dAxe.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -9,6 +9,7 @@ import java.awt.Color; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.BCalquePersistenceInterface; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; @@ -36,6 +37,7 @@ setLineModelOuvert(getLineModel(0)); setName(getExtName()); setTitle(MdlResource.MDL.getString("Axes hydrauliques")); + setAttributForLabels(GISAttributeConstants.LABEL); } public MdlLayer1dAxe(FSigEditor _editor) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dTrace.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dTrace.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dTrace.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -9,6 +9,7 @@ import java.awt.Color; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.BCalquePersistenceInterface; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; @@ -37,6 +38,7 @@ // _model.addListener(this); A implementer. setName(getExtName()); setTitle(MdlResource.MDL.getString("Trace profils")); + setAttributForLabels(GISAttributeConstants.LABEL); } public MdlLayer1dTrace(FSigEditor _editor) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCloud.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCloud.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCloud.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -11,6 +11,7 @@ import java.util.ArrayList; import java.util.Arrays; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.BCalque; import org.fudaa.ebli.calque.BCalquePersistenceInterface; import org.fudaa.ebli.calque.BGroupeCalque; @@ -40,8 +41,8 @@ super(_model,_editor); setName(getExtName()); setIconModel(0, new TraceIconModel(TraceIcon.CARRE_PLEIN, 2, new Color(0,190,0))); - setTitle(MdlResource.MDL.getString("Semis de points")); + setAttributForLabels(GISAttributeConstants.BATHY); } public MdlLayer2dCloud(FSigEditor _editor) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dConstraintLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dConstraintLine.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dConstraintLine.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -9,6 +9,7 @@ import java.awt.Color; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.BCalquePersistenceInterface; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; @@ -36,6 +37,7 @@ setLineModelOuvert(getLineModel(0)); setName(getExtName()); setTitle(MdlResource.MDL.getString("Lignes de contraintes")); + setAttributForLabels(GISAttributeConstants.BATHY); } public MdlLayer2dConstraintLine(FSigEditor _editor) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dContour.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dContour.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dContour.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -9,6 +9,7 @@ import java.awt.Color; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.BCalquePersistenceInterface; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; @@ -40,6 +41,7 @@ setIconModel(1, new TraceIconModel(getIconModel(0))); setName(getExtName()); setTitle(MdlResource.MDL.getString("Contours d'\xE9tude")); + setAttributForLabels(GISAttributeConstants.BATHY); } public MdlLayer2dContour(FSigEditor _editor) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dDirectionLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dDirectionLine.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dDirectionLine.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -9,6 +9,7 @@ import java.awt.Color; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.BCalquePersistenceInterface; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; @@ -37,6 +38,7 @@ // _model.addListener(this); A implementer. setName(getExtName()); setTitle(MdlResource.MDL.getString("Lignes directrices")); + setAttributForLabels(GISAttributeConstants.LABEL); } public MdlLayer2dDirectionLine(FSigEditor _editor) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dLevel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dLevel.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dLevel.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -9,6 +9,7 @@ import java.awt.Color; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.BCalquePersistenceInterface; import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; import org.fudaa.ebli.trace.TraceLigne; @@ -37,6 +38,7 @@ setLineModelOuvert(getLineModel(0)); setTitle(MdlResource.MDL.getString("Lignes de niveau")); + setAttributForLabels(GISAttributeConstants.BATHY); } public MdlLayer2dLevel(FSigEditor _editor) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dProfile.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dProfile.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dProfile.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -11,6 +11,7 @@ import java.util.ArrayList; import java.util.Arrays; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.BCalquePersistenceInterface; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; @@ -43,6 +44,7 @@ // _model.addListener(this); A implementer. setName(getExtName()); setTitle(MdlResource.MDL.getString("Profils")); + setAttributForLabels(GISAttributeConstants.LABEL); } public MdlLayer2dProfile(FSigEditor _editor) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dZone.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dZone.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dZone.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -9,6 +9,7 @@ import java.awt.Color; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.BCalquePersistenceInterface; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; @@ -40,6 +41,7 @@ setIconModel(1, new TraceIconModel(getIconModel(0))); setName(getExtName()); setTitle(MdlResource.MDL.getString("Zones")); + setAttributForLabels(GISAttributeConstants.BATHY); } public MdlLayer2dZone(FSigEditor _editor) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dAxe.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dAxe.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dAxe.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -28,7 +28,8 @@ GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE, - GISAttributeConstants.VISIBILITE + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -30,7 +30,8 @@ GISAttributeConstants.TITRE, GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.NATURE, - GISAttributeConstants.VISIBILITE + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -19,7 +19,7 @@ * @version $Id$ */ public class MdlModel2dCloud extends MdlModel2dMultiPoint { - + /** * Construction d'un modele de profil avec pile de commandes. * @param _cmd La pile de commandes pour le undo/redo. @@ -34,7 +34,8 @@ GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE, - GISAttributeConstants.VISIBILITE + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -32,7 +32,8 @@ GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE, - GISAttributeConstants.VISIBILITE + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -31,7 +31,8 @@ GISAttributeConstants.TITRE, GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.NATURE, - GISAttributeConstants.VISIBILITE + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -32,7 +32,8 @@ GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE, - GISAttributeConstants.VISIBILITE + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -35,7 +35,8 @@ GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE, - GISAttributeConstants.VISIBILITE + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -26,13 +26,15 @@ */ public MdlModel2dProfile(final ZModelGeometryListener _listener, final CtuluCommandContainer _cmd) { super(_listener); + GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.BATHY, GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE, GISAttributeConstants.COMMENTAIRE_HYDRO, - GISAttributeConstants.VISIBILITE + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java 2009-02-09 18:36:49 UTC (rev 4449) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java 2009-02-10 09:33:45 UTC (rev 4450) @@ -31,7 +31,8 @@ GISAttributeConstants.TITRE, GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.NATURE, - GISAttributeConstants.VISIBILITE + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-02-09 18:36:53
|
Revision: 4449 http://fudaa.svn.sourceforge.net/fudaa/?rev=4449&view=rev Author: hadouxad Date: 2009-02-09 18:36:49 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Correction + connecteurs fleches Modified Paths: -------------- 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/TrReplayCurvesData.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2009-02-09 18:36:13 UTC (rev 4448) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2009-02-09 18:36:49 UTC (rev 4449) @@ -52,6 +52,7 @@ import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorLegende; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorArrowEditor; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorConnectionWidget; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorTextLabel; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorCircle; @@ -332,7 +333,9 @@ // nodeFleche.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorFlecheSimple())); nodeFleche.setCreator(new EbliWidgetCreatorArrowEditor(new EbliEditorArrow())); - + // nodeFleche.setCreator(new EbliWidgetCreatorConnectionWidget()); + + nodeFleche.setPreferedSize(new Dimension(200, 150)); nodeFleche.setPreferedLocation(new Point(350, 125)); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-02-09 18:36:13 UTC (rev 4448) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-02-09 18:36:49 UTC (rev 4449) @@ -255,7 +255,7 @@ */ private TrReplayDialog constructDialog(final TrPostVisuPanel vue2d, final TrPostCommonImplementation implementation,final EGModel modele,JComponent composantAdditionnel,boolean modeEdition,String title){ implementation.createTask(TrResource.getS("Origine ")+" "+modele.getTitle()); - final TrReplayDialog pn = new TrReplayDialog(false); + final TrReplayDialog pn = new TrReplayDialog(false,implementation.getParentComponent()); pn.setLayout(new BuBorderLayout()); pn.setBorder(BuBorders.EMPTY3333); //pn.add(new BuLabel(CtuluLib.getS("S\xE9lectionner le fichier r\xE9sultat")), BuBorderLayout.NORTH); @@ -315,7 +315,7 @@ //panelEAST.add(compEast,BorderLayout.CENTER); // panelEAST.setTopComponent(dialog); // panelEAST.setBottomComponent(compEast); - panelEAST.addTab("Rechercher", dialog); + panelEAST.addTab("Rechercher", new JScrollPane(dialog)); panelEAST.addTab("Infos Points, Variables", compEast); //pn.add(dialog,BorderLayout.WEST); pn.add(panelEAST,BuBorderLayout.EAST); @@ -350,8 +350,9 @@ panelSouth2.add(genereVue2d.buildButton(EbliComponentFactory.INSTANCE)); } - - + //pn.setSize(new Dimension(800,600)); +// if(pn.dialog_!=null) +// pn.dialog_.pack(); return pn; @@ -500,12 +501,14 @@ class TrReplayDialog extends CtuluDialogPanel{ CtuluDialog dialog_; - TrReplayDialog(boolean b){ + TrReplayDialog(boolean b,final Component _parent){ super(b); + dialog_= createDialog(_parent); } public int afficheModale(final Component _parent, final String _t, final int _option) { - dialog_= createDialog(_parent); + if(dialog_==null) + dialog_= createDialog(_parent); dialog_.setModal(false); dialog_.setInitParent(_parent); dialog_.setOption(_option); @@ -607,10 +610,10 @@ String title=TrResource.getS("<html><body>Choisir le point et la variable qui seront utilis\xE9s pour refaire le calcul(interpolation possible).<br /> Le point rouge d\xE9signe le point d'origine.</body></html>"); dialog_=constructDialog(vue2d, implementation, modele,/*constructSelectorVariable(vars)*/null,true,title); - dialog_.setPreferredSize(new Dimension(600,400)); + dialog_.setPreferredSize(new Dimension(800,600)); //-- on restaure la vue --// - vue2d.setSize(300, 300); + //vue2d.setSize(300, 300); vue2d.restaurer(); //-- on positionne la bonne variable et le bon pas de temps --// @@ -619,10 +622,13 @@ //-- on cr\xE9e le bouton de rejoue de donn\xE9es pour un autre fichier r\xE9sultat --// - + boolean restaurationInitiale=true; //-- on affiche tant que l'utilisateur valide des r\xE9sultats faux --// while(CtuluDialogPanel.isOkResponse(dialog_.afficheModale(implementation.getParentComponent(), TrResource.getS("Rejouer ")+" "+modele.getTitle())) && !replayEvolutionFor(srcChoisie,vue2d,treeModel,modele,implementation)){ - + if(restaurationInitiale){ + restaurationInitiale=false; + vue2d.restaurer(); + } } @@ -801,7 +807,7 @@ //-- on rappelle l'interface --// getProfilSpatialReplayData(newSrc, treeModel, modele, implementation); - + return; } else return; @@ -810,10 +816,10 @@ }); dialog_=constructDialog(vue2d, implementation, modele,/*constructSelectorVariable(vars)*/null,true,title); - dialog_.setPreferredSize(new Dimension(600,400)); + dialog_.setPreferredSize(new Dimension(800,600)); //-- on restaure la vue --// - vue2d.setSize(300, 300); + //vue2d.setSize(300, 300); vue2d.restaurer(); @@ -826,10 +832,14 @@ //final FSigLayerLineEditable cq4 = new FSigLayerLineEditable(new ZModeleLigneBriseeEditable(), vue2d.getGisEditor()); // cq4.setTitle("toto"); //vue2d.addCalque(cq4, true); - + boolean restaurationInitiale=true; //-- on affiche tant que l'utilisateur valide des r\xE9sultats faux --// while(CtuluDialogPanel.isOkResponse(dialog_.afficheModale(implementation.getParentComponent(), TrResource.getS("Rejouer ")+" "+modele.getTitle())) && !replayProfilSpatialFor(srcChoisie,vue2d,treeModel,modele,implementation)){ + if(restaurationInitiale){ + restaurationInitiale=false; + vue2d.restaurer(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-02-09 18:36:17
|
Revision: 4448 http://fudaa.svn.sourceforge.net/fudaa/?rev=4448&view=rev Author: hadouxad Date: 2009-02-09 18:36:13 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Correction + connecteurs fleches Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeMultiWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorConnectionWidget.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java 2009-02-08 22:18:41 UTC (rev 4447) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java 2009-02-09 18:36:13 UTC (rev 4448) @@ -56,16 +56,16 @@ } public int getRowCount() { - return infos_.keySet().size() + 1; + return infos_.keySet().size() /*+ 1*/; } public Object getValueAt(int row, int column) { - if (row == getRowCount() - 1) { + /* if (row == getRowCount() - 1) { if (column == 0) return EbliResource.EBLI.getString("Editable"); else return EbliResource.EBLI.getString("Double-cliquez pour \xE9diter"); } else - +*/ if (column == 0) return getKey(row); else return getValue(row); @@ -122,7 +122,7 @@ @Override public boolean isCellEditable(int row, int column) { - return true; + return false; } @Override Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeMultiWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeMultiWidget.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeMultiWidget.java 2009-02-09 18:36:13 UTC (rev 4448) @@ -0,0 +1,100 @@ +package org.fudaa.ebli.visuallibrary; + +import java.awt.Dimension; +import java.awt.Point; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; + +/** + * EbliNode qui reference plusieurs widgets. + * @author Adrien Hadoux + * + */ +public class EbliNodeMultiWidget implements EbliNode { + + EbliWidgetCreator creator; + Point preferedLocation; + Dimension preferedSize; + String title; + List<EbliWidget> nodeWidget_; + + public String getTitle() { + return title; + } + + /** + * methode qui permet de dupliquer un node + */ + public EbliNode duplicate(final Map options) { + return getCreator().duplicate(this); + } + + public void setTitle(final String title) { + this.title = title; + } + + public void setPreferedLocation(final Point p) { + this.preferedLocation = p; + // repositionnement du widget si existant + if (hasWidget()) + for(EbliWidget nodeWidget:nodeWidget_) + nodeWidget.setPreferredLocation(p); + } + + public void setPreferedSize(final Dimension d) { + this.preferedSize = d; + + // repositionnement du widget si existant + if (hasWidget()) + for(EbliWidget nodeWidget:nodeWidget_) + nodeWidget.setPreferredSize(d); + } + + public void setCreator(final EbliWidgetCreator creator) { + this.creator = creator; + } + + public EbliWidgetCreator getCreator() { + return creator; + } + + public Point getPreferedLocation() { + + return preferedLocation; + } + + public Dimension getPreferedSize() { + return preferedSize; + } + + + + public boolean hasWidget() { + return (getCreator() != null && nodeWidget_ != null); + + } + + /** + * @see hasWidget() + * @return EbliWidget + */ + public EbliWidget getWidget() { + return nodeWidget_.get(0); + } + + public boolean isMovable() { + // TODO Auto-generated method stub + return (hasWidget() && getPreferedLocation() != null && getWidget().getBounds() != null); + } + + public void setWidget(final EbliWidget _widget) { + if(nodeWidget_==null) + nodeWidget_=new ArrayList<EbliWidget>(10); + nodeWidget_.clear(); + nodeWidget_.add(_widget); + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2009-02-08 22:18:41 UTC (rev 4447) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2009-02-09 18:36:13 UTC (rev 4448) @@ -249,8 +249,11 @@ // -- creation de la widget ici --// // if (node.getWidget() == null) - // -- on ne cree la widget que sis necessaire + // -- on ne cree la widget que si necessaire node.setWidget(node.getCreator().create(this)); + + if(node.getWidget()==null) + return null; // else // node.getWidget().setScene(this); // @@ -261,8 +264,8 @@ // -- ajout dans la vue layer --// visu_.addChild(node.getWidget()); - if (node.getWidget().getController().getDescription() == null - || node.getWidget().getController().getDescription().equals("")) node.getWidget().getController() + if (node.getWidget().getController()!=null && (node.getWidget().getController().getDescription() == null + || node.getWidget().getController().getDescription().equals(""))) node.getWidget().getController() .setDescription(node.getTitle()); return node.getWidget(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2009-02-08 22:18:41 UTC (rev 4447) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2009-02-09 18:36:13 UTC (rev 4448) @@ -446,7 +446,8 @@ parent.setBorder(lookFeel.getBorder(_newState, parent.getController().canResize_, parent.getController() .isProportional())); } else { - setBorder(lookFeel.getBorder(_newState, getController().canResize_, getController().isProportional())); + if(lookFeel!=null && getController()!=null) + setBorder(lookFeel.getBorder(_newState, getController().canResize_, getController().isProportional())); } } Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorConnectionWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorConnectionWidget.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorConnectionWidget.java 2009-02-09 18:36:13 UTC (rev 4448) @@ -0,0 +1,88 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Dimension; +import java.awt.Image; +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.netbeans.api.visual.anchor.AnchorFactory; +import org.netbeans.api.visual.anchor.AnchorShape; +import org.netbeans.api.visual.widget.ConnectionWidget; +import org.netbeans.api.visual.widget.LayerWidget; + +/** + * Creator pour un widget creator connection. + * + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorConnectionWidget implements EbliWidgetCreator{ + + + EbliWidget connection1_; + EbliWidget connection2_; + ConnectionWidget connection_; + EbliWidget conteneurFleche_; + LayerWidget layoutConteneur_; + + public EbliWidgetCreatorConnectionWidget() { + super(); + + } + + public EbliWidget create(EbliScene _scene) { + connection1_=new EbliWidget(_scene,true); + connection2_=new EbliWidget(_scene,true); + conteneurFleche_=new EbliWidget(_scene); + + + connection1_.setPreferredSize(new Dimension(50,50)); + connection2_.setPreferredSize(new Dimension(50,50)); + + connection1_.setPreferredLocation(new Point(10,10)); + connection2_.setPreferredLocation(new Point(600,300)); + + _scene.getVisu().addChild(connection1_); + _scene.getVisu().addChild(connection2_); + + //-- creation de la connection --// + connection_ = new ConnectionWidget (_scene); + connection_.setSourceAnchor(AnchorFactory.createCircularAnchor (connection1_, 32)); + connection_.setTargetAnchor(AnchorFactory.createCircularAnchor (connection2_, 32)); + connection_.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED); + + layoutConteneur_ = new LayerWidget (_scene); + _scene.addChild(layoutConteneur_); + +// layoutConteneur_= new LayerWidget(_scene); +// conteneurFleche_.addChild(layoutConteneur_ ); + layoutConteneur_.addChild(connection_); + + + + return null; + } + + + public EbliNode duplicate(EbliNode adupliquer) { + // TODO Auto-generated method stub + return null; + } + + + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 2009-02-08 22:18:41 UTC (rev 4447) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 2009-02-09 18:36:13 UTC (rev 4448) @@ -63,6 +63,7 @@ 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.EbliWidgetCreatorConnectionWidget; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorDblFleche; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorFleche; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape; @@ -199,6 +200,9 @@ nodeLegende.setPreferedLocation(new Point(4, 270)); scene.addNode(nodeLegende); + + + // -- creation de la vue calque final TestModelLigneBrisee m = TestModelLigneBrisee.buildDefault(); ZCalqueLigneBrisee br = new ZCalqueLigneBrisee(m); @@ -236,7 +240,7 @@ node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_DIAG1)); node.setPreferedSize(new Dimension(100, 100)); node.setPreferedLocation(new Point(450, 125)); - scene.addNode(node); + //scene.addNode(node); // -- ajout du fleche double sens nord--// final EbliNodeDefault nodeDbl = new EbliNodeDefault(); @@ -244,56 +248,60 @@ nodeDbl.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_WEST)); nodeDbl.setPreferedSize(new Dimension(100, 100)); nodeDbl.setPreferedLocation(new Point(450, 125)); - scene.addNode(nodeDbl); + //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); +// 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); +// 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(); +// 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); - - 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); + EbliNodeDefault nodeFleche = new EbliNodeDefault(); + nodeFleche.setTitle("CONNECTOR"); + nodeFleche.setCreator(new EbliWidgetCreatorConnectionWidget()); + scene.addNode(nodeFleche); 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"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2009-02-08 22:18:46
|
Revision: 4447 http://fudaa.svn.sourceforge.net/fudaa/?rev=4447&view=rev Author: deniger Date: 2009-02-08 22:18:41 +0000 (Sun, 08 Feb 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluListModelEmpty.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliEditorArrow.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetArrowEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetComponent.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerFlecheEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliActionEditorOneClick.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionAlign.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionConfigure.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicateLayout.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRatio.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageHorizontal.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageVertical.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/animation/EbliWidgetAnimAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorArrowEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFlecheSimple.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorFlecheSimple.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetTitle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/GrapheCellRenderer.java 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/WidgetLegendeManager.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTreeTableModel.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluListModelEmpty.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluListModelEmpty.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluListModelEmpty.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -9,12 +9,14 @@ import javax.swing.ComboBoxModel; import javax.swing.event.ListDataListener; +import javax.swing.event.TableModelListener; +import javax.swing.table.TableModel; /** * @author Fred Deniger * @version $Id: CtuluListModelEmpty.java,v 1.2 2007-05-04 13:43:23 deniger Exp $ */ -public final class CtuluListModelEmpty implements ComboBoxModel { +public final class CtuluListModelEmpty implements ComboBoxModel,TableModel { public final static CtuluListModelEmpty EMPTY = new CtuluListModelEmpty(); @@ -24,10 +26,28 @@ public void addListDataListener(final ListDataListener _l) {} + public void addTableModelListener(TableModelListener _l) {} + + public Class<?> getColumnClass(int _columnIndex) { + return null; + } + + public int getColumnCount() { + return 0; + } + + public String getColumnName(int _columnIndex) { + return null; + } + public Object getElementAt(final int _index) { return null; } + public int getRowCount() { + return 0; + } + public Object getSelectedItem() { return null; } @@ -36,7 +56,19 @@ return 0; } + public Object getValueAt(int _rowIndex, int _columnIndex) { + return null; + } + + public boolean isCellEditable(int _rowIndex, int _columnIndex) { + return false; + } + public void removeListDataListener(final ListDataListener _l) {} + public void removeTableModelListener(TableModelListener _l) {} + public void setSelectedItem(final Object _anItem) {} + + public void setValueAt(Object _value, int _rowIndex, int _columnIndex) {} } 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 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -36,10 +36,13 @@ import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JMenu; +import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; +import javax.swing.JTable; import javax.swing.ListCellRenderer; +import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener; @@ -48,7 +51,11 @@ import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluSelectionInterface; import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ctulu.gui.CtuluDialog; +import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluListModelEmpty; +import org.fudaa.ctulu.gui.CtuluTable; import org.fudaa.ctulu.gui.CtuluTreeComboboxModel; import org.fudaa.ctulu.gui.CtuluTreeComboboxRenderer; import org.fudaa.ctulu.image.CtuluImageProducer; @@ -69,12 +76,13 @@ import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuDynamicMenu; +import com.memoire.bu.BuInsets; import com.memoire.bu.BuLabel; import com.memoire.bu.BuLib; import com.memoire.bu.BuMenu; import com.memoire.bu.BuPanel; import com.memoire.bu.BuPopupMenu; -import com.memoire.bu.BuTable; +import com.memoire.bu.BuToolButton; /** * Fenetre d'affichage de calques contenant des services de base. (position souris, zoom fenetre, selection, @@ -141,6 +149,7 @@ cq_ = _cq; } + @Override protected void build() { removeAll(); final EbliActionInterface[] ac = cq_.getActions(); @@ -149,6 +158,7 @@ } } + @Override protected boolean isActive() { return true; } @@ -178,6 +188,7 @@ cqDonnees_ = _cqDonnees; } + @Override protected void build() { if (getMenuComponentCount() == 0) { fillWithAllLayersAction(this); @@ -196,6 +207,7 @@ return m; } + @Override protected boolean isActive() { return true; } @@ -284,7 +296,7 @@ return gcDonnees_; } - public void setGcDonnees_(BGroupeCalque gcDonnees_) { + public void setGcDonnees_(final BGroupeCalque gcDonnees_) { this.gcDonnees_ = gcDonnees_; } @@ -359,6 +371,7 @@ gcDonnees_ = new BGroupeCalque() { // B.M. Pour eviter le plantage, une boite est retourn\xE9e si rien n'est affich\xE9 ou boite non conforme. + @Override public GrBoite getDomaine() { GrBoite bt = super.getDomaine(); @@ -786,6 +799,7 @@ public ComboBoxModel getItemModel() { return new CtuluTreeComboboxModel(getArbreCalqueModel()) { + @Override public boolean isSelectable(final Object _o) { return EbliFindDialog.isCalqueFindable(_o); } @@ -834,6 +848,7 @@ public ListCellRenderer getComboRender() { return new CtuluTreeComboboxRenderer(getArbreCalqueModel(), new BArbreCalque.ArbreCellLabel()) { + @Override public void update(final JList _l, final JComponent _comp, final boolean _isSelected, final Object _value) { final JLabel lb = (JLabel) _comp; _comp.setToolTipText(lb.getText()); @@ -1001,11 +1016,11 @@ /* * @see org.fudaa.ebli.calque.ZSelectionListener#selectionChanged(org.fudaa.ebli.calque.ZSelectionEvent) */ - public void selectionChanged(ZSelectionEvent _evt) { + public void selectionChanged(final ZSelectionEvent _evt) { modelArbre_.fireObservableChanged(); } - public ZEbliCalquesPanel duplicate(Map options) { + public ZEbliCalquesPanel duplicate(final Map options) { /* * ZEbliCalquesPanel duplic = new ZEbliCalquesPanel(new CtuluUIDefault()); * @@ -1028,22 +1043,47 @@ public BuPanel buildInfosCreationComposant() { if (infosCreation_ == null || infosCreation_.keySet() == null || infosCreation_.keySet().size() == 0) return new BuPanel(); - List<String> liste = new ArrayList<String>(infosCreation_.keySet()); - Collections.sort(liste); - List<String> col = new ArrayList<String>(); - col.add(EbliResource.EBLI.getString("Nom")); - col.add(EbliResource.EBLI.getString("Valeur")); - EbliModelInfos modelInfos = new EbliModelInfos(liste, infosCreation_, col); - BuTable table = new BuTable(modelInfos); + final JTable table = createTable(); - table.getColumnModel().getColumn(0).setPreferredWidth(20); - BuPanel conteneur = new BuPanel(new BorderLayout()); + final BuPanel conteneur = new BuPanel(new BorderLayout()); conteneur.add(new JScrollPane(table), BorderLayout.CENTER); - conteneur.add(new JLabel("<html><body><b>" + EbliResource.EBLI.getString("Infos cr\xE9ations") + "</b></body></html>", - JLabel.CENTER), BorderLayout.NORTH); + final BuToolButton bt = new BuToolButton(EbliResource.EBLI.getToolIcon("haut-droit.gif")); + bt.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent _e) { + final CtuluDialogPanel pn = new CtuluDialogPanel(); + pn.setLayout(new BuBorderLayout()); + final JTable newtable = new CtuluTable(table.getModel()); + newtable.getColumnModel().getColumn(0).setPreferredWidth(20); + pn.add(new JScrollPane(newtable), BorderLayout.CENTER); + pn.afficheModale(table, CtuluDialog.OK_OPTION); + newtable.setModel(CtuluListModelEmpty.EMPTY); + } + }); + JPanel top = new BuPanel(new BuBorderLayout()); + + top.add(new JLabel("<html><body><b>" + EbliResource.EBLI.getString("Infos cr\xE9ations") + "</b></body></html>", + SwingConstants.CENTER), BorderLayout.CENTER); + top.add(bt, BuBorderLayout.EAST); + bt.setBorder(null); + bt.setMargin(BuInsets.INSETS0000); + conteneur.add(top, BuBorderLayout.NORTH); return conteneur; } + private JTable createTable() { + final List<String> liste = new ArrayList<String>(infosCreation_.keySet()); + Collections.sort(liste); + final List<String> col = new ArrayList<String>(); + col.add(EbliResource.EBLI.getString("Nom")); + col.add(EbliResource.EBLI.getString("Valeur")); + + final EbliModelInfos modelInfos = new EbliModelInfos(liste, infosCreation_, col); + final JTable table = new CtuluTable(modelInfos); + table.getColumnModel().getColumn(0).setPreferredWidth(20); + return table; + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliEditorArrow.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliEditorArrow.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliEditorArrow.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -5,14 +5,12 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.Image; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.image.BufferedImage; -import java.awt.image.ImageProducer; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -28,8 +26,6 @@ import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; - - import com.memoire.bu.BuPanel; @@ -43,6 +39,7 @@ * @author Adrien Hadoux * */ +@SuppressWarnings("serial") public class EbliEditorArrow extends BuPanel implements CtuluImageProducer, MouseListener, MouseMotionListener { public final static int ExtremiteTete=0; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -1,166 +1,144 @@ package org.fudaa.ebli.commun; import java.util.ArrayList; -import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import javax.swing.event.TableModelListener; import javax.swing.table.AbstractTableModel; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableModel; +import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ebli.ressource.EbliResource; - /** - * Modele de tableau qui utilise une map <str, str>. - * Affiche des couple clef/valeurs de la map tri\xE9es. - * Utilis\xE9 en particulier pour les infos de creation des extends zeblicalquePanel. - * Prend en charge l'\xE9dition dans la map. - * Organise les infos par ordre lexicographique. - * Pour changer le trie a sa guise, faire son comparator et le placer dans le bon constructeur. + * Modele de tableau qui utilise une map <str, str>. Affiche des couple clef/valeurs de la map tri\xE9es. Utilis\xE9 en + * particulier pour les infos de creation des extends zeblicalquePanel. Prend en charge l'\xE9dition dans la map. Organise + * les infos par ordre lexicographique. Pour changer le trie a sa guise, faire son comparator et le placer dans le bon + * constructeur. + * * @author Adrien Hadoux - * */ -public class EbliModelInfos extends AbstractTableModel{ +public class EbliModelInfos extends AbstractTableModel { - private static final long serialVersionUID = -2080709568281587469L; - private List<String> listeKey_; - private List<String> listeValue_; - private final List<String> colonnes_; - /** - * Les infos de la table. - */ - private Map<String,String> infos_; - private final Comparator<String> comparator_; + private static final long serialVersionUID = -2080709568281587469L; + private List<String> listeKey_; + private List<String> listeValue_; + private final List<String> colonnes_; + /** + * Les infos de la table. + */ + private Map<String, String> infos_; + private final Comparator<String> comparator_; - public EbliModelInfos(List<String> liste,Map<String,String> map,List<String> colonnes){ - - this(liste,map,colonnes,null); - } + public EbliModelInfos(List<String> liste, Map<String, String> map, List<String> colonnes) { - public EbliModelInfos(List<String> liste,Map<String,String> map,List<String> colonnes,Comparator<String> comparator){ - super(); - listeKey_=liste; - infos_=map; - comparator_=comparator; - colonnes_=colonnes; - - listeValue_=new ArrayList<String>(); - for(String key:liste) - listeValue_.add(map.get(key)); - - } + this(liste, map, colonnes, null); + } + public EbliModelInfos(List<String> liste, Map<String, String> map, List<String> colonnes, + Comparator<String> comparator) { + super(); + listeKey_ = liste; + infos_ = map; + comparator_ = comparator; + colonnes_ = colonnes; - @Override - public String getColumnName(int column) { - // TODO Auto-generated method stub - return colonnes_.get(column); - } + listeValue_ = new ArrayList<String>(); + for (String key : liste) + listeValue_.add(map.get(key)); - public int getRowCount() { - // TODO Auto-generated method stub - return infos_.keySet().size()+1; - } + } - public Object getValueAt(int row, int column) { + @Override + public String getColumnName(int column) { + return colonnes_.get(column); + } - if(row==getRowCount()-1){ - if(column==0) - return EbliResource.EBLI.getString("Editable"); - else - return EbliResource.EBLI.getString("Double-cliquez pour \xE9diter"); - }else + public int getRowCount() { + return infos_.keySet().size() + 1; + } - if(column==0) - return getKey(row); - else - return getValue(row); + public Object getValueAt(int row, int column) { - } + if (row == getRowCount() - 1) { + if (column == 0) return EbliResource.EBLI.getString("Editable"); + else return EbliResource.EBLI.getString("Double-cliquez pour \xE9diter"); + } else + if (column == 0) return getKey(row); + else return getValue(row); - public void setValueAt(Object value, int row, int column) { + } - if(value==null)return; + public void setValueAt(Object value, int row, int column) { - if(row==getRowCount()-1 && !((String)value).equals(EbliResource.EBLI.getString("Editable"))){ - //-- ajout --// - if(column==1){ - String newKey="Note "+(infos_.keySet().size()+1); - infos_.put(newKey,(String)value); - listeKey_.add(newKey); - listeValue_.add((String)value); - } - else{ - infos_.put((String)value,""); - listeKey_.add((String)value); - listeValue_.add(""); - } - fireTableDataChanged(); + if (value == null) return; - }else{ - //-- modification --// - if(column==0){ - String res=infos_.get(getKey(row)); - infos_.remove(getKey(row)); - infos_.put((String)value, res); - listeKey_.set(row, (String)value); - }else{ - infos_.put(getKey(row),(String)value); - listeValue_.set(row,(String)value); - } - fireTableDataChanged(); - } - } - public String getKey(int row){ + if (row == getRowCount() - 1 && !((String) value).equals(EbliResource.EBLI.getString("Editable"))) { + // -- ajout --// + if (column == 1) { + String newKey = "Note " + (infos_.keySet().size() + 1); + infos_.put(newKey, (String) value); + listeKey_.add(newKey); + listeValue_.add((String) value); + } else { + infos_.put((String) value, ""); + listeKey_.add((String) value); + listeValue_.add(""); + } + fireTableDataChanged(); - if(row>=infos_.keySet().size()) - return ""; - return listeKey_.get(row); - } + } else { + // -- modification --// + if (column == 0) { + String res = infos_.get(getKey(row)); + infos_.remove(getKey(row)); + infos_.put((String) value, res); + listeKey_.set(row, (String) value); + } else { + infos_.put(getKey(row), (String) value); + listeValue_.set(row, (String) value); + } + fireTableDataChanged(); + } + } + public String getKey(int row) { + if (row < 0 || row >= infos_.size()) return ""; + return listeKey_.get(row); + } - public void fireTableDataChanged() { + public void fireTableDataChanged() { - //-- on modif le tableau --// -// listeKey_=new ArrayList<String>(infos_.keySet()); -// //-- on ordonne la liste -// if(comparator_==null) -// Collections.sort(listeKey_); -// else -// Collections.sort(listeKey_,comparator_); - super.fireTableDataChanged(); - } + super.fireTableDataChanged(); + } - public String getValue(int row){ - return listeValue_.get(row); - } + public String getValue(int row) { + if (row < 0 || row > listeValue_.size() - 1) return CtuluLibString.EMPTY_STRING; + return listeValue_.get(row); + } - @Override - public boolean isCellEditable(int row, int column) { - return true; - } + @Override + public boolean isCellEditable(int row, int column) { + return true; + } - @Override - public void addTableModelListener(TableModelListener l) { - } + @Override + public void addTableModelListener(TableModelListener l) {} - @Override - public Class<?> getColumnClass(int columnIndex) { - return String.class; - } + @Override + public Class<?> getColumnClass(int columnIndex) { + return String.class; + } - public int getColumnCount() { - return colonnes_.size(); - } + public int getColumnCount() { + return colonnes_.size(); + } - public void removeTableModelListener(TableModelListener l) { - - } + public void removeTableModelListener(TableModelListener l) { + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -7,14 +7,11 @@ import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.ArrayList; -import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; -import javax.swing.JComponent; - import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLibGenerator; @@ -31,8 +28,6 @@ import org.netbeans.api.visual.widget.Scene; import org.netbeans.api.visual.widget.Widget; -import sun.misc.Cleaner; - /** * classe de gestion de la scene principale * Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetArrowEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetArrowEditor.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetArrowEditor.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -13,8 +13,6 @@ import org.netbeans.api.visual.action.InplaceEditorProvider; import org.netbeans.api.visual.widget.Widget; -import com.memoire.fu.FuLog; - /** * Classe editeur de Fleche * Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetComponent.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetComponent.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetComponent.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -146,8 +146,8 @@ final Rectangle bounds = getClientArea(); final AffineTransform previousTransform = graphics.getTransform(); graphics.translate(bounds.x, bounds.y); - final double zoomFactor = getScene().getZoomFactor(); - graphics.scale(1 / zoomFactor, 1 / zoomFactor); + final double factor = getScene().getZoomFactor(); + graphics.scale(1 / factor, 1 / factor); component.print(graphics); graphics.setTransform(previousTransform); if (isDoubleBuffered) ((JComponent) component).setDoubleBuffered(isDoubleBuffered); 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 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -325,7 +325,7 @@ public void constructMenuDeplacerDansArbre(JPopupMenu menu){ - EbliActionSimple action=null; +// EbliActionSimple action=null; menu.add( new EbliActionSimple(EbliResource.EBLI.getString("En premier"),EbliResource.EBLI.getIcon("enpremier"),"ENPREMIER"){ public void actionPerformed(final ActionEvent _e) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerFlecheEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerFlecheEditor.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerFlecheEditor.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -9,14 +9,12 @@ import javax.swing.JToolBar; import org.fudaa.ctulu.CtuluResource; -import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; import org.fudaa.ebli.commun.EbliEditorArrow; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.actions.EbliActionEditorOneClick; import org.netbeans.api.visual.action.InplaceEditorProvider; import com.memoire.bu.BuMenuBar; -import com.memoire.bu.BuPanel; /** * Controller de l'editeur de fleches. Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -4,7 +4,6 @@ */ package org.fudaa.ebli.visuallibrary; -import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.Rectangle; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliActionEditorOneClick.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliActionEditorOneClick.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliActionEditorOneClick.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -44,30 +44,30 @@ * Modification ici: pour activer l editor, il suffit d appuyer une seule fois sur l editeur */ @Override - public State mouseClicked(final Widget widget, final WidgetMouseEvent event) { + public State mouseClicked(final Widget _widget, final WidgetMouseEvent _event) { - if (event.getButton() == MouseEvent.BUTTON1 /* && event.getClickCount() == 2 */) { - final Point p = event.getPoint(); - if (widget.getClientArea().contains(p)) if (openEditor(widget)) return State.createLocked(widget, this); + if (_event.getButton() == MouseEvent.BUTTON1 /* && event.getClickCount() == 2 */) { + final Point p = _event.getPoint(); + if (_widget.getClientArea().contains(p)) if (openEditor(_widget)) return State.createLocked(_widget, this); } return State.REJECTED; } @Override - public State mousePressed(final Widget widget, final WidgetMouseEvent event) { + public State mousePressed(final Widget _widget, final WidgetMouseEvent _event) { if (editor != null) closeEditor(true); return State.REJECTED; } @Override - public State mouseReleased(final Widget widget, final WidgetAction.WidgetMouseEvent event) { + public State mouseReleased(final Widget _widget, final WidgetAction.WidgetMouseEvent _event) { if (editor != null) closeEditor(true); return State.REJECTED; } @Override - public State keyPressed(final Widget widget, final WidgetKeyEvent event) { - if (event.getKeyChar() == KeyEvent.VK_ENTER) if (openEditor(widget)) return State.createLocked(widget, this); + public State keyPressed(final Widget _widget, final WidgetKeyEvent _event) { + if (_event.getKeyChar() == KeyEvent.VK_ENTER) if (openEditor(_widget)) return State.createLocked(_widget, this); return State.REJECTED; } @@ -75,34 +75,34 @@ return editor != null; } - public final boolean openEditor(final Widget widget) { + public final boolean openEditor(final Widget _widget) { if (editor != null) return false; - final Scene scene = widget.getScene(); + final Scene scene = _widget.getScene(); final JComponent component = scene.getView(); if (component == null) return false; - editor = provider.createEditorComponent(this, widget); + editor = provider.createEditorComponent(this, _widget); if (editor == null) return false; - this.widget = widget; + this.widget = _widget; component.add(editor); - provider.notifyOpened(this, widget, editor); + provider.notifyOpened(this, _widget, editor); - Rectangle rectangle = widget.getScene().convertSceneToView(widget.convertLocalToScene(widget.getBounds())); + Rectangle sceneRect = _widget.getScene().convertSceneToView(_widget.convertLocalToScene(_widget.getBounds())); - final Point center = GeomUtil.center(rectangle); + final Point center = GeomUtil.center(sceneRect); final Dimension size = editor.getMinimumSize(); - if (rectangle.width > size.width) size.width = rectangle.width; - if (rectangle.height > size.height) size.height = rectangle.height; + if (sceneRect.width > size.width) size.width = sceneRect.width; + if (sceneRect.height > size.height) size.height = sceneRect.height; final int x = center.x - size.width / 2; final int y = center.y - size.height / 2; - rectangle = new Rectangle(x, y, size.width, size.height); - updateRectangleToFitToView(rectangle); + sceneRect = new Rectangle(x, y, size.width, size.height); + updateRectangleToFitToView(sceneRect); - final Rectangle r = provider.getInitialEditorComponentBounds(this, widget, editor, rectangle); - this.rectangle = r != null ? r : rectangle; + final Rectangle r = provider.getInitialEditorComponentBounds(this, _widget, editor, sceneRect); + this.rectangle = r != null ? r : sceneRect; editor.setBounds(x, y, size.width, size.height); notifyEditorComponentBoundsChanged(); @@ -111,12 +111,13 @@ return true; } - private void updateRectangleToFitToView(final Rectangle rectangle) { + private void updateRectangleToFitToView(final Rectangle _rectangle) { final JComponent component = widget.getScene().getView(); - if (rectangle.x + rectangle.width > component.getWidth()) rectangle.x = component.getWidth() - rectangle.width; - if (rectangle.y + rectangle.height > component.getHeight()) rectangle.y = component.getHeight() - rectangle.height; - if (rectangle.x < 0) rectangle.x = 0; - if (rectangle.y < 0) rectangle.y = 0; + if (_rectangle.x + _rectangle.width > component.getWidth()) _rectangle.x = component.getWidth() - _rectangle.width; + if (_rectangle.y + _rectangle.height > component.getHeight()) _rectangle.y = component.getHeight() + - _rectangle.height; + if (_rectangle.x < 0) _rectangle.x = 0; + if (_rectangle.y < 0) _rectangle.y = 0; } public final void closeEditor(final boolean commit) { @@ -139,7 +140,7 @@ EnumSet<InplaceEditorProvider.ExpansionDirection> directions = provider .getExpansionDirections(this, widget, editor); if (directions == null) directions = EnumSet.noneOf(InplaceEditorProvider.ExpansionDirection.class); - final Rectangle rectangle = this.rectangle; + // final Rectangle rectangle = this.rectangle; final Dimension size = editor.getPreferredSize(); final Dimension minimumSize = editor.getMinimumSize(); if (minimumSize != null) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionAlign.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionAlign.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionAlign.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -23,6 +23,7 @@ * *@author Adrien Hadoux */ +@SuppressWarnings("serial") public abstract class EbliWidgetActionAlign extends EbliWidgetActionSimple { public static class Bottom extends EbliWidgetActionAlign { @@ -107,7 +108,6 @@ } - @SuppressWarnings("serial") public static class Left extends EbliWidgetActionAlign { public Left(final EbliScene _scene) { @@ -188,7 +188,6 @@ } - @SuppressWarnings("serial") public static class Right extends EbliWidgetActionAlign { public Right(final EbliScene _scene) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -5,7 +5,6 @@ import java.util.Iterator; import java.util.Set; -import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -19,13 +18,13 @@ */ public class EbliWidgetActionBackGround extends EbliWidgetActionSimple { - CtuluCommandContainer cmd_; +// CtuluCommandContainer cmd_; public EbliWidgetActionBackGround(final EbliScene _scene) { super(_scene, EbliResource.EBLI.getString("Arri\xE8re plan"), CtuluResource.CTULU.getIcon("crystal_disposerderriere"), "BACKGROUND"); - cmd_ = _scene.getCmdMng(); +// cmd_ = _scene.getCmdMng(); putValue(NAME, "Arri\xE8re plan"); } 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 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBloqueOuDebloqueWidget.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -4,7 +4,6 @@ import javax.swing.Icon; -import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; @@ -19,7 +18,7 @@ private static final long serialVersionUID = 1L; - final CtuluCommandContainer cmd_; +// final CtuluCommandContainer cmd_; boolean bloque_ = true; EbliWidget widget_; @@ -28,7 +27,7 @@ super(_widget.getEbliScene(), name, ic, id); widget_ = _widget; - cmd_ = _widget.getEbliScene().getCmdMng(); +// cmd_ = _widget.getEbliScene().getCmdMng(); bloque_ = bloque; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorBackground.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -23,6 +23,7 @@ * * @author Adrien Hadoux */ +@SuppressWarnings("serial") public abstract class EbliWidgetActionColorBackground extends EbliWidgetActionSimple { public static class ForWidget extends EbliWidgetActionColorBackground { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionColorForeground.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -10,7 +10,6 @@ import javax.swing.JColorChooser; -import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; @@ -21,15 +20,16 @@ * * @author Adrien Hadoux */ +@SuppressWarnings("serial") public class EbliWidgetActionColorForeground extends EbliWidgetActionSimple { - CtuluCommandContainer cmd_; +// CtuluCommandContainer cmd_; public EbliWidgetActionColorForeground(final EbliScene _scene) { super(_scene, EbliResource.EBLI.getString("Couleur Contour"), EbliResource.EBLI.getToolIcon("palettecouleur"), "CONTOUR"); - cmd_ = _scene.getCmdMng(); +// cmd_ = _scene.getCmdMng(); } @Override Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionConfigure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionConfigure.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionConfigure.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -22,6 +22,7 @@ * * @author Adrien Hadoux */ +@SuppressWarnings("serial") public class EbliWidgetActionConfigure extends EbliWidgetActionSimple { public EbliWidgetActionConfigure(final EbliScene _scene) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicate.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -5,7 +5,6 @@ import java.util.Iterator; import java.util.Set; -import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -30,14 +29,14 @@ private static final long serialVersionUID = 1L; - final CtuluCommandContainer cmd_; +// final CtuluCommandContainer cmd_; public EbliWidgetActionDuplicate(final EbliScene _scene) { super(_scene, EbliResource.EBLI.getString("dupliquer les objets s\xE9lectionn\xE9s"), CtuluResource.CTULU .getIcon("crystal_copier"), "DUPLICATE"); putValue(NAME, EbliResource.EBLI.getString("Duplication des \xE9lements s\xE9lectionn\xE9s")); - cmd_ = _scene.getCmdMng(); +// cmd_ = _scene.getCmdMng(); } @@ -74,8 +73,8 @@ final EbliNode currentNode = it.next(); // -- duplication du node --// - - EbliNode node = currentNode.getWidget().getController().duplication(listeNodeUndo, sceneDestination_); + currentNode.getWidget().getController().duplication(listeNodeUndo, sceneDestination_); +// EbliNode node = Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicateLayout.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicateLayout.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDuplicateLayout.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -6,7 +6,6 @@ import java.util.Iterator; import java.util.Set; -import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -21,6 +20,7 @@ * @author Adrien Hadoux * */ +@SuppressWarnings("serial") public class EbliWidgetActionDuplicateLayout extends EbliWidgetActionSimple { /** @@ -32,16 +32,15 @@ */ EbliScene sceneDestination_ = null; - private static final long serialVersionUID = 1L; - final CtuluCommandContainer cmd_; +// final CtuluCommandContainer cmd_; public EbliWidgetActionDuplicateLayout(final EbliScene _scene) { super(_scene, EbliResource.EBLI.getString("Dupliquer le layout"), CtuluResource.CTULU .getIcon("crystal_cascade.png"), "DUPLICATE"); putValue(NAME, EbliResource.EBLI.getString("Dupliquer le layout")); - cmd_ = _scene.getCmdMng(); +// cmd_ = _scene.getCmdMng(); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -21,6 +21,7 @@ * * @author Adrien Hadoux */ +@SuppressWarnings("serial") public class EbliWidgetActionImageChooser extends EbliWidgetActionSimple { public EbliWidgetActionImageChooser(final EbliScene _widget) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRatio.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRatio.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRatio.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -5,23 +5,21 @@ import javax.swing.Icon; import org.fudaa.ctulu.CtuluCommand; -import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliWidget; -import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; -import org.fudaa.ebli.visuallibrary.EbliWidgetController; /** * Action qui resize les widgets proportionnellement * * @author Adrien Hadoux */ +@SuppressWarnings("serial") public class EbliWidgetActionRatio extends EbliWidgetActionSimple { - private static final long serialVersionUID = 1L; +// private static final long serialVersionUID = 1L; - final CtuluCommandContainer cmd_; +// final CtuluCommandContainer cmd_; final boolean resizeProportionnel_; EbliWidget widget_; @@ -30,11 +28,10 @@ super(_widget.getEbliScene(), name, ic, id); widget_ = _widget; - cmd_ = _widget.getEbliScene().getCmdMng(); +// cmd_ = _widget.getEbliScene().getCmdMng(); resizeProportionnel_ = proportionnel; } - @SuppressWarnings("serial") public static class Proportional extends EbliWidgetActionRatio { public Proportional(final EbliWidget _widget) { @@ -46,7 +43,6 @@ } - @SuppressWarnings("serial") public static class Classical extends EbliWidgetActionRatio { public Classical(final EbliWidget _widget) { @@ -61,17 +57,17 @@ @Override public void actionPerformed(final ActionEvent e) { - EbliWidgetController controll; +// EbliWidgetController controll; +// +// if (widget_ instanceof EbliWidgetBordureSingle) { +// +// controll = ((EbliWidgetBordureSingle) widget_).getBordureController(); +// } else if (widget_.getParentWidget() instanceof EbliWidgetBordureSingle) { +// controll = ((EbliWidgetBordureSingle) widget_.getParentWidget()).getBordureController(); +// } else controll = widget_.getController(); - if (widget_ instanceof EbliWidgetBordureSingle) { +// final EbliWidgetController controller = controll; - controll = ((EbliWidgetBordureSingle) widget_).getBordureController(); - } else if (widget_.getParentWidget() instanceof EbliWidgetBordureSingle) { - controll = ((EbliWidgetBordureSingle) widget_.getParentWidget()).getBordureController(); - } else controll = widget_.getController(); - - final EbliWidgetController controller = controll; - if (resizeProportionnel_) { // controller.switchToResizeProportionnal(); widget_.getController().boutonProportion.setAction(new EbliWidgetActionRatio.Classical(widget_)); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageHorizontal.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageHorizontal.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageHorizontal.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -9,7 +9,6 @@ import java.util.List; import java.util.Set; -import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -28,7 +27,7 @@ public int typeRetaillage_; - CtuluCommandContainer cmd_; +// CtuluCommandContainer cmd_; public EbliWidgetActionRetaillageHorizontal(final EbliScene _scene, final int _typeRetaillage) { super(_scene, EbliResource.EBLI.getString("Premier plan"), CtuluResource.CTULU.getIcon("crystal_rangericones"), @@ -37,7 +36,7 @@ // -- type retailage --// typeRetaillage_ = _typeRetaillage; - cmd_ = _scene.getCmdMng(); +// cmd_ = _scene.getCmdMng(); if (_typeRetaillage == RETAIILLAGE_MAX) { putValue(NAME, "Resize Horizontal Max"); setIcon(EbliResource.EBLI.getToolIcon("aowidest")); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageVertical.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageVertical.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionRetaillageVertical.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -9,7 +9,6 @@ import java.util.List; import java.util.Set; -import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -28,7 +27,7 @@ public int typeRetaillage_; - CtuluCommandContainer cmd_; +// CtuluCommandContainer cmd_; public EbliWidgetActionRetaillageVertical(final EbliScene _scene, final int _typeRetaillage) { super(_scene, EbliResource.EBLI.getString("Premier plan"), CtuluResource.CTULU.getIcon("crystal_rangericones"), @@ -37,7 +36,7 @@ // -- type retailage --// typeRetaillage_ = _typeRetaillage; - cmd_ = _scene.getCmdMng(); +// cmd_ = _scene.getCmdMng(); if (_typeRetaillage == RETAIILLAGE_MAX) { putValue(NAME, EbliResource.EBLI.getString("Resize Vertical Max")); setIcon(EbliResource.EBLI.getToolIcon("aotallest")); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -17,6 +17,7 @@ * * @author Adrien Hadoux */ +@SuppressWarnings("serial") public class EbliWidgetActiontextEditor extends EbliWidgetActionSimple { public EbliWidgetActiontextEditor(final EbliScene _widget) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/animation/EbliWidgetAnimAdapter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/animation/EbliWidgetAnimAdapter.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/animation/EbliWidgetAnimAdapter.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -107,6 +107,7 @@ return act_; } + @SuppressWarnings("serial") private static class AnimTreeCellRenderer extends DefaultTreeCellRenderer { @Override 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 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -13,8 +13,6 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ebli.calque.BCalqueLegendePanel; -import org.fudaa.ebli.courbe.EGFillePanel; -import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.palette.PaletteSelecteurCouleurPlage; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2009-02-08 21:14:45 UTC (rev 4446) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2009-02-08 22:18:41 UTC (rev 4447) @@ -1,6 +1,5 @@ package org.fudaa.ebli.visuallibrary.calque; -import java.awt.Component; import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; @@ -21,8 +20,6 @@ import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JSplitPane; -import javax.swing.JTabbedPane; -import javax.swing.JTable; import javax.swing.JToolBar; import org.fudaa.ctulu.CtuluCommandContainer; @@ -52,7 +49,6 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; import org.fudaa.ebli.visuallibrary.actions.CommandMasquer; import org.fudaa.ebli.visuallibrary.actions.EbliActionEditorOneClick; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRatio; import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuMenuBar; @@ -96,7 +92,6 @@ widgetParent_ = _parent; addActionSpecifiques(); setProportional(true); - } @@ -174,32 +169,32 @@ @Override public EbliNode duplication(final ArrayList<EbliNode> listeNodeUndo, final EbliScene sceneDestination) { + if (sceneDestination == null) return null; // -- recuperation du node a dupliquer --// final EbliNode n = (EbliNode) widget_.getEbliScene().findObject(widget_); // duplication du node en question final EbliNode duplique = n.duplicate(null); + if (duplique == null) return null; - duplique.setTitle(EbliLib.getS("Calque")+" "+(sceneDestination.getAllVue2d().size()+1)); - + duplique.setTitle(EbliLib.getS("Calque") + " " + (sceneDestination.getAllVue2d().size() + 1)); + // -- redimensionnement du duplicata --// ((EbliWidgetCreatorVueCalque) duplique.getCreator()).initSize(getVisuPanel().getVueCalque().getCalque().getSize()); // -- ajout dans la scene --// - if (duplique != null && sceneDestination != null) { - sceneDestination.addNode(duplique); + sceneDestination.addNode(duplique); - // -- duplication des map de property graphique de la widget --// - duplique.getWidget().setPropGraphique(n.getWidget().duplicateGraphicalProperties()); - // -- duplication de la taille --// - duplique.getWidget().setPreferredBounds(n.getWidget().getPreferredBounds()); + // -- duplication des map de property graphique de la widget --// + duplique.getWidget().setPropGraphique(n.getWidget().duplicateGraphicalProperties()); + // -- duplication de la taille --// + duplique.getWidget().setPreferredBounds(n.getWidget().getPreferredBounds()); - // -- raffraichissement de la scene --// - widget_.getEbliScene().refresh(); - sceneDestination.refresh(); - postActionDuplication(n, duplique, listeNodeUndo); - } + // -- raffraichissement de la scene --// + widget_.getEbliScene().refresh(); + sceneDestination.refresh(); + postActionDuplication(n, duplique, listeNodeUndo); return duplique; } @@ -223,8 +218,7 @@ if (calqueActif != null && calqueActif instanceof BCalqueAffichage) { if (this.legendeWidget_.get(calqueActif) == null) { // legendeWidget_ = (CalqueLegendeWidgetAdapter) widgetCalque_.calquePanel_.getCqLegend(); - legendeWidget_.put(calqueActif, - (CalqueLegendeWidgetAdapter) widgetCalque_.calquePanel_.getCqLegend()); + legendeWidget_.put(calqueActif, (CalqueLegendeWidgetAdapter) widgetCalque_.calquePanel_.getCqLegend()); final CalqueLegendeWidgetAdapter legendeAdapter = this.legendeWidget_.get(calqueActif); @@ -464,24 +458,22 @@ pals.updateBeforeShow(); tb.addTab(pals.getTitle(), pals.getIcon(), component); } - - - //-- split avec infos + arbre des calques --// + + // -- split avec infos + arbre des calques --// final JSplitPane splitInfosArbre = new JSplitPane(JSplitPane.VERTICAL_SPLIT); - + final BuPanel scrollInfos = getVisuPanel().buildInfosCreationComposant(); - scrollInfos.setMinimumSize(new Dimension((int) scrollInfos.getSize().getWidth(),100)); - + scrollInfos.setMinimumSize(new Dimension((int) scrollInfos.getSize().getWidth(), 100)); + splitInfosArbre.setTopComponent(scrollInfos); splitInfosArbre.setBottomComponent(scrollPane); splitInfosArbre.setDividerLocation(0.3D); - - + final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); splitPane.setTopComponent(tb); splitPane.setBottomComponent(splitInfosArbre); splitPane.setDividerLocation(0.3D); - + panelTreeCalque_ = splitPane; } else { panelTreeCalque_ = scrollPane; @@ -531,16 +523,21 @@ // ajout combobox toolbarCalque_.add(comboVar_); - - comboVar_.setPreferredSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); - comboVar_.getCb().setMaximumSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); - comboVar_.getCb().setMinimumSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); - comboVar_.getCb().setSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); - comboVar_.getCb().setPreferredSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); - + + comboVar_.setPreferredSize(new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_ + .getPreferredSize().height)); + comboVar_.getCb().setMaximumSize( + new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_.getPreferredSize().height)); + comboVar_.getCb().setMinimumSize( + new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_.getPreferredSize().height)); + comboVar_.getCb().setSize( + new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_.getPreferredSize().height)); + comboVar_.getCb().setPreferredSize( + new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_.getPreferredSize().height)); + comboVar_.revalidate(); toolbarCalque_.revalidate(); - + // -- ajout des combo des pas de temps --// final EbliCalqueActionTimeChooser chooserT = new EbliCalqueActionTimeChooser(getVisuPanel().getArbreCalqueModel() .getTreeSelectionModel(), true); @@ -548,14 +545,19 @@ chooserT.setSelected(true); final BSelecteurListComboBox combo = (BSelecteurListComboBox) chooserT.buildContentPane(); chooserT.updateBeforeShow(); - + // ajout combobox toolbarCalque_.add(combo); - combo.setPreferredSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); - combo.getCb().setMaximumSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); - combo.getCb().setMinimumSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); - combo.getCb().setSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); - combo.getCb().setPreferredSize(new Dimension(Math.max(comboVar_.getPreferredSize().width,200),comboVar_.getPreferredSize().height)); + combo.setPreferredSize(new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_ + .getPreferredSize().height)); + combo.getCb().setMaximumSize( + new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_.getPreferredSize().height)); + combo.getCb().setMinimumSize( + new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_.getPreferredSize().height)); + combo.getCb().setSize( + new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_.getPreferredSize().height)); + combo.getCb().setPreferredSize( + new Dimension(Math.max(comboVar_.getPreferredSize().width, 200), comboVar_.getPreferredSize().height)); combo.revalidate(); toolbarCalque_.revalidate(); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branc... [truncated message content] |
From: <de...@us...> - 2009-02-08 21:14:50
|
Revision: 4446 http://fudaa.svn.sourceforge.net/fudaa/?rev=4446&view=rev Author: deniger Date: 2009-02-08 21:14:45 +0000 (Sun, 08 Feb 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibArray.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliEditorArrow.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/EbliWidgetArrowEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerForGroup.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.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/TrPostSourceComparator.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDeleteSelected.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionGroup.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibArray.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibArray.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibArray.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -48,7 +48,7 @@ */ @SuppressWarnings("unchecked") public static boolean isEmpty(final Collection _array) { - return _array == null || _array.size() == 0; + return _array == null || _array.isEmpty(); } /** Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZScene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZScene.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZScene.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -769,7 +769,7 @@ * @see javax.swing.event.TreeModelListener#treeNodesInserted(javax.swing.event.TreeModelEvent) */ public void treeNodesInserted(TreeModelEvent e) { - FuLog.warning("ZScene.treeNodesInserted"); + FuLog.trace("ZScene.treeNodesInserted"); refreshRequested(); } @@ -777,7 +777,7 @@ * @see javax.swing.event.TreeModelListener#treeNodesRemoved(javax.swing.event.TreeModelEvent) */ public void treeNodesRemoved(TreeModelEvent e) { - FuLog.warning("ZScene.treeNodesRemoved"); + FuLog.trace("ZScene.treeNodesRemoved"); refreshRequested(); } @@ -785,7 +785,7 @@ * @see javax.swing.event.TreeModelListener#treeStructureChanged(javax.swing.event.TreeModelEvent) */ public void treeStructureChanged(TreeModelEvent e) { - FuLog.warning("ZScene.treeStructureChanged"); + FuLog.trace("ZScene.treeStructureChanged"); refreshRequested(); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliEditorArrow.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliEditorArrow.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliEditorArrow.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -429,7 +429,7 @@ if(!ajout()){ positionPointToMove_=determinePointAmodifier(new Point(e.getX(),e.getY())); marqueurDeplacement_=true; - System.out.println("Souris pressed: positionToMove:"+positionPointToMove_); +// System.out.println("Souris pressed: positionToMove:"+positionPointToMove_); repaint(); } else @@ -443,7 +443,7 @@ if(!ajout() && positionPointToMove_!=-1){ modifieExtremite(new Point(e.getX(),e.getY()), positionPointToMove_); positionPointToMove_=-1; - System.out.println("Souris released: positionToMove:"+positionPointToMove_); +// System.out.println("Souris released: positionToMove:"+positionPointToMove_); marqueurDeplacement_=false; positionDeplacement_=null; repaint(); @@ -460,7 +460,7 @@ } public void mouseMoved(MouseEvent e) { - System.out.println("Souris MOVED: "+positionPointToMove_); +// System.out.println("Souris MOVED: "+positionPointToMove_); } 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 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 2009-02-08 21:14:45 UTC (rev 4446) @@ -337,6 +337,7 @@ Ajouter un sommet \xE0 une polyligne=Add a vertex to a polyline Groupe=Group Supprimer un point=Delete a point +Supprimer les objets s\xE9lectionn\xE9s=Delete selected objects Epaisseur du trait=Line weight Style du trait=Line style Vecteurs=Vectors Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetArrowEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetArrowEditor.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetArrowEditor.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -10,9 +10,7 @@ import org.fudaa.ctulu.image.CtuluLibImage; import org.fudaa.ebli.commun.EbliEditorArrow; -import org.netbeans.api.visual.action.ActionFactory; import org.netbeans.api.visual.action.InplaceEditorProvider; -import org.netbeans.api.visual.action.WidgetAction; import org.netbeans.api.visual.widget.Widget; import com.memoire.fu.FuLog; @@ -49,12 +47,13 @@ final Rectangle rec = getClientArea(); final Graphics2D g = getGraphics(); // g.translate(rec.x, rec.y); + // FRED comprend rien: pourquoi creer une image interm\xE9diaire ? if (rec.width > 0 && rec.height > 0) { // mode edition // if (imageFleche == null || imageFleche.getWidth() != (rec.width-1) || imageFleche.getHeight() != // (rec.height-1)) { - FuLog.debug("EWI: recreate image"); + // FuLog.debug("EWI: recreate image"); final Map params = new HashMap(); CtuluLibImage.setCompatibleImageAsked(params); editor_.model_ = getTraceLigneModel(); @@ -81,14 +80,12 @@ public EnumSet<org.netbeans.api.visual.action.InplaceEditorProvider.ExpansionDirection> getExpansionDirections( org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget, EbliEditorArrow editor) { - // TODO Auto-generated method stub return null; } public Rectangle getInitialEditorComponentBounds( org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, Widget widget, EbliEditorArrow editor, Rectangle viewBounds) { - // TODO Auto-generated method stub final Rectangle rec = convertLocalToScene(getClientArea()); rec.width -= 1; rec.height -= 1; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -147,7 +147,7 @@ if(oldTraceligne_.getEpaisseur()!=l.getEpaisseur()){ //-- on ajoute le delta d'epaisseur --// float delta=l.getEpaisseur()-oldTraceligne_.getEpaisseur(); - System.out.println("\n***Delta: "+delta); +// System.out.println("\n***Delta: "+delta); Rectangle sizeWidget=this.getPreferredBounds(); //-- on rajoute le double de delta pour l'\xE9paisseur des 2 cot\xE9s --// sizeWidget.height+=2*delta; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerForGroup.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerForGroup.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetControllerForGroup.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -12,7 +12,7 @@ import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ebli.visuallibrary.actions.CommandeDuplicate; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetGroupAction; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionGroup; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetUngroupAction; import org.netbeans.api.visual.widget.Widget; @@ -64,7 +64,7 @@ } // -- on rejoue un groupement des node a grouper --// - final EbliNode nodeGroup = new EbliWidgetGroupAction(sceneDestination).groupWidgets(nodeToGroup); + final EbliNode nodeGroup = new EbliWidgetActionGroup(sceneDestination).groupWidgets(nodeToGroup); // listeNodeUndo.add(nodeGroup); // -- undo global --// @@ -77,7 +77,7 @@ public void redo() { new CommandeDuplicate(nodeToGroup, widget_.getEbliScene()).redo(); - new EbliWidgetGroupAction(sceneDestination).groupWidgets(nodeToGroup); + new EbliWidgetActionGroup(sceneDestination).groupWidgets(nodeToGroup); } }); Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDeleteSelected.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDeleteSelected.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionDeleteSelected.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -0,0 +1,55 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ebli.visuallibrary.actions; + +import java.awt.Point; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.swing.KeyStroke; + +import org.fudaa.ctulu.CtuluLibArray; +import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ebli.commun.EbliLib; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; + +/** + * @author deniger + */ +@SuppressWarnings("serial") +public class EbliWidgetActionDeleteSelected extends EbliWidgetActionSimple { + + public EbliWidgetActionDeleteSelected(final EbliScene _scene) { + super(_scene, EbliLib.getS("Supprimer"), CtuluResource.CTULU.getIcon("crystal_non"), "DELETE_SELECTED"); + setKey(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); + setDefaultToolTip(EbliLib.getS("Supprimer les objets s\xE9lectionn\xE9s")); + } + + @Override + public void actionPerformed(final ActionEvent _e) { + final Set selectedObjects = new HashSet(scene_.getSelectedObjects()); + if (CtuluLibArray.isEmpty(selectedObjects)) return; + final List<EbliNode> nodes = new ArrayList<EbliNode>(selectedObjects.size()); + final List<Point> points = new ArrayList<Point>(selectedObjects.size()); + for (final Object obj : selectedObjects) { + final EbliWidget ew = (EbliWidget) scene_.findWidget(obj); + final EbliNode node = (EbliNode) obj; + nodes.add(node); + points.add(ew.getLocation()); + scene_.removeNode(node); + } + scene_.refresh(); + scene_.getCmdMng().addCmd(new CommandSupprimer(nodes, scene_, points)); + scene_.setSelectedObjects(Collections.EMPTY_SET); + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -5,7 +5,6 @@ import java.util.Iterator; import java.util.Set; -import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -19,13 +18,10 @@ */ public class EbliWidgetActionForeGround extends EbliWidgetActionSimple { - CtuluCommandContainer cmd_; - public EbliWidgetActionForeGround(final EbliScene _scene) { super(_scene, EbliResource.EBLI.getString("Avant plan"), CtuluResource.CTULU.getIcon("crystal_disposerdevant"), "FOREGROUND"); - cmd_ = _scene.getCmdMng(); putValue(NAME, "Avant plan"); } @@ -46,19 +42,7 @@ final EbliNode currentNode = it.next(); if (currentNode != null && currentNode.isMovable()) { - // -- ajout au premier plan du node --// - // scene_.getVisu().addChild(currentNode.getCreator().getWidget()); - -// currentNode.getWidget().bringToFront(); -// -// listeWidget.add(currentNode.getWidget()); -// -// // -- rafraichissement de la scene --// -// scene_.refresh(); -// -// scene_.getTreeModel().nodeMoved( currentNode.getWidget()); - - scene_.bringToLast(currentNode.getWidget()); + scene_.bringToLast(currentNode.getWidget()); } } Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionGroup.java (from rev 4358, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionGroup.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionGroup.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -0,0 +1,188 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ebli.visuallibrary.actions; + +import java.awt.Dimension; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.geom.Rectangle2D; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import org.fudaa.ctulu.CtuluCommand; +import org.fudaa.ebli.commun.EbliLib; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetControllerForGroup; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerCalque; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetVueCalque; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetGroupCreator; +import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetGraphe; +import org.fudaa.ebli.visuallibrary.layout.GroupLayout; +import org.netbeans.api.visual.widget.Widget; + +import com.memoire.bu.BuInsets; + +/** + * @author deniger + */ +@SuppressWarnings("serial") +public class EbliWidgetActionGroup extends EbliWidgetActionSimple { + + public EbliWidgetActionGroup(final EbliScene _scene) { + super(_scene, EbliLib.getS("Grouper"), EbliResource.EBLI.getToolIcon("formatgroup_16.png"), "GROUP_WIDGETS"); + } + + @Override + @SuppressWarnings("unchecked") + public void actionPerformed(final ActionEvent e) { + Set selectedObjects = new HashSet(scene_.getSelectedObjects()); + if (!selectedObjects.isEmpty()) { + + //--Gestion du cas si le graphe a une legende, on veut pouvoir grouper automatiquement sa legende dans le groupe --// + selectedObjects = addLegendeAuto(selectedObjects); + + + performGroup(selectedObjects); + } + + } + + /** + * Ajoute automatiquement les legendes dans la liste a grouper. + * + * @param selectedObjects + * @return + */ + private Set addLegendeAuto(final Set selectedObjects) { + Set<EbliNode> newList = new HashSet<EbliNode>(selectedObjects); + + // -- check automatiquement les l\xE9gendes si il doit en ajouter --// + for (Object objet : selectedObjects) { + if (objet instanceof EbliNode) { + EbliNode nodeCurrent = (EbliNode) objet; + + // instance de graphe + if (nodeCurrent.getWidget().getIntern() instanceof EbliWidgetGraphe) { + // -- candidat --// + EbliNode nodeLegende = ((EbliWidgetGraphe) nodeCurrent.getWidget().getIntern()).getNodeLegende(); + if (nodeLegende != null) + newList.add(nodeLegende);// hashset donc ajoute que si la ref n + // existe pas deja + } else if (nodeCurrent.getWidget().getIntern() instanceof EbliWidgetVueCalque) { + // -- candidat --// + EbliNode nodeLegende = ((EbliWidgetControllerCalque) nodeCurrent.getWidget().getIntern().getController()) + .getNodeLegende(); + if (nodeLegende != null) + newList.add(nodeLegende);// hashset donc ajoute que si la ref n + // existe pas deja + } + + } + } + + + return newList; + } + + /** + * Methode qui realise le groupage des ebliNodes. + * + * @param _selectedObjects + * @return + */ + public EbliNode performGroup(final Set _selectedObjects) { + final EbliNode n = groupWidgets(_selectedObjects); + getScene().getCmdMng().addCmd(new CtuluCommand() { + + public void undo() { + EbliWidgetUngroupAction.degroupObjects(getScene(), n); + + } + + public void redo() { + groupWidgets(_selectedObjects); + } + }); + return n; + } + + public EbliNode groupWidgets(final Collection _selectedObjects) { + final EbliWidgetGroup parent = new EbliWidgetGroup(scene_); + // parent.setController(new EbliWidgetControllerMenuOnly(parent)); + parent.setLayout(new GroupLayout()); + final Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); + final Point max = new Point(-Integer.MAX_VALUE, -Integer.MAX_VALUE); + for (final Object object : _selectedObjects) { + final Widget findWidget = scene_.findWidget(object); + // Rectangle rec = findWidget.getBounds(); + final Rectangle rec = findWidget.convertLocalToScene(findWidget.getBounds()); + min.x = Math.min(min.x, rec.x); + min.y = Math.min(min.y, rec.y); + max.x = Math.max(max.x, rec.x + rec.width); + max.y = Math.max(max.y, rec.y + rec.height); + } + final int w = max.x - min.x; + final int h = max.y - min.y; + final Insets b = BuInsets.INSETS0000;// parent.getBorder().getInsets(); + + // System.err.println(b); + final Rectangle bounds = new Rectangle(-b.left, -b.top, w + b.left + b.right, h + b.top + b.bottom); + parent.setPreferredBounds(bounds); + parent.setPreferredLocation(new Point(min.x - bounds.x - b.left, min.y - bounds.y - b.top)); + parent.setPreferredSize(new Dimension(w + b.left + b.right, h + b.top + b.bottom)); + + for (final Object object : _selectedObjects) { + final Widget findWidget = scene_.findWidget(object); + final Rectangle widgetBounds = findWidget.getBounds(); + final Rectangle rec = findWidget.convertLocalToScene(widgetBounds); + final EbliWidget ew = (EbliWidget) findWidget; + ew.getController().removeActionResize(); + // scene_.removeNode((EbliNode) object); + + + findWidget.removeFromParent(); + final int dx = rec.x - min.x; + final int dy = rec.y - min.y; + + final Point pt = new Point(dx - widgetBounds.x, dy - widgetBounds.y); + findWidget.setPreferredLocation(pt); + parent.addChild(findWidget); + final float rMinX = ((float) dx) / w; + final float rMinY = ((float) dy) / h; + final float rMaxX = ((float) (w - widgetBounds.width - dx)) / w; + final float rMaxY = ((float) (h - widgetBounds.height - dy)) / h; + parent.setChildConstraint(findWidget, new Rectangle2D.Float(rMinX, rMinY, rMaxX, rMaxY)); + + + + + } + //-- sauvegarde des proportions pour le ungroup --// + parent.setProportions(); + + final EbliWidgetGroupCreator creator = new EbliWidgetGroupCreator(); + + parent.setGroup(true); + creator.setW(parent); + + final EbliNodeDefault node = new EbliNodeDefault(); + node.setPreferedLocation(min); + node.setTitle(EbliLib.getS("Groupe")); + node.setCreator(creator); + parent.setController(new EbliWidgetControllerForGroup(parent)); + scene_.addNode(node); + scene_.setSelectedObjects(new HashSet(Arrays.asList(node))); + return node; + } +} \ No newline at end of file Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -1,187 +0,0 @@ -/** - * Licence GPL - * Copyright Genesis - */ -package org.fudaa.ebli.visuallibrary.actions; - -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.geom.Rectangle2D; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import org.fudaa.ctulu.CtuluCommand; -import org.fudaa.ebli.commun.EbliLib; -import org.fudaa.ebli.ressource.EbliResource; -import org.fudaa.ebli.visuallibrary.EbliNode; -import org.fudaa.ebli.visuallibrary.EbliNodeDefault; -import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.EbliWidget; -import org.fudaa.ebli.visuallibrary.EbliWidgetControllerForGroup; -import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerCalque; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetVueCalque; -import org.fudaa.ebli.visuallibrary.creator.EbliWidgetGroupCreator; -import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetGraphe; -import org.fudaa.ebli.visuallibrary.layout.GroupLayout; -import org.netbeans.api.visual.widget.Widget; - -import com.memoire.bu.BuInsets; - -/** - * @author deniger - */ -public class EbliWidgetGroupAction extends EbliWidgetActionSimple { - - public EbliWidgetGroupAction(final EbliScene _scene) { - super(_scene, EbliLib.getS("Grouper"), EbliResource.EBLI.getToolIcon("formatgroup_16.png"), "GROUP_WIDGETS"); - } - - @Override - @SuppressWarnings("unchecked") - public void actionPerformed(final ActionEvent e) { - Set selectedObjects = new HashSet(scene_.getSelectedObjects()); - if (!selectedObjects.isEmpty()) { - - //--Gestion du cas si le graphe a une legende, on veut pouvoir grouper automatiquement sa legende dans le groupe --// - selectedObjects = addLegendeAuto(selectedObjects); - - - performGroup(selectedObjects); - } - - } - - /** - * Ajoute automatiquement les legendes dans la liste a grouper. - * - * @param selectedObjects - * @return - */ - private Set addLegendeAuto(final Set selectedObjects) { - Set<EbliNode> newList = new HashSet<EbliNode>(selectedObjects); - - // -- check automatiquement les l\xE9gendes si il doit en ajouter --// - for (Object objet : selectedObjects) { - if (objet instanceof EbliNode) { - EbliNode nodeCurrent = (EbliNode) objet; - - // instance de graphe - if (nodeCurrent.getWidget().getIntern() instanceof EbliWidgetGraphe) { - // -- candidat --// - EbliNode nodeLegende = ((EbliWidgetGraphe) nodeCurrent.getWidget().getIntern()).getNodeLegende(); - if (nodeLegende != null) - newList.add(nodeLegende);// hashset donc ajoute que si la ref n - // existe pas deja - } else if (nodeCurrent.getWidget().getIntern() instanceof EbliWidgetVueCalque) { - // -- candidat --// - EbliNode nodeLegende = ((EbliWidgetControllerCalque) nodeCurrent.getWidget().getIntern().getController()) - .getNodeLegende(); - if (nodeLegende != null) - newList.add(nodeLegende);// hashset donc ajoute que si la ref n - // existe pas deja - } - - } - } - - - return newList; - } - - /** - * Methode qui realise le groupage des ebliNodes. - * - * @param _selectedObjects - * @return - */ - public EbliNode performGroup(final Set _selectedObjects) { - final EbliNode n = groupWidgets(_selectedObjects); - getScene().getCmdMng().addCmd(new CtuluCommand() { - - public void undo() { - EbliWidgetUngroupAction.degroupObjects(getScene(), n); - - } - - public void redo() { - groupWidgets(_selectedObjects); - } - }); - return n; - } - - public EbliNode groupWidgets(final Collection _selectedObjects) { - final EbliWidgetGroup parent = new EbliWidgetGroup(scene_); - // parent.setController(new EbliWidgetControllerMenuOnly(parent)); - parent.setLayout(new GroupLayout()); - final Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); - final Point max = new Point(-Integer.MAX_VALUE, -Integer.MAX_VALUE); - for (final Object object : _selectedObjects) { - final Widget findWidget = scene_.findWidget(object); - // Rectangle rec = findWidget.getBounds(); - final Rectangle rec = findWidget.convertLocalToScene(findWidget.getBounds()); - min.x = Math.min(min.x, rec.x); - min.y = Math.min(min.y, rec.y); - max.x = Math.max(max.x, rec.x + rec.width); - max.y = Math.max(max.y, rec.y + rec.height); - } - final int w = max.x - min.x; - final int h = max.y - min.y; - final Insets b = BuInsets.INSETS0000;// parent.getBorder().getInsets(); - - // System.err.println(b); - final Rectangle bounds = new Rectangle(-b.left, -b.top, w + b.left + b.right, h + b.top + b.bottom); - parent.setPreferredBounds(bounds); - parent.setPreferredLocation(new Point(min.x - bounds.x - b.left, min.y - bounds.y - b.top)); - parent.setPreferredSize(new Dimension(w + b.left + b.right, h + b.top + b.bottom)); - - for (final Object object : _selectedObjects) { - final Widget findWidget = scene_.findWidget(object); - final Rectangle widgetBounds = findWidget.getBounds(); - final Rectangle rec = findWidget.convertLocalToScene(widgetBounds); - final EbliWidget ew = (EbliWidget) findWidget; - ew.getController().removeActionResize(); - // scene_.removeNode((EbliNode) object); - - - findWidget.removeFromParent(); - final int dx = rec.x - min.x; - final int dy = rec.y - min.y; - - final Point pt = new Point(dx - widgetBounds.x, dy - widgetBounds.y); - findWidget.setPreferredLocation(pt); - parent.addChild(findWidget); - final float rMinX = ((float) dx) / w; - final float rMinY = ((float) dy) / h; - final float rMaxX = ((float) (w - widgetBounds.width - dx)) / w; - final float rMaxY = ((float) (h - widgetBounds.height - dy)) / h; - parent.setChildConstraint(findWidget, new Rectangle2D.Float(rMinX, rMinY, rMaxX, rMaxY)); - - - - - } - //-- sauvegarde des proportions pour le ungroup --// - parent.setProportions(); - - final EbliWidgetGroupCreator creator = new EbliWidgetGroupCreator(); - - parent.setGroup(true); - creator.setW(parent); - - final EbliNodeDefault node = new EbliNodeDefault(); - node.setPreferedLocation(min); - node.setTitle(EbliLib.getS("Groupe")); - node.setCreator(creator); - parent.setController(new EbliWidgetControllerForGroup(parent)); - scene_.addNode(node); - scene_.setSelectedObjects(new HashSet(Arrays.asList(node))); - return node; - } -} \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -39,13 +39,14 @@ import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionBackGround; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionColorBackground; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionConfigure; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionDeleteSelected; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionForeGround; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionGroup; 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.actions.EbliWidgetActionSimple; import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActiontextEditor; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetGroupAction; import org.fudaa.ebli.visuallibrary.animation.EbliWidgetAnimAdapter; import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorLegende; @@ -364,7 +365,7 @@ * @param node */ public Widget addNode(final EbliNode node) { - Widget addNode = getSceneCourante().addNode(node); + final Widget addNode = getSceneCourante().addNode(node); // -- rafraichissement de la scene pour eviter les plantages --// getSceneCourante().refresh(); @@ -525,60 +526,51 @@ } } - // ajout de la combo de choix des layout - // res.add(comboMultiScenes_); - // JButton addScene = new - // JButton(CtuluResource.CTULU.getIcon("crystal_ajouter")); - // addScene.setActionCommand("AJOUTLAYOUT"); - // addScene.addActionListener(this); - // res.add(addScene); return res.toArray(new JComponent[res.size()]); } public List<EbliActionAbstract> getActions() { if (actions_ == null) { final List<EbliActionAbstract> init = new ArrayList<EbliActionAbstract>(20); - init.add(new EbliWidgetActionAlign.Left(getSceneCourante())); - init.add(new EbliWidgetActionAlign.Right(getSceneCourante())); - init.add(new EbliWidgetActionAlign.Middle(getSceneCourante())); - init.add(new EbliWidgetActionAlign.Center(getSceneCourante())); - init.add(new EbliWidgetActionAlign.Top(getSceneCourante())); - init.add(new EbliWidgetActionAlign.Bottom(getSceneCourante())); + final TrPostScene sceneCourante = getSceneCourante(); + init.add(new EbliWidgetActionAlign.Left(sceneCourante)); + init.add(new EbliWidgetActionAlign.Right(sceneCourante)); + init.add(new EbliWidgetActionAlign.Middle(sceneCourante)); + init.add(new EbliWidgetActionAlign.Center(sceneCourante)); + init.add(new EbliWidgetActionAlign.Top(sceneCourante)); + init.add(new EbliWidgetActionAlign.Bottom(sceneCourante)); init.add(null); - init.add(new EbliWidgetActionForeGround(getSceneCourante())); - init.add(new EbliWidgetActionBackGround(getSceneCourante())); + init.add(new EbliWidgetActionForeGround(sceneCourante)); + init.add(new EbliWidgetActionBackGround(sceneCourante)); init.add(null); // -- actions de retaillage min et max --// // init.add(new EbliWidgetActionRetaillageHorizontal(getScene(), // EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MIN)); - init.add(new EbliWidgetActionRetaillageHorizontal(getSceneCourante(), + init.add(new EbliWidgetActionRetaillageHorizontal(sceneCourante, EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MAX)); - init.add(new EbliWidgetActionRetaillageVertical(getSceneCourante(), - EbliWidgetActionRetaillageVertical.RETAIILLAGE_MAX)); + init + .add(new EbliWidgetActionRetaillageVertical(sceneCourante, EbliWidgetActionRetaillageVertical.RETAIILLAGE_MAX)); init.add(null); // -- blocage des widgets --// - // init.add(new - // EbliWidgetActionBloqueOuDebloqueWidget.Bloque(getSceneCourante())); - // init.add(new - // EbliWidgetActionBloqueOuDebloqueWidget.DeBloque(getSceneCourante())); + init.add(new EbliWidgetActionGroup(sceneCourante)); init.add(null); - init.add(new EbliWidgetGroupAction(getSceneCourante())); + init.add(new EbliWidgetActionDeleteSelected(sceneCourante)); init.add(null); // -- action de duplication --// // init.add(new EbliWidgetActionDuplicate(getSceneCourante())); - init.add(new TrPostActionDuplicate(getSceneCourante(), projet_)); - init.add(new TrPostActionDuplicateLayout(getSceneCourante(), projet_)); - init.add(new TrPostActionChangeSceneForWidget(getSceneCourante(), projet_)); + init.add(new TrPostActionDuplicate(sceneCourante, projet_)); + init.add(new TrPostActionDuplicateLayout(sceneCourante, projet_)); + init.add(new TrPostActionChangeSceneForWidget(sceneCourante, projet_)); init.add(null); // -- Action sur le format --// // init.add(new EbliWidgetActionColorForeground(getSceneCourante())); - init.add(new EbliWidgetActionColorBackground.ForScene(getSceneCourante())); + init.add(new EbliWidgetActionColorBackground.ForScene(sceneCourante)); // -- action de configuration des composants graphiques--// - init.add(new EbliWidgetActionConfigure(getSceneCourante())); + init.add(new EbliWidgetActionConfigure(sceneCourante)); init.add(null); // -- objets graphiques de base --// @@ -586,22 +578,23 @@ // -- ajout d'une action specifique de recreation du calque en cas de // suppression, on choisit la source a prendre en compte --// init.add(null); - init.add(new EbliActionSimple(EbliResource.EBLI.getString("Gestion Multi-Sources"), EbliResource.EBLI.getToolIcon("tableau"), - "MULTI SOURCES") { - public void actionPerformed(final ActionEvent _evt) { - // -- affichage de la fenetre de gestion multi projet --// - if (!projet_.filleProjetctManager_.isVisible()) { -// filleProjetctManager_.setSize(filleProjetctManager_.getSize().width, -// filleProjetctManager_.getSize().height / 2); + init.add(new EbliActionSimple(EbliResource.EBLI.getString("Gestion Multi-Sources"), EbliResource.EBLI + .getToolIcon("tableau"), "MULTI SOURCES") { + @Override + public void actionPerformed(final ActionEvent _evt) { + // -- affichage de la fenetre de gestion multi projet --// + if (!projet_.filleProjetctManager_.isVisible()) { + // filleProjetctManager_.setSize(filleProjetctManager_.getSize().width, + // filleProjetctManager_.getSize().height / 2); - projet_.impl_.addInternalFrame(projet_.filleProjetctManager_); - } else projet_.filleProjetctManager_.moveToFront(); - } - }); - + projet_.impl_.addInternalFrame(projet_.filleProjetctManager_); + } else projet_.filleProjetctManager_.moveToFront(); + } + }); + init.add(new TrPostActionChooseAndCreateCalque(projet_, this)); init.add(null); - init.add(new EbliWidgetAnimAdapter(getSceneCourante()).createAction()); + init.add(new EbliWidgetAnimAdapter(sceneCourante).createAction()); init.add(null); init.add(new TrPostWizardCreateScope.ImportAction(projet_)); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceComparator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceComparator.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceComparator.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -125,12 +125,8 @@ // srcVar.add(common[i]); finalVar.add(TrPostSourceComparatorBuilder.createDeltaVar(common[i], false)); } - variable_ = (H2dVariableType[]) finalVar.toArray(new H2dVariableType[finalVar.size()]); + setInitVar((H2dVariableType[]) finalVar.toArray(new H2dVariableType[finalVar.size()])); srcVariable_ = common; - initVarIdx_ = new TObjectIntHashMap(variable_.length); - for (int i = variable_.length - 1; i >= 0; i--) { - initVarIdx_.put(variable_[i], i); - } fireVariableAdd(false); fireVarListModelChanged(); } @@ -169,11 +165,10 @@ return inv_ ? -res : res; } - public void fillInfosCreationWith(Map<String,String> _infosCreation){ - + public void fillInfosCreationWith(Map<String, String> _infosCreation) { + } - - + public boolean isRubar() { return ref_.isRubar(); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2009-02-06 13:30:12 UTC (rev 4445) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2009-02-08 21:14:45 UTC (rev 4446) @@ -32,7 +32,7 @@ import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetGroupAction; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionGroup; import org.fudaa.ebli.visuallibrary.calque.EbliWidgetFusionCalques; import org.fudaa.ebli.visuallibrary.persist.EbliSceneSerializeXml; import org.fudaa.ebli.visuallibrary.persist.EbliWidgetGroupSerializeXml; @@ -1406,7 +1406,7 @@ // -- on met a jour le ebliNode avec les infos du groupe sauv\xE9 --// final EbliWidgetGroupSerializeXml infoGroup = listeGroupes.get(idGroup); - if (!infoGroup.isFusion()) nodeGroup = new EbliWidgetGroupAction(scenToUpdate).performGroup(listeToGroup); + if (!infoGroup.isFusion()) nodeGroup = new EbliWidgetActionGroup(scenToUpdate).performGroup(listeToGroup); else nodeGroup = new TrPostActionFusionCalques(scenToUpdate, trprojet_).performGroupFusion(listeToGroup); if (infoGroup != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-02-06 13:30:21
|
Revision: 4445 http://fudaa.svn.sourceforge.net/fudaa/?rev=4445&view=rev Author: bmarchan Date: 2009-02-06 13:30:12 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Tache#17: Sauvegarde des attributs atomiques dans les fichiers projets. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISDataModelFeatureAdapter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/gml/GISGMLZoneExporter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerExporter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISDataModelFeatureAdapter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISDataModelFeatureAdapter.java 2009-02-05 18:21:55 UTC (rev 4444) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISDataModelFeatureAdapter.java 2009-02-06 13:30:12 UTC (rev 4445) @@ -114,8 +114,39 @@ while (it.hasNext()) { final Feature f = it.next(); geom.add(f.getDefaultGeometry()); + for (int i = 0; i < finalAttributeCount; i++) { - values[i].add(f.getAttribute(idxInFeature.getQuick(i))); + // Les attributs atomiques sont autoris\xE9s. La valeur lue sur les features doit \xEAtre sous la forme {val1,val2,val3} + if (finalAtt[i].isAtomicValue()) { + String s=(String)f.getAttribute(idxInFeature.getQuick(i)); + String[] svals=s.substring(1,s.length()-1).split(","); + for (int j=0; j<svals.length; j++) + svals[j]=svals[j].replaceAll("‚", ","); + + if (finalAtt[i].getDataClass().equals(Integer.class)) { + Integer[] vals=new Integer[svals.length]; + for (int j=0; j<vals.length; j++) vals[j]=new Integer(svals[j]); + values[i].add(finalAtt[i].createDataForGeom(vals,vals.length)); + } + else if (finalAtt[i].getDataClass().equals(Boolean.class)) { + Boolean[] vals=new Boolean[svals.length]; + for (int j=0; j<vals.length; j++) vals[j]=new Boolean(svals[j]); + values[i].add(finalAtt[i].createDataForGeom(vals,vals.length)); + } + else if (finalAtt[i].getDataClass().equals(Double.class)) { + Double[] vals=new Double[svals.length]; + for (int j=0; j<vals.length; j++) vals[j]=new Double(svals[j]); + values[i].add(finalAtt[i].createDataForGeom(vals,vals.length)); + } + else if (finalAtt[i].getDataClass().equals(String.class)) { + String[] vals=new String[svals.length]; + for (int j=0; j<vals.length; j++) vals[j]=svals[j]; + values[i].add(finalAtt[i].createDataForGeom(vals,vals.length)); + } + } + // La valeur lue est globale. + else + values[i].add(f.getAttribute(idxInFeature.getQuick(i))); } if(indexGeomAttr!=-1) indexGeom.add((Integer) f.getAttribute(indexGeomAttr)); 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 2009-02-05 18:21:55 UTC (rev 4444) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2009-02-06 13:30:12 UTC (rev 4445) @@ -14,6 +14,7 @@ import org.fudaa.ctulu.ProgressionUpdater; import org.fudaa.ctulu.gui.CtuluValueEditorDefaults; import org.geotools.feature.AttributeType; +import org.geotools.feature.AttributeTypeFactory; import com.memoire.fu.FuLog; import com.vividsolutions.jts.algorithm.CGAlgorithms; @@ -622,14 +623,85 @@ return true; } + /** + * Cr\xE9e un attribut a partir d'un {@link AttributeType}, utilis\xE9 dans les DataStore. + * @param _type L'attribute type. + * @return L'attribut. + * @see {@link #createAttributeFrom(GISAttributeInterface, boolean)} + */ public static GISAttributeInterface createAttributeFrom(final AttributeType _type) { final GISAttributeInterface known = GISAttributeConstants.getConstantAttribute(_type.getName()); if (known != null && known.getDataClass().equals(_type.getType())) { return known; } - return createAttributeFrom(_type.getName(), _type.getType(), false); + + String name=_type.getName(); + Class<?> clazz=_type.getType(); + boolean isAtomic=false; + + // Gestion des attributs atomiques. + if (name.startsWith("[I]")) { + clazz=Integer.class; + name=name.substring(3); + isAtomic=true; + } + else if (name.startsWith("[S]")) { + clazz=String.class; + name=name.substring(3); + isAtomic=true; + } + else if (name.startsWith("[B]")) { + clazz=Boolean.class; + name=name.substring(3); + isAtomic=true; + } + else if (name.startsWith("[D]")) { + clazz=Double.class; + name=name.substring(3); + isAtomic=true; + } + + return createAttributeFrom(name, clazz, isAtomic); } + /** + * Cr\xE9e un {@link AttributeType}, utilis\xE9 dans les DataStore a partir d'un attribut.<p> + * Les AttributeType n'autorisant pas les tableaux, les attributs atomiques sont g\xE9r\xE9s de la mani\xE8re suivante:<br> + * <ul> + * <li>Le nom de l'AttributeType (getName()) indique l'atomicit\xE9, on y adjoint le type du tableau ([I],[S],[B],[D]). + * Exemple : [I]Indices</li> + * <li>Le type de l'AttributType (getType()) est toujours String.class</li> + * <li>La valeur de l'attribut sera une chaine contenant les valeurs, s\xE9par\xE9es par des virgules.</li> + * </ul> + * + * @param _att L'attribut. + * @return L'attribute type. + */ + public static AttributeType createAttributeFrom(final GISAttributeInterface _att, boolean _useIdAsName) { + AttributeType type; + + // Pour les attributs atomique, le type d'attribut est syst\xE9matique String, le type de tableau est mis dans le nom!! + if (_att.isAtomicValue()) { + String tbType=""; + if (_att.getDataClass().equals(String.class)) + tbType="[S]"; + else if (_att.getDataClass().equals(Integer.class)) + tbType="[I]"; + else if (_att.getDataClass().equals(Double.class)) + tbType="[D]"; + else if (_att.getDataClass().equals(Boolean.class)) + tbType="[B]"; + + type=AttributeTypeFactory.newAttributeType(tbType+(_useIdAsName ? _att.getID() : _att.getName()), String.class, true, 18); + } + // 18 pour les shapefiles ...; + else { + type=AttributeTypeFactory.newAttributeType(_useIdAsName ? _att.getID() : _att.getName(), _att + .getDataClass(), true, 18); + } + return type; + } + public static GISAttributeInterface createAttributeFrom(final String _name, final Class _c, final boolean _isAtomic) { if (Number.class.isAssignableFrom(_c)) { if (Integer.class.isAssignableFrom(_c)) { @@ -645,7 +717,7 @@ return createNonNumberAttr(_name, _c, _isAtomic); } - public static GISAttributeInterface createNonNumberAttr(final String _name, final Class _c, final boolean _isAtomic) { + private static GISAttributeInterface createNonNumberAttr(final String _name, final Class _c, final boolean _isAtomic) { if (Boolean.class.isAssignableFrom(_c)) { return new GISAttributeBoolean(_name, _isAtomic); } else if (String.class.isAssignableFrom(_c)) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/gml/GISGMLZoneExporter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/gml/GISGMLZoneExporter.java 2009-02-05 18:21:55 UTC (rev 4444) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/gml/GISGMLZoneExporter.java 2009-02-06 13:30:12 UTC (rev 4445) @@ -17,7 +17,10 @@ import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISAttributeDouble; import org.fudaa.ctulu.gis.GISAttributeInterface; +import org.fudaa.ctulu.gis.GISAttributeModel; +import org.fudaa.ctulu.gis.GISLib; import org.fudaa.ctulu.gis.GISZoneCollection; import org.geotools.data.DataStore; import org.geotools.data.FeatureWriter; @@ -54,13 +57,23 @@ private boolean useIdAsName_; - public AttributeType[] createAttributes(final GISDataModel _zone, final TObjectIntHashMap _attrIdx) { + /** + * Cr\xE9ation de tous les attributes types a partir des attributs de la zone. L'attribut pris pour Z n'est pas + * cr\xE9\xE9, car transf\xE9r\xE9 dans le Z. + * + * @param _zone La zone. + * @param _attIsZ L'attribut pris pour Z + * @param _attrIdx Argument de sortie. Une table associant l'indice des attributs de la zone a un attribut cr\xE9\xE9. + * @return Les attributs cr\xE9es. + */ + public AttributeType[] createAttributes(final GISDataModel _zone, final GISAttributeDouble _attIsZ, final TObjectIntHashMap _attrIdx) { final int attributeNb = _zone.getNbAttributes(); final TIntArrayList attribute = new TIntArrayList(attributeNb); - // pour l'instant, les attributs atomiques (definis sur chaque sommets) ne sont pas - // support\xE9s. + for (int i = 0; i < attributeNb; i++) { - if (!_zone.getAttribute(i).isAtomicValue()) { + // Seul l'attribut pris pour Z n'est pas enregistr\xE9. + if (!_zone.getAttribute(i).equals(_attIsZ)) { +// if (!_zone.getAttribute(i).isAtomicValue()) { attribute.add(i); if (FuLog.isDebug()) { FuLog.debug("add attribute " + _zone.getAttribute(i).getID() + " classe " @@ -76,12 +89,10 @@ for (int i = 0; i < size; i++) { final int posInZone = attribute.get(i); - final GISAttributeInterface atti = _zone.getAttribute(posInZone); - // 18 pour les shapefiles ...; - atts[1 + i] = AttributeTypeFactory.newAttributeType(useIdAsName_ ? atti.getID() : atti.getName(), atti - .getDataClass(), true, 18); - _attrIdx.put(atts[i + 1], posInZone); + atts[i+1] = GISLib.createAttributeFrom(_zone.getAttribute(posInZone),useIdAsName_); + _attrIdx.put(atts[i+1], posInZone); } + // Le dernier correspond \xE0 l'index de la g\xE9om\xE9trie dans la GISZone GISAttributeInterface attInd=GISAttributeConstants.INDEX_GEOM; atts[atts.length-1]=AttributeTypeFactory.newAttributeType(attInd.getID(), attInd.getDataClass()); @@ -107,11 +118,11 @@ * @throws SchemaException * @throws IllegalAttributeException */ - public void process(final ProgressionInterface _prog, final GISDataModel _zone, final DataStore _dest) + public void process(final ProgressionInterface _prog, final GISDataModel _zone, final GISAttributeDouble _attIsZ, final DataStore _dest) throws IOException, SchemaException, IllegalAttributeException { out_ = null; store_ = _dest; - process(_prog, _zone); + process(_prog, _zone, _attIsZ); } /** @@ -129,20 +140,29 @@ out_ = _dest; store_ = null; _zone.prepareExport(); - process(_prog, _zone); - + process(_prog, _zone, _zone.getAttributeIsZ()); } - private void process(final ProgressionInterface _prog, final GISDataModel _zone) throws IOException, + /** + * Enregistre la zone sous un format GML.<p> + * + * Les attributs globaux sont enregistr\xE9s comme attributs globaux de chaque g\xE9om\xE9trie, + * l'attribut pris pour Z est enregistr\xE9 dans les coordonn\xE9es Z des g\xE9om\xE9tries.<br> + * Les attributs atomiques sont enregistr\xE9s sous forme de tableau de String, s\xE9par\xE9s par une virgule. + * + * @param _prog Progression de la tache. + * @param _zone La zone a enregistrer + * @param _attIsZ L'attrribut pris pour Z (atomique ou non). + */ + private void process(final ProgressionInterface _prog, final GISDataModel _zone, GISAttributeDouble _attIsZ) throws IOException, SchemaException, IllegalAttributeException { /* - * Pour que les z atomiques soient exporter correctement, il faut que - * prepareExport() est \xE9t\xE9 appel\xE9 sur la GISZoneCollection dans le - * GISDataModel. + * Pour que les z atomiques soient export\xE9s correctement, il faut que + * prepareExport() ait \xE9t\xE9 appel\xE9 en amont de cette m\xE9thode. */ stop_ = false; final TObjectIntHashMap attIdx = new TObjectIntHashMap(_zone.getNbAttributes()); - final AttributeType[] atts = createAttributes(_zone, attIdx); + final AttributeType[] atts = createAttributes(_zone, _attIsZ, attIdx); if (stop_) { return; } @@ -164,8 +184,24 @@ final Feature feature = writer.next(); feature.setDefaultGeometry(_zone.getGeometry(i)); for (int j = 1; j < nbAttribute-1; j++) { - feature.setAttribute(j, _zone.getValue(attIdx.get(atts[j]), i)); + + // Pour les attributs atomiques, les valeurs sont stock\xE9es sous forme d'un tableau {a,b,c,...} + if (_zone.getAttribute(attIdx.get(atts[j])).isAtomicValue()) { + GISAttributeModel md=(GISAttributeModel)_zone.getValue(attIdx.get(atts[j]),i); + StringBuilder sb=new StringBuilder(); + + sb.append("{").append(md.getObjectValueAt(0).toString().replaceAll(",","‚")); + for (int k=1; k<md.getSize(); k++) sb.append(",").append(md.getObjectValueAt(k).toString().replaceAll(",","‚")); + sb.append("}"); + + feature.setAttribute(j, sb); + } + + /// Atributs standards. + else + feature.setAttribute(j, _zone.getValue(attIdx.get(atts[j]), i)); } + // Enregistrement de l'index de la g\xE9om\xE9trie dans le fichier feature.setAttribute(nbAttribute-1, new Integer(i)); writer.write(); @@ -181,7 +217,6 @@ } } } - } public FeatureType createFeatureType(final GISDataModel _zone, final AttributeType[] _atts) Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerExporter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerExporter.java 2009-02-05 18:21:55 UTC (rev 4444) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerExporter.java 2009-02-06 13:30:12 UTC (rev 4445) @@ -22,6 +22,7 @@ import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.fileformat.FileFormatUnique; import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISAttributeDouble; import org.fudaa.ctulu.gis.GISAttributeInterface; import org.fudaa.ctulu.gis.GISDataModel; import org.fudaa.ctulu.gis.GISDataModelFilterAdapter; @@ -96,7 +97,8 @@ } } GISDataModel collect = _filter.getCollect(oi); - exporter.process(_prog, collect, GISExportDataStoreFactory.createDataStore(dataStore_, file.toURL(), collect + GISAttributeDouble attIsZ=_filter.getAttributeIsZ(oi); + exporter.process(_prog, collect, attIsZ, GISExportDataStoreFactory.createDataStore(dataStore_, file.toURL(), collect .getEnvelopeInternal(), true)); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java 2009-02-05 18:21:55 UTC (rev 4444) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java 2009-02-06 13:30:12 UTC (rev 4445) @@ -16,6 +16,7 @@ import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gis.GISAttributeDouble; import org.fudaa.ctulu.gis.GISDataModel; import org.fudaa.ctulu.gis.GISDataModelFilterAdapter; import org.fudaa.ctulu.gis.GISZoneCollection; @@ -81,6 +82,15 @@ else return zone; } + + /** + * Retourne l'attribut pris pour Z dans la zone. + * @param _o Le calque + * @return L'attribut pris pour Z. Peut \xEAtre null. + */ + final GISAttributeDouble getAttributeIsZ(final ZCalqueAffichageDonneesInterface _o) { + return ((ZModeleGeometry) _o.modeleDonnees()).getGeomData().getAttributeIsZ(); + } final GISDataModel getCollect(final Object _o) { return getCollect((ZCalqueAffichageDonneesInterface) _o); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-02-05 18:22:07
|
Revision: 4444 http://fudaa.svn.sourceforge.net/fudaa/?rev=4444&view=rev Author: hadouxad Date: 2009-02-05 18:21:55 +0000 (Thu, 05 Feb 2009) Log Message: ----------- - calques destructibles (trajectoires, trace de courbes, cr?\195?\169ation depuis option origine du graphe) - cr?\195?\169ation de groupes pour rangement des traces de calques - ihm grilles et sous grilles graphe: sch?\195?\169ma des vues 2d - Refactorisation des algos de calculs fixes nb graduations et longueur de pas sous forme d iterator. - Grilles et sous grilles des graphes: - mode par nombre de graduations - mode par longueur de pas - ajout des tracelignemodel pour les 2 type de trac?\195?\169s - Utilisation des bselecteurs interfaces - Grilles et sous grilles des vues 2d - ajout des traceligne model pour les 2 versions - Wizard: - Texte avec case a cocher - Case par default a false - Undo/redo op?\195?\169rationnels pour les superposition des frames. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.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/TrPostSourceComparatorBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTrajectoireComputeAndDisplayActivity.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 2009-02-05 18:20:44 UTC (rev 4443) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 2009-02-05 18:21:55 UTC (rev 4444) @@ -8,6 +8,7 @@ import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.beans.PropertyChangeListener; import javax.swing.JColorChooser; import javax.swing.JComponent; @@ -19,9 +20,12 @@ import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; import org.fudaa.ebli.commun.EbliLib; +import org.fudaa.ebli.controle.BSelecteurLineModel; import org.fudaa.ebli.controle.BSelecteurReduitFonteNewVersion; +import org.fudaa.ebli.controle.BSelecteurTargetInterface; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.trace.TraceIconButton; +import org.fudaa.ebli.trace.TraceLigneModel; import org.fudaa.ebli.volume.controles.BControleVisible; import com.memoire.bu.BuButton; @@ -40,7 +44,7 @@ * @author fred deniger * @version $Id: FSigGrillePalette.java,v 1.2 2007-04-16 16:35:35 deniger Exp $ */ -public final class FSigGrillePalette extends EbliActionPaletteAbstract { +public final class FSigGrillePalette extends EbliActionPaletteAbstract implements BSelecteurTargetInterface { final ZCalqueGrille target_; @@ -66,7 +70,7 @@ return r; } - @Override + public JComponent buildContentPane() { final BuPanel content = new BuPanel(new BuVerticalLayout(2)); content.add(createMainProperties()); @@ -75,6 +79,11 @@ return content; } + public static String GRILLE_AXE_X="GRILLE_AXE_X"; + public static String GRILLE_AXE_Y="GRILLE_AXE_Y"; + public static String SOUS_GRILLE_AXE_X="SOUS_GRILLE_AXE_X"; + public static String SOUS_GRILLE_AXE_Y="SOUS_GRILLE_AXE_Y"; + private static String MANUEL1 = "MANUEL1"; private static String MANUEL2 = "MANUEL2"; private static String AUTO = "AUTO"; @@ -612,36 +621,42 @@ }); pn.add(cb); - pn.add(new BuLabel(EbliLib.getS("Couleur Grille"))); - final TraceIconButton btColor = new TraceIconButton(); - btColor.setForeground(target_.getForeground()); - btColor.addActionListener(new ActionListener() { - - public void actionPerformed(final ActionEvent _e) { - final Color c = JColorChooser.showDialog(target_, EbliLib.getS("Couleur Grille"), target_.getForeground()); - if (c != null) { - target_.setForeground(c); - btColor.setForeground(c); - } - } - }); - pn.add(btColor); - - pn.add(new BuLabel(EbliLib.getS("Couleur Sous Grille"))); - final TraceIconButton btColor2 = new TraceIconButton(); - btColor2.setForeground(target_.getForeground()); - btColor2.addActionListener(new ActionListener() { - - public void actionPerformed(final ActionEvent _e) { - final Color c = JColorChooser.showDialog(target_, EbliLib.getS("Couleur Sous Grille"), target_.getForeground()); - if (c != null) { - target_.setSousGraduationColor(c); - btColor2.setForeground(c); - } - } - }); - pn.add(btColor2); - + pn.add(new BuLabel(EbliLib.getS("Forme Grille"))); +// final TraceIconButton btColor = new TraceIconButton(); +// btColor.setForeground(target_.getForeground()); +// btColor.addActionListener(new ActionListener() { +// +// public void actionPerformed(final ActionEvent _e) { +// final Color c = JColorChooser.showDialog(target_, EbliLib.getS("Couleur Grille"), target_.getForeground()); +// if (c != null) { +// target_.setForeground(c); +// btColor.setForeground(c); +// } +// } +// }); +// pn.add(btColor); + BSelecteurLineModel modelGraduations = new BSelecteurLineModel(GRILLE_AXE_X,this.target_.getTraceGraduations_()); + modelGraduations.setSelecteurTarget(this); + pn.add(modelGraduations.buildPanel()); + + pn.add(new BuLabel(EbliLib.getS("Forme Sous Grille"))); +// final TraceIconButton btColor2 = new TraceIconButton(); +// btColor2.setForeground(target_.getForeground()); +// btColor2.addActionListener(new ActionListener() { +// +// public void actionPerformed(final ActionEvent _e) { +// final Color c = JColorChooser.showDialog(target_, EbliLib.getS("Couleur Sous Grille"), target_.getForeground()); +// if (c != null) { +// target_.setSousGraduationColor(c); +// btColor2.setForeground(c); +// } +// } +// }); +// pn.add(btColor2); + BSelecteurLineModel modelSousGraduations = new BSelecteurLineModel(SOUS_GRILLE_AXE_X,this.target_.getTraceSousGraduations_()); + modelSousGraduations.setSelecteurTarget(this); + pn.add(modelSousGraduations.buildPanel()); + pn.add(new BuLabel(EbliLib.getS("Fonte"))); final BuButton btFont = new BuButton("1234.567"); pn.add(btFont); @@ -708,4 +723,51 @@ zoom.add(btRestaurer); return zoom; } + + +public void addPropertyChangeListener(String _key, PropertyChangeListener _l) { + // TODO Auto-generated method stub + +} + + +public Object getMin(String _key) { + // TODO Auto-generated method stub + return null; +} + + +public Object getMoy(String _key) { + // TODO Auto-generated method stub + return null; +} + + +public Object getProperty(String _key) { + if(_key.equals(GRILLE_AXE_X)) + return target_.getTraceGraduations_(); + if(_key.equals(SOUS_GRILLE_AXE_X)) + return target_.getTraceSousGraduations_(); + return null; +} + + +public void removePropertyChangeListener(String _key, PropertyChangeListener _l) { + // TODO Auto-generated method stub + +} + + +public boolean setProperty(String _key, Object prop) { + boolean ok=false; + if(_key.equals(GRILLE_AXE_X)){ + target_.modifieTraceGraduations((TraceLigneModel) prop); + ok=true; + } + if(_key.equals(SOUS_GRILLE_AXE_X)){ + target_.modifieSousGraduations((TraceLigneModel) prop); + ok=true; + } + return ok; +} } \ No newline at end of file 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 2009-02-05 18:20:44 UTC (rev 4443) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2009-02-05 18:21:55 UTC (rev 4444) @@ -101,1408 +101,1607 @@ */ public class TrPostProjet implements ActionListener { - /** - * Manager de sauvegarder/charghement des donn\xE9es - */ - private TrPostPersistenceManager manager_; + /** + * Manager de sauvegarder/charghement des donn\xE9es + */ + private TrPostPersistenceManager manager_; - public TrPostPersistenceManager getManager() { - if (manager_ == null) manager_ = new TrPostPersistenceManager(this); + public TrPostPersistenceManager getManager() { + if (manager_ == null) + manager_ = new TrPostPersistenceManager(this); - return manager_; - } + return manager_; + } - private class TimeContentUpdater implements ListDataListener { + private class TimeContentUpdater implements ListDataListener { - protected TimeContentUpdater() { + protected TimeContentUpdater() { - } + } - protected void updateAll() { - // TODO a revoir - // if (fille_ != null && fille_.isVisible()) { - // if (CtuluLibMessage.DEBUG) { - // CtuluLibMessage.debug("update fill time format"); - // } - // final TrPostVisuPanel panel = (TrPostVisuPanel) fille_.getVisuPanel(); - // final BCalque[] cqs = panel.getDonneesCalque().getCalques(); - // for (int i = cqs.length - 1; i >= 0; i--) { - // final BCalque calque = cqs[i]; - // if (calque instanceof TrPostFlecheLayer) { - // ((TrPostFlecheLayer) calque).timeStepFormatChanged(); - // } else if (calque instanceof TrIsoLayerDefault) { - // ((TrIsoLayerDefault) calque).timeStepFormatChanged(); - // } - // } - // final TrPostFlecheLayer flecheLayer = panel.getFlecheLayer(); - // if (flecheLayer != null) { - // flecheLayer.timeStepFormatChanged(); - // } - // final TrIsoLayer liso = panel.getIsoLayer(); - // if (liso != null && liso.isVisible()) { - // liso.timeStepFormatChanged(); - // } - // if (!fille_.getArbreCalqueModel().getTreeSelectionModel().isSelectionEmpty()) { - // final TreePath[] path = fille_.getArbreCalqueModel().getTreeSelectionModel().getSelectionPaths(); - // fille_.getArbreCalqueModel().getTreeSelectionModel().clearSelection(); - // fille_.getArbreCalqueModel().getTreeSelectionModel().setSelectionPaths(path); - // } - // } - setProjectModified(); - } + protected void updateAll() { + // TODO a revoir + // if (fille_ != null && fille_.isVisible()) { + // if (CtuluLibMessage.DEBUG) { + // CtuluLibMessage.debug("update fill time format"); + // } + // final TrPostVisuPanel panel = (TrPostVisuPanel) + // fille_.getVisuPanel(); + // final BCalque[] cqs = panel.getDonneesCalque().getCalques(); + // for (int i = cqs.length - 1; i >= 0; i--) { + // final BCalque calque = cqs[i]; + // if (calque instanceof TrPostFlecheLayer) { + // ((TrPostFlecheLayer) calque).timeStepFormatChanged(); + // } else if (calque instanceof TrIsoLayerDefault) { + // ((TrIsoLayerDefault) calque).timeStepFormatChanged(); + // } + // } + // final TrPostFlecheLayer flecheLayer = panel.getFlecheLayer(); + // if (flecheLayer != null) { + // flecheLayer.timeStepFormatChanged(); + // } + // final TrIsoLayer liso = panel.getIsoLayer(); + // if (liso != null && liso.isVisible()) { + // liso.timeStepFormatChanged(); + // } + // if (!fille_.getArbreCalqueModel().getTreeSelectionModel(). + // isSelectionEmpty()) { + // final TreePath[] path = + // fille_.getArbreCalqueModel().getTreeSelectionModel + // ().getSelectionPaths(); + //fille_.getArbreCalqueModel().getTreeSelectionModel().clearSelection + // (); + // fille_.getArbreCalqueModel().getTreeSelectionModel(). + // setSelectionPaths(path); + // } + // } + setProjectModified(); + } - public void contentsChanged(final ListDataEvent _event) { - updateAll(); - } + public void contentsChanged(final ListDataEvent _event) { + updateAll(); + } - public void intervalAdded(final ListDataEvent _event) { - updateAll(); - } + public void intervalAdded(final ListDataEvent _event) { + updateAll(); + } - public void intervalRemoved(final ListDataEvent _event) { - updateAll(); - } - } + public void intervalRemoved(final ListDataEvent _event) { + updateAll(); + } + } - class ModifyObserver implements Observer { + class ModifyObserver implements Observer { - private boolean isModified_; + private boolean isModified_; - protected void clearModified() { - isModified_ = false; - updateFrameState(); - } + protected void clearModified() { + isModified_ = false; + updateFrameState(); + } - protected void updateFrameState() { - if (impl_ != null) { - impl_.setEnabledForAction("ENREGISTRER", isModified_); - impl_.setEnabledForAction("ENREGISTRERSOUS", isModified_); - changedMainFrameState(); - } - } + protected void updateFrameState() { + if (impl_ != null) { + impl_.setEnabledForAction("ENREGISTRER", isModified_); + impl_.setEnabledForAction("ENREGISTRERSOUS", isModified_); + changedMainFrameState(); + } + } - public boolean isModified() { - return isModified_; - } + public boolean isModified() { + return isModified_; + } - public void setModified() { - isModified_ = true; - updateFrameState(); - } + public void setModified() { + isModified_ = true; + updateFrameState(); + } - public void update(final Observable _o, final Object _arg) { - setModified(); - } + public void update(final Observable _o, final Object _arg) { + setModified(); + } - } + } - class VariableListener implements TrPostDataListener { + class VariableListener implements TrPostDataListener { - public void dataAdded(final boolean _isFleche) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataAdded(_isFleche); - } - } - } - setProjectModified(); - } + public void dataAdded(final boolean _isFleche) { + if (impl_ == null) { + return; + } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataAdded(_isFleche); + } + } + } + setProjectModified(); + } - public void dataChanged(final H2dVariableType _old, final H2dVariableType _new, final boolean _contentChanged, - final boolean _isFleche, final Set _varDepending) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataChanged(_old, _new, _contentChanged, _isFleche, _varDepending); - } - } - } - setProjectModified(); - } + public void dataChanged(final H2dVariableType _old, + final H2dVariableType _new, final boolean _contentChanged, + final boolean _isFleche, final Set _varDepending) { + if (impl_ == null) { + return; + } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataChanged(_old, _new, _contentChanged, _isFleche, + _varDepending); + } + } + } + setProjectModified(); + } - public void dataRemoved(final H2dVariableType[] _vars, final boolean _isFleche) { - if (impl_ == null) { return; } - final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); - if (allFrames != null) { - for (int i = allFrames.length - 1; i >= 0; i--) { - TrPostDataListener l = null; - if (allFrames[i] instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i]; - } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { - l = (TrPostDataListener) allFrames[i].getContentPane(); - } - if (l != null) { - l.dataRemoved(_vars, _isFleche); - } - } - } - setProjectModified(); - } + public void dataRemoved(final H2dVariableType[] _vars, + final boolean _isFleche) { + if (impl_ == null) { + return; + } + final JInternalFrame[] allFrames = impl_.getAllInternalFrames(); + if (allFrames != null) { + for (int i = allFrames.length - 1; i >= 0; i--) { + TrPostDataListener l = null; + if (allFrames[i] instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i]; + } else if (allFrames[i].getContentPane() instanceof TrPostDataListener) { + l = (TrPostDataListener) allFrames[i].getContentPane(); + } + if (l != null) { + l.dataRemoved(_vars, _isFleche); + } + } + } + setProjectModified(); + } - } + } - // transient TrPostFille fille_; - // - // /** - // * Fenetre fille qui contient le layout scene. Cette fenetre remplace petit a petit fille_ - // */ - // // protected transient TrPostLayoutFille filleLayout_; - // ArrayList<TrPostLayoutFille> listeFillesLayout = new ArrayList<TrPostLayoutFille>(); + // transient TrPostFille fille_; + // + // /** + // * Fenetre fille qui contient le layout scene. Cette fenetre remplace + // petit a petit fille_ + // */ + // // protected transient TrPostLayoutFille filleLayout_; + // ArrayList<TrPostLayoutFille> listeFillesLayout = new + // ArrayList<TrPostLayoutFille>(); - /** - * liste des noeuds pour gerer le cut/copy/paste avec en + le undo/redo - */ - // liste des noeuds copies - Set<EbliNode> nodesCopyied = null; - // liste des noeuuds coupes - Set<EbliNode> nodesCutted = null; + /** + * liste des noeuds pour gerer le cut/copy/paste avec en + le undo/redo + */ + // liste des noeuds copies + Set<EbliNode> nodesCopyied = null; + // liste des noeuuds coupes + Set<EbliNode> nodesCutted = null; - /** - * internalframe qui gere les multiProjets - */ - public TrPostProjetsManagerFille filleProjetctManager_; + /** + * internalframe qui gere les multiProjets + */ + public TrPostProjetsManagerFille filleProjetctManager_; - /** - * Le menu du post qui contient tout les sous menus des projets - */ - BuMenu menuPost_; - BuMenu menuLayout_ = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER");; - List<BuMenu> listeMenuProjets_; + /** + * Le menu du post qui contient tout les sous menus des projets + */ + BuMenu menuPost_; + BuMenu menuLayout_ = new BuMenu(TrResource.getS("Layout"), "LAYOUTMANAGER");; + List<BuMenu> listeMenuProjets_; - List<ArrayList<BuMenuItem>> listeSousMenuProjets_; + List<ArrayList<BuMenuItem>> listeSousMenuProjets_; - /** - * Observable custom reserv\xE9 aux modifs apport\xE9es a la liste des src. - * - * @author Adrien Hadoux - */ - class observableSupport extends Observable { - @Override - public void notifyObservers() { - this.setChanged(); - super.notifyObservers(); - } + /** + * Observable custom reserv\xE9 aux modifs apport\xE9es a la liste des src. + * + * @author Adrien Hadoux + */ + class observableSupport extends Observable { + @Override + public void notifyObservers() { + this.setChanged(); + super.notifyObservers(); + } - @Override - public void notifyObservers(final Object arg) { - this.setChanged(); - super.notifyObservers(arg); - } + @Override + public void notifyObservers(final Object arg) { + this.setChanged(); + super.notifyObservers(arg); + } - } + } - private observableSupport observable; + private observableSupport observable; - public observableSupport getObservable() { - if (observable == null) observable = new observableSupport(); - return observable; - } + public observableSupport getObservable() { + if (observable == null) + observable = new observableSupport(); + return observable; + } - public void notifyObservers() { - // getObservable().setChanged(); + public void notifyObservers() { + // getObservable().setChanged(); - getObservable().notifyObservers(); + getObservable().notifyObservers(); - } + } - transient int idxFilleG_; + transient int idxFilleG_; - public transient TrPostCommonImplementation impl_; + public transient TrPostCommonImplementation impl_; - ModifyObserver modifyState_ = new ModifyObserver(); + ModifyObserver modifyState_ = new ModifyObserver(); - /** - * Donnees courantes du trpost. - */ - // transient TrPostSource src_; - /** - * liste des sources pour le multiProjet. - */ - public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>(); + /** + * Donnees courantes du trpost. + */ + // transient TrPostSource src_; + /** + * liste des sources pour le multiProjet. + */ + public transient ArrayList<TrPostSource> listeSrc_ = new ArrayList<TrPostSource>(); - transient TimeContentUpdater timeUpdater_; + transient TimeContentUpdater timeUpdater_; - public TrPostProjet(final TrPostCommonImplementation _impl) { - this(null, _impl); + public TrPostProjet(final TrPostCommonImplementation _impl) { + this(null, _impl); - } + } - public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) { - if (_src != null) ajouterSource(_src); + public TrPostProjet(final TrPostSource _src, + final TrPostCommonImplementation _impl) { + if (_src != null) + ajouterSource(_src); - // -- creation de la frame de gestion multi projet --// - filleProjetctManager_ = new TrPostProjetsManagerFille(this); - impl_ = _impl; + // -- creation de la frame de gestion multi projet --// + filleProjetctManager_ = new TrPostProjetsManagerFille(this); + impl_ = _impl; - } + } - /** - * Permet d ajouter une source dans le projet afin de gerer le multi source. On doit toujorus passer par cette methode - * pour ajouter une source. - * - * @param _src - */ - public void ajouterSource(final TrPostSource _src) { - ajouterSource(_src, null); + /** + * Permet d ajouter une source dans le projet afin de gerer le multi source. + * On doit toujorus passer par cette methode pour ajouter une source. + * + * @param _src + */ + public void ajouterSource(final TrPostSource _src) { + ajouterSource(_src, null); - } + } - public void ajouterSource(final TrPostSource _src, String title) { - _src.addVariableListener(new VariableListener()); - if (_src.getFiles() == null || !isOneSourceLoaded(_src.getFiles())) { - listeSrc_.add(_src); - _src.buildDefaultVarUpdateLists(); + public void ajouterSource(final TrPostSource _src, String title) { + _src.addVariableListener(new VariableListener()); + if (_src.getFiles() == null || !isOneSourceLoaded(_src.getFiles())) { + listeSrc_.add(_src); + _src.buildDefaultVarUpdateLists(); - // -- ajout du menu correspondant uniquement a partir de la 2eme --// - // if (listeSrc_.size()>1 || (menuPost_!=null &&)) - construitMenuPostSpecifiqueSource(_src, title); + // -- ajout du menu correspondant uniquement a partir de la 2eme + // --// + // if (listeSrc_.size()>1 || (menuPost_!=null &&)) + construitMenuPostSpecifiqueSource(_src, title); - } else { - // -- messqge d erreur: le fichier est deja ouvert --// - new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), "Le fichier est deja ouvert.").activate(); + } else { + // -- messqge d erreur: le fichier est deja ouvert --// + new BuDialogMessage(impl_.getApp(), + impl_.getInformationsSoftware(), + "Le fichier est deja ouvert.").activate(); - } - // -- notify aux observers --// - this.notifyObservers(); + } + // -- notify aux observers --// + this.notifyObservers(); - } + } - public TrPostSource findSource(final String _file) { - return findSource(new File(_file)); - } + public TrPostSource findSource(final String _file) { + return findSource(new File(_file)); + } - /** - * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. - * - * @param _file : path absolu du fichier - * @return - */ - public TrPostSource findSource(final File _file) { + /** + * retourne la source dans la liste des sources correspondant au fichier. + * retourne null sinon. + * + * @param _file + * : path absolu du fichier + * @return + */ + public TrPostSource findSource(final File _file) { - for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { - final TrPostSource src = it.next(); - if (src.isOpened(_file)) return src; - } + for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it + .hasNext();) { + final TrPostSource src = it.next(); + if (src.isOpened(_file)) + return src; + } - return null; - } + return null; + } - public TrPostSource findSource(final Collection<File> _file) { + public TrPostSource findSource(final Collection<File> _file) { - for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { - final TrPostSource src = it.next(); - if (isOpenedIn(_file, src)) return src; - } - return null; - } + for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it + .hasNext();) { + final TrPostSource src = it.next(); + if (isOpenedIn(_file, src)) + return src; + } + return null; + } - private boolean isOpenedIn(Collection<File> files, TrPostSource _in) { - if (_in == null) return false; - boolean sourceGetAllFiles = true; - for (File file : files) { - if (!_in.isOpened(file)) sourceGetAllFiles = false;; + private boolean isOpenedIn(Collection<File> files, TrPostSource _in) { + if (_in == null) + return false; + boolean sourceGetAllFiles = true; + for (File file : files) { + if (!_in.isOpened(file)) + sourceGetAllFiles = false; + ; - } - return sourceGetAllFiles; + } + return sourceGetAllFiles; - } + } - /** - * Retourne la source asscoi\xE9 a l id. - * - * @param _id - * @return - */ - public TrPostSource findSourceById(final String _id) { + /** + * Retourne la source asscoi\xE9 a l id. + * + * @param _id + * @return + */ + public TrPostSource findSourceById(final String _id) { - for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it.hasNext();) { - final TrPostSource src = it.next(); - if (src.getId().equals(_id)) return src; - } + for (final Iterator<TrPostSource> it = listeSrc_.iterator(); it + .hasNext();) { + final TrPostSource src = it.next(); + if (src.getId().equals(_id)) + return src; + } - return null; - } + return null; + } - /** - * Retourne toutes les sources qui ne sont pas des composites - * - * @return - */ - public List<TrPostSource> getAllClassicalSource() { - List<TrPostSource> res = new ArrayList<TrPostSource>(); - for (TrPostSource src : listeSrc_) { - if (!isAsuiteCalcul(src)) res.add(src); - } - return res; - } + /** + * Retourne toutes les sources qui ne sont pas des composites + * + * @return + */ + public List<TrPostSource> getAllClassicalSource() { + List<TrPostSource> res = new ArrayList<TrPostSource>(); + for (TrPostSource src : listeSrc_) { + if (!isAsuiteCalcul(src)) + res.add(src); + } + return res; + } - /** - * Retourne toutes les sources qui sont des composites - * - * @return - */ - public List<TrPostSourceFromReader> getAllCCompositeSource() { - List<TrPostSourceFromReader> res = new ArrayList<TrPostSourceFromReader>(); - for (TrPostSource src : listeSrc_) { - if (isAsuiteCalcul(src)) res.add((TrPostSourceFromReader) src); - } - return res; - } + /** + * Retourne toutes les sources qui sont des composites + * + * @return + */ + public List<TrPostSourceFromReader> getAllCCompositeSource() { + List<TrPostSourceFromReader> res = new ArrayList<TrPostSourceFromReader>(); + for (TrPostSource src : listeSrc_) { + if (isAsuiteCalcul(src)) + res.add((TrPostSourceFromReader) src); + } + return res; + } - public boolean isSourceLoaded(final String _file) { - return isSourceLoaded(new File(_file)); - } + public boolean isSourceLoaded(final String _file) { + return isSourceLoaded(new File(_file)); + } - /** - * indique si il existe une source portant le nom du fichier en param. - * - * @param _file : path absolu du fichier - * @return - */ - public boolean isSourceLoaded(final File _file) { - if (findSource(_file) == null) return false; - return true; - } + /** + * indique si il existe une source portant le nom du fichier en param. + * + * @param _file + * : path absolu du fichier + * @return + */ + public boolean isSourceLoaded(final File _file) { + if (findSource(_file) == null) + return false; + return true; + } - public boolean isOneSourceLoaded(final Collection<File> _files) { - if (findSource(_files) == null) return false; - return true; - } + public boolean isOneSourceLoaded(final Collection<File> _files) { + if (findSource(_files) == null) + return false; + return true; + } - // /** - // * methode qui change la source courante et retourne true si la source existe bien, false sinon - // * - // * @param _file : path absolu du fichier - // * @return - // */ - // public boolean changeSource(final TrPostSource _src) { - // - // src_ = _src; - // - // return true; - // } + // /** + // * methode qui change la source courante et retourne true si la source + // existe bien, false sinon + // * + // * @param _file : path absolu du fichier + // * @return + // */ + // public boolean changeSource(final TrPostSource _src) { + // + // src_ = _src; + // + // return true; + // } - /** - * Methode de suppression de la source - * - * @param src : TrPostSource, retourne true si la suppression a bien ete effectuee. - */ - public boolean removeSource(final TrPostSource src, final int n) { + /** + * Methode de suppression de la source + * + * @param src + * : TrPostSource, retourne true si la suppression a bien ete + * effectuee. + */ + public boolean removeSource(final TrPostSource src, final int n) { - if (isOneSourceLoaded(src.getFiles())) { - listeSrc_.remove(src); + if (isOneSourceLoaded(src.getFiles())) { + listeSrc_.remove(src); - // --recuperation du menu simul --// - final BuMenu menuSimul = getlisteMenuProjets_().get(n); + // --recuperation du menu simul --// + final BuMenu menuSimul = getlisteMenuProjets_().get(n); - // --on retire les menus correspondants --// - // for (int i = 0; i < listeSousMenuProjets_.get(n).size(); i++) { - // BuMenuItem item = listeSousMenuProjets_.get(n).get(i); - // menuSimul.remove(item); - // } + // --on retire les menus correspondants --// + // for (int i = 0; i < listeSousMenuProjets_.get(n).size(); i++) { + // BuMenuItem item = listeSousMenuProjets_.get(n).get(i); + // menuSimul.remove(item); + // } - // -- on retire le menuSimul de la liste --// - menuPost_.remove(menuSimul); + // -- on retire le menuSimul de la liste --// + menuPost_.remove(menuSimul); - // -- on retire de la liste des menus le menusimul et la liste des sous - // menus --// - getlisteMenuProjets_().remove(n); - getlisteSousMenuProjets_().remove(n); + // -- on retire de la liste des menus le menusimul et la liste des + // sous + // menus --// + getlisteMenuProjets_().remove(n); + getlisteSousMenuProjets_().remove(n); - // -- mise a jour de la barre des menus --// - impl_.getMainMenuBar().revalidate(); + // -- mise a jour de la barre des menus --// + impl_.getMainMenuBar().revalidate(); - // -- on met a jour la scene en enlevant tous les objets reli\xE9s \xE0 cette source --// - for (TrPostLayoutFille frame : impl_.getAllLayoutFille()) { - frame.getScene().removeAllWidgetLinkedToSrc(src); - } + // -- on met a jour la scene en enlevant tous les objets reli\xE9s \xE0 + // cette source --// + for (TrPostLayoutFille frame : impl_.getAllLayoutFille()) { + frame.getScene().removeAllWidgetLinkedToSrc(src); + } - return true; - } else { - // -- messqge d erreur: le fichier est deja ouvert --// - new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), - "Impossible de supprimer ce fichier de la liste.").activate(); + return true; + } else { + // -- messqge d erreur: le fichier est deja ouvert --// + new BuDialogMessage(impl_.getApp(), + impl_.getInformationsSoftware(), + "Impossible de supprimer ce fichier de la liste.") + .activate(); - return false; - } + return false; + } - } + } - /** - * methode qui formatte les infos de la source - * - * @param _src - * @return - */ - public String formatInfoSource(final TrPostSource _src) { - // --ajout dans la liste des titres --// - Collection<File> files = _src.getFiles(); - if (!isAsuiteCalcul(_src)) return formatName(_src.getTitle()) + " | Fichier: " - + formatFichier(files.iterator().next()); - else { + /** + * methode qui formatte les infos de la source + * + * @param _src + * @return + */ + public String formatInfoSource(final TrPostSource _src) { + // --ajout dans la liste des titres --// + Collection<File> files = _src.getFiles(); + if (!isAsuiteCalcul(_src)) + return formatName(_src.getTitle()) + " | Fichier: " + + formatFichier(files.iterator().next()); + else { - // String listeFiles=""; - // for(File f:files) - // listeFiles+="| "+f.getName(); - return _src.getTitle();// + listeFiles; - } - } + // String listeFiles=""; + // for(File f:files) + // listeFiles+="| "+f.getName(); + return _src.getTitle();// + listeFiles; + } + } - public boolean isAsuiteCalcul(final TrPostSource _src) { - if (_src instanceof TrPostSourceFromReader) { - TrPostSourceFromReader s = (TrPostSourceFromReader) _src; - if (s.getReader() instanceof TrPostSourceReaderComposite) return true; + public boolean isAsuiteCalcul(final TrPostSource _src) { + if (_src instanceof TrPostSourceFromReader) { + TrPostSourceFromReader s = (TrPostSourceFromReader) _src; + if (s.getReader() instanceof TrPostSourceReaderComposite) + return true; - } + } - return false; - } + return false; + } - public String formatFichier(final File file) { - if (file == null) return ""; - final String nomFichier = file.getAbsolutePath(); - // int position = nomFichier.lastIndexOf(File.separator) + 1; - // if (position != -1) { - // nomFichier = nomFichier.substring(position); - // } - // position = nomFichier.lastIndexOf(CtuluLibString.DOT); - // if (position != -1) { - // nomFichier = nomFichier.substring(0, position); - // } - // FuLog.warning("nom du fichier: " + nomFichier); - return nomFichier; - } + public String formatFichier(final File file) { + if (file == null) + return ""; + final String nomFichier = file.getAbsolutePath(); + // int position = nomFichier.lastIndexOf(File.separator) + 1; + // if (position != -1) { + // nomFichier = nomFichier.substring(position); + // } + // position = nomFichier.lastIndexOf(CtuluLibString.DOT); + // if (position != -1) { + // nomFichier = nomFichier.substring(0, position); + // } + // FuLog.warning("nom du fichier: " + nomFichier); + return nomFichier; + } - /** - * formatte le titre - * - * @param file - * @return - */ - public String formatName(String title) { - // --suppression des trop long espaces du titre --// + /** + * formatte le titre + * + * @param file + * @return + */ + public String formatName(String title) { + // --suppression des trop long espaces du titre --// - title = title.replaceAll(" ", ""); + title = title.replaceAll(" ", ""); - return title; - } + return title; + } - /** - * Construit un menu specifique a la source choisie. A chaque fois que l on ajoute une source au projet, il faut - * ajouter un menu sp\xE9cifique. - * - * @param _src - */ - public void construitMenuPostSpecifiqueSource(final TrPostSource _src, String title) { + /** + * Construit un menu specifique a la source choisie. A chaque fois que l on + * ajoute une source au projet, il faut ajouter un menu sp\xE9cifique. + * + * @param _src + */ + public void construitMenuPostSpecifiqueSource(final TrPostSource _src, + String title) { - BuMenu menuSimul = null; - if (title == null) menuSimul = new BuMenu((listeSrc_.size()) + ". " - + formatFichier(_src.getFiles().iterator().next()), "SIMULATION" + (listeSrc_.size())); - else menuSimul = new BuMenu((listeSrc_.size()) + ". " + _src.getTitle(), "SIMULATION" + (listeSrc_.size())); - // -- ajout du menu au menu post --// - getMenuPost().add(menuSimul); + BuMenu menuSimul = null; + if (title == null) + menuSimul = new BuMenu((listeSrc_.size()) + ". " + + formatFichier(_src.getFiles().iterator().next()), + "SIMULATION" + (listeSrc_.size())); + else + menuSimul = new BuMenu((listeSrc_.size()) + ". " + _src.getTitle(), + "SIMULATION" + (listeSrc_.size())); + // -- ajout du menu au menu post --// + getMenuPost().add(menuSimul); - // -- sauvegarde d une trace du menu dans la liste pour une suppression - // ulterieure --// - getlisteMenuProjets_().add(menuSimul); + // -- sauvegarde d une trace du menu dans la liste pour une suppression + // ulterieure --// + getlisteMenuProjets_().add(menuSimul); -// final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>(); -// -// final BuIcon ic = BuResource.BU.getIcon("aucun"); -// -// listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."), "COMPUTE_EXTREMA", ic, TrPostProjet.this)); -// listSousMenus.add(menuSimul.addMenuItem(CtuluLib.getS("Editer les variables..."), "VARIABLES", ic, -// TrPostProjet.this)); -// menuSimul.addSeparator(); -// listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Palettes de couleurs"), "PALETTE_DEFAULT", ic, -// TrPostProjet.this)); -// listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Formater/modifier les pas de temps..."), "TIME_FORMAT", -// ic, TrPostProjet.this)); -// -// menuSimul.addSeparator(); -// -// listSousMenus.add(menuSimul.addMenuItem(new TrPostBuilderSuiteCalcul.ActionBuildSuite(_src, TrResource -// .getS("Suite de calcul"), EbliResource.EBLI.getIcon(""), "SUITECALCUL", impl_))); -// listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer..."), "COMPARE", ic, TrPostProjet.this)); -// listSousMenus.get(listSousMenus.size() - 1).setToolTipText( -// TrResource.getS("Comparer les r\xE9sultats avec ceux d'un autre projet")); -// listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter..."), "PROJECT", ic, TrPostProjet.this)); -// listSousMenus.get(listSousMenus.size() - 1).setToolTipText( -// TrResource.getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent")); -// -// menuSimul.addSeparator(); -// -// listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"), "EXPORTDATA", TrPostProjet.this)); -// _src.addSpecificItemInMainMenu(menuSimul, getImpl()); + // final ArrayList<BuMenuItem> listSousMenus = new + // ArrayList<BuMenuItem>(); + // + // final BuIcon ic = BuResource.BU.getIcon("aucun"); + // + //listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."), + // "COMPUTE_EXTREMA", ic, TrPostProjet.this)); + // listSousMenus.add(menuSimul.addMenuItem(CtuluLib.getS( + // "Editer les variables..."), "VARIABLES", ic, + // TrPostProjet.this)); + // menuSimul.addSeparator(); + // listSousMenus.add(menuSimul.addMenuItem(TrResource.getS( + // "Palettes de couleurs"), "PALETTE_DEFAULT", ic, + // TrPostProjet.this)); + // listSousMenus.add(menuSimul.addMenuItem(TrResource.getS( + // "Formater/modifier les pas de temps..."), "TIME_FORMAT", + // ic, TrPostProjet.this)); + // + // menuSimul.addSeparator(); + // + // listSousMenus.add(menuSimul.addMenuItem(new + // TrPostBuilderSuiteCalcul.ActionBuildSuite(_src, TrResource + // .getS("Suite de calcul"), EbliResource.EBLI.getIcon(""), + // "SUITECALCUL", impl_))); + //listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer...") + // , "COMPARE", ic, TrPostProjet.this)); + // listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + //TrResource.getS("Comparer les r\xE9sultats avec ceux d'un autre projet")) + // ; + //listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter...") + // , "PROJECT", ic, TrPostProjet.this)); + // listSousMenus.get(listSousMenus.size() - 1).setToolTipText( + // TrResource.getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent")); + // + // menuSimul.addSeparator(); + // + // listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"), + // "EXPORTDATA", TrPostProjet.this)); + // _src.addSpecificItemInMainMenu(menuSimul, getImpl()); - ArrayList<BuMenuItem>listSousMenus= getSousMenusSpecifiqueSource(_src, menuSimul); - // -- ajout de la sous liste de menus pour la garder en memoire --// - getlisteSousMenuProjets_().add(listSousMenus); + ArrayList<BuMenuItem> listSousMenus = getSousMenusSpecifiqueSource( + _src, menuSimul); + // -- ajout de la sous liste de menus pour la garder en memoire --// + getlisteSousMenuProjets_().add(listSousMenus); - - } - - /** - * Cree la liste des menu items sp\xE9cifiques au fichier source charg\xE9. - * @param _src - * @param menuSimul - * @return - */ - public ArrayList<BuMenuItem> getSousMenusSpecifiqueSource(final TrPostSource _src,BuMenu menuSimul ){ - final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>(); + } - final BuIcon ic = BuResource.BU.getIcon("aucun"); + /** + * Cree la liste des menu items sp\xE9cifiques au fichier source charg\xE9. + * + * @param _src + * @param menuSimul + * @return + */ + public ArrayList<BuMenuItem> getSousMenusSpecifiqueSource( + final TrPostSource _src, BuMenu menuSimul) { + final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."), "COMPUTE_EXTREMA", ic, TrPostProjet.this)); - BuMenuItem item=new BuMenuItem(); - - listSousMenus.add(menuSimul.addMenuItem(CtuluLib.getS("Editer les variables..."), "VARIABLES", ic, - TrPostProjet.this)); - menuSimul.addSeparator(); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Palettes de couleurs"), "PALETTE_DEFAULT", ic, - TrPostProjet.this)); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Formater/modifier les pas de temps..."), "TIME_FORMAT", - ic, TrPostProjet.this)); + final BuIcon ic = BuResource.BU.getIcon("aucun"); - menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Extrema..."), + "COMPUTE_EXTREMA", ic, TrPostProjet.this)); + BuMenuItem item = new BuMenuItem(); - listSousMenus.add(menuSimul.addMenuItem(new TrPostBuilderSuiteCalcul.ActionBuildSuite(_src, TrResource - .getS("Suite de calcul"), EbliResource.EBLI.getIcon(""), "SUITECALCUL", impl_))); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer..."), "COMPARE", ic, TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Comparer les r\xE9sultats avec ceux d'un autre projet")); - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter..."), "PROJECT", ic, TrPostProjet.this)); - listSousMenus.get(listSousMenus.size() - 1).setToolTipText( - TrResource.getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent")); + listSousMenus.add(menuSimul.addMenuItem(CtuluLib + .getS("Editer les variables..."), "VARIABLES", ic, + TrPostProjet.this)); + menuSimul.addSeparator(); + listSousMenus.add(menuSimul.addMenuItem(TrResource + .getS("Palettes de couleurs"), "PALETTE_DEFAULT", ic, + TrPostProjet.this)); + listSousMenus.add(menuSimul.addMenuItem(TrResource + .getS("Formater/modifier les pas de temps..."), "TIME_FORMAT", + ic, TrPostProjet.this)); - menuSimul.addSeparator(); - - listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"), "EXPORTDATA", TrPostProjet.this)); - _src.addSpecificItemInMainMenu(menuSimul, getImpl()); - return listSousMenus; - } - + menuSimul.addSeparator(); - public BuMenu getMenuPost() { - if (menuPost_ == null) menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); - return menuPost_; - } + listSousMenus.add(menuSimul + .addMenuItem(new TrPostBuilderSuiteCalcul.ActionBuildSuite( + _src, TrResource.getS("Suite de calcul"), + EbliResource.EBLI.getIcon(""), "SUITECALCUL", impl_))); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Comparer..."), + "COMPARE", ic, TrPostProjet.this)); + listSousMenus + .get(listSousMenus.size() - 1) + .setToolTipText( + TrResource + .getS("Comparer les r\xE9sultats avec ceux d'un autre projet")); + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Projeter..."), + "PROJECT", ic, TrPostProjet.this)); + listSousMenus + .get(listSousMenus.size() - 1) + .setToolTipText( + TrResource + .getS("Projeter les r\xE9sultats sur un maillage diff\xE9rent")); - /** - * Creation par defaut du menu post de l interface. Cette methdoe est appelee une seule dfois au moment de la creation - * de l impl. - */ - public void setMenuPost() { - final BuMenuBar menubar = impl_.getMainMenuBar(); + menuSimul.addSeparator(); - Component comp = null; - if (getMenuPost().getMenuComponentCount() > 0) { - comp = getMenuPost().getMenuComponent(0); - // getMenuPost().remove(0); - } + listSousMenus.add(menuSimul.addMenuItem(TrResource.getS("Exporter"), + "EXPORTDATA", TrPostProjet.this)); + _src.addSpecificItemInMainMenu(menuSimul, getImpl()); + return listSousMenus; + } - getMenuPost().setIcon(null); - getMenuPost().setName("mnPost"); + public BuMenu getMenuPost() { + if (menuPost_ == null) + menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); + return menuPost_; + } - menubar.add(getMenuPost(), 2); + /** + * Creation par defaut du menu post de l interface. Cette methdoe est + * appelee une seule dfois au moment de la creation de l impl. + */ + public void setMenuPost() { + final BuMenuBar menubar = impl_.getMainMenuBar(); - getMenuPost().addSeparator(TrResource.getS("Layout")); - // -- ajout de l action de creation du calque --// - // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this)); - // getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); - getMenuPost().addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", - CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { + Component comp = null; + if (getMenuPost().getMenuComponentCount() > 0) { + comp = getMenuPost().getMenuComponent(0); + // getMenuPost().remove(0); + } - public void actionPerformed(final ActionEvent _e) { - createNewLayoutFrame(); + getMenuPost().setIcon(null); + getMenuPost().setName("mnPost"); - } - }); - getMenuPost().addMenuItem(TrResource.getS(("Fusionner avec un autre projet POST")), "FUSIONPOST", - CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { + menubar.add(getMenuPost(), 2); - public void actionPerformed(final ActionEvent _e) { - boolean ok = CtuluLibDialog - .showConfirmation( - getImpl().getFrame(), - TrResource.getS("Fusionner avec un autre projet POST"), - TrResource - .getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?"), - TrResource.getS("Sauvegarder et continuer"), TrResource.getS("Annuler")); - if (!ok) return; - getManager().saveProject(false); - getManager().loadProject(false, null); - // -- on reinitialise le nom path du projet a null pour qu'il soit redemand\xE9 lors de la nouvelle sauvegarde - // --// - getManager().setProjet(null); + getMenuPost().addSeparator(TrResource.getS("Layout")); + // -- ajout de l action de creation du calque --// + // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this)); + // getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", + // BuResource.BU.getIcon("aucun"), TrPostProjet.this); + getMenuPost().addMenuItem( + TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), + "AJOUTFRAME", CtuluResource.CTULU.getIcon("crystal_ajouter"), + new ActionListener() { - } - }); + public void actionPerformed(final ActionEvent _e) { + createNewLayoutFrame(); - getMenuPost().addSeparator(TrResource.getS("Gestion")); - // -- ajout de l action de gestion des simus dans post --// - final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Sources")); - item.addActionListener(new ActionListener() { + } + }); + getMenuPost().addMenuItem( + TrResource.getS(("Fusionner avec un autre projet POST")), + "FUSIONPOST", CtuluResource.CTULU.getIcon("crystal_ajouter"), + new ActionListener() { - public void actionPerformed(final ActionEvent e) { - // -- affichage de la fenetre de gestion multi projet --// + public void actionPerformed(final ActionEvent _e) { + boolean ok = CtuluLibDialog + .showConfirmation( + getImpl().getFrame(), + TrResource + .getS("Fusionner avec un autre projet POST"), + TrResource + .getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?"), + TrResource + .getS("Sauvegarder et continuer"), + TrResource.getS("Annuler")); + if (!ok) + return; + getManager().saveProject(false); + getManager().loadProject(false, null); + // -- on reinitialise le nom path du projet a null pour + // qu'il soit redemand\xE9 lors de la nouvelle sauvegarde + // --// + getManager().setProjet(null); - if (!filleProjetctManager_.isVisible()) { -// filleProjetctManager_.setSize(filleProjetctManager_.getSize().width, -// filleProjetctManager_.getSize().height / 2); + } + }); - impl_.addInternalFrame(filleProjetctManager_); - } else filleProjetctManager_.moveToFront(); + getMenuPost().addSeparator(TrResource.getS("Gestion")); + // -- ajout de l action de gestion des simus dans post --// + final BuMenuItem item = new BuMenuItem(TrResource + .getS("Gestion Multi-Sources")); + item.addActionListener(new ActionListener() { - } + public void actionPerformed(final ActionEvent e) { + // -- affichage de la fenetre de gestion multi projet --// - }); - getMenuPost().add(item); - getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats"); - // -- init de la liste des menus --// + if (!filleProjetctManager_.isVisible()) { + //filleProjetctManager_.setSize(filleProjetctManager_.getSize + // ().width, + // filleProjetctManager_.getSize().height / 2); - // -- construction par defaut du premier menu de simulation --// - // construitMenuPostSpecifiqueSource(getSource(0)); + impl_.addInternalFrame(filleProjetctManager_); + } else + filleProjetctManager_.moveToFront(); - if (comp != null) { - getMenuPost().add(comp); - } + } - } + }); + getMenuPost().add(item); + getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats"); + // -- init de la liste des menus --// - public List<BuMenu> getlisteMenuProjets_() { - if (listeMenuProjets_ == null) listeMenuProjets_ = new ArrayList<BuMenu>(); - return listeMenuProjets_; - } + // -- construction par defaut du premier menu de simulation --// + // construitMenuPostSpecifiqueSource(getSource(0)); - public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_() { - if (listeSousMenuProjets_ == null) listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); - return listeSousMenuProjets_; - } + if (comp != null) { + getMenuPost().add(comp); + } - /** - * calcul les extrema en fonction de la source proposee - * - * @param indiceSource_ - */ - private void showExtremum(final int indiceSource_) { - final JTable table = TrPostMinMaxTableModel.createTableFor(getSource(indiceSource_)); - final TrPostMinMaxTableModel model = (TrPostMinMaxTableModel) table.getModel(); - final CtuluDialogPanel panel = new CtuluDialogPanel(); - final CtuluDialog dial = new CtuluDialog(getImpl().getFrame(), panel); - final BuButton btCalcul = new BuButton(TrResource.getS("Calcul des extrema")); - dial.setTitle(btCalcul.getText()); - btCalcul.setActionCommand("EXTREMUM"); - panel.setLayout(new BuHorizontalLayout(3, false, false)); - final BuPanel center = new BuPanel(); - center.setLayout(new BuBorderLayout(2, 2, true, true)); - final BuScrollPane scroll = new BuScrollPane(table); - scroll.setPreferredHeight((int) (table.getPreferredSize().height * 1.3)); - center.add(scroll, BuBorderLayout.CENTER); - center.add(model.createInfoPanel(table), BuBorderLayout.SOUTH); - panel.add(center); - btCalcul.setAlignmentX(1f); - btCalcul.setAlignmentY(0f); - panel.add(btCalcul); + } - btCalcul.addActionListener(new ActionListener() { + public List<BuMenu> getlisteMenuProjets_() { + if (listeMenuProjets_ == null) + listeMenuProjets_ = new ArrayList<BuMenu>(); + return listeMenuProjets_; + } - public void actionPerformed(final ActionEvent _event) { - final BuGlassPaneStop stop = new BuGlassPaneStop(); - dial.setGlassPane(stop); - stop.setVisible(true); - new CtuluTaskOperationGUI(impl_, CtuluLibString.EMPTY_STRING) { + public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_() { + if (listeSousMenuProjets_ == null) + listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); + return listeSousMenuProjets_; + } - @Override - public void act() { - model.apply(new ProgressionBuAdapter(this), impl_); - BuLib.invokeLater(new Runnable() { - public void run() { - TrPostProjet.this.setProjectModified(); - stop.setVisible(false); - dial.getRootPane().remove(stop); - } + /** + * calcul les extrema en fonction de la source proposee + * + * @param indiceSource_ + */ + private void showExtremum(final int indiceSource_) { + final JTable table = TrPostMinMaxTableModel + .createTableFor(getSource(indiceSource_)); + final TrPostMinMaxTableModel model = (TrPostMinMaxTableModel) table + .getModel(); + final CtuluDialogPanel panel = new CtuluDialogPanel(); + final CtuluDialog dial = new CtuluDialog(getImpl().getFrame(), panel); + final BuButton btCalcul = new BuButton(TrResource + .getS("Calcul des extrema")); + dial.setTitle(btCalcul.getText()); + btCalcul.setActionCommand("EXTREMUM"); + panel.setLayout(new BuHorizontalLayout(3, false, false)); + final BuPanel center = new BuPanel(); + center.setLayout(new BuBorderLayout(2, 2, true, true)); + final BuScrollPane scroll = new BuScrollPane(table); + scroll + .setPreferredHeight((int) (table.getPreferredSize().height * 1.3)); + center.add(scroll, BuBorderLayout.CENTER); + center.add(model.createInfoPanel(table), BuBorderLayout.SOUTH); + panel.add(center); + btCalcul.setAlignmentX(1f); + btCalcul.setAlignmentY(0f); + panel.add(btCalcul); - }); - } - }.start(); - } - }); - dial.afficheDialogModal(); - } + btCalcul.addActionListener(new ActionListener() { - private void updatePaletteMin(final TrPostSource _src) { - final TrPostMinPaletteTableModel model = _src.getMinPaletteModel(); - final BuTable table = new BuTable(model); - final CtuluDialogPanel pnDial = new CtuluDialogPanel() { + public void actionPerformed(final ActionEvent _event) { + final BuGlassPaneStop stop = new BuGlassPaneStop(); + dial.setGlassPane(stop); + stop.setVisible(true); + new CtuluTaskOperationGUI(impl_, CtuluLibString.EMPTY_STRING) { - @Override - public void apply() { - if (table.isEditing()) { - table.getCellEditor().stopCellEditing(); - } - model.apply(); - } - }; + @Override + public void act() { + model.apply(new ProgressionBuAdapter(this), impl_); + BuLib.invokeLater(new Runnable() { + public void run() { + TrPostProjet.this.setProjectModified(); + stop.setVisible(false); + dial.getRootPane().remove(stop); + } - final TableColumn col0 = table.getColumnModel().getColumn(0); - col0.setMaxWidth(20); - col0.setCellRenderer(new CtuluCellBooleanRenderer()); - pnDial.setLayout(new BuVerticalLayout(2, true, true)); - pnDial.addLabel(TrResource - .getS("Activer et pr\xE9ciser les valeurs minimales \xE0 utiliser par d\xE9faut pour les palettes")); - pnDial.add(new BuScrollPane(table)); - pnDial.afficheModale(impl_.getFrame(), TrResource.getS("Valeurs par d\xE9faut pour les palettes")); + }); + } + }.start(); + } + }); + dial.afficheDialogModal(); + } - } + private void updatePaletteMin(final TrPostSource _src) { + final TrPostMinPaletteTableModel model = _src.getMinPaletteModel(); + final BuTable table = new BuTable(model); + final CtuluDialogPanel pnDial = new CtuluDialogPanel() { - // TrPostInspectorReader createWatcher(final TrPostSource _src) { - // return _src.createWatcher(this, true); - // } + @Override + public void apply() { + if (table.isEditing()) { + table.getCellEditor().stopCellEditing(); + } + model.apply(); + } + }; - boolean openSrcDataAndIsModified(final CtuluUI _ui, final ProgressionInterface _prog) { - return new TrPostProjetSaver(this).openSrcDataAndIsModified(_ui, _prog); - } + final TableColumn col0 = table.getColumnModel().getColumn(0); + col0.setMaxWidth(20); + col0.setCellRenderer(new CtuluCellBooleanRenderer()); + pnDial.setLayout(new BuVerticalLayout(2, true, true)); + pnDial + .addLabel(TrResource + .getS("Activer et pr\xE9ciser les valeurs minimales \xE0 utiliser par d\xE9faut pour les palettes")); + pnDial.add(new BuScrollPane(table)); + pnDia... [truncated message content] |
From: <had...@us...> - 2009-02-05 18:20:54
|
Revision: 4443 http://fudaa.svn.sourceforge.net/fudaa/?rev=4443&view=rev Author: hadouxad Date: 2009-02-05 18:20:44 +0000 (Thu, 05 Feb 2009) Log Message: ----------- - calques destructibles (trajectoires, trace de courbes, cr?\195?\169ation depuis option origine du graphe) - cr?\195?\169ation de groupes pour rangement des traces de calques - ihm grilles et sous grilles graphe: sch?\195?\169ma des vues 2d - Refactorisation des algos de calculs fixes nb graduations et longueur de pas sous forme d iterator. - Grilles et sous grilles des graphes: - mode par nombre de graduations - mode par longueur de pas - ajout des tracelignemodel pour les 2 type de trac?\195?\169s - Utilisation des bselecteurs interfaces - Grilles et sous grilles des vues 2d - ajout des traceligne model pour les 2 versions - Wizard: - Texte avec case a cocher - Case par default a false - Undo/redo op?\195?\169rationnels pour les superposition des frames. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/controle/BSelecteurLineModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontal.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVertical.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionBackGround.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionForeGround.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java 2009-02-05 18:18:47 UTC (rev 4442) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java 2009-02-05 18:20:44 UTC (rev 4443) @@ -27,12 +27,16 @@ import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.iterator.NumberIterator; +import org.fudaa.ctulu.iterator.NumberIteratorGraduationsFixe; +import org.fudaa.ctulu.iterator.NumberIteratorPasFixe; +import org.fudaa.ctulu.iterator.TickIterator; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.commun.EbliUIProperties; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.geometrie.GrMorphisme; import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.trace.TraceLigne; +import org.fudaa.ebli.trace.TraceLigneModel; import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.LinearRing; @@ -40,971 +44,1097 @@ /** * Un calque d'affichage d'une grille. * - * @version $Revision: 1.11.6.1 $ $Date: 2008-02-20 10:14:40 $ by $Author: bmarchan $ + * @version $Revision: 1.11.6.1 $ $Date: 2008-02-20 10:14:40 $ by $Author: + * bmarchan $ * @author Guillaume Desnoix */ public class ZCalqueGrille extends ZCalqueAffichageDonnees { - // Proprietes - // private GrBoite boite_; - boolean drawGrid_; - boolean drawX_ = true; - boolean drawY_ = true; - // Envelope customBounds_; - // boolean useCustom_; + // Proprietes + // private GrBoite boite_; + boolean drawGrid_; + boolean drawX_ = true; + boolean drawY_ = true; + // Envelope customBounds_; + // boolean useCustom_; - int nbGraduationX_ = 10; - int nbGraduationY_ = 10; + int nbGraduationX_ = 10; + int nbGraduationY_ = 10; - // -- sous graduations --// - int nbSousGraduationX_ = 3; - // -- sous graduations --// - int nbSousGraduationY_ = 3; + // -- sous graduations --// + int nbSousGraduationX_ = 3; + // -- sous graduations --// + int nbSousGraduationY_ = 3; - final BVueCalque vue_; + + private TraceLigneModel traceGraduations_=new TraceLigneModel(TraceLigne.TIRETE,1,Color.black); + private TraceLigneModel traceSousGraduations_=new TraceLigneModel(TraceLigne.TIRETE,(float)0.5,Color.gray); + + final BVueCalque vue_; - /** - * Indique la facon de calculer les graduations. pour l'axe des x. - */ - boolean modeAutomatiqueX_ = false; - /** - * Indique la facon de calculer les graduations. pour l'axe des y. - */ - boolean modeAutomatiqueY_ = false; + /** + * Indique la facon de calculer les graduations. pour l'axe des x. + */ + boolean modeAutomatiqueX_ = false; + /** + * Indique la facon de calculer les graduations. pour l'axe des y. + */ + boolean modeAutomatiqueY_ = false; - /** - * Indique si on utilise par taille de pas ou par nombre de graduations - */ - boolean modeLongueurPasX_ = false; - boolean modeLongueurPasY_ = false; + /** + * Indique si on utilise par taille de pas ou par nombre de graduations + */ + boolean modeLongueurPasX_ = false; + boolean modeLongueurPasY_ = false; - /** - * Valeur du pas que devront suivrent tous les traits de la grilles si on en mode taille pas. - */ - double valeurPasX_; - double valeurPasY_; + /** + * Valeur du pas que devront suivrent tous les traits de la grilles si on en + * mode taille pas. + */ + double valeurPasX_; + double valeurPasY_; - boolean drawSousGrilleX_ = false; - boolean drawSousGrilleY_ = false; + boolean drawSousGrilleX_ = false; + boolean drawSousGrilleY_ = false; - boolean modeLongueurPasSousGradX_ = false; - boolean modeLongueurPasSousGradY_ = false; + boolean modeLongueurPasSousGradX_ = false; + boolean modeLongueurPasSousGradY_ = false; - double valeurPasSousGradX_; - double valeurPasSousGradY_; + double valeurPasSousGradX_; + double valeurPasSousGradY_; - private Color couleurSousGraduation_ = Color.blue; + private Color couleurSousGraduation_ = Color.blue; - public ZCalqueGrille(final BVueCalque _vue) { - super(); - vue_ = _vue; - setDestructible(false); - setName("cqGrille"); - setTitle(EbliLib.getS("Grille")); - // setForeground(new Color(204, 153, 0)); - setForeground(Color.BLACK); - } + public ZCalqueGrille(final BVueCalque _vue) { + super(); + vue_ = _vue; + setDestructible(false); + setName("cqGrille"); + setTitle(EbliLib.getS("Grille")); + // setForeground(new Color(204, 153, 0)); + setForeground(Color.BLACK); + } - public void paintAllInImage(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, - final GrBoite _clipReel) { - // super.paintAllInImage(_g, _versEcran, _versReel, _clipReel); - } + public void paintAllInImage(final Graphics2D _g, + final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { + // super.paintAllInImage(_g, _versEcran, _versReel, _clipReel); + } - public void changeZoom(double minx, double miny, double maxx, double maxy) { - vue_.changeViewBoite(this, new GrBoite(new GrPoint(minx, miny, 0), new GrPoint(maxx, maxy, 0)), false); - } + public void changeZoom(double minx, double miny, double maxx, double maxy) { + vue_.changeViewBoite(this, new GrBoite(new GrPoint(minx, miny, 0), + new GrPoint(maxx, maxy, 0)), false); + } - public int getNbXGraduations() { - return nbGraduationX_; - } + public int getNbXGraduations() { + return nbGraduationX_; + } - public int getNbYGraduations() { - return nbGraduationY_; - } + public int getNbYGraduations() { + return nbGraduationY_; + } - public int getNbXSousGraduations() { - return nbSousGraduationX_; - } + public int getNbXSousGraduations() { + return nbSousGraduationX_; + } - public int getNbYSousGraduations() { - return nbSousGraduationY_; - } + public int getNbYSousGraduations() { + return nbSousGraduationY_; + } - public void setSousGraduationColor(Color c) { - if (couleurSousGraduation_ != c) { - couleurSousGraduation_ = c; - grilleChanged(); - } + public void setSousGraduationColor(Color c) { + if (couleurSousGraduation_ != c) { + couleurSousGraduation_ = c; + grilleChanged(); + } - } + } - /** - * Accesseur de la propriete <I>boite</I>. Elle donne la position, la taille, le domaine de la grille. - */ - // public GrBoite getBoite() { - // return boite_; - // } - public GrBoite getDomaine() { - return null; - // GrBoite r = null; - // if (isVisible()) { - // GrBoite d = null; - // d = super.getDomaine(); - // r = getBoite(); - // if (d != null) { - // if (r == null) { - // r = d; - // } else { - // r = r.union(d); - // } - // } - // } - // return r; - } + /** + * Accesseur de la propriete <I>boite</I>. Elle donne la position, la + * taille, le domaine de la grille. + */ + // public GrBoite getBoite() { + // return boite_; + // } + public GrBoite getDomaine() { + return null; + // GrBoite r = null; + // if (isVisible()) { + // GrBoite d = null; + // d = super.getDomaine(); + // r = getBoite(); + // if (d != null) { + // if (r == null) { + // r = d; + // } else { + // r = r.union(d); + // } + // } + // } + // return r; + } - public GrBoite getDomaineOnSelected() { - return getDomaine(); - } + public GrBoite getDomaineOnSelected() { + return getDomaine(); + } - public boolean isCouleurModifiable() { - return true; - } + public boolean isCouleurModifiable() { + return true; + } - public int getTiretLength() { - return 3; - } + public int getTiretLength() { + return 3; + } - public void paintDonnees(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, - final GrBoite _clipReel) { - GrBoite domaine = vue_.getAbstractCalque().getDomaine(); - final GrBoite zv = _clipReel.intersectionXY(domaine); + public void paintDonnees(final Graphics2D _g, final GrMorphisme _versEcran, + final GrMorphisme _versReel, final GrBoite _clipReel) { + GrBoite domaine = vue_.getAbstractCalque().getDomaine(); + final GrBoite zv = _clipReel.intersectionXY(domaine); +// GrBoite domaine = vue_.getViewBoite(); +// final GrBoite zv = domaine; - if (zv == null) { return; } - // updateBounds(zv); - final GrBoite targetBoite = new GrBoite(); - targetBoite.ajuste(0, 0, 0); - // la boite d'affichage + if (zv == null) { + return; + } + // updateBounds(zv); + final GrBoite targetBoite = new GrBoite(); + targetBoite.ajuste(0, 0, 0); + // la boite d'affichage - if (!_versEcran.isSame(getVersEcran())) { return; } - targetBoite.ajuste(getWidth(), getHeight(), 0); - final Color old = _g.getColor(); - final Font oldFont = _g.getFont(); - // la fonte - final Font font = getFont(); - if (font != null) { - _g.setFont(font); - } - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - final TDoubleArrayList xValue = new TDoubleArrayList(20); - final TIntArrayList xStrWidth = new TIntArrayList(20); - final List xString = new ArrayList(20); - final NumberIterator it = new NumberIterator(); - final boolean isXPainted = drawX_ && zv.getMinX() < zv.getMaxX() && nbGraduationX_ > 0; + if (!_versEcran.isSame(getVersEcran())) { + return; + } + targetBoite.ajuste(getWidth(), getHeight(), 0); + final Color old = _g.getColor(); + final Font oldFont = _g.getFont(); + // la fonte + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + final TDoubleArrayList xValue = new TDoubleArrayList(20); + final TIntArrayList xStrWidth = new TIntArrayList(20); + final List xString = new ArrayList(20); + + final boolean isXPainted = drawX_ && zv.getMinX() < zv.getMaxX() + && nbGraduationX_ > 0; - if (isXPainted) { - computeXValues(zv, _g, xValue, xStrWidth, xString, it); - } - double yMax = 0; - final TDoubleArrayList yValue = new TDoubleArrayList(20); - final TIntArrayList yStrWidth = new TIntArrayList(20); - final List yString = new ArrayList(20); - final boolean isYPainted = drawY_ && zv.getMinY() < zv.getMaxY() && nbGraduationY_ > 0; - if (isYPainted) { - yMax = computeYValues(_g, zv, yValue, yStrWidth, yString); - } + if (isXPainted) { + computeXValues(zv, _g, xValue, xStrWidth, xString); + } + double yMax = 0; + final TDoubleArrayList yValue = new TDoubleArrayList(20); + final TIntArrayList yStrWidth = new TIntArrayList(20); + final List yString = new ArrayList(20); + final boolean isYPainted = drawY_ && zv.getMinY() < zv.getMaxY() + && nbGraduationY_ > 0; + if (isYPainted) { + yMax = computeYValues(_g, zv, yValue, yStrWidth, yString); + } - // boolean rapide = isRapide(); - final GrMorphisme versEcran = _versEcran; - final int tiret = getTiretLength(); - final int marge = 1; - int absyAxe = (int) (targetBoite.getMinX() + yMax + 2 * marge + tiret); - final int margeBas = (font == null ? 0 : font.getSize()) + 2 * marge + tiret; - int ordxAxe = (int) (targetBoite.getMaxY() - margeBas); - vue_.setUserInsets(new Insets(3, absyAxe + 5, margeBas + 5, 3)); + // boolean rapide = isRapide(); + final GrMorphisme versEcran = _versEcran; + final int tiret = getTiretLength(); + final int marge = 1; + int absyAxe = (int) (targetBoite.getMinX() + yMax + 2 * marge + tiret); + final int margeBas = (font == null ? 0 : font.getSize()) + 2 * marge + + tiret; + int ordxAxe = (int) (targetBoite.getMaxY() - margeBas); + vue_.setUserInsets(new Insets(3, absyAxe + 5, margeBas + 5, 3)); - final GrBoite ecranBoite = domaine.applique(_versEcran); - if (ecranBoite.getMinX() - 5 > absyAxe) { - absyAxe = (int) (ecranBoite.getMinX() - 5); - } - if (ecranBoite.getMaxY() + 5 < ordxAxe) { - ordxAxe = (int) (ecranBoite.getMaxY() + 5); - } - if (isXPainted) { - fillXZone(_g, targetBoite, absyAxe, ordxAxe, ecranBoite); + final GrBoite ecranBoite = domaine.applique(_versEcran); + if (ecranBoite.getMinX() - 5 > absyAxe) { + absyAxe = (int) (ecranBoite.getMinX() - 5); + } + if (ecranBoite.getMaxY() + 5 < ordxAxe) { + ordxAxe = (int) (ecranBoite.getMaxY() + 5); + } + if (isXPainted) { + fillXZone(_g, targetBoite, absyAxe, ordxAxe, ecranBoite); - } + } - // l'axe des x - final double maxXForAxe = ecranBoite.getMaxX() - marge; + // l'axe des x + final double maxXForAxe = ecranBoite.getMaxX() - marge; - // l'axe des y - final double minYForAxe = ecranBoite.getMinY() + marge; - // les graduation en x + // l'axe des y + final double minYForAxe = ecranBoite.getMinY() + marge; + // les graduation en x - final int ascent = fm == null ? 0 : fm.getAscent(); - final int ordXString = ordxAxe + tiret + ascent; - if (isXPainted) { - drawXAxe(_g, zv, xValue, versEcran, absyAxe, ordxAxe, maxXForAxe); - drawXGraduations(_g, targetBoite, xValue, xStrWidth, xString, absyAxe, ordxAxe, ecranBoite, minYForAxe, - ordXString); - } + final int ascent = fm == null ? 0 : fm.getAscent(); + final int ordXString = ordxAxe + tiret + ascent; + if (isXPainted) { + drawXAxe(_g, zv, xValue, versEcran, absyAxe, ordxAxe, maxXForAxe); + drawXGraduations(_g, targetBoite, xValue, xStrWidth, xString, + absyAxe, ordxAxe, ecranBoite, minYForAxe, ordXString); + } - // y + // y - if (isYPainted) { - fillYZone(_g, targetBoite, absyAxe, ecranBoite); - drawYaxe(_g, zv, xValue, yValue, versEcran, absyAxe, ordxAxe, minYForAxe); - drawYGraduations(_g, yValue, yStrWidth, yString, versEcran, marge, absyAxe, ordxAxe, ecranBoite, maxXForAxe); - } - _g.setColor(old); - _g.setFont(oldFont); - } + if (isYPainted) { + fillYZone(_g, targetBoite, absyAxe, ecranBoite); + drawYaxe(_g, zv, xValue, yValue, versEcran, absyAxe, ordxAxe, + minYForAxe); + drawYGraduations(_g, yValue, yStrWidth, yString, versEcran, marge, + absyAxe, ordxAxe, ecranBoite, maxXForAxe); + } + _g.setColor(old); + _g.setFont(oldFont); + } - void fillXZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite) { - if (_ecranBoite.getMaxX() > _ordxAxe) { - _g.setColor(vue_.getBackground()); - _g.fillRect(_absyAxe, _ordxAxe, (int) _targetBoite.getMaxX() - _absyAxe, (int) _targetBoite.getMaxY() - _ordxAxe); - } - } + void fillXZone(final Graphics2D _g, final GrBoite _targetBoite, + final int _absyAxe, final int _ordxAxe, final GrBoite _ecranBoite) { + if (_ecranBoite.getMaxX() > _ordxAxe) { + _g.setColor(vue_.getBackground()); + _g.fillRect(_absyAxe, _ordxAxe, (int) _targetBoite.getMaxX() + - _absyAxe, (int) _targetBoite.getMaxY() - _ordxAxe); + } + } - private void fillYZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final GrBoite _ecranBoite) { - if (_ecranBoite.getMinX() < _absyAxe) { - _g.setColor(vue_.getBackground()); - _g.fillRect(0, 0, _absyAxe, (int) _targetBoite.getMaxY()); - } - } + private void fillYZone(final Graphics2D _g, final GrBoite _targetBoite, + final int _absyAxe, final GrBoite _ecranBoite) { + if (_ecranBoite.getMinX() < _absyAxe) { + _g.setColor(vue_.getBackground()); + _g.fillRect(0, 0, _absyAxe, (int) _targetBoite.getMaxY()); + } + } - protected void drawYGraduations(final Graphics2D _g, final TDoubleArrayList _yValue, final TIntArrayList _yStrWidth, - final List _yString, final GrMorphisme _versEcran, final int _marge, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite, final double _maxXForAxe) { - final int nb = _yString.size(); - final int tiret = getTiretLength(); - final Font font = getFont(); - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - final int ascent = fm == null ? 0 : fm.getAscent(); - int idxStr = -1; - final Color fg = getDrawColor(); - final Color subColor = getSubColor(); - GrPoint tmpSousGrille_ = new GrPoint(); - double longueurMoyenne = 0; - for (int i = 0; i < nb; i++) { - tmp_.y_ = _yValue.getQuick(i); - tmp_.autoApplique(_versEcran); - if (tmp_.y_ > _ordxAxe) { - continue; - } - if (tmp_.y_ < _ecranBoite.getMinY()) { - break; - } - // le tiret - tl_.setTypeTrait(TraceLigne.LISSE); - tl_.setCouleur(fg); - final int w = _yStrWidth.getQuick(i); - tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _absyAxe - (w > 0 ? tiret : tiret - 2), tmp_.y_); - if (w > 0 && (tmp_.y_ < idxStr || idxStr < 0)) { - _g.setColor(fg); - _g.drawString((String) _yString.get(i), (_absyAxe - w - tiret - _marge), (int) (tmp_.y_ + ascent / 2D)); - idxStr = (int) (tmp_.y_ - ascent / 2D - 3D); - } + protected void drawYGraduations(final Graphics2D _g, + final TDoubleArrayList _yValue, final TIntArrayList _yStrWidth, + final List _yString, final GrMorphisme _versEcran, + final int _marge, final int _absyAxe, final int _ordxAxe, + final GrBoite _ecranBoite, final double _maxXForAxe) { + final int nb = _yString.size(); + final int tiret = getTiretLength(); + final Font font = getFont(); + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + final int ascent = fm == null ? 0 : fm.getAscent(); + int idxStr = -1; + final Color fg = getDrawColor(); + final Color subColor = getSubColor(); + GrPoint tmpSousGrille_ = new GrPoint(); + double longueurMoyenne = 0; + TraceLigne tl=new TraceLigne(traceGraduations_); + TraceLigne t1sousGrad=new TraceLigne(traceSousGraduations_); + for (int i = 0; i < nb; i++) { + tmp_.y_ = _yValue.getQuick(i); + tmp_.autoApplique(_versEcran); + if (tmp_.y_ > _ordxAxe) { + continue; + } + if (tmp_.y_ < _ecranBoite.getMinY()) { + break; + } + // le tiret + //tl_.setTypeTrait(TraceLigne.LISSE); + //tl_.setCouleur(fg); + final int w = _yStrWidth.getQuick(i); + tl.dessineTrait(_g, _absyAxe, tmp_.y_, _absyAxe + - (w > 0 ? tiret : tiret - 2), tmp_.y_); + if (w > 0 && (tmp_.y_ < idxStr || idxStr < 0)) { + _g.setColor(fg); + _g.drawString((String) _yString.get(i), + (_absyAxe - w - tiret - _marge), + (int) (tmp_.y_ + ascent / 2D)); + idxStr = (int) (tmp_.y_ - ascent / 2D - 3D); + } - // -- on trace ou non les sous graduations --// - if ((w > 0 || i == nb - 2) && drawSousGrilleY_ && i > 0 && i < nb - 1) { - int valNextPotable = -1; - for (int j = i + 1; valNextPotable == -1 && j < _yStrWidth.size(); j++) - if (_yStrWidth.getQuick(j) > 0) valNextPotable = j; + // -- on trace ou non les sous graduations --// + if ((w > 0 || i == nb - 2) && drawSousGrilleY_ && i > 0 + && i < nb - 1) { + int valNextPotable = -1; + for (int j = i + 1; valNextPotable == -1 + && j < _yStrWidth.size(); j++) + if (_yStrWidth.getQuick(j) > 0) + valNextPotable = j; - if (i == nb - 2) { - // -- la fin il faut creer le nouveau - valNextPotable = nb - 1; - _yValue.set(valNextPotable, _yValue.get(i) + longueurMoyenne); - } + if (i == nb - 2) { + // -- la fin il faut creer le nouveau + valNextPotable = nb - 1; + _yValue.set(valNextPotable, _yValue.get(i) + + longueurMoyenne); + } - if (valNextPotable != -1) { + if (valNextPotable != -1) { - tmpSousGrille_.y_ = _yValue.getQuick(valNextPotable); - tmpSousGrille_.autoApplique(_versEcran); - double distanceEntre2Trait = Math.abs(tmpSousGrille_.y_ - tmp_.y_); - int nbSousGrilles = 0; - int taillePasSousgrille = 0; - if (!this.modeLongueurPasSousGradY_) { - // -- on trace des nombre de cesure --// - nbSousGrilles = this.getNbYSousGraduations(); - if (nbSousGrilles != 0) taillePasSousgrille = (int) ((distanceEntre2Trait) / nbSousGrilles); - } else { - // -- on trace des pas par longueur --// - double ratio = (_yValue.getQuick(valNextPotable) - _yValue.getQuick(i)); - if (ratio != 0) ratio = this.valeurPasSousGradY_ / ratio; + tmpSousGrille_.y_ = _yValue.getQuick(valNextPotable); + tmpSousGrille_.autoApplique(_versEcran); + double distanceEntre2Trait = Math.abs(tmpSousGrille_.y_ + - tmp_.y_); + int nbSousGrilles = 0; + int taillePasSousgrille = 0; + if (!this.modeLongueurPasSousGradY_) { + // -- on trace des nombre de cesure --// + nbSousGrilles = this.getNbYSousGraduations(); + if (nbSousGrilles != 0) + taillePasSousgrille = (int) ((distanceEntre2Trait) / nbSousGrilles); + } else { + // -- on trace des pas par longueur --// + double ratio = (_yValue.getQuick(valNextPotable) - _yValue + .getQuick(i)); + if (ratio != 0) + ratio = this.valeurPasSousGradY_ / ratio; - taillePasSousgrille = (int) (ratio * distanceEntre2Trait); - if (taillePasSousgrille != 0) nbSousGrilles = (int) (distanceEntre2Trait / taillePasSousgrille); - } - // -- si on a des bons pas et nb de grilles --// - if (nbSousGrilles > 0 && taillePasSousgrille > 0 && taillePasSousgrille < distanceEntre2Trait) { + taillePasSousgrille = (int) (ratio * distanceEntre2Trait); + if (taillePasSousgrille != 0) + nbSousGrilles = (int) (distanceEntre2Trait / taillePasSousgrille); + } + // -- si on a des bons pas et nb de grilles --// + if (nbSousGrilles > 0 && taillePasSousgrille > 0 + && taillePasSousgrille < distanceEntre2Trait) { - for (int k = 0; k < nbSousGrilles + 1; k++) { - // -- on trace un trait de couleur de subgrid --// - tl_.setTypeTrait(TraceLigne.POINTILLE); - tl_.setEpaisseur((float) 0.1); - tl_.setCouleur(this.couleurSousGraduation_); - double longueur = ((k) * taillePasSousgrille); - tmpSousGrille_.autoApplique(_versEcran); - tl_.dessineTrait(_g, _absyAxe, tmp_.y_ + longueur, _maxXForAxe, tmp_.y_ + longueur); - } - longueurMoyenne = (int) (_yValue.getQuick(valNextPotable) - _yValue.getQuick(i)); - } + for (int k = 0; k < nbSousGrilles + 1; k++) { + // -- on trace un trait de couleur de subgrid --// +// t1sousGrad.setTypeTrait(TraceLigne.POINTILLE); +// t1sousGrad.setEpaisseur((float) 0.1); +// t1sousGrad.setCouleur(this.couleurSousGraduation_); + double longueur = ((k) * taillePasSousgrille); + tmpSousGrille_.autoApplique(_versEcran); + t1sousGrad.dessineTrait(_g, _absyAxe, tmp_.y_ + longueur, + _maxXForAxe, tmp_.y_ + longueur); + } + longueurMoyenne = (int) (_yValue + .getQuick(valNextPotable) - _yValue.getQuick(i)); + } - } - } + } + } - if (drawGrid_ && w > 0) { - tl_.setTypeTrait(TraceLigne.TIRETE); - tl_.setEpaisseur(1); - tl_.setCouleur(subColor); - tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _maxXForAxe, tmp_.y_); - } - } - } + if (drawGrid_ && w > 0) { + //tl.setTypeTrait(TraceLigne.TIRETE); + //tl.setEpaisseur(1); + //tl.setCouleur(subColor); + tl.dessineTrait(_g, _absyAxe, tmp_.y_, _maxXForAxe, tmp_.y_); + } + } + } - private Color getSubColor() { - Color subColor = attenueCouleur(getForeground()); - if (isAttenue()) { - subColor = attenueCouleur(subColor); - } - return subColor; - } + private Color getSubColor() { + Color subColor = attenueCouleur(getForeground()); + if (isAttenue()) { + subColor = attenueCouleur(subColor); + } + return subColor; + } - private Color getDrawColor() { - Color fg = getForeground(); - if (isAttenue()) { - fg = attenueCouleur(fg); - } - return fg; - } + private Color getDrawColor() { + Color fg = getForeground(); + if (isAttenue()) { + fg = attenueCouleur(fg); + } + return fg; + } - final GrPoint tmp_ = new GrPoint(); + final GrPoint tmp_ = new GrPoint(); - private void drawXGraduations(final Graphics2D _g, final GrBoite _targetBoite, final TDoubleArrayList _xValue, - final TIntArrayList _xStrWidth, final List _xString, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite, final double _minYForAxe, final int _ordXString) { - final int nb = _xString.size(); - final Color fg = getDrawColor(); - final Color subColor = getSubColor(); - int idxStr = -1; - final GrMorphisme versEcran = getVersEcran(); - final int tiret = getTiretLength(); - final TraceLigne gtl = new TraceLigne(); - GrPoint tmpSousGrille_ = new GrPoint(); + private void drawXGraduations(final Graphics2D _g, + final GrBoite _targetBoite, final TDoubleArrayList _xValue, + final TIntArrayList _xStrWidth, final List _xString, + final int _absyAxe, final int _ordxAxe, final GrBoite _ecranBoite, + final double _minYForAxe, final int _ordXString) { + final int nb = _xString.size(); + final Color fg = getDrawColor(); + final Color subColor = getSubColor(); + int idxStr = -1; + final GrMorphisme versEcran = getVersEcran(); + final int tiret = getTiretLength(); + final TraceLigne gtl = new TraceLigne(traceGraduations_); + final TraceLigne gtlsousGrad = new TraceLigne(traceSousGraduations_); + + GrPoint tmpSousGrille_ = new GrPoint(); - double longueurMoyenne = 0; + double longueurMoyenne = 0; - for (int i = 0; i < nb; i++) { - tmp_.x_ = _xValue.getQuick(i); - tmp_.autoApplique(versEcran); - if (tmp_.x_ < _absyAxe) { - continue; - } - if (tmp_.x_ > _ecranBoite.getMaxX()) { - break; - } - // le tiret - gtl.setTypeTrait(TraceLigne.LISSE); - gtl.setCouleur(fg); - final int w = _xStrWidth.getQuick(i); - gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _ordxAxe + (w > 0 ? tiret : tiret - 2)); - if (w > 0) { - final int start = (int) (tmp_.x_ - w / 2D); - if (start > idxStr + 1 && start + w < _targetBoite.getMaxX()) { - _g.setColor(fg); - _g.drawString((String) _xString.get(i), start, _ordXString); - idxStr = start + w; - } - } + for (int i = 0; i < nb; i++) { + tmp_.x_ = _xValue.getQuick(i); + tmp_.autoApplique(versEcran); + if (tmp_.x_ < _absyAxe) { + continue; + } + if (tmp_.x_ > _ecranBoite.getMaxX()) { + break; + } + // le tiret + //gtl.setTypeTrait(TraceLigne.LISSE); + //gtl.setCouleur(fg); + final int w = _xStrWidth.getQuick(i); + gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _ordxAxe + + (w > 0 ? tiret : tiret - 2)); + if (w > 0) { + final int start = (int) (tmp_.x_ - w / 2D); + if (start > idxStr + 1 && start + w < _targetBoite.getMaxX()) { + _g.setColor(fg); + _g.drawString((String) _xString.get(i), start, _ordXString); + idxStr = start + w; + } + } - // -- on trace ou non les sous graduations --// - if ((w > 0 || i == nb - 2) && drawSousGrilleX_ && i < nb - 1) { - int valNextPotable = -1; - for (int j = i + 1; valNextPotable == -1 && j < _xStrWidth.size(); j++) - if (_xStrWidth.getQuick(j) > 0) valNextPotable = j; - if (i == nb - 2) { - // -- la fin il faut creer le nouveau - valNextPotable = nb - 1; - _xValue.set(valNextPotable, _xValue.get(i) + longueurMoyenne); - } - if (valNextPotable != -1) { + // -- on trace ou non les sous graduations --// + if ((w > 0 || i == nb - 2) && drawSousGrilleX_ && i < nb - 1) { + int valNextPotable = -1; + for (int j = i + 1; valNextPotable == -1 + && j < _xStrWidth.size(); j++) + if (_xStrWidth.getQuick(j) > 0) + valNextPotable = j; + if (i == nb - 2) { + // -- la fin il faut creer le nouveau + valNextPotable = nb - 1; + _xValue.set(valNextPotable, _xValue.get(i) + + longueurMoyenne); + } + if (valNextPotable != -1) { - tmpSousGrille_.x_ = _xValue.getQuick(valNextPotable); - tmpSousGrille_.autoApplique(versEcran); - double distanceEntre2Trait = Math.abs(tmpSousGrille_.x_ - tmp_.x_); - int nbSousGrilles = 0; - int taillePasSousgrille = 0; - if (!this.modeLongueurPasSousGradX_) { - // -- on trace des nombre de cesure --// - nbSousGrilles = this.getNbXSousGraduations(); - if (nbSousGrilles != 0) taillePasSousgrille = (int) ((distanceEntre2Trait) / nbSousGrilles); - } else { - // -- on trace des pas par longueur --// - double ratio = (_xValue.getQuick(valNextPotable) - _xValue.getQuick(i)); - if (ratio != 0) ratio = this.valeurPasSousGradX_ / ratio; + tmpSousGrille_.x_ = _xValue.getQuick(valNextPotable); + tmpSousGrille_.autoApplique(versEcran); + double distanceEntre2Trait = Math.abs(tmpSousGrille_.x_ + - tmp_.x_); + int nbSousGrilles = 0; + int taillePasSousgrille = 0; + if (!this.modeLongueurPasSousGradX_) { + // -- on trace des nombre de cesure --// + nbSousGrilles = this.getNbXSousGraduations(); + if (nbSousGrilles != 0) + taillePasSousgrille = (int) ((distanceEntre2Trait) / nbSousGrilles); + } else { + // -- on trace des pas par longueur --// + double ratio = (_xValue.getQuick(valNextPotable) - _xValue + .getQuick(i)); + if (ratio != 0) + ratio = this.valeurPasSousGradX_ / ratio; - taillePasSousgrille = (int) (ratio * distanceEntre2Trait); - if (taillePasSousgrille != 0) nbSousGrilles = (int) (distanceEntre2Trait / taillePasSousgrille); - } - // -- si on a des bons pas et nb de grilles --// - if (nbSousGrilles > 0 && taillePasSousgrille > 0 && taillePasSousgrille < distanceEntre2Trait) { + taillePasSousgrille = (int) (ratio * distanceEntre2Trait); + if (taillePasSousgrille != 0) + nbSousGrilles = (int) (distanceEntre2Trait / taillePasSousgrille); + } + // -- si on a des bons pas et nb de grilles --// + if (nbSousGrilles > 0 && taillePasSousgrille > 0 + && taillePasSousgrille < distanceEntre2Trait) { - for (int k = 0; k < nbSousGrilles + 1; k++) { - // -- on trace un trait de couleur de subgrid --// - gtl.setTypeTrait(TraceLigne.POINTILLE); - gtl.setEpaisseur((float) 0.1); - gtl.setCouleur(this.couleurSousGraduation_); - double longueur = ((k) * taillePasSousgrille); - tmpSousGrille_.autoApplique(versEcran); - gtl.dessineTrait(_g, tmp_.x_ + longueur, _ordxAxe, tmp_.x_ + longueur, _minYForAxe); - } + for (int k = 0; k < nbSousGrilles + 1; k++) { + // -- on trace un trait de couleur de subgrid --// +// gtlsousGrad.setTypeTrait(TraceLigne.POINTILLE); +// gtlsousGrad.setEpaisseur((float) 0.1); +// gtlsousGrad.setCouleur(this.couleurSousGraduation_); + double longueur = ((k) * taillePasSousgrille); + tmpSousGrille_.autoApplique(versEcran); + gtlsousGrad.dessineTrait(_g, tmp_.x_ + longueur, _ordxAxe, + tmp_.x_ + longueur, _minYForAxe); + } - longueurMoyenne = (int) (_xValue.getQuick(valNextPotable) - _xValue.getQuick(i)); - } + longueurMoyenne = (int) (_xValue + .getQuick(valNextPotable) - _xValue.getQuick(i)); + } - } - } - if (drawGrid_ && w > 0) { - gtl.setTypeTrait(TraceLigne.TIRETE); - gtl.setCouleur(subColor); - gtl.setEpaisseur((float) 1); - gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _minYForAxe); - } + } + } + if (drawGrid_ && w > 0) { +// gtl.setTypeTrait(TraceLigne.TIRETE); +// gtl.setCouleur(subColor); +// gtl.setEpaisseur((float) 1); + gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _minYForAxe); + } - } - } + } + } - private void drawYaxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, - final TDoubleArrayList _yValue, final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, - final double _minYForAxe) { - int minYDraw = _ordxAxe; - int maxYDraw = (int) _minYForAxe; + private void drawYaxe(final Graphics2D _g, final GrBoite _zv, + final TDoubleArrayList _xValue, final TDoubleArrayList _yValue, + final GrMorphisme _versEcran, final int _absyAxe, + final int _ordxAxe, final double _minYForAxe) { + int minYDraw = _ordxAxe; + int maxYDraw = (int) _minYForAxe; - // if (useCustom_) { - // tmp_.y_ = _zv.getMinY(); - // if (_yValue.size() > 0) { - // tmp_.y_ = Math.min(_yValue.get(0), tmp_.y_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.y_ = Math.floor(tmp_.y_); - // if (tmp_.y_ > minYDraw) { - // minYDraw = (int) tmp_.y_; - // } - // tmp_.y_ = _zv.getMaxY(); - // if (_yValue.size() > 1) { - // tmp_.y_ = Math.max(_yValue.get(_yValue.size() - 1), tmp_.y_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.y_ = Math.ceil(tmp_.y_); - // if (tmp_.y_ < maxYDraw) { - // maxYDraw = (int) tmp_.y_; - // } - // } - tl_.setCouleur(getDrawColor()); - tl_.setTypeTrait(TraceLigne.LISSE); - tl_.dessineTrait(_g, _absyAxe, minYDraw, _absyAxe, maxYDraw); - } + // if (useCustom_) { + // tmp_.y_ = _zv.getMinY(); + // if (_yValue.size() > 0) { + // tmp_.y_ = Math.min(_yValue.get(0), tmp_.y_); + // } + // tmp_.autoApplique(_versEcran); + // tmp_.y_ = Math.floor(tmp_.y_); + // if (tmp_.y_ > minYDraw) { + // minYDraw = (int) tmp_.y_; + // } + // tmp_.y_ = _zv.getMaxY(); + // if (_yValue.size() > 1) { + // tmp_.y_ = Math.max(_yValue.get(_yValue.size() - 1), tmp_.y_); + // } + // tmp_.autoApplique(_versEcran); + // tmp_.y_ = Math.ceil(tmp_.y_); + // if (tmp_.y_ < maxYDraw) { + // maxYDraw = (int) tmp_.y_; + // } + // } + tl_.setCouleur(getDrawColor()); + tl_.setTypeTrait(TraceLigne.LISSE); + tl_.dessineTrait(_g, _absyAxe, minYDraw, _absyAxe, maxYDraw); + } - final TraceLigne tl_ = new TraceLigne(); + final TraceLigne tl_ = new TraceLigne(); - private void drawXAxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, - final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, final double _maxXForAxe) { - int minXDraw = _absyAxe; - int maxXDraw = (int) _maxXForAxe; + private void drawXAxe(final Graphics2D _g, final GrBoite _zv, + final TDoubleArrayList _xValue, final GrMorphisme _versEcran, + final int _absyAxe, final int _ordxAxe, final double _maxXForAxe) { + int minXDraw = _absyAxe; + int maxXDraw = (int) _maxXForAxe; - tl_.setCouleur(getDrawColor()); - tl_.setTypeTrait(TraceLigne.LISSE); - tl_.dessineTrait(_g, minXDraw, _ordxAxe, maxXDraw, _ordxAxe); - } + tl_.setCouleur(getDrawColor()); + tl_.setTypeTrait(TraceLigne.LISSE); + tl_.dessineTrait(_g, minXDraw, _ordxAxe, maxXDraw, _ordxAxe); + } - private void computeXValues(final GrBoite _zv, final Graphics2D _g, final TDoubleArrayList _xValue, - final TIntArrayList _xStrWidth, final List _xString, final NumberIterator _it) { - final Font font = getFont(); - if (font != null) { - _g.setFont(font); - } - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + private void computeXValues(final GrBoite _zv, final Graphics2D _g, + final TDoubleArrayList _xValue, final TIntArrayList _xStrWidth, + final List _xString) { + TickIterator it=null; + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - // -- mode manuel --// - if (!modeAutomatiqueX_) { - if (modeLongueurPasX_) fillGraduationsWithPas(_g, this.valeurPasX_, _zv.getMinX(), _zv.getMaxX(), _xValue, - _xStrWidth, _xString, fm); - else fillGraduations(_g, getNbXGraduations(), _zv.getMinX(), _zv.getMaxX(), _xValue, _xStrWidth, _xString, fm); - return; - } + // -- mode manuel --// + if (!modeAutomatiqueX_) { + if (modeLongueurPasX_){ + //fillGraduationsWithPas(_g, this.valeurPasX_, _zv.getMinX(), _zv + // .getMaxX(), _xValue, _xStrWidth, _xString, fm); + it=new NumberIteratorPasFixe(); + it.init(_zv.getMinX(), _zv.getMaxX(), this.valeurPasX_); + + } + else{ +// fillGraduations(_g, getNbXGraduations(), _zv.getMinX(), _zv +// .getMaxX(), _xValue, _xStrWidth, _xString, fm); + it=new NumberIteratorGraduationsFixe(); + it.init(_zv.getMinX(), _zv.getMaxX(), getNbXGraduations()); + } + }else{ + it=new NumberIterator(); + it.init(_zv.getMinX(), _zv.getMaxX(), getNbXGraduations()); + } + + if(it==null) + return; + // _it= + while (it.hasNext()) { + final double x = it.currentValue(); + _xValue.add(x); - _it.init(_zv.getMinX(), _zv.getMaxX(), getNbXGraduations()); + if (font == null || !it.isMajorTick()) { + _xStrWidth.add(0); + _xString.add(CtuluLibString.EMPTY_STRING); + } else { + final String currentLabel = it.currentLabel(); + _xStrWidth.add(fm.stringWidth(currentLabel)); + _xString.add(currentLabel); + } + it.next(); + } + } - // _it= - while (_it.hasNext()) { - final double x = _it.currentValue(); - _xValue.add(x); + public boolean isModeAutomatiqueX() { + return modeAutomatiqueX_; + } - if (font == null || !_it.isMajorTick()) { - _xStrWidth.add(0); - _xString.add(CtuluLibString.EMPTY_STRING); - } else { - final String currentLabel = _it.currentLabel(); - _xStrWidth.add(fm.stringWidth(currentLabel)); - _xString.add(currentLabel); - } - _it.next(); - } - } + public void setModeAutomatiqueX(boolean modeAutomatiqueX) { + this.modeAutomatiqueX_ = modeAutomatiqueX; + } - public boolean isModeAutomatiqueX() { - return modeAutomatiqueX_; - } + public boolean isModeAutomatiqueY() { + return modeAutomatiqueY_; + } - public void setModeAutomatiqueX(boolean modeAutomatiqueX) { - this.modeAutomatiqueX_ = modeAutomatiqueX; - } + public void setModeAutomatiqueY(boolean modeAutomatiqueY) { + this.modeAutomatiqueY_ = modeAutomatiqueY; + } - public boolean isModeAutomatiqueY() { - return modeAutomatiqueY_; - } + /** + * Remplit les graduations correctement: nb cesures= nombre de trait sur + * l'ecran que ce soit pour le mode par taille de pas ou par nb de cesures. + * + * @param nbGraduations + * @param min + * @param max + * @param _xValue + * @param _xStrWidth + * @param _xString + */ + private double fillGraduations(Graphics2D _g, int nbGraduations, + double min, double max, final TDoubleArrayList _xValue, + final TIntArrayList _xStrWidth, final List _xString, FontMetrics fm) { - public void setModeAutomatiqueY(boolean modeAutomatiqueY) { - this.modeAutomatiqueY_ = modeAutomatiqueY; - } + // -- distance tot a couvrir --// + final double distance = max - min;// e + final int taillePas = Math.max(1, (int) (distance / nbGraduations)); + double yMax = 0; + - /** - * Remplit les graduations correctement: nb cesures= nombre de trait sur l'ecran que ce soit pour le mode par taille - * de pas ou par nb de cesures. - * - * @param nbGraduations - * @param min - * @param max - * @param _xValue - * @param _xStrWidth - * @param _xString - */ - private double fillGraduations(Graphics2D _g, int nbGraduations, double min, double max, - final TDoubleArrayList _xValue, final TIntArrayList _xStrWidth, final List _xString, FontMetrics fm) { + + NumberIteratorGraduationsFixe _it=new NumberIteratorGraduationsFixe(); + _it.init(min, max, nbGraduations); + + while (_it.hasNext()) { + final double x = _it.currentValue(); + _xValue.add(x); + final String currentLabel = _it.currentLabel(); + int stringWidth=fm.stringWidth(currentLabel); + _xStrWidth.add(stringWidth); + if (stringWidth > yMax) { + yMax = stringWidth; + } + _xString.add(currentLabel); + + _it.next(); + } + + return yMax; - // -- distance tot a couvrir --// - final double distance = max - min;// e - final int taillePas = Math.max(1, (int) (distance / nbGraduations));// FREd ne fonctionne pas toujours si on a des - // valeurs <1 + } - double yMax = 0; - // boucle infinie ! + /** + * Remplit les graduations correctement: nb cesures= nombre de trait sur + * l'ecran que ce soit pour le mode par taille de pas ou par nb de cesures. + * + * @param nbGraduations + * @param min + * @param max + * @param _xValue + * @param _xStrWidth + * @param _xString + */ + private double fillGraduationsWithPas(Graphics2D _g, double pas, + double min, double max, final TDoubleArrayList _xValue, + final TIntArrayList _xStrWidth, final List _xString, FontMetrics fm) { + DecimalFormat df = new DecimalFormat("#.0"); + // -- distance tot a couvrir --// + final double distance = max - min; + final double taillePas = pas; + if (pas == 0) + return 0; + int nbGraduations = (int) (distance / taillePas); + double yMax = 0; - for (int i = 0; i < nbGraduations + 1; i++) { - int cesure = (int) (min + (taillePas * (i))); - _xValue.add(cesure); - final String currentLabel = Integer.toString(cesure); - _xStrWidth.add(fm.stringWidth(currentLabel)); - _xString.add(currentLabel); + for (int i = 0; i < nbGraduations + 1; i++) { + double cesure = (min + (taillePas * (i))); + _xValue.add(cesure); + String currentLabel; - final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); - if (stringWidth > yMax) { - yMax = stringWidth; - } - // boucle infinie ! - if (i == nbGraduations) if (cesure < max) nbGraduations++; - // Fred truc tempo pour eviter les crashs - if (i > 100) break; - } - return yMax; + currentLabel = df.format(cesure); + + String chiffreApresVirgule = currentLabel.substring(currentLabel + .lastIndexOf(",") + 1); + if (chiffreApresVirgule.equals("0")) + currentLabel = "" + (int) cesure; + _xString.add(currentLabel); + _xStrWidth.add(fm.stringWidth(currentLabel)); + final double stringWidth = fm == null ? 0 : fm.getStringBounds( + currentLabel, _g).getWidth(); + if (stringWidth > yMax) { + yMax = stringWidth; + } - } + if (i == nbGraduations) { + if (cesure < max) + nbGraduations++;// ATTENTION boucle infinie ! + } + if (i > 100) + break;// a enlever bugfix temporaire. - /** - * Remplit les graduations correctement: nb cesures= nombre de trait sur l'ecran que ce soit pour le mode par taille - * de pas ou par nb de cesures. - * - * @param nbGraduations - * @param min - * @param max - * @param _xValue - * @param _xStrWidth - * @param _xString - */ - private double fillGraduationsWithPas(Graphics2D _g, double pas, double min, double max, final TDoubleArrayList _xValue, - final TIntArrayList _xStrWidth, final List _xString, FontMetrics fm) { - DecimalFormat df = new DecimalFormat("#.0"); - // -- distance tot a couvrir --// - final double distance = max - min; - final double taillePas = pas; - if (pas == 0) return 0; - int nbGraduations = (int) (distance / taillePas); - double yMax = 0; + } + return yMax; - for (int i = 0; i < nbGraduations + 1; i++) { - double cesure = (min + (taillePas * (i))); - _xValue.add(cesure); - String currentLabel; - - currentLabel = df.format(cesure); - _xStrWidth.add(fm.stringWidth(currentLabel)); - String chiffreApresVirgule=currentLabel.substring(currentLabel.lastIndexOf(",")+1); - if( chiffreApresVirgule.equals("0")) - currentLabel=""+(int)cesure; - _xString.add(currentLabel); - - final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); - if (stringWidth > yMax) { - yMax = stringWidth; - } + } - if (i == nbGraduations) { - if (cesure < max) nbGraduations++;// ATTENTION boucle infinie ! - } - if (i > 100) break;// a enlever bugfix temporaire. + private double computeYValues(final Graphics2D _g, final GrBoite _zv, + final TDoubleArrayList _yValue, final TIntArrayList _yStrWidth, + final List _yString) { + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + double yMax = 0; + TickIterator it=null; - } - return yMax; + // -- mode manuel --// + if (!modeAutomatiqueY_) { + if (modeLongueurPasY_){ + + it=new NumberIteratorPasFixe(); + it.init(_zv.getMinY(), _zv.getMaxY(), this.valeurPasY_); +// yMax = fillGraduationsWithPas(_g, this.valeurPasY_, _zv +// .getMinY(), _zv.getMaxY(), _yValue, _yStrWidth, +// _yString, fm); + } + else{ + it = new NumberIteratorGraduationsFixe(); + it.init(_zv.getMinY(), _zv.getMaxY(), getNbYGraduations()); +// yMax = fillGraduations(_g, nbGraduationY_, _zv.getMinY(), _zv +// .getMaxY(), _yValue, _yStrWidth, _yString, fm); + } + //return yMax; + }else{ + it = new NumberIterator(); + it.init(_zv.getMinY(), _zv.getMaxY(), getNbYGraduations()); + } - } + if(it==null) + return 0; + + while (it.hasNext()) { - private double computeYValues(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _yValue, - final TIntArrayList _yStrWidth, final List _yString) { - final Font font = getFont(); - if (font != null) { - _g.setFont(font); - } - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - double yMax = 0; - NumberIterator it; + final double x = it.currentValue(); + _yValue.add(x); + if (font == null || !it.isMajorTick()) { + _yStrWidth.add(0); + _yString.add(CtuluLibString.EMPTY_STRING); + } else { + final String currentLabel = it.currentLabel(); + final double stringWidth = fm == null ? 0 : fm.getStringBounds( + currentLabel, _g).getWidth(); + if (stringWidth > yMax) { + yMax = stringWidth; + } + _yStrWidth.add((int) stringWidth); + _yString.add(currentLabel); + } + it.next(); + } + return yMax; + } - // -- mode manuel --// - if (!modeAutomatiqueY_) { - if (modeLongueurPasY_) yMax = fillGraduationsWithPas(_g, this.valeurPasY_, _zv.getMinY(), _zv.getMaxY(), _yValue, - _yStrWidth, _yString, fm); - else yMax = fillGraduations(_g, nbGraduationY_, _zv.getMinY(), _zv.getMaxY(), _yValue, _yStrWidth, _yString, fm); - return yMax; - } + // private void updateBounds(final GrBoite _zv) { + // if (useCustom_ && customBounds_ != null) { + // _zv.o_.x_ = Math.max(_zv.o_.x_, customBounds_.getMinX()); + // _zv.e_.x_ = Math.min(_zv.e_.x_, customBounds_.getMaxX()); + // _zv.o_.y_ = Math.max(_zv.o_.y_, customBounds_.getMinY()); + // _zv.e_.y_ = Math.min(_zv.e_.y_, customBounds_.getMaxY()); + // } + // } - it = new NumberIterator(); - it.init(_zv.getMinY(), _zv.getMaxY(), getNbYGraduations()); - while (it.hasNext()) { + // Icon + /** + * Dessin de l'icone. + * + * @param _c + * composant dont l'icone peut deriver des proprietes (couleur, + * ...). Ce parametre peut etre <I>null</I>. Il est ignore ici. + * @param _g + * le graphics sur lequel dessiner l'icone + * @param _x + * lieu cible de l'icone (x) + * @param _y + * lieu cible de l'icone (y) + */ + public void paintIcon(final Component _c, final Graphics _g, final int _x, + final int _y) { + super.paintIcon(_c, _g, _x, _y); + Color fg = getForeground(); + if (isAttenue()) { + fg = attenueCouleur(fg); + } + _g.setColor(fg); + final int w = getIconWidth(); + final int h = getIconHeight(); + for (int i = 6; i < w - 2; i += 8) { + _g.drawLine(_x + i, _y + 1, _x + i, _y + h - 1); + } + for (int j = 6; j < h - 2; j += 8) { + _g.drawLine(_x + 1, _y + j, _x + w - 1, _y + j); + } + } - final double x = it.currentValue(); - _yValue.add(x); - if (font == null || !it.isMajorTick()) { - _yStrWidth.add(0); - _yString.add(CtuluLibString.EMPTY_STRING); - } else { - final String currentLabel = it.currentLabel(); - final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); - if (stringWidth > yMax) { - yMax = stringWidth; - } - _yStrWidth.add((int) stringWidth); - _yString.add(currentLabel); - } - it.next(); - } - return yMax; - } + public void paintSelection(final Graphics2D _g, + final ZSelectionTrace _trace, final GrMorphisme _versEcran, + final GrBoite _clipReel) { + } - // private void updateBounds(final GrBoite _zv) { - // if (useCustom_ && customBounds_ != null) { - // _zv.o_.x_ = Math.max(_zv.o_.x_, customBounds_.getMinX()); - // _zv.e_.x_ = Math.min(_zv.e_.x_, customBounds_.getMaxX()); - // _zv.o_.y_ = Math.max(_zv.o_.y_, customBounds_.getMinY()); - // _zv.e_.y_ = Math.min(_zv.e_.y_, customBounds_.getMaxY()); - // } - // } + public CtuluListSelection selection(final GrPoint _pt, final int _tolerance) { + return null; + } - // Icon - /** - * Dessin de l'icone. - * - * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null</I>. Il - * est ignore ici. - * @param _g le graphics sur lequel dessiner l'icone - * @param _x lieu cible de l'icone (x) - * @param _y lieu cible de l'icone (y) - */ - public void paintIcon(final Component _c, final Graphics _g, final int _x, final int _y) { - super.paintIcon(_c, _g, _x, _y); - Color fg = getForeground(); - if (isAttenue()) { - fg = attenueCouleur(fg); - } - _g.setColor(fg); - final int w = getIconWidth(); - final int h = getIconHeight(); - for (int i = 6; i < w - 2; i += 8) { - _g.drawLine(_x + i, _y + 1, _x + i, _y + h - 1); - } - for (int j = 6; j < h - 2; j += 8) { - _g.drawLine(_x + 1, _y + j, _x + w - 1, _y + j); - } - } + public CtuluListSelection selection(final LinearRing _poly, final int _mode) { + return null; + } - public void paintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, - final GrBoite _clipReel) {} + public LineString getSelectedLine() { + return null; + } - public CtuluListSelection selection(final GrPoint _pt, final int _tolerance) { - return null; - } + /** + * Affectation de la propriete <I>boite</I>. + */ + // public void setBoite(final GrBoite _v) { + // if (boite_ != _v) { + // final GrBoite vp = boite_; + // boite_ = _v; + // firePropertyChange("boite", vp, _v); + // } + // } + public void setVisible(final boolean _v) { + // if (_v && boite_ == null) { + // boite_ = vue_.getAbstractCalque().getDomaine(); + // } + if (!_v) { + vue_.setUserInsets(null); + super.setVisible(false); + } else { + super.setVisible(_v); + } + firePropertyChange("grille", true, false); - public CtuluListSelection selection(final LinearRing _poly, final int _mode) { - return null; - } + } - public LineString getSelectedLine() { - return null; - } + public boolean isDrawGrid() { + return drawGrid_; + } - /** - * Affectation de la propriete <I>boite</I>. - */ - // public void setBoite(final GrBoite _v) { - // if (boite_ != _v) { - // final GrBoite vp = boite_; - // boite_ = _v; - // firePropertyChange("boite", vp, _v); - // } - // } - public void setVisible(final boolean _v) { - // if (_v && boite_ == null) { - // boite_ = vue_.getAbstractCalque().getDomaine(); - // } - if (!_v) { - vue_.setUserInsets(null); - super.setVisible(false); - } else { - super.setVisible(_v); - } - firePropertyChange("grille", true, false); + public void setDrawGrid(final boolean _drawGrid) { + if (_drawGrid != drawGrid_) { + drawGrid_ = _drawGrid; + grilleChanged(); + } + } - } + // public boolean isUseCustom() { + // return useCustom_; + // } + // + // public void setUseCustom(final boolean _useCustom) { + // if (useCustom_ != _useCustom) { + // useCustom_ = _useCustom; + // repaint(); + // } + // } + // + // public Envelope getCustomBounds() { + // return customBounds_ == null ? null : new Envelope(customBounds_); + // } + // + // public void setCustomBounds(final Envelope _customBounds) { + // if (customBounds_ != _customBounds) { + // customBounds_ = _customBounds; + // repaint(); + // } + // } - public boolean isDrawGrid() { - return drawGrid_; - } + public boolean isDrawX() { + return drawX_; + } - public void setDrawGrid(final boolean _drawGrid) { - if (_drawGrid != drawGrid_) { - drawGrid_ = _drawGrid; - grilleChanged(); - } - } + public void setDrawX(final boolean _drawX) { + if (drawX_ != _drawX) { + drawX_ = _drawX; + grilleChanged(); + } + } - // public boolean isUseCustom() { - // return useCustom_; - // } - // - // public void setUseCustom(final boolean _useCustom) { - // if (useCustom_ != _useCustom) { - // useCustom_ = _useCustom; - // repaint(); - // } - // } - // - // public Envelope getCustomBounds() { - // return customBounds_ == null ? null : new Envelope(customBounds_); - // } - // - // public void setCustomBounds(final Envelope _customBounds) { - // if (customBounds_ != _customBounds) { - // customBounds_ = _customBounds; - // repaint(); - // } - // } + public boolean isDrawY() { + return drawY_; + } - public boolean isDrawX() { - return drawX_; - } + public void setDrawY(final boolean _drawY) { + if (drawY_ != _drawY) { + drawY_ = _drawY; + grilleChanged(); + } + } - public void setDrawX(final boolean _drawX) { - if (drawX_ != _drawX) { - drawX_ = _drawX; - grilleChanged(); - } - } + public void setDrawSousGrilleY(final boolean _drawY) { + if (drawSousGrilleY_ != _drawY) { + drawSousGrilleY_ = _drawY; + grilleChanged(); + } + } - public boolean isDrawY() { - return drawY_; - } + public void setDrawSousGrilleX(final boolean _drawX) { + if (drawSousGrilleX_ != _drawX) { + drawSousGrilleX_ = _drawX; + grilleChanged(); + } + } - public void setDrawY(final boolean _drawY) { - if (drawY_ != _drawY) { - drawY_ = _drawY; - grilleChanged(); - } - } + private void grilleChanged() { + repaint(); + firePropertyChange("grille", true, false); + } - public void setDrawSousGrilleY(final boolean _drawY) { - if (drawSousGrilleY_ != _drawY) { - drawSousGrilleY_ = _drawY; - grilleChanged(); - } - } + @Override + public EbliUIProperties saveUIProperties() { + final EbliUIProperties res = super.saveUIProperties(); + res.put("graduation.x.nb", getNbXGraduations()); + res.put("graduation.y.nb", getNbYGraduations()); + res.put("graduation.x.visible", isDrawX()); + res.put("graduation.y.visible", isDrawY()); + res.put("grille.visible", isDrawGrid()); + return res; + } - public void setDrawSousGrilleX(final boolean _drawX) { - if (drawSousGrilleX_ != _drawX) { - drawSousGrilleX_ = _drawX; - grilleChanged(); - } - } + @Override + public void initFrom(EbliUIProperties _p) { + super.initFrom(_p); + if (_p.isDefined("graduation.x.nb")) { + setNbGraduationX(_p.getInteger("graduation.x.nb")); + } + if (_p.isDefined("graduation.y.nb")) { + setNbGraduationX(_p.getInteger("graduation.y.nb")); + } + if (_p.isDefined("graduation.y.visible")) { + setDrawY(_p.getBoolean("graduation.y.visible")); + } + if (_p.isDefined("graduation.x.visible")) { + setDrawX(_p.getBoolean("graduation.x.visible")); + } + if (_p.isDefined("grille.visible")) { + setDrawGrid(_p.getBoolean("grille.visible")); + } + } - private void grilleChanged() { - repaint(); - firePropertyChange("grille", true, false); - } + public void setNbGraduationX(final int _nbGraduationX) { + if (_nbGraduationX > 0 /* && nbGraduationX_ != _nbGraduationX */) { + nbGraduationX_ = _nbGraduationX; + modeLongueurPasX_ = false; + grilleChanged(); + } + } - @Override - public EbliUIProperties saveUIProperties() { - final EbliUIProperties res = super.saveUIProperties(); - res.put("graduation.x.nb", getNbXGraduations()); - res.put("graduation.y.nb", getNbYGraduations()); - res.put("graduation.x.visible", isDrawX()); - res.put("graduation.y.visible", isDrawY()); - res.put("grille.visible", isDrawGrid()); - return res; - } + public void setLenghtStepsX(final double _lenghtSteps) { + GrBoite boite = vue_.getViewBoite(); + if (_lenghtSteps == 0) + return; + double max = boite.getMaxX(); + int nbGraduationsX = (int) (max / _lenghtSteps); + if (nbGraduationsX + 1 > 0 /* && nbGraduationsX+1!=nbGraduationX_ */) { + nbGraduationX_ = nbGraduationsX; + valeurPasX_ = _lenghtSteps; + modeLongueurPasX_ = true; + grilleChanged(); + } - @Override - public void initFrom(EbliUIProperties _p) { - super.initFrom(_p); - if (_p.isDefined("graduation.x.nb")) { - setNbGraduationX(_p.getInteger("graduation.x.nb")); - } - if (_p.isDefined("graduation.y.nb")) { - setNbGraduationX(_p.getInteger("graduation.y.nb")); - } - if (_p.isDefined("graduation.y.visible")) { - setDrawY(_p.getBoolean("graduation.y.visible")); - } - if (_p.isDefined("graduation.x.visible")) { - setDrawX(_p.getBoolean("graduation.x.visible")); - } - if (_p.isDefined("grille.visible")) { - setDrawGrid(_p.getBoolean("grille.visible")); - } - } + } - public void setNbGraduationX(final int _nbGraduationX) { - if (_nbGraduationX > 0 /* && nbGraduationX_ != _nbGraduationX */) { - nbGraduationX_ = _nbGraduationX; - modeLongueurPasX_ = false; - grilleChanged(); - } - } + public void setLenghtStepsY(final double _lenghtSteps) { + GrBoite boite = vue_.getViewBoite(); + if (_lenghtSteps == 0) + return; + int nbGraduationsY = (int) (boite.getMaxY() / _lenghtSteps); + if (nbGraduationsY > 0 /* && nbGraduationsY!=nbGraduationY_ */) { + nbGraduationY_ = nbGraduationsY; + valeurPasY_ = _lenghtSteps;... [truncated message content] |
From: <had...@us...> - 2009-02-05 18:18:55
|
Revision: 4442 http://fudaa.svn.sourceforge.net/fudaa/?rev=4442&view=rev Author: hadouxad Date: 2009-02-05 18:18:47 +0000 (Thu, 05 Feb 2009) Log Message: ----------- - calques destructibles (trajectoires, trace de courbes, cr?\195?\169ation depuis option origine du graphe) - cr?\195?\169ation de groupes pour rangement des traces de calques - ihm grilles et sous grilles graphe: sch?\195?\169ma des vues 2d - Refactorisation des algos de calculs fixes nb graduations et longueur de pas sous forme d iterator. - Grilles et sous grilles des graphes: - mode par nombre de graduations - mode par longueur de pas - ajout des tracelignemodel pour les 2 type de trac?\195?\169s - Utilisation des bselecteurs interfaces - Grilles et sous grilles des vues 2d - ajout des traceligne model pour les 2 versions - Wizard: - Texte avec case a cocher - Case par default a false - Undo/redo op?\195?\169rationnels pour les superposition des frames. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/DateIterator.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIterator.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/TickIterator.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIteratorGraduationsFixe.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIteratorPasFixe.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/DateIterator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/DateIterator.java 2009-02-05 11:53:41 UTC (rev 4441) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/DateIterator.java 2009-02-05 18:18:47 UTC (rev 4442) @@ -763,4 +763,10 @@ return buf.toString(); } + +public void init(double _min, double _max, double pasDeTemps) { +init(_min, _max, (int)pasDeTemps); + +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIterator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIterator.java 2009-02-05 11:53:41 UTC (rev 4441) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIterator.java 2009-02-05 18:18:47 UTC (rev 4442) @@ -288,6 +288,9 @@ iterationDone_ = 0; } + public void init(double _min,double _max, double pasDeTemps){} + + public final Object clone() throws CloneNotSupportedException{ final NumberIterator res=(NumberIterator )super.clone(); res.initFrom(this); Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIteratorGraduationsFixe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIteratorGraduationsFixe.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIteratorGraduationsFixe.java 2009-02-05 18:18:47 UTC (rev 4442) @@ -0,0 +1,151 @@ +package org.fudaa.ctulu.iterator; + +import java.text.DecimalFormat; + +/** + * Un iterator qui cree une grille avec exactement le meme nombre de graduations que sp\xE9cifi\xE9es. + * @author Adrien Hadoux + * + */ +public class NumberIteratorGraduationsFixe implements TickIterator { + /** + * Pour eviter les loop infinie. + */ + private static final int MAX_ITERATION = 500; + + /** + * Le nombre de graduations totales a ne pas d\xE9passer + */ + int nbGraduations_=10; + double min_; + double max_; + + /** + * Indice courant de la graduation. + */ + int current_=0; + + + /** + * La valeur de la droite de la grille + */ + double value_; + + + public NumberIteratorGraduationsFixe(){ + + } + + public String currentLabel() { + DecimalFormat df = new DecimalFormat("#.0"); + String currentLabel; + currentLabel = df.format(value_); + String chiffreApresVirgule = currentLabel.substring(currentLabel + .lastIndexOf(",") + 1); + if (chiffreApresVirgule.equals("0")) + currentLabel = "" + (int) value_; + return currentLabel; + } + + + public double currentPosition() { + + return current_; + } + + + public double currentValue() { + + return value_; + } + + public Object clone() throws CloneNotSupportedException{ + return null; + } + + + public String formatSubValue(double _v) { + + return null; + } + + + public String formatValue(double _v) { + + return null; + } + + + public double getIncrement() { + + return current_; + } + + + public double getPositionFromValue(double _v) { + + return 0; + } + + + public double getValueFromPosition(double _v) { + + return 0; + } + + + public boolean hasNext() { + if(current_>MAX_ITERATION) + return false; + if(current_<nbGraduations_ ){ + current_++; + return true; + } + return false; + } + + + public void init(double _min, double _max, int iteration) { + min_=_min; + max_=_max; + //-- nb iterations + 1 car utilise une graduation confondue --// + nbGraduations_=iteration+1; + current_=0; + value_=_min; + + + } + + public void init(double _min,double _max, double pasDeTemps){} + + + public boolean isMajorTick() { + // TODO Auto-generated method stub + return true; + } + + + public void next() { + + double distance = max_ - min_;// e + double taillePas = (distance / (nbGraduations_-1)); + + value_= (min_ + (taillePas * (current_))); + + } + + + + + public void nextMajor() { + // TODO Auto-generated method stub + next(); + } + + + public void rewind() { + current_--; + + } + +} Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIteratorPasFixe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIteratorPasFixe.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/NumberIteratorPasFixe.java 2009-02-05 18:18:47 UTC (rev 4442) @@ -0,0 +1,163 @@ +package org.fudaa.ctulu.iterator; + +import java.text.DecimalFormat; + +/** +* Un iterator qui cree une grille avec exactement les graduations avec la m\xEAme longueur sp\xE9cifi\xE9es. +* @author Adrien Hadoux +* +*/ +public class NumberIteratorPasFixe implements TickIterator { + /** + * Pour eviter les loop infinie. + */ + private static final int MAX_ITERATION = 500; + + /** + * La longueur totale a ne pas depasser + */ + double longueurPas_; + double min_; + double max_; + + /** + * Le nombre de graduations total a r\xE9aliser est n\xE9cessaire pour indiquer qu'il prendre en compte le dernier trait m\xEAme si il d\xE9passe de la vue (si taille pas proportionnelle a longueur pas) + * Super utile pour les sous graduations + */ + int nbGraduations_; + + /** + * Indice courant de la graduation. + */ + int current_=0; + + + /** + * La valeur de la graduation + */ + double value_; + + + public NumberIteratorPasFixe(){ + + } + + public String currentLabel() { + DecimalFormat df = new DecimalFormat("#.0"); + String currentLabel; + currentLabel = df.format(value_); + String chiffreApresVirgule = currentLabel.substring(currentLabel + .lastIndexOf(",") + 1); + if (chiffreApresVirgule.equals("0")) + currentLabel = "" + (int) value_; + return currentLabel; + } + + + public double currentPosition() { + + return current_; + } + + + public double currentValue() { + + return value_; + } + + public Object clone() throws CloneNotSupportedException{ + return null; + } + + + public String formatSubValue(double _v) { + + return null; + } + + + public String formatValue(double _v) { + + return null; + } + + + public double getIncrement() { + + return current_; + } + + + public double getPositionFromValue(double _v) { + + return 0; + } + + + public double getValueFromPosition(double _v) { + + return 0; + } + + + public boolean hasNext() { + if(current_>MAX_ITERATION) + return false; + //-- Il faut penser a ses petits (les sous graduations)--// + if( current_==nbGraduations_-1 && value_<max_ ){ + nbGraduations_++; + } + + + if(current_<nbGraduations_){ + current_++; + return true; + } + return false; + } + + + public void init(double _min, double _max, int iteration) { + init(_min,_max,new Double(iteration).doubleValue()); + + } + + + public void init(double _min,double _max, double pasDeTemps){ + min_=_min; + max_=_max; + longueurPas_=pasDeTemps; + current_=0; + value_=_min; + //-- nb iterations + 1 car utilise une graduation confondue --// + + nbGraduations_=(int) ((max_ - min_)/longueurPas_)+1; + + } + + public boolean isMajorTick() { + // TODO Auto-generated method stub + return true; + } + + + public void next() { + + value_= min_ + (longueurPas_ * (current_)); + + + } + + + public void nextMajor() { + // TODO Auto-generated method stub + next(); + } + + + public void rewind() { + current_--; + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/TickIterator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/TickIterator.java 2009-02-05 11:53:41 UTC (rev 4441) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/iterator/TickIterator.java 2009-02-05 18:18:47 UTC (rev 4442) @@ -121,7 +121,7 @@ double getIncrement(); void init(double _min,double _max, int _nbIteration); - + void init(double _min,double _max, double pasDeTemps); double getValueFromPosition(double _v); double getPositionFromValue(double _v); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fa...@us...> - 2009-02-05 12:22:33
|
Revision: 4441 http://fudaa.svn.sourceforge.net/fudaa/?rev=4441&view=rev Author: fargeix Date: 2009-02-05 11:53:41 +0000 (Thu, 05 Feb 2009) Log Message: ----------- Mise ?\195?\160 jour Fudaa-Prepro v0.94 Modified Paths: -------------- trunk/fudaa_devel/aide/src/prepro/src/web/inc.history.en.html trunk/fudaa_devel/aide/src/prepro/src/web/inc.history.fr.html trunk/fudaa_devel/aide/src/prepro/src/web/inc.last-changelog.en.html trunk/fudaa_devel/aide/src/prepro/src/web/inc.last-changelog.fr.html trunk/fudaa_devel/aide/src/prepro/src/web/inc.news.en.html trunk/fudaa_devel/aide/src/prepro/src/web/inc.news.fr.html trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java trunk/fudaa_devel/fudaa-distrib/prepro/prepro.properties Modified: trunk/fudaa_devel/aide/src/prepro/src/web/inc.history.en.html =================================================================== --- trunk/fudaa_devel/aide/src/prepro/src/web/inc.history.en.html 2009-02-04 17:31:34 UTC (rev 4440) +++ trunk/fudaa_devel/aide/src/prepro/src/web/inc.history.en.html 2009-02-05 11:53:41 UTC (rev 4441) @@ -1,5 +1,6 @@ <div class="toc"> <ul> + <li><a href="#v093">Version 0.93 (2009-01-27)</a></li> <li><a href="#v092">Version 0.92 (2008-11-03)</a></li> <li><a href="#v091">Version 0.91 (2007-11-29)</a></li> <li><a href="#v090">Versions 0.90 (2007-09-18)</a></li> @@ -38,6 +39,15 @@ </div> +<h2 id="v093">Version 0.93 (2009-01-27)</h2> +<h3>Bugs corrected</h3> +<ul> + <li>error when trying to display node numbers</li> + <li>problems to select several layers at the same time</li> + <li>error while generating INP files (Reflux chain)</li> +</ul> + + <h2 id="v092">Version 0.92 (2008-11-03)</h2> <h3>Enhancements</h3> Modified: trunk/fudaa_devel/aide/src/prepro/src/web/inc.history.fr.html =================================================================== --- trunk/fudaa_devel/aide/src/prepro/src/web/inc.history.fr.html 2009-02-04 17:31:34 UTC (rev 4440) +++ trunk/fudaa_devel/aide/src/prepro/src/web/inc.history.fr.html 2009-02-05 11:53:41 UTC (rev 4441) @@ -1,5 +1,6 @@ <div class="toc"> <ul> + <li><a href="#v093">Version 0.93 (2009-01-27)</a></li> <li><a href="#v092">Version 0.92 (2008-11-03)</a></li> <li><a href="#v091">Version 0.91 (2007-11-29)</a></li> <li><a href="#v090">Version 0.90 (2007-09-18)</a></li> @@ -45,6 +46,14 @@ </div> +<h2 id="v093">Version 0.93 (2009-01-27)</h2> +<h3>Bogues corrig\xE9s</h3> +<ul> + <li>impossibilit\xE9 d'afficher les num\xE9ros de noeuds</li> + <li>impossibilit\xE9 de s\xE9lectionner plusieurs calques simultan\xE9ment</li> + <li>erreur \xE0 la g\xE9n\xE9ration de fichiers INP (chaine Reflux)</li> +</ul> + <h2 id="v092">Version 0.92 (2008-11-03)</h2> <h3>Am\xE9liorations</h3> <ul> Modified: trunk/fudaa_devel/aide/src/prepro/src/web/inc.last-changelog.en.html =================================================================== --- trunk/fudaa_devel/aide/src/prepro/src/web/inc.last-changelog.en.html 2009-02-04 17:31:34 UTC (rev 4440) +++ trunk/fudaa_devel/aide/src/prepro/src/web/inc.last-changelog.en.html 2009-02-05 11:53:41 UTC (rev 4441) @@ -2,7 +2,5 @@ <h3>Bugs corrected</h3> <ul> - <li>error when trying to display node numbers</li> - <li>problems to select several layers at the same time</li> - <li>error while generating INP files (Reflux chain)</li> + <li>error writing PREL information while generating INP files (Reflux chain)</li> </ul> \ No newline at end of file Modified: trunk/fudaa_devel/aide/src/prepro/src/web/inc.last-changelog.fr.html =================================================================== --- trunk/fudaa_devel/aide/src/prepro/src/web/inc.last-changelog.fr.html 2009-02-04 17:31:34 UTC (rev 4440) +++ trunk/fudaa_devel/aide/src/prepro/src/web/inc.last-changelog.fr.html 2009-02-05 11:53:41 UTC (rev 4441) @@ -2,7 +2,5 @@ <h2>Derni\xE8res modifications</h2> <h3>Bogues corrig\xE9s</h3> <ul> - <li>impossibilit\xE9 d'afficher les num\xE9ros de noeuds</li> - <li>impossibilit\xE9 de s\xE9lectionner plusieurs calques simultan\xE9ment</li> - <li>erreur \xE0 la g\xE9n\xE9ration de fichiers INP (chaine Reflux)</li> + <li>erreur \xE0 l'\xE9criture du bloc PREL lors de la g\xE9n\xE9ration de fichiers INP (chaine Reflux)</li> </ul> \ No newline at end of file Modified: trunk/fudaa_devel/aide/src/prepro/src/web/inc.news.en.html =================================================================== --- trunk/fudaa_devel/aide/src/prepro/src/web/inc.news.en.html 2009-02-04 17:31:34 UTC (rev 4440) +++ trunk/fudaa_devel/aide/src/prepro/src/web/inc.news.en.html 2009-02-05 11:53:41 UTC (rev 4441) @@ -11,6 +11,14 @@ </tr> <tr> <th colspan="1" rowspan="1"> + <p>2008-01-27</p> + </th> + <td colspan="1" rowspan="1"> + <p>New version: 0.93</p> + </td> + </tr> + <tr> + <th colspan="1" rowspan="1"> <p>2008-11-03</p> </th> <td colspan="1" rowspan="1"> Modified: trunk/fudaa_devel/aide/src/prepro/src/web/inc.news.fr.html =================================================================== --- trunk/fudaa_devel/aide/src/prepro/src/web/inc.news.fr.html 2009-02-04 17:31:34 UTC (rev 4440) +++ trunk/fudaa_devel/aide/src/prepro/src/web/inc.news.fr.html 2009-02-05 11:53:41 UTC (rev 4441) @@ -10,6 +10,14 @@ </tr> <tr> <th colspan="1" rowspan="1"> + <p>2008-01-27</p> + </th> + <td colspan="1" rowspan="1"> + <p>Nouvelle version: 0.93</p> + </td> + </tr> + <tr> + <th colspan="1" rowspan="1"> <p>2008-11-03</p> </th> <td colspan="1" rowspan="1"> Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2009-02-04 17:31:34 UTC (rev 4440) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2009-02-05 11:53:41 UTC (rev 4441) @@ -134,8 +134,8 @@ infoSoft = new BuInformationsSoftware(); infoSoft.name = "prepro"; - infoSoft.version = "0.93"; - infoSoft.date = "2009-01-27"; + infoSoft.version = "0.94"; + infoSoft.date = "2009-02-05"; infoSoft.rights = TrResource.getS("Tous droits r\xE9serv\xE9s") + ". CETMEF (c)2003-2009"; infoSoft.contact = "fre...@fu..."; infoSoft.license = "GPL2"; Modified: trunk/fudaa_devel/fudaa-distrib/prepro/prepro.properties =================================================================== --- trunk/fudaa_devel/fudaa-distrib/prepro/prepro.properties 2009-02-04 17:31:34 UTC (rev 4440) +++ trunk/fudaa_devel/fudaa-distrib/prepro/prepro.properties 2009-02-05 11:53:41 UTC (rev 4441) @@ -1,7 +1,7 @@ -@version@=0.93 -...@ve...le@=093 +@version@=0.94 +...@ve...le@=094 @exe.size@=22 Mo @jar.size@=22 Mo @jnlp.size@=13 Mo @zip.size@=22 Mo -@version.date@=2009-01-27 \ No newline at end of file +@version.date@=2009-02-05 \ 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...> - 2009-02-04 17:31:37
|
Revision: 4440 http://fudaa.svn.sourceforge.net/fudaa/?rev=4440&view=rev Author: bmarchan Date: 2009-02-04 17:31:34 +0000 (Wed, 04 Feb 2009) Log Message: ----------- Tache #156 : Ajout d'un sommet a l'extr?\195?\169mit?\195?\169 d'un polyligne Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueClickInteraction.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueClikInteractionListener.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardStepCalage.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarLimniSaisie.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageSaisie.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacSourceSaisie.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -116,29 +116,31 @@ } /** - * Ajoute un sommet a une g\xE9om\xE9trie. + * Ajoute un sommet a une g\xE9om\xE9trie. Les attributs atomiques sont ajout\xE9s au sommet ins\xE9r\xE9, par interpolation. * @param _idxGeom L'index de la g\xE9om\xE9trie - * @param _idxBefore L'indice du point juste avant. + * @param _idxBefore L'indice du point juste avant. Si _idxBefore est \xE9gal \xE0 -1, le point est ajout\xE9 en d\xE9but de g\xE9om\xE9trie * @param _x La coordonn\xE9e X du sommet ajout\xE9. - * @param _y LA coordonn\xE9e Y du sommet ajout\xE9. + * @param _y La coordonn\xE9e Y du sommet ajout\xE9. * @param _cmd Le manager de commandes. */ public void addAtomic(final int _idxGeom, final int _idxBefore, final double _x, final double _y, final CtuluCommandContainer _cmd) { + if (!isGeomModifiable_) { return; } Geometry geom = (Geometry)super.geometry_.getValueAt(_idxGeom); final Coordinate[] oldcs = geom.getCoordinates(); final int initSize = oldcs.length; - if(_idxBefore<0||_idxBefore>=initSize) + if(_idxBefore<-1||_idxBefore>=initSize) throw new IllegalArgumentException("L'index du point \xE0 ajouter doit appartenir \xE0 la g\xE9om\xE9trie."); final Coordinate[] cs = new Coordinate[initSize + 1]; int idx = 0; - for (int i = 0; i < initSize; i++) { - cs[idx++] = (Coordinate)oldcs[i].clone(); + for (int i = -1; i < initSize; i++) { + if (i>=0) + cs[idx++] = (Coordinate)oldcs[i].clone(); if (i == _idxBefore) { - cs[idx++] = new Coordinate(_x, _y, oldcs[i].z); + cs[idx++] = new Coordinate(_x, _y, 0.); } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -82,7 +82,7 @@ newIdxOldIdx.put(idx,i); // Pour les attributs cs[idx++] = (Coordinate)oldcs[i].clone(); if (i == _idxBefore) { - cs[idx++] = new Coordinate(_x, _y, oldcs[i].z); + cs[idx++] = new Coordinate(_x, _y, 0); } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueClickInteraction.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueClickInteraction.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueClickInteraction.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -12,14 +12,20 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; +import org.fudaa.ebli.geometrie.GrPoint; + /** * @author Fred Deniger * @version $Id: ZCalqueClickInteraction.java,v 1.10.8.1 2008-03-27 15:26:28 bmarchan Exp $ */ public class ZCalqueClickInteraction extends BCalqueInteraction implements MouseListener, - MouseMotionListener { + MouseMotionListener, ZCatchListener { ZCalqueClikInteractionListener listener_; + /** Le point d'accrochage, ou null si pas de point d'accrochage */ + GrPoint ptAccroch_=null; + /** Le point interm\xE9diaire */ + GrPoint ptTmp_=new GrPoint(); public ZCalqueClickInteraction() { setName("cqInteractClicked"); @@ -48,7 +54,14 @@ public void mouseClicked(final MouseEvent _e){ if (isOkLeftEvent(_e) && (listener_ != null)) { - listener_.pointClicked(_e.getX(), _e.getY()); + if (ptAccroch_==null) { + ptTmp_.setCoordonnees(_e.getX(), _e.getY(),0); + ptTmp_.autoApplique(getVersReel()); + } + else { + ptTmp_.setCoordonnees(ptAccroch_.x_, ptAccroch_.y_, ptAccroch_.z_); + } + listener_.pointClicked(ptTmp_); } } @@ -67,4 +80,11 @@ public final void setListener(final ZCalqueClikInteractionListener _listener){ listener_ = _listener; } + + public void catchChanged(ZCatchEvent _evt) { + if (_evt.type==ZCatchEvent.UNCAUGHT) + ptAccroch_=null; + else + ptAccroch_=_evt.selection.getScene().getVertex(_evt.idxGeom, _evt.idxVertex); + } } \ No newline at end of file Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueClikInteractionListener.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueClikInteractionListener.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueClikInteractionListener.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -7,13 +7,20 @@ */ package org.fudaa.ebli.calque; +import org.fudaa.ebli.geometrie.GrPoint; + /** + * Un listener du calque {@link ZCalqueClickInteraction}. * @author Fred Deniger * @version $Id: ZCalqueClikInteractionListener.java,v 1.4 2006-04-12 15:27:10 deniger Exp $ */ public interface ZCalqueClikInteractionListener { - void pointClicked(int _xEcran,int _yEcran); + /** + * Le point 3D saisi (la coordonn\xE9e Z peut provenir d'un sommet accroch\xE9), en coordonn\xE9es r\xE9elles. + * @param _ptReel Le point saisi. + */ + void pointClicked(GrPoint _ptReel); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -17,6 +17,8 @@ import org.fudaa.ebli.calque.BCalqueInteraction; import org.fudaa.ebli.calque.ZScene; +import org.fudaa.ebli.calque.ZSelectionEvent; +import org.fudaa.ebli.calque.ZSelectionListener; import org.fudaa.ebli.calque.edition.BPaletteEdition; import org.fudaa.ebli.calque.edition.ZCalqueEditable; import org.fudaa.ebli.calque.edition.ZCalqueEditionInteraction; @@ -30,7 +32,7 @@ * @author Fred Deniger * @version $Id: CalqueGISEditionAction.java,v 1.6.6.2 2008-05-13 12:10:47 emartin Exp $ */ -public class CalqueGISEditionAction extends EbliActionPaletteTreeModel implements PropertyChangeListener { +public class CalqueGISEditionAction extends EbliActionPaletteTreeModel implements PropertyChangeListener, ZSelectionListener { private ZEditorDefault editor_; private ZScene scene_; @@ -61,6 +63,7 @@ setEnabled(isTargetValid(null)); setResizable(true); target_ = (target_ instanceof ZCalqueEditable)?target_:null; + _scene.addSelectionListener(this); } protected boolean isTargetValid(final Object _o) { @@ -167,4 +170,13 @@ if(editor_.getPanel().getController().getCqSelectionI()!=null) editor_.getPanel().getController().getCqSelectionI().setGele(false); } + + /* (non-Javadoc) + * @see org.fudaa.ebli.calque.ZSelectionListener#selectionChanged(org.fudaa.ebli.calque.ZSelectionEvent) + */ + public void selectionChanged(ZSelectionEvent _evt) { + if (editor_!=null) { + editor_.updatePaletteWhenSelectionChanged(); + } + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -301,7 +301,7 @@ _target.add(null); bt = new BuToolToggleButton(); bt.setActionCommand("ATOME_ADD"); - bt.setToolTipText(EbliLib.getS("Ajouter un sommet (la g\xE9om\xE9trie doit \xEAtre s\xE9lectionn\xE9e)")); + bt.setToolTipText(EbliLib.getS("Ajouter un sommet (une g\xE9om\xE9trie, un sommet extr\xE9mit\xE9 ou 2 sommets cons\xE9cutifs doivent \xEAtre s\xE9lectionn\xE9s)")); bt.setIcon(EbliResource.EBLI.getToolIcon("node-add")); decoreButton(bt); group.add(bt); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueEditable.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueEditable.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -14,6 +14,7 @@ import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.geometrie.GrObjet; +import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.trace.TraceIcon; /** @@ -103,13 +104,12 @@ * Ajoute un sommet a l'objet selectionn\xE9. Si le nombre d'objets selectionn\xE9s est diff\xE9rent de 1, * le point n'est pas ajout\xE9. * - * @param _xEcran le x ecran de l'atome a ajouter - * @param _yEcran le y ecran de l'atome a ajouter + * @param _ptReel le point 3D r\xE9el de l'atome a ajouter * @param _cmd le receveur de command * @param _ui l'interface utilisateur * @return true si atome ajoute */ - boolean addAtome(int _xEcran,int _yEcran,CtuluCommandContainer _cmd, CtuluUI _ui); + boolean addAtome(GrPoint _ptReel, CtuluCommandContainer _cmd, CtuluUI _ui); /** * @return true si le mode atomique est autorise */ Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -15,7 +15,6 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluUI; -import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ebli.calque.ZCalqueLigneBrisee; import org.fudaa.ebli.calque.ZModeleLigneBrisee; import org.fudaa.ebli.calque.dessin.DeForme; @@ -53,10 +52,6 @@ return editor_ == null ? EbliLib.getS("Edition impossible") : editor_.edit(); } - private void addPoint(final int _ligneIdx, final int _idxBefore, final double _x, final double _y, final CtuluCommandContainer _cmd) { - getModelePoly().addPoint(_ligneIdx, _idxBefore, _x, _y, _cmd); - } - /** * Scinde en 2 une polyligne dont deux sommets cons\xE9cutifs sont s\xE9lectionn\xE9. Les attributs sont copi\xE9s. * @param _cmd La pile de commandes. @@ -162,45 +157,93 @@ } } - public boolean addAtome(final int _xEcran, final int _yEcran, final CtuluCommandContainer _cmd, final CtuluUI _ui) { - if (isAtomicMode() || getNbSelected()!=1) return false; + /** + * Ajoute un sommet a l'objet selectionn\xE9. Le sommet peut \xEAtre ajout\xE9 en bout de ligne, si un point extremit\xE9 est selectionn\xE9, + * ou bien inser\xE9 si 2 sommets s\xE9lectionn\xE9s. + * + * Si le nombre d'objets selectionn\xE9s est diff\xE9rent de 1, le point n'est pas ajout\xE9. + * + * @param _ptReel le point 3D r\xE9el de l'atome a ajouter + * @param _cmd le receveur de command + * @param _ui l'interface utilisateur + * @return true si atome ajoute + */ + public boolean addAtome(final GrPoint _ptReel, final CtuluCommandContainer _cmd, final CtuluUI _ui) { + if (getNbSelected()!=1) return false; +// if (isAtomicMode() || getNbSelected()!=1) return false; - final GrMorphisme versEcran = getVersEcran(); - final GrMorphisme versReel = getVersReel(); - final GrBoite bClip = getDomaine(); - bClip.autoApplique(versEcran); - final int tolerance = 5; - // Point \xE0 projeter - final GrPoint pt = new GrPoint(_xEcran, _yEcran, 0); - if ((!bClip.contientXY(pt)) && (bClip.distanceXY(pt) > tolerance)) { - return false; + if (isAtomicMode()) { + int idxGeom=selectionMulti_.getIdxSelected()[0]; + int idxBefore; + + if (selectionMulti_.getNbSelectedItem()==1) { + // Cas d'un polygone => Interdit d'ajouter un point en fin de g\xE9om\xE9trie. + if (getModelePoly().isGeometryFermee(idxGeom)) return false; + + if (selectionMulti_.getSelection(idxGeom).getMinIndex()==0) + idxBefore=-1; + else if (selectionMulti_.getSelection(idxGeom).getMaxIndex()==getModelePoly().getGeomData().getGeometry(idxGeom).getNumPoints()-1) + idxBefore=selectionMulti_.getSelection(idxGeom).getMaxIndex(); + else + return false; + } + else if (selectionMulti_.getNbSelectedItem()==2) { + if (selectionMulti_.getSelection(idxGeom).getMaxIndex()==selectionMulti_.getSelection(idxGeom).getMinIndex()+1) + idxBefore=selectionMulti_.getSelection(idxGeom).getMinIndex(); + else + return false; + } + else { + return false; + } + + getModelePoly().addPoint(idxGeom,idxBefore, _ptReel.x_, _ptReel.y_, _ptReel.z_, _cmd); + return true; } - final double distanceReel = GrMorphisme.convertDistanceXY(versReel, tolerance); - final GrPoint ptToTest = pt.applique(versReel); - final GrSegment seg = new GrSegment(new GrPoint(), new GrPoint()); - final GrBoite bPoly = new GrBoite(new GrPoint(), new GrPoint()); - int i=selection_.getMinIndex(); - modele_.getDomaineForGeometry(i, bPoly); - if (bPoly.contientXY(ptToTest)||bPoly.distanceXY(ptToTest)<distanceReel) { - for (int j=modele_.getNbPointForGeometry(i)-1; j>0; j--) { - modele_.point(seg.e_, i, j); - modele_.point(seg.o_, i, j-1); - if (seg.distanceXY(ptToTest)<distanceReel) { - addPoint(i, j-1, ptToTest.x_, ptToTest.y_, _cmd); - return true; - } + // En mode non atomique, le point ajout\xE9 est obligatoirement sur la polyligne. + else { + final GrMorphisme versEcran=getVersEcran(); + final GrMorphisme versReel=getVersReel(); + final GrBoite bClip=getDomaine(); + bClip.autoApplique(versEcran); + final int tolerance=5; + // Point \xE0 projeter + // final GrPoint pt = new GrPoint(_xEcran, _yEcran, 0); + final GrPoint ptEcran=_ptReel.applique(versEcran); + if ((!bClip.contientXY(ptEcran))&&(bClip.distanceXY(ptEcran)>tolerance)) { + return false; } - if (modele_.isGeometryFermee(i)) { - modele_.point(seg.e_, i, 0); - modele_.point(seg.o_, i, modele_.getNbPointForGeometry(i)-1); - if (seg.distanceXY(ptToTest)<distanceReel) { - addPoint(i, modele_.getNbPointForGeometry(i)-1, ptToTest.x_, ptToTest.y_, _cmd); - return true; + + final double distanceReel=GrMorphisme.convertDistanceXY(versReel, tolerance); + // final GrPoint _ptReel = pt.applique(versReel); + final GrSegment seg=new GrSegment(new GrPoint(), new GrPoint()); + final GrBoite bPoly=new GrBoite(new GrPoint(), new GrPoint()); + + int i=selection_.getMinIndex(); + modele_.getDomaineForGeometry(i, bPoly); + if (bPoly.contientXY(_ptReel)||bPoly.distanceXY(_ptReel)<distanceReel) { + for (int j=modele_.getNbPointForGeometry(i)-1; j>0; j--) { + modele_.point(seg.e_, i, j); + modele_.point(seg.o_, i, j-1); + if (seg.distanceXY(_ptReel)<distanceReel) { + GrPoint ptOnSeg=seg.pointPlusProcheXY(_ptReel); + getModelePoly().addPoint(i, j-1, ptOnSeg.x_, ptOnSeg.y_, null, _cmd); + return true; + } } + if (modele_.isGeometryFermee(i)) { + modele_.point(seg.e_, i, 0); + modele_.point(seg.o_, i, modele_.getNbPointForGeometry(i)-1); + if (seg.distanceXY(_ptReel)<distanceReel) { + GrPoint ptOnSeg=seg.pointPlusProcheXY(_ptReel); + getModelePoly().addPoint(i, modele_.getNbPointForGeometry(i)-1, ptOnSeg.x_, ptOnSeg.y_, null, _cmd); + return true; + } + } } + return false; } - return false; } public boolean addForme(final GrObjet _o, final int _deforme, final CtuluCommandContainer _cmd, final CtuluUI _ui, Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -15,6 +15,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface; import org.fudaa.ctulu.gis.GISGeometryFactory; import org.fudaa.ctulu.gis.GISMultiPoint; @@ -88,19 +89,17 @@ // return getModelePoly().joinGeometries(idxLines, idxSels, _cmd)!=-1; // } - public boolean addAtome(final int _xEcran, final int _yEcran, final CtuluCommandContainer _cmd, final CtuluUI _ui) { - if (isAtomicMode() || getNbSelected()!=1) return false; + public boolean addAtome(final GrPoint _ptReel, final CtuluCommandContainer _cmd, final CtuluUI _ui) { + if (getNbSelected()!=1) return false; - final GrMorphisme versEcran = getVersEcran(); - final GrMorphisme versReel = getVersReel(); - - final GrBoite bClip = getDomaineOnSelected(); - bClip.autoApplique(versEcran); - final GrPoint pt = new GrPoint(_xEcran, _yEcran, 0); - final GrPoint ptToTest = pt.applique(versReel); - - int idx=selection_.getMinIndex(); - ((ZModeleMultiPointEditable)modele_).addAtomic(idx,0, ptToTest.x_, ptToTest.y_, _cmd); + int idx; + if (isAtomicMode()) + idx=selectionMulti_.getIdxSelected()[0]; + else + idx=selection_.getMinIndex(); + + int idxBefore=modeleDonnees().getGeomData().getGeometry(idx).getNumGeometries()-1; + ((ZModeleMultiPointEditable)modele_).addAtomic(idx,idxBefore, _ptReel.x_, _ptReel.y_, _ptReel.z_, _cmd); return true; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -21,7 +21,6 @@ import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.gis.GISAttributeInterface; -import org.fudaa.ctulu.gis.GISAttributeModel; import org.fudaa.ctulu.gis.GISZoneCollection; import org.fudaa.ebli.calque.ZCalquePoint; @@ -105,7 +104,7 @@ editor_ = _editor; } - public boolean addAtome(final int _xEcran, final int _yEcran, final CtuluCommandContainer _cmd, final CtuluUI _ui) { + public boolean addAtome(final GrPoint _ptReel, final CtuluCommandContainer _cmd, final CtuluUI _ui) { return false; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -24,12 +24,15 @@ import javax.swing.KeyStroke; import javax.swing.SwingUtilities; +import org.fudaa.ctulu.CtuluCommandComposite; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluCommandPersitant; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface; import org.fudaa.ctulu.gis.GISGuiBuilder; +import org.fudaa.ctulu.gis.GISMultiPoint; import org.fudaa.ctulu.gis.GISZoneCollectionPoint; import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.ctulu.gui.CtuluLibSwing; @@ -41,6 +44,7 @@ import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.calque.ZModeleGeometry; import org.fudaa.ebli.calque.ZScene; +import org.fudaa.ebli.calque.ZScene.SceneSelectionHelper; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionSimple; @@ -50,6 +54,7 @@ import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.geometrie.GrPolygone; import org.fudaa.ebli.geometrie.GrPolyligne; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.trace.TraceIcon; import com.memoire.bu.BuDesktop; @@ -80,11 +85,16 @@ class NodeAddListener implements ZCalqueClikInteractionListener { - public void pointClicked(final int _xEcran, final int _yEcran) { + public void pointClicked(GrPoint _ptReel) { if (getSupport().canUseAtomicMode()) { int idGeom=getSupport().getSelectionHelper().getUniqueSelectedIdx(); - if(idGeom!=-1) - ((ZCalqueEditable)getSupport().getLayerForId(idGeom)).addAtome(_xEcran, _yEcran, mng_, null); + if(idGeom!=-1) { + CtuluCommandComposite cmp=new CtuluCommandComposite(EbliLib.getS("Ajout d'un sommet")); + if (((ZCalqueEditable)getSupport().getLayerForId(idGeom)).addAtome(_ptReel, cmp, null)) { + if (mng_!=null) + mng_.addCmd(cmp.getSimplify()); + } + } } } } @@ -344,7 +354,8 @@ palette_.setEnable("GLOBAL_ADD_SEMIS", target_.canAddForme(DeForme.MULTI_POINT) && isModifiable); } -// updatePaletteState(); + + updatePaletteWhenSelectionChanged(); palette_.checkEnableAndCheckBt(); final AbstractButton bt = palette_.getSelectedButton(); if (bt == null) { @@ -353,7 +364,40 @@ changeState(bt.getActionCommand()); } } + + public void updatePaletteWhenSelectionChanged() { + if (palette_==null) return; + + ZScene scn=getSupport(); + SceneSelectionHelper hlp=scn.getSelectionHelper(); + int idGeom=-1; + boolean b=true; + // Si la selection est sur le m\xEAme objet. + b=b && (idGeom=hlp.getUniqueSelectedIdx())!=-1; + // Si le nombre d'atomiques est de 2 cons\xE9cutifs sur une g\xE9om\xE9trie de type polyligne. + if (b && scn.isAtomicMode()) { + if (scn.getObject(idGeom) instanceof GISCoordinateSequenceContainerInterface) { + GISCoordinateSequenceContainerInterface geom=(GISCoordinateSequenceContainerInterface)scn.getObject(idGeom); + if (!(geom instanceof GISMultiPoint)) { + if (hlp.getNbAtomicSelected()==1) { + b=b + &&(hlp.getUniqueAtomicSelection().getMinIndex()==0||hlp.getUniqueAtomicSelection().getMaxIndex()+1==geom + .getCoordinateSequence().size()); + } + else if (hlp.getNbAtomicSelected()==2) { + b=b&&Math.abs(hlp.getUniqueAtomicSelection().getMinIndex()-hlp.getUniqueAtomicSelection().getMaxIndex())==1; + } + else { + b=false; + } + } + } + } + + palette_.setEnable("ATOME_ADD", b); + } + protected boolean changeState(final String _s) { // Pas de changement: le cas null,null et meme etat if (_s == state_ || (_s != null && _s.equals(state_))) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -27,6 +27,7 @@ import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISAttributeDouble; import org.fudaa.ctulu.gis.GISAttributeInterface; import org.fudaa.ctulu.gis.GISAttributeModel; import org.fudaa.ctulu.gis.GISAttributeModelDoubleArray; @@ -271,20 +272,35 @@ CtuluLibString.DEUX); } - public void addPoint(final int _ligneIdx,final int _idxBefore,final double _x,final double _y,final CtuluCommandContainer _cmd){ + /** + * Ajoute un sommet 3D \xE0 une g\xE9om\xE9trie. + * @param _ligneIdx L'indice de la g\xE9om\xE9trie + * @param _idxBefore L'indice de sommet pr\xE9c\xE9dent pour l'insertion. Peut \xEAtre \xE9gal \xE0 -1. + * @param _x La coordonn\xE9e X du sommet \xE0 inserer + * @param _y La coordonn\xE9e Y du sommet \xE0 inserer + * @param _z La coordonn\xE9e Z du sommet \xE0 inserer. Peut \xEAtre null. Dans ce cas, le z est interpol\xE9 depuis les autres valeurs. + * @param _cmd Le container de commande. + */ + public void addPoint(final int _ligneIdx,final int _idxBefore,final double _x,final double _y,final Double _z,final CtuluCommandContainer _cmd){ if (geometries_ == null) { return; } - final CoordinateSequence g = ((LineString) geometries_.getGeometry(_ligneIdx)) - .getCoordinateSequence(); + + CtuluCommandComposite cmp=new CtuluCommandComposite(); + // Modification de l'\xE9tat de la g\xE9om\xE9trie - setGeomModif(_ligneIdx, _cmd); - // Cr\xE9ation du segment d\xE9fini par les deux point de la forme - // Construction du point projet\xE9 grace \xE0 'pointPlusProche' - GrPoint point = (new GrSegment(new GrPoint(g.getX(_idxBefore), g.getY(_idxBefore), 0), - new GrPoint(g.getX(_idxBefore + 1), g.getY(_idxBefore + 1), 0))) - .pointPlusProche(new GrPoint(_x, _y, 0)); - geometries_.addAtomic(_ligneIdx, _idxBefore, point.x_, point.y_, _cmd); + setGeomModif(_ligneIdx, cmp); + geometries_.addAtomic(_ligneIdx, _idxBefore, _x, _y, cmp); + + // Mise a jour du Z si necessaire. + GISAttributeInterface attZ=geometries_.getAttributeIsZ(); + if (_z!=null && attZ!=null && attZ.isAtomicValue()) { + GISAttributeModel md=(GISAttributeModel)geometries_.getModel(attZ).getObjectValueAt(_ligneIdx); + md.setObject(_idxBefore+1, _z, cmp); + } + + if (_cmd!=null) + _cmd.addCmd(cmp.getSimplify()); } /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -333,18 +333,32 @@ } /** - * Ajoute un sommet X,Y \xE0 la g\xE9om\xE9trie donn\xE9e.<p> + * Ajoute un sommet X,Y,Z \xE0 la g\xE9om\xE9trie donn\xE9e.<p> * <b>ATTENTION</b> : Les valeurs des attributs pour ce sommet sont d\xE9finies par d\xE9faut. * @param _idxGeom La g\xE9om\xE9trie modifi\xE9e. * @param _idxBefore Le sommet qui sera le pr\xE9cedent de celui ajout\xE9. * @param _x La coordonn\xE9e X du point. * @param _y La coordonn\xE9e Y du point. + * @param _z La coordonn\xE9e Z du point. * @param _cmd Le manager de commandes. */ - public void addAtomic(final int _idxGeom,final int _idxBefore,final double _x,final double _y,final CtuluCommandContainer _cmd){ + public void addAtomic(final int _idxGeom,final int _idxBefore,final double _x,final double _y, final double _z,final CtuluCommandContainer _cmd){ if (geometries_ == null) return; + + CtuluCommandComposite cmp=new CtuluCommandComposite(); + setGeomModif(_idxGeom, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie geometries_.addAtomic(_idxGeom, _idxBefore, _x, _y, _cmd); + + // Mise a jour du Z si necessaire. + GISAttributeInterface attZ=geometries_.getAttributeIsZ(); + if (attZ!=null && attZ.isAtomicValue()) { + GISAttributeModel md=(GISAttributeModel)geometries_.getModel(attZ).getObjectValueAt(_idxGeom); + md.setObject(_idxBefore+1, _z, cmp); + } + + if (_cmd!=null) + _cmd.addCmd(cmp.getSimplify()); } protected GISZoneCollectionMultiPoint createCollection(){ Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -192,8 +192,8 @@ palette_.setEnable("GLOBAL_ADD_ELLIPSE", target_.canAddForme(DeForme.ELLIPSE) && isModifiable); palette_.setEnable("GLOBAL_ADD_POLYGONE", target_.canAddForme(DeForme.POLYGONE) && isModifiable); palette_.setEnable("GLOBAL_ADD_SEMIS", target_.canAddForme(DeForme.MULTI_POINT) && isModifiable); - } + updatePaletteWhenSelectionChanged(); palette_.checkEnableAndCheckBt(); final AbstractButton bt = palette_.getSelectedButton(); if (bt == null) { @@ -202,5 +202,4 @@ changeState(bt.getActionCommand()); } } - } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardStepCalage.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardStepCalage.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardStepCalage.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -30,7 +30,6 @@ import org.fudaa.ctulu.image.RasterDataInterface; import org.fudaa.ebli.calque.BVueCalque; -import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.calque.ZCalqueClickInteraction; import org.fudaa.ebli.calque.ZCalqueClikInteractionListener; import org.fudaa.ebli.calque.ZCalqueImageRaster; @@ -94,8 +93,8 @@ calqueClickInteraction_ = new ZCalqueClickInteraction(); calqueClickInteraction_.setListener(new ZCalqueClikInteractionListener() { - public void pointClicked(final int _xEcran, final int _yEcran) { - mouseClickedOnReal(_xEcran, _yEcran); + public void pointClicked(final GrPoint _ptReel) { + mouseClickedOnReal(_ptReel); } @@ -201,19 +200,11 @@ return FSigLib.getS("G\xE9or\xE9f\xE9rencer l'image"); } - GrPoint reel_; - - public void pointClicked(final int _xEcran, final int _yEcran) { + public void pointClicked(final GrPoint _ptReel) { if (click_.isGele()) { return; } - if (reel_ == null) { - reel_ = new GrPoint(); - } - reel_.setCoordonnees(_xEcran, _yEcran, 0); - reel_.autoApplique(image_.getVersReel()); - control_.ptClickedInImg((int) reel_.x_, (int) reel_.y_); - + control_.ptClickedInImg((int) _ptReel.x_, (int) _ptReel.y_); } public void restaurer() { @@ -243,13 +234,8 @@ // cqDest_.setCalqueInteractionActif(calqueClickInteraction_); } - public void mouseClickedOnReal(final int _x, final int _y) { - if (reel_ == null) { - reel_ = new GrPoint(); - } - reel_.setCoordonnees(_x, _y, 0); - reel_.autoApplique(cqDest_.getVueCalque().getVersReel()); - control_.ptClickedInReel(reel_.x_, reel_.y_); + public void mouseClickedOnReal(final GrPoint _ptReel) { + control_.ptClickedInReel(_ptReel.x_, _ptReel.y_); } public void setRasterData(final RasterDataInterface _data) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarLimniSaisie.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarLimniSaisie.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarLimniSaisie.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -7,8 +7,6 @@ */ package org.fudaa.fudaa.tr.rubar; -import com.vividsolutions.jts.geom.Coordinate; - import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ebli.calque.ZCalquePoint; @@ -32,14 +30,10 @@ super(_pn, _layer); } - GrPoint pt_ = new GrPoint(); - Coordinate m_ = new Coordinate(); - public void pointClicked(final int _xEcran,final int _yEcran){ - pt_.setCoordonnees(_xEcran, _yEcran, 0); - pt_.autoApplique(layer_.getVersReel()); + public void pointClicked(final GrPoint _ptReel){ final TrRubarLimniModel model = (TrRubarLimniModel) layer_.modeleDonnees(); - final int idxToAdd = model.mng_.getEltContaining(pt_.x_, pt_.y_); + final int idxToAdd = model.mng_.getEltContaining(_ptReel.x_, _ptReel.y_); if (idxToAdd < 0) { super.errMessage(TrResource.getS("Le point n'appartient pas \xE0 un \xE9l\xE9ment")); return; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageSaisie.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageSaisie.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/rubar/TrRubarOuvrageSaisie.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -166,20 +166,24 @@ } } - public void pointClicked(final int _xEcran, final int _yEcran) { + public void pointClicked(final GrPoint _ptReel) { + _ptReel.autoApplique(layer_.getVersEcran()); + final int xEcran=(int)_ptReel.x_; + final int yEcran=(int)_ptReel.y_; + boolean ok = false; switch (step_) { case 0: - ok = pointClickedElt1(_xEcran, _yEcran); + ok = pointClickedElt1(xEcran, yEcran); break; case 1: - ok = pointClickedArete1(_xEcran, _yEcran); + ok = pointClickedArete1(xEcran, yEcran); break; case 2: - ok = pointClickedElt2(_xEcran, _yEcran); + ok = pointClickedElt2(xEcran, yEcran); break; case 3: - ok = pointClickedArete2(_xEcran, _yEcran); + ok = pointClickedArete2(xEcran, yEcran); break; default: Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacSourceSaisie.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacSourceSaisie.java 2009-02-04 12:21:32 UTC (rev 4439) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacSourceSaisie.java 2009-02-04 17:31:34 UTC (rev 4440) @@ -46,13 +46,11 @@ add(bt_); } - public void pointClicked(final int _xEcran,final int _yEcran){ + public void pointClicked(final GrPoint _ptReel){ if (!editor_.valide()) { return; } - final GrPoint p = new GrPoint(_xEcran, _yEcran, 0); - p.autoApplique(nodes_.getVersReel()); - final int i = ZCalquePoint.getSelectedPoint(nodes_.modele(), p, 5, nodes_.getVersReel(), pn_.getVueCalque().getViewBoite()); + final int i = ZCalquePoint.getSelectedPoint(nodes_.modele(), _ptReel, 5, nodes_.getVersReel(), pn_.getVueCalque().getViewBoite()); if (i < 0) { infoLabel_.setText(TrResource.getS("Aucun noeud trouv\xE9")); return; @@ -63,11 +61,11 @@ infoLabel_.setText(TrResource.getS("Noeud fronti\xE8re non autoris\xE9")); return; } - nodes_.modele().point(p, i, true); + nodes_.modele().point(_ptReel, i, true); final H2dTelemacSourceMng mng = ((TrTelemacSourceLayer) layer_).getNodeModel().getMng(); final String[] val = editor_.getValues(); - val[0] = CtuluLib.DEFAULT_NUMBER_FORMAT.format(p.x_); - val[1] = CtuluLib.DEFAULT_NUMBER_FORMAT.format(p.y_); + val[0] = CtuluLib.DEFAULT_NUMBER_FORMAT.format(_ptReel.x_); + val[1] = CtuluLib.DEFAULT_NUMBER_FORMAT.format(_ptReel.y_); mng.addSource(val, pn_.getCmdMng()); pointAjouteOk(val[0], val[1]); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fa...@us...> - 2009-02-04 12:21:39
|
Revision: 4439 http://fudaa.svn.sourceforge.net/fudaa/?rev=4439&view=rev Author: fargeix Date: 2009-02-04 12:21:32 +0000 (Wed, 04 Feb 2009) Log Message: ----------- Fudaa-Prepro/Reflux: Correction d'un bug lors de l'?\195?\169criture du bloc PREL Modified Paths: -------------- trunk/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPWriterV5P0.java Modified: trunk/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPWriterV5P0.java =================================================================== --- trunk/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPWriterV5P0.java 2009-02-03 19:44:50 UTC (rev 4438) +++ trunk/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPWriterV5P0.java 2009-02-04 12:21:32 UTC (rev 4439) @@ -74,11 +74,11 @@ final int maxD = fmtD.length; int maxEnCoursD = maxD; final H2dNodalPropertyMixte[] gpElD = inter_.getPropElementaires(); - int nbPropElemD = gpElD.length; - while (idxCurrentD < nbPropElemD) { - if ((nbPropElemD - idxCurrentD) < maxD) { - maxEnCoursD = nbPropElemD - idxCurrentD; - } + while (idxCurrentD < grpIdx_.size()) { + if (idxCurrentD + maxD > grpIdx_.size()) + { + maxEnCoursD = grpIdx_.size() - idxCurrentD; + } for (int i = maxEnCoursD - 1; i >= 0; i--) { out_.intField(i, grpIdx_.get(idxCurrentD + i) + 1); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-02-03 19:44:55
|
Revision: 4438 http://fudaa.svn.sourceforge.net/fudaa/?rev=4438&view=rev Author: hadouxad Date: 2009-02-03 19:44:50 +0000 (Tue, 03 Feb 2009) Log Message: ----------- Creation rapide de profil spatial sans devoir passer par la cr?\195?\169ation d'un calque de donn?\195?\169es g?\195?\169om?\195?\169triques: - on utilise l'outil sonde depuis le menu ?\195?\169dition d'une vue 2d - on clic en maintenant shift pour cr?\195?\169er plusieurs sondes (les sondes se relient entre elles par des trait) - on clique sur le bouton de cr?\195?\169ation de profil spatial: l'assistant reconnait qu'il y a une ligne bris?\195?\169e de cr?\195?\169e et propose par d?\195?\169faut d'utiliser cette ligne, on peut donc rapidement passer aux ?\195?\169tapes suivantes (choix des pas de temps, variables,...) - Ce principe est ?\195?\169galement disponible pour rejouer les donn?\195?\169es des profils spatiaux - Concernant l'utilisation classique de la sonde : rien ne change: seule la premi?\195?\168re sonde construite affiche ses propres informations AMELIORATION Grilles et sous grilles pour les zeblicalquepanel Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionPoint.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInterface.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/action/CalqueActionSonde.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/find/CalqueFindActionAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 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/TrPostFlecheLayer.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/TrReplayCurvesData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostProfileAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/.metadata/.plugins/org.eclipse.core.resources/ branches/Prepro-0.92-SNAPSHOT/fudaa/.metadata/.plugins/org.eclipse.core.resources/.root/ branches/Prepro-0.92-SNAPSHOT/fudaa/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionPoint.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionPoint.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionPoint.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -203,6 +203,9 @@ return add(_x, _y, _z, null, null); } + + + public final boolean addAll(final GISPoint[] _data, final List _list, final CtuluCommandContainer _c) { if (!isGeomModifiable_) { return false; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -18,6 +18,8 @@ import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; +import java.text.DecimalFormat; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; @@ -54,9 +56,9 @@ int nbGraduationY_ = 10; // -- sous graduations --// - int nbSousGraduationX_ = 2; + int nbSousGraduationX_ = 3; // -- sous graduations --// - int nbSousGraduationY_ = 2; + int nbSousGraduationY_ = 3; final BVueCalque vue_; @@ -78,8 +80,8 @@ /** * Valeur du pas que devront suivrent tous les traits de la grilles si on en mode taille pas. */ - int valeurPasX_; - int valeurPasY_; + double valeurPasX_; + double valeurPasY_; boolean drawSousGrilleX_ = false; boolean drawSousGrilleY_ = false; @@ -87,8 +89,8 @@ boolean modeLongueurPasSousGradX_ = false; boolean modeLongueurPasSousGradY_ = false; - int valeurPasSousGradX_; - int valeurPasSousGradY_; + double valeurPasSousGradX_; + double valeurPasSousGradY_; private Color couleurSousGraduation_ = Color.blue; @@ -622,23 +624,28 @@ * @param _xStrWidth * @param _xString */ - private double fillGraduationsWithPas(Graphics2D _g, int pas, double min, double max, final TDoubleArrayList _xValue, + private double fillGraduationsWithPas(Graphics2D _g, double pas, double min, double max, final TDoubleArrayList _xValue, final TIntArrayList _xStrWidth, final List _xString, FontMetrics fm) { - + DecimalFormat df = new DecimalFormat("#.0"); // -- distance tot a couvrir --// final double distance = max - min; - final int taillePas = pas; + final double taillePas = pas; if (pas == 0) return 0; int nbGraduations = (int) (distance / taillePas); double yMax = 0; for (int i = 0; i < nbGraduations + 1; i++) { - int cesure = (int) (min + (taillePas * (i))); + double cesure = (min + (taillePas * (i))); _xValue.add(cesure); - final String currentLabel = Integer.toString(cesure); + String currentLabel; + + currentLabel = df.format(cesure); _xStrWidth.add(fm.stringWidth(currentLabel)); + String chiffreApresVirgule=currentLabel.substring(currentLabel.lastIndexOf(",")+1); + if( chiffreApresVirgule.equals("0")) + currentLabel=""+(int)cesure; _xString.add(currentLabel); - + final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); if (stringWidth > yMax) { yMax = stringWidth; @@ -883,7 +890,7 @@ } } - public void setLenghtStepsX(final int _lenghtSteps) { + public void setLenghtStepsX(final double _lenghtSteps) { GrBoite boite = vue_.getViewBoite(); if (_lenghtSteps == 0) return; double max = boite.getMaxX(); @@ -897,7 +904,7 @@ } - public void setLenghtStepsY(final int _lenghtSteps) { + public void setLenghtStepsY(final double _lenghtSteps) { GrBoite boite = vue_.getViewBoite(); if (_lenghtSteps == 0) return; int nbGraduationsY = (int) (boite.getMaxY() / _lenghtSteps); @@ -918,7 +925,7 @@ } } - public void setLenghtStepsSousGradX(final int _lenghtSteps) { + public void setLenghtStepsSousGradX(final double _lenghtSteps) { GrBoite boite = vue_.getViewBoite(); if (_lenghtSteps == 0) return; int nbSousGraduationsX = (int) (boite.getMaxY() / _lenghtSteps); @@ -932,14 +939,14 @@ } public void setNbGraduationSousGradX(final int _nbGraduation) { - if (_nbGraduation > 0) { - nbSousGraduationX_ = _nbGraduation; + if (_nbGraduation+1 > 0) { + nbSousGraduationX_ = _nbGraduation+1; modeLongueurPasSousGradX_ = false; grilleChanged(); } } - public void setLenghtStepsSousGradY(final int _lenghtSteps) { + public void setLenghtStepsSousGradY(final double _lenghtSteps) { GrBoite boite = vue_.getViewBoite(); if (_lenghtSteps == 0) return; int nbSousGraduationsY = (int) (boite.getMaxY() / _lenghtSteps); @@ -953,11 +960,51 @@ } public void setNbGraduationSousGradY(final int _nbGraduation) { - if (_nbGraduation > 0) { - nbSousGraduationY_ = _nbGraduation; + if (_nbGraduation+1 > 0) { + nbSousGraduationY_ = _nbGraduation+1; modeLongueurPasSousGradY_ = false; grilleChanged(); } } +public boolean isModeLongueurPasX_() { + return modeLongueurPasX_; } + +public void setModeLongueurPasX_(boolean modeLongueurPasX_) { + this.modeLongueurPasX_ = modeLongueurPasX_; +} + +public double getValeurPasX_() { + return valeurPasX_; +} + +public void setValeurPasX_(int valeurPasX_) { + this.valeurPasX_ = valeurPasX_; +} + +public double getValeurPasY_() { + return valeurPasY_; +} + +public void setValeurPasY_(int valeurPasY_) { + this.valeurPasY_ = valeurPasY_; +} + +public double getValeurPasSousGradX_() { + return valeurPasSousGradX_; +} + +public void setValeurPasSousGradX_(int valeurPasSousGradX_) { + this.valeurPasSousGradX_ = valeurPasSousGradX_; +} + +public double getValeurPasSousGradY_() { + return valeurPasSousGradY_; +} + +public void setValeurPasSousGradY_(int valeurPasSousGradY_) { + this.valeurPasSousGradY_ = valeurPasSousGradY_; +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -64,8 +64,10 @@ final GrPoint pt=new GrPoint(_e.getX(),_e.getY(),0); // final GrPoint clone = new GrPoint(pt); pt.autoApplique(((BCalque)target_).getVersReel()); - target_.changeSonde(pt); + + target_.changeSonde(pt,_e.isShiftDown()); + // -- notify aux sondeListener --// notifySondeListener(pt); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInterface.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInterface.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInterface.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -7,6 +7,8 @@ */ package org.fudaa.ebli.calque; +import java.util.List; + import org.fudaa.ebli.geometrie.GrPoint; @@ -48,7 +50,7 @@ * @param _reel coordonn\xE9es r\xE9elles * @return true si trouv\xE9 */ - boolean changeSonde(GrPoint _reel); + boolean changeSonde(GrPoint _reel,boolean ajoute); /** @@ -57,5 +59,11 @@ */ boolean isPointSondable(GrPoint _reel); + /** + * Retourne la liste des sondes qui forment une ligne brisee. + * @return + */ + public List<GrPoint> getLigneBriseeFromSondes(); + } 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 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -123,7 +123,7 @@ ZCalqueSondeInterface objet = sondeInteraction.getTarget(); objet.setSondeEnable(true); - objet.changeSonde(pt); + objet.changeSonde(pt,false); //--remplissage des infos specifiques a la sonde --// ZCalquePoint isoLayer = listeWidgetCalque_.get(i).getCalqueController().getVisuPanel().getIsoLayer(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/action/CalqueActionSonde.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/action/CalqueActionSonde.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/action/CalqueActionSonde.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -27,7 +27,7 @@ super(EbliLib.getS("Interpolation"), EbliResource.EBLI.getToolIcon("pointeur"), "SONDE", _cq); _m.addTreeSelectionListener(this); - super.setDefaultToolTip(EbliLib.getS("Interpoler les valeurs en un point")); + super.setDefaultToolTip(EbliLib.getS("<html><body>Interpoler les valeurs en un point<br /><b>On peut construire une ligne bris\xE9e en cr\xE9ant plusieurs sondes en maintenant shift. </b></body></html>")); updateForLayer(_m.getSelectedCalque()); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/find/CalqueFindActionAbstract.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/find/CalqueFindActionAbstract.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/find/CalqueFindActionAbstract.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -172,7 +172,7 @@ target.setSondeEnable(true); s.setTarget(target); - r = target.changeSonde(new GrPoint(x, y, 0)); + r = target.changeSonde(new GrPoint(x, y, 0),true); if (r) { visu.setInfoPaletteActive(); } Added: branches/Prepro-0.92-SNAPSHOT/fudaa/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvVisuPanel.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -10,6 +10,7 @@ import java.awt.event.ActionEvent; import java.util.Collection; +import java.util.List; import javax.swing.JCheckBoxMenuItem; import javax.swing.JColorChooser; @@ -21,6 +22,7 @@ import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.gis.GISPolygone; +import org.fudaa.ctulu.gis.GISZoneCollectionPoint; import org.fudaa.ctulu.gui.CtuluDialog; import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.dodico.ef.EfFrontierInterface; @@ -28,8 +30,10 @@ import org.fudaa.dodico.ef.EfGridVolumeInterface; import org.fudaa.ebli.calque.BGroupeCalque; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.calque.ZCalqueSondeInterface; import org.fudaa.ebli.calque.edition.ZCalqueEditionGroup; import org.fudaa.ebli.controle.BSelecteurReduitFonteNewVersion; +import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.meshviewer.MvLayerGrid; import org.fudaa.fudaa.meshviewer.MvResource; @@ -51,6 +55,9 @@ import com.memoire.bu.BuDynamicMenu; import com.memoire.bu.BuMenu; import com.memoire.bu.BuPopupMenu; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.CoordinateSequences; +import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.LineString; /** @@ -450,11 +457,54 @@ * @return la ligne selectionnee dans le calque selectionne ou null si aucune */ public LineString getSelectedLine() { + LineString selection=null; // pas de calque s\xE9lectionn\xE9 - if (!(getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { return null; } - return ((ZCalqueAffichageDonneesInterface) getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); + if ((getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueAffichageDonneesInterface)) { + //-- on essaie de recuperer la ligne selectionnee:--// + selection=((ZCalqueAffichageDonneesInterface) getArbreCalqueModel().getSelectedCalque()).getSelectedLine(); + } + //-- si il n'y a pas de ligne selectionne dans une donne geometrique, alors on tente de renvoyer la ligne formee des sondes --// + if(selection==null) + selection=getSelectedLineFromSonde(); + + return selection; } + public boolean isSelectionOkForEvolutionSonde() { + return (getCalqueActif() instanceof ZCalqueSondeInterface) + && ((ZCalqueSondeInterface) getCalqueActif()).isSondeActive(); + } + + /** + * Retourne la ligne brisee formee par les sondes. + * On peut creer plusieurs sondes en maintenant shift appuy\xE9. + * @return + */ + public List<GrPoint> getLigneBriseeFormSonde() { + if (isSelectionOkForEvolutionSonde()) { + final ZCalqueSondeInterface s = (ZCalqueSondeInterface) getCalqueActif(); + if(s !=null && s.getLigneBriseeFromSondes()!=null && s.getLigneBriseeFromSondes().size()>1) + return s.getLigneBriseeFromSondes(); + } + return null; + } + + /** + * Retourne la ligne cr\xE9e a partir des objets sondes (en maintenant le crtl+shift) + * @return + */ + public LineString getSelectedLineFromSonde() { + List<GrPoint> listeSondes=getLigneBriseeFormSonde(); + if(listeSondes==null) return null; + GISZoneCollectionPoint listePoints=new GISZoneCollectionPoint(); + for(GrPoint point:listeSondes) + listePoints.add(point.x_,point.y_,point.z_); + LineString newLine=new LineString(listePoints,new GeometryFactory()); + + return newLine; + } + + public void setActive(final boolean _b) {} /** Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileAction.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileAction.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -34,11 +34,18 @@ } protected LineString getSelectedLine() { - return panel_.getSelectedLine(); + //-- on tente de recuperer la ligne issue d'une creation geometrique --// + LineString ligneSelectionnee=panel_.getSelectedLine(); + //-- on essaie avec une ligne brisee formee par les sondes --// + if(ligneSelectionnee==null) + ligneSelectionnee=panel_.getSelectedLineFromSonde(); + return ligneSelectionnee; } @Override public void actionPerformed(final ActionEvent _e) { + + new MvProfileBuilderFromTree(src_, ui_, getSelectedLine(), panel_, new MvProfileCoteTester()).start(); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -55,6 +55,7 @@ import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.courbe.EGObject; +import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; @@ -207,20 +208,12 @@ * @param newVariable * @param ecraser */ - public void replayPoints(TrPostCommonImplementation impl,TrPostVisuPanel vue2d,MVProfileCourbeModel _model,final TrPostSource _src, final int[] _idxToAdd, final CtuluCommandContainer _cmd, + public void replayPoints(TrPostCommonImplementation impl,TrPostVisuPanel vue2d,MVProfileCourbeModel _model,final TrPostSource _src, final GISZoneCollectionPoint points, final CtuluCommandContainer _cmd, final ProgressionInterface _prog, H2dVariableType newVariable,int newTimeStep, boolean ecraser) { - + LineString polyligne=new LineString(points,new GeometryFactory()); //-- ajout de la variable --// final MvProfileCourbeGroup groupVar = getGroup(newVariable, true); - - //-- creation de la polyligne --// - GISZoneCollectionPoint points=new GISZoneCollectionPoint(); - for(int i=0;i<_idxToAdd.length;i++) - points.add(_src.getGrid().getPtX(_idxToAdd[i]),_src.getGrid().getPtY(_idxToAdd[i]),0); - LineString polyligne=new LineString(points,new GeometryFactory()); - - //-- on cree la nouvelle courbe pour la variable correspondante --// MvProfileTarget target=new TrPostProfileAction.ProfileAdapter(_src,impl.getCurrentProject()); MvProfileBuilder builder=new MvProfileBuilderFromLine(target,impl,polyligne,vue2d,new MvProfileCoteTester()); @@ -252,8 +245,29 @@ fireStructureChanged(); + } + + + + public void replayPoints(TrPostCommonImplementation impl,TrPostVisuPanel vue2d,MVProfileCourbeModel _model,final TrPostSource _src, final int[] _idxToAdd, final CtuluCommandContainer _cmd, + final ProgressionInterface _prog, H2dVariableType newVariable,int newTimeStep, boolean ecraser) { + //-- creation de la polyligne --// + GISZoneCollectionPoint points=new GISZoneCollectionPoint(); + for(int i=0;i<_idxToAdd.length;i++) + points.add(_src.getGrid().getPtX(_idxToAdd[i]),_src.getGrid().getPtY(_idxToAdd[i]),0); + replayPoints(impl, vue2d, _model, _src, points, _cmd, _prog, newVariable, newTimeStep, ecraser); } + + public void replayPoints(TrPostCommonImplementation impl,TrPostVisuPanel vue2d,MVProfileCourbeModel _model,final TrPostSource _src, final List<GrPoint> _idxToAdd, final CtuluCommandContainer _cmd, + final ProgressionInterface _prog, H2dVariableType newVariable,int newTimeStep, boolean ecraser) { + //-- creation de la polyligne --// + GISZoneCollectionPoint points=new GISZoneCollectionPoint(); + for(GrPoint point:_idxToAdd) + points.add(point.x_,point.y_,point.z_); + + replayPoints(impl, vue2d, _model, _src, points, _cmd, _prog, newVariable, newTimeStep, ecraser); + } /** * Methode qui supprime la courbe pour son modele du profil spatial. Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -4,6 +4,7 @@ import java.awt.CardLayout; import java.awt.Color; import java.awt.Container; +import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -87,33 +88,24 @@ boolean modeAutomatiqueY_ = true; private BuPanel createAxis() { - BuPanel panelX = new BuPanel(new BorderLayout()); - panelX.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Axes X"))); + final BuPanel panelX = new BuPanel(new FlowLayout(FlowLayout.LEFT)); + final BuPanel panelY = new BuPanel(new FlowLayout(FlowLayout.LEFT)); + final BuPanel panelSousGrilleeX = new BuPanel(new FlowLayout(FlowLayout.LEFT)); + final BuPanel panelSousGrilleeY = new BuPanel(new FlowLayout(FlowLayout.LEFT)); + final BuCheckBox cbsousGrilleX = new BuCheckBox(EbliLib.getS("Dessiner les sous graduations X")); + final BuCheckBox cbsousGrilleY = new BuCheckBox(EbliLib.getS("Dessiner les sous graduations Y")); + + panelX.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Graduations X"))); final BuComboBox combo = new BuComboBox(new String[] { EbliLib.getS("Manuel: Nb graduations"), EbliLib.getS("Manuel: longueur des pas"), EbliLib.getS("Automatique: Nb graduations"), EbliLib.getS("Automatique: longueur des pas") }); final CardLayout layoutCardX = new CardLayout(); - panelX.add(combo, BorderLayout.NORTH); + final BuPanel panelCardX = new BuPanel(layoutCardX); // panelCardX.setLayout(layoutCardX); - panelX.add(combo, BorderLayout.NORTH); - panelX.add(panelCardX, BorderLayout.CENTER); - combo.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - modeAutomatiqueX_ = false; - if (combo.getSelectedIndex() == 0) layoutCardX.show(panelCardX, MANUEL1); - else if (combo.getSelectedIndex() == 1) layoutCardX.show(panelCardX, MANUEL2); - else if (combo.getSelectedIndex() == 2) { - layoutCardX.show(panelCardX, MANUEL1); - modeAutomatiqueX_ = true; - } else if (combo.getSelectedIndex() == 3) { - layoutCardX.show(panelCardX, MANUEL2); - modeAutomatiqueX_ = true; - } - } + + - }); - final BuCheckBox cbX = new BuCheckBox(EbliLib.getS("Dessiner l'axe X")); cbX.setSelected(target_.isDrawX()); cbX.addActionListener(new ActionListener() { @@ -123,13 +115,18 @@ } }); - panelX.add(cbX, BorderLayout.SOUTH); - + + BuPanel paneCombo1=new BuPanel(); + paneCombo1.add(combo); + panelX.add(cbX/*, BorderLayout.SOUTH*/); + panelX.add(paneCombo1/*, BorderLayout.NORTH*/); + panelX.add(panelCardX/*, BorderLayout.CENTER*/); + // -- panel x manuel 1: choix par nb de cesures --// final BuPanel pnXmanu1 = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); - pnXmanu1.add(new BuLabel(EbliLib.getS("Nombre de graduations"))); + // pnXmanu1.add(new BuLabel(EbliLib.getS("Nombre de graduations"))); final BuTextField btGraduationX = BuTextField.createIntegerField(); - btGraduationX.setColumns(20); + btGraduationX.setColumns(5); btGraduationX.setValue(new Integer(target_.getNbXGraduations())); pnXmanu1.add(btGraduationX); btGraduationX.addActionListener(new ActionListener() { @@ -150,15 +147,15 @@ // -- panel x manuel 2: choix par longueur des pas --// final BuPanel pnXmanu2 = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); - pnXmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); - final BuTextField btGraduationX2 = BuTextField.createIntegerField(); - btGraduationX2.setColumns(20); - btGraduationX2.setValue(new Integer(target_.getNbXGraduations())); + // pnXmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); + final BuTextField btGraduationX2 = BuTextField.createDoubleField(); + btGraduationX2.setColumns(5); + // btGraduationX2.setValue(new Integer(target_.get)); pnXmanu2.add(btGraduationX2); btGraduationX2.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { - final int newVal = ((Integer) btGraduationX2.getValue()).intValue(); + final double newVal = ((Double) btGraduationX2.getValue()).doubleValue(); if (newVal > 0) { target_.setModeAutomatiqueX(modeAutomatiqueX_); target_.setLenghtStepsX(newVal); @@ -173,33 +170,74 @@ // --on affiche le manuel 1 par defaut --// layoutCardX.show(panelCardX, "MANUEL1"); + + combo.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + modeAutomatiqueX_ = false; + if (combo.getSelectedIndex() == 0){ + layoutCardX.show(panelCardX, MANUEL1); + final int newVal = ((Integer) btGraduationX.getValue()).intValue(); + if(newVal>0){ + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setNbGraduationX(newVal); + } + } + else if (combo.getSelectedIndex() == 1){ + layoutCardX.show(panelCardX, MANUEL2); + if(btGraduationX2.getValue()!=null){ + final double newVal = ((Double) btGraduationX2.getValue()).doubleValue(); + if(newVal>0){ + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setLenghtStepsX(newVal); + } + } + } + else if (combo.getSelectedIndex() == 2) { + layoutCardX.show(panelCardX, MANUEL1); + modeAutomatiqueX_ = true; + final int newVal = ((Integer) btGraduationX.getValue()).intValue(); + if(newVal>0){ + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setNbGraduationX(newVal); + } + } else if (combo.getSelectedIndex() == 3) { + layoutCardX.show(panelCardX, MANUEL2); + modeAutomatiqueX_ = true; + if(btGraduationX2.getValue()!=null){ + final double newVal = ((Double) btGraduationX2.getValue()).doubleValue(); + if(newVal>0){ + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setLenghtStepsX(newVal); + }} + } + + if(combo.getSelectedIndex()>=2){ + cbsousGrilleX.setSelected(false); + cbsousGrilleX.setEnabled(false); + target_.setDrawSousGrilleX(false); + }else{ + cbsousGrilleX.setEnabled(true); + } + + + + } + + }); + + // -- Panel y --// - BuPanel panelY = new BuPanel(new BorderLayout()); - panelY.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Axes Y"))); + + panelY.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Graduations Y"))); final BuComboBox comboY = new BuComboBox(new String[] { EbliLib.getS("Manuel: Nb graduations"), EbliLib.getS("Manuel: longueur des pas"), EbliLib.getS("Automatique: Nb graduations"), EbliLib.getS("Automatique: longueur des pas") }); final CardLayout layoutCardY = new CardLayout(); - panelY.add(comboY, BorderLayout.NORTH); + final BuPanel panelCardY = new BuPanel(layoutCardY); // panelCardY.setLayout(layoutCardY); - panelY.add(comboY, BorderLayout.NORTH); - panelY.add(panelCardY, BorderLayout.CENTER); - comboY.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - modeAutomatiqueY_ = false; - if (comboY.getSelectedIndex() == 0) layoutCardY.show(panelCardY, MANUEL1); - else if (comboY.getSelectedIndex() == 1) layoutCardY.show(panelCardY, MANUEL2); - else if (comboY.getSelectedIndex() == 2) { - layoutCardY.show(panelCardY, MANUEL1); - modeAutomatiqueY_ = true; - } else if (comboY.getSelectedIndex() == 3) { - layoutCardY.show(panelCardY, MANUEL2); - modeAutomatiqueY_ = true; - } - } - - }); + + final BuCheckBox cbY = new BuCheckBox(EbliLib.getS("Dessiner l'axe Y")); cbY.setSelected(target_.isDrawY()); cbY.addActionListener(new ActionListener() { @@ -209,14 +247,18 @@ } }); + BuPanel combo3=new BuPanel(); + combo3.add(comboY); + panelY.add(cbY /*,BorderLayout.SOUTH*/); + panelY.add(combo3/*, BorderLayout.NORTH*/); + panelY.add(panelCardY/*, BorderLayout.CENTER*/); + - panelY.add(cbY, BorderLayout.SOUTH); - // -- panel y manuel 1: choix par nb de cesures --// final BuPanel pnYmanu1 = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); - pnYmanu1.add(new BuLabel(EbliLib.getS("Nombre de graduation"))); + // pnYmanu1.add(new BuLabel(EbliLib.getS("Nombre de graduation"))); final BuTextField btGraduationY = BuTextField.createIntegerField(); - btGraduationY.setColumns(20); + btGraduationY.setColumns(5); btGraduationY.setValue(new Integer(target_.getNbYGraduations())); pnYmanu1.add(btGraduationY); btGraduationY.addActionListener(new ActionListener() { @@ -237,15 +279,15 @@ // -- panel y manuel 2: choix par longueur des pas --// final BuPanel pnYmanu2 = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); - pnYmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); - final BuTextField btGraduationY2 = BuTextField.createIntegerField(); - btGraduationY2.setColumns(20); - btGraduationY2.setValue(new Integer(target_.getNbXGraduations())); + // pnYmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); + final BuTextField btGraduationY2 = BuTextField.createDoubleField(); + btGraduationY2.setColumns(5); + // btGraduationY2.setValue(new Integer(target_.getNbXGraduations())); pnYmanu2.add(btGraduationY2); btGraduationY2.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { - final int newVal = ((Integer) btGraduationY2.getValue()).intValue(); + final double newVal = ((Double) btGraduationY2.getValue()).doubleValue(); if (newVal > 0) { target_.setModeAutomatiqueY(modeAutomatiqueY_); target_.setLenghtStepsY(newVal); @@ -259,40 +301,91 @@ // --on affiche le manuel 1 par defaut --// layoutCardY.show(panelCardY, "MANUEL1"); + + comboY.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + modeAutomatiqueY_ = false; + if (comboY.getSelectedIndex() == 0){ + layoutCardY.show(panelCardY, MANUEL1); + final int newVal = ((Integer) btGraduationY.getValue()).intValue(); + if(newVal>0){ + target_.setModeAutomatiqueY(modeAutomatiqueY_); + target_.setNbGraduationY(newVal); + } + } + else if (comboY.getSelectedIndex() == 1){ + layoutCardY.show(panelCardY, MANUEL2); + if(btGraduationY2.getValue()!=null){ + final double newVal = ((Double) btGraduationY2.getValue()).doubleValue(); + if(newVal>0){ + target_.setModeAutomatiqueY(modeAutomatiqueY_); + target_.setLenghtStepsY(newVal); + }} + } + else if (comboY.getSelectedIndex() == 2) { + layoutCardY.show(panelCardY, MANUEL1); + modeAutomatiqueY_ = true; + final int newVal = ((Integer) btGraduationY.getValue()).intValue(); + if(newVal>0){ + target_.setModeAutomatiqueY(modeAutomatiqueY_); + target_.setNbGraduationY(newVal); + } + } else if (comboY.getSelectedIndex() == 3) { + layoutCardY.show(panelCardY, MANUEL2); + modeAutomatiqueY_ = true; + if(btGraduationY2.getValue()!=null){ + final double newVal = ((Double) btGraduationY2.getValue()).doubleValue(); + if(newVal>0){ + target_.setModeAutomatiqueY(modeAutomatiqueY_); + target_.setLenghtStepsY(newVal); + }} + } + + if(comboY.getSelectedIndex()>=2){ + cbsousGrilleY.setSelected(false); + cbsousGrilleY.setEnabled(false); + target_.setDrawSousGrilleY(false); + }else{ + cbsousGrilleY.setEnabled(true); + } + + } + + }); + + + + + // -- panel des sous grilles --// // --sous grille x --// - BuPanel panelSousGrilleeX = new BuPanel(new BorderLayout()); + + final BuComboBox comboSousGrilleX = new BuComboBox(new String[] { EbliLib.getS("Nb graduations"), EbliLib.getS("Longueur des pas") }); + + final CardLayout layoutCardSousGrilleX = new CardLayout(); - panelSousGrilleeX.add(comboSousGrilleX, BorderLayout.NORTH); final BuPanel panelCardSouGrilleX = new BuPanel(layoutCardSousGrilleX); - // panelCardSouGrilleX.setLayout(layoutCardSousGrilleX); - panelSousGrilleeX.add(comboSousGrilleX, BorderLayout.NORTH); - panelSousGrilleeX.add(panelCardSouGrilleX, BorderLayout.CENTER); - comboSousGrilleX.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (comboSousGrilleX.getSelectedIndex() == 0) layoutCardSousGrilleX.show(panelCardSouGrilleX, MANUEL1); - else if (comboSousGrilleX.getSelectedIndex() == 1) layoutCardSousGrilleX.show(panelCardSouGrilleX, MANUEL2); - } - }); - final BuCheckBox cbsousGrilleX = new BuCheckBox(EbliLib.getS("Dessiner les sous grilles X")); + + cbsousGrilleX.setSelected(target_.isDrawY()); - cbsousGrilleX.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent _e) { - target_.setModeAutomatiqueY(modeAutomatiqueX_); - target_.setDrawSousGrilleX(cbsousGrilleX.isSelected()); - } - }); - panelSousGrilleeX.add(cbsousGrilleX, BorderLayout.SOUTH); + + + BuPanel combo2=new BuPanel(); + combo2.add(comboSousGrilleX); + panelSousGrilleeX.add(cbsousGrilleX/*, BorderLayout.SOUTH*/); + panelSousGrilleeX.add(combo2/*, BorderLayout.NORTH*/); + panelSousGrilleeX.add(panelCardSouGrilleX/*, BorderLayout.CENTER*/); + cbsousGrilleX.setSelected(false); // -- panel sous grille x manuel 1: choix par nb de cesures --// final BuPanel pnsousXmanu1 = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); - pnsousXmanu1.add(new BuLabel(EbliLib.getS("Nombre de graduation"))); + //pnsousXmanu1.add(new BuLabel(EbliLib.getS("Nombre de graduation"))); final BuTextField btGraduationSousX = BuTextField.createIntegerField(); - btGraduationSousX.setColumns(20); - btGraduationSousX.setValue(new Integer(target_.getNbXSousGraduations())); + btGraduationSousX.setColumns(5); + btGraduationSousX.setValue(new Integer(target_.getNbXSousGraduations()-1)); pnsousXmanu1.add(btGraduationSousX); btGraduationSousX.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { @@ -308,14 +401,14 @@ panelCardSouGrilleX.add(pnsousXmanu1, MANUEL1); // -- panel sous grille x manuel 2: choix par longueur des pas --// final BuPanel pnSousXmanu2 = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); - pnSousXmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); - final BuTextField btGraduationSousX2 = BuTextField.createIntegerField(); - btGraduationSousX2.setColumns(20); + // pnSousXmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); + final BuTextField btGraduationSousX2 = BuTextField.createDoubleField(); + btGraduationSousX2.setColumns(5); // btGraduationSousX2.setValue(new Integer(target_.getNbXGraduations())); pnSousXmanu2.add(btGraduationSousX2); btGraduationSousX2.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { - final int newVal = ((Integer) btGraduationSousX2.getValue()).intValue(); + final double newVal = ((Double) btGraduationSousX2.getValue()).doubleValue(); if (newVal > 0) { target_.setModeAutomatiqueX(modeAutomatiqueX_); target_.setLenghtStepsSousGradX(newVal); @@ -324,38 +417,79 @@ }); panelCardSouGrilleX.add(pnSousXmanu2, MANUEL2); + cbsousGrilleX.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + target_.setModeAutomatiqueX(modeAutomatiqueX_); + if (comboSousGrilleX.getSelectedIndex() == 0){ + layoutCardSousGrilleX.show(panelCardSouGrilleX, MANUEL1); + final int newVal = ((Integer) btGraduationSousX.getValue()).intValue(); + if(newVal>0){ + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setNbGraduationSousGradX(newVal); + } + } + else if (comboSousGrilleX.getSelectedIndex() == 1){ + layoutCardSousGrilleX.show(panelCardSouGrilleX, MANUEL2); + if(btGraduationSousX2.getValue()!=null){ + final double newVal = ((Double) btGraduationSousX2.getValue()).doubleValue(); + if(newVal>0){ + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setLenghtStepsSousGradX(newVal); + }} + } + + + target_.setDrawSousGrilleX(cbsousGrilleX.isSelected()); + } + }); + comboSousGrilleX.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (comboSousGrilleX.getSelectedIndex() == 0){ + layoutCardSousGrilleX.show(panelCardSouGrilleX, MANUEL1); + final int newVal = ((Integer) btGraduationSousX.getValue()).intValue(); + if(newVal>0){ + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setNbGraduationSousGradX(newVal); + } + } + else if (comboSousGrilleX.getSelectedIndex() == 1){ + layoutCardSousGrilleX.show(panelCardSouGrilleX, MANUEL2); + if(btGraduationSousX2.getValue()!=null){ + final double newVal = ((Double) btGraduationSousX2.getValue()).doubleValue(); + if(newVal>0){ + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setLenghtStepsSousGradX(newVal); + }} + } + } + }); + + // --sous grille y --// - BuPanel panelSousGrilleeY = new BuPanel(new BorderLayout()); + final BuComboBox comboSousGrilleY = new BuComboBox(new String[] { EbliLib.getS("Nb graduations"), EbliLib.getS("Longueur des pas") }); final CardLayout layoutCardSousGrilleY = new CardLayout(); - panelSousGrilleeY.add(comboSousGrilleY, BorderLayout.NORTH); + final BuPanel panelCardSouGrilleY = new BuPanel(layoutCardSousGrilleY); // panelCardSouGrilleY.setLayout(layoutCardSousGrilleY); - panelSousGrilleeY.add(comboSousGrilleY, BorderLayout.NORTH); - panelSousGrilleeY.add(panelCardSouGrilleY, BorderLayout.CENTER); - comboSousGrilleY.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (comboSousGrilleY.getSelectedIndex() == 0) layoutCardSousGrilleY.show(panelCardSouGrilleY, MANUEL1); - else if (comboSousGrilleY.getSelectedIndex() == 1) layoutCardSousGrilleY.show(panelCardSouGrilleY, MANUEL2); - } - }); - final BuCheckBox cbsousGrilleY = new BuCheckBox(EbliLib.getS("Dessiner les sous grilles Y")); + + cbsousGrilleY.setSelected(target_.isDrawY()); - cbsousGrilleY.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent _e) { - target_.setModeAutomatiqueY(modeAutomatiqueY_); - target_.setDrawSousGrilleY(cbsousGrilleY.isSelected()); - } - }); - panelSousGrilleeY.add(cbsousGrilleY, BorderLayout.SOUTH); + + BuPanel combo4=new BuPanel(); + combo4.add(comboSousGrilleY); + panelSousGrilleeY.add(cbsousGrilleY/*, BorderLayout.SOUTH*/); + panelSousGrilleeY.add(combo4/*, BorderLayout.NORTH*/); + panelSousGrilleeY.add(panelCardSouGrilleY/*, BorderLayout.CENTER*/); + cbsousGrilleY.setSelected(false); // -- panel sous grille x manuel 1: choix par nb de cesures --// final BuPanel pnsousYmanu1 = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); - pnsousYmanu1.add(new BuLabel(EbliLib.getS("Nombre de graduation"))); + // pnsousYmanu1.add(new BuLabel(EbliLib.getS("Nombre de graduation"))); final BuTextField btGraduationSousY = BuTextField.createIntegerField(); - btGraduationSousY.setColumns(20); - btGraduationSousY.setValue(new Integer(target_.getNbYSousGraduations())); + btGraduationSousY.setColumns(5); + btGraduationSousY.setValue(new Integer(target_.getNbYSousGraduations()-1)); pnsousYmanu1.add(btGraduationSousY); btGraduationSousY.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { @@ -371,14 +505,14 @@ panelCardSouGrilleY.add(pnsousYmanu1, MANUEL1); // -- panel sous grille x manuel 2: choix par longueur des pas --// final BuPanel pnSousYmanu2 = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); - pnSousYmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); - final BuTextField btGraduationSousY2 = BuTextField.createIntegerField(); - btGraduationSousY2.setColumns(20); + //pnSousYmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); + final BuTextField btGraduationSousY2 = BuTextField.createDoubleField(); + btGraduationSousY2.setColumns(5); // btGraduationSousY2.setValue(new Integer(target_.getNbYGraduations())); pnSousYmanu2.add(btGraduationSousY2); btGraduationSousY2.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { - final int newVal = ((Integer) btGraduationSousY2.getValue()).intValue(); + final double newVal = ((Double) btGraduationSousY2.getValue()).doubleValue(); if (newVal > 0) { target_.setModeAutomatiqueY(modeAutomatiqueY_); target_.setLenghtStepsSousGradY(newVal); @@ -387,17 +521,64 @@ }); panelCardSouGrilleY.add(pnSousYmanu2, MANUEL2); + cbsousGrilleY.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + target_.setModeAutomatiqueY(modeAutomatiqueY_); + if (comboSousGrilleY.getSelectedIndex() == 0){ + layoutCardSousGrilleY.show(panelCardSouGrilleY, MANUEL1); + final int newVal = ((Integer) btGraduationSousY.getValue()).intValue(); + if(newVal>0){ + target_.setModeAutomatiqueY(modeAutomatiqueY_); + target_.setNbGraduationSousGradY(newVal); + } + } + else if (comboSousGrilleY.getSelectedIndex() == 1){ + layoutCardSousGrilleY.show(panelCardSouGrilleY, MANUEL2); + if(btGraduationSousY2.getValue()!=null){ + final double newVal = ((Double) btGraduationSousY2.getValue()).doubleValue(); + if(newVal>0){ + target_.setModeAutomatiqueY(modeAutomatiqueY_); + target_.setLenghtStepsSousGradY(newVal); + }} + } + + target_.setDrawSousGrilleY(cbsousGrilleY.isSelected()); + } + }); + comboSousGrilleY.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (comboSousGrilleY.getSelectedIndex() == 0){ + layoutCardSousGrilleY.show(panelCardSouGrilleY, MANUEL1); + final int newVal = ((Integer) btGraduationSousY.getValue()).intValue(); + if(newVal>0){ + target_.setModeAutomatiqueY(modeAutomatiqueY_); + target_.setNbGraduationSousGradY(newVal); + } + } + else if (comboSousGrilleY.getSelectedIndex() == 1){ + layoutCardSousGrilleY.show(panelCardSouGrilleY, MANUEL2); + if(btGraduationSousY2.getValue()!=null){ + final double newVal = ((Double) btGraduationSousY2.getValue()).doubleValue(); + if(newVal>0){ + target_.setModeAutomatiqueY(modeAutomatiqueY_); + target_.setLenghtStepsSousGradY(newVal); + }} + } + } + }); + + // -- init des panels grilles --// BuPanel pnGrille = new BuPanel(new GridLayout(2, 1)); pnGrille.add(panelX); - pnGrille.add(panelY); + pnGrille.add(panelSousGrilleeX ); // -- init panel sous grilles --// BuPanel pnSousGrille = new BuPanel(new GridLayout(2, 1)); - pnSousGrille.add(panelSousGrilleeX); + pnSousGrille.add(panelY); pnSousGrille.add(panelSousGrilleeY); - panelSousGrilleeX.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Sous grilles X"))); - panelSousGrilleeY.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Sous grilles Y"))); + panelSousGrilleeX.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Sous graduations X"))); + panelSousGrilleeY.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Sous graduations Y"))); // -- init au modes par defaut --// combo.setSelectedIndex(0); @@ -410,6 +591,8 @@ return pnXY; } + + private BuPanel createMainProperties() { final BuPanel pn = new BuPanel(); 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 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -264,7 +264,7 @@ TraceIcon sondeIcone_; - GrPoint sondePt_; + List<GrPoint> sondePt_; int sondeSelectedElement_ = -1; @@ -287,6 +287,7 @@ i = 0; } setV(i); + sondePt_=new ArrayList<GrPoint>(); } void initPaletteMap() { @@ -334,13 +335,24 @@ protected final void paintSonde(final Graphics2D _g2d, final GrMorphisme _versEcran) { if (sondeSelectedElement_ >= 0) { - final GrPoint p = sondePt_.applique(_versEcran); + GrPoint oldPoint=null; + for(GrPoint point:sondePt_) { + + final GrPoint p = point.applique(_versEcran); if (sondeIcone_ == null) { sondeIcone_ = getSondeIcone(); } // _g2d.setXORMode(Color.WHITE); sondeIcone_.paintIconCentre(this, _g2d, p.x_, p.y_); + + //-- on trace la ligne entre les sondes --// + if(oldPoint!=null){ + _g2d.drawLine((int)oldPoint.x_,(int) oldPoint.y_, (int) p.x_,(int) p.y_); + + } + oldPoint=p ; } + } } protected void timeStepFormatChanged() { @@ -389,13 +401,22 @@ protected void updateSavedPalBeforeSet(final BPalettePlage _p) {} - public final boolean changeSonde(final GrPoint _ptReel) { + public final boolean changeSonde(final GrPoint _ptReel, final boolean _add) { if (!isSondeEnable()) { return false; } if (sondePt_ == null) { - sondePt_ = new GrPoint(); + //sondePt_ = new GrPoint(); + sondePt_=new ArrayList<GrPoint>(); } - sondePt_.initialiseAvec(_ptReel); - final int i = sondeSelection(sondePt_, getIsoModelAbstract()); + + GrPoint point=new GrPoint(); + + point.initialiseAvec(_ptReel); + + if(!_add) + sondePt_.clear(); + sondePt_.add(point); + + final int i = sondeSelection(point, getIsoModelAbstract()); final boolean oldIsDraw = sondeSelectedElement_ >= 0; sondeSelectedElement_ = i; if (sondeSelectedElement_ >= 0) { @@ -500,7 +521,7 @@ @Override public void fillWithInterpolateInfo(final InfoData _m) { - getIsoModelAbstract().fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.x_, sondePt_.y_, getTitle()); + getIsoModelAbstract().fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.get(0).x_, sondePt_.get(0).y_, getTitle()); } @Override @@ -591,11 +612,11 @@ } public final double getSondeX() { - return sondePt_ == null ? 0 : sondePt_.x_; + return sondePt_ == null ? 0 : sondePt_.get(0).x_; } public final double getSondeY() { - return sondePt_ == null ? 0 : sondePt_.y_; + return sondePt_ == null ? 0 : sondePt_.get(0).y_; } public final JComponent getTargetComponent() { @@ -974,5 +995,10 @@ repaint(); } } + + public List<GrPoint> getLigneBriseeFromSondes(){ + return this.sondePt_; + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheLayer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheLayer.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheLayer.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -10,6 +10,7 @@ import java.awt.Component; import java.awt.Graphics2D; import java.awt.event.ActionEvent; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -77,7 +78,7 @@ TraceIcon sondeIcone_; - GrPoint sondePt_; + List<GrPoint> sondePt_; JMenuItem[] spec_; @@ -91,6 +92,7 @@ super(new TrPostFlecheModel(_s)); initModel_ = (TrPostFlecheModel) super.modele_; setTitle(TrResource.getS("Vecteurs")); + sondePt_=new ArrayList<GrPoint>(); } public H2dVariableType getSelectedVar() { @@ -161,13 +163,17 @@ protected void paintSonde(final Graphics2D _g2d, final GrMorphisme _versEcran) { if (sondeSelectedElement_ >= 0) { - final GrPoint p = sondePt_.applique(_versEcran); + + for(GrPoint point:sondePt_) { + + final GrPoint p = point.applique(_versEcran); if (sondeIcone_ == null) { sondeIcone_ = TrIsoLayerDefault.getSondeIcone(); } // _g2d.setXORMode(Color.WHITE); sondeIcone_.paintIconCentre(this, _g2d, p.x_, p.y_); } + } } @Override @@ -239,13 +245,22 @@ } } - public boolean changeSonde(final GrPoint _pt) { + public boolean changeSonde(final GrPoint _pt, final boolean add) { if (!isSondeEnable()) { return false; } if (sondePt_ == null) { - sondePt_ = new GrPoint(); + sondePt_=new ArrayList<GrPoint>(); + //sondePt_ = new GrPoint(); } - sondePt_.initialiseAvec(_pt); - final int i = TrIsoLayerDefault.sondeSelection(sondePt_, initModel_); + GrPoint point=new GrPoint(); + + point.initialiseAvec(_pt); + + if(!add) + sondePt_.clear(); + sondePt_.add(point); + + + final int i = TrIsoLayerDefault.sondeSelection(point, initModel_); final boolean oldIsDraw = sondeSelectedElement_ >= 0; sondeSelectedElement_ = i; if (sondeSelectedElement_ >= 0) { @@ -331,7 +346,7 @@ @Override public void fillWithInfo(final InfoData _m) { if (isSondeActive()) { - initModel_.fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.x_, sondePt_.y_, getTitle()); + initModel_.fillInterpolateInfo(_m, sondeSelectedElement_, sondePt_.get(0).x_, sondePt_.get(0).y_, getTitle()); } else if (!isGrilleActivated()) { initModel_.fillWithInfo(_m, this); @@ -394,11 +409,11 @@ } public double getSondeX() { - return sondePt_ == null ? 0 : sondePt_.x_; + return sondePt_ == null ? 0 : sondePt_.get(0).x_; } public double getSondeY() { - return sondePt_ == null ? 0 : sondePt_.y_; + return sondePt_ == null ? 0 : sondePt_.get(0).y_; } @Override @@ -588,5 +603,9 @@ changeVarStep(); } } + + public List<GrPoint> getLigneBriseeFromSondes(){ + return this.sondePt_; + } } \ No newline at end of file Modified: 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/TrPostVisuPanel.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -44,6 +44,7 @@ import org.fudaa.ebli.commun.EbliActionPaletteAbstract; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliLib; +import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; @@ -385,6 +386,8 @@ return null; } + + /* * protected void anim(){ if (anim_ == null) anim_ = new EbliAnimation(this); anim_.go(); } */ @@ -512,10 +515,7 @@ return d != null && !d.isSelectionEmpty(); } - public boolean isSelectionOkForEvolutionSonde() { - return (getCalqueActif() instanceof ZCalqueSondeInterface) - && ((ZCalqueSondeInterface) getCalqueActif()).isSondeActive(); - } + public void startExport(final CtuluUI _impl) { TrPostVisuPanel.startExport(_impl, source_, super.getCurrentSelection()); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-02-02 22:46:04 UTC (rev 4437) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-02-03 19:44:50 UTC (rev 4438) @@ -31,6 +31,7 @@ import javax.swing.table.DefaultTableModel; import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee; import org.fudaa.ctulu.gis.GISZoneCollectionPoint; import org.fudaa.ctulu.gui.CtuluDialog; import org.fudaa.ctulu.gui.CtuluDialogPanel; @@ -40,11 +41,13 @@ import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.calque.BCalquePaletteInfo; import org.fudaa.ebli.calque.ZCalqueAffichageDonnees; +import org.fudaa.ebli.calque.ZCalqueLigneBrisee; import org.fudaa.ebli.calque.ZCalquePoint; import org.fudaa.ebli.calque.ZCalqueSondeInteraction; import org.fudaa.ebli.calque.action.CalqueActionSonde; import org.fudaa.ebli.calque.action.EbliCalqueActionTimeChooser; import org.fudaa.ebli.calque.edition.BPaletteEdition; +import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeDefault; import org.fudaa.ebli.calque.edition.ZModelePointEditable; import org.fudaa.ebli.commun.EbliActionAbstract; import org.fudaa.ebli.commun.EbliActionInterface; @@ -56,6 +59,7 @@ import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.find.EbliFindDialog; import org.fudaa.ebli.find.EbliFindableItem; +import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.palette.BPaletteInfo; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.trace.TraceIcon; @@ -81,6 +85,7 @@ import com.memoire.bu.BuWizardDialog; import com.memoire.fu.FuComparator; import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.LineString; @@ -436,10 +441,19 @@ dataP[i][1]=listePoints.getCoordinateN(i).y; } - ZModelePointEditable modelePointEdit=new ZModelePointEditable(collectionPoint); + //ZModelePointEditable modelePointEdit=new ZModelePointEditable(collectionPoint); BCalque memoire=vue2d.getCalqueActif(); - ZCalquePoint calqueZ=new ZCalquePoint(modelePointEdit); + //ZCalquePoint calqueZ=new ZCalquePoint(modelePointEdit); + + + GISZoneCollectionLigneBrisee ligneBrisee=new GISZoneCollectionLigneBrisee(); + ligneBrisee.addCoordinateSequence(collectionPoint, null,null); + ZModeleLigneBriseeDefault modeleDefault=new ZModeleLigneBriseeDefault(ligneBrisee); + ZCalqueLigneBrisee calqueZ=new ZCalqueLigneBrisee(modeleDefault); + + + //calqueZ.setVisible(true); //calqueZ.setLineModel(0, new TraceLigneModel(1,2,Color.BLACK)); calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.CARRE_SELECTION,3,Color.blue)); @@ -740,10 +754,15 @@ } - ZModelePointEditable modelePointEdit=new ZModelePointEditable(collectionPoint); + //ZModelePointEditable modelePointEdit=new ZModelePointEditable(collectionPoint); //-- creation du calque - FSigLayerPointEditable layer2=new FSigLayerPointEditable(modelePointEdit,vue2d.getGisEditor()); + //FSigLayerPointEditable layer2=new FSigLayerPointEditable(modelePointEdit,vue2d.getGisEditor()); + GISZoneCollectionLigneBrisee ligneBrisee=new GISZoneCollectionLigneBrisee(); + ligneBrisee.addCoordinateSequence(collectionPoint, null,null); + ZModeleLigneBriseeDefault modeleDefault=new ZModeleLigneBriseeDefault(ligneBrisee); + ZCalqueLigneBrisee layer2=new ZCalqueLigneBrisee(modeleDefault); + layer2.setVisible(true); layer2.setIconModel(0, new TraceIconModel(TraceIcon.CARRE_SELECTION,4,Color.RED)); layer2.setEnabled(true); @@ -754,7 +773,7 @@ vue2d.setCalqueActif(resultatsCalque); //-- creation du panel de choix des variables a selectionner --// - String title=TrResource.getS("<html><... [truncated message content] |
From: <de...@us...> - 2009-02-02 22:46:08
|
Revision: 4437 http://fudaa.svn.sourceforge.net/fudaa/?rev=4437&view=rev Author: deniger Date: 2009-02-02 22:46:04 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/PaletteSelecteurCouleurPlage.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/layer/MvElementLayer.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/MvProfileTarget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSig.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigAttibuteTypeManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigAttributeEditorPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigAttributeTableModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigExportImportAttributesMapper.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigFilterZone.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigFilterZoneActivity.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigGeomDataClosedLayerFilter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigGeomSrcData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigGeomSrcDataUtils.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLayerGroupSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLayerLineAddedSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLayerPointAddedSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLib.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLineSingleModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigLoaderPreviewer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjectPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigProjetDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigResource.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigVarAttrMapperTableModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigVarPolygoneModifierActivity.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigVariableModifResult.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigVariableModifResultSub.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/FSigVisuPanelDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigFilleDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigImageImportAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerExporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerGroup.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerLine.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerLineEditable.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerPointEditable.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigVisuPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerGroupPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerLinePersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerMultiPointPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerPointPersistence.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSIgImageWizartStepCalageUI.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigDataModelSinusxAdapter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigDataModelStoreAdapter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoadResult.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderCsv.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGIS.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGrid.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderI.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderInp.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadSEM.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRefluxRefondeResult.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarCox.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarInx.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarSem.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarSt.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderSerafin.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderSinusX.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardStepCalage.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardStepCalageLogic.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardStepImage.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardTableModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigImageWizardTask.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigVariableInterpolator.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardDefaultPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardFileMng.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardFileModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImport.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportHelper.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportStepDestination.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardVariableModifier.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/common/TrCommonImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrExplorer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrLib.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/data/TrGisProjectEditor.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBuilderSuiteCalcul.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/TrPostCourbeTreeModelPersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFusionProjet.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/TrPostMultiSourceActivator2.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/TrPostProjetsManagerFille.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/TrPostSourceFromReader.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderComposite.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderReflux.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTrajectoireLineLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostTrajectoireLineLayerPersist.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/TrPostVisuPanelPersistManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java 2009-02-02 19:33:52 UTC (rev 4436) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java 2009-02-02 22:46:04 UTC (rev 4437) @@ -42,974 +42,922 @@ * @author Guillaume Desnoix */ public class ZCalqueGrille extends ZCalqueAffichageDonnees { - // Proprietes - // private GrBoite boite_; - boolean drawGrid_; - boolean drawX_ = true; - boolean drawY_ = true; - // Envelope customBounds_; - // boolean useCustom_; + // Proprietes + // private GrBoite boite_; + boolean drawGrid_; + boolean drawX_ = true; + boolean drawY_ = true; + // Envelope customBounds_; + // boolean useCustom_; - int nbGraduationX_ = 10; - int nbGraduationY_ = 10; + int nbGraduationX_ = 10; + int nbGraduationY_ = 10; - //-- sous graduations --// - int nbSousGraduationX_ = 2; - //-- sous graduations --// - int nbSousGraduationY_ = 2; + // -- sous graduations --// + int nbSousGraduationX_ = 2; + // -- sous graduations --// + int nbSousGraduationY_ = 2; - final BVueCalque vue_; + final BVueCalque vue_; + /** + * Indique la facon de calculer les graduations. pour l'axe des x. + */ + boolean modeAutomatiqueX_ = false; + /** + * Indique la facon de calculer les graduations. pour l'axe des y. + */ + boolean modeAutomatiqueY_ = false; - /** - * Indique la facon de calculer les graduations. - * pour l'axe des x. - */ - boolean modeAutomatiqueX_=false; - /** - * Indique la facon de calculer les graduations. - * pour l'axe des y. - */ - boolean modeAutomatiqueY_=false; + /** + * Indique si on utilise par taille de pas ou par nombre de graduations + */ + boolean modeLongueurPasX_ = false; + boolean modeLongueurPasY_ = false; + /** + * Valeur du pas que devront suivrent tous les traits de la grilles si on en mode taille pas. + */ + int valeurPasX_; + int valeurPasY_; + boolean drawSousGrilleX_ = false; + boolean drawSousGrilleY_ = false; + boolean modeLongueurPasSousGradX_ = false; + boolean modeLongueurPasSousGradY_ = false; - /** - * Indique si on utilise par taille de pas ou par nombre de graduations - */ - boolean modeLongueurPasX_=false; - boolean modeLongueurPasY_=false; + int valeurPasSousGradX_; + int valeurPasSousGradY_; - /** - * Valeur du pas que devront suivrent tous les traits de la grilles si on en mode taille pas. - */ - int valeurPasX_; - int valeurPasY_; + private Color couleurSousGraduation_ = Color.blue; - boolean drawSousGrilleX_ = false; - boolean drawSousGrilleY_ = false; + public ZCalqueGrille(final BVueCalque _vue) { + super(); + vue_ = _vue; + setDestructible(false); + setName("cqGrille"); + setTitle(EbliLib.getS("Grille")); + // setForeground(new Color(204, 153, 0)); + setForeground(Color.BLACK); + } - boolean modeLongueurPasSousGradX_=false; - boolean modeLongueurPasSousGradY_=false; + public void paintAllInImage(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { + // super.paintAllInImage(_g, _versEcran, _versReel, _clipReel); + } - int valeurPasSousGradX_; - int valeurPasSousGradY_; + public void changeZoom(double minx, double miny, double maxx, double maxy) { + vue_.changeViewBoite(this, new GrBoite(new GrPoint(minx, miny, 0), new GrPoint(maxx, maxy, 0)), false); + } - private Color couleurSousGraduation_=Color.blue; + public int getNbXGraduations() { + return nbGraduationX_; + } - public ZCalqueGrille(final BVueCalque _vue) { - super(); - vue_ = _vue; - setDestructible(false); - setName("cqGrille"); - setTitle(EbliLib.getS("Grille")); - // setForeground(new Color(204, 153, 0)); - setForeground(Color.BLACK); - } + public int getNbYGraduations() { + return nbGraduationY_; + } - public void paintAllInImage(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, - final GrBoite _clipReel) { - // super.paintAllInImage(_g, _versEcran, _versReel, _clipReel); - } + public int getNbXSousGraduations() { + return nbSousGraduationX_; + } - public void changeZoom(double minx, double miny, double maxx, double maxy) { - vue_.changeViewBoite(this, new GrBoite(new GrPoint(minx, miny, 0), new GrPoint(maxx, maxy, 0)), false); - } + public int getNbYSousGraduations() { + return nbSousGraduationY_; + } - public int getNbXGraduations() { - return nbGraduationX_; - } + public void setSousGraduationColor(Color c) { + if (couleurSousGraduation_ != c) { + couleurSousGraduation_ = c; + grilleChanged(); + } - public int getNbYGraduations() { - return nbGraduationY_; - } + } - public int getNbXSousGraduations() { - return nbSousGraduationX_; - } + /** + * Accesseur de la propriete <I>boite</I>. Elle donne la position, la taille, le domaine de la grille. + */ + // public GrBoite getBoite() { + // return boite_; + // } + public GrBoite getDomaine() { + return null; + // GrBoite r = null; + // if (isVisible()) { + // GrBoite d = null; + // d = super.getDomaine(); + // r = getBoite(); + // if (d != null) { + // if (r == null) { + // r = d; + // } else { + // r = r.union(d); + // } + // } + // } + // return r; + } - public int getNbYSousGraduations() { - return nbSousGraduationY_; - } + public GrBoite getDomaineOnSelected() { + return getDomaine(); + } - public void setSousGraduationColor(Color c){ - if(couleurSousGraduation_!=c){ - couleurSousGraduation_=c; - grilleChanged(); - } + public boolean isCouleurModifiable() { + return true; + } - } + public int getTiretLength() { + return 3; + } - /** - * Accesseur de la propriete <I>boite</I>. Elle donne la position, la taille, le domaine de la grille. - */ - // public GrBoite getBoite() { - // return boite_; - // } - public GrBoite getDomaine() { - return null; - // GrBoite r = null; - // if (isVisible()) { - // GrBoite d = null; - // d = super.getDomaine(); - // r = getBoite(); - // if (d != null) { - // if (r == null) { - // r = d; - // } else { - // r = r.union(d); - // } - // } - // } - // return r; - } + public void paintDonnees(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { + GrBoite domaine = vue_.getAbstractCalque().getDomaine(); + final GrBoite zv = _clipReel.intersectionXY(domaine); - public GrBoite getDomaineOnSelected() { - return getDomaine(); - } + if (zv == null) { return; } + // updateBounds(zv); + final GrBoite targetBoite = new GrBoite(); + targetBoite.ajuste(0, 0, 0); + // la boite d'affichage - public boolean isCouleurModifiable() { - return true; - } + if (!_versEcran.isSame(getVersEcran())) { return; } + targetBoite.ajuste(getWidth(), getHeight(), 0); + final Color old = _g.getColor(); + final Font oldFont = _g.getFont(); + // la fonte + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + final TDoubleArrayList xValue = new TDoubleArrayList(20); + final TIntArrayList xStrWidth = new TIntArrayList(20); + final List xString = new ArrayList(20); + final NumberIterator it = new NumberIterator(); + final boolean isXPainted = drawX_ && zv.getMinX() < zv.getMaxX() && nbGraduationX_ > 0; - public int getTiretLength() { - return 3; - } + if (isXPainted) { + computeXValues(zv, _g, xValue, xStrWidth, xString, it); + } + double yMax = 0; + final TDoubleArrayList yValue = new TDoubleArrayList(20); + final TIntArrayList yStrWidth = new TIntArrayList(20); + final List yString = new ArrayList(20); + final boolean isYPainted = drawY_ && zv.getMinY() < zv.getMaxY() && nbGraduationY_ > 0; + if (isYPainted) { + yMax = computeYValues(_g, zv, yValue, yStrWidth, yString); + } - public void paintDonnees(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, - final GrBoite _clipReel) { - GrBoite domaine = vue_.getAbstractCalque().getDomaine(); - final GrBoite zv = _clipReel.intersectionXY(domaine); + // boolean rapide = isRapide(); + final GrMorphisme versEcran = _versEcran; + final int tiret = getTiretLength(); + final int marge = 1; + int absyAxe = (int) (targetBoite.getMinX() + yMax + 2 * marge + tiret); + final int margeBas = (font == null ? 0 : font.getSize()) + 2 * marge + tiret; + int ordxAxe = (int) (targetBoite.getMaxY() - margeBas); + vue_.setUserInsets(new Insets(3, absyAxe + 5, margeBas + 5, 3)); - if (zv == null) { return; } - // updateBounds(zv); - final GrBoite targetBoite = new GrBoite(); - targetBoite.ajuste(0, 0, 0); - // la boite d'affichage + final GrBoite ecranBoite = domaine.applique(_versEcran); + if (ecranBoite.getMinX() - 5 > absyAxe) { + absyAxe = (int) (ecranBoite.getMinX() - 5); + } + if (ecranBoite.getMaxY() + 5 < ordxAxe) { + ordxAxe = (int) (ecranBoite.getMaxY() + 5); + } + if (isXPainted) { + fillXZone(_g, targetBoite, absyAxe, ordxAxe, ecranBoite); - if (!_versEcran.isSame(getVersEcran())) { return; } - targetBoite.ajuste(getWidth(), getHeight(), 0); - final Color old = _g.getColor(); - final Font oldFont = _g.getFont(); - // la fonte - final Font font = getFont(); - if (font != null) { - _g.setFont(font); - } - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - final TDoubleArrayList xValue = new TDoubleArrayList(20); - final TIntArrayList xStrWidth = new TIntArrayList(20); - final List xString = new ArrayList(20); - final NumberIterator it = new NumberIterator(); - final boolean isXPainted = drawX_ && zv.getMinX() < zv.getMaxX() && nbGraduationX_ > 0; + } - if (isXPainted) { - computeXValues(zv, _g, xValue, xStrWidth, xString, it); - } - double yMax = 0; - final TDoubleArrayList yValue = new TDoubleArrayList(20); - final TIntArrayList yStrWidth = new TIntArrayList(20); - final List yString = new ArrayList(20); - final boolean isYPainted = drawY_ && zv.getMinY() < zv.getMaxY() && nbGraduationY_ > 0; - if (isYPainted) { - yMax = computeYValues(_g, zv, yValue, yStrWidth, yString); - } + // l'axe des x + final double maxXForAxe = ecranBoite.getMaxX() - marge; - // boolean rapide = isRapide(); - final GrMorphisme versEcran = _versEcran; - final int tiret = getTiretLength(); - final int marge = 1; - int absyAxe = (int) (targetBoite.getMinX() + yMax + 2 * marge + tiret); - final int margeBas = (font == null ? 0 : font.getSize()) + 2 * marge + tiret; - int ordxAxe = (int) (targetBoite.getMaxY() - margeBas); - vue_.setUserInsets(new Insets(3, absyAxe + 5, margeBas + 5, 3)); + // l'axe des y + final double minYForAxe = ecranBoite.getMinY() + marge; + // les graduation en x - final GrBoite ecranBoite = domaine.applique(_versEcran); - if (ecranBoite.getMinX() - 5 > absyAxe) { - absyAxe = (int) (ecranBoite.getMinX() - 5); - } - if (ecranBoite.getMaxY() + 5 < ordxAxe) { - ordxAxe = (int) (ecranBoite.getMaxY() + 5); - } - if (isXPainted) { - fillXZone(_g, targetBoite, absyAxe, ordxAxe, ecranBoite); + final int ascent = fm == null ? 0 : fm.getAscent(); + final int ordXString = ordxAxe + tiret + ascent; + if (isXPainted) { + drawXAxe(_g, zv, xValue, versEcran, absyAxe, ordxAxe, maxXForAxe); + drawXGraduations(_g, targetBoite, xValue, xStrWidth, xString, absyAxe, ordxAxe, ecranBoite, minYForAxe, + ordXString); + } - } + // y - // l'axe des x - final double maxXForAxe = ecranBoite.getMaxX() - marge; + if (isYPainted) { + fillYZone(_g, targetBoite, absyAxe, ecranBoite); + drawYaxe(_g, zv, xValue, yValue, versEcran, absyAxe, ordxAxe, minYForAxe); + drawYGraduations(_g, yValue, yStrWidth, yString, versEcran, marge, absyAxe, ordxAxe, ecranBoite, maxXForAxe); + } + _g.setColor(old); + _g.setFont(oldFont); + } - // l'axe des y - final double minYForAxe = ecranBoite.getMinY() + marge; - // les graduation en x + void fillXZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final int _ordxAxe, + final GrBoite _ecranBoite) { + if (_ecranBoite.getMaxX() > _ordxAxe) { + _g.setColor(vue_.getBackground()); + _g.fillRect(_absyAxe, _ordxAxe, (int) _targetBoite.getMaxX() - _absyAxe, (int) _targetBoite.getMaxY() - _ordxAxe); + } + } - final int ascent = fm == null ? 0 : fm.getAscent(); - final int ordXString = ordxAxe + tiret + ascent; - if (isXPainted) { - drawXAxe(_g, zv, xValue, versEcran, absyAxe, ordxAxe, maxXForAxe); - drawXGraduations(_g, targetBoite, xValue, xStrWidth, xString, absyAxe, ordxAxe, ecranBoite, minYForAxe, - ordXString); - } + private void fillYZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final GrBoite _ecranBoite) { + if (_ecranBoite.getMinX() < _absyAxe) { + _g.setColor(vue_.getBackground()); + _g.fillRect(0, 0, _absyAxe, (int) _targetBoite.getMaxY()); + } + } - // y + protected void drawYGraduations(final Graphics2D _g, final TDoubleArrayList _yValue, final TIntArrayList _yStrWidth, + final List _yString, final GrMorphisme _versEcran, final int _marge, final int _absyAxe, final int _ordxAxe, + final GrBoite _ecranBoite, final double _maxXForAxe) { + final int nb = _yString.size(); + final int tiret = getTiretLength(); + final Font font = getFont(); + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + final int ascent = fm == null ? 0 : fm.getAscent(); + int idxStr = -1; + final Color fg = getDrawColor(); + final Color subColor = getSubColor(); + GrPoint tmpSousGrille_ = new GrPoint(); + double longueurMoyenne = 0; + for (int i = 0; i < nb; i++) { + tmp_.y_ = _yValue.getQuick(i); + tmp_.autoApplique(_versEcran); + if (tmp_.y_ > _ordxAxe) { + continue; + } + if (tmp_.y_ < _ecranBoite.getMinY()) { + break; + } + // le tiret + tl_.setTypeTrait(TraceLigne.LISSE); + tl_.setCouleur(fg); + final int w = _yStrWidth.getQuick(i); + tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _absyAxe - (w > 0 ? tiret : tiret - 2), tmp_.y_); + if (w > 0 && (tmp_.y_ < idxStr || idxStr < 0)) { + _g.setColor(fg); + _g.drawString((String) _yString.get(i), (_absyAxe - w - tiret - _marge), (int) (tmp_.y_ + ascent / 2D)); + idxStr = (int) (tmp_.y_ - ascent / 2D - 3D); + } - if (isYPainted) { - fillYZone(_g, targetBoite, absyAxe, ecranBoite); - drawYaxe(_g, zv, xValue, yValue, versEcran, absyAxe, ordxAxe, minYForAxe); - drawYGraduations(_g, yValue, yStrWidth, yString, versEcran, marge, absyAxe, ordxAxe, ecranBoite, maxXForAxe); - } - _g.setColor(old); - _g.setFont(oldFont); - } + // -- on trace ou non les sous graduations --// + if ((w > 0 || i == nb - 2) && drawSousGrilleY_ && i > 0 && i < nb - 1) { + int valNextPotable = -1; + for (int j = i + 1; valNextPotable == -1 && j < _yStrWidth.size(); j++) + if (_yStrWidth.getQuick(j) > 0) valNextPotable = j; - void fillXZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite) { - if (_ecranBoite.getMaxX() > _ordxAxe) { - _g.setColor(vue_.getBackground()); - _g.fillRect(_absyAxe, _ordxAxe, (int) _targetBoite.getMaxX() - _absyAxe, (int) _targetBoite.getMaxY() - _ordxAxe); - } - } + if (i == nb - 2) { + // -- la fin il faut creer le nouveau + valNextPotable = nb - 1; + _yValue.set(valNextPotable, _yValue.get(i) + longueurMoyenne); + } - private void fillYZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final GrBoite _ecranBoite) { - if (_ecranBoite.getMinX() < _absyAxe) { - _g.setColor(vue_.getBackground()); - _g.fillRect(0, 0, _absyAxe, (int) _targetBoite.getMaxY()); - } - } + if (valNextPotable != -1) { - protected void drawYGraduations(final Graphics2D _g, final TDoubleArrayList _yValue, final TIntArrayList _yStrWidth, - final List _yString, final GrMorphisme _versEcran, final int _marge, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite, final double _maxXForAxe) { - final int nb = _yString.size(); - final int tiret = getTiretLength(); - final Font font = getFont(); - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - final int ascent = fm == null ? 0 : fm.getAscent(); - int idxStr = -1; - final Color fg = getDrawColor(); - final Color subColor = getSubColor(); - GrPoint tmpSousGrille_=new GrPoint(); - double longueurMoyenne=0; - for (int i = 0; i < nb; i++) { - tmp_.y_ = _yValue.getQuick(i); - tmp_.autoApplique(_versEcran); - if (tmp_.y_ > _ordxAxe) { - continue; - } - if (tmp_.y_ < _ecranBoite.getMinY()) { - break; - } - // le tiret - tl_.setTypeTrait(TraceLigne.LISSE); - tl_.setCouleur(fg); - final int w = _yStrWidth.getQuick(i); - tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _absyAxe - (w > 0 ? tiret : tiret - 2), tmp_.y_); - if (w > 0 && (tmp_.y_ < idxStr || idxStr < 0)) { - _g.setColor(fg); - _g.drawString((String) _yString.get(i), (_absyAxe - w - tiret - _marge), (int) (tmp_.y_ + ascent / 2D)); - idxStr = (int) (tmp_.y_ - ascent / 2D - 3D); - } - - - //-- on trace ou non les sous graduations --// - if((w > 0 || i==nb-2) && drawSousGrilleY_ && i>0 && i<nb-1){ - int valNextPotable=-1; - for(int j=i+1;valNextPotable==-1 &&j<_yStrWidth.size();j++) - if(_yStrWidth.getQuick(j)>0) - valNextPotable=j; - - if(i==nb-2){ - //-- la fin il faut creer le nouveau - valNextPotable=nb-1; - _yValue.set(valNextPotable,_yValue.get(i)+longueurMoyenne); - } - - if(valNextPotable!=-1){ + tmpSousGrille_.y_ = _yValue.getQuick(valNextPotable); + tmpSousGrille_.autoApplique(_versEcran); + double distanceEntre2Trait = Math.abs(tmpSousGrille_.y_ - tmp_.y_); + int nbSousGrilles = 0; + int taillePasSousgrille = 0; + if (!this.modeLongueurPasSousGradY_) { + // -- on trace des nombre de cesure --// + nbSousGrilles = this.getNbYSousGraduations(); + if (nbSousGrilles != 0) taillePasSousgrille = (int) ((distanceEntre2Trait) / nbSousGrilles); + } else { + // -- on trace des pas par longueur --// + double ratio = (_yValue.getQuick(valNextPotable) - _yValue.getQuick(i)); + if (ratio != 0) ratio = this.valeurPasSousGradY_ / ratio; - tmpSousGrille_.y_=_yValue.getQuick(valNextPotable); - tmpSousGrille_.autoApplique(_versEcran); - double distanceEntre2Trait=Math.abs(tmpSousGrille_.y_-tmp_.y_); - int nbSousGrilles=0; - int taillePasSousgrille=0; - if(!this.modeLongueurPasSousGradY_){ - //-- on trace des nombre de cesure --// - nbSousGrilles=this.getNbYSousGraduations(); - if(nbSousGrilles!=0) - taillePasSousgrille=(int) ((distanceEntre2Trait)/nbSousGrilles); - }else{ - //-- on trace des pas par longueur --// - double ratio=(_yValue.getQuick(valNextPotable)-_yValue.getQuick(i)); - if(ratio!=0) - ratio=this.valeurPasSousGradY_/ratio; + taillePasSousgrille = (int) (ratio * distanceEntre2Trait); + if (taillePasSousgrille != 0) nbSousGrilles = (int) (distanceEntre2Trait / taillePasSousgrille); + } + // -- si on a des bons pas et nb de grilles --// + if (nbSousGrilles > 0 && taillePasSousgrille > 0 && taillePasSousgrille < distanceEntre2Trait) { - taillePasSousgrille=(int) (ratio*distanceEntre2Trait); - if(taillePasSousgrille!=0) - nbSousGrilles=(int) (distanceEntre2Trait/taillePasSousgrille); - } - //-- si on a des bons pas et nb de grilles --// - if(nbSousGrilles>0 && taillePasSousgrille>0 && taillePasSousgrille<distanceEntre2Trait){ + for (int k = 0; k < nbSousGrilles + 1; k++) { + // -- on trace un trait de couleur de subgrid --// + tl_.setTypeTrait(TraceLigne.POINTILLE); + tl_.setEpaisseur((float) 0.1); + tl_.setCouleur(this.couleurSousGraduation_); + double longueur = ((k) * taillePasSousgrille); + tmpSousGrille_.autoApplique(_versEcran); + tl_.dessineTrait(_g, _absyAxe, tmp_.y_ + longueur, _maxXForAxe, tmp_.y_ + longueur); + } + longueurMoyenne = (int) (_yValue.getQuick(valNextPotable) - _yValue.getQuick(i)); + } - for(int k=0;k<nbSousGrilles+1;k++){ - //-- on trace un trait de couleur de subgrid --// - tl_.setTypeTrait(TraceLigne.POINTILLE); - tl_.setEpaisseur((float) 0.1); - tl_.setCouleur(this.couleurSousGraduation_); - double longueur=((k)*taillePasSousgrille); - tmpSousGrille_.autoApplique(_versEcran); - tl_.dessineTrait(_g,_absyAxe, tmp_.y_+longueur,_maxXForAxe,tmp_.y_+ longueur); - } - longueurMoyenne=(int) (_yValue.getQuick(valNextPotable)-_yValue.getQuick(i)); - } + } + } - } - } - - - if (drawGrid_ && w > 0) { - tl_.setTypeTrait(TraceLigne.TIRETE); - tl_.setEpaisseur(1); - tl_.setCouleur(subColor); - tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _maxXForAxe, tmp_.y_); - } - } - } + if (drawGrid_ && w > 0) { + tl_.setTypeTrait(TraceLigne.TIRETE); + tl_.setEpaisseur(1); + tl_.setCouleur(subColor); + tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _maxXForAxe, tmp_.y_); + } + } + } - private Color getSubColor() { - Color subColor = attenueCouleur(getForeground()); - if (isAttenue()) { - subColor = attenueCouleur(subColor); - } - return subColor; - } + private Color getSubColor() { + Color subColor = attenueCouleur(getForeground()); + if (isAttenue()) { + subColor = attenueCouleur(subColor); + } + return subColor; + } - private Color getDrawColor() { - Color fg = getForeground(); - if (isAttenue()) { - fg = attenueCouleur(fg); - } - return fg; - } + private Color getDrawColor() { + Color fg = getForeground(); + if (isAttenue()) { + fg = attenueCouleur(fg); + } + return fg; + } - final GrPoint tmp_ = new GrPoint(); + final GrPoint tmp_ = new GrPoint(); - private void drawXGraduations(final Graphics2D _g, final GrBoite _targetBoite, final TDoubleArrayList _xValue, - final TIntArrayList _xStrWidth, final List _xString, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite, final double _minYForAxe, final int _ordXString) { - final int nb = _xString.size(); - final Color fg = getDrawColor(); - final Color subColor = getSubColor(); - int idxStr = -1; - final GrMorphisme versEcran = getVersEcran(); - final int tiret = getTiretLength(); - final TraceLigne gtl = new TraceLigne(); - GrPoint tmpSousGrille_=new GrPoint(); - - double longueurMoyenne=0; - - for (int i = 0; i < nb; i++) { - tmp_.x_ = _xValue.getQuick(i); - tmp_.autoApplique(versEcran); - if (tmp_.x_ < _absyAxe) { - continue; - } - if (tmp_.x_ > _ecranBoite.getMaxX()) { - break; - } - // le tiret - gtl.setTypeTrait(TraceLigne.LISSE); - gtl.setCouleur(fg); - final int w = _xStrWidth.getQuick(i); - gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _ordxAxe + (w > 0 ? tiret : tiret - 2)); - if (w > 0) { - final int start = (int) (tmp_.x_ - w / 2D); - if (start > idxStr + 1 && start + w < _targetBoite.getMaxX()) { - _g.setColor(fg); - _g.drawString((String) _xString.get(i), start, _ordXString); - idxStr = start + w; - } - } + private void drawXGraduations(final Graphics2D _g, final GrBoite _targetBoite, final TDoubleArrayList _xValue, + final TIntArrayList _xStrWidth, final List _xString, final int _absyAxe, final int _ordxAxe, + final GrBoite _ecranBoite, final double _minYForAxe, final int _ordXString) { + final int nb = _xString.size(); + final Color fg = getDrawColor(); + final Color subColor = getSubColor(); + int idxStr = -1; + final GrMorphisme versEcran = getVersEcran(); + final int tiret = getTiretLength(); + final TraceLigne gtl = new TraceLigne(); + GrPoint tmpSousGrille_ = new GrPoint(); + double longueurMoyenne = 0; + for (int i = 0; i < nb; i++) { + tmp_.x_ = _xValue.getQuick(i); + tmp_.autoApplique(versEcran); + if (tmp_.x_ < _absyAxe) { + continue; + } + if (tmp_.x_ > _ecranBoite.getMaxX()) { + break; + } + // le tiret + gtl.setTypeTrait(TraceLigne.LISSE); + gtl.setCouleur(fg); + final int w = _xStrWidth.getQuick(i); + gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _ordxAxe + (w > 0 ? tiret : tiret - 2)); + if (w > 0) { + final int start = (int) (tmp_.x_ - w / 2D); + if (start > idxStr + 1 && start + w < _targetBoite.getMaxX()) { + _g.setColor(fg); + _g.drawString((String) _xString.get(i), start, _ordXString); + idxStr = start + w; + } + } - //-- on trace ou non les sous graduations --// - if((w > 0 || i==nb-2) && drawSousGrilleX_ && i<nb-1){ - int valNextPotable=-1; - for(int j=i+1;valNextPotable==-1 &&j<_xStrWidth.size();j++) - if(_xStrWidth.getQuick(j)>0) - valNextPotable=j; - if(i==nb-2){ - //-- la fin il faut creer le nouveau - valNextPotable=nb-1; - _xValue.set(valNextPotable,_xValue.get(i)+longueurMoyenne); - } - if(valNextPotable!=-1 ){ - - tmpSousGrille_.x_=_xValue.getQuick(valNextPotable); - tmpSousGrille_.autoApplique(versEcran); - double distanceEntre2Trait=Math.abs(tmpSousGrille_.x_-tmp_.x_); - int nbSousGrilles=0; - int taillePasSousgrille=0; - if(!this.modeLongueurPasSousGradX_){ - //-- on trace des nombre de cesure --// - nbSousGrilles=this.getNbXSousGraduations(); - if(nbSousGrilles!=0) - taillePasSousgrille=(int) ((distanceEntre2Trait)/nbSousGrilles); - }else{ - //-- on trace des pas par longueur --// - double ratio=(_xValue.getQuick(valNextPotable)-_xValue.getQuick(i)); - if(ratio!=0) - ratio=this.valeurPasSousGradX_/ratio; + // -- on trace ou non les sous graduations --// + if ((w > 0 || i == nb - 2) && drawSousGrilleX_ && i < nb - 1) { + int valNextPotable = -1; + for (int j = i + 1; valNextPotable == -1 && j < _xStrWidth.size(); j++) + if (_xStrWidth.getQuick(j) > 0) valNextPotable = j; + if (i == nb - 2) { + // -- la fin il faut creer le nouveau + valNextPotable = nb - 1; + _xValue.set(valNextPotable, _xValue.get(i) + longueurMoyenne); + } + if (valNextPotable != -1) { - taillePasSousgrille=(int) (ratio*distanceEntre2Trait); - if(taillePasSousgrille!=0) - nbSousGrilles=(int) (distanceEntre2Trait/taillePasSousgrille); - } - //-- si on a des bons pas et nb de grilles --// - if(nbSousGrilles>0 && taillePasSousgrille>0 && taillePasSousgrille<distanceEntre2Trait){ + tmpSousGrille_.x_ = _xValue.getQuick(valNextPotable); + tmpSousGrille_.autoApplique(versEcran); + double distanceEntre2Trait = Math.abs(tmpSousGrille_.x_ - tmp_.x_); + int nbSousGrilles = 0; + int taillePasSousgrille = 0; + if (!this.modeLongueurPasSousGradX_) { + // -- on trace des nombre de cesure --// + nbSousGrilles = this.getNbXSousGraduations(); + if (nbSousGrilles != 0) taillePasSousgrille = (int) ((distanceEntre2Trait) / nbSousGrilles); + } else { + // -- on trace des pas par longueur --// + double ratio = (_xValue.getQuick(valNextPotable) - _xValue.getQuick(i)); + if (ratio != 0) ratio = this.valeurPasSousGradX_ / ratio; - for(int k=0;k<nbSousGrilles+1;k++){ - //-- on trace un trait de couleur de subgrid --// - gtl.setTypeTrait(TraceLigne.POINTILLE); - gtl.setEpaisseur((float) 0.1); - gtl.setCouleur(this.couleurSousGraduation_); - double longueur=((k)*taillePasSousgrille); - tmpSousGrille_.autoApplique(versEcran); - gtl.dessineTrait(_g, tmp_.x_+longueur, _ordxAxe,tmp_.x_+ longueur, _minYForAxe); - } - - longueurMoyenne=(int) (_xValue.getQuick(valNextPotable)-_xValue.getQuick(i)); - } + taillePasSousgrille = (int) (ratio * distanceEntre2Trait); + if (taillePasSousgrille != 0) nbSousGrilles = (int) (distanceEntre2Trait / taillePasSousgrille); + } + // -- si on a des bons pas et nb de grilles --// + if (nbSousGrilles > 0 && taillePasSousgrille > 0 && taillePasSousgrille < distanceEntre2Trait) { - } - } - if (drawGrid_ && w > 0) { - gtl.setTypeTrait(TraceLigne.TIRETE); - gtl.setCouleur(subColor); - gtl.setEpaisseur((float) 1); - gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _minYForAxe); - } + for (int k = 0; k < nbSousGrilles + 1; k++) { + // -- on trace un trait de couleur de subgrid --// + gtl.setTypeTrait(TraceLigne.POINTILLE); + gtl.setEpaisseur((float) 0.1); + gtl.setCouleur(this.couleurSousGraduation_); + double longueur = ((k) * taillePasSousgrille); + tmpSousGrille_.autoApplique(versEcran); + gtl.dessineTrait(_g, tmp_.x_ + longueur, _ordxAxe, tmp_.x_ + longueur, _minYForAxe); + } - } - } + longueurMoyenne = (int) (_xValue.getQuick(valNextPotable) - _xValue.getQuick(i)); + } - private void drawYaxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, - final TDoubleArrayList _yValue, final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, - final double _minYForAxe) { - int minYDraw = _ordxAxe; - int maxYDraw = (int) _minYForAxe; + } + } + if (drawGrid_ && w > 0) { + gtl.setTypeTrait(TraceLigne.TIRETE); + gtl.setCouleur(subColor); + gtl.setEpaisseur((float) 1); + gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _minYForAxe); + } - // if (useCustom_) { - // tmp_.y_ = _zv.getMinY(); - // if (_yValue.size() > 0) { - // tmp_.y_ = Math.min(_yValue.get(0), tmp_.y_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.y_ = Math.floor(tmp_.y_); - // if (tmp_.y_ > minYDraw) { - // minYDraw = (int) tmp_.y_; - // } - // tmp_.y_ = _zv.getMaxY(); - // if (_yValue.size() > 1) { - // tmp_.y_ = Math.max(_yValue.get(_yValue.size() - 1), tmp_.y_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.y_ = Math.ceil(tmp_.y_); - // if (tmp_.y_ < maxYDraw) { - // maxYDraw = (int) tmp_.y_; - // } - // } - tl_.setCouleur(getDrawColor()); - tl_.setTypeTrait(TraceLigne.LISSE); - tl_.dessineTrait(_g, _absyAxe, minYDraw, _absyAxe, maxYDraw); - } + } + } - final TraceLigne tl_ = new TraceLigne(); + private void drawYaxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, + final TDoubleArrayList _yValue, final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, + final double _minYForAxe) { + int minYDraw = _ordxAxe; + int maxYDraw = (int) _minYForAxe; - private void drawXAxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, - final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, final double _maxXForAxe) { - int minXDraw = _absyAxe; - int maxXDraw = (int) _maxXForAxe; + // if (useCustom_) { + // tmp_.y_ = _zv.getMinY(); + // if (_yValue.size() > 0) { + // tmp_.y_ = Math.min(_yValue.get(0), tmp_.y_); + // } + // tmp_.autoApplique(_versEcran); + // tmp_.y_ = Math.floor(tmp_.y_); + // if (tmp_.y_ > minYDraw) { + // minYDraw = (int) tmp_.y_; + // } + // tmp_.y_ = _zv.getMaxY(); + // if (_yValue.size() > 1) { + // tmp_.y_ = Math.max(_yValue.get(_yValue.size() - 1), tmp_.y_); + // } + // tmp_.autoApplique(_versEcran); + // tmp_.y_ = Math.ceil(tmp_.y_); + // if (tmp_.y_ < maxYDraw) { + // maxYDraw = (int) tmp_.y_; + // } + // } + tl_.setCouleur(getDrawColor()); + tl_.setTypeTrait(TraceLigne.LISSE); + tl_.dessineTrait(_g, _absyAxe, minYDraw, _absyAxe, maxYDraw); + } - // if (useCustom_) { - // tmp_.x_ = _zv.getMinX(); - // if (_xValue.size() > 0) { - // tmp_.x_ = Math.min(_xValue.get(0), tmp_.x_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.x_ = Math.floor(tmp_.x_); - // if (tmp_.x_ < minXDraw) { - // minXDraw = (int) tmp_.x_; - // } - // tmp_.x_ = _zv.getMaxX(); - // if (_xValue.size() > 1) { - // tmp_.x_ = Math.max(_xValue.get(_xValue.size() - 1), tmp_.x_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.x_ = Math.ceil(tmp_.x_); - // if (tmp_.x_ < maxXDraw) { - // maxXDraw = (int) tmp_.x_; - // } - // } + final TraceLigne tl_ = new TraceLigne(); - tl_.setCouleur(getDrawColor()); - tl_.setTypeTrait(TraceLigne.LISSE); - tl_.dessineTrait(_g, minXDraw, _ordxAxe, maxXDraw, _ordxAxe); - } + private void drawXAxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, + final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, final double _maxXForAxe) { + int minXDraw = _absyAxe; + int maxXDraw = (int) _maxXForAxe; - private void computeXValues(final GrBoite _zv, final Graphics2D _g, final TDoubleArrayList _xValue, - final TIntArrayList _xStrWidth, final List _xString, final NumberIterator _it) { - final Font font = getFont(); - if (font != null) { - _g.setFont(font); - } - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + tl_.setCouleur(getDrawColor()); + tl_.setTypeTrait(TraceLigne.LISSE); + tl_.dessineTrait(_g, minXDraw, _ordxAxe, maxXDraw, _ordxAxe); + } - //-- mode manuel --// - if(!modeAutomatiqueX_){ - if(modeLongueurPasX_) - fillGraduationsWithPas(_g,this.valeurPasX_, _zv.getMinX(), _zv.getMaxX(), _xValue, _xStrWidth, _xString, fm); - else - fillGraduations(_g,getNbXGraduations(), _zv.getMinX(), _zv.getMaxX(), _xValue, _xStrWidth, _xString, fm); - return; - } + private void computeXValues(final GrBoite _zv, final Graphics2D _g, final TDoubleArrayList _xValue, + final TIntArrayList _xStrWidth, final List _xString, final NumberIterator _it) { + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - _it.init(_zv.getMinX(), _zv.getMaxX(), getNbXGraduations()); + // -- mode manuel --// + if (!modeAutomatiqueX_) { + if (modeLongueurPasX_) fillGraduationsWithPas(_g, this.valeurPasX_, _zv.getMinX(), _zv.getMaxX(), _xValue, + _xStrWidth, _xString, fm); + else fillGraduations(_g, getNbXGraduations(), _zv.getMinX(), _zv.getMaxX(), _xValue, _xStrWidth, _xString, fm); + return; + } - //_it= - while (_it.hasNext()) { - final double x = _it.currentValue(); - _xValue.add(x); + _it.init(_zv.getMinX(), _zv.getMaxX(), getNbXGraduations()); - if (font == null || !_it.isMajorTick()) { - _xStrWidth.add(0); - _xString.add(CtuluLibString.EMPTY_STRING); - } else { - final String currentLabel = _it.currentLabel(); - _xStrWidth.add(fm.stringWidth(currentLabel)); - _xString.add(currentLabel); - } - _it.next(); - } - } + // _it= + while (_it.hasNext()) { + final double x = _it.currentValue(); + _xValue.add(x); + if (font == null || !_it.isMajorTick()) { + _xStrWidth.add(0); + _xString.add(CtuluLibString.EMPTY_STRING); + } else { + final String currentLabel = _it.currentLabel(); + _xStrWidth.add(fm.stringWidth(currentLabel)); + _xString.add(currentLabel); + } + _it.next(); + } + } - public boolean isModeAutomatiqueX() { - return modeAutomatiqueX_; - } + public boolean isModeAutomatiqueX() { + return modeAutomatiqueX_; + } - public void setModeAutomatiqueX(boolean modeAutomatiqueX) { - this.modeAutomatiqueX_ = modeAutomatiqueX; - } + public void setModeAutomatiqueX(boolean modeAutomatiqueX) { + this.modeAutomatiqueX_ = modeAutomatiqueX; + } - public boolean isModeAutomatiqueY() { - return modeAutomatiqueY_; - } + public boolean isModeAutomatiqueY() { + return modeAutomatiqueY_; + } - public void setModeAutomatiqueY(boolean modeAutomatiqueY) { - this.modeAutomatiqueY_ = modeAutomatiqueY; - } + public void setModeAutomatiqueY(boolean modeAutomatiqueY) { + this.modeAutomatiqueY_ = modeAutomatiqueY; + } - /** - * Remplit les graduations correctement: nb cesures= nombre de trait sur l'ecran - * que ce soit pour le mode par taille de pas ou par nb de cesures. - * @param nbGraduations - * @param min - * @param max - * @param _xValue - * @param _xStrWidth - * @param _xString - */ - private double fillGraduations(Graphics2D _g,int nbGraduations,double min,double max,final TDoubleArrayList _xValue,final TIntArrayList _xStrWidth,final List _xString,FontMetrics fm ){ + /** + * Remplit les graduations correctement: nb cesures= nombre de trait sur l'ecran que ce soit pour le mode par taille + * de pas ou par nb de cesures. + * + * @param nbGraduations + * @param min + * @param max + * @param _xValue + * @param _xStrWidth + * @param _xString + */ + private double fillGraduations(Graphics2D _g, int nbGraduations, double min, double max, + final TDoubleArrayList _xValue, final TIntArrayList _xStrWidth, final List _xString, FontMetrics fm) { - //-- distance tot a couvrir --// - final double distance=max-min; - final int taillePas=(int) (distance/nbGraduations); - double yMax=0; + // -- distance tot a couvrir --// + final double distance = max - min;// e + final int taillePas = Math.max(1, (int) (distance / nbGraduations));// FREd ne fonctionne pas toujours si on a des + // valeurs <1 - for(int i=0;i<nbGraduations+1;i++){ - int cesure=(int) (min+(taillePas*(i))); - _xValue.add(cesure); - final String currentLabel =""+cesure; - _xStrWidth.add(fm.stringWidth(currentLabel)); - _xString.add(currentLabel); + double yMax = 0; + // boucle infinie ! - final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); - if (stringWidth > yMax) { - yMax = stringWidth; - } - if(i==nbGraduations) - if(cesure<max) - nbGraduations++; - } - return yMax; + for (int i = 0; i < nbGraduations + 1; i++) { + int cesure = (int) (min + (taillePas * (i))); + _xValue.add(cesure); + final String currentLabel = Integer.toString(cesure); + _xStrWidth.add(fm.stringWidth(currentLabel)); + _xString.add(currentLabel); + final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); + if (stringWidth > yMax) { + yMax = stringWidth; + } + // boucle infinie ! + if (i == nbGraduations) if (cesure < max) nbGraduations++; + // Fred truc tempo pour eviter les crashs + if (i > 100) break; + } + return yMax; - } + } + /** + * Remplit les graduations correctement: nb cesures= nombre de trait sur l'ecran que ce soit pour le mode par taille + * de pas ou par nb de cesures. + * + * @param nbGraduations + * @param min + * @param max + * @param _xValue + * @param _xStrWidth + * @param _xString + */ + private double fillGraduationsWithPas(Graphics2D _g, int pas, double min, double max, final TDoubleArrayList _xValue, + final TIntArrayList _xStrWidth, final List _xString, FontMetrics fm) { - /** - * Remplit les graduations correctement: nb cesures= nombre de trait sur l'ecran - * que ce soit pour le mode par taille de pas ou par nb de cesures. - * @param nbGraduations - * @param min - * @param max - * @param _xValue - * @param _xStrWidth - * @param _xString - */ - private double fillGraduationsWithPas(Graphics2D _g,int pas,double min,double max,final TDoubleArrayList _xValue,final TIntArrayList _xStrWidth,final List _xString,FontMetrics fm ){ + // -- distance tot a couvrir --// + final double distance = max - min; + final int taillePas = pas; + if (pas == 0) return 0; + int nbGraduations = (int) (distance / taillePas); + double yMax = 0; - //-- distance tot a couvrir --// - final double distance=max-min; - final int taillePas= pas; - if(pas==0) - return 0; - int nbGraduations=(int) (distance/taillePas); - double yMax=0; + for (int i = 0; i < nbGraduations + 1; i++) { + int cesure = (int) (min + (taillePas * (i))); + _xValue.add(cesure); + final String currentLabel = Integer.toString(cesure); + _xStrWidth.add(fm.stringWidth(currentLabel)); + _xString.add(currentLabel); - for(int i=0;i<nbGraduations+1;i++){ - int cesure=(int) (min+(taillePas*(i))); - _xValue.add(cesure); - final String currentLabel =""+cesure; - _xStrWidth.add(fm.stringWidth(currentLabel)); - _xString.add(currentLabel); + final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); + if (stringWidth > yMax) { + yMax = stringWidth; + } - final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); - if (stringWidth > yMax) { - yMax = stringWidth; - } - - if(i==nbGraduations){ - if(cesure<max) - nbGraduations++; - } + if (i == nbGraduations) { + if (cesure < max) nbGraduations++;// ATTENTION boucle infinie ! + } + if (i > 100) break;// a enlever bugfix temporaire. - } - return yMax; + } + return yMax; + } - } + private double computeYValues(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _yValue, + final TIntArrayList _yStrWidth, final List _yString) { + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + double yMax = 0; + NumberIterator it; - private double computeYValues(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _yValue, - final TIntArrayList _yStrWidth, final List _yString) { - final Font font = getFont(); - if (font != null) { - _g.setFont(font); - } - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - double yMax = 0; - NumberIterator it; + // -- mode manuel --// + if (!modeAutomatiqueY_) { + if (modeLongueurPasY_) yMax = fillGraduationsWithPas(_g, this.valeurPasY_, _zv.getMinY(), _zv.getMaxY(), _yValue, + _yStrWidth, _yString, fm); + else yMax = fillGraduations(_g, nbGraduationY_, _zv.getMinY(), _zv.getMaxY(), _yValue, _yStrWidth, _yString, fm); + return yMax; + } + it = new NumberIterator(); + it.init(_zv.getMinY(), _zv.getMaxY(), getNbYGraduations()); + while (it.hasNext()) { + final double x = it.currentValue(); + _yValue.add(x); + if (font == null || !it.isMajorTick()) { + _yStrWidth.add(0); + _yString.add(CtuluLibString.EMPTY_STRING); + } else { + final String currentLabel = it.currentLabel(); + final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); + if (stringWidth > yMax) { + yMax = stringWidth; + } + _yStrWidth.add((int) stringWidth); + _yString.add(currentLabel); + } + it.next(); + } + return yMax; + } - //-- mode manuel --// - if(!modeAutomatiqueY_){ - if(modeLongueurPasY_) - yMax=fillGraduationsWithPas(_g,this.valeurPasY_, _zv.getMinY(), _zv.getMaxY(), _yValue, _yStrWidth, _yString, fm); - else - yMax=fillGraduations(_g,nbGraduationY_, _zv.getMinY(), _zv.getMaxY(), _yValue, _yStrWidth, _yString, fm); - return yMax; - } + // private void updateBounds(final GrBoite _zv) { + // if (useCustom_ && customBounds_ != null) { + // _zv.o_.x_ = Math.max(_zv.o_.x_, customBounds_.getMinX()); + // _zv.e_.x_ = Math.min(_zv.e_.x_, customBounds_.getMaxX()); + // _zv.o_.y_ = Math.max(_zv.o_.y_, customBounds_.getMinY()); + // _zv.e_.y_ = Math.min(_zv.e_.y_, customBounds_.getMaxY()); + // } + // } - it = new NumberIterator(); - it.init(_zv.getMinY(), _zv.getMaxY(), getNbYGraduations()); - while (it.hasNext()) { + // Icon + /** + * Dessin de l'icone. + * + * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null</I>. Il + * est ignore ici. + * @param _g le graphics sur lequel dessiner l'icone + * @param _x lieu cible de l'icone (x) + * @param _y lieu cible de l'icone (y) + */ + public void paintIcon(final Component _c, final Graphics _g, final int _x, final int _y) { + super.paintIcon(_c, _g, _x, _y); + Color fg = getForeground(); + if (isAttenue()) { + fg = attenueCouleur(fg); + } + _g.setColor(fg); + final int w = getIconWidth(); + final int h = getIconHeight(); + for (int i = 6; i < w - 2; i += 8) { + _g.drawLine(_x + i, _y + 1, _x + i, _y + h - 1); + } + for (int j = 6; j < h - 2; j += 8) { + _g.drawLine(_x + 1, _y + j, _x + w - 1, _y + j); + } + } - final double x = it.currentValue(); - _yValue.add(x); - if (font == null || !it.isMajorTick()) { - _yStrWidth.add(0); - _yString.add(CtuluLibString.EMPTY_STRING); - } else { - final String currentLabel = it.currentLabel(); - final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); - if (stringWidth > yMax) { - yMax = stringWidth; - } - _yStrWidth.add((int) stringWidth); - _yString.add(currentLabel); - } - it.next(); - } - return yMax; - } + public void paintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, + final GrBoite _clipReel) {} - // private void updateBounds(final GrBoite _zv) { - // if (useCustom_ && customBounds_ != null) { - // _zv.o_.x_ = Math.max(_zv.o_.x_, customBounds_.getMinX()); - // _zv.e_.x_ = Math.min(_zv.e_.x_, customBounds_.getMaxX()); - // _zv.o_.y_ = Math.max(_zv.o_.y_, customBounds_.getMinY()); - // _zv.e_.y_ = Math.min(_zv.e_.y_, customBounds_.getMaxY()); - // } - // } + public CtuluListSelection selection(final GrPoint _pt, final int _tolerance) { + return null; + } - // Icon - /** - * Dessin de l'icone. - * - * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null</I>. Il - * est ignore ici. - * @param _g le graphics sur lequel dessiner l'icone - * @param _x lieu cible de l'icone (x) - * @param _y lieu cible de l'icone (y) - */ - public void paintIcon(final Component _c, final Graphics _g, final int _x, final int _y) { - super.paintIcon(_c, _g, _x, _y); - Color fg = getForeground(); - if (isAttenue()) { - fg = attenueCouleur(fg); - } - _g.setColor(fg); - final int w = getIconWidth(); - final int h = getIconHeight(); - for (int i = 6; i < w - 2; i += 8) { - _g.drawLine(_x + i, _y + 1, _x + i, _y + h - 1); - } - for (int j = 6; j < h - 2; j += 8) { - _g.drawLine(_x + 1, _y + j, _x + w - 1, _y + j); - } - } + public CtuluListSelection selection(final LinearRing _poly, final int _mode) { + return null; + } - public void paintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, - final GrBoite _clipReel) {} + public LineString getSelectedLine() { + return null; + } - public CtuluListSelection selection(final GrPoint _pt, final int _tolerance) { - return null; - } + /** + * Affectation de la propriete <I>boite</I>. + */ + // public void setBoite(final GrBoite _v) { + // if (boite_ != _v) { + // final GrBoite vp = boite_; + // boite_ = _v; + // firePropertyChange("boite", vp, _v); + // } + // } + public void setVisible(final boolean _v) { + // if (_v && boite_ == null) { + // boite_ = vue_.getAbstractCalque().getDomaine(); + // } + if (!_v) { + vue_.setUserInsets(null); + super.setVisible(false); + } else { + super.setVisible(_v); + } + firePropertyChange("grille", true, false); - public CtuluListSelection selection(final LinearRing _poly, final int _mode) { - return null; - } + } - public LineString getSelectedLine() { - return null; - } + public boolean isDrawGrid() { + return drawGrid_; + } - /** - * Affectation de la propriete <I>boite</I>. - */ - // public void setBoite(final GrBoite _v) { - // if (boite_ != _v) { - // final GrBoite vp = boite_; - // boite_ = _v; - // firePropertyChange("boite", vp, _v); - // } - // } - public void setVisible(final boolean _v) { - // if (_v && boite_ == null) { - // boite_ = vue_.getAbstractCalque().getDomaine(); - // } - if (!_v) { - vue_.setUserInsets(null); - super.setVisible(false); - } else { - super.setVisible(_v); - } - firePropertyChange("grille", true, false); + public void setDrawGrid(final boolean _drawGrid) { + if (_drawGrid != drawGrid_) { + drawGrid_ = _drawGrid; + grilleChanged(); + } + } - } + // public boolean isUseCustom() { + // return useCustom_; + // } + // + // public void setUseCustom(final boolean _useCustom) { + // if (useCustom_ != _useCustom) { + // useCustom_ = _useCustom; + // repaint(); + // } + // } + // + // public Envelope getCustomBounds() { + // return customBounds_ == null ? null : new Envelope(customBounds_); + // } + // + // public void setCustomBounds(final Envelope _customBounds) { + // if (customBounds_ != _customBounds) { + // customBounds_ = _customBounds; + // repaint(); + // } + // } - public boolean isDrawGrid() { - return drawGrid_; - } + public boolean isDrawX() { + return drawX_; + } - public void setDrawGrid(final boolean _drawGrid) { - if (_drawGrid != drawGrid_) { - drawGrid_ = _drawGrid; - grilleChange... [truncated message content] |
From: <had...@us...> - 2009-02-02 19:34:03
|
Revision: 4436 http://fudaa.svn.sourceforge.net/fudaa/?rev=4436&view=rev Author: hadouxad Date: 2009-02-02 19:33:52 +0000 (Mon, 02 Feb 2009) Log Message: ----------- GRILLES ET SOUS GRILLES !!! Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java 2009-02-02 16:00:39 UTC (rev 4435) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueGrille.java 2009-02-02 19:33:52 UTC (rev 4436) @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.List; +import org.apache.tools.ant.filters.TailFilter; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.iterator.NumberIterator; @@ -41,579 +42,974 @@ * @author Guillaume Desnoix */ public class ZCalqueGrille extends ZCalqueAffichageDonnees { - // Proprietes - // private GrBoite boite_; - boolean drawGrid_; - boolean drawX_ = true; - boolean drawY_ = true; - // Envelope customBounds_; - // boolean useCustom_; + // Proprietes + // private GrBoite boite_; + boolean drawGrid_; + boolean drawX_ = true; + boolean drawY_ = true; + // Envelope customBounds_; + // boolean useCustom_; - int nbGraduationX_ = 10; - int nbGraduationY_ = 10; + int nbGraduationX_ = 10; + int nbGraduationY_ = 10; - final BVueCalque vue_; + //-- sous graduations --// + int nbSousGraduationX_ = 2; + //-- sous graduations --// + int nbSousGraduationY_ = 2; - public ZCalqueGrille(final BVueCalque _vue) { - super(); - vue_ = _vue; - setDestructible(false); - setName("cqGrille"); - setTitle(EbliLib.getS("Grille")); - // setForeground(new Color(204, 153, 0)); - setForeground(Color.BLACK); - } + final BVueCalque vue_; - public void paintAllInImage(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, - final GrBoite _clipReel) { - // super.paintAllInImage(_g, _versEcran, _versReel, _clipReel); - } - public void changeZoom(double minx, double miny, double maxx, double maxy) { - vue_.changeViewBoite(this, new GrBoite(new GrPoint(minx, miny, 0), new GrPoint(maxx, maxy, 0)), false); - } + /** + * Indique la facon de calculer les graduations. + * pour l'axe des x. + */ + boolean modeAutomatiqueX_=false; + /** + * Indique la facon de calculer les graduations. + * pour l'axe des y. + */ + boolean modeAutomatiqueY_=false; - public int getNbXGraduations() { - return nbGraduationX_; - } - public int getNbYGraduations() { - return nbGraduationY_; - } - /** - * Accesseur de la propriete <I>boite</I>. Elle donne la position, la taille, le domaine de la grille. - */ - // public GrBoite getBoite() { - // return boite_; - // } - public GrBoite getDomaine() { - return null; - // GrBoite r = null; - // if (isVisible()) { - // GrBoite d = null; - // d = super.getDomaine(); - // r = getBoite(); - // if (d != null) { - // if (r == null) { - // r = d; - // } else { - // r = r.union(d); - // } - // } - // } - // return r; - } - public GrBoite getDomaineOnSelected() { - return getDomaine(); - } + /** + * Indique si on utilise par taille de pas ou par nombre de graduations + */ + boolean modeLongueurPasX_=false; + boolean modeLongueurPasY_=false; - public boolean isCouleurModifiable() { - return true; - } + /** + * Valeur du pas que devront suivrent tous les traits de la grilles si on en mode taille pas. + */ + int valeurPasX_; + int valeurPasY_; - public int getTiretLength() { - return 3; - } + boolean drawSousGrilleX_ = false; + boolean drawSousGrilleY_ = false; - public void paintDonnees(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, - final GrBoite _clipReel) { - GrBoite domaine = vue_.getAbstractCalque().getDomaine(); - final GrBoite zv = _clipReel.intersectionXY(domaine); + boolean modeLongueurPasSousGradX_=false; + boolean modeLongueurPasSousGradY_=false; - if (zv == null) { return; } - // updateBounds(zv); - final GrBoite targetBoite = new GrBoite(); - targetBoite.ajuste(0, 0, 0); - // la boite d'affichage + int valeurPasSousGradX_; + int valeurPasSousGradY_; - if (!_versEcran.isSame(getVersEcran())) { return; } - targetBoite.ajuste(getWidth(), getHeight(), 0); - final Color old = _g.getColor(); - final Font oldFont = _g.getFont(); - // la fonte - final Font font = getFont(); - if (font != null) { - _g.setFont(font); - } - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - final TDoubleArrayList xValue = new TDoubleArrayList(20); - final TIntArrayList xStrWidth = new TIntArrayList(20); - final List xString = new ArrayList(20); - final NumberIterator it = new NumberIterator(); - final boolean isXPainted = drawX_ && zv.getMinX() < zv.getMaxX() && nbGraduationX_ > 0; + private Color couleurSousGraduation_=Color.blue; - if (isXPainted) { - computeXValues(zv, _g, xValue, xStrWidth, xString, it); - } - double yMax = 0; - final TDoubleArrayList yValue = new TDoubleArrayList(20); - final TIntArrayList yStrWidth = new TIntArrayList(20); - final List yString = new ArrayList(20); - final boolean isYPainted = drawY_ && zv.getMinY() < zv.getMaxY() && nbGraduationY_ > 0; - if (isYPainted) { - yMax = computeYValues(_g, zv, yValue, yStrWidth, yString); - } + public ZCalqueGrille(final BVueCalque _vue) { + super(); + vue_ = _vue; + setDestructible(false); + setName("cqGrille"); + setTitle(EbliLib.getS("Grille")); + // setForeground(new Color(204, 153, 0)); + setForeground(Color.BLACK); + } - // boolean rapide = isRapide(); - final GrMorphisme versEcran = _versEcran; - final int tiret = getTiretLength(); - final int marge = 1; - int absyAxe = (int) (targetBoite.getMinX() + yMax + 2 * marge + tiret); - final int margeBas = (font == null ? 0 : font.getSize()) + 2 * marge + tiret; - int ordxAxe = (int) (targetBoite.getMaxY() - margeBas); - vue_.setUserInsets(new Insets(3, absyAxe + 5, margeBas + 5, 3)); + public void paintAllInImage(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { + // super.paintAllInImage(_g, _versEcran, _versReel, _clipReel); + } - final GrBoite ecranBoite = domaine.applique(_versEcran); - if (ecranBoite.getMinX() - 5 > absyAxe) { - absyAxe = (int) (ecranBoite.getMinX() - 5); - } - if (ecranBoite.getMaxY() + 5 < ordxAxe) { - ordxAxe = (int) (ecranBoite.getMaxY() + 5); - } - if (isXPainted) { - fillXZone(_g, targetBoite, absyAxe, ordxAxe, ecranBoite); + public void changeZoom(double minx, double miny, double maxx, double maxy) { + vue_.changeViewBoite(this, new GrBoite(new GrPoint(minx, miny, 0), new GrPoint(maxx, maxy, 0)), false); + } - } + public int getNbXGraduations() { + return nbGraduationX_; + } - // l'axe des x - final double maxXForAxe = ecranBoite.getMaxX() - marge; + public int getNbYGraduations() { + return nbGraduationY_; + } - // l'axe des y - final double minYForAxe = ecranBoite.getMinY() + marge; - // les graduation en x + public int getNbXSousGraduations() { + return nbSousGraduationX_; + } - final int ascent = fm == null ? 0 : fm.getAscent(); - final int ordXString = ordxAxe + tiret + ascent; - if (isXPainted) { - drawXAxe(_g, zv, xValue, versEcran, absyAxe, ordxAxe, maxXForAxe); - drawXGraduations(_g, targetBoite, xValue, xStrWidth, xString, absyAxe, ordxAxe, ecranBoite, minYForAxe, - ordXString); - } + public int getNbYSousGraduations() { + return nbSousGraduationY_; + } - // y + public void setSousGraduationColor(Color c){ + if(couleurSousGraduation_!=c){ + couleurSousGraduation_=c; + grilleChanged(); + } - if (isYPainted) { - fillYZone(_g, targetBoite, absyAxe, ecranBoite); - drawYaxe(_g, zv, xValue, yValue, versEcran, absyAxe, ordxAxe, minYForAxe); - drawYGraduations(_g, yValue, yStrWidth, yString, versEcran, marge, absyAxe, ordxAxe, ecranBoite, maxXForAxe); - } - _g.setColor(old); - _g.setFont(oldFont); - } + } - void fillXZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite) { - if (_ecranBoite.getMaxX() > _ordxAxe) { - _g.setColor(vue_.getBackground()); - _g.fillRect(_absyAxe, _ordxAxe, (int) _targetBoite.getMaxX() - _absyAxe, (int) _targetBoite.getMaxY() - _ordxAxe); - } - } + /** + * Accesseur de la propriete <I>boite</I>. Elle donne la position, la taille, le domaine de la grille. + */ + // public GrBoite getBoite() { + // return boite_; + // } + public GrBoite getDomaine() { + return null; + // GrBoite r = null; + // if (isVisible()) { + // GrBoite d = null; + // d = super.getDomaine(); + // r = getBoite(); + // if (d != null) { + // if (r == null) { + // r = d; + // } else { + // r = r.union(d); + // } + // } + // } + // return r; + } - private void fillYZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final GrBoite _ecranBoite) { - if (_ecranBoite.getMinX() < _absyAxe) { - _g.setColor(vue_.getBackground()); - _g.fillRect(0, 0, _absyAxe, (int) _targetBoite.getMaxY()); - } - } + public GrBoite getDomaineOnSelected() { + return getDomaine(); + } - protected void drawYGraduations(final Graphics2D _g, final TDoubleArrayList _yValue, final TIntArrayList _yStrWidth, - final List _yString, final GrMorphisme _versEcran, final int _marge, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite, final double _maxXForAxe) { - final int nb = _yString.size(); - final int tiret = getTiretLength(); - final Font font = getFont(); - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - final int ascent = fm == null ? 0 : fm.getAscent(); - int idxStr = -1; - final Color fg = getDrawColor(); - final Color subColor = getSubColor(); - for (int i = 0; i < nb; i++) { - tmp_.y_ = _yValue.getQuick(i); - tmp_.autoApplique(_versEcran); - if (tmp_.y_ > _ordxAxe) { - continue; - } - if (tmp_.y_ < _ecranBoite.getMinY()) { - break; - } - // le tiret - tl_.setTypeTrait(TraceLigne.LISSE); - tl_.setCouleur(fg); - final int w = _yStrWidth.getQuick(i); - tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _absyAxe - (w > 0 ? tiret : tiret - 2), tmp_.y_); - if (w > 0 && (tmp_.y_ < idxStr || idxStr < 0)) { - _g.setColor(fg); - _g.drawString((String) _yString.get(i), (_absyAxe - w - tiret - _marge), (int) (tmp_.y_ + ascent / 2D)); - idxStr = (int) (tmp_.y_ - ascent / 2D - 3D); - } - if (drawGrid_ && w > 0) { - tl_.setTypeTrait(TraceLigne.TIRETE); - tl_.setCouleur(subColor); - tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _maxXForAxe, tmp_.y_); - } - } - } + public boolean isCouleurModifiable() { + return true; + } - private Color getSubColor() { - Color subColor = attenueCouleur(getForeground()); - if (isAttenue()) { - subColor = attenueCouleur(subColor); - } - return subColor; - } + public int getTiretLength() { + return 3; + } - private Color getDrawColor() { - Color fg = getForeground(); - if (isAttenue()) { - fg = attenueCouleur(fg); - } - return fg; - } + public void paintDonnees(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { + GrBoite domaine = vue_.getAbstractCalque().getDomaine(); + final GrBoite zv = _clipReel.intersectionXY(domaine); - final GrPoint tmp_ = new GrPoint(); + if (zv == null) { return; } + // updateBounds(zv); + final GrBoite targetBoite = new GrBoite(); + targetBoite.ajuste(0, 0, 0); + // la boite d'affichage - private void drawXGraduations(final Graphics2D _g, final GrBoite _targetBoite, final TDoubleArrayList _xValue, - final TIntArrayList _xStrWidth, final List _xString, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite, final double _minYForAxe, final int _ordXString) { - final int nb = _xString.size(); - final Color fg = getDrawColor(); - final Color subColor = getSubColor(); - int idxStr = -1; - final GrMorphisme versEcran = getVersEcran(); - final int tiret = getTiretLength(); - final TraceLigne gtl = new TraceLigne(); - for (int i = 0; i < nb; i++) { - tmp_.x_ = _xValue.getQuick(i); - tmp_.autoApplique(versEcran); - if (tmp_.x_ < _absyAxe) { - continue; - } - if (tmp_.x_ > _ecranBoite.getMaxX()) { - break; - } - // le tiret - gtl.setTypeTrait(TraceLigne.LISSE); - gtl.setCouleur(fg); - final int w = _xStrWidth.getQuick(i); - gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _ordxAxe + (w > 0 ? tiret : tiret - 2)); - if (w > 0) { - final int start = (int) (tmp_.x_ - w / 2D); - if (start > idxStr + 1 && start + w < _targetBoite.getMaxX()) { - _g.setColor(fg); - _g.drawString((String) _xString.get(i), start, _ordXString); - idxStr = start + w; - } - } - if (drawGrid_ && w > 0) { - gtl.setTypeTrait(TraceLigne.TIRETE); - gtl.setCouleur(subColor); - gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _minYForAxe); - } - } - } + if (!_versEcran.isSame(getVersEcran())) { return; } + targetBoite.ajuste(getWidth(), getHeight(), 0); + final Color old = _g.getColor(); + final Font oldFont = _g.getFont(); + // la fonte + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + final TDoubleArrayList xValue = new TDoubleArrayList(20); + final TIntArrayList xStrWidth = new TIntArrayList(20); + final List xString = new ArrayList(20); + final NumberIterator it = new NumberIterator(); + final boolean isXPainted = drawX_ && zv.getMinX() < zv.getMaxX() && nbGraduationX_ > 0; - private void drawYaxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, - final TDoubleArrayList _yValue, final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, - final double _minYForAxe) { - int minYDraw = _ordxAxe; - int maxYDraw = (int) _minYForAxe; + if (isXPainted) { + computeXValues(zv, _g, xValue, xStrWidth, xString, it); + } + double yMax = 0; + final TDoubleArrayList yValue = new TDoubleArrayList(20); + final TIntArrayList yStrWidth = new TIntArrayList(20); + final List yString = new ArrayList(20); + final boolean isYPainted = drawY_ && zv.getMinY() < zv.getMaxY() && nbGraduationY_ > 0; + if (isYPainted) { + yMax = computeYValues(_g, zv, yValue, yStrWidth, yString); + } - // if (useCustom_) { - // tmp_.y_ = _zv.getMinY(); - // if (_yValue.size() > 0) { - // tmp_.y_ = Math.min(_yValue.get(0), tmp_.y_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.y_ = Math.floor(tmp_.y_); - // if (tmp_.y_ > minYDraw) { - // minYDraw = (int) tmp_.y_; - // } - // tmp_.y_ = _zv.getMaxY(); - // if (_yValue.size() > 1) { - // tmp_.y_ = Math.max(_yValue.get(_yValue.size() - 1), tmp_.y_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.y_ = Math.ceil(tmp_.y_); - // if (tmp_.y_ < maxYDraw) { - // maxYDraw = (int) tmp_.y_; - // } - // } - tl_.setCouleur(getDrawColor()); - tl_.setTypeTrait(TraceLigne.LISSE); - tl_.dessineTrait(_g, _absyAxe, minYDraw, _absyAxe, maxYDraw); - } + // boolean rapide = isRapide(); + final GrMorphisme versEcran = _versEcran; + final int tiret = getTiretLength(); + final int marge = 1; + int absyAxe = (int) (targetBoite.getMinX() + yMax + 2 * marge + tiret); + final int margeBas = (font == null ? 0 : font.getSize()) + 2 * marge + tiret; + int ordxAxe = (int) (targetBoite.getMaxY() - margeBas); + vue_.setUserInsets(new Insets(3, absyAxe + 5, margeBas + 5, 3)); - final TraceLigne tl_ = new TraceLigne(); + final GrBoite ecranBoite = domaine.applique(_versEcran); + if (ecranBoite.getMinX() - 5 > absyAxe) { + absyAxe = (int) (ecranBoite.getMinX() - 5); + } + if (ecranBoite.getMaxY() + 5 < ordxAxe) { + ordxAxe = (int) (ecranBoite.getMaxY() + 5); + } + if (isXPainted) { + fillXZone(_g, targetBoite, absyAxe, ordxAxe, ecranBoite); - private void drawXAxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, - final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, final double _maxXForAxe) { - int minXDraw = _absyAxe; - int maxXDraw = (int) _maxXForAxe; + } - // if (useCustom_) { - // tmp_.x_ = _zv.getMinX(); - // if (_xValue.size() > 0) { - // tmp_.x_ = Math.min(_xValue.get(0), tmp_.x_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.x_ = Math.floor(tmp_.x_); - // if (tmp_.x_ < minXDraw) { - // minXDraw = (int) tmp_.x_; - // } - // tmp_.x_ = _zv.getMaxX(); - // if (_xValue.size() > 1) { - // tmp_.x_ = Math.max(_xValue.get(_xValue.size() - 1), tmp_.x_); - // } - // tmp_.autoApplique(_versEcran); - // tmp_.x_ = Math.ceil(tmp_.x_); - // if (tmp_.x_ < maxXDraw) { - // maxXDraw = (int) tmp_.x_; - // } - // } + // l'axe des x + final double maxXForAxe = ecranBoite.getMaxX() - marge; - tl_.setCouleur(getDrawColor()); - tl_.setTypeTrait(TraceLigne.LISSE); - tl_.dessineTrait(_g, minXDraw, _ordxAxe, maxXDraw, _ordxAxe); - } + // l'axe des y + final double minYForAxe = ecranBoite.getMinY() + marge; + // les graduation en x - private void computeXValues(final GrBoite _zv, final Graphics2D _g, final TDoubleArrayList _xValue, - final TIntArrayList _xStrWidth, final List _xString, final NumberIterator _it) { - final Font font = getFont(); - if (font != null) { - _g.setFont(font); - } - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - _it.init(_zv.getMinX(), _zv.getMaxX(), getNbXGraduations()); - while (_it.hasNext()) { - final double x = _it.currentValue(); - _xValue.add(x); + final int ascent = fm == null ? 0 : fm.getAscent(); + final int ordXString = ordxAxe + tiret + ascent; + if (isXPainted) { + drawXAxe(_g, zv, xValue, versEcran, absyAxe, ordxAxe, maxXForAxe); + drawXGraduations(_g, targetBoite, xValue, xStrWidth, xString, absyAxe, ordxAxe, ecranBoite, minYForAxe, + ordXString); + } - if (font == null || !_it.isMajorTick()) { - _xStrWidth.add(0); - _xString.add(CtuluLibString.EMPTY_STRING); - } else { - final String currentLabel = _it.currentLabel(); - _xStrWidth.add(fm.stringWidth(currentLabel)); - _xString.add(currentLabel); - } - _it.next(); - } - } + // y - private double computeYValues(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _yValue, - final TIntArrayList _yStrWidth, final List _yString) { - final Font font = getFont(); - if (font != null) { - _g.setFont(font); - } - final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); - double yMax = 0; - NumberIterator it; - it = new NumberIterator(); - it.init(_zv.getMinY(), _zv.getMaxY(), getNbYGraduations()); - while (it.hasNext()) { + if (isYPainted) { + fillYZone(_g, targetBoite, absyAxe, ecranBoite); + drawYaxe(_g, zv, xValue, yValue, versEcran, absyAxe, ordxAxe, minYForAxe); + drawYGraduations(_g, yValue, yStrWidth, yString, versEcran, marge, absyAxe, ordxAxe, ecranBoite, maxXForAxe); + } + _g.setColor(old); + _g.setFont(oldFont); + } - final double x = it.currentValue(); - _yValue.add(x); - if (font == null || !it.isMajorTick()) { - _yStrWidth.add(0); - _yString.add(CtuluLibString.EMPTY_STRING); - } else { - final String currentLabel = it.currentLabel(); - final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); - if (stringWidth > yMax) { - yMax = stringWidth; - } - _yStrWidth.add((int) stringWidth); - _yString.add(currentLabel); - } - it.next(); - } - return yMax; - } + void fillXZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final int _ordxAxe, + final GrBoite _ecranBoite) { + if (_ecranBoite.getMaxX() > _ordxAxe) { + _g.setColor(vue_.getBackground()); + _g.fillRect(_absyAxe, _ordxAxe, (int) _targetBoite.getMaxX() - _absyAxe, (int) _targetBoite.getMaxY() - _ordxAxe); + } + } - // private void updateBounds(final GrBoite _zv) { - // if (useCustom_ && customBounds_ != null) { - // _zv.o_.x_ = Math.max(_zv.o_.x_, customBounds_.getMinX()); - // _zv.e_.x_ = Math.min(_zv.e_.x_, customBounds_.getMaxX()); - // _zv.o_.y_ = Math.max(_zv.o_.y_, customBounds_.getMinY()); - // _zv.e_.y_ = Math.min(_zv.e_.y_, customBounds_.getMaxY()); - // } - // } + private void fillYZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final GrBoite _ecranBoite) { + if (_ecranBoite.getMinX() < _absyAxe) { + _g.setColor(vue_.getBackground()); + _g.fillRect(0, 0, _absyAxe, (int) _targetBoite.getMaxY()); + } + } - // Icon - /** - * Dessin de l'icone. - * - * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null</I>. Il - * est ignore ici. - * @param _g le graphics sur lequel dessiner l'icone - * @param _x lieu cible de l'icone (x) - * @param _y lieu cible de l'icone (y) - */ - public void paintIcon(final Component _c, final Graphics _g, final int _x, final int _y) { - super.paintIcon(_c, _g, _x, _y); - Color fg = getForeground(); - if (isAttenue()) { - fg = attenueCouleur(fg); - } - _g.setColor(fg); - final int w = getIconWidth(); - final int h = getIconHeight(); - for (int i = 6; i < w - 2; i += 8) { - _g.drawLine(_x + i, _y + 1, _x + i, _y + h - 1); - } - for (int j = 6; j < h - 2; j += 8) { - _g.drawLine(_x + 1, _y + j, _x + w - 1, _y + j); - } - } + protected void drawYGraduations(final Graphics2D _g, final TDoubleArrayList _yValue, final TIntArrayList _yStrWidth, + final List _yString, final GrMorphisme _versEcran, final int _marge, final int _absyAxe, final int _ordxAxe, + final GrBoite _ecranBoite, final double _maxXForAxe) { + final int nb = _yString.size(); + final int tiret = getTiretLength(); + final Font font = getFont(); + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + final int ascent = fm == null ? 0 : fm.getAscent(); + int idxStr = -1; + final Color fg = getDrawColor(); + final Color subColor = getSubColor(); + GrPoint tmpSousGrille_=new GrPoint(); + double longueurMoyenne=0; + for (int i = 0; i < nb; i++) { + tmp_.y_ = _yValue.getQuick(i); + tmp_.autoApplique(_versEcran); + if (tmp_.y_ > _ordxAxe) { + continue; + } + if (tmp_.y_ < _ecranBoite.getMinY()) { + break; + } + // le tiret + tl_.setTypeTrait(TraceLigne.LISSE); + tl_.setCouleur(fg); + final int w = _yStrWidth.getQuick(i); + tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _absyAxe - (w > 0 ? tiret : tiret - 2), tmp_.y_); + if (w > 0 && (tmp_.y_ < idxStr || idxStr < 0)) { + _g.setColor(fg); + _g.drawString((String) _yString.get(i), (_absyAxe - w - tiret - _marge), (int) (tmp_.y_ + ascent / 2D)); + idxStr = (int) (tmp_.y_ - ascent / 2D - 3D); + } + + + //-- on trace ou non les sous graduations --// + if((w > 0 || i==nb-2) && drawSousGrilleY_ && i>0 && i<nb-1){ + int valNextPotable=-1; + for(int j=i+1;valNextPotable==-1 &&j<_yStrWidth.size();j++) + if(_yStrWidth.getQuick(j)>0) + valNextPotable=j; + + if(i==nb-2){ + //-- la fin il faut creer le nouveau + valNextPotable=nb-1; + _yValue.set(valNextPotable,_yValue.get(i)+longueurMoyenne); + } + + if(valNextPotable!=-1){ - public void paintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, - final GrBoite _clipReel) {} + tmpSousGrille_.y_=_yValue.getQuick(valNextPotable); + tmpSousGrille_.autoApplique(_versEcran); + double distanceEntre2Trait=Math.abs(tmpSousGrille_.y_-tmp_.y_); + int nbSousGrilles=0; + int taillePasSousgrille=0; + if(!this.modeLongueurPasSousGradY_){ + //-- on trace des nombre de cesure --// + nbSousGrilles=this.getNbYSousGraduations(); + if(nbSousGrilles!=0) + taillePasSousgrille=(int) ((distanceEntre2Trait)/nbSousGrilles); + }else{ + //-- on trace des pas par longueur --// + double ratio=(_yValue.getQuick(valNextPotable)-_yValue.getQuick(i)); + if(ratio!=0) + ratio=this.valeurPasSousGradY_/ratio; - public CtuluListSelection selection(final GrPoint _pt, final int _tolerance) { - return null; - } + taillePasSousgrille=(int) (ratio*distanceEntre2Trait); + if(taillePasSousgrille!=0) + nbSousGrilles=(int) (distanceEntre2Trait/taillePasSousgrille); + } + //-- si on a des bons pas et nb de grilles --// + if(nbSousGrilles>0 && taillePasSousgrille>0 && taillePasSousgrille<distanceEntre2Trait){ - public CtuluListSelection selection(final LinearRing _poly, final int _mode) { - return null; - } + for(int k=0;k<nbSousGrilles+1;k++){ + //-- on trace un trait de couleur de subgrid --// + tl_.setTypeTrait(TraceLigne.POINTILLE); + tl_.setEpaisseur((float) 0.1); + tl_.setCouleur(this.couleurSousGraduation_); + double longueur=((k)*taillePasSousgrille); + tmpSousGrille_.autoApplique(_versEcran); + tl_.dessineTrait(_g,_absyAxe, tmp_.y_+longueur,_maxXForAxe,tmp_.y_+ longueur); + } + longueurMoyenne=(int) (_yValue.getQuick(valNextPotable)-_yValue.getQuick(i)); + } - public LineString getSelectedLine() { - return null; - } + } + } + + + if (drawGrid_ && w > 0) { + tl_.setTypeTrait(TraceLigne.TIRETE); + tl_.setEpaisseur(1); + tl_.setCouleur(subColor); + tl_.dessineTrait(_g, _absyAxe, tmp_.y_, _maxXForAxe, tmp_.y_); + } + } + } - /** - * Affectation de la propriete <I>boite</I>. - */ - // public void setBoite(final GrBoite _v) { - // if (boite_ != _v) { - // final GrBoite vp = boite_; - // boite_ = _v; - // firePropertyChange("boite", vp, _v); - // } - // } - public void setVisible(final boolean _v) { - // if (_v && boite_ == null) { - // boite_ = vue_.getAbstractCalque().getDomaine(); - // } - if (!_v) { - vue_.setUserInsets(null); - super.setVisible(false); - } else { - super.setVisible(_v); - } - firePropertyChange("grille", true, false); + private Color getSubColor() { + Color subColor = attenueCouleur(getForeground()); + if (isAttenue()) { + subColor = attenueCouleur(subColor); + } + return subColor; + } - } + private Color getDrawColor() { + Color fg = getForeground(); + if (isAttenue()) { + fg = attenueCouleur(fg); + } + return fg; + } - public boolean isDrawGrid() { - return drawGrid_; - } + final GrPoint tmp_ = new GrPoint(); - public void setDrawGrid(final boolean _drawGrid) { - if (_drawGrid != drawGrid_) { - drawGrid_ = _drawGrid; - grilleChanged(); - } - } + private void drawXGraduations(final Graphics2D _g, final GrBoite _targetBoite, final TDoubleArrayList _xValue, + final TIntArrayList _xStrWidth, final List _xString, final int _absyAxe, final int _ordxAxe, + final GrBoite _ecranBoite, final double _minYForAxe, final int _ordXString) { + final int nb = _xString.size(); + final Color fg = getDrawColor(); + final Color subColor = getSubColor(); + int idxStr = -1; + final GrMorphisme versEcran = getVersEcran(); + final int tiret = getTiretLength(); + final TraceLigne gtl = new TraceLigne(); + GrPoint tmpSousGrille_=new GrPoint(); + + double longueurMoyenne=0; + + for (int i = 0; i < nb; i++) { + tmp_.x_ = _xValue.getQuick(i); + tmp_.autoApplique(versEcran); + if (tmp_.x_ < _absyAxe) { + continue; + } + if (tmp_.x_ > _ecranBoite.getMaxX()) { + break; + } + // le tiret + gtl.setTypeTrait(TraceLigne.LISSE); + gtl.setCouleur(fg); + final int w = _xStrWidth.getQuick(i); + gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _ordxAxe + (w > 0 ? tiret : tiret - 2)); + if (w > 0) { + final int start = (int) (tmp_.x_ - w / 2D); + if (start > idxStr + 1 && start + w < _targetBoite.getMaxX()) { + _g.setColor(fg); + _g.drawString((String) _xString.get(i), start, _ordXString); + idxStr = start + w; + } + } - // public boolean isUseCustom() { - // return useCustom_; - // } - // - // public void setUseCustom(final boolean _useCustom) { - // if (useCustom_ != _useCustom) { - // useCustom_ = _useCustom; - // repaint(); - // } - // } - // - // public Envelope getCustomBounds() { - // return customBounds_ == null ? null : new Envelope(customBounds_); - // } - // - // public void setCustomBounds(final Envelope _customBounds) { - // if (customBounds_ != _customBounds) { - // customBounds_ = _customBounds; - // repaint(); - // } - // } - public boolean isDrawX() { - return drawX_; - } - public void setDrawX(final boolean _drawX) { - if (drawX_ != _drawX) { - drawX_ = _drawX; - grilleChanged(); - } - } + //-- on trace ou non les sous graduations --// + if((w > 0 || i==nb-2) && drawSousGrilleX_ && i<nb-1){ + int valNextPotable=-1; + for(int j=i+1;valNextPotable==-1 &&j<_xStrWidth.size();j++) + if(_xStrWidth.getQuick(j)>0) + valNextPotable=j; + if(i==nb-2){ + //-- la fin il faut creer le nouveau + valNextPotable=nb-1; + _xValue.set(valNextPotable,_xValue.get(i)+longueurMoyenne); + } + if(valNextPotable!=-1 ){ + + tmpSousGrille_.x_=_xValue.getQuick(valNextPotable); + tmpSousGrille_.autoApplique(versEcran); + double distanceEntre2Trait=Math.abs(tmpSousGrille_.x_-tmp_.x_); + int nbSousGrilles=0; + int taillePasSousgrille=0; + if(!this.modeLongueurPasSousGradX_){ + //-- on trace des nombre de cesure --// + nbSousGrilles=this.getNbXSousGraduations(); + if(nbSousGrilles!=0) + taillePasSousgrille=(int) ((distanceEntre2Trait)/nbSousGrilles); + }else{ + //-- on trace des pas par longueur --// + double ratio=(_xValue.getQuick(valNextPotable)-_xValue.getQuick(i)); + if(ratio!=0) + ratio=this.valeurPasSousGradX_/ratio; - public boolean isDrawY() { - return drawY_; - } + taillePasSousgrille=(int) (ratio*distanceEntre2Trait); + if(taillePasSousgrille!=0) + nbSousGrilles=(int) (distanceEntre2Trait/taillePasSousgrille); + } + //-- si on a des bons pas et nb de grilles --// + if(nbSousGrilles>0 && taillePasSousgrille>0 && taillePasSousgrille<distanceEntre2Trait){ - public void setDrawY(final boolean _drawY) { - if (drawY_ != _drawY) { - drawY_ = _drawY; - grilleChanged(); - } - } + for(int k=0;k<nbSousGrilles+1;k++){ + //-- on trace un trait de couleur de subgrid --// + gtl.setTypeTrait(TraceLigne.POINTILLE); + gtl.setEpaisseur((float) 0.1); + gtl.setCouleur(this.couleurSousGraduation_); + double longueur=((k)*taillePasSousgrille); + tmpSousGrille_.autoApplique(versEcran); + gtl.dessineTrait(_g, tmp_.x_+longueur, _ordxAxe,tmp_.x_+ longueur, _minYForAxe); + } + + longueurMoyenne=(int) (_xValue.getQuick(valNextPotable)-_xValue.getQuick(i)); + } - private void grilleChanged() { - repaint(); - firePropertyChange("grille", true, false); - } - - + } + } + if (drawGrid_ && w > 0) { + gtl.setTypeTrait(TraceLigne.TIRETE); + gtl.setCouleur(subColor); + gtl.setEpaisseur((float) 1); + gtl.dessineTrait(_g, tmp_.x_, _ordxAxe, tmp_.x_, _minYForAxe); + } - @Override - public EbliUIProperties saveUIProperties() { - final EbliUIProperties res = super.saveUIProperties(); - res.put("graduation.x.nb", getNbXGraduations()); - res.put("graduation.y.nb", getNbYGraduations()); - res.put("graduation.x.visible", isDrawX()); - res.put("graduation.y.visible", isDrawY()); - res.put("grille.visible", isDrawGrid()); - return res; - } + } + } - @Override - public void initFrom(EbliUIProperties _p) { - super.initFrom(_p); - if (_p.isDefined("graduation.x.nb")) { - setNbGraduationX(_p.getInteger("graduation.x.nb")); - } - if (_p.isDefined("graduation.y.nb")) { - setNbGraduationX(_p.getInteger("graduation.y.nb")); - } - if (_p.isDefined("graduation.y.visible")) { - setDrawY(_p.getBoolean("graduation.y.visible")); - } - if (_p.isDefined("graduation.x.visible")) { - setDrawX(_p.getBoolean("graduation.x.visible")); - } - if (_p.isDefined("grille.visible")) { - setDrawGrid(_p.getBoolean("grille.visible")); - } - } + private void drawYaxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, + final TDoubleArrayList _yValue, final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, + final double _minYForAxe) { + int minYDraw = _ordxAxe; + int maxYDraw = (int) _minYForAxe; - public void setNbGraduationX(final int _nbGraduationX) { - if (_nbGraduationX > 0 && nbGraduationX_ != _nbGraduationX) { - nbGraduationX_ = _nbGraduationX; - grilleChanged(); - } - } + // if (useCustom_) { + // tmp_.y_ = _zv.getMinY(); + // if (_yValue.size() > 0) { + // tmp_.y_ = Math.min(_yValue.get(0), tmp_.y_); + // } + // tmp_.autoApplique(_versEcran); + // tmp_.y_ = Math.floor(tmp_.y_); + // if (tmp_.y_ > minYDraw) { + // minYDraw = (int) tmp_.y_; + // } + // tmp_.y_ = _zv.getMaxY(); + // if (_yValue.size() > 1) { + // tmp_.y_ = Math.max(_yValue.get(_yValue.size() - 1), tmp_.y_); + // } + // tmp_.autoApplique(_versEcran); + // tmp_.y_ = Math.ceil(tmp_.y_); + // if (tmp_.y_ < maxYDraw) { + // maxYDraw = (int) tmp_.y_; + // } + // } + tl_.setCouleur(getDrawColor()); + tl_.setTypeTrait(TraceLigne.LISSE); + tl_.dessineTrait(_g, _absyAxe, minYDraw, _absyAxe, maxYDraw); + } - public void setNbGraduationY(final int _nbGraduationY) { - if (_nbGraduationY > 0 && nbGraduationY_ != _nbGraduationY) { - nbGraduationY_ = _nbGraduationY; - grilleChanged(); - } - } + final TraceLigne tl_ = new TraceLigne(); + private void drawXAxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, + final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, final double _maxXForAxe) { + int minXDraw = _absyAxe; + int maxXDraw = (int) _maxXForAxe; + + // if (useCustom_) { + // tmp_.x_ = _zv.getMinX(); + // if (_xValue.size() > 0) { + // tmp_.x_ = Math.min(_xValue.get(0), tmp_.x_); + // } + // tmp_.autoApplique(_versEcran); + // tmp_.x_ = Math.floor(tmp_.x_); + // if (tmp_.x_ < minXDraw) { + // minXDraw = (int) tmp_.x_; + // } + // tmp_.x_ = _zv.getMaxX(); + // if (_xValue.size() > 1) { + // tmp_.x_ = Math.max(_xValue.get(_xValue.size() - 1), tmp_.x_); + // } + // tmp_.autoApplique(_versEcran); + // tmp_.x_ = Math.ceil(tmp_.x_); + // if (tmp_.x_ < maxXDraw) { + // maxXDraw = (int) tmp_.x_; + // } + // } + + tl_.setCouleur(getDrawColor()); + tl_.setTypeTrait(TraceLigne.LISSE); + tl_.dessineTrait(_g, minXDraw, _ordxAxe, maxXDraw, _ordxAxe); + } + + private void computeXValues(final GrBoite _zv, final Graphics2D _g, final TDoubleArrayList _xValue, + final TIntArrayList _xStrWidth, final List _xString, final NumberIterator _it) { + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + + //-- mode manuel --// + if(!modeAutomatiqueX_){ + if(modeLongueurPasX_) + fillGraduationsWithPas(_g,this.valeurPasX_, _zv.getMinX(), _zv.getMaxX(), _xValue, _xStrWidth, _xString, fm); + else + fillGraduations(_g,getNbXGraduations(), _zv.getMinX(), _zv.getMaxX(), _xValue, _xStrWidth, _xString, fm); + return; + } + + _it.init(_zv.getMinX(), _zv.getMaxX(), getNbXGraduations()); + + //_it= + while (_it.hasNext()) { + final double x = _it.currentValue(); + _xValue.add(x); + + if (font == null || !_it.isMajorTick()) { + _xStrWidth.add(0); + _xString.add(CtuluLibString.EMPTY_STRING); + } else { + final String currentLabel = _it.currentLabel(); + _xStrWidth.add(fm.stringWidth(currentLabel)); + _xString.add(currentLabel); + } + _it.next(); + } + } + + + public boolean isModeAutomatiqueX() { + return modeAutomatiqueX_; + } + + public void setModeAutomatiqueX(boolean modeAutomatiqueX) { + this.modeAutomatiqueX_ = modeAutomatiqueX; + } + + public boolean isModeAutomatiqueY() { + return modeAutomatiqueY_; + } + + public void setModeAutomatiqueY(boolean modeAutomatiqueY) { + this.modeAutomatiqueY_ = modeAutomatiqueY; + } + + /** + * Remplit les graduations correctement: nb cesures= nombre de trait sur l'ecran + * que ce soit pour le mode par taille de pas ou par nb de cesures. + * @param nbGraduations + * @param min + * @param max + * @param _xValue + * @param _xStrWidth + * @param _xString + */ + private double fillGraduations(Graphics2D _g,int nbGraduations,double min,double max,final TDoubleArrayList _xValue,final TIntArrayList _xStrWidth,final List _xString,FontMetrics fm ){ + + //-- distance tot a couvrir --// + final double distance=max-min; + final int taillePas=(int) (distance/nbGraduations); + double yMax=0; + + for(int i=0;i<nbGraduations+1;i++){ + int cesure=(int) (min+(taillePas*(i))); + _xValue.add(cesure); + final String currentLabel =""+cesure; + _xStrWidth.add(fm.stringWidth(currentLabel)); + _xString.add(currentLabel); + + final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); + if (stringWidth > yMax) { + yMax = stringWidth; + } + if(i==nbGraduations) + if(cesure<max) + nbGraduations++; + } + return yMax; + + + } + + + /** + * Remplit les graduations correctement: nb cesures= nombre de trait sur l'ecran + * que ce soit pour le mode par taille de pas ou par nb de cesures. + * @param nbGraduations + * @param min + * @param max + * @param _xValue + * @param _xStrWidth + * @param _xString + */ + private double fillGraduationsWithPas(Graphics2D _g,int pas,double min,double max,final TDoubleArrayList _xValue,final TIntArrayList _xStrWidth,final List _xString,FontMetrics fm ){ + + //-- distance tot a couvrir --// + final double distance=max-min; + final int taillePas= pas; + if(pas==0) + return 0; + int nbGraduations=(int) (distance/taillePas); + double yMax=0; + + for(int i=0;i<nbGraduations+1;i++){ + int cesure=(int) (min+(taillePas*(i))); + _xValue.add(cesure); + final String currentLabel =""+cesure; + _xStrWidth.add(fm.stringWidth(currentLabel)); + _xString.add(currentLabel); + + final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); + if (stringWidth > yMax) { + yMax = stringWidth; + } + + if(i==nbGraduations){ + if(cesure<max) + nbGraduations++; + } + + } + return yMax; + + + } + + private double computeYValues(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _yValue, + final TIntArrayList _yStrWidth, final List _yString) { + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + double yMax = 0; + NumberIterator it; + + + + //-- mode manuel --// + if(!modeAutomatiqueY_){ + if(modeLongueurPasY_) + yMax=fillGraduationsWithPas(_g,this.valeurPasY_, _zv.getMinY(), _zv.getMaxY(), _yValue, _yStrWidth, _yString, fm); + else + yMax=fillGraduations(_g,nbGraduationY_, _zv.getMinY(), _zv.getMaxY(), _yValue, _yStrWidth, _yString, fm); + return yMax; + } + + it = new NumberIterator(); + it.init(_zv.getMinY(), _zv.getMaxY(), getNbYGraduations()); + while (it.hasNext()) { + + final double x = it.currentValue(); + _yValue.add(x); + if (font == null || !it.isMajorTick()) { + _yStrWidth.add(0); + _yString.add(CtuluLibString.EMPTY_STRING); + } else { + final String currentLabel = it.currentLabel(); + final double stringWidth = fm == null ? 0 : fm.getStringBounds(currentLabel, _g).getWidth(); + if (stringWidth > yMax) { + yMax = stringWidth; + } + _yStrWidth.add((int) stringWidth); + _yString.add(currentLabel); + } + it.next(); + } + return yMax; + } + + // private void updateBounds(final GrBoite _zv) { + // if (useCustom_ && customBounds_ != null) { + // _zv.o_.x_ = Math.max(_zv.o_.x_, customBounds_.getMinX()); + // _zv.e_.x_ = Math.min(_zv.e_.x_, customBounds_.getMaxX()); + // _zv.o_.y_ = Math.max(_zv.o_.y_, customBounds_.getMinY()); + // _zv.e_.y_ = Math.min(_zv.e_.y_, customBounds_.getMaxY()); + // } + // } + + // Icon + /** + * Dessin de l'icone. + * + * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null</I>. Il + * est ignore ici. + * @param _g le graphics sur lequel dessiner l'icone + * @param _x lieu cible de l'icone (x) + * @param _y lieu cible de l'icone (y) + */ + public void paintIcon(final Component _c, final Graphics _g, final int _x, final int _y) { + super.paintIcon(_c, _g, _x, _y); + Color fg = getForeground(); + if (isAttenue()) { + fg = attenueCouleur(fg); + } + _g.setColor(fg); + final int w = getIconWidth(); + final int h = getIconHeight(); + for (int i = 6; i < w - 2; i += 8) { + _g.drawLine(_x + i, _y + 1, _x + i, _y + h - 1); + } + for (int j = 6; j < h - 2; j += 8) { + _g.drawLine(_x + 1, _y + j, _x + w - 1, _y + j); + } + } + + public void paintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, + final GrBoite _clipReel) {} + + public CtuluListSelection selection(final GrPoint _pt, final int _tolerance) { + return null; + } + + public CtuluListSelection selection(final LinearRing _poly, final int _mode) { + return null; + } + + public LineString getSelectedLine() { + return null; + } + + /** + * Affectation de la propriete <I>boite</I>. + */ + // public void setBoite(final GrBoite _v) { + // if (boite_ != _v) { + // final GrBoite vp = boite_; + // boite_ = _v; + // firePropertyChange("boite", vp, _v); + // } + // } + public void setVisible(final boolean _v) { + // if (_v && boite_ == null) { + // boite_ = vue_.getAbstractCalque().getDomaine(); + // } + if (!_v) { + vue_.setUserInsets(null); + super.setVisible(false); + } else { + super.setVisible(_v); + } + firePropertyChange("grille", true, false); + + } + + public boolean isDrawGrid() { + return drawGrid_; + } + + public void setDrawGrid(final boolean _drawGrid) { + if (_drawGrid != drawGrid_) { + drawGrid_ = _drawGrid; + grilleChanged(); + } + } + + // public boolean isUseCustom() { + // return useCustom_; + // } + // + // public void setUseCustom(final boolean _useCustom) { + // if (useCustom_ != _useCustom) { + // useCustom_ = _useCustom; + // repaint(); + // } + // } + // + // public Envelope getCustomBounds() { + // return customBounds_ == null ? null : new Envelope(customBounds_); + // } + // + // public void setCustomBounds(final Envelope _customBounds) { + // if (customBounds_ != _customBounds) { + // customBounds_ = _customBounds; + // repaint(); + // } + // } + + public boolean isDrawX() { + return drawX_; + } + + public void setDrawX(final boolean _drawX) { + if (drawX_ != _drawX) { + drawX_ = _drawX; + grilleChanged(); + } + } + + public boolean isDrawY() { + return drawY_; + } + + public void setDrawY(final boolean _drawY) { + if (drawY_ != _drawY) { + drawY_ = _drawY; + grilleChanged(); + } + } + + public void setDrawSousGrilleY(final boolean _drawY) { + if (drawSousGrilleY_ != _drawY) { + drawSousGrilleY_ = _drawY; + grilleChanged(); + } + } + public void setDrawSousGrilleX(final boolean _drawX) { + if (drawSousGrilleX_ != _drawX) { + drawSousGrilleX_ = _drawX; + grilleChanged(); + } + } + private void grilleChanged() { + repaint(); + firePropertyChange("grille", true, false); + } + + + + @Override + public EbliUIProperties saveUIProperties() { + final EbliUIProperties res = super.saveUIProperties(); + res.put("graduation.x.nb", getNbXGraduations()); + res.put("graduation.y.nb", getNbYGraduations()); + res.put("graduation.x.visible", isDrawX()); + res.put("graduation.y.visible", isDrawY()); + res.put("grille.visible", isDrawGrid()); + return res; + } + + @Override + public void initFrom(EbliUIProperties _p) { + super.initFrom(_p); + if (_p.isDefined("graduation.x.nb")) { + setNbGraduationX(_p.getInteger("graduation.x.nb")); + } + if (_p.isDefined("graduation.y.nb")) { + setNbGraduationX(_p.getInteger("graduation.y.nb")); + } + if (_p.isDefined("graduation.y.visible")) { + setDrawY(_p.getBoolean("graduation.y.visible")); + } + if (_p.isDefined("graduation.x.visible")) { + setDrawX(_p.getBoolean("graduation.x.visible")); + } + if (_p.isDefined("grille.visible")) { + setDrawGrid(_p.getBoolean("grille.visible")); + } + } + + public void setNbGraduationX(final int _nbGraduationX) { + if (_nbGraduationX > 0 /*&& nbGraduationX_ != _nbGraduationX*/) { + nbGraduationX_ = _nbGraduationX; + modeLongueurPasX_=false; + grilleChanged(); + } + } + + + public void setLenghtStepsX(final int _lenghtSteps){ + GrBoite boite= vue_.getViewBoite(); + if(_lenghtSteps==0) + return; + double max=boite.getMaxX(); + int nbGraduationsX=(int) (max/_lenghtSteps); + if(nbGraduationsX+1>0 /*&& nbGraduationsX+1!=nbGraduationX_*/){ + nbGraduationX_=nbGraduationsX; + valeurPasX_=_lenghtSteps; + modeLongueurPasX_=true; + grilleChanged(); + } + + } + + public void setLenghtStepsY(final int _lenghtSteps){ + GrBoite boite= vue_.getViewBoite(); + if(_lenghtSteps==0) + return; + int nbGraduationsY=(int) (boite.getMaxY()/_lenghtSteps); + if(nbGraduationsY>0 /*&& nbGraduationsY!=nbGraduationY_*/){ + nbGraduationY_ = nbGraduationsY; + valeurPasY_=_lenghtSteps; + modeLongueurPasY_=true; + grilleChanged(); + } + + } + + + public void setNbGraduationY(final int _nbGraduationY) { + if (_nbGraduationY > 0 /*&& nbGraduationY_ != _nbGraduationY*/) { + nbGraduationY_ = _nbGraduationY; + modeLongueurPasY_=false; + grilleChanged(); + } + } + + + + public void setLenghtStepsSousGradX(final int _lenghtSteps){ + GrBoite boite= vue_.getViewBoite(); + if(_lenghtSteps==0) + return; + int nbSousGraduationsX=(int) (boite.getMaxY()/_lenghtSteps); + if(nbSousGraduationsX>0 ){ + nbSousGraduationX_ = nbSousGraduationsX; + valeurPasSousGradX_=_lenghtSteps; + modeLongueurPasSousGradX_=true; + grilleChanged(); + } + + } + + + public void setNbGraduationSousGradX(final int _nbGraduation) { + if (_nbGraduation > 0 ) { + nbSousGraduationX_ = _nbGraduation; + modeLongueurPasSousGradX_=false; + grilleChanged(); + } + } + + + public void setLenghtStepsSousGradY(final int _lenghtSteps){ + GrBoite boite= vue_.getViewBoite(); + if(_lenghtSteps==0) + return; + int nbSousGraduationsY=(int) (boite.getMaxY()/_lenghtSteps); + if(nbSousGraduationsY>0 ){ + nbSousGraduationY_ = nbSousGraduationsY; + valeurPasSousGradY_=_lenghtSteps; + modeLongueurPasSousGradY_=true; + grilleChanged(); + } + + } + + + public void setNbGraduationSousGradY(final int _nbGraduation) { + if (_nbGraduation > 0 ) { + nbSousGraduationY_ = _nbGraduation; + modeLongueurPasSousGradY_=false; + grilleChanged(); + } + } + + } 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 2009-02-02 16:00:39 UTC (rev 4435) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 2009-02-02 19:33:52 UTC (rev 4436) @@ -634,4 +634,11 @@ Redimensionner proportionnellement la taille de la frame=Proportional resizing of the frame Conserver le ratio hauteur/largeur=Preserve width/height ratio Ne pas conserver le ratio hauteur/largeur=Do not preserve width/height ratio -Dupliquer la sc\xE8ne= Duplicate the scene \ No newline at end of file +Dupliquer la sc\xE8ne= Duplicate the scene +Taille des pas= Step's lenght +Manuel: Nb graduations=Manual: nb of graduations +Manuel: taille des pas=Manual: Step's lenght +Automatique=Automatic +Grille auto activ\xE9e=Automatic Grid activated +Couleur Grille=Grid's Color +Couleur Sous Grille=SubGrid's color Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 2009-02-02 16:00:39 UTC (rev 4435) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 2009-02-02 19:33:52 UTC (rev 4436) @@ -1,13 +1,17 @@ package org.fudaa.fudaa.sig.layer; +import java.awt.BorderLayout; +import java.awt.CardLayout; import java.awt.Color; import java.awt.Container; +import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JColorChooser; import javax.swing.JComponent; import javax.swing.JDialog; +import javax.swing.JLabel; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; @@ -21,9 +25,12 @@ import org.fudaa.ebli.trace.TraceIconButton; import org.fudaa.ebli.volume.controles.BControleVisible; +import sun.security.krb5.internal.PAEncTSEnc; + import com.memoire.bu.BuButton; import com.memoire.bu.BuCharValidator; import com.memoire.bu.BuCheckBox; +import com.memoire.bu.BuComboBox; import com.memoire.bu.BuGridLayout; import com.memoire.bu.BuLabel; import com.memoire.bu.BuPanel; @@ -38,252 +45,585 @@ */ public final class FSigGrillePalette extends EbliActionPaletteAbstract { - final ZCalqueGrille target_; + final ZCalqueGrille target_; - // /** - // * @author fred deniger - // * @version $Id: FSigGrillePalette.java,v 1.2 2007-04-16 16:35:35 deniger Exp $ - // */ - // final class BoundsActionListener implements ActionListener { - // public void actionPerformed(final ActionEvent _e) { - // Envelope env = target_.getCustomBounds(); - // if (env == null) { - // env = new Envelope(); - // final GrBoite boite = target_.getDomaine(); - // if (boite != null) { - // env.expandToInclude(boite.getMinX(), boite.getMinY()); - // env.expandToInclude(boite.getMaxX(), boite.getMaxY()); - // } - // } - // final CtuluDialogPanel pnBounds = new CtuluDialogPanel(); - // pnBounds.setLayout(new BuGridLayout(2, 2, 2)); - // final BuTextField tfMinX = pnBounds.addLabelDoubleText("Min X"); - // tfMinX.setValue(CtuluLib.getDouble(env.getMinX())); - // final BuTextField tfMaxX = pnBounds.addLabelDoubleText("Max X"); - // tfMaxX.setValue(CtuluLib.getDouble(env.getMaxX())); - // final BuTextField tfMinY = pnBounds.addLabelDoubleText("Min Y"); - // tfMinY.setValue(CtuluLib.getDouble(env.getMinY())); - // final BuTextField tfMaxY = pnBounds.addLabelDoubleText("Max Y"); - // tfMaxY.setValue(CtuluLib.getDouble(env.getMaxY())); - // if (pnBounds.afficheModaleOk(CtuluLibSwing.getFrameAncestorHelper(target_))) { - // target_.setCustomBounds(new Envelope(((Double) tfMinX.getValue()).doubleValue(), ((Double) tfMaxX.getValue()) - // .doubleValue(), ((Double) tfMinY.getValue()).doubleValue(), ((Double) tfMaxY.getValue()).doubleValue())); - // } - // - // } - // } + // /** + // * @author fred deniger + // * @version $Id: FSigGrillePalette.java,v 1.2 2007-04-16 16:35:35 deniger Exp $ + // */ + // final class BoundsActionListener implements ActionListener { + // public void actionPerformed(final ActionEvent _e) { + // Envelope env = target_.getCustomBounds(); + // if (env == null) { + // env = new Envelope(); + // final GrBoite boite = target_.getDomaine(); + // if (boite != null) { + // env.expandToInclude(boite.getMinX(), boite.getMinY()); + // env.expandToInclude(boite.getMaxX(), boite.getMaxY()); + // } + // } + // final CtuluDialogPanel pnBounds = new CtuluDialogPanel(); + // pnBounds.setLayout(new BuGridLayout(2, 2, 2)); + // final BuTextField tfMinX = pnBounds.addLabelDoubleText("Min X"); + // tfMinX.setValue(CtuluLib.getDouble(env.getMinX())); + // final BuTextField tfMaxX = pnBounds.addLabelDoubleText("Max X"); + // tfMaxX.setValue(CtuluLib.getDouble(env.getMaxX())); + // final BuTextField tfMinY = pnBounds.addLabelDoubleText("Min Y"); + // tfMinY.setValue(CtuluLib.getDouble(env.getMinY())); + // final BuTextField tfMaxY = pnBounds.addLabelDoubleText("Max Y"); + // tfMaxY.setValue(CtuluLib.getDouble(env.getMaxY())); + // if (pnBounds.afficheModaleOk(CtuluLibSwing.getFrameAncestorHelper(target_))) { + // target_.setCustomBounds(new Envelope(((Double) tfMinX.getValue()).doubleValue(), ((Double) tfMaxX.getValue()) + // .doubleValue(), ((Double) tfMinY.getValue()).doubleValue(), ((Double) tfMaxY.getValue()).doubleValue())); + // } + // + // } + // } - ZEbliCalquesPanel panel_; + ZEbliCalquesPanel panel_; - /** - * @param _name - * @param _icon - * @param _name2 - */ - FSigGrillePalette(final ZCalqueGrille _target, final ZEbliCalquesPanel _panel) { - super(EbliResource.EBLI.getString("Rep\xE8re"), EbliResource.EBLI.getIcon("repere"), "CHANGE_REFERENCE"); - target_ = _target; - panel_ = _panel; - } + /** + * @param _name + * @param _icon + * @param _name2 + */ + FSigGrillePalette(final ZCalqueGrille _target, final ZEbliCalquesPanel _panel) { + super(EbliResource.EBLI.getString("Rep\xE8re"), EbliResource.EBLI.getIcon("repere"), "CHANGE_REFERENCE"); + target_ = _target; + panel_ = _panel; + } - protected BuTextField addDoubleText(final Container _c) { - final BuTextField r = new BuTextField(10); - r.setCharValidator(BuCharValidator.DOUBLE); - r.setStringValidator(BuStringValidator.DOUBLE); - r.setValueValidator(BuValueValidator.DOUBLE); - _c.add(r); - return r; - } + protected BuTextField addDoubleText(final Container _c) { + final BuTextField r = new BuTextField(10); + r.setCharValidator(BuCharValidator.DOUBLE); + r.setStringValidator(BuStringValidator.DOUBLE); + r.setValueValidator(BuValueValidator.DOUBLE); + _c.add(r); + return r; + } - @Override - public JComponent buildContentPane() { - final BuPanel content = new BuPanel(new BuVerticalLayout(2)); - content.add(createMainProperties()); - content.add(createAxis()); - content.add(createZoom()); - return content; - } + @Override + public JComponent buildContentPane() { + final BuPanel content = new BuPanel(new BuVerticalLayout(2)); + content.add(createMainProperties()); + content.add(createAxis()); + content.add(createZoom()); + return content; + } - private BuPanel createAxis() { - final BuPanel pnXY = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); - pnXY.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Axes"))); - pnXY.add(new BuLabel("")); - pnXY.add(new BuLabel(EbliLib.getS("Nombre de graduation"))); - final BuCheckBox cbX = new BuCheckBox(EbliLib.getS("Dessiner l'axe X")); - cbX.setSelected(target_.isDrawX()); - cbX.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent _e) { - target_.setDrawX(cbX.isSelected()); - } - }); - pnXY.add(cbX); - final BuTextField btGraduationX = BuTextField.createIntegerField(); - btGraduationX.setValue(new Integer(target_.getNbXGraduations())); - pnXY.add(btGraduationX); - btGraduationX.addActionListener(new ActionListener() { + private static String MANUEL1="MANUEL1"; + private static String MANUEL2="MANUEL2"; + private static String AUTO="AUTO"; + /** + * Indique la facon de calculer les graduations. + * pour l'axe des x. + */ + boolean modeAutomatiqueX_=true; + /** + * Indique la facon de calculer les graduations. + * pour l'axe des y. + */ + boolean modeAutomatiqueY_=true; + - public void actionPerformed(final ActionEvent _e) { - final int newVal = ((Integer) btGraduationX.getValue()).intValue(); - if (newVal < 0 || newVal > 5000) { - btGraduationX.setValue(new Integer(target_.getNbXGraduations())); - } else { - target_.setNbGraduationX(newVal); - } + + private BuPanel createAxis() { + BuPanel panelX=new BuPanel(new BorderLayout()); + panelX.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Axes X"))); + final BuComboBox combo=new BuComboBox(new String[]{EbliLib.getS("Manuel: Nb graduations"),EbliLib.getS("Manuel: longueur des pas"),EbliLib.getS("Automatique: Nb graduations"),EbliLib.getS("Automatique: longueur des pas")}); + final CardLayout layoutCardX=new CardLayout(); + panelX.add(combo,BorderLayout.NORTH); + final BuPanel panelCardX=new BuPanel(layoutCardX); + //panelCardX.setLayout(layoutCardX); + panelX.add(combo,BorderLayout.NORTH); + panelX.add(panelCardX,BorderLayout.CENTER); + combo.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e) { + modeAutomatiqueX_=false; + if(combo.getSelectedIndex()==0) + layoutCardX.show(panelCardX, MANUEL1); + else + if(combo.getSelectedIndex()==1) + layoutCardX.show(panelCardX,MANUEL2); + else + if(combo.getSelectedIndex()==2){ + layoutCardX.show(panelCardX, MANUEL1); + modeAutomatiqueX_=true; + } + else + if(combo.getSelectedIndex()==3){ + layoutCardX.show(panelCardX, MANUEL2); + modeAutomatiqueX_=true; + } + } - } + }); - }); - - final BuCheckBox cbY = new BuCheckBox(EbliLib.getS("Dessiner l'axe Y")); - cbY.setSelected(target_.isDrawY()); - cbY.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent _e) { - target_.setDrawY(cbY.isSelected()); - } - }); - pnXY.add(cbY); + final BuCheckBox cbX = new BuCheckBox(EbliLib.getS("Dessiner l'axe X")); + cbX.setSelected(target_.isDrawX()); + cbX.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent _e) { + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setDrawX(cbX.isSelected()); + } - final BuTextField btGraduationY = BuTextField.createIntegerField(); - btGraduationY.setValue(new Integer(target_.getNbYGraduations())); - pnXY.add(btGraduationY); - btGraduationY.addActionListener(new ActionListener() { + }); + panelX.add(cbX,BorderLayout.SOUTH); - public void actionPerformed(final ActionEvent _e) { - final int newVal = ((Integer) btGraduationY.getValue()).intValue(); - if (newVal < 0 || newVal > 5000) { - btGraduationY.setValue(new Integer(target_.getNbYGraduations())); - } else { - target_.setNbGraduationY(newVal); - } + //-- panel x manuel 1: choix par nb de cesures --// + final BuPanel pnXmanu1 = new BuPanel(new BuGridLayout(2, 3, 3, false, false, false, false, false)); + pnXmanu1.add(new BuLabel(EbliLib.getS("Nombre de graduation"))); + final BuTextField btGraduationX = BuTextField.createIntegerField(); + btGraduationX.setColumns(20); + btGraduationX.setValue(new Integer(target_.getNbXGraduations())); + pnXmanu1.add(btGraduationX); + btGraduationX.addActionListener(new ActionListener() { - } + public void actionPerformed(final ActionEvent _e) { + final int newVal = ((Integer) btGraduationX.getValue()).intValue(); + if (newVal < 0 || newVal > 5000) { + btGraduationX.setValue(new Integer(target_.getNbXGraduations())); + } else { + target_.setModeAutomatiqueX(modeAutomatiqueX_); + target_.setNbGraduationX(newVal); + } - }); - return pnXY; - } + } - private BuPanel createMainProperties() { - final BuPanel pn = new BuPanel(); - pn.setBorder(CtuluLibSwing.createTitle... [truncated message content] |
From: <bma...@us...> - 2009-02-02 16:00:43
|
Revision: 4435 http://fudaa.svn.sourceforge.net/fudaa/?rev=4435&view=rev Author: bmarchan Date: 2009-02-02 16:00:39 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Tache #175 : Correction terminologique Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueTableau.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java 2009-02-02 15:32:42 UTC (rev 4434) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java 2009-02-02 16:00:39 UTC (rev 4435) @@ -228,7 +228,7 @@ */ protected void buildModel1dLayerGroup(boolean _build) { cqMdl1d_ = new BGroupeCalque(); - cqMdl1d_.setTitle(MdlResource.MDL.getString("Mod\xE8le 1D")); + cqMdl1d_.setTitle(MdlResource.MDL.getString("Entit\xE9s 1D")); cqMdl1d_.setName("gcMdl1d"); cqMdl1d_.putClientProperty(Action.SHORT_DESCRIPTION, TrResource.getS("Stocke le mod\xE8le")); cqMdl1d_.setDestructible(false); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java 2009-02-02 15:32:42 UTC (rev 4434) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java 2009-02-02 16:00:39 UTC (rev 4435) @@ -74,7 +74,7 @@ * Petite classe utilie pour le combo box de choix de ligne directrice. * Il permet de concerver l'index de la ligne directrice en plus de son nom. * @author Emmanuel MARTIN - * @version $Id:$ + * @version $Id$ */ private class PaireLd { public int idx; @@ -438,7 +438,7 @@ grapheVue_=new EGGraphe(grapheModel); // Axe X \\ EGAxeHorizontal axeX = new EGAxeHorizontal(false); - axeX.setTitre(FudaaLib.getS("Abscisse curviligne")); + axeX.setTitre(FudaaLib.getS("Abscisse en travers")); axeX.setUnite(FudaaLib.getS("m\xE8tre")); axeX.setBounds(0, 500); // Minimum et maximum de l'axe axeX.setGraduations(true); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueTableau.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueTableau.java 2009-02-02 15:32:42 UTC (rev 4434) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueTableau.java 2009-02-02 16:00:39 UTC (rev 4435) @@ -23,6 +23,7 @@ import org.fudaa.ctulu.CtuluCommandComposite; import org.fudaa.ctulu.gui.CtuluTable; +import org.fudaa.ctulu.gui.CtuluValueEditorDefaults; import org.fudaa.ebli.commun.EbliFormatterInterface; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.modeleur.modeleur1d.controller.Controller1d; @@ -56,7 +57,7 @@ protected EbliFormatterInterface formater_; public TableGeomModel(ProfilContainer _data, EbliFormatterInterface _formater){ - super(new String[]{FudaaLib.getS("Index"), FudaaLib.getS("Abs curv"), FudaaLib.getS("Z")}, 0); + super(new String[]{FudaaLib.getS("Index"), FudaaLib.getS("Abs travers"), FudaaLib.getS("Z")}, 0); formater_=_formater; if(_data==null) throw new IllegalArgumentException("_data ne doit pas \xEAtre null."); @@ -182,7 +183,6 @@ }); add(new BuScrollPane(table_), BuBorderLayout.CENTER); // Abscisse curviligne du profil sur l'axe hydraulique - tfAxeHydraulique_.setHorizontalAlignment(SwingUtilities.CENTER); tfAxeHydraulique_.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { double oldValue=modelTable_.getAbsCurvProfilOnAxeHydraulique(); @@ -201,7 +201,7 @@ } }); Box absCurv=new Box(BoxLayout.X_AXIS); - absCurv.add(new BuLabel(FudaaLib.getS("Abscisse Curviligne : "))); + absCurv.add(new BuLabel(FudaaLib.getS("Abscisse sur l'axe: "))); absCurv.add(tfAxeHydraulique_); add(absCurv, BuBorderLayout.SOUTH); // Taille This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-02-02 15:32:52
|
Revision: 4434 http://fudaa.svn.sourceforge.net/fudaa/?rev=4434&view=rev Author: bmarchan Date: 2009-02-02 15:32:42 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Ajout d'une colonne d'index dans le tableau d'?\195?\169dition, onglet courbe. Modified Paths: -------------- 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/ZEditorDefault.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/TableModelModeleAdapter.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 2009-02-02 09:48:56 UTC (rev 4433) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2009-02-02 15:32:42 UTC (rev 4434) @@ -9,6 +9,7 @@ import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; @@ -35,6 +36,9 @@ import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.AbstractTableModel; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableColumnModel; import javax.swing.table.TableModel; import org.fudaa.ctulu.CtuluCommandComposite; @@ -78,6 +82,7 @@ import com.memoire.bu.BuResource; import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuSplit2Pane; +import com.memoire.bu.BuTableCellRenderer; import com.memoire.fu.FuLog; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.CoordinateSequence; @@ -303,13 +308,27 @@ /** * Cette classe donne un acc\xE8s restraint au model 'model_'. Concr\xE8tement - * seul deux colones sont visibles : curviligne et z. Et seul z est \xE9ditable. + * seules trois colonnes sont visibles : index, curviligne et z. Et seul z est \xE9ditable. * * @author Emmanuel MARTIN * @version $Id:$ */ protected class LimitedTableRepresentation extends AbstractTableModel implements TableModelListener { + /** + * Le renderer des cellules du tableau. + */ + protected class Renderer extends DefaultTableCellRenderer { + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, + int column) { + + if(value instanceof Double) + return super.getTableCellRendererComponent(table, xyFormatter_.getXYFormatter().format((Double) value), isSelected, hasFocus, row, column); + else + return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + } + } + private EbliFormatterInterface xyFormatter_; /** @@ -321,9 +340,9 @@ } public int getColumnCount() { - return 2; + return 3; } - + public int getRowCount() { return modelData_.getRowCount(); } @@ -331,8 +350,10 @@ public Object getValueAt(int _rowIndex, int _columnIndex) { switch (_columnIndex) { case 0: - return xyFormatter_.getXYFormatter().format(getX(_rowIndex)); + return _rowIndex+1; case 1: + return /*xyFormatter_.getXYFormatter().format(*/getX(_rowIndex);//); + case 2: return getY(_rowIndex); default: return null; @@ -340,33 +361,60 @@ } public boolean isCellEditable(final int _rowIndex, final int _columnIndex) { - if (_columnIndex == 0) + if (_columnIndex<2) return false; - return modelData_.isCellEditable(_rowIndex, _columnIndex); +// return modelData_.isCellEditable(_rowIndex, _columnIndex); + return true; } public void setValueAt(final Object _value, final int _rowIndex, final int _columnIndex) { - if(_columnIndex == 1) + if(_columnIndex == 2) setY(_rowIndex, (Double)_value, null); } public String getColumnName(int _column) { switch (_column) { case 0: + return EbliLib.getS(EbliLib.getS("Index")); + case 1: return EbliLib.getS(EbliLib.getS("Abscisse")); - case 1: + case 2: return modelData_.getColumnName(zCol_); default: return null; } } + + public Class<?> getColumnClass(int _columnIndex) { + switch (_columnIndex) { + case 0: + return Integer.class; + case 1: + return Double.class; + case 2: + return Double.class; + default: + return null; + } + } public void tableChanged(TableModelEvent _e) { int col=_e.getColumn(); if (_e.getColumn()==zCol_) - col=1; + col=2; fireTableChanged(new TableModelEvent((TableModel)_e.getSource(), _e.getFirstRow(), _e.getLastRow(), col, _e.getType())); } + + public void updateCellEditor(final JTable _table) { + final TableColumnModel cols = _table.getColumnModel(); + // Editor : Abscisse, Z + final TableCellEditor ed = xyFormatter_.createTableEditorComponent(); + cols.getColumn(1).setCellEditor(ed); + cols.getColumn(2).setCellEditor(ed); + // Renderer : Abscisse, Z + cols.getColumn(1).setCellRenderer(new Renderer()); + cols.getColumn(2).setCellRenderer(new Renderer()); + } } // Taille de la polyligne, utile pour l'axe des abscisses @@ -447,9 +495,8 @@ 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(zone_.getAttributeIsZ().getEditor().createTableEditorComponent()); + tableau.updateCellEditor(tableauVue_); + // Ajout au panel \\ BuScrollPane scrollPane = new BuScrollPane(tableauVue_); BuPanel left = new BuPanel(); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2009-02-02 09:48:56 UTC (rev 4433) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2009-02-02 15:32:42 UTC (rev 4434) @@ -769,10 +769,10 @@ /** * Contient l'index de l'onglet selectionn\xE9 dans le panel d'edition d'objet - * seul. C'est pour que d'une \xE9dition \xE0 l'autre le m\xEAme onglet est + * seul. C'est pour que d'une \xE9dition \xE0 l'autre le m\xEAme onglet soit * automatiquement selectionn\xE9. */ - private int SingleObjectEditorPanel_selectedTab_=0; + private int selectedTabInSingleObjectEditorPanel_=0; /** * L'\xE9dition pour un objet selectionn\xE9 unique. @@ -784,10 +784,10 @@ true, true, getXYFormatter()); ed.setCmd(getMng()); if(ed.hasTab()) - ed.setSelectedTab(SingleObjectEditorPanel_selectedTab_); + ed.setSelectedTab(selectedTabInSingleObjectEditorPanel_); ed.afficheModale(getFrame(), _target.getTitle()); if(ed.hasTab()) - SingleObjectEditorPanel_selectedTab_=ed.getSelectedTab(); + selectedTabInSingleObjectEditorPanel_=ed.getSelectedTab(); } protected void editVertexObject(final ZCalqueEditable _target) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/TableModelModeleAdapter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/TableModelModeleAdapter.java 2009-02-02 09:48:56 UTC (rev 4433) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/commun/TableModelModeleAdapter.java 2009-02-02 15:32:42 UTC (rev 4434) @@ -20,6 +20,7 @@ import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.TableCellEditor; import javax.swing.table.TableColumnModel; import javax.swing.table.TableModel; @@ -31,6 +32,7 @@ import org.fudaa.ctulu.gis.GISAttributeModel; import org.fudaa.ctulu.gis.GISCoordinateSequenceFactory; import org.fudaa.ctulu.gis.GISZoneCollection; +import org.fudaa.ctulu.gui.CtuluValueEditorDefaults; import org.fudaa.ctulu.gui.CtuluValueEditorI; import org.fudaa.ebli.calque.ZModelGeometryListener; import org.fudaa.ebli.calque.ZModeleGeometry; @@ -42,9 +44,9 @@ /** * Cette classe permet d'adapter l'interface d'un ZModeleGeometry sur une - * g\xE9om\xE9trie sp\xE9cifique. C'est \xE0 dire que que l'adapter se greffe sur le mod\xE8le - * et selectionne une des g\xE9om\xE9tries. Toutes les m\xE9thodes propos\xE9 par cette - * interface seront r\xE9alis\xE9 sur cette g\xE9om\xE9trie. + * g\xE9om\xE9trie sp\xE9cifique. C'est \xE0 dire que l'adapter se greffe sur le mod\xE8le + * et selectionne une des g\xE9om\xE9tries. Toutes les m\xE9thodes propos\xE9es par cette + * interface seront r\xE9alis\xE9es sur cette g\xE9om\xE9trie. * * Ce model contient : * en premi\xE8re colonne : index @@ -61,7 +63,7 @@ * Le model se charge de mettre la g\xE9o\xE9mtrie \xE0 'Modifi\xE9' lorsque celle-ci l'est. * * @author Emmanuel MARTIN - * @version $Id:$ + * @version $Id$ */ public class TableModelModeleAdapter implements TableModel { @@ -86,7 +88,7 @@ * Utilisation du design pattern Stat. * * @author Emmanuel MARTIN - * @version $Id:$ + * @version $Id$ */ protected interface TableModelModeleAdapterEtat { @@ -114,7 +116,7 @@ * R\xE9alise les op\xE9rations imm\xE9diatement sur le Modele. * * @author Emmanuel MARTIN - * @version $Id:$ + * @version $Id$ */ protected class ModificationOnTheFly implements TableModelModeleAdapterEtat { @@ -191,7 +193,7 @@ * R\xE9alise les op\xE9rations en diff\xE9r\xE9es sur le Modele. * * @author Emmanuel MARTIN - * @version $Id:$ + * @version $Id$ */ protected class ModificationDefered implements TableModelModeleAdapterEtat { @@ -729,11 +731,17 @@ */ public void updateEditorAndRenderer(JTable _table) { TableColumnModel cols=_table.getColumnModel(); + + // Renderer \\ Renderer renderer=new Renderer(); - // Renderer \\ for(int i=0;i<cols.getColumnCount();i++) cols.getColumn(i).setCellRenderer(renderer); + // Editors \\ + // Colonnes X,Y + TableCellEditor editorXY=CtuluValueEditorDefaults.DOUBLE_EDITOR.createTableEditorComponent(); + cols.getColumn(1).setCellEditor(editorXY); + cols.getColumn(2).setCellEditor(editorXY); // Colonnes des attributs if (modele_!=null) { for (int i=0; i<mapColonne_.size(); i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-02-02 09:49:01
|
Revision: 4433 http://fudaa.svn.sourceforge.net/fudaa/?rev=4433&view=rev Author: bmarchan Date: 2009-02-02 09:48:56 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Recup?\195?\169ration/sauvegarde des pk sur fichiers Rubar ST. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStCnFileFormat.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerExporter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2009-01-30 18:59:41 UTC (rev 4432) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2009-02-02 09:48:56 UTC (rev 4433) @@ -158,6 +158,15 @@ }; /** + * Un attribut commentaire hydraulique, utilis\xE9 dans la lecture/ecriture des fichiers. + */ + public final static GISAttributeString COMMENTAIRE_HYDRO = new GISAttributeString(CtuluLib.getS("Commentaire hydro"), false) { + public String getID() { + return "ATTRIBUTE_HYDRO_COMMENT"; + } + }; + + /** * Un attribut bathy, atomique. */ public final static GISAttributeDouble BATHY = new GISAttributeDouble(CtuluLib.getS("z"), true) { @@ -180,7 +189,7 @@ /** La liste des attributs syst\xE8mes. */ protected final static List<GISAttribute> attrs_= - Arrays.asList(new GISAttribute[]{BATHY,TITRE,NATURE,VISIBILITE,ETAT_GEOM}); + Arrays.asList(new GISAttribute[]{BATHY,TITRE,NATURE,VISIBILITE,ETAT_GEOM,COMMENTAIRE_HYDRO}); private GISAttributeConstants() {} @@ -242,6 +251,9 @@ else if (VISIBILITE.isSameContent(res)) { res = VISIBILITE; } + else if (COMMENTAIRE_HYDRO.isSameContent(res)) { + res = COMMENTAIRE_HYDRO; + } } return res; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStCnFileFormat.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStCnFileFormat.java 2009-01-30 18:59:41 UTC (rev 4432) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStCnFileFormat.java 2009-02-02 09:48:56 UTC (rev 4433) @@ -25,6 +25,9 @@ */ public class RubarStCnFileFormat extends FileFormatUnique { + /** Commentaire hydro PK. Utilis\xE9 pour transporter les infos de l'import vers l'export. */ + public static final String COMM_HYDRO_PK="PK"; + public RubarStCnFileFormat() { super(1); extensions_ = new String[] { "st", "cn", "m", "sem" }; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java 2009-01-30 18:59:41 UTC (rev 4432) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java 2009-02-02 09:48:56 UTC (rev 4433) @@ -75,6 +75,7 @@ final List<LineString> lignes = new ArrayList<LineString>(200); final List<String> names=new ArrayList<String>(200); + final List<String> pks=new ArrayList<String>(200); final List<Coordinate> coordinatesEnCours = new ArrayList<Coordinate>(); // Contient les listes de coordonn\xE9es pour les lignes directrices (Map<String,ArrayList<Coordinate>> en Java 1.5) final Map<String, List<Coordinate>> mdirs=new HashMap<String, List<Coordinate>>(20); @@ -83,12 +84,14 @@ final int[] fmt1Line=new int[]{6,6,6,6,13,1,42}; Coordinate last = null; String name=""; + String pk=""; try { while (true) { if (isSt_) { in_.readFields(fmt1Line); name=in_.stringField(6).trim(); + pk=RubarStCnFileFormat.COMM_HYDRO_PK+"="+in_.stringField(4).trim(); } String first = CtuluLibString.EMPTY_STRING; String sec = CtuluLibString.EMPTY_STRING; @@ -119,6 +122,7 @@ final LineString str = GISLib.createLineOrLinearFromList(coordinatesEnCours); if (str != null) { lignes.add(str); + pks.add(pk); if ("".equals(name)) { names.add(CtuluLib.getS(isSt_?"P":"N")+((GISGeometry)str).getId()); } @@ -149,7 +153,9 @@ if (lignes.size() > 0) { final GISZoneCollectionLigneBrisee zligs = new GISZoneCollectionLigneBrisee(null); zligs.addAllLineStringClosedOrNode((LineString[]) lignes.toArray(new LineString[lignes.size()]), null); - zligs.setAttributes(new GISAttributeInterface[] { GISAttributeConstants.BATHY, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE}, null); + zligs.setAttributes(new GISAttributeInterface[] { + GISAttributeConstants.BATHY, GISAttributeConstants.TITRE, + GISAttributeConstants.NATURE, GISAttributeConstants.COMMENTAIRE_HYDRO}, null); if(zligs.getAttributeIsZ()==null) zligs.setAttributeIsZ(GISAttributeConstants.BATHY); zligs.postImport(0); @@ -159,6 +165,13 @@ for (int i=0; i<names.size(); i++) { attmod.setObject(i,attmod.getAttribute().createDataForGeom(names.get(i),1),null); } + + // Affectation de l'attribut commentaire hydro. + attmod=zligs.getModel(GISAttributeConstants.COMMENTAIRE_HYDRO); + for (int i=0; i<pks.size(); i++) { + attmod.setObject(i,attmod.getAttribute().createDataForGeom(pks.get(i),1),null); + } + // Affectation de l'attribut nature attmod=zligs.getModel(GISAttributeConstants.NATURE); for (int i=0; i<attmod.getSize(); i++) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-01-30 18:59:41 UTC (rev 4432) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-02-02 09:48:56 UTC (rev 4433) @@ -48,6 +48,31 @@ } /** + * Retourne la valeur pour une propri\xE9t\xE9 hydraulique de type double. + * @param _comm Commentaire hydro sous la forme "<prop1>=<val>; <prop2>=<val>" + * @param _prop La propri\xE9t\xE9 a extraire. + * @return La valeur de la propri\xE9t\xE9. + */ + private double getHydroCommentDouble(String _comm, String _prop) { + double r=0; + + if (_comm!=null && !_comm.trim().equals("")) { + for (String cpl : _comm.split(";")) { + String[] nameval=cpl.split("="); + if (nameval.length==2 && nameval[0].equalsIgnoreCase(_prop)) { + try { + r=Double.parseDouble(nameval[1]); + break; + } + // En cas d'erreur, retourne 0. + catch (NumberFormatException _exc) {} + } + } + } + return r; + } + + /** * Ecrit les profils et les lignes directrices. * param _o Un tableau GISDataModel[2]. * [0] : le modele des profils (ou null si aucun profil), @@ -68,6 +93,7 @@ // profs_ = ((GISDataModel[])_o)[0]; final int attName=profs_.getIndiceOf(GISAttributeConstants.TITRE); + final int attPk=profs_.getIndiceOf(GISAttributeConstants.COMMENTAIRE_HYDRO); final int attNameLines=bldirs?lines.getIndiceOf(GISAttributeConstants.TITRE):-1; final int[] fmtEntete = new int[] { 6, 6, 6, 6, 13, 1, 42 }; @@ -81,13 +107,18 @@ for (int i = 0; i < profs_.getNumGeometries(); i++) { HashMap<Integer,ArrayList<Integer>> pts2ld=bldirs?pts2lds_[i]:null; String name; + double pk=0; final CoordinateSequence str = ((LineString) profs_.getGeometry(i)).getCoordinateSequence(); if (isSt_) { if (attName==-1||(name=(String)profs_.getValue(attName, i))==null) name=""; + // PK, issu du commentaire hydrualique. + if (attPk!=-1) { + pk=getHydroCommentDouble((String)profs_.getValue(attPk, i),RubarStCnFileFormat.COMM_HYDRO_PK); + } writer.setSpaceBefore(false); writer.stringField(6, name); writer.stringField(5, ""); - writer.doubleField(4, 0); + writer.doubleField(4, pk); writer.intField(3, str.size()); writer.intField(2, 0); writer.intField(1, 0); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java 2009-01-30 18:59:41 UTC (rev 4432) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java 2009-02-02 09:48:56 UTC (rev 4433) @@ -31,6 +31,7 @@ GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE, + GISAttributeConstants.COMMENTAIRE_HYDRO, GISAttributeConstants.VISIBILITE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerExporter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerExporter.java 2009-01-30 18:59:41 UTC (rev 4432) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerExporter.java 2009-02-02 09:48:56 UTC (rev 4433) @@ -195,11 +195,11 @@ int idxAtt=col.getIndiceOf(GISAttributeConstants.NATURE); if (idxAtt==-1) { mdlautres.add(GISDataModelFilterAdapter.buildAdapter(_filter.getCollect(_filter.polyCq_.get(i)), - new GISAttributeInterface[]{GISAttributeConstants.TITRE})); + new GISAttributeInterface[]{GISAttributeConstants.TITRE, GISAttributeConstants.COMMENTAIRE_HYDRO})); } else { GISDataModel mdl=GISDataModelFilterAdapter.buildAdapter(_filter.getCollect(_filter.polyCq_.get(i)), - new GISAttributeInterface[]{GISAttributeConstants.TITRE, GISAttributeConstants.NATURE}); + new GISAttributeInterface[]{GISAttributeConstants.TITRE, GISAttributeConstants.NATURE, GISAttributeConstants.COMMENTAIRE_HYDRO}); if (GISAttributeConstants.ATT_NATURE_CN.equals(col.getValue(idxAtt, 0))) { mdlniv.add(mdl); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-30 18:59:47
|
Revision: 4432 http://fudaa.svn.sourceforge.net/fudaa/?rev=4432&view=rev Author: hadouxad Date: 2009-01-30 18:59:41 +0000 (Fri, 30 Jan 2009) Log Message: ----------- Liste des am?\195?\169liorations: - Superposition: modification de la pile des frames: actions accessibles via clic droit sur les frame: monter, descendre, en premier, en dernier (comme pour les graphes et vues 2d) - Correction bugs rejoue des donn?\195?\169es pour les trajectoires/lignes de courant - Action origine de la courbe: un Bouton offre la possibilit?\195?\169 de cr?\195?\169er la frame de la vue de la fen?\195?\170tre et de l'ins?\195?\169rer automatiquement dans le layout. Cette action permet de visualiser la frame avec l'origine de la cr?\195?\169ation de la courbe pour plus de visibilit?\195?\169 par l'utilisateur : un calque est automatiquement g?\195?\169n?\195?\169r?\195?\169 avec les informations g?\195?\169om?\195?\169triques qui porte le nom de la courbe. -Assistant cr?\195?\169ation graphe: cr?\195?\169er automatiquement une trace dans la vue 2d: propose par d?\195?\169faut un flag qui g?\195?\169n?\195?\168re automatiquement le calque avec les donn?\195?\169es d'origine du graphe dans la vue 2d, permet de conserver une trace. Propose de saisir un titre pr?\195?\169 remplit. - Ajout du panel rechercher directement a cote de l'interface de modif pour l'action rejouer les donn?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.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/TrPostFlecheContent.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostTrajectoireTaskModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-30 18:55:31 UTC (rev 4431) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-30 18:59:41 UTC (rev 4432) @@ -160,13 +160,39 @@ _table.put(MvResource.getS("Pas de temps"), pdt); LineString polyligne = builder_.getInitLine(); - if (polyligne != null) { + if (polyligne != null && polyligne.getNumPoints()>0) { _table.put(MvResource.getS("Polyligne, nb pts"), Integer.toString(polyligne.getNumPoints())); - _table.put(MvResource.getS("Point d\xE9but"), "(" + formater.getFormatter().format(polyligne.getCoordinateN(0).x) - + ";" + formater.getFormatter().format(polyligne.getCoordinateN(0).y) + ")"); - _table.put(MvResource.getS("Point fin"), "(" - + formater.getFormatter().format(polyligne.getCoordinateN(polyligne.getNumPoints() - 1).x) + ";" - + formater.getFormatter().format(polyligne.getCoordinateN(polyligne.getNumPoints() - 1).y) + ")"); + + String ptDebut="("; + if( formater!=null && formater.getFormatter()!=null) + ptDebut+= formater.getFormatter().format(polyligne.getCoordinateN(0).x); + else + ptDebut+=polyligne.getCoordinateN(0).x; + ptDebut+= ";"; + if( formater!=null && formater.getFormatter()!=null) + ptDebut+= formater.getFormatter().format(polyligne.getCoordinateN(0).y); + else + ptDebut+=polyligne.getCoordinateN(0).y; + ptDebut+= ")"; + + _table.put(MvResource.getS("Point d\xE9but"), ptDebut); + + int fin=polyligne.getNumPoints() - 1; + String ptFin="("; + if( formater!=null && formater.getFormatter()!=null) + ptFin+= formater.getFormatter().format(polyligne.getCoordinateN(fin).x); + else + ptFin+=polyligne.getCoordinateN(fin).x; + ptFin+= ";"; + if( formater!=null && formater.getFormatter()!=null) + ptFin+= formater.getFormatter().format(polyligne.getCoordinateN(fin).y); + else + ptFin+=polyligne.getCoordinateN(fin).y; + ptFin+= ")"; + + _table.put(MvResource.getS("Point fin"), ptFin); + + } 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 2009-01-30 18:55:31 UTC (rev 4431) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2009-01-30 18:59:41 UTC (rev 4432) @@ -79,7 +79,13 @@ */ public TrPostLayoutFille getCurrentLayoutFille() { final JInternalFrame currentInternalFrame = getCurrentInternalFrame(); - return currentInternalFrame instanceof TrPostLayoutFille ? (TrPostLayoutFille) currentInternalFrame : null; + if( currentInternalFrame instanceof TrPostLayoutFille) + return (TrPostLayoutFille) currentInternalFrame; + else{ + //-- on recherche la premiere file layout qu'on a et on l'envoie --// + //-- ACHTUNG: CAS A TRAITER:EXEMPLE SI ON EST DANS LA FRAME GESTION MULTI SOURCE; ON EST PAS DANS LA CURRENT LAYOUT MAIS ON S EN FOUT--// + return getAllLayoutFille().get(0); + } } /** @@ -129,6 +135,7 @@ setEnabledForAction("ENREGISTRER", true); setEnabledForAction("ENREGISTRERSOUS", true); setEnabledForAction("IMPORTER", true); + setEnabledForAction("RECHERCHER", true); setEnabledForAction(getImportResultsAct(), true); setEnabledForAction("IMPORT_PROJECT", true); } @@ -298,6 +305,7 @@ setEnabledForAction("IMPORTER", true); setEnabledForAction(getImportResultsAct(), true); setEnabledForAction("IMPORT_PROJECT", true); + setEnabledForAction("RECHERCHER", true); } }); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContent.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContent.java 2009-01-30 18:55:31 UTC (rev 4431) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContent.java 2009-01-30 18:59:41 UTC (rev 4432) @@ -36,6 +36,9 @@ H2dVariableType getVy(); + + + /** * @return un clone de l'objet */ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-01-30 18:55:31 UTC (rev 4431) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-01-30 18:59:41 UTC (rev 4432) @@ -9,6 +9,7 @@ import java.awt.FlowLayout; import java.awt.Frame; import java.awt.GridLayout; +import java.awt.Point; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -17,9 +18,11 @@ import java.text.DecimalFormat; import java.util.Arrays; import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.Vector; @@ -32,6 +35,8 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.JToolBar; import javax.swing.table.DefaultTableModel; @@ -56,13 +61,19 @@ import org.fudaa.ebli.calque.edition.ZCalqueLigneBriseeEditable; import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; import org.fudaa.ebli.calque.edition.ZModelePointEditable; +import org.fudaa.ebli.commun.EbliActionAbstract; import org.fudaa.ebli.commun.EbliActionInterface; +import org.fudaa.ebli.commun.EbliActionMap; import org.fudaa.ebli.commun.EbliActionPaletteAbstract; +import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliComponentFactory; import org.fudaa.ebli.controle.BSelecteurListComboBox; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGModel; +import org.fudaa.ebli.find.EbliFindDialog; +import org.fudaa.ebli.find.EbliFindableItem; import org.fudaa.ebli.palette.BPaletteInfo; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.trace.TraceIcon; import org.fudaa.ebli.trace.TraceIconModel; import org.fudaa.ebli.trace.TraceLigneModel; @@ -80,6 +91,7 @@ import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardImportScope; import org.openide.util.actions.Presenter.Toolbar; +import com.memoire.bu.Bu; import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuBorders; import com.memoire.bu.BuButton; @@ -87,6 +99,7 @@ import com.memoire.bu.BuList; import com.memoire.bu.BuPanel; import com.memoire.bu.BuRadioButton; +import com.memoire.bu.BuResource; import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuToolBar; import com.memoire.bu.BuWizardDialog; @@ -174,11 +187,11 @@ - public JToolBar constructToolBarVue2d(TrPostVisuPanel vue2d,boolean modeEdition){ + public JToolBar constructToolBarVue2d(final TrPostVisuPanel vue2d,boolean modeEdition){ JToolBar toolbarCalque = new BuToolBar(); AbstractButton boutonSelection=null; //final EbliActionInterface[] actions =vue2d.getController().getSelectedNavigationAndStandardActionGroup(); - final List actions = vue2d.getController().getSelectedNavigationAndStandardActionGroup(); + final List actions = vue2d.getController().getActions();//getSelectedNavigationAndStandardActionGroup(); int i=0; for (final Iterator iterator = actions.iterator(); iterator.hasNext();) { // for (int i=0;i<actions.length;i++) { @@ -200,6 +213,16 @@ final ZCalqueSondeInteraction sonde = vue2d.getController().addCalqueSondeInteraction(); toolbarCalque.add(new CalqueActionSonde(sonde, vue2d.getArbreCalqueModel())); + //--ajout de l'action rechercher--// + EbliActionAbstract action=new EbliActionSimple("Rechercher",EbliResource.EBLI.getIcon("rechercher"),"RECH"){ + public void actionPerformed(final ActionEvent _e) { + vue2d.find(); + } + }; + + + toolbarCalque.add(action); + //-- activer par d\xE9faut l'action selection de points --// if(boutonSelection!=null) boutonSelection.doClick(); @@ -247,7 +270,7 @@ * @param implementation * @param modele */ - private TrReplayDialog constructDialog(TrPostVisuPanel vue2d, TrPostCommonImplementation implementation, EGModel modele,JComponent composantAdditionnel,boolean modeEdition,String title){ + private TrReplayDialog constructDialog(final TrPostVisuPanel vue2d, final TrPostCommonImplementation implementation,final EGModel modele,JComponent composantAdditionnel,boolean modeEdition,String title){ implementation.createTask(TrResource.getS("Origine ")+" "+modele.getTitle()); final TrReplayDialog pn = new TrReplayDialog(false); pn.setLayout(new BuBorderLayout()); @@ -264,7 +287,7 @@ JPanel panelSouth2=new JPanel(new FlowLayout(FlowLayout.LEFT)); panelSouth.add(vue2d.getLabelSuiviSouris()); - JPanel panelTotalSouth=new JPanel(new GridLayout(3,1)); + final JPanel panelTotalSouth=new JPanel(new GridLayout(3,1)); if(title!=null){ panelTotalSouth.add(new JLabel(title)); @@ -302,7 +325,17 @@ compEast.add(comp,BuBorderLayout.SOUTH); } } - pn.add(compEast,BuBorderLayout.EAST); + EbliFindDialog dialog= new EbliFindDialog(vue2d); + dialog.setSelectedFindAction((EbliFindableItem)vue2d.getCalqueActif()); + JTabbedPane panelEAST=new JTabbedPane(); + + //panelEAST.add(compEast,BorderLayout.CENTER); +// panelEAST.setTopComponent(dialog); +// panelEAST.setBottomComponent(compEast); + panelEAST.addTab("Rechercher", dialog); + panelEAST.addTab("Infos Points, Variables", compEast); + //pn.add(dialog,BorderLayout.WEST); + pn.add(panelEAST,BuBorderLayout.EAST); panelSouth.add(this.ecraser_); panelSouth.add(this.ajouter_); //final JScrollPane arbreVue2d = new JScrollPane(new BArbreCalque(vue2d.getArbreCalqueModel())); @@ -316,6 +349,22 @@ } + }else{ + + //-- ajout de l'action de cr\xE9ation de la vue 2d correspondante --// + EbliActionSimple genereVue2d=new EbliActionSimple( EbliResource.EBLI.getString("G\xE9n\xE9rer la frame dans le layout"), BuResource.BU.getToolIcon("crystal_graphe"), "WIDGETRECALQUE"){ + + public void actionPerformed(ActionEvent e){ + TrPostLayoutFille fille=implementation.getCurrentLayoutFille(); + if(fille==null) + { + implementation.error("Il n'existe pas de layout..."); + return; + } + fille.addCalque("Origine courbe:"+modele.getTitle(), new Point(100,100),new Dimension(300,300),vue2d/*.duplicate(new HashMap())*/,new CalqueLegendeWidgetAdapter(fille.getScene(),vue2d.getArbreCalqueModel())); + } + }; + panelSouth2.add(genereVue2d.buildButton(EbliComponentFactory.INSTANCE)); } @@ -365,7 +414,9 @@ calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.PLUS,4,Color.blue)); else calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.CARRE_SELECTION,3,Color.blue)); - vue2d.addCalque(calqueZ, true); + calqueZ.setTitle("Origine courbe de "+modele.getTitle()); + // vue2d.addCalque(calqueZ, true); + vue2d.getGroupGIS().add(calqueZ); calqueZ.setVisible(true); vue2d.setCalqueActif(memoire); //-- on affiche le contenu dans une dialog--// @@ -417,7 +468,9 @@ //calqueZ.setVisible(true); //calqueZ.setLineModel(0, new TraceLigneModel(1,2,Color.BLACK)); calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.CARRE_SELECTION,3,Color.blue)); - vue2d.addCalque(calqueZ, true); + calqueZ.setTitle("Origine courbe de "+modele.getTitle()); + //vue2d.addCalque(calqueZ, true); + vue2d.getGroupGIS().add(calqueZ); calqueZ.setVisible(true); vue2d.setCalqueActif(memoire); //-- on affiche le contenu dans une dialog--// @@ -455,6 +508,7 @@ public int afficheModale(final Component _parent, final String _t, final int _option) { dialog_= createDialog(_parent); + dialog_.setModal(false); dialog_.setInitParent(_parent); dialog_.setOption(_option); if (_t != null) { @@ -517,7 +571,8 @@ //groupeCalque.addPointLayerAct("Origine", new GISZoneCollectionPoint()); BCalque resultatsCalque=vue2d.getCalqueActif(); - vue2d.addCalque(layer2, true); + //vue2d.addCalque(layer2, true); + vue2d.getGroupGIS().add(layer2); vue2d.setCalqueActif(resultatsCalque); //vue2d.addCalque(layer2, true); @@ -719,7 +774,8 @@ layer2.setEnabled(true); BCalque resultatsCalque=vue2d.getCalqueActif(); - vue2d.addCalque(layer2, true); + //vue2d.addCalque(layer2, true); + vue2d.getGroupGIS().add(layer2); vue2d.setCalqueActif(resultatsCalque); //-- creation du panel de choix des variables a selectionner --// Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostTrajectoireTaskModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostTrajectoireTaskModel.java 2009-01-30 18:55:31 UTC (rev 4431) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostTrajectoireTaskModel.java 2009-01-30 18:59:41 UTC (rev 4432) @@ -46,6 +46,8 @@ import org.fudaa.fudaa.tr.post.TrPostTrajectoireLineLayer; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; +import sun.security.action.GetLongAction; + import com.memoire.bu.BuComboBox; import com.memoire.bu.BuGridLayout; import com.memoire.bu.BuPanel; @@ -211,12 +213,12 @@ } // -- premier point --// - doubleEditor_.setValue(dataReplay.points_.get(0).x, x_); - doubleEditor_.setValue(dataReplay.points_.get(0).y, y_); - + doubleEditor_.setValue(dataReplay.segment_.get(0).x, x_); + doubleEditor_.setValue(dataReplay.segment_.get(0).y, y_); + integerEditor_.setValue(dataReplay.nbPointsInitiaux_,nbPoints_); // -- dernier point --// - doubleEditor_.setValue(dataReplay.points_.get(dataReplay.points_.size() - 1).x, x2_); - doubleEditor_.setValue(dataReplay.points_.get(dataReplay.points_.size() - 1).y, y2_); + doubleEditor_.setValue(dataReplay.segment_.get(dataReplay.segment_.size() - 1).x, x2_); + doubleEditor_.setValue(dataReplay.segment_.get(dataReplay.segment_.size() - 1).y, y2_); // -- marqueurs --// if (dataReplay.marqueur_ != null) { @@ -318,6 +320,11 @@ final TrPostFlecheContent flecheContent = getSelectedVariable(); final EfTrajectoireParameters data = new EfTrajectoireParameters(); + data.segment_=new ArrayList<Coordinate>(); + data.segment_.add(getFirsCoordinate()); + data.segment_.add(getEndCoordinate()); + data.nbPointsInitiaux_=(Integer) integerEditor_.getValue(nbPoints_); + data.vx = flecheContent.getVx(); data.vy = flecheContent.getVy(); data.dureeIntegration_ = getDuree(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java 2009-01-30 18:55:31 UTC (rev 4431) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java 2009-01-30 18:59:41 UTC (rev 4432) @@ -1,6 +1,7 @@ package org.fudaa.fudaa.tr.post.dialogSpec; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; @@ -26,20 +27,29 @@ import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; +import javax.swing.JTextField; import javax.swing.table.AbstractTableModel; import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.CtuluTaskDelegate; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gis.GISPrecision; +import org.fudaa.ctulu.gis.GISZoneCollectionPoint; +import org.fudaa.ctulu.gui.CtuluDialog; +import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.ctulu.image.CtuluLibImage; import org.fudaa.dodico.ef.operation.EfIndexHelper; import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.ZCalquePoint; +import org.fudaa.ebli.calque.edition.ZModelePointEditable; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheModel; import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceIconModel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; @@ -60,11 +70,13 @@ import com.memoire.bu.BuButtonPanel; import com.memoire.bu.BuCharValidator; import com.memoire.bu.BuCheckBox; +import com.memoire.bu.BuGridLayout; import com.memoire.bu.BuScrollPane; import com.memoire.bu.BuStringValidator; import com.memoire.bu.BuTextField; import com.memoire.bu.BuValueValidator; import com.memoire.bu.BuWizardTask; +import com.vividsolutions.jts.geom.Coordinate; /** * Wizard reserv\xE9 pour la creation de courbes temporelles. @@ -155,12 +167,10 @@ * les points selectionnes */ // private int[] ptIdx_; - BuCheckBox checkboxNewGraphe_ = new BuCheckBox(TrResource.TR.getString("Cr\xE9er un nouveau graphe")/* - * , EbliResource . - * EBLI . getIcon ( - * "crystal_valider" - * ) - */); + BuCheckBox checkboxNewGraphe_ = new BuCheckBox(TrResource.TR.getString("Cr\xE9er un nouveau graphe")); + + BuCheckBox traceOrigineDansVue2d_ = new BuCheckBox(TrResource.TR.getString("Cr\xE9er un calque avec les points d'origine de la courbe dans la vue 2d")); + private final MvExportChooseVarAndTime chooserVarTime_; // TrPostActionAddPointFromWidgetCalque.Temporel actionChoixGraphes_; @@ -286,6 +296,9 @@ bouttonCenter.add(checkboxNewGraphe_); main.add(bouttonCenter, BorderLayout.NORTH); + + panelControle.add(traceOrigineDansVue2d_); + traceOrigineDansVue2d_.setSelected(true); return main; } @@ -431,7 +444,55 @@ } } + /** + * Creer une trace de l'origine du graphe sous forme dd calque + */ + private void creerTraceCalque(){ + CtuluDialogPanel pn = new CtuluDialogPanel(false); + pn.setLayout(new BuGridLayout(2)); + pn.addLabel(TrLib.getString("Indiquer le nom du calque \xE0 cr\xE9er")); + JTextField tf = pn.addStringText(); + tf.setColumns(10); + tf.setText("Origine \xE9volution temporelle"); + pn.afficheModale(CtuluLibSwing.getActiveWindow(),"Trace de l'origine du graphe", CtuluDialog.OK_OPTION); + String titreCalque = tf.getText(); + + //-- cas interpol\xE9 --// + TrPostInterpolatePoint[] listeInterpol=getAllPOintsInt(); + if(listeInterpol!=null && listeInterpol.length>0){ + GISZoneCollectionPoint collectionPoint=new GISZoneCollectionPoint(); + for(int i=0;i<listeInterpol.length;i++) + collectionPoint.add(listeInterpol[i].getX(), listeInterpol[i].getY(),0); + ZModelePointEditable modelePointEdit=new ZModelePointEditable(collectionPoint); + ZCalquePoint calqueZ=new ZCalquePoint(modelePointEdit); + calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.PLUS,4,Color.blue)); + calqueZ.setTitle(titreCalque+" Interpol\xE9s"); + calque_.getGroupGIS().add(calqueZ); + } + //-- cas reels --// + int[] listeReels=getAllPOintsReels(); + if(listeReels!=null && listeReels.length>0){ + GISZoneCollectionPoint collectionPoint=new GISZoneCollectionPoint(); + for(int i=0;i<listeReels.length;i++){ + + Coordinate coor=calque_.getSource().getGrid().getCoor(listeReels[i]); + collectionPoint.add(coor.x,coor.y,0); + } + ZModelePointEditable modelePointEdit=new ZModelePointEditable(collectionPoint); + ZCalquePoint calqueZ=new ZCalquePoint(modelePointEdit); + calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.CARRE_SELECTION,3,Color.blue)); + calqueZ.setTitle(titreCalque+" Noeuds R\xE9els"); + calque_.getGroupGIS().add(calqueZ); + } + + + + + + } + + /** * appel\xE9 a la fin du wizard */ @Override @@ -448,6 +509,11 @@ // -- creation du model pour les donn\xE9es fournies --// final TrPostCourbeTreeModel modelTotal = createCourbeModel(prog); + //-- on enregistre les calques initiaux dans le graphe + if(traceOrigineDansVue2d_.isSelected()){ + creerTraceCalque(); + } + // -- creation d un nouveau graphe si coch\xE9 --// if (checkboxNewGraphe_.isSelected()) createNewGraphe(modelTotal, prog); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java 2009-01-30 18:55:31 UTC (rev 4431) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java 2009-01-30 18:59:41 UTC (rev 4432) @@ -1,18 +1,27 @@ package org.fudaa.fudaa.tr.post.dialogSpec; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.FlowLayout; import javax.swing.JComponent; import javax.swing.JPanel; +import javax.swing.JTextField; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluTaskDelegate; import org.fudaa.ctulu.CtuluVariable; +import org.fudaa.ctulu.gis.GISZoneCollectionPoint; +import org.fudaa.ctulu.gui.CtuluDialog; +import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.ebli.calque.ZCalquePoint; +import org.fudaa.ebli.calque.edition.ZModelePointEditable; import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceIconModel; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.meshviewer.profile.MvProfileBuilderFromTree; import org.fudaa.fudaa.meshviewer.profile.MvProfileFillePanel; @@ -20,6 +29,7 @@ import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; +import org.fudaa.fudaa.tr.post.TrPostInterpolatePoint; import org.fudaa.fudaa.tr.post.TrPostScene; import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; @@ -27,7 +37,10 @@ import com.memoire.bu.BuButtonPanel; import com.memoire.bu.BuCheckBox; +import com.memoire.bu.BuGridLayout; import com.memoire.bu.BuWizardTask; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.LineString; /** * classe reservee a la creation de profils spatiaux via un wizard. @@ -51,13 +64,9 @@ MvProfileBuilderFromTree builderParams_; - BuCheckBox checkboxNewGraphe_ = new BuCheckBox(TrResource.TR.getString("Cr\xE9er un nouveau graphe")/* - * , EbliResource . - * EBLI . getIcon ( - * "crystal_valider" - * ) - */); - + BuCheckBox checkboxNewGraphe_ = new BuCheckBox(TrResource.TR.getString("Cr\xE9er un nouveau graphe")); + BuCheckBox traceOrigineDansVue2d_ = new BuCheckBox(TrResource.TR.getString("Cr\xE9er un calque avec les points d'origine de la courbe dans la vue 2d")); + private final TrPostVisuPanel calque_; TrPostSource src_; public TrPostWizardProfilSpatial(final TrPostVisuPanel _calque, final MvProfileBuilderFromTree _chooserParam, final TrPostActionAddPointFromWidgetCalque.Spatial _actionChoixGraphes) { @@ -65,6 +74,7 @@ builderParams_ = _chooserParam; // calque_ = _calque; src_ = _calque.getSource(); + calque_=_calque; } @Override @@ -97,7 +107,45 @@ }); } + + /** + * Creer une trace de l'origine du graphe sous forme dd calque + */ + private void creerTraceCalque(){ + CtuluDialogPanel pn = new CtuluDialogPanel(false); + pn.setLayout(new BuGridLayout(2)); + pn.addLabel(TrLib.getString("Indiquer le nom du calque \xE0 cr\xE9er")); + JTextField tf = pn.addStringText(); + tf.setColumns(10); + tf.setText("Origine profil spatial"); + pn.afficheModale(CtuluLibSwing.getActiveWindow(),"Trace de l'origine du graphe", CtuluDialog.OK_OPTION); + String titreCalque = tf.getText(); + + + + //-- cas reels --// + LineString listePoints=builderParams_.selectedLine_; + + GISZoneCollectionPoint collectionPoint=new GISZoneCollectionPoint(); + + for(int i=0;i<listePoints.getNumPoints();i++) + collectionPoint.add(listePoints.getCoordinateN(i).x,listePoints.getCoordinateN(i).y,0); + + ZModelePointEditable modelePointEdit=new ZModelePointEditable(collectionPoint); + ZCalquePoint calqueZ=new ZCalquePoint(modelePointEdit); + calqueZ.setIconModel(0, new TraceIconModel(TraceIcon.CARRE_SELECTION,3,Color.blue)); + calqueZ.setTitle(titreCalque); + calque_.getGroupGIS().add(calqueZ); + + + + + + } + + + /** * appel\xE9 a la fin du wizard */ @Override @@ -105,13 +153,24 @@ builderParams_.close(); done_ = true; + + // -- creation d un nouveau graphe si coch\xE9 --// if (checkboxNewGraphe_.isSelected()) createNewGraphe(); + + //-- on enregistre les calques initiaux dans le graphe + if(traceOrigineDansVue2d_.isSelected()){ + creerTraceCalque(); + } + final TrPostCommonImplementation impl = getPostImpl(); // -- ajout des courbes dans les graphes --// for (int i = 0; i < this.actionChoixGraphes_.listeGraphesChoisis.size(); i++) { final EGGraphe graphe = this.actionChoixGraphes_.listeGraphesChoisis.get(i); + + + // -- preliminaire --// // bizarre ? builderParams_.selectedLine_ = builderParams_.getSelectedLine(); @@ -172,7 +231,7 @@ final JPanel bouttonCenter = new JPanel(new FlowLayout(FlowLayout.CENTER)); bouttonCenter.add(checkboxNewGraphe_); content.add(bouttonCenter, BorderLayout.NORTH); - + content.add(traceOrigineDansVue2d_,BorderLayout.SOUTH); content.setBorder(CtuluLibSwing.createTitleBorder(CtuluLib.getS("Etape 3: S\xE9lection et cr\xE9ation des graphes"))); if (actionChoixGraphes_.listeGraphesPossibles.size() == 0 && actionChoixGraphes_.listeGraphesChoisis.size() == 0) { @@ -180,6 +239,8 @@ checkboxNewGraphe_.setEnabled(false); actionChoixGraphes_.setEnabled(false); } + + traceOrigineDansVue2d_.setSelected(true); return content; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-30 18:55:36
|
Revision: 4431 http://fudaa.svn.sourceforge.net/fudaa/?rev=4431&view=rev Author: hadouxad Date: 2009-01-30 18:55:31 +0000 (Fri, 30 Jan 2009) Log Message: ----------- Liste des am?\195?\169liorations: - Superposition: modification de la pile des frames: actions accessibles via clic droit sur les frame: monter, descendre, en premier, en dernier (comme pour les graphes et vues 2d) - Correction bugs rejoue des donn?\195?\169es pour les trajectoires/lignes de courant - Action origine de la courbe: un Bouton offre la possibilit?\195?\169 de cr?\195?\169er la frame de la vue de la fen?\195?\170tre et de l'ins?\195?\169rer automatiquement dans le layout. Cette action permet de visualiser la frame avec l'origine de la cr?\195?\169ation de la courbe pour plus de visibilit?\195?\169 par l'utilisateur : un calque est automatiquement g?\195?\169n?\195?\169r?\195?\169 avec les informations g?\195?\169om?\195?\169triques qui porte le nom de la courbe. -Assistant cr?\195?\169ation graphe: cr?\195?\169er automatiquement une trace dans la vue 2d: propose par d?\195?\169faut un flag qui g?\195?\169n?\195?\168re automatiquement le calque avec les donn?\195?\169es d'origine du graphe dans la vue 2d, permet de conserver une trace. Propose de saisir un titre pr?\195?\169 remplit. - Ajout du panel rechercher directement a cote de l'interface de modif pour l'action rejouer les donn?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfTrajectoireParameters.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTreeTableModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetTreeTableNode.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfTrajectoireParameters.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfTrajectoireParameters.java 2009-01-30 17:09:25 UTC (rev 4430) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfTrajectoireParameters.java 2009-01-30 18:55:31 UTC (rev 4431) @@ -22,7 +22,15 @@ * Les points de depart des trajectoires/ligne de courants */ public List<Coordinate> points_; + + /** + * Le segment initial + */ + public List<Coordinate> segment_; + + public int nbPointsInitiaux_; + /** * La dur\xE9e de l'int\xE9gration */ public double dureeIntegration_; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2009-01-30 17:09:25 UTC (rev 4430) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2009-01-30 18:55:31 UTC (rev 4431) @@ -425,5 +425,101 @@ // refresh(); } + + /** + * Place la widget en fin de liste: + * le premier plan:la fin de la liste children + * l'arriere plan: le debut de la liste children + * @param widget + */ + public void getActPrem(EbliWidget widget){ + Widget layer=visu_; + EbliWidget parent=widget.getParentBordure(); + //-- cas particulier pour les groupes--// + if(parent.getParentWidget() instanceof EbliWidgetGroup) + layer=parent.getParentWidget(); + List<Widget> children = layer.getChildren(); + layer.removeChild(parent); + layer.addChild(children.size(), parent); + widget.revalidate (); + this.refresh(); + //-- notify le modele: redessine toi ! --// + treeModel_.nodeMoved(parent); + } + + /** + * Augmente la position de la widget d'un cran: + * le premier plan:la fin de la liste children + * l'arriere plan: le debut de la liste children + * @param widget + */ +public void getActUp(EbliWidget widget){ + + Widget layer=visu_; + EbliWidget parent=widget.getParentBordure(); + //-- cas particulier pour les groupes--// + if(parent.getParentWidget() instanceof EbliWidgetGroup) + layer=parent.getParentWidget(); + List<Widget> children = layer.getChildren(); + + + int i =children.indexOf (parent); + if (i < 0 || i==children.size()-1) + return; + layer.removeChild(parent); + layer.addChild(i+1, parent); + widget.revalidate (); + this.refresh(); + //-- notify le modele: redessine toi ! --// + treeModel_.nodeMoved(parent); + } +/** + * Diminue la position de la widget d'un cran: + * le premier plan:la fin de la liste children + * l'arriere plan: le debut de la liste children + * @param widget + */ +public void getActDown(EbliWidget widget){ + Widget layer=visu_; + EbliWidget parent=widget.getParentBordure(); + //-- cas particulier pour les groupes--// + if(parent.getParentWidget() instanceof EbliWidgetGroup) + layer=parent.getParentWidget(); + List<Widget> children = layer.getChildren(); + + int i =children.indexOf (parent); + if (i <= 0 ) + return; + layer.removeChild(parent); + layer.addChild(i-1, parent); + widget.revalidate (); + this.refresh(); + //-- notify le modele: redessine toi ! --// + treeModel_.nodeMoved(parent); + } + +/** + * Place la widget en debut de liste: + * le premier plan:la fin de la liste children + * l'arriere plan: le debut de la liste children + * @param widget + */ +public void getActLast(EbliWidget widget){ + Widget layer=visu_; + EbliWidget parent=widget.getParentBordure(); + //-- cas particulier pour les groupes--// + if(parent.getParentWidget() instanceof EbliWidgetGroup) + layer=parent.getParentWidget(); + + + layer.removeChild(parent); + layer.addChild(0, parent); + widget.revalidate (); + this.refresh(); + //-- notify le modele: redessine toi ! --// + treeModel_.nodeMoved(parent); } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2009-01-30 17:09:25 UTC (rev 4430) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2009-01-30 18:55:31 UTC (rev 4431) @@ -561,4 +561,19 @@ public void setUseBorder(final boolean _useBorder) { useBorder_ = _useBorder; } + + + public final void bringToPosition (int position) { + if (getParentWidget() == null) + return; + List<Widget> children = getParentWidget().getChildren(); + int i = children.indexOf (this); + if (i < 0) + return; + children.remove (i); + children.add (position, this); + revalidate (); + getParentWidget().revalidate (); + } + } \ No newline at end of file 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 2009-01-30 17:09:25 UTC (rev 4430) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2009-01-30 18:55:31 UTC (rev 4431) @@ -293,9 +293,12 @@ */ public void constructPopupMenuBase(final JPopupMenu _popup) { + // -- reference vers le gestionnaire de commandeundo/redo --// final CtuluCommandContainer cmd_ = getWidget().getEbliScene().getCmdMng(); + constructMenuDeplacerDansArbre(_popup); + final JMenuItem menuItem3 = _popup.add(EbliResource.EBLI.getString("Informations")); menuItem3.setIcon(BuResource.BU.getIcon("crystal_aide")); menuItem3.addActionListener(new ActionListener() { @@ -319,6 +322,35 @@ } + + public void constructMenuDeplacerDansArbre(JPopupMenu menu){ + + EbliActionSimple action=null; + + menu.add( new EbliActionSimple(EbliResource.EBLI.getString("En premier"),EbliResource.EBLI.getIcon("enpremier"),"ENPREMIER"){ + public void actionPerformed(final ActionEvent _e) { + widget_.getEbliScene().getActPrem(widget_) ; + } + }); + menu.add( new EbliActionSimple(EbliResource.EBLI.getString("Monter"),EbliResource.EBLI.getIcon("monter"),"MONTER"){ + public void actionPerformed(final ActionEvent _e) { + widget_.getEbliScene().getActUp(widget_) ; + } + }); + menu.add( new EbliActionSimple(EbliResource.EBLI.getString("Descendre"),EbliResource.EBLI.getIcon("descendre"),"DESCENTRE"){ + public void actionPerformed(final ActionEvent _e) { + widget_.getEbliScene().getActDown(widget_) ; + } + }); + menu.add( new EbliActionSimple(EbliResource.EBLI.getString("En dernier"),EbliResource.EBLI.getIcon("endernier"),"ENPREMIER"){ + public void actionPerformed(final ActionEvent _e) { + widget_.getEbliScene().getActLast(widget_) ; + } + }); + + + } + /** * Attention ce menu ne doit pas apparaitre pour les calques et graphe car il n a aucun effet. * Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java 2009-01-30 17:09:25 UTC (rev 4430) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetGraphe.java 2009-01-30 18:55:31 UTC (rev 4431) @@ -188,7 +188,7 @@ public void notifyClosing(final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, final Widget widget, final BuPanel editor, final boolean commit) { editingStop(editor); - + getEbliScene().refresh(); } // TODO a changer pour ne recreer tout plein de listener a chaque fois Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTreeTableModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTreeTableModel.java 2009-01-30 17:09:25 UTC (rev 4430) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetJXTreeTableModel.java 2009-01-30 18:55:31 UTC (rev 4431) @@ -91,7 +91,9 @@ public void nodeAdded(final EbliNode _node) { refresh(); } - + public void nodeMoved(final EbliWidget widget) { + refresh(); + } public void nodeRemoved(final EbliNode _node) { final MutableTreeTableNode aSuppr = findTreeTableNode(_node); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetTreeTableNode.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetTreeTableNode.java 2009-01-30 17:09:25 UTC (rev 4430) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/tree/EbliWidgetTreeTableNode.java 2009-01-30 18:55:31 UTC (rev 4431) @@ -32,6 +32,13 @@ addChilds((ObjectScene) w.getScene(), w, _root, null); } + /** + * Ajoute les childs depuis la liste de la scene + * @param _sc + * @param w + * @param parent + * @param parentNode + */ static void addChilds(final ObjectScene _sc, final Widget w, final EbliWidgetTreeTableNode parent, final EbliNode parentNode) { List<Widget> children = w.getChildren(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |