From: <de...@us...> - 2009-01-28 22:44:35
|
Revision: 4423 http://fudaa.svn.sourceforge.net/fudaa/?rev=4423&view=rev Author: deniger Date: 2009-01-28 22:44:24 +0000 (Wed, 28 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluCellTextRenderer.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGPaletteLegendeGraphe.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/MvProfileBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/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/TrPostFlecheContentDefaut.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentExpr.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/TrPostRubarEnvFlecheContent.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceTelemac3D.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCommonPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCstPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataUserVarModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataVecteur.java 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/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaultSaver.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditFlechePanel.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluCellTextRenderer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluCellTextRenderer.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gui/CtuluCellTextRenderer.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -24,6 +24,7 @@ * @author fred deniger * @version $Id: CtuluCellTextRenderer.java,v 1.14 2007-04-30 14:21:16 deniger Exp $ */ +@SuppressWarnings("serial") public class CtuluCellTextRenderer extends JLabel implements CtuluCellRenderer, TreeCellRenderer { private CtuluCellDecorator decorator_; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGPaletteLegendeGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGPaletteLegendeGraphe.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGPaletteLegendeGraphe.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -4,33 +4,23 @@ import java.awt.Color; import java.awt.Component; import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.GridLayout; -import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.image.BufferedImage; -import java.util.HashMap; import java.util.List; -import java.util.Map; import javax.swing.BorderFactory; +import javax.swing.DefaultListCellRenderer; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JColorChooser; -import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextField; -import javax.swing.ListCellRenderer; import javax.swing.ListModel; import javax.swing.ListSelectionModel; import javax.swing.SwingConstants; @@ -39,25 +29,19 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import jxl.Image; - -import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluNumberFormatDefault; import org.fudaa.ctulu.CtuluNumberFormatI; import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.gui.CtuluCellTextRenderer; import org.fudaa.ctulu.gui.CtuluDecimalFormatEditPanel; import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.ctulu.gui.CtuluPopupMenu; -import org.fudaa.ebli.calque.CalqueGISTreeModel.CellRenderer; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BConfigurePalette; -import org.fudaa.ebli.palette.BPalettePlageLegende; import org.fudaa.ebli.palette.BPalettePlageTarget; import org.fudaa.ebli.palette.BPlageAbstract; import org.fudaa.ebli.ressource.EbliResource; -import org.fudaa.ebli.trace.BPlageInterface; import org.fudaa.ebli.trace.TraceIcon; -import org.fudaa.ebli.trace.TraceIconModel; import org.fudaa.ebli.trace.TraceLigne; import com.memoire.bu.BuBorderLayout; @@ -68,7 +52,6 @@ import com.memoire.bu.BuEmptyList; import com.memoire.bu.BuGridLayout; import com.memoire.bu.BuLabel; -import com.memoire.bu.BuLib; import com.memoire.bu.BuMenuItem; import com.memoire.bu.BuPanel; import com.memoire.bu.BuResource; @@ -77,354 +60,372 @@ import com.memoire.bu.BuToolButton; import com.memoire.bu.BuVerticalLayout; - /** - * Palette de l\xE9gende des graphes. - * Utilis\xE9e pour \xE9diter les l\xE9gendes des graphes + * Palette de l\xE9gende des graphes. Utilis\xE9e pour \xE9diter les l\xE9gendes des graphes + * * @author Adrien Hadoux - * */ -public class EGPaletteLegendeGraphe extends BuPanel implements ActionListener,ListSelectionListener,BuBorders{ +public class EGPaletteLegendeGraphe extends BuPanel implements ActionListener, ListSelectionListener, BuBorders { - /** - * Graphe associ\xE9 a la palette - */ - EGGraphe graphe_; + /** + * Graphe associ\xE9 a la palette + */ + EGGraphe graphe_; - //Map<BuTextField,EGCourbe > mapTitles_; + // Map<BuTextField,EGCourbe > mapTitles_; - /** - * Bouton qui applique les changements - */ - JButton btApply_; + /** + * Bouton qui applique les changements + */ + JButton btApply_; - BuToolButton btAssombrir_; + BuToolButton btAssombrir_; - JButton btColor_; + JButton btColor_; - BuToolButton btEcl_; + BuToolButton btEcl_; - BuButton btFormat_; + BuButton btFormat_; - JButton btRefresh_; + JButton btRefresh_; - BuCheckBox cbChangedLeg_; + BuCheckBox cbChangedLeg_; - CtuluRange dataBoite_; + CtuluRange dataBoite_; - TraceIcon ic_; + TraceIcon ic_; - boolean isAdjusting_; + boolean isAdjusting_; - BuMenuItem itemRemove_; + BuMenuItem itemRemove_; - BuMenuItem itemSplit_; + BuMenuItem itemSplit_; - JLabel lbGrapheTitle_; + JLabel lbGrapheTitle_; + /** + * Format des nombres des l\xE9gendes + */ + CtuluNumberFormatI format_ = CtuluNumberFormatDefault.DEFAULT_FMT; - /** - * Format des nombres des l\xE9gendes - */ - CtuluNumberFormatI format_ =CtuluNumberFormatDefault.DEFAULT_FMT; + /** + * S\xE9parateur entre les formats + */ + String separatorFormat_ = "-"; - /** - * S\xE9parateur entre les formats - */ - String separatorFormat_="-"; + /** + * La liste des cournes + */ + JList list_; - /** - * La liste des cournes - */ - JList list_; + CtuluPopupMenu menu_; - CtuluPopupMenu menu_; + /** + * Panel des donn\xE9es qui se met a jour automatiquement lors du clic dans la liste des courbes. + */ + JPanel panelData_; + BPlageAbstract plageEnCours_; - /** - * Panel des donn\xE9es qui se met a jour automatiquement lors du clic dans la liste des courbes. - */ - JPanel panelData_; + List plages_; - BPlageAbstract plageEnCours_; + /** + * LE scroll de la liste des courbe + */ + BuScrollPane sp_; - List plages_; + BPalettePlageTarget target_; - /** - * LE scroll de la liste des courbe - */ - BuScrollPane sp_; + JTextField tfPlageLeg_; + /** + * Textfield du contenu du titre de la courbe + */ + JTextField tfTitleCourbeTop_; - BPalettePlageTarget target_; + // BuTextField txtTitleCourbe_=new BuTextField(10); - JTextField tfPlageLeg_; - /** - * Textfield du contenu du titre de la courbe - */ - JTextField tfTitleCourbeTop_; + private class PlageTableModel implements ListModel { + EGCourbe[] liste_; + public PlageTableModel(EGCourbe[] list) { + super(); + liste_ = list; + } - //BuTextField txtTitleCourbe_=new BuTextField(10); + public void addListDataListener(ListDataListener l) {} + public Object getElementAt(int index) { + return liste_[index]; + } + public int getSize() { + return liste_.length; + } + public void removeListDataListener(ListDataListener l) {} + } + /** + * Renderer qui affiche la courbe sous forme de sa courbe miniature et son libell\xE9 \xE0 cot\xE9 + * + * @author Adrien Hadoux + */ + @SuppressWarnings("serial") + private static class LegendeRenderer extends CtuluCellTextRenderer { // ne pas refaire le travail !!!!!!! - private class PlageTableModel implements ListModel{ - EGCourbe[] liste_; - public PlageTableModel(EGCourbe[] list){ - super(); - liste_=list; - } + private final CellRendererIcon icon_ = new CellRendererIcon(); - public void addListDataListener(ListDataListener l) { - } + public LegendeRenderer() {} - public Object getElementAt(int index) { - return liste_[index]; - } + @Override + protected void setValue(Object _value) { + EGCourbe cb = (EGCourbe) _value; + icon_.setCourbe(cb); + setIcon(icon_); + setText(cb.getTitle()); + setOpaque(true); + } - public int getSize() { - return liste_.length; - } + // public Component getListCellRendererComponent(JList _list, Object _value, int _index, boolean _isSelected, + // boolean _cellHasFocus) { + // super.getListCellRendererComponent(_list, _value, _index, _isSelected, _cellHasFocus); + // EGCourbe cb = (EGCourbe) _value; + // // // pas optimise: a chaque fois que le renderer tu cree une image + // // BufferedImage image = new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB); + // // Graphics2D g = image.createGraphics(); + // // final Rectangle rec = new Rectangle(20, 20); + // // // g.translate(rec.x, rec.y); + // // // la ligne + // // g.setColor(Color.white); + // // g.fillRect(0, 0, 20, 20); + // // final TraceLigne l = new TraceLigne(cb.getLigneModel()); + // // l.dessineTrait(g, 0, rec.height / 2, rec.width, rec.height / 2); + // // // l'icone + // // final TraceIconModel icm = new TraceIconModel(cb.getIconModel()); + // // icm.setTaille(Math.min(rec.width / 3, rec.height / 3));// a voir + // // final TraceIcon ic = new TraceIcon(icm); + // // ic.paintIconCentre(g, rec.width / 2, rec.height / 2); + // // // g.translate(-rec.x, -rec.y); + // // image.flush(); + // icon_.setCourbe(cb); + // setIcon(icon_); + // setText(cb.getTitle()); + // setOpaque(true); + // // // resultat.setIconTextGap(12); + // // if (isSelected) { + // // resultat.setBackground(HIGHLIGHT_COLOR); + // // resultat.setForeground(Color.white); + // // } + // + // return this; + // } + } - public void removeListDataListener(ListDataListener l) { - } - } + /** + * Un icone + * + * @author deniger + */ + private static class CellRendererIcon implements Icon { + TraceLigne traceLigne_ = new TraceLigne(); + TraceIcon traceIcon_ = new TraceIcon(); - /** - * Renderer qui affiche la courbe sous forme de sa courbe miniature et son libell\xE9 \xE0 cot\xE9 - * @author Adrien Hadoux - * - */ - private class LegendeRenderer implements ListCellRenderer{ + protected void setCourbe(EGCourbe _c) { + traceLigne_.getModel().updateData(_c.getLigneModel()); + traceIcon_.getModel().updateData(_c.getIconModel()); + traceIcon_.setTaille(getIconHeight() / 4);// a voir + } - private final Color HIGHLIGHT_COLOR = UIManager.getColor("Tree.selectionBackground"); - public LegendeRenderer(){ + public int getIconHeight() { + return 20; + } - } + public int getIconWidth() { + return 30; + } - @Override - public Component getListCellRendererComponent(JList list, Object value, - int index, boolean isSelected, boolean cellHasFocus) { - EGCourbe cb=(EGCourbe) value; - JLabel resultat=new JLabel(); + public void paintIcon(Component _c, Graphics _g, int _x, int _y) { + Graphics2D g = (Graphics2D) _g; + g.setColor(Color.white); + g.fillRect(_x, _y, _x + getIconWidth(), _y + getIconHeight()); + int middleH = _y + getIconHeight() / 2; + traceLigne_.dessineTrait(g, _x, middleH, _x + getIconWidth(), middleH); + traceIcon_.paintIconCentre(g, _x + getIconWidth() / 2, middleH); - BufferedImage image=new BufferedImage(20,20,BufferedImage.TYPE_INT_RGB); - Graphics2D g = image.createGraphics(); - final Rectangle rec = new Rectangle(20,20); - //g.translate(rec.x, rec.y); - // la ligne - g.setColor(Color.white); - g.fillRect(0, 0, 20, 20); - final TraceLigne l = new TraceLigne(cb.getLigneModel()); - l.dessineTrait(g, 0, rec.height / 2, rec.width, rec.height / 2); - // l'icone - final TraceIconModel icm = new TraceIconModel(cb.getIconModel()); - icm.setTaille(Math.min(rec.width / 3, rec.height/3));// a voir - final TraceIcon ic = new TraceIcon(icm); - ic.paintIconCentre(g, rec.width / 2, rec.height / 2); - //g.translate(-rec.x, -rec.y); + } - resultat.setIcon(new ImageIcon(image)); - resultat.setText(cb.getTitle()); - resultat.setOpaque(true); - //resultat.setIconTextGap(12); - if (isSelected) { - resultat.setBackground(HIGHLIGHT_COLOR); - resultat.setForeground(Color.white); - } - - return resultat; - } + } - } + PlageTableModel model_; - PlageTableModel model_; + public EGPaletteLegendeGraphe(EGGraphe graphe) { + graphe_ = graphe; + // mapTitles_=new HashMap<BuTextField, EGCourbe>(); + // -- construction du panel des l\xE9gendes --// + buildContent(); + } - public EGPaletteLegendeGraphe(EGGraphe graphe){ - graphe_=graphe; - //mapTitles_=new HashMap<BuTextField, EGCourbe>(); - //-- construction du panel des l\xE9gendes --// - buildContent(); - } + private EGCourbe getSelectedCourbe() { + int select = this.list_.getSelectedIndex(); + if (select == -1) return null; + EGCourbe courbe = graphe_.getModel().getCourbes()[select]; + return courbe; + } + BConfigurePalette paletteConf_ = new BConfigurePalette(true); - private EGCourbe getSelectedCourbe(){ - int select=this.list_.getSelectedIndex(); - if(select==-1) - return null; - EGCourbe courbe=graphe_.getModel().getCourbes()[select]; - return courbe; - } + /** + * Met a jour le panneau des donn\xE9es. + */ + private void updatePanelData() { + // -- on r\xE9cup\xE8re la courbe selectionnee --// + EGCourbe courbe = getSelectedCourbe(); + if (courbe != null) paletteConf_.setPalettePanelTarget(courbe); + } - - BConfigurePalette paletteConf_=new BConfigurePalette(true); - /** - * Met a jour le panneau des donn\xE9es. - */ - private void updatePanelData() { - //-- on r\xE9cup\xE8re la courbe selectionnee --// - EGCourbe courbe=getSelectedCourbe(); - if(courbe!=null) - paletteConf_.setPalettePanelTarget(courbe); - } + private void buildContent() { + final EGCourbe[] cs = graphe_.getModel().getCourbes(); - private void buildContent(){ + final BuBorderLayout lay = new BuBorderLayout(2, 2); + setLayout(lay); - final EGCourbe[] cs = graphe_.getModel().getCourbes(); + // -- liste des courbes --// + list_ = new BuEmptyList(); + model_ = new PlageTableModel(cs); + list_.setModel(model_); + list_.setCellRenderer(new LegendeRenderer()); + list_.getSelectionModel().addListSelectionListener(this); + list_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - final BuBorderLayout lay = new BuBorderLayout(2, 2); - setLayout(lay); - - //-- liste des courbes --// - list_ = new BuEmptyList(); - model_ = new PlageTableModel(cs); - list_.setModel(model_); - list_.setCellRenderer(new LegendeRenderer()); - list_.getSelectionModel().addListSelectionListener(this); - list_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + // list_.setFocusable(false); + sp_ = new BuScrollPane(list_); + sp_.setPreferredSize(new Dimension(150, 100)); + sp_.setBorder(BorderFactory.createTitledBorder(EbliResource.EBLI.getString("Liste des courbes"))); + add(sp_, BuBorderLayout.NORTH); - //list_.setFocusable(false); - sp_ = new BuScrollPane(list_); - sp_.setPreferredSize(new Dimension(150,100)); - sp_.setBorder(BorderFactory.createTitledBorder(EbliResource.EBLI.getString("Liste des courbes"))); - add(sp_, BuBorderLayout.NORTH); + final BuPanel pnColor = new BuPanel(); + pnColor.setLayout(new BuButtonLayout(1, SwingConstants.LEFT)); - final BuPanel pnColor = new BuPanel(); - pnColor.setLayout(new BuButtonLayout(1, SwingConstants.LEFT)); + // -- update le panel des donn\xE9es + updatePanelData(); - //-- update le panel des donn\xE9es - updatePanelData(); - - - //paletteConf_.setPreferredSize(new Dimension(300,300)); - paletteConf_.setBorder(BorderFactory.createTitledBorder(EbliResource.EBLI.getString("Param\xE9trage"))); + // paletteConf_.setPreferredSize(new Dimension(300,300)); + paletteConf_.setBorder(BorderFactory.createTitledBorder(EbliResource.EBLI.getString("Param\xE9trage"))); - JScrollPane peast=new JScrollPane(paletteConf_); - peast.setPreferredSize(new Dimension(150,200)); - - add(peast, BorderLayout.CENTER); - btApply_ = new BuButton(BuResource.BU.getIcon("appliquer")); - btApply_.setText(BuResource.BU.getString("Appliquer")); - btApply_.setToolTipText(EbliLib.getS("Appliquer les modifications")); - btApply_.addActionListener(this); - btRefresh_ = new BuButton(BuResource.BU.getIcon("rafraichir")); - btRefresh_.setText(EbliLib.getS("initialiser")); - btRefresh_.setToolTipText(EbliLib.getS("Initialiser les plages des couleurs")); - btRefresh_.addActionListener(this); - btRefresh_.setEnabled(true); -// btFormat_ = new BuButton(); -// btFormat_.setText(EbliLib.getS("Format des labels")); -// btFormat_.setToolTipText(EbliLib.getS("Permet de modifier le formattage des nombres et le s\xE9parateur de valeurs")); -// btFormat_.addActionListener(this); -// btFormat_.setEnabled(false); - final BuPanel btpn = new BuPanel(); - btpn.setLayout(new BuButtonLayout(1, SwingConstants.RIGHT)); + JScrollPane peast = new JScrollPane(paletteConf_); + peast.setPreferredSize(new Dimension(150, 200)); - //btpn.add(btFormat_); - btpn.add(btRefresh_); - //btpn.add(btApply_); - add(btpn, BuBorderLayout.SOUTH); + add(peast, BorderLayout.CENTER); + btApply_ = new BuButton(BuResource.BU.getIcon("appliquer")); + btApply_.setText(BuResource.BU.getString("Appliquer")); + btApply_.setToolTipText(EbliLib.getS("Appliquer les modifications")); + btApply_.addActionListener(this); + btRefresh_ = new BuButton(BuResource.BU.getIcon("rafraichir")); + btRefresh_.setText(EbliLib.getS("initialiser")); + btRefresh_.setToolTipText(EbliLib.getS("Initialiser les plages des couleurs")); + btRefresh_.addActionListener(this); + btRefresh_.setEnabled(true); + // btFormat_ = new BuButton(); + // btFormat_.setText(EbliLib.getS("Format des labels")); + // btFormat_.setToolTipText(EbliLib.getS("Permet de modifier le formattage des nombres et le s\xE9parateur de valeurs")); + // btFormat_.addActionListener(this); + // btFormat_.setEnabled(false); + final BuPanel btpn = new BuPanel(); + btpn.setLayout(new BuButtonLayout(1, SwingConstants.RIGHT)); - this.setPreferredSize(new Dimension(300,300)); - this.setMinimumSize(new Dimension(300,300)); + // btpn.add(btFormat_); + btpn.add(btRefresh_); + // btpn.add(btApply_); + add(btpn, BuBorderLayout.SOUTH); - this.setBorder(BorderFactory.createTitledBorder(EbliResource.EBLI.getString("Edition de la l\xE9gende des courbes"))); - //-- initialise au premier courbe --// - list_.setSelectedIndex(0); - } + this.setPreferredSize(new Dimension(300, 300)); + this.setMinimumSize(new Dimension(300, 300)); + this.setBorder(BorderFactory.createTitledBorder(EbliResource.EBLI.getString("Edition de la l\xE9gende des courbes"))); + // -- initialise au premier courbe --// + list_.setSelectedIndex(0); + } + public void actionPerformed(ActionEvent _e) { - public void actionPerformed(ActionEvent _e) { - - EGCourbe courbe=getSelectedCourbe(); - if(courbe==null)return; + EGCourbe courbe = getSelectedCourbe(); + if (courbe == null) return; - final Object s = _e.getSource(); - if ((s == btColor_) ) { - final Color n = JColorChooser.showDialog(this, EbliResource.EBLI.getString("Couleur"), ic_.getCouleur()); - if ((n != null) && (n != ic_.getCouleur())) { - // setModified(); - ic_.setCouleur(n); - if(courbe!=null) - courbe.setAspectContour(n); - } - } else if (s == btApply_) { - actionApply(); - } else if (s == btRefresh_) { - reinitPlages(); - } else if (btFormat_ == _e.getSource()) { - actionFormat(); - } + final Object s = _e.getSource(); + if ((s == btColor_)) { + final Color n = JColorChooser.showDialog(this, EbliResource.EBLI.getString("Couleur"), ic_.getCouleur()); + if ((n != null) && (n != ic_.getCouleur())) { + // setModified(); + ic_.setCouleur(n); + if (courbe != null) courbe.setAspectContour(n); + } + } else if (s == btApply_) { + actionApply(); + } else if (s == btRefresh_) { + reinitPlages(); + } else if (btFormat_ == _e.getSource()) { + actionFormat(); + } - - } + } + /** + * Appelee lorsqu'on appuie sur le bouton appliquer + */ + private void actionApply() { - /** - * Appelee lorsqu'on appuie sur le bouton appliquer - */ - private void actionApply() { + } - } + /** + * Reinitialise les titres des courbes avec les donn\xE9es initiales. + */ + private void reinitPlages() { - /** - * Reinitialise les titres des courbes avec les donn\xE9es initiales. - */ - private void reinitPlages() { + } - } + /** + * Methode qui ajuste toutes les l\xE9gendes en fonction du format choisi et du separator. + */ + protected void ajusteAllLegendes() { - /** - * Methode qui ajuste toutes les l\xE9gendes en fonction du format choisi et du separator. - */ - protected void ajusteAllLegendes() { + } - } + public void valueChanged(ListSelectionEvent e) { + updatePanelData(); + } + private void actionFormat() { + CtuluNumberFormatI ctuluNumberFormatI = format_; + /* + * CtuluNumberFormatI fmt = getDefaultFormat(); if (fmt == null) { fmt = CtuluLib.DEFAULT_NUMBER_FORMAT; } + */ + final CtuluDecimalFormatEditPanel fmtSelect = new CtuluDecimalFormatEditPanel(ctuluNumberFormatI); + fmtSelect.setErrorTextUnable(); + final CtuluDialogPanel pn = new CtuluDialogPanel() { + public boolean valide() { + return fmtSelect.valide(); + } + }; + pn.setLayout(new BuVerticalLayout(4)); + final JPanel pnSep = new BuPanel(new BuGridLayout(2, 2, 2)); + pnSep.add(new BuLabel(EbliLib.getS("S\xE9parateur"))); + final BuTextField tf = new BuTextField(); + tf.setText(separatorFormat_); + pnSep.add(tf); + pn.add(pnSep); - public void valueChanged(ListSelectionEvent e) { + if (ctuluNumberFormatI == null || ctuluNumberFormatI.isDecimal()) { + fmtSelect.setBorder(BorderFactory.createTitledBorder(EbliLib.getS("Format d\xE9cimal"))); + pn.add(fmtSelect); + } + if (CtuluDialogPanel.isOkResponse(pn.afficheModale(this, EbliLib.getS("Format")))) { + format_ = fmtSelect.getCurrentFmt(); + separatorFormat_ = tf.getText(); + ajusteAllLegendes(); - updatePanelData(); - } + } + } - - - private void actionFormat() { - CtuluNumberFormatI ctuluNumberFormatI =format_; - /* - * CtuluNumberFormatI fmt = getDefaultFormat(); if (fmt == null) { fmt = CtuluLib.DEFAULT_NUMBER_FORMAT; } - */ - final CtuluDecimalFormatEditPanel fmtSelect = new CtuluDecimalFormatEditPanel(ctuluNumberFormatI); - fmtSelect.setErrorTextUnable(); - final CtuluDialogPanel pn = new CtuluDialogPanel() { - public boolean valide() { - return fmtSelect.valide(); - } - }; - pn.setLayout(new BuVerticalLayout(4)); - final JPanel pnSep = new BuPanel(new BuGridLayout(2, 2, 2)); - pnSep.add(new BuLabel(EbliLib.getS("S\xE9parateur"))); - final BuTextField tf = new BuTextField(); - tf.setText(separatorFormat_); - pnSep.add(tf); - pn.add(pnSep); - - if (ctuluNumberFormatI == null || ctuluNumberFormatI.isDecimal()) { - fmtSelect.setBorder(BorderFactory.createTitledBorder(EbliLib.getS("Format d\xE9cimal"))); - pn.add(fmtSelect); - } - if (CtuluDialogPanel.isOkResponse(pn.afficheModale(this, EbliLib.getS("Format")))) { - format_= fmtSelect.getCurrentFmt(); - separatorFormat_= tf.getText(); - ajusteAllLegendes(); - - } - } - - } 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-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileAction.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -13,7 +13,6 @@ import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.layer.MvVisuPanel; -import org.fudaa.fudaa.tr.post.TrPostSource; import com.vividsolutions.jts.geom.LineString; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -112,7 +112,7 @@ * @param _prog * @param _selected */ - public void actBuildGroup( final ProgressionInterface _prog, final MvExportChooseVarAndTime _selected) { + public void actBuildGroup(final ProgressionInterface _prog, final MvExportChooseVarAndTime _selected) { int[] time = _selected.getSelectedTimeStepIdx(); final CtuluVariable[] vs = _selected.getSelectedVar(); @@ -218,15 +218,17 @@ _prog), _prog); EGCourbeChild child; if (isTime) { - String title=var.toString() + CtuluLibString.ESPACE ; - if(var.getCommonUnit()!=null) - title+="("+var.getCommonUnit()+")"+ CtuluLibString.ESPACE ; - title+=timeModel_.getElementAt(time[t]); - //-- on ajoute les extremites du segment choisi --// - title+=", P1("+format(this.selectedLine_.getCoordinateN(0).x,2)+";"+format(this.selectedLine_.getCoordinateN(0).y,2)+")"+sep+"P"+this.selectedLine_.getNumPoints()+"("+format(this.selectedLine_.getCoordinateN(this.selectedLine_.getNumPoints()-1).x,2)+";"+format(this.selectedLine_.getCoordinateN(this.selectedLine_.getNumPoints()-1).y,2)+")"; - - - model.setTitle(title); + String title = var.toString() + CtuluLibString.ESPACE; + if (var.getCommonUnit() != null) title += "(" + var.getCommonUnit() + ")" + CtuluLibString.ESPACE; + title += timeModel_.getElementAt(time[t]); + // -- on ajoute les extremites du segment choisi --// + title += ", P1(" + format(this.selectedLine_.getCoordinateN(0).x, 2) + ";" + + format(this.selectedLine_.getCoordinateN(0).y, 2) + ")" + sep + "P" + + this.selectedLine_.getNumPoints() + "(" + + format(this.selectedLine_.getCoordinateN(this.selectedLine_.getNumPoints() - 1).x, 2) + ";" + + format(this.selectedLine_.getCoordinateN(this.selectedLine_.getNumPoints() - 1).y, 2) + ")"; + + model.setTitle(title); child = new MvProfileCourbeTime(gri, model, timeModel_); } else { child = new MvProfileCourbe(gri, model); @@ -244,15 +246,14 @@ } - - public String format(double value,int nbChiffresSignificatifs){ - String forme="#."; - for(int i=0;i<nbChiffresSignificatifs;i++) - forme+="0"; - DecimalFormat df = new DecimalFormat(forme); - return df.format(value); + public String format(double value, int nbChiffresSignificatifs) { + String forme = "#."; + for (int i = 0; i < nbChiffresSignificatifs; i++) + forme += "0"; + DecimalFormat df = new DecimalFormat(forme); + return df.format(value); } - + /** * Methode qui permet d ajouter une courbe spatiale poru un grapeh deja existant. * @@ -385,7 +386,7 @@ } - protected void close() {} + public void close() {} protected String getHelpForVarTime() { return timeModel_ == null ? CtuluLib.getS("S\xE9lectionner les variables") : CtuluLib Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -41,9 +41,6 @@ final MvLineChooser lineChooser_; - - - /** * panel qui contient les calques des isolignes */ @@ -61,11 +58,11 @@ // initSelected_ = _selected; calque_ = _panel; lineChooser_ = new MvLineChooser(_selected, panel_); - + } @Override - protected void close() { + public void close() { lineChooser_.close(); } 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-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -208,7 +208,6 @@ if ("OUVRIR".equals(com)) { // -- ouverture d un nouveau projet --// - 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) { Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaultSaver.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaultSaver.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaultSaver.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -0,0 +1,38 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.fudaa.tr.post; + +import java.util.Map; + +import org.fudaa.ctulu.CtuluUI; +import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.fudaa.tr.post.data.TrPostDataCreated; +import org.fudaa.fudaa.tr.post.data.TrPostDataCreatedSaver; + +/** + * Classe de sauvegarde pour les fleches + * + * @author deniger + */ +public class TrPostFlecheContentDefaultSaver implements TrPostDataCreatedSaver { + + String vx_; + String vy_; + String name_; + + public TrPostFlecheContentDefaultSaver(TrPostFlecheContentDefaut _defaut) { + name_ = _defaut.getVar().getShortName(); + vx_ = _defaut.getVx().getShortName(); + vy_ = _defaut.getVy().getShortName(); + } + + public TrPostDataCreated restore(TrPostSource _src, CtuluUI _ui, Map _shortName) { + H2dVariableType var = (H2dVariableType) _shortName.get(name_); + H2dVariableType varX = (H2dVariableType) _shortName.get(vx_); + H2dVariableType varY = (H2dVariableType) _shortName.get(vy_); + if (var != null && varX != null && varY != null) { return new TrPostFlecheContentDefaut(_src, var, varX, varY); } + return null; + } +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentDefaut.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -18,9 +18,8 @@ import com.memoire.fu.FuLog; -class TrPostFlecheContentDefaut implements TrPostFlecheContent { +public class TrPostFlecheContentDefaut implements TrPostFlecheContent { - private final boolean isElementData_; int lastTime_ = -1; final H2dVariableType name_; final TrPostSource src_; @@ -31,23 +30,35 @@ final H2dVariableType varVy_; + final boolean useSaver_; + /** * @param _name le nom de la variable * @param _idxX la valeur pour x * @param _idxY la valeur pour y - * @param _isElement true si valeur sur les elements */ public TrPostFlecheContentDefaut(final TrPostSource _src, final H2dVariableType _name, final H2dVariableType _idxX, - final H2dVariableType _idxY, final boolean _isElement) { + final H2dVariableType _idxY) { + this(_src, _name, _idxX, _idxY, false); + } + + /** + * @param _name le nom de la variable + * @param _idxX la valeur pour x + * @param _idxY la valeur pour y + * @param _useSaver true si ce vecteur doit fournir une classe de sauvegarde cf {@link #createSaver()} + */ + public TrPostFlecheContentDefaut(final TrPostSource _src, final H2dVariableType _name, final H2dVariableType _idxX, + final H2dVariableType _idxY, boolean _useSaver) { src_ = _src; name_ = _name; varVx_ = _idxX; varVy_ = _idxY; - isElementData_ = _isElement; + useSaver_ = _useSaver; } public TrPostFlecheContent changeVar(final H2dVariableType _newName) { - return new TrPostFlecheContentDefaut(src_, _newName, varVx_, varVy_, isElementData_); + return new TrPostFlecheContentDefaut(src_, _newName, varVx_, varVy_, useSaver_); } public void clearCache() { @@ -55,15 +66,16 @@ } public TrPostDataCreatedSaver createSaver() { - return null; + + return useSaver_ ? new TrPostFlecheContentDefaultSaver(this) : null; } public TrPostFlecheContent duplicate(final TrPostSource _src) { - return new TrPostFlecheContentDefaut(_src, name_, varVx_, varVy_, isElementData_); + return new TrPostFlecheContentDefaut(_src, name_, varVx_, varVy_, useSaver_); } public TrPostFlecheContent duplicate(final TrPostSource _src, final H2dVariableType _newName) { - return new TrPostFlecheContentDefaut(_src, _newName, varVx_, varVy_, isElementData_); + return new TrPostFlecheContentDefaut(_src, _newName, varVx_, varVy_, useSaver_); } public void fillWhithAllUsedVar(final Set _res) { @@ -85,7 +97,7 @@ try { final double vx = src_.getData(varVx_, _idxTime, _idxObject); final double vy = src_.getData(varVy_, _idxTime, _idxObject); - return Math.hypot(vx,vy); + return Math.hypot(vx, vy); } catch (final IOException _e) { FuLog.warning(_e); } @@ -95,7 +107,7 @@ public TrPostDataVecteur getValues(final int _tIdx) { if (_tIdx != lastTime_) { lastTime_ = _tIdx; - val_ = new TrPostDataVecteur(src_.getData(varVx_, lastTime_), src_.getData(varVy_, lastTime_), isElementData_); + val_ = new TrPostDataVecteur(src_.getData(varVx_, lastTime_), src_.getData(varVy_, lastTime_)); } return val_; @@ -122,7 +134,7 @@ } public boolean isEditable() { - return false; + return useSaver_; } public TrPostFlecheContent isFleche() { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentExpr.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentExpr.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostFlecheContentExpr.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -94,7 +94,7 @@ public TrPostDataVecteur getValues(int _tIdx) { if (_tIdx != lastTime_) { lastTime_ = _tIdx; - lastValue_ = new TrPostDataVecteur(vx_.getDataFor(_tIdx), vy_.getDataFor(_tIdx), isElementData_); + lastValue_ = new TrPostDataVecteur(vx_.getDataFor(_tIdx), vy_.getDataFor(_tIdx)); } return lastValue_; } 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-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -47,6 +47,7 @@ import org.fudaa.ctulu.gui.CtuluCellBooleanRenderer; import org.fudaa.ctulu.gui.CtuluDialog; import org.fudaa.ctulu.gui.CtuluDialogPanel; +import org.fudaa.ctulu.gui.CtuluLibDialog; import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.ef.EfGridInterface; import org.fudaa.dodico.ef.EfLib; @@ -275,30 +276,6 @@ // liste des noeuuds coupes Set<EbliNode> nodesCutted = null; - // /** - // *ajout une fillelayout a la liste des frame layout - // * - // * @param _fille - // */ - // public void addFillesLayout(TrPostLayoutFille _fille) { - // listeFillesLayout.add(_fille); - // } - - // /** - // * retourne la frame layout en cours d utilisation par le user. sinon retourne la premiere fille. IMPORTANT: il faut - // * passer par cette methode pour etre root\xE9 vers la bonne scene en cours de manip. - // * - // * @return - // */ - // public TrPostLayoutFille getSelectedFilleLayout() { - // for (Iterator<TrPostLayoutFille> it = listeFillesLayout.iterator(); it.hasNext();) { - // TrPostLayoutFille fille = it.next(); - // if (fille.isSelected()) return fille; - // } - // // sinon retourne la premier frame - // return listeFillesLayout.get(0); - // } - /** * internalframe qui gere les multiProjets */ @@ -385,28 +362,28 @@ * @param _src */ public void ajouterSource(final TrPostSource _src) { - ajouterSource(_src,null); + 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(); - // -- ajout du menu correspondant uniquement a partir de la 2eme --// - // if (listeSrc_.size()>1 || (menuPost_!=null &&)) - construitMenuPostSpecifiqueSource(_src,title); + public void ajouterSource(final TrPostSource _src, String title) { + _src.addVariableListener(new VariableListener()); + if (_src.getFiles() == null || !isOneSourceLoaded(_src.getFiles())) { + listeSrc_.add(_src); + _src.buildDefaultVarUpdateLists(); - } else { - // -- messqge d erreur: le fichier est deja ouvert --// - new BuDialogMessage(impl_.getApp(), impl_.getInformationsSoftware(), "Le fichier est deja ouvert.").activate(); + // -- ajout du menu correspondant uniquement a partir de la 2eme --// + // if (listeSrc_.size()>1 || (menuPost_!=null &&)) + construitMenuPostSpecifiqueSource(_src, title); - } - // -- notify aux observers --// - this.notifyObservers(); - + } 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(); + } public TrPostSource findSource(final String _file) { @@ -464,32 +441,32 @@ 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; + 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 + * 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 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)); @@ -579,29 +556,27 @@ 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; + 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; } } - - public boolean isAsuiteCalcul(final TrPostSource _src){ - if(_src instanceof TrPostSourceFromReader){ - TrPostSourceFromReader s=(TrPostSourceFromReader) _src; - if(s.getReader() instanceof TrPostSourceReaderComposite) - return true; - - } - - return false; + public boolean isAsuiteCalcul(final TrPostSource _src) { + if (_src instanceof TrPostSourceFromReader) { + TrPostSourceFromReader s = (TrPostSourceFromReader) _src; + if (s.getReader() instanceof TrPostSourceReaderComposite) return true; + + } + + return false; } - + public String formatFichier(final File file) { if (file == null) return ""; final String nomFichier = file.getAbsolutePath(); @@ -637,15 +612,12 @@ * * @param _src */ - public void construitMenuPostSpecifiqueSource(final TrPostSource _src,String title) { + 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())); + 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); @@ -696,37 +668,6 @@ // } } - /** - * Construit le menu Layout. Cette methode doit etre appelee une seule fois - */ - // public void setMenuLayout() { - // //filleLayout_.controller_.construitMenuMultiScenes(impl_.getMainMenuBar()); - // final BuMenuBar menubar = impl_.getMainMenuBar(); - // // -- creation du menu principal des scenes a cote de post --// - // - // menuLayout_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), - // "AJOUTFRAME", CtuluResource.CTULU - // .getIcon("crystal_ajouter"), getSelectedFilleLayout().controller_); - // /* - // * - // * menu.addMenuItem(TrResource.getS(("Ajouter un layout dans la vue")), - // * "AJOUTLAYOUT", CtuluResource.CTULU .getIcon("crystal_ajouter"), - // * filleLayout_.controller_); - // * menu.addMenuItem(TrResource.getS(("Retirer un layout de la vue")), - // * "RETIRELAYOUT", CtuluResource.CTULU .getIcon("crystal_enlever"), - // * filleLayout_.controller_); menu.addSeparator("Layouts"); - // * menu.addSubMenu(filleLayout_.controller_.menuScenes_, true); - // */ - // // ajout a cote de menu post - // // menuLayout_.addSeparator(TrResource.getS("Liste des fen\xEAtres")); - // // menuLayout_.addMenuItem(TrResource.getS(("Layout ")) + - // // listeFillesLayout.size(), "FILLELAYOUT" - // // + (listeFillesLayout.size() - 1), null, this); - // // - // - // menubar.add(menuLayout_, 2); - // - // } public BuMenu getMenuPost() { if (menuPost_ == null) menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); return menuPost_; @@ -766,21 +707,19 @@ CtuluResource.CTULU.getIcon("crystal_ajouter"), new ActionListener() { public void actionPerformed(final ActionEvent _e) { - - final int reponse = JOptionPane - .showConfirmDialog( - getImpl().getParentComponent(), + 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?")); - if (reponse == JOptionPane.CANCEL_OPTION) { return; } - if (reponse == JOptionPane.OK_OPTION) { - getManager().saveProject(false); - } - + .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); + getManager().setProjet(null); } }); @@ -794,11 +733,11 @@ // -- affichage de la fenetre de gestion multi projet --// if (!filleProjetctManager_.isVisible()) { - filleProjetctManager_.setSize(filleProjetctManager_.getSize().width, - filleProjetctManager_.getSize().height / 2); +// filleProjetctManager_.setSize(filleProjetctManager_.getSize().width, +// filleProjetctManager_.getSize().height / 2); impl_.addInternalFrame(filleProjetctManager_); - } + } else filleProjetctManager_.moveToFront(); } @@ -1431,27 +1370,27 @@ return src.getId(); } - + public String deliverSourceSuiteId(TrPostSource src) { - String idString = src.getTitle(); - if (src.getId() == null) { + String idString = src.getTitle(); + if (src.getId() == null) { - String uniqueId = CtuluLibGenerator.getInstance().deliverUniqueStringId(idString); - src.setId(uniqueId); - } else { + String uniqueId = CtuluLibGenerator.getInstance().deliverUniqueStringId(idString); + src.setId(uniqueId); + } else { - // -- on teste si l'id de base est 'parlant' => contient le nom du ficheir --// - String nameFormate = FuLib.clean(idString); - String id = src.getId(); - if (!id.startsWith(nameFormate)) { - String uniqueId = CtuluLibGenerator.getInstance().deliverUniqueStringId(idString); - src.setId(uniqueId); - } + // -- on teste si l'id de base est 'parlant' => contient le nom du ficheir --// + String nameFormate = FuLib.clean(idString); + String id = src.getId(); + if (!id.startsWith(nameFormate)) { + String uniqueId = CtuluLibGenerator.getInstance().deliverUniqueStringId(idString); + src.setId(uniqueId); + } - } - return src.getId(); + } + return src.getId(); - } + } /** * genere uniquement l id. Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarEnvFlecheContent.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarEnvFlecheContent.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarEnvFlecheContent.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -90,7 +90,7 @@ public TrPostDataVecteur getValues(final int _tIdx) { if (val_ == null) { - val_ = new TrPostDataVecteur(src_.getEnveloppData(varVx_), src_.getEnveloppData(varVy_), true); + val_ = new TrPostDataVecteur(src_.getEnveloppData(varVx_), src_.getEnveloppData(varVy_)); } return val_; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostRubarLoader.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -334,7 +334,7 @@ varEnveloppData.put(H2dVariableType.VITESSE_U, qx); final EfDataElement qy = new EfDataElement(qvMax); varEnveloppData.put(H2dVariableType.VITESSE_V, qy); - varEnveloppData.put(H2dVariableType.VITESSE, new TrPostDataVecteur(qx, qy, true)); + varEnveloppData.put(H2dVariableType.VITESSE, new TrPostDataVecteur(qx, qy)); src_.setEnvResultats(varEnveloppData); src_.setEnvTime(envReader.getTfinal()); checkEnvTime(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -513,7 +513,7 @@ */ public final TrPostFlecheContent createSimpleVecteurContent(final H2dVariableType _name, final H2dVariableType _idxX, final H2dVariableType _idxY, final boolean _isElt) { - return new TrPostFlecheContentDefaut(this, _name, _idxX, _idxY, _isElt); + return new TrPostFlecheContentDefaut(this, _name, _idxX, _idxY); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceTelemac3D.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceTelemac3D.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceTelemac3D.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -225,7 +225,7 @@ final H2dVariableType vy = variable[idxY * nbplan + k]; final H2dVariableTypeCreated var2d = H2dVariableType.createTempVar(nameBase + " 2D " + fmt.format(k + 1), _shortName); - fleches.add(new TrPostFlecheContentDefaut(source, var2d, vx, vy, false)); + fleches.add(new TrPostFlecheContentDefaut(source, var2d, vx, vy)); var2d.setUnit(H2dVariableType.VITESSE.getCommonUnitString()); } final int idxW = H2DLib.getIdxVarWithName(vars, nameBase + endz); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataCreationPanel.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -186,6 +186,9 @@ @Override protected void addBtAdd(final BuPanel _pn) { super.addBtAdd(_pn); + _pn.add(buildButton(BuResource.BU.getIcon("ajouter"), TrResource.getS("Ajouter un vecteur"), "ADD_FLECHE", + TrResource.getS("Ajouter un vecteur d\xE9fini par 2 variables d\xE9j\xE0 d\xE9finies"), + 0)); _pn.add(buildButton(BuResource.BU.getIcon("ajouter"), TrResource .getS("Ajouter une variable d\xE9finie par un pas de temps"), "ADD_TIME", TrResource .getS("Ajouter une nouvelle variable d\xE9finie par un pas de temps et une variable d\xE9j\xE0 d\xE9finie"), 0)); @@ -199,11 +202,11 @@ public void actionPerformed(final ActionEvent _evt) { if ("ADD_TIME".equals(_evt.getActionCommand())) { ((TrPostDataUserVarModel) getTableModel()).actionAddCst(); - } - if ("ADD_STATS".equals(_evt.getActionCommand())) { + } else if ("ADD_STATS".equals(_evt.getActionCommand())) { ((TrPostDataUserVarModel) getTableModel()).actionAddStatistic(); - } - super.actionPerformed(_evt); + } else if ("ADD_FLECHE".equals(_evt.getActionCommand())) { + ((TrPostDataUserVarModel) getTableModel()).actionAddFleche(); + } else super.actionPerformed(_evt); } }; tb_ = edi.getTable(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCommonPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCommonPanel.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCommonPanel.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -37,6 +37,7 @@ * @author Fred Deniger * @version $Id: TrPostDataEditCommonPanel.java,v 1.4 2006-12-20 16:13:19 deniger Exp $ */ +@SuppressWarnings("serial") public abstract class TrPostDataEditCommonPanel extends CtuluDialogPanel { class NameDocumentListener implements DocumentListener { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCstPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCstPanel.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditCstPanel.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -21,6 +21,7 @@ * @author Fred Deniger * @version $Id: TrPostDataEditCstPanel.java,v 1.4 2007-01-17 10:44:30 deniger Exp $ */ +@SuppressWarnings("serial") public class TrPostDataEditCstPanel extends TrPostDataEditCommonPanel { final BuComboBox cbTime_; Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditFlechePanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditFlechePanel.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataEditFlechePanel.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -0,0 +1,71 @@ +/* + * @creation 9 ao\xFBt 2005 + * @modification $Date: 2007-01-17 10:44:30 $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.fudaa.tr.post.data; + +import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.dodico.h2d.type.H2dVariableTypeCreated; +import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.TrPostFlecheContentDefaut; +import org.fudaa.fudaa.tr.post.TrPostSource; + +import com.memoire.bu.BuComboBox; + +/** + * Permet l'edition des variables creees par l'utilisateur. + * + * @author Fred Deniger + * @version $Id: TrPostDataEditCstPanel.java,v 1.4 2007-01-17 10:44:30 deniger Exp $ + */ +@SuppressWarnings("serial") +public class TrPostDataEditFlechePanel extends TrPostDataEditCommonPanel { + + final BuComboBox cbVarX_; + final BuComboBox cbVarY_; + + H2dVariableType initVarX_; + H2dVariableType initVarY_; + + TrPostFlecheContentDefaut initFleche_; + + /** + * @param _src la source + * @param _var la variable a modifier: si null, phase de creation. + */ + public TrPostDataEditFlechePanel(final TrPostSource _src, final H2dVariableTypeCreated _var) { + super(_src, _var); + initFleche_ = _var == null ? null : (TrPostFlecheContentDefaut) _src.getUserCreatedVar(_var); + cbVarX_ = new BuComboBox(super.varToAdd_.toArray()); + cbVarY_ = new BuComboBox(super.varToAdd_.toArray()); + if (initFleche_ != null) { + initVarX_ = initFleche_.getVx(); + initVarY_ = initFleche_.getVy(); + cbVarX_.setSelectedItem(initVarX_); + cbVarY_.setSelectedItem(initVarY_); + } + addLabel(TrResource.getS("Composante selon X")); + add(cbVarX_); + addLabel(TrResource.getS("Composante selon Y")); + add(cbVarY_); + + } + + @Override + public TrPostDataCreated createData() { + return new TrPostFlecheContentDefaut(src_, getNewVar(), (H2dVariableType) cbVarX_.getSelectedItem(), + (H2dVariableType) cbVarY_.getSelectedItem(), true); + } + + /** + * @return true si des modifications ont ete faites. + */ + @Override + public boolean isModified() { + if (var_ == null || initVarX_ == null || initVarY_ == null) { return true; } + return super.isVarModified() || cbVarX_.getSelectedItem() != initVarX_ || cbVarY_.getSelectedItem() != initVarY_; + } +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataUserVarModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataUserVarModel.java 2009-01-28 19:17:26 UTC (rev 4422) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/data/TrPostDataUserVarModel.java 2009-01-28 22:44:24 UTC (rev 4423) @@ -20,6 +20,7 @@ import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.dodico.h... [truncated message content] |