r2302 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
Author: chatellier Date: 2009-06-02 09:52:06 +0000 (Tue, 02 Jun 2009) New Revision: 2302 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx Log: Remove NumberEditor (data binding are really non working) Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2009-06-02 09:41:23 UTC (rev 2301) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2009-06-02 09:52:06 UTC (rev 2302) @@ -100,12 +100,15 @@ @Override protected void goBackToPreviousNode(TreeSelectionEvent event, Exception e) { if (e != null) { - // FIXME add logger here ? - e.printStackTrace(); + if (log.isErrorEnabled()) { + log.error("Error happen, go back to previous node" ,e); + } } // go back to previous node returnToPreviousNode(getNavigationTree(), event); - log.info("goBackToPreviousNode"); + if (log.isInfoEnabled()) { + log.info("goBackToPreviousNode"); + } } Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2009-06-02 09:41:23 UTC (rev 2301) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2009-06-02 09:52:06 UTC (rev 2302) @@ -39,19 +39,6 @@ protected int month = 0; protected PropertyChangeListener listener; -addPropertyChangeListener("strategyMonthInfo", new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent evt) { - if (evt.getOldValue() != null || evt.getNewValue() == null) { - numberOfTrips.setText(""); - fieldStrategyMonthInfoMinInactivityDays.setModelText(""); - fieldStrategyMonthInfoProportion.setMatrix(null); - } - if (evt.getNewValue() != null) { - - } - } -}); - fieldStrategyMonthInfoProportion.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { @@ -86,8 +73,15 @@ fieldStrategyMonthInfoTripType.addActionListener(listener); } setProportionMetierMatrix(); - fieldStrategyMonthInfoMinInactivityDays.init(); + //fieldStrategyMonthInfoMinInactivityDays.setText( } + else { + // don't put in addPropertyChangeListener + // if called after, remove content :( + numberOfTrips.setText(""); + fieldStrategyMonthInfoMinInactivityDays.setText(""); + fieldStrategyMonthInfoProportion.setMatrix(null); + } matrixListener = new MatrixPanelListener() { @Override public void matrixChanged(MatrixPanelEvent event) { @@ -138,13 +132,13 @@ <JLabel text="isisfish.strategyMonthInfo.minInactivityDays" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <NumberEditor id='fieldStrategyMonthInfoMinInactivityDays' constructorParams='this' + <!-- NumberEditor id='fieldStrategyMonthInfoMinInactivityDays' constructorParams='this' bean='{getStrategyMonthInfo()}' property='minInactivityDays' enabled='{isActif()}' decorator='boxed' useSign='true' - _bean='{StrategyMonthInfoImpl.class}' _method='"MinInactivityDays"'/> - <!--JTextField id="fieldStrategyMonthInfoMinInactivityDays" text='{getStrategyMonthInfo().getMinInactivityDays()}' + _bean='{StrategyMonthInfoImpl.class}' _method='"MinInactivityDays"'/--> + <JTextField id="fieldStrategyMonthInfoMinInactivityDays" text='{getStrategyMonthInfo().getMinInactivityDays()}' onKeyReleased='getStrategyMonthInfo().setMinInactivityDays(Double.parseDouble(fieldStrategyMonthInfoMinInactivityDays.getText()))' - enabled='{isActif()}' decorator='boxed' _bean='{StrategyMonthInfoImpl.class}' _method='"MinInactivityDays"'/--> + enabled='{isActif()}' decorator='boxed' _bean='{StrategyMonthInfoImpl.class}' _method='"MinInactivityDays"'/> </cell> </row> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2009-06-02 09:41:23 UTC (rev 2301) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2009-06-02 09:52:06 UTC (rev 2302) @@ -1,7 +1,6 @@ <!-- /* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin + * Copyright (C) 2005 - 2009 Ifremer, Code Lutin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -17,18 +16,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *##%*/ - -/* * - * IsisFish.java - * - * Created: 1 aout 2005 18:37:25 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * @version $Revision: 1312 $ - * - * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ - * by : $Author: sletellier $ - */ --> <fr.ifremer.isisfish.ui.input.InputContentUI> @@ -45,24 +32,7 @@ import org.codelutin.topia.persistence.TopiaEntity; import fr.ifremer.isisfish.ui.WelcomePanelUI; import fr.ifremer.isisfish.ui.widget.editor.GenericCell; -import jaxx.runtime.swing.editor.NumberEditor; -addPropertyChangeListener("bean", new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent evt) { - if (evt.getOldValue() != null || evt.getNewValue() == null) { - // remove previous binding on getBean() - //jaxx.runtime.SwingUtil.removeDataBinding(get$Table0(), "fieldCellName.text", "fieldCellLongitude.text", "fieldCellLatitude.text", "fieldCellLand.selected", "fieldCellComment.text");fieldPopulationBasicsName.setText(""); - fieldStrategyName.setText(""); - fieldStrategyProportionSetOfVessels.setModelText("0.0"); - fieldStrategyComment.setText(""); - } - if (evt.getNewValue() != null) { - // add binding on getBean() - //jaxx.runtime.SwingUtil.applyDataBinding(get$Table0(), "fieldCellName.text", "fieldCellLongitude.text", "fieldCellLatitude.text", "fieldCellLand.selected", "fieldCellComment.text"); - } - } -}); - public void refresh() { getVerifier().setSaveButton(save); getVerifier().setCancelButton(cancel); @@ -70,19 +40,26 @@ getVerifier().setDeleteButton(remove); Strategy strategy = (Strategy)getVerifier().getEntity(Strategy.class); setBean((StrategyImpl) strategy); - if (getBean() != null){ + if (getBean() != null) { getVerifier().addCurrentPanel(strategyInactivity); setSetOfVesselsModel(); - fieldStrategyProportionSetOfVessels.init(); + //fieldStrategyProportionSetOfVessels.init(); } + else { + // listener seam to be called after refresh and remove content :( + fieldStrategyName.setText(""); + //fieldStrategyProportionSetOfVessels.setModelText("0.0"); + fieldStrategyProportionSetOfVessels.setText("0.0"); + fieldStrategyComment.setText(""); + } } protected void setSetOfVesselsModel() { ActionListener[] listeners = fieldStrategySetOfVessels.getActionListeners(); - for (ActionListener listener : listeners){ + for (ActionListener listener : listeners) { fieldStrategySetOfVessels.removeActionListener(listener); } jaxx.runtime.SwingUtil.fillComboBox(fieldStrategySetOfVessels,getRegion().getSetOfVessels(), getBean().getSetOfVessels(), true); - for (ActionListener listener : listeners){ + for (ActionListener listener : listeners) { fieldStrategySetOfVessels.addActionListener(listener); } } @@ -112,13 +89,13 @@ <JLabel text="isisfish.strategy.proportionSetOfVessels" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <NumberEditor id='fieldStrategyProportionSetOfVessels' constructorParams='this' + <!-- NumberEditor id='fieldStrategyProportionSetOfVessels' constructorParams='this' bean='{getBean()}' property='proportionSetOfVessels' enabled='{isActif()}' decorator='boxed' useSign='true' - _bean='{StrategyImpl.class}' _method='"ProportionSetOfVessels"'/> - <!--JTextField id="fieldStrategyProportionSetOfVessels" text='{getBean().getProportionSetOfVessels()}' + _bean='{StrategyImpl.class}' _method='"ProportionSetOfVessels"'/--> + <JTextField id="fieldStrategyProportionSetOfVessels" text='{getBean().getProportionSetOfVessels()}' onKeyReleased='getBean().setProportionSetOfVessels(Double.parseDouble(fieldStrategyProportionSetOfVessels.getText()))' - enabled='{isActif()}' decorator='boxed' _bean='{StrategyImpl.class}' _method='"ProportionSetOfVessels"'/--> + enabled='{isActif()}' decorator='boxed' _bean='{StrategyImpl.class}' _method='"ProportionSetOfVessels"'/> </cell> </row> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2009-06-02 09:41:23 UTC (rev 2301) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2009-06-02 09:52:06 UTC (rev 2302) @@ -1,7 +1,6 @@ <!-- /* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin + * Copyright (C) 2005 - 2009 Ifremer, Code Lutin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -17,28 +16,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *##%*/ - -/* * - * IsisFish.java - * - * Created: 1 aout 2005 18:37:25 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * @version $Revision: 1312 $ - * - * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ - * by : $Author: sletellier $ - */ --> - <!-- - + Strategy - +--> <fr.ifremer.isisfish.ui.input.InputContentUI> <script><![CDATA[ import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabbedPaneListener; getVerifier().addCurrentPanel(this); + public void refresh() { if (isSens()){ strategyTab.addChangeListener(new SensitivityTabbedPaneListener()); @@ -50,8 +35,12 @@ ]]></script> <JPanel id='body' layout='{new BorderLayout()}'> <JTabbedPane id="strategyTab" name="Strategy" constraints='BorderLayout.CENTER'> - <tab title='{_("isisfish.strategy.title")}'><StrategyTabUI id='strategyTabUI' constructorParams='this'/></tab> - <tab title='{_("isisfish.strategyMonthInfo.title")}'><StrategyMonthInfoUI id='strategyMonthInfoUI' constructorParams='this'/></tab> + <tab title='isisfish.strategy.title'> + <StrategyTabUI id='strategyTabUI' constructorParams='this'/> + </tab> + <tab title='isisfish.strategyMonthInfo.title'> + <StrategyMonthInfoUI id='strategyMonthInfoUI' constructorParams='this'/> + </tab> </JTabbedPane> </JPanel> </fr.ifremer.isisfish.ui.input.InputContentUI>
participants (1)
-
chatellier@users.labs.libre-entreprise.org