r2329 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
Author: chatellier Date: 2009-06-05 14:57:13 +0000 (Fri, 05 Jun 2009) New Revision: 2329 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx Log: Remove NumberEditor (again) Cancel is working Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2009-06-05 13:33:16 UTC (rev 2328) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2009-06-05 14:57:13 UTC (rev 2329) @@ -24,18 +24,16 @@ <script><![CDATA[ import fr.ifremer.isisfish.entities.FisheryRegion; +import fr.ifremer.isisfish.entities.FisheryRegionImpl; import com.bbn.openmap.gui.OMToolSet; -import fr.ifremer.isisfish.map.CellSelectionLayer; -import com.bbn.openmap.event.SelectMouseMode; -import fr.ifremer.isisfish.entities.FisheryRegionImpl; -import jaxx.runtime.swing.editor.NumberEditor; protected OMToolSet toolSet = new OMToolSet(); - toolSet.setupListeners(cellMap); toolMap.add((Component)toolSet); + setButtonTitle(_("isisfish.input.continueCells")); setNextPath("$root/$cells"); + addPropertyChangeListener("bean", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (evt.getOldValue() != null || evt.getNewValue() == null) { @@ -51,17 +49,22 @@ @Override public void refresh() { + FisheryRegion region = getVerifier().getEntity(FisheryRegion.class); + + // add null before, for second to be considered as a changed event + // otherwize, setBean has no effect setBean(null); - FisheryRegion region = getVerifier().getEntity(FisheryRegion.class); setBean((FisheryRegionImpl)region); - if (region != null){ + + if (getBean() != null) { setFieldMapfilesModel(getBean()); + /* numberEditor is not working fieldLatMin.init(); fieldLatMax.init(); fieldLongMin.init(); fieldLongMax.init(); fieldCellLengthLatitude.init(); - fieldCellLengthLongitude.init(); + fieldCellLengthLongitude.init();*/ } } @@ -71,44 +74,44 @@ getVerifier().setCancelButton(cancel); } -protected void setFieldMapfilesModel(FisheryRegion region){ +protected void setFieldMapfilesModel(FisheryRegion region) { DefaultListModel model = new DefaultListModel(); java.util.List<String> mapList = region.getMapFileList(); - if (mapList != null){ + if (mapList != null) { int cnt = 0; - for (String map : mapList){ + for (String map : mapList) { model.add(cnt, map); cnt++; } } fieldMapfiles.setModel(model); } -protected void mapFieldChanged(){ +protected void mapFieldChanged() { Object[] values = fieldMapfiles.getSelectedValues(); java.util.List<String> valuesList = new ArrayList<String>(); - if (values != null){ + if (values != null) { for (Object o : values){ valuesList.add((String)o); } } getBean().setMapFileList(valuesList); } -protected void addMap(){ +protected void addMap() { getContextValue(InputAction.class).addMap(getBean()); } -protected void delMap(){ +protected void delMap() { getContextValue(InputAction.class).removeMap(getBean(), fieldMapfiles.getSelectedValues()); } -protected void cellFillChanged(){ +protected void cellFillChanged() { } -protected void cellFile(){ +protected void cellFile() { getContextValue(InputAction.class).loadCellFile(fieldCellFile.getText()); } -protected void check(){ +protected void check() { getContextValue(InputAction.class).checkFisheryRegion(getBean()); setInfoText(_("isisfish.message.check.region")); } -protected void save(){ +protected void save() { setInfoText(_("isisfish.message.checking.cell")); getContextValue(InputAction.class).saveFisheryRegion(getBean()); getVerifier().setEditable(false); @@ -117,9 +120,7 @@ setInfoText(_("isisfish.message.save.finished")); refresh(); } - ]]> - </script> - + ]]></script> <JPanel id='body' layout='{new BorderLayout()}'> <JSplitPane id="FisheryRegionTab" name="FisheryRegion" constraints='BorderLayout.CENTER' oneTouchExpandable="true" dividerLocation="200" orientation="HORIZONTAL"> @@ -146,9 +147,11 @@ <JLabel text="isisfish.fisheryRegion.latitude.min"/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <NumberEditor id='fieldLatMin' constructorParams='this' + <!-- NumberEditor id='fieldLatMin' constructorParams='this' bean='{getBean()}' property='minLatitude' - decorator='boxed' useSign='true'/> + decorator='boxed' useSign='true'/--> + <JTextField id="fieldLatMin" text='{getBean().getMinLatitude()}' decorator='boxed' + onKeyReleased='getBean().setMinLatitude(Float.parseFloat(fieldLatMin.getText()))'/> </cell> </row> <row> @@ -156,9 +159,11 @@ <JLabel text="isisfish.fisheryRegion.latitude.max"/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <NumberEditor id='fieldLatMax' constructorParams='this' + <!-- NumberEditor id='fieldLatMax' constructorParams='this' bean='{getBean()}' property='maxLatitude' - decorator='boxed' useSign='true'/> + decorator='boxed' useSign='true'/--> + <JTextField id="fieldLatMax" text='{getBean().getMaxLatitude()}' decorator='boxed' + onKeyReleased='getBean().setMaxLatitude(Float.parseFloat(fieldLatMax.getText()))'/> </cell> </row> <row> @@ -166,9 +171,11 @@ <JLabel text="isisfish.fisheryRegion.longitude.min"/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <NumberEditor id='fieldLongMin' constructorParams='this' + <!-- NumberEditor id='fieldLongMin' constructorParams='this' bean='{getBean()}' property='minLongitude' - decorator='boxed' useSign='true'/> + decorator='boxed' useSign='true'/--> + <JTextField id="fieldLongMin" text='{getBean().getMinLongitude()}' decorator='boxed' + onKeyReleased='getBean().setMinLongitude(Float.parseFloat(fieldLongMin.getText()))'/> </cell> </row> <row> @@ -176,9 +183,11 @@ <JLabel text="isisfish.fisheryRegion.longitude.max"/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <NumberEditor id='fieldLongMax' constructorParams='this' + <!-- NumberEditor id='fieldLongMax' constructorParams='this' bean='{getBean()}' property='maxLongitude' - decorator='boxed' useSign='true'/> + decorator='boxed' useSign='true'/--> + <JTextField id="fieldLongMax" text='{getBean().getMaxLongitude()}' decorator='boxed' + onKeyReleased='getBean().setMaxLongitude(Float.parseFloat(fieldLongMax.getText()))'/> </cell> </row> <row> @@ -191,9 +200,11 @@ <JLabel text="isisfish.fisheryRegion.latitude"/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <NumberEditor id='fieldCellLengthLatitude' constructorParams='this' + <!-- NumberEditor id='fieldCellLengthLatitude' constructorParams='this' bean='{getBean()}' property='cellLengthLatitude' - decorator='boxed' useSign='true'/> + decorator='boxed' useSign='true'/--> + <JTextField id="fieldCellLengthLatitude" text='{getBean().getCellLengthLatitude()}' decorator='boxed' + onKeyReleased='getBean().setCellLengthLatitude(Float.parseFloat(fieldCellLengthLatitude.getText()))'/> </cell> </row> <row> @@ -201,9 +212,11 @@ <JLabel text="isisfish.fisheryRegion.longitude"/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <NumberEditor id='fieldCellLengthLongitude' constructorParams='this' + <!-- NumberEditor id='fieldCellLengthLongitude' constructorParams='this' bean='{getBean()}' property='cellLengthLongitude' - decorator='boxed' useSign='true'/> + decorator='boxed' useSign='true'/--> + <JTextField id="fieldCellLengthLongitude" text='{getBean().getCellLengthLongitude()}' decorator='boxed' + onKeyReleased='getBean().setCellLengthLongitude(Float.parseFloat(fieldCellLengthLongitude.getText()))'/> </cell> </row> <row> @@ -275,10 +288,12 @@ <JButton id='check' text="isisfish.common.check" onActionPerformed='check()' decorator='boxed'/> </cell> </row> - </Table> + </Table> <JPanel id='map' layout='{new BorderLayout()}'> - <fr.ifremer.isisfish.map.OpenMapToolPanel id='toolMap' javaBean='new fr.ifremer.isisfish.map.OpenMapToolPanel()' constraints='BorderLayout.NORTH' decorator='boxed'/> - <fr.ifremer.isisfish.map.IsisMapBean id='cellMap' selectionMode="0" javaBean='new fr.ifremer.isisfish.map.IsisMapBean()' fisheryRegion='{getBean()}' constraints='BorderLayout.CENTER' decorator='boxed'/> + <fr.ifremer.isisfish.map.OpenMapToolPanel id='toolMap' javaBean='new fr.ifremer.isisfish.map.OpenMapToolPanel()' + constraints='BorderLayout.NORTH' decorator='boxed'/> + <fr.ifremer.isisfish.map.IsisMapBean id='cellMap' selectionMode="0" javaBean='new fr.ifremer.isisfish.map.IsisMapBean()' + fisheryRegion='{getBean()}' constraints='BorderLayout.CENTER' decorator='boxed'/> </JPanel> </JSplitPane> </JPanel>
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org