From: <de...@us...> - 2009-02-12 22:54:15
|
Revision: 4461 http://fudaa.svn.sourceforge.net/fudaa/?rev=4461&view=rev Author: deniger Date: 2009-02-12 22:54:12 +0000 (Thu, 12 Feb 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/Thumbs.db 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/commun/save/FilleVisuSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.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/TrLauncherDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.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/TrPostSourceRubar.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/Thumbs.db Deleted: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/Thumbs.db =================================================================== (Binary files differ) Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BVueCalque.java 2009-02-12 20:39:45 UTC (rev 4460) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BVueCalque.java 2009-02-12 22:54:12 UTC (rev 4461) @@ -487,13 +487,17 @@ * final GrBoite b = new GrBoite(new GrPoint(insets.left, insets.top, 0), new GrPoint(getWidth() - insets.left - * insets.right, getHeight() - insets.top - insets.bottom, 0)).; */ - final GrBoite b = new GrBoite(new GrPoint(0, getHeight(), 0), new GrPoint(getWidth(),0, 0)); + double minX = 0; + double minY = 0; + double maxX = getWidth(); + double maxY = getHeight(); if (insets_ != null) { - b.o_.x_ += insets_.left; - b.o_.y_ = b.o_.y_-(insets_.bottom+insets_.top); - b.e_.x_ =b.e_.x_- (insets_.left + insets_.right); - b.e_.y_ += insets_.top ; + minX = insets_.left; + minY = insets_.top; + maxX = maxX - insets_.right; + maxY = maxY - insets_.bottom; } + final GrBoite b = new GrBoite(new GrPoint(minX, minY, 0), new GrPoint(maxX, maxY, 0)); b.autoApplique(getCalque().getVersReel()); return b; } 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-12 20:39:45 UTC (rev 4460) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java 2009-02-12 22:54:12 UTC (rev 4461) @@ -1,7 +1,6 @@ package org.fudaa.ebli.commun; import java.util.ArrayList; -import java.util.Comparator; import java.util.List; import java.util.Map; @@ -29,19 +28,14 @@ * Les infos de la table. */ private Map<String, String> infos_; - private final Comparator<String> comparator_; +// 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, - Comparator<String> comparator) { super(); listeKey_ = liste; infos_ = map; - comparator_ = comparator; +// comparator_ = comparator; colonnes_ = colonnes; listeValue_ = new ArrayList<String>(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/Thumbs.db =================================================================== (Binary files differ) 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-12 20:39:45 UTC (rev 4460) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/ressource/ebli_en.fr_txt 2009-02-12 22:54:12 UTC (rev 4461) @@ -636,10 +636,17 @@ 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 -Taille des pas= Step's lenght -Manuel: Nb graduations=Manual: nb of graduations -Manuel: taille des pas=Manual: Step's lenght +Nombre de graduations=Number of graduations +Longueur des pas=Step length +Manuel\: longueur des pas=Manual\: Step's length +Manuel\: Nombre de graduations=Manual\: Number of graduations +Automatique\: longueur des pas=Automatic\: Step's length +Automatique\: Nombre de graduations=Automatic\: Number of graduations Automatique=Automatic Grille auto activ\xE9e=Automatic Grid activated Couleur Grille=Grid's Color Couleur Sous Grille=SubGrid's color +Dessiner l'axe=Draw Axis +Dessiner les sous-graduations=Draw minor graduations +Grille\: trac\xE9 des lignes principales=Grid\:main lines +Grille\: lignes des sous graduations=Grid\:minor lines \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FilleVisuSaver.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FilleVisuSaver.java 2009-02-12 20:39:45 UTC (rev 4460) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FilleVisuSaver.java 2009-02-12 22:54:12 UTC (rev 4461) @@ -26,6 +26,7 @@ String name_; Dimension ifDim_; BCalqueSaverInterface props_; + BCalqueSaverInterface cqInfosProps_; String selectedLayer_; double ptMinX_; double ptMinY_; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java 2009-02-12 20:39:45 UTC (rev 4460) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/save/FudaaFilleVisuPersistence.java 2009-02-12 22:54:12 UTC (rev 4461) @@ -28,8 +28,8 @@ import com.memoire.fu.FuLog; /** - * Une classe pour la persistence d'une fenetre de visualisation 2D, qui contient des - * calques 2D. Les informations de la fenetre sont sauv\xE9es sur fichier projet .fzip. + * Une classe pour la persistence d'une fenetre de visualisation 2D, qui contient des calques 2D. Les informations de la + * fenetre sont sauv\xE9es sur fichier projet .fzip. * * @author fred deniger * @version $Id: FudaaFilleVisuPersistence.java,v 1.9.4.2 2008-04-01 07:20:52 bmarchan Exp $ @@ -90,7 +90,6 @@ // // } // } - public void saveIn(final CtuluArkSaver _writer, final ProgressionInterface _prog) { try { final BGroupeCalque donneesCalque = visu_.getDonneesCalque(); @@ -98,6 +97,7 @@ final BCalquePersistenceGroupe persistenceMng = donneesCalque.getGroupePersistenceMng(); persistenceMng.setTop(true); commitData(_writer.getDb(), persistenceMng.saveIn(donneesCalque, _writer, rep_ + '/', rep_), _prog); + } catch (final IOException _evt) { FuLog.error(_evt); @@ -112,6 +112,7 @@ private void commitData(final ObjectContainer _db, final BCalqueSaverInterface _data, final ProgressionInterface _prog) { final FilleVisuSaver saveData = setData(_db); saveData.props_ = _data; + saveData.cqInfosProps_ = visu_.getCqInfos().getGroupePersistenceMng().save(visu_.getCqInfos(), _prog); _db.set(saveData); _db.commit(); } @@ -136,7 +137,8 @@ saveData.ptMaxY_ = b.e_.y_; saveData.ptMinX_ = b.o_.x_; saveData.ptMinY_ = b.o_.y_; - saveData.legendUI_ = visu_.getCqLegend().saveUIProperties(); + + // saveData.legendUI_ = visu_.getCqLegend().saveUIProperties(); final BCalque selectedLayers = visu_.getCalqueActif(); if (selectedLayers != null) { saveData.selectedLayer_ = selectedLayers.getName(); @@ -146,6 +148,7 @@ /** * Restaure la fenetre de visu 2D : Les calques et les propri\xE9t\xE9s de la fenetre. + * * @param _impl L'implementation * @param _loader Le zip loader * @param _prog La progression de tache @@ -195,6 +198,7 @@ /** * Restaure les propri\xE9t\xE9s de la fenetre (hors calques de donn\xE9es). + * * @param _saveData Les propri\xE9t\xE9s de la fenetre de visu. * @param _impl L'implementation * @param _parent Le calque racine des calques de donn\xE9es. @@ -229,6 +233,10 @@ if (_saveData.legendUI_ != null && visu_.getCqLegend() != null) { visu_.getCqLegend().initFrom(_saveData.legendUI_); } + if (_saveData.cqInfosProps_ != null && visu_.getCqInfos() != null) { + visu_.getCqInfos().getGroupePersistenceMng().restore(_saveData.cqInfosProps_, visu_, + (BCalque) visu_.getCqInfos().getParent(), null); + } } }; 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-12 20:39:45 UTC (rev 4460) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 2009-02-12 22:54:12 UTC (rev 4461) @@ -1,16 +1,12 @@ 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.FlowLayout; 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; import javax.swing.JDialog; import javax.swing.JLabel; @@ -24,7 +20,6 @@ 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; @@ -70,7 +65,6 @@ return r; } - public JComponent buildContentPane() { final BuPanel content = new BuPanel(new BuVerticalLayout(2)); content.add(createMainProperties()); @@ -79,11 +73,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"; - + 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"; @@ -97,25 +91,22 @@ boolean modeAutomatiqueY_ = true; private BuPanel createAxis() { - 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 BuPanel panelX = new BuPanel(new BuGridLayout(3, 5, 5, true, false, true, true, true)); + final BuPanel panelY = new BuPanel(new BuGridLayout(3, 5, 5, true, false, true, true, true)); + String text = EbliLib.getS("Dessiner les sous-graduations"); + // final BuPanel panelSousGrilleeX = new BuPanel(new FlowLayout(FlowLayout.LEFT)); + // final BuPanel panelSousGrilleeY = new BuPanel(new FlowLayout(FlowLayout.LEFT)); + final BuCheckBox cbsousGrilleX = new BuCheckBox(text); + final BuCheckBox cbsousGrilleY = new BuCheckBox(text); + + panelX.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Axe X"))); + final BuComboBox combo = createAxeComboBox(); final CardLayout layoutCardX = new CardLayout(); - + final BuPanel panelCardX = new BuPanel(layoutCardX); // panelCardX.setLayout(layoutCardX); - - - final BuCheckBox cbX = new BuCheckBox(EbliLib.getS("Dessiner l'axe X")); + final BuCheckBox cbX = new BuCheckBox(EbliLib.getS("Dessiner l'axe")); cbX.setSelected(target_.isDrawX()); cbX.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { @@ -124,16 +115,14 @@ } }); - - BuPanel paneCombo1=new BuPanel(); - paneCombo1.add(combo); - panelX.add(cbX/*, BorderLayout.SOUTH*/); - panelX.add(paneCombo1/*, BorderLayout.NORTH*/); - panelX.add(panelCardX/*, BorderLayout.CENTER*/); - + + panelX.add(cbX/* , BorderLayout.SOUTH */); + panelX.add(combo/* , 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(5); btGraduationX.setValue(new Integer(target_.getNbXGraduations())); @@ -156,10 +145,10 @@ // -- 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"))); + // pnXmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); final BuTextField btGraduationX2 = BuTextField.createDoubleField(); btGraduationX2.setColumns(5); - // btGraduationX2.setValue(new Integer(target_.get)); + // btGraduationX2.setValue(new Integer(target_.get)); pnXmanu2.add(btGraduationX2); btGraduationX2.addActionListener(new ActionListener() { @@ -179,75 +168,67 @@ // --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); - } + 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() == 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() == 3) { - layoutCardX.show(panelCardX, MANUEL2); - modeAutomatiqueX_ = true; - if(btGraduationX2.getValue()!=null){ + } + } 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 (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); - } - - - } - }); - - + if (combo.getSelectedIndex() >= 2) { + cbsousGrilleX.setSelected(false); + cbsousGrilleX.setEnabled(false); + target_.setDrawSousGrilleX(false); + } else { + cbsousGrilleX.setEnabled(true); + } + + } + + }); + // -- Panel 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") }); + + panelY.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Axe Y"))); + final BuComboBox comboY = createAxeComboBox(); final CardLayout layoutCardY = new CardLayout(); - + final BuPanel panelCardY = new BuPanel(layoutCardY); // panelCardY.setLayout(layoutCardY); - - - final BuCheckBox cbY = new BuCheckBox(EbliLib.getS("Dessiner l'axe Y")); + + final BuCheckBox cbY = new BuCheckBox(EbliLib.getS("Dessiner l'axe")); cbY.setSelected(target_.isDrawY()); cbY.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { @@ -256,16 +237,15 @@ } }); - BuPanel combo3=new BuPanel(); - combo3.add(comboY); - panelY.add(cbY /*,BorderLayout.SOUTH*/); - panelY.add(combo3/*, BorderLayout.NORTH*/); - panelY.add(panelCardY/*, BorderLayout.CENTER*/); - + // BuPanel combo3 = new BuPanel(); + // combo3.add(comboY); + panelY.add(cbY /* ,BorderLayout.SOUTH */); + panelY.add(comboY/* , BorderLayout.NORTH */); + panelY.add(panelCardY/* , BorderLayout.CENTER */); // -- 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(5); btGraduationY.setValue(new Integer(target_.getNbYGraduations())); @@ -288,10 +268,10 @@ // -- 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"))); + // pnYmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); final BuTextField btGraduationY2 = BuTextField.createDoubleField(); btGraduationY2.setColumns(5); - // btGraduationY2.setValue(new Integer(target_.getNbXGraduations())); + // btGraduationY2.setValue(new Integer(target_.getNbXGraduations())); pnYmanu2.add(btGraduationY2); btGraduationY2.addActionListener(new ActionListener() { @@ -310,91 +290,79 @@ // --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); - } + 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){ + } 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); - }} + 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); + } 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 --// - - - final BuComboBox comboSousGrilleX = new BuComboBox(new String[] { EbliLib.getS("Nb graduations"), + + final BuComboBox comboSousGrilleX = new BuComboBox(new String[] { EbliLib.getS("Nombre de graduations"), EbliLib.getS("Longueur des pas") }); - - + final CardLayout layoutCardSousGrilleX = new CardLayout(); final BuPanel panelCardSouGrilleX = new BuPanel(layoutCardSousGrilleX); - - + cbsousGrilleX.setSelected(target_.isDrawY()); - - - BuPanel combo2=new BuPanel(); - combo2.add(comboSousGrilleX); - panelSousGrilleeX.add(cbsousGrilleX/*, BorderLayout.SOUTH*/); - panelSousGrilleeX.add(combo2/*, BorderLayout.NORTH*/); - panelSousGrilleeX.add(panelCardSouGrilleX/*, BorderLayout.CENTER*/); - + + panelX.add(cbsousGrilleX/* , BorderLayout.SOUTH */); + panelX.add(comboSousGrilleX); + panelX.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(5); - btGraduationSousX.setValue(new Integer(target_.getNbXSousGraduations()-1)); + btGraduationSousX.setValue(new Integer(target_.getNbXSousGraduations() - 1)); pnsousXmanu1.add(btGraduationSousX); btGraduationSousX.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { @@ -410,7 +378,7 @@ 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"))); + // pnSousXmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); final BuTextField btGraduationSousX2 = BuTextField.createDoubleField(); btGraduationSousX2.setColumns(5); // btGraduationSousX2.setValue(new Integer(target_.getNbXGraduations())); @@ -427,78 +395,73 @@ 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); - } + 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); } - 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()); + } } - }); + + 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); - } + 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); - }} + } 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 --// - - final BuComboBox comboSousGrilleY = new BuComboBox(new String[] { EbliLib.getS("Nb graduations"), + + final BuComboBox comboSousGrilleY = new BuComboBox(new String[] { EbliLib.getS("Nombre de graduations"), EbliLib.getS("Longueur des pas") }); final CardLayout layoutCardSousGrilleY = new CardLayout(); - + final BuPanel panelCardSouGrilleY = new BuPanel(layoutCardSousGrilleY); // panelCardSouGrilleY.setLayout(layoutCardSousGrilleY); - - + cbsousGrilleY.setSelected(target_.isDrawY()); - - BuPanel combo4=new BuPanel(); - combo4.add(comboSousGrilleY); - panelSousGrilleeY.add(cbsousGrilleY/*, BorderLayout.SOUTH*/); - panelSousGrilleeY.add(combo4/*, BorderLayout.NORTH*/); - panelSousGrilleeY.add(panelCardSouGrilleY/*, BorderLayout.CENTER*/); - + + panelY.add(cbsousGrilleY/* , BorderLayout.SOUTH */); + panelY.add(comboSousGrilleY/* , BorderLayout.NORTH */); + panelY.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(5); - btGraduationSousY.setValue(new Integer(target_.getNbYSousGraduations()-1)); + btGraduationSousY.setValue(new Integer(target_.getNbYSousGraduations() - 1)); pnsousYmanu1.add(btGraduationSousY); btGraduationSousY.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent _e) { @@ -514,7 +477,7 @@ 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"))); + // pnSousYmanu2.add(new BuLabel(EbliLib.getS("Longueur des pas"))); final BuTextField btGraduationSousY2 = BuTextField.createDoubleField(); btGraduationSousY2.setColumns(5); // btGraduationSousY2.setValue(new Integer(target_.getNbYGraduations())); @@ -531,78 +494,69 @@ 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); - } + 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); - }} + } 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()); } - }); + + 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); - } + 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); - }} + } 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(panelSousGrilleeX ); + } + }); - // -- init panel sous grilles --// - BuPanel pnSousGrille = new BuPanel(new GridLayout(2, 1)); - pnSousGrille.add(panelY); - pnSousGrille.add(panelSousGrilleeY); - 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); comboY.setSelectedIndex(0); // -- creation du panel contenant x et y --// BuPanel pnXY = new BuPanel(new GridLayout(2, 1)); - pnXY.add(pnGrille); - pnXY.add(pnSousGrille); + pnXY.add(panelX); + pnXY.add(panelY); return pnXY; } - - + private BuComboBox createAxeComboBox() { + return new BuComboBox(new String[] { EbliLib.getS("Manuel: Nombre de graduations"), + EbliLib.getS("Manuel: longueur des pas"), EbliLib.getS("Automatique: Nombre de graduations"), + EbliLib.getS("Automatique: longueur des pas") }); + } + private BuPanel createMainProperties() { final BuPanel pn = new BuPanel(); pn.setBorder(CtuluLibSwing.createTitleBorder(super.getTitle())); @@ -621,42 +575,17 @@ }); pn.add(cb); - 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("Grille: trac\xE9 des lignes principales"))); + BSelecteurLineModel modelGraduations = new BSelecteurLineModel(GRILLE_AXE_X, this.target_.getTraceGraduations_()); + modelGraduations.setSelecteurTarget(this); + pn.add(modelGraduations.buildPanel()); + + pn.add(new BuLabel(EbliLib.getS("Grille: lignes des sous graduations"))); + 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); @@ -724,50 +653,42 @@ return zoom; } + public void addPropertyChangeListener(String _key, PropertyChangeListener _l) { + // TODO Auto-generated method stub -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 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 Object getMoy(String _key) { - // TODO Auto-generated method stub - return null; -} + public void removePropertyChangeListener(String _key, PropertyChangeListener _l) { + // TODO Auto-generated method stub + } -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; -} + 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/TrLauncherDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2009-02-12 20:39:45 UTC (rev 4460) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java 2009-02-12 22:54:12 UTC (rev 4461) @@ -140,8 +140,8 @@ infoSoft = new BuInformationsSoftware(); infoSoft.name = "prepro"; - infoSoft.version = "0.93-MAQUETTE-V8"; - infoSoft.date = "2009-02-02"; + infoSoft.version = "0.94-MAQUETTE-V9"; + infoSoft.date = "2009-02-12"; infoSoft.rights = TrResource.getS("Tous droits r\xE9serv\xE9s") + ". CETMEF (c)2003-2007"; infoSoft.contact = "fre...@fu..."; infoSoft.license = "GPL2"; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt =================================================================== (Binary files differ) 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-12 20:39:45 UTC (rev 4460) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2009-02-12 22:54:12 UTC (rev 4461) @@ -41,380 +41,375 @@ */ public abstract class TrPostCommonImplementation extends TrCommonImplementation { - TrPostProjet c_; + TrPostProjet c_; - public final TrPostProjet getCurrentProject() { - return c_; - } - public final void setCurrentProject(TrPostProjet _c) { - c_=_c; - } + public final TrPostProjet getCurrentProject() { + return c_; + } - /** - * @return toutes les fenetres de PostLayout - */ - public List<TrPostLayoutFille> getAllLayoutFille() { - final JInternalFrame[] allInternalFrames = getAllInternalFrames(); - if (allInternalFrames == null) return Collections.emptyList(); - final List<TrPostLayoutFille> res = new ArrayList<TrPostLayoutFille>(allInternalFrames.length); - for (int i = 0; i < allInternalFrames.length; i++) { - final JInternalFrame internalFrame = allInternalFrames[i]; - if (internalFrame instanceof TrPostLayoutFille) { - res.add((TrPostLayoutFille) internalFrame); - } - } - return res; - } + public final void setCurrentProject(TrPostProjet _c) { + c_ = _c; + } + /** + * @return toutes les fenetres de PostLayout + */ + public List<TrPostLayoutFille> getAllLayoutFille() { + final JInternalFrame[] allInternalFrames = getAllInternalFrames(); + if (allInternalFrames == null) return Collections.emptyList(); + final List<TrPostLayoutFille> res = new ArrayList<TrPostLayoutFille>(allInternalFrames.length); + for (int i = 0; i < allInternalFrames.length; i++) { + final JInternalFrame internalFrame = allInternalFrames[i]; + if (internalFrame instanceof TrPostLayoutFille) { + res.add((TrPostLayoutFille) internalFrame); + } + } + return res; + } - public void elimineDoublonNomsLayout(){ - List<TrPostLayoutFille> liste=getAllLayoutFille(); + public void elimineDoublonNomsLayout() { + List<TrPostLayoutFille> liste = getAllLayoutFille(); - for(int i=0;i<liste.size();i++){ - int cpt=1; - for(int j=i; j<liste.size();j++){ - if(liste.get(j).previousTitleFrame.equals(liste.get(i).previousTitleFrame)){ + for (int i = 0; i < liste.size(); i++) { + int cpt = 1; + for (int j = i; j < liste.size(); j++) { + if (liste.get(j).previousTitleFrame.equals(liste.get(i).previousTitleFrame)) { - liste.get(j).previousTitleFrame+="_"+(cpt++); - } - } + liste.get(j).previousTitleFrame += "_" + (cpt++); + } + } - } + } - } + } - /** - * @return la fenetre layout active. - */ - public TrPostLayoutFille getCurrentLayoutFille() { - final JInternalFrame currentInternalFrame = getCurrentInternalFrame(); - 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); - } - } + /** + * @return la fenetre layout active. + */ + public TrPostLayoutFille getCurrentLayoutFille() { + final JInternalFrame currentInternalFrame = getCurrentInternalFrame(); + 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); + } + } - /** - * @return la fenetre layout active ou la premiere des LayoutFille de cette application - */ - public TrPostLayoutFille getCurrentLayoutFilleOrFirst() { - TrPostLayoutFille current = getCurrentLayoutFille(); - if (current == null) { - final List<TrPostLayoutFille> allLayoutFille = getAllLayoutFille(); - if (!allLayoutFille.isEmpty()) current = allLayoutFille.get(0); - } - return current; - } + /** + * @return la fenetre layout active ou la premiere des LayoutFille de cette application + */ + public TrPostLayoutFille getCurrentLayoutFilleOrFirst() { + TrPostLayoutFille current = getCurrentLayoutFille(); + if (current == null) { + final List<TrPostLayoutFille> allLayoutFille = getAllLayoutFille(); + if (!allLayoutFille.isEmpty()) current = allLayoutFille.get(0); + } + return current; + } - @Override - public void init() { - super.init(); - final BuMenu menu = (BuMenu) getMainMenuBar().getMenu("IMPORTER"); - menu.addMenuItem(TrResource.getS("Autres r\xE9sultats"), getImportResultsAct()); - } + @Override + public void init() { + super.init(); + final BuMenu menu = (BuMenu) getMainMenuBar().getMenu("IMPORTER"); + menu.addMenuItem(TrResource.getS("Autres r\xE9sultats"), getImportResultsAct()); + } - String getImportResultsAct() { - return "IMPORT_RESULTS"; - } + String getImportResultsAct() { + return "IMPORT_RESULTS"; + } - @Override - public void close() { - if (c_ != null) { - c_.close(); - } - removeInternalFrames(getAllInternalFrames()); - } + @Override + public void close() { + if (c_ != null) { + c_.close(); + } + removeInternalFrames(getAllInternalFrames()); + } - public void setProjet(final TrPostProjet _c) { - if (c_ == _c) { return; } - new CtuluTaskOperationGUI(null, CtuluLibString.EMPTY_STRING) { + public void setProjet(final TrPostProjet _c) { + if (c_ == _c) { return; } + new CtuluTaskOperationGUI(null, CtuluLibString.EMPTY_STRING) { - @Override - public void act() { - saveAndCloseProjet(createProgressionInterface(this)); - c_ = _c; - if (c_ != null) { - c_.active(TrPostCommonImplementation.this); - BuLib.invokeNowOrLater(new Runnable() { - public void run() { - setEnabledForAction("CREER", true); - setEnabledForAction("ENREGISTRER", true); - setEnabledForAction("ENREGISTRERSOUS", true); - setEnabledForAction("IMPORTER", true); - setEnabledForAction("RECHERCHER", true); - setEnabledForAction(getImportResultsAct(), true); - setEnabledForAction("IMPORT_PROJECT", true); - } - }); - } - } - }.start(); + @Override + public void act() { + saveAndCloseProjet(createProgressionInterface(this)); + c_ = _c; + if (c_ != null) { + c_.active(TrPostCommonImplementation.this); + BuLib.invokeNowOrLater(new Runnable() { + public void run() { + setEnabledForAction("CREER", true); + setEnabledForAction("ENREGISTRER", true); + setEnabledForAction("ENREGISTRERSOUS", true); + setEnabledForAction("IMPORTER", true); + setEnabledForAction("RECHERCHER", true); + setEnabledForAction(getImportResultsAct(), true); + setEnabledForAction("IMPORT_PROJECT", true); + } + }); + } + } + }.start(); - } + } - public boolean saveAndCloseProjet(final ProgressionInterface _interface) { - if (c_ != null) { + public boolean saveAndCloseProjet(final ProgressionInterface _interface) { + if (c_ != null) { - // -- enregistrement sauce widget --// - final int i = CtuluLibDialog.confirmExitIfProjectisModified(getFrame()); - if (i == JOptionPane.CANCEL_OPTION) { - return false; - } - if (i != JOptionPane.NO_OPTION) { - c_.getManager().saveProject(false); - //c_.save(this, _interface); - } + // -- enregistrement sauce widget --// + if (c_.isModified()) { + final int i = CtuluLibDialog.confirmExitIfProjectisModified(getFrame()); + if (i == JOptionPane.CANCEL_OPTION) { return false; } + if (i != JOptionPane.NO_OPTION) { + c_.getManager().saveProject(false); + // c_.save(this, _interface); + } + } + c_.close(); + c_ = null; + SwingUtilities.invokeLater(new Runnable() { - c_.close(); - c_ = null; - SwingUtilities.invokeLater(new Runnable() { + public void run() { + setEnabledForAction("CREER", true); + setEnabledForAction("ENREGISTRER", false); + setEnabledForAction("IMPORTER", false); + setEnabledForAction(getImportResultsAct(), false); + setEnabledForAction("IMPORT_PROJECT", false); + } + }); + } - public void run() { - setEnabledForAction("CREER", true); - setEnabledForAction("ENREGISTRER", false); - setEnabledForAction("IMPORTER", false); - setEnabledForAction(getImportResultsAct(), false); - setEnabledForAction("IMPORT_PROJECT", false); - } - }); - } + return true; + } + @Override + public boolean confirmExit() { + final boolean b = super.confirmExit(); + if (b && c_ != null && !saveAndCloseProjet(null)) { return false; } + return b; + } + @Override + public void actionPerformed(final ActionEvent _evt) { + final String com = _evt.getActionCommand(); - return true; - } + if ("CREER".equals(com)) { - @Override - public boolean confirmExit() { - final boolean b = super.confirmExit(); - if (b && c_ != null && !saveAndCloseProjet(null)) { return false; } - return b; - } + if (c_ != null) { + final int reponse = JOptionPane.showConfirmDialog(this.getParentComponent(), TrResource + .getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); + if (reponse == JOptionPane.CANCEL_OPTION) { return; } + if (reponse == JOptionPane.OK_OPTION) { + c_.getManager().saveProject(false); + } + // -- nettoyage du projet pr\xE9c\xE9dent --// - @Override - public void actionPerformed(final ActionEvent _evt) { - final String com = _evt.getActionCommand(); + c_.getManager().clearProject(); + } else { + c_ = new TrPostProjet(this); + c_.setMenuPost(); + } + // -- ouverture d'un fichier r\xE9sultat qui sera automatiquement ajout\xE9 dans la layout courante --// + c_.createNewLayoutFrame(); + // -- ouverture d'un fichier r\xE9sultat --// + TrPostActionChooseAndCreateCalque chooserSource = new TrPostActionChooseAndCreateCalque(c_, c_.getImpl() + .getCurrentLayoutFille().controller_); + chooserSource.actionPerformed(null); - if ("CREER".equals(com)) { + } else if ("OUVRIR".equals(com)) { + // -- ouverture d un nouveau projet --// + if (c_ != null) { + final int reponse = JOptionPane.showConfirmDialog(this.getParentComponent(), TrResource + .getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); + if (reponse == JOptionPane.CANCEL_OPTION) { return; } + if (reponse == JOptionPane.OK_OPTION) { + c_.getManager().saveProject(false); + } - if(c_!=null){ - final int reponse = JOptionPane.showConfirmDialog(this.getParentComponent(),TrResource.getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); - if (reponse == JOptionPane.CANCEL_OPTION) { return; } - if (reponse == JOptionPane.OK_OPTION) { - c_.getManager().saveProject(false); - } - //-- nettoyage du projet pr\xE9c\xE9dent --// + // -- nettoyage du projet pr\xE9c\xE9dent --// + c_.getManager().clearProject(); + } else { + c_ = new TrPostProjet(this); + c_.setMenuPost(); + } - c_.getManager().clearProject(); - } - else { - c_=new TrPostProjet(this); - c_.setMenuPost(); - } - //-- ouverture d'un fichier r\xE9sultat qui sera automatiquement ajout\xE9 dans la layout courante --// - c_.createNewLayoutFrame(); - //-- ouverture d'un fichier r\xE9sultat --// - TrPostActionChooseAndCreateCalque chooserSource= new TrPostActionChooseAndCreateCalque(c_,c_.getImpl().getCurrentLayoutFille().controller_); - chooserSource.actionPerformed(null); + c_.getManager().loadProject(false, null); + // new TrPostFusionProjet(c_); + } else + if ("FERMER".equals(com)) { + new CtuluTaskOperationGUI(this, TrResource.getS("Fermer")) { - }else - if ("OUVRIR".equals(com)) { - // -- ouverture d un nouveau projet --// - if(c_!=null){ - final int reponse = JOptionPane.showConfirmDialog(this.getParentComponent(),TrResource.getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); - if (reponse == JOptionPane.CANCEL_OPTION) { return; } - if (reponse == JOptionPane.OK_OPTION) { - c_.getManager().saveProject(false); - } + @Override + public void act() { + saveAndCloseProjet(createProgressionInterface(this)); + } + }.start(); + } else if ("ENREGISTRER".equals(com) && c_ != null) { + new CtuluTaskOperationGUI(this, TrResource.getS("Enregistrement")) { - //-- nettoyage du projet pr\xE9c\xE9dent --// - c_.getManager().clearProject(); - }else - { - c_=new TrPostProjet(this); - c_.setMenuPost(); - } + @Override + public void act() { + // c_.save(TrPostCommonImplementation.this, createProgressionInterface(this)); - c_.getManager().loadProject(false, null); - //new TrPostFusionProjet(c_); + // -- enregistrement sauce widget --// + c_.getManager().saveProject(false); - } else + } + }.start(); + } else if ("ENREGISTRERSOUS".equals(com) && c_ != null) { + new CtuluTaskOperationGUI(this, TrResource.getS("Enregistrement Sous")) { - if ("FERMER".equals(com)) { - new CtuluTaskOperationGUI(this, TrResource.getS("Fermer")) { + @Override + public void act() { + // c_.save(TrPostCommonImplementation.this, createProgressionInterface(this)); - @Override - public void act() { - saveAndCloseProjet(createProgressionInterface(this)); - } - }.start(); - } else if ("ENREGISTRER".equals(com) && c_ != null) { - new CtuluTaskOperationGUI(this, TrResource.getS("Enregistrement")) { + // -- enregistrement sauce widget --// + c_.getManager().savePr... [truncated message content] |