Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- 3175 discussions
r1579 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: . input result simulator
by sletellierï¼ users.labs.libre-entreprise.org 30 Oct '08
by sletellierï¼ users.labs.libre-entreprise.org 30 Oct '08
30 Oct '08
Author: sletellier
Date: 2008-10-30 17:47:57 +0000 (Thu, 30 Oct 2008)
New Revision: 1579
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
Log:
InputUI in progress
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java 2008-10-30 17:47:57 UTC (rev 1579)
@@ -85,5 +85,6 @@
Logger.getLogger(Common.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
- }
+ }
+
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -36,11 +36,91 @@
+-->
<Table>
<script><![CDATA[
+ import fr.ifremer.isisfish.entities.Cell;
+ import com.bbn.openmap.gui.OMToolSet;
+ import fr.ifremer.isisfish.map.IsisMapBean;
+ import fr.ifremer.isisfish.map.OpenMapToolPanel;
+ import org.codelutin.topia.persistence.TopiaEntity;
+ import fr.ifremer.isisfish.entities.Zone;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+
+ protected IsisMapBean cellMap = new IsisMapBean();
+ protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
+ protected OMToolSet toolSet = new OMToolSet();
+ protected boolean changed = false;
+
public CellUI (InputAction action){
setContextValue(action);
}
protected void refresh() {
- }
+ Cell cell = getContextValue(InputAction.class).getCell();
+ if (cell != null){
+ DefaultComboBoxModel fieldCellModel = new DefaultComboBoxModel();
+ java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
+ for (Cell c : cells){
+ fieldCellModel.addElement(c);
+ }
+ fieldCell.setModel(fieldCellModel);
+
+ fieldCellName.setText(cell.getName());
+ fieldCellLatitude.setText(cell.getLatitude()+"");
+ fieldCellLongitude.setText(cell.getLongitude()+"");
+ fieldCellLand.setSelected(cell.getLand());
+ fieldCellComment.setText(getContextValue(InputAction.class).getCell().getComment());
+
+ cellMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
+ toolSet.setupListeners(cellMap);
+ toolMap.add((Component)toolSet);
+ cellMapPanel.add(toolMap, BorderLayout.NORTH);
+ cellMapPanel.add(cellMap, BorderLayout.CENTER);
+ cellMap.setSelectedCells(cell);
+ }
+ }
+ protected void save(){
+ TopiaEntity topia = getContextValue(InputAction.class).save("Cell");
+ getParentContainer(InputUI.class).setTreeSelection(topia, Cell.class);
+ setInfoText(_("isisfish.message.save.finished"));
+ refresh();
+ valueChanged(false);
+ }
+ protected void cancel(){
+ getContextValue(InputAction.class).cancel("Cell");
+ setInfoText(_("isisfish.message.cancel.finished"));
+ valueChanged(false);
+ refresh();
+ }
+ protected void goToZone(){
+ getParentContainer(InputUI.class).setTreeSelection(null, Zone.class);
+ }
+ protected void valueChanged(boolean b){
+ changed=b;
+ save.setEnabled(b);
+ cancel.setEnabled(b);
+ }
+ protected void setInfoText(String txt){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(txt);
+ }
+ protected void fieldCellChanged(){
+ Cell c = (Cell)fieldCell.getSelectedItem();
+ getContextValue(InputAction.class).setValue(c, Cell.class);
+ getParentContainer(InputUI.class).setTreeSelection(c, Cell.class);
+ refresh();
+ }
+ protected void nameChanged(){
+ getContextValue(InputAction.class).getCell().setName(fieldCellName.getText());
+ valueChanged(true);
+ refresh();
+ }
+ protected void cellLandChanged(){
+ getContextValue(InputAction.class).getCell().setLand(fieldCellLand.isSelected());
+ valueChanged(true);
+ refresh();
+ }
+ protected void commentChanged(){
+ getContextValue(InputAction.class).getCell().setComment(fieldCellComment.getText());
+ valueChanged(true);
+ }
]]>
</script>
<row>
@@ -50,13 +130,7 @@
<Table>
<row>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <!-- Widget -->
- <JComboBox id="fieldCell"/>
-<!-- Fixme : ComboBoxModel
-origin="$Cell" renderer="name"
-actionCommand='UIHelper.setTreeSelection($tree, $treeModel, $fieldCell/selectedItem)'
-<ComboBoxModel origin="$FisheryRegion/cell"/>
--->
+ <JComboBox id="fieldCell" onActionPerformed='fieldCellChanged()'/>
</cell>
</row>
<row>
@@ -64,24 +138,15 @@
<JLabel text="isisfish.cell.name"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldCellName"/>
-<!-- Fixme : DocumentEvents
-origin="$Cell/name"
- <DocumentEvents onModified="Update($fieldCellName/text)"/>
--->
+ <JTextField id="fieldCellName" onActionPerformed='nameChanged()'/>
</cell>
</row>
<row>
<cell>
-
-
<JLabel text="isisfish.cell.latitude"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
<JTextField id="fieldCellLatitude" editable="false"/>
-<!--
-origin="$Cell/latitude"
--->
</cell>
</row>
<row>
@@ -89,83 +154,45 @@
<JLabel text="isisfish.cell.longitude"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldCellLongitude" editable="false"/>
-<!--
-origin="$Cell/longitude"
--->
+ <JTextField id="fieldCellLongitude" editable="false"/>
</cell>
</row>
<row>
<cell>
-
-
<JLabel text="isisfish.cell.land"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JCheckBox id="fieldCellLand"/>
-<!-- Fixme : ItemEvents
-origin="$Cell/land"
-<ItemEvents onStateChanged="Update($fieldCellLand/selected)"/>
--->
+ <JCheckBox id="fieldCellLand" onActionPerformed='cellLandChanged()'/>
</cell>
</row>
<row>
<cell columns='2' fill='horizontal'>
- <JLabel text="isisfish.cell.comments"/>
+ <JLabel text="isisfish.cell.comments" onFocusLost='commentChanged()'/>
</cell>
</row>
<row>
<cell columns='2' fill='both' weighty='1.0' weightx='1.0'>
<JScrollPane>
- <JTextArea id="fieldCellComment">
-<!--
-origin="$Cell/comment"
-<DocumentEvents onModified="Update($fieldCellComment/text)"/>
--->
- </JTextArea>
+ <JTextArea id="fieldCellComment" onKeyPressed='commentChanged()'/>
</JScrollPane>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.save"/>
-<!--
-origin="$EntityModified"
-actionCommand='input.Input.save("Cell", $Cell);refreshView($inputCell)'
--->
+ <JButton id='save' text="isisfish.common.save" enabled='false' onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.cancel"/>
-<!--
-origin="$EntityModified"
-actionCommand='input.Input.cancel("Cell", $Cell);refreshView($inputCell)'
--->
+ <JButton id='cancel' text="isisfish.common.cancel" enabled='false' onActionPerformed='cancel()'/>
</cell>
</row>
</Table>
-
<JPanel id="cellMapPanel" layout='{new BorderLayout()}'/>
-<!--
- <OpenMapToolPanel constraints='"BorderLayout.NORTH"' id="cellMapTool">
- <OpenMapToolSet id="cellMapToolSet" origin="$cellMap"/>
- </OpenMapToolPanel>
- <OpenMap constraints='"BorderLayout.CENTER"' id="cellMap"
- origin="$FisheryRegion" selected="$Cell" selectionMode="1">
- <OpenMapEvents id="cellMapEvents" mouseMode="Select"
- onMouseClicked="UIHelper.setTreeSelection($cellMap/selectedCells[1])"/>
- </OpenMap>
--->
</JSplitPane>
-
</cell>
</row>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.input.continueZones"/>
-<!--
- actionCommand="UIHelper.setTreeSelection('Zones')"
--->
-
+ <JButton text="isisfish.input.continueZones" onActionPerformed='goToZone()'/>
</cell>
</row>
</Table>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -31,6 +31,95 @@
*/
-->
<Table>
+ <script><![CDATA[
+ import fr.ifremer.isisfish.entities.Gear;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import org.codelutin.topia.persistence.TopiaEntity;
+ import org.codelutin.topia.TopiaException;
+
+ protected boolean changed = false;
+ public GearTabUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ Gear gear = getContextValue(InputAction.class).getGear();
+ if (gear != null){
+ fieldGearName.setText(gear.getName());
+ fieldGearEffortUnit.setText(gear.getEffortUnit());
+ fieldGearStandardisationFactor.setText(gear.getStandardisationFactor() + "");
+ fieldGearParamName.setText(gear.getParameterName());
+ DefaultComboBoxModel model = new DefaultComboBoxModel(fr.ifremer.isisfish.types.RangeOfValues.getPossibleTypes());
+ fieldGearParamType.setModel(model);
+ fieldGearParamPossibleValue.setText(gear.getPossibleValue().getValues());
+ fieldGearComment.setText(gear.getComment());
+ }
+ }
+ protected void create(){
+ TopiaEntity topia = getContextValue(InputAction.class).create("Gear");
+
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection(topia, Gear.class);
+
+ setInfoText(_("isisfish.message.creation.finished"));
+ }
+ protected void save(){
+ TopiaEntity topia = getContextValue(InputAction.class).save("Gear");
+ getParentContainer(InputUI.class).setTreeSelection(topia, Gear.class);
+ setInfoText(_("isisfish.message.save.finished"));
+ refresh();
+ valueChanged(false);
+ }
+ protected void cancel(){
+ getContextValue(InputAction.class).cancel("Gear");
+ setInfoText(_("isisfish.message.cancel.finished"));
+ valueChanged(false);
+ refresh();
+ }
+ protected void remove(){
+ setInfoText(getContextValue(InputAction.class).remove());
+ valueChanged(false);
+ refresh();
+ }
+ protected void setInfoText(String txt){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(txt);
+ }
+ protected void valueChanged(boolean b){
+ changed=b;
+ create.setEnabled(b);
+ save.setEnabled(b);
+ }
+ protected void nameChanged(){
+ getContextValue(InputAction.class).getGear().setName(fieldGearName.getText());
+ valueChanged(true);
+ }
+ protected void effortUnitChanged(){
+ getContextValue(InputAction.class).getGear().setEffortUnit(fieldGearEffortUnit.getText());
+ valueChanged(true);
+ }
+ protected void standardisationFactorChanged(){
+ getContextValue(InputAction.class).getGear().setStandardisationFactor(Double.parseDouble(fieldGearStandardisationFactor.getText()));
+ valueChanged(true);
+ }
+ protected void paramNameChanged(){
+ getContextValue(InputAction.class).getGear().setParameterName(fieldGearParamName.getSelectedText());
+ valueChanged(true);
+ }
+ protected void paramTypeChanged(){
+// TODO
+// getContextValue(InputAction.class).getGear().setParameterName(fieldGearParamName.getSelectedText());
+// valueChanged(true);
+ }
+ protected void paramPossibleValueChanged(){
+ getContextValue(InputAction.class).getGear().setStandardisationFactor(Double.parseDouble(fieldGearParamPossibleValue.getText()));
+ valueChanged(true);
+ }
+ protected void commentChanged(){
+ getContextValue(InputAction.class).getGear().setComment(fieldGearComment.getText());
+ valueChanged(true);
+ }
+ ]]>
+ </script>
<row>
<cell fill='both' weightx='1.0' weighty='1.0'>
<Table>
@@ -39,7 +128,7 @@
<JLabel text="isisfish.gear.name"/>
</cell>
<cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearName"/>
+ <JTextField id="fieldGearName" onKeyTyped='nameChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Gear/name"
<DocumentEvents onModified="Update($fieldGearName/text)"/>
@@ -51,7 +140,7 @@
<JLabel text="isisfish.gear.effortUnit"/>
</cell>
<cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearEffortUnit"/>
+ <JTextField id="fieldGearEffortUnit" onKeyTyped='effortUnitChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Gear/effortUnit"
<DocumentEvents onModified="Update($fieldGearEffortUnit/text)"/>
@@ -63,7 +152,7 @@
<JLabel text="isisfish.gear.standardisationFactor"/>
</cell>
<cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearStandardisationFactor"/>
+ <JTextField id="fieldGearStandardisationFactor" onKeyTyped='standardisationFactorChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Gear/standardisationFactor"
<DocumentEvents onModified="Update($fieldGearStandardisationFactor/text)"/>
@@ -75,7 +164,7 @@
<JLabel text="isisfish.gear.technicalParameter"/>
</cell>
<cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearParamName"/>
+ <JTextField id="fieldGearParamName" onKeyTyped='paramNameChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Gear/parameterName">
<DocumentEvents onModified="Update($fieldGearParamName/text)"/>
@@ -87,7 +176,7 @@
<JLabel text="isisfish.gear.rangeValues"/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JComboBox id="fieldGearParamType"/>
+ <JComboBox id="fieldGearParamType" onActionPerformed='paramTypeChanged()'/>
<!-- Fixme : ComboBoxModel
firstNull="true"
origin="$Gear/possibleValue/type"
@@ -96,7 +185,7 @@
-->
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JTextField id="fieldGearParamPossibleValue"/>
+ <JTextField id="fieldGearParamPossibleValue" onKeyTyped='paramPossibleValueChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Gear/possibleValue/values"
<DocumentEvents onModified="Update(concat($fieldGearParamType/selectedItem, '[', $fieldGearParamPossibleValue/text, ']'), $Gear/possibleValue)"/>
@@ -109,7 +198,7 @@
</cell>
<cell columns="2" fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane>
- <JTextArea id="fieldGearComment">
+ <JTextArea id="fieldGearComment" onKeyTyped='commentChanged()'>
<!-- Fixme : DocumentEvents
origin="$Gear/comment"
<DocumentEvents onModified="Update($fieldGearComment/text)"/>
@@ -126,14 +215,14 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.new"/>
+ <JButton id="create" text="isisfish.common.new" onActionPerformed='create()'/>
<!--
origin="$FisheryRegion"
actionCommand='input.Input.create("Gear")'
-->
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.save"/>
+ <JButton id="save" text="isisfish.common.save" onActionPerformed='save()'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.save("Gear", $Gear);refreshView($inputGear)'
@@ -142,14 +231,14 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.cancel"/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("Gear", $Gear);refreshView($inputGear)'
-->
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.remove"/>
+ <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/>
<!--
origin="$Gear"
actionCommand="input.Input.remove($Gear)"
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -37,24 +37,21 @@
+-->
<JPanel layout='{new BorderLayout()}'>
<script><![CDATA[
+ import fr.ifremer.isisfish.entities.Metier;
public GearUI (InputAction action){
setContextValue(action);
}
protected void refresh() {
- }
+ gearTabUI.refresh();
+ selectivityUI.refresh();
+ }
+ protected void goToMetier(){
+ getParentContainer(InputUI.class).setTreeSelection(null, Metier.class);
+ }
]]></script>
<JTabbedPane constraints='BorderLayout.CENTER' id="GearTab" name="Gear">
- <tab title='{_("isisfish.gear.title")}'><GearTabUI/></tab>
- <tab title='{_("isisfish.selectivity.title")}'><SelectivityUI/></tab>
-<!--
- name="isisfish.gear.title"
- name="isisfish.selectivity.title"
- <xpanel xml="input/Gear.xml" id="inputGear"/>
- <xpanel xml="input/Selectivity.xml" id="inputSelectivity"/>
--->
+ <tab title='{_("isisfish.gear.title")}'><GearTabUI id="gearTabUI" constructorParams='getContextValue(InputAction.class)'/></tab>
+ <tab title='{_("isisfish.selectivity.title")}'><SelectivityUI id="selectivityUI" constructorParams='getContextValue(InputAction.class)'/></tab>
</JTabbedPane>
- <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueMetiers"/>
-<!--
- actionCommand="UIHelper.setTreeSelection('Metiers')"
--->
+ <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueMetiers" onActionPerformed='goToMetier()'/>
</JPanel>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-10-30 17:47:57 UTC (rev 1579)
@@ -34,6 +34,9 @@
* and open the template in the editor.
*/
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.datastore.FormuleStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
import java.util.List;
import fr.ifremer.isisfish.datastore.RegionStorage;
@@ -41,20 +44,31 @@
import fr.ifremer.isisfish.entities.FisheryRegion;
import fr.ifremer.isisfish.entities.Gear;
import fr.ifremer.isisfish.entities.Metier;
+import fr.ifremer.isisfish.entities.Population;
import fr.ifremer.isisfish.entities.Port;
+import fr.ifremer.isisfish.entities.Selectivity;
+import fr.ifremer.isisfish.entities.SelectivityDAO;
import fr.ifremer.isisfish.entities.SetOfVessels;
import fr.ifremer.isisfish.entities.Species;
import fr.ifremer.isisfish.entities.Strategy;
import fr.ifremer.isisfish.entities.TripType;
import fr.ifremer.isisfish.entities.VesselType;
import fr.ifremer.isisfish.entities.Zone;
+import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.swing.JOptionPane;
+import org.apache.commons.beanutils.MethodUtils;
+import org.apache.commons.lang.ClassUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelutin.topia.TopiaContext;
+import org.codelutin.topia.persistence.TopiaDAO;
import org.codelutin.topia.persistence.TopiaEntity;
+import org.codelutin.widget.editor.Editor;
import static org.codelutin.i18n.I18nf._;
+import static javax.swing.JOptionPane.showInputDialog;
/**
*
@@ -84,28 +98,33 @@
}
public void setValue(Object value, Class type) {
- if (type == Zone.class){
- zone = (Zone) value;
- } else if (type == Cell.class){
- cell = (Cell) value;
- } else if (type == Port.class){
- port = (Port) value;
- } else if (type == Species.class){
- species = (Species) value;
- } else if (type == Gear.class){
- gear = (Gear) value;
- } else if (type == Metier.class){
- metier = (Metier) value;
- } else if (type == TripType.class){
- tripType = (TripType) value;
- } else if (type == VesselType.class){
- vesselType = (VesselType) value;
- } else if (type == SetOfVessels.class){
- setOfVessels = (SetOfVessels) value;
- } else if (type == Strategy.class){
- strategy = (Strategy) value;
- }
+ if (type == Zone.class) {
+ zone = (Zone) value;
+ } else if (type == Cell.class) {
+ cell = (Cell) value;
+ } else if (type == Port.class) {
+ port = (Port) value;
+ } else if (type == Species.class) {
+ species = (Species) value;
+ } else if (type == Gear.class) {
+ gear = (Gear) value;
+ } else if (type == Metier.class) {
+ metier = (Metier) value;
+ } else if (type == TripType.class) {
+ tripType = (TripType) value;
+ } else if (type == VesselType.class) {
+ vesselType = (VesselType) value;
+ } else if (type == SetOfVessels.class) {
+ setOfVessels = (SetOfVessels) value;
+ } else if (type == Strategy.class) {
+ strategy = (Strategy) value;
+ }
+ selected = (TopiaEntity) value;
+ selectedType = type;
}
+ public TopiaContext getIsisContext(){
+ return isisContext;
+ }
/**
* load region.
@@ -204,7 +223,218 @@
//
return result;
}
+ /**
+ * Permet de creer simplement un nouvelle objet portant un nom par defaut.
+ * Le nouvel element est automatiquement selectionné dans l'arbre
+ *
+ * @param frame
+ * @param isisContext
+ * (auto) Le Topia context a utiliser
+ * @param tree
+ * (auto) l'arbre ou il faudra selectionner le nouvel element
+ * @param jmodel
+ * (auto) le model de l'arbre
+ * @param type
+ * le type de l'entite a creer, le type est compose seulement du
+ * nom de l'entite et pas du package.
+ * @return null ou un fenetre d'erreur
+ */
+ @SuppressWarnings("unchecked")
+ public TopiaEntity create(String type) {
+ log.debug("create called for " + type);
+ try {
+ String name = type + "_new";
+ Method method = MethodUtils.getAccessibleMethod(
+ IsisFishDAOHelper.class, "get" + type + "DAO",
+ TopiaContext.class);
+ TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke(null, new Object[] { isisContext });
+
+ TopiaEntity entity = dao.create("name", name);
+ entity.update();
+ isisContext.commitTransaction();
+ return entity;
+
+ } catch (Exception eee) {
+ log.error("Can't create entity", eee);
+// return new OutputView("Error.xml", "error", eee.getMessage());
+ }
+ return null;
+ }
+
+ /**
+ * Save entity passed in argument, and commit
+ *
+ * @param frame
+ * @param idToRefresh
+ * id to refresh after commit
+ * @param entity
+ * entity to save
+ * @return if ok return null else OutView error
+ */
+ public TopiaEntity save(String idToRefresh) {
+ log.debug("save called");
+ try {
+ if (selected == null) {
+ log.warn("Try to save null entity");
+ return null;
+ }
+ // on est pas en autoUpdate donc il faut faire le update avant le
+ // commit
+ selected.update();
+
+ selected.getTopiaContext().commitTransaction();
+ } catch (Exception eee) {
+ log.error("Can't save region", eee);
+ // return new OutputView("Error.xml", "error", eee.getMessage());
+ }
+ return selected;
+ }
+
+ /**
+ * Cancel all modification on entity (rollback), and force reload it and
+ * refresh all ui component that name match 'type'Tab
+ *
+ * @param uiContext
+ * @param frame
+ * @param isisContext
+ * @param type
+ * entity type (Zone, Gear, Population, ...), prefix of user
+ * interface Tab to refresh after rollback and reload
+ * @param entity
+ * entity to refresh
+ * @return if ok return null else OutView error
+ */
+ public Object cancel(String type) {
+ log.debug("cancel called");
+ try {
+ isisContext.rollbackTransaction();
+
+ // reload the object
+ if (selected != null) {
+ selected = isisContext.findByTopiaId(selected.getTopiaId());
+ }
+// uiContext.setData(type, entity);
+
+// frame.refreshView(type + "Tab");
+
+ } catch (Exception eee) {
+ log.error("Can't cancel modification in region", eee);
+// return new OutputView("Error.xml", "error", eee.getMessage());
+ }
+ return null;
+ }
+
+ /**
+ * Delete one entity and commit the change, try to selected intelligently
+ * other node in tree.
+ * <p>
+ * Refresh all ui component where name match "input<entity type without
+ * package >.*"
+ *
+ * @param uiContext
+ * @param frame
+ * @param isisContext
+ * @param fisheryRegion
+ * @param tree
+ * tree where we want to select other node
+ * @param jmodel
+ * tree model
+ * @param entity
+ * entuty to remove
+ * @return if ok return null else OutView error
+ */
+ public String remove() {
+ log.debug("remove called");
+ String msg = "";
+ try {
+
+ boolean doDelete = true;
+ List<TopiaEntity> allWillBeRemoved = selected.getComposite();
+ if (allWillBeRemoved.size() > 0) {
+ String text = _(
+ "isisfish.message.delete.object",
+ selected.toString());
+ for (TopiaEntity e : allWillBeRemoved) {
+ text += ClassUtils.getShortClassName(e.getClass()) + " - "
+ + e.toString() + "\n";
+ }
+ int resp = JOptionPane.showConfirmDialog(null, text,
+ _("isisfish.message.delete.entities"), JOptionPane.YES_NO_OPTION);
+ doDelete = resp == JOptionPane.YES_OPTION;
+ } else {
+ String text = _("isisfish.message.confirm.delete.object", selected.toString());
+ int resp = JOptionPane.showConfirmDialog(null, text,
+ _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION);
+ doDelete = resp == JOptionPane.YES_OPTION;
+ }
+
+ if (doDelete) {
+// uiContext.setData("RegionModified", Boolean.FALSE);
+// uiContext.setData("InDeletion", Boolean.TRUE);
+ selected.delete();
+ isisContext.commitTransaction();
+ msg = _("isisfish.message.remove.finished");
+ } else {
+ msg = _("isisfish.message.remove.canceled");
+ }
+ } catch (Exception eee) {
+ log.error("Can't remove entity: " + selected, eee);
+ // return new OutputView("Error.xml", "error", eee.getMessage());
+ }
+// finally {
+ // uiContext.removeData("InDeletion");
+// }
+ return msg;
+ }
+
+ /**
+ * Save an Equation as model, to reuse it for other equation
+ *
+ * @param uiContext
+ * @param frame
+ * @param isisfish
+ * @param category
+ * categoy for this equation
+ * @param isisfish
+ * equation to put in models
+ * @param language
+ * @return if ok return null else OutputView error message
+ */
+ public Object saveAsModel(String category, String language, String content) {
+ try {
+ String name = showInputDialog("");
+ if ("".equals(name)) {
+// return new OutputView("Error.xml", "error",_("isisfish.error.invalid.equation.name"));
+ }
+ if (name != null) {
+ FormuleStorage storage = FormuleStorage.createFormule(category, name, language);
+ storage.setContent(content);
+ }
+
+ } catch (Exception eee) {
+ log.error("Can't save equation as model", eee);
+// return new OutputView("Error.xml", "error", eee.getMessage());
+ }
+ return null;
+ }
+ public Object openEditor(String category, String name,
+ Class javaInterface, String content, Editor editor) {
+ log.debug("openEditor");
+ try {
+ EquationEditorPaneUI pane = new EquationEditorPaneUI();
+ pane.setEquation(category, name, javaInterface, content);
+ pane.setVisible(true);
+ if (pane.isOk() && editor != null) {
+ editor.setText(pane.getEditor().getText());
+ }
+ pane.dispose();
+ } catch (Exception eee) {
+ log.error("Can't open editor", eee);
+// return new OutputView("Error.xml", "error", eee.getMessage());
+ }
+ return null;
+ }
protected String getFisheryRegionName() {
if (fisheryRegion != null) {
return fisheryRegion.getName();
@@ -215,6 +445,10 @@
protected FisheryRegion getFisheryRegion() {
return fisheryRegion;
}
+
+ protected TopiaEntity getSelected(){
+ return selected;
+ }
protected Cell getCell() {
return cell;
@@ -255,4 +489,41 @@
protected Strategy getStrategy() {
return strategy;
}
+
+// InputGear
+
+ public Object addSelectivity(Population pop, String equation) {
+ try {
+
+ SelectivityDAO dao = IsisFishDAOHelper.getSelectivityDAO(isisContext);
+ Selectivity selectivity = dao.create();
+
+ selectivity.setGear(gear);
+ selectivity.setPopulation(pop);
+ selectivity.getEquation().setContent(equation);
+ selectivity.update();
+
+ gear.addPopulationSelectivity(selectivity);
+ gear.update();
+
+ } catch (Exception eee) {
+ log.error("Can't add selectivity", eee);
+// return new OutputView("Error.xml", "error", eee.getMessage());
+ }
+ return null;
+ }
+
+ public Object removeSelectivity(Selectivity selectivity){
+ log.debug("removeTargetSpecies called: " + selectivity);
+ try {
+ if (gear != null && selectivity != null) {
+ gear.removePopulationSelectivity(selectivity);
+ }
+ }catch(Exception eee){
+ log.error("Can't remove TargetSpecies", eee);
+// return new OutputView("Error.xml", "error", eee.getMessage());
+ }
+ return null;
+ }
+
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -52,48 +52,53 @@
import fr.ifremer.isisfish.entities.TripType;
import fr.ifremer.isisfish.entities.VesselType;
import fr.ifremer.isisfish.entities.Zone;
-
- //setContextValue(new InputAction());
+ import javax.swing.tree.TreeNode;
+ import javax.swing.tree.TreePath;
+ import org.codelutin.topia.persistence.TopiaEntity;
+ import org.codelutin.topia.TopiaException;
tree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
+ String name = null;
if (node != null) {
GenericCell selectedValue = (GenericCell) node.getUserObject();
if (selectedValue.getType() != null) {
- ((CardLayout) inputPane.getLayout()).show(inputPane, selectedValue.getType().getSimpleName());
- if (selectedValue.getClass() != null) {
- getContextValue(InputAction.class).setValue(selectedValue.getValue(),selectedValue.getType());
- if (selectedValue.getType() == Zone.class){
- zoneUI.refresh();
- } else if (selectedValue.getType() == Cell.class){
- cellUI.refresh();
- } else if (selectedValue.getType() == Port.class){
- portUI.refresh();
- } else if (selectedValue.getType() == Species.class){
- speciesUI.refresh();
- } else if (selectedValue.getType() == Gear.class){
- gearUI.refresh();
- } else if (selectedValue.getType() == Metier.class){
- metierUI.refresh();
- } else if (selectedValue.getType() == TripType.class){
- tripTypeUI.refresh();
- } else if (selectedValue.getType() == VesselType.class){
- vesselTypeUI.refresh();
- } else if (selectedValue.getType() == SetOfVessels.class){
- setOfVesselsUI.refresh();
- } else if (selectedValue.getType() == Strategy.class){
- strategyUI.refresh();
- }
- }
+ name = selectedValue.getType().getSimpleName();
+ getContextValue(InputAction.class).setValue(selectedValue.getValue(),selectedValue.getType());
+ refreshAll(selectedValue);
}
else {
- ((CardLayout) inputPane.getLayout()).show(inputPane, "none");
+ name = "none";
}
+ ((CardLayout) inputPane.getLayout()).show(inputPane, name);
}
}
});
+ protected void refreshAll(GenericCell selectedValue){
+ if (selectedValue.getType() == Zone.class){
+ zoneUI.refresh();
+ } else if (selectedValue.getType() == Cell.class){
+ cellUI.refresh();
+ } else if (selectedValue.getType() == Port.class){
+ portUI.refresh();
+ } else if (selectedValue.getType() == Species.class){
+ speciesUI.refresh();
+ } else if (selectedValue.getType() == Gear.class){
+ gearUI.refresh();
+ } else if (selectedValue.getType() == Metier.class){
+ metierUI.refresh();
+ } else if (selectedValue.getType() == TripType.class){
+ tripTypeUI.refresh();
+ } else if (selectedValue.getType() == VesselType.class){
+ vesselTypeUI.refresh();
+ } else if (selectedValue.getType() == SetOfVessels.class){
+ setOfVesselsUI.refresh();
+ } else if (selectedValue.getType() == Strategy.class){
+ strategyUI.refresh();
+ }
+ }
public InputUI (InputAction action){
setContextValue(action);
}
@@ -161,6 +166,61 @@
node.add(childNode);
}
}
+ protected void setTreeSelection(TopiaEntity topia, Class type){
+ String name = null;
+ if (topia != null){
+ if (type == Zone.class){
+ name = ((Zone) topia).getName();
+ } else if (type == Cell.class){
+ name = ((Cell) topia).getName();
+ } else if (type == Port.class){
+ name = ((Port) topia).getName();
+ } else if (type == Species.class){
+ name = ((Species) topia).getName();
+ } else if (type == Gear.class){
+ name = ((Gear) topia).getName();
+ } else if (type == Metier.class){
+ name = ((Metier) topia).getName();
+ } else if (type == TripType.class){
+ name = ((TripType) topia).getName();
+ } else if (type == VesselType.class){
+ name = ((VesselType) topia).getName();
+ } else if (type == SetOfVessels.class){
+ name = ((SetOfVessels) topia).getName();
+ } else if (type == Strategy.class){
+ name = ((Strategy) topia).getName();
+ }
+ }
+ DefaultMutableTreeNode element = null;
+ element = findNode((DefaultMutableTreeNode) tree.getModel().getRoot(), type, name);
+ TreeNode[] path = element.getPath();
+ if (log.isDebugEnabled()) {
+ log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path));
+ }
+ TreePath newSelectionPath = new TreePath(path);
+ tree.setSelectionPath(newSelectionPath);
+ }
+ protected DefaultMutableTreeNode findNode(DefaultMutableTreeNode root, Class type, String name){
+ DefaultMutableTreeNode result = null;
+ for (Enumeration e = root.children(); e.hasMoreElements();){
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode)e.nextElement();
+ GenericCell g = (GenericCell)node.getUserObject();
+ if (type == g.getType()){
+ result = node;
+ if (name != null){
+ for (e = result.children(); e.hasMoreElements();){
+ node = (DefaultMutableTreeNode)e.nextElement();
+ g = (GenericCell)node.getUserObject();
+ if (name.equals(g.getName())){
+ result = node;
+ break;
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
protected void setInfoText(String s){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
root.setInfoText(s);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -32,6 +32,14 @@
-->
<Table>
+ <script><![CDATA[
+ public MetierSeasonInfoSpeciesUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+
+ }
+ ]]></script>
<row>
<cell fill='both' weightx='1.0' weighty='0.5'>
<Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -32,6 +32,14 @@
-->
<Table>
+ <script><![CDATA[
+ public MetierSeasonInfoZoneUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+
+ }
+ ]]></script>
<row>
<cell fill='both' weightx='1.0' weighty='1.0'>
<Table>
@@ -55,6 +63,7 @@
</cell>
<cell fill='horizontal' weightx='1.0'>
<JPanel/>
+ <!--fr.ifremer.isisfish.ui.widget.IntervalPanel id="displayMetierSeason"/-->
<!-- Fixme : SeasonIntervalPanel
<SeasonIntervalPanel constraints='"displayMetierSeason"' id="displayMetierSeason"
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -32,6 +32,85 @@
-->
<Table>
+ <script><![CDATA[
+
+ import fr.ifremer.isisfish.entities.Gear;
+ import fr.ifremer.isisfish.entities.TripType;
+ import fr.ifremer.isisfish.entities.Metier;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import org.codelutin.topia.persistence.TopiaEntity;
+ import org.codelutin.topia.TopiaException;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+
+ protected boolean changed = false;
+ public MetierTabUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ try {
+ Metier metier = getContextValue(InputAction.class).getMetier();
+ if (metier != null){
+ fieldMetierName.setText(metier.getName());
+ DefaultComboBoxModel model = new DefaultComboBoxModel(getContextValue(InputAction.class).getFisheryRegion().getGear().toArray());
+ fieldMetierGear.setModel(model);
+ fieldMetierParam.setText(metier.getGearParameterValue());
+ fieldMetierComment.setText(metier.getComment());
+ }
+ } catch (Exception ex) {
+ Logger.getLogger(MetierTabUI.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ protected void nameChanged(){
+ getContextValue(InputAction.class).getMetier().setName(fieldMetierName.getText());
+ valueChanged(true);
+ }
+ protected void gearChanged(){
+ getContextValue(InputAction.class).getMetier().setGear((Gear)fieldMetierGear.getSelectedItem());
+ valueChanged(true);
+ }
+ protected void paramChanged(){
+ getContextValue(InputAction.class).getMetier().setGearParameterValue(fieldMetierParam.getText());
+ valueChanged(true);
+ }
+ protected void commentChanged(){
+ getContextValue(InputAction.class).getMetier().setComment(fieldMetierComment.getText());
+ valueChanged(true);
+ }
+ protected void create(){
+ TopiaEntity topia = getContextValue(InputAction.class).create("Metier");
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection(topia, Metier.class);
+ setInfoText(_("isisfish.message.creation.finished"));
+ }
+ protected void save(){
+ TopiaEntity topia = getContextValue(InputAction.class).save("Metier");
+ getParentContainer(InputUI.class).setTreeSelection(topia, Metier.class);
+ setInfoText(_("isisfish.message.save.finished"));
+ refresh();
+ valueChanged(false);
+ }
+ protected void cancel(){
+ getContextValue(InputAction.class).cancel("Metier");
+ setInfoText(_("isisfish.message.cancel.finished"));
+ valueChanged(false);
+ refresh();
+ }
+ protected void remove(){
+ setInfoText(getContextValue(InputAction.class).remove());
+ valueChanged(false);
+ refresh();
+ }
+ protected void setInfoText(String txt){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(txt);
+ }
+ protected void valueChanged(boolean b){
+ changed=b;
+ create.setEnabled(b);
+ save.setEnabled(b);
+ }
+ ]]></script>
<row>
<cell fill='both' weightx='1.0' weighty='1.0'>
<Table>
@@ -40,7 +119,7 @@
<JLabel text="isisfish.metier.name"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldMetierName"/>
+ <JTextField id="fieldMetierName" onKeyTyped='nameChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Metier/name"
<DocumentEvents onModified="Update($fieldMetierName/text)"/>
@@ -52,7 +131,7 @@
<JLabel text="isisfish.common.gear"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldMetierGear"/>
+ <JComboBox id="fieldMetierGear" onActionPerformed='gearChanged()'/>
<!-- Fixme : ComboBoxModel
origin="$Metier/gear" renderer="name" firstNull="true"
actionCommand="update($fieldMetierGear/selectedItem, $Metier/gear)"
@@ -65,7 +144,7 @@
<JLabel text="isisfish.metier.rangeValues"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldMetierParam"/>
+ <JTextField id="fieldMetierParam" onKeyTyped='paramChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Metier/gearParameterValue"
<DocumentEvents onModified="Update($fieldMetierParam/text)"/>
@@ -78,12 +157,11 @@
</cell>
<cell fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JTextArea id="fieldMetierComment">
+ <JTextArea id="fieldMetierComment" onKeyTyped='commentChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Metier/comment"
<DocumentEvents onModified="Update($fieldMetierComment/text)"/>
-->
- </JTextArea>
</JScrollPane>
</cell>
</row>
@@ -95,14 +173,14 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.new"/>
+ <JButton id="create" text="isisfish.common.new" onActionPerformed='create()'/>
<!--
origin="$FisheryRegion"
actionCommand='input.Input.create("Metier")'
-->
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.save"/>
+ <JButton id="save" text="isisfish.common.save" onActionPerformed='save()'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.save("Metier", $Metier);refreshView($inputMetier)'
@@ -111,14 +189,14 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.cancel"/>
+ <JButton id="cancel" text="isisfish.common.cancel" onActionPerformed='cancel()'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("Metier", $Metier);refreshView($inputMetier)'
-->
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.remove"/>
+ <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()'/>
<!--
origin="$Metier"
actionCommand="input.Input.remove($Metier)"
@@ -128,5 +206,4 @@
</Table>
</cell>
</row>
-</Table>
-
+</Table>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -36,20 +36,23 @@
+-->
<JPanel layout='{new BorderLayout()}'>
<script><![CDATA[
+ import fr.ifremer.isisfish.entities.TripType;
public MetierUI (InputAction action){
setContextValue(action);
}
protected void refresh() {
- }
+ metierTabUI.refresh();
+ metierSeasonSpeciesUI.refresh();
+ metierSeasonInfoUI.refresh();
+ }
+ protected void goToTripType(){
+ getParentContainer(InputUI.class).setTreeSelection(null, TripType.class);
+ }
]]></script>
<JTabbedPane id="MetierTab" name="Metier" constraints='BorderLayout.CENTER'>
- <tab title='{_("isisfish.metier.title")}'><MetierTabUI/></tab>
- <tab title='{_("isisfish.metierSeasonInfoZone.title")}'><MetierSeasonInfoZoneUI/></tab>
- <tab title='{_("isisfish.metierSeasonInfoSpecies.title")}'><MetierSeasonInfoSpeciesUI/></tab>
-
+ <tab title='{_("isisfish.metier.title")}'><MetierTabUI id="metierTabUI" constructorParams='getContextValue(InputAction.class)'/></tab>
+ <tab title='{_("isisfish.metierSeasonInfoZone.title")}'><MetierSeasonInfoZoneUI id="metierSeasonInfoUI" constructorParams='getContextValue(InputAction.class)'/></tab>
+ <tab title='{_("isisfish.metierSeasonInfoSpecies.title")}'><MetierSeasonInfoSpeciesUI id="metierSeasonSpeciesUI" constructorParams='getContextValue(InputAction.class)'/></tab>
</JTabbedPane>
- <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueTripTypes"/>
-<!--
- actionCommand="UIHelper.setTreeSelection('TripTypes')"
--->
+ <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueTripTypes" onActionPerformed='goToTripType()'/>
</JPanel>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -37,11 +37,106 @@
+-->
<Table>
<script><![CDATA[
+
+ import fr.ifremer.isisfish.entities.Species;
+ import fr.ifremer.isisfish.entities.Port;
+ import fr.ifremer.isisfish.entities.Cell;
+ import fr.ifremer.isisfish.map.IsisMapBean;
+ import fr.ifremer.isisfish.map.OpenMapToolPanel;
+ import com.bbn.openmap.gui.OMToolSet;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import org.codelutin.topia.persistence.TopiaEntity;
+ import org.codelutin.topia.TopiaException;
+
+ protected IsisMapBean portMap = new IsisMapBean();
+ protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
+ protected OMToolSet toolSet = new OMToolSet();
+ protected boolean changed = false;
public PortUI (InputAction action){
setContextValue(action);
}
protected void refresh() {
- }
+ Port port = getContextValue(InputAction.class).getPort();
+ if (port != null){
+
+ fieldPortName.setText(port.getName());
+
+ DefaultListModel portCellModel = new DefaultListModel();
+ java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
+ for (Cell c : cells){
+ portCellModel.addElement(c);
+ }
+ portCell.setModel(portCellModel);
+ portCell.setSelectedValue(port.getCell());
+
+ fieldPortComment.setText(getContextValue(InputAction.class).getPort().getComment());
+
+ portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
+ toolSet.setupListeners(portMap);
+ toolMap.add((Component)toolSet);
+ portMapPanel.add(toolMap, BorderLayout.NORTH);
+ portMapPanel.add(portMap, BorderLayout.CENTER);
+ refreshMap();
+ }
+ }
+ protected void refreshMap(){
+ java.util.List<Cell> cells = new ArrayList<Cell>();
+ cells.add((Cell)portCell.getSelectedValue());
+ portMap.setSelectedCells(cells);
+ portMap.setSelectedCells(cells);
+ }
+ protected void create(){
+ TopiaEntity topia = getContextValue(InputAction.class).create("Port");
+
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection(topia, Port.class);
+
+ setInfoText(_("isisfish.message.creation.finished"));
+ }
+ protected void save(){
+ TopiaEntity topia = getContextValue(InputAction.class).save("Port");
+ getParentContainer(InputUI.class).setTreeSelection(topia, Port.class);
+ setInfoText(_("isisfish.message.save.finished"));
+ refresh();
+ valueChanged(false);
+ }
+ protected void cancel(){
+ getContextValue(InputAction.class).cancel("Port");
+ setInfoText(_("isisfish.message.cancel.finished"));
+ valueChanged(false);
+ refresh();
+ }
+ protected void remove(){
+ setInfoText(getContextValue(InputAction.class).remove());
+ valueChanged(false);
+ refresh();
+ }
+ protected void goToSpecies(){
+ getParentContainer(InputUI.class).setTreeSelection(null, Species.class);
+ }
+ protected void setInfoText(String txt){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(txt);
+ }
+ protected void valueChanged(boolean b){
+ changed=b;
+ create.setEnabled(b);
+ save.setEnabled(b);
+ }
+ protected void nameChanged(){
+ getContextValue(InputAction.class).getPort().setName(fieldPortName.getText());
+ valueChanged(true);
+ refresh();
+ }
+ protected void portCellChanged(){
+ getContextValue(InputAction.class).getPort().setCell((Cell)portCell.getSelectedValue());
+ valueChanged(true);
+ refresh();
+ }
+ protected void commentChanged(){
+ getContextValue(InputAction.class).getPort().setComment(fieldPortComment.getText());
+ valueChanged(true);
+ }
]]>
</script>
<row>
@@ -56,11 +151,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0' >
- <JTextField id="fieldPortName"/>
-<!-- Fixme : DocumentEvents
-origin="$Port/name"
- <DocumentEvents onModified="Update($fieldPortName/text)"/>
--->
+ <JTextField id="fieldPortName" onActionPerformed='nameChanged()'/>
</cell>
</row>
<row>
@@ -72,13 +163,7 @@
<row>
<cell columns='2' fill='both' weighty='0.7' weightx='1.0'>
<JScrollPane>
- <JList id="portCell"/>
-<!-- Fixme : ListModel
-SelectionMode="0" renderer="name"
- origin="getCell($Port)"
- <ListModel origin="$FisheryRegion/cell"/>
- <ListSelectionEvents onValueChanged="Update($portCell/selectedValue, $Port/cell, refreshView($portMap))"/>
--->
+ <JList id="portCell" selectionMode="0" onMouseClicked='portCellChanged()'/>
</JScrollPane>
</cell>
</row>
@@ -91,68 +176,34 @@
<row>
<cell columns='2' fill='both' weighty='0.3' weightx='1.0' >
<JScrollPane>
- <JTextArea id="fieldPortComment"/>
-<!-- Fixme : DocumentEvents
- origin="$Port/comment"
-<DocumentEvents onModified="Update($fieldPortComment/text)"/>
--->
+ <JTextArea id="fieldPortComment" onKeyPressed='commentChanged()'/>
</JScrollPane>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.save"/>
-<!--
- origin="$EntityModified"
- actionCommand='input.Input.save("Port", $Port);refreshView($inputPort)'
--->
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.cancel"/>
-<!--
- origin="$EntityModified"
- actionCommand='input.Input.cancel("Port", $Port);refreshView($inputPort)'
--->
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.new"/>
-<!--
-origin="$FisheryRegion"
- actionCommand='input.Input.create("Port")'
--->
+ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.remove"/>
-<!--
- origin="$Port"
- actionCommand="input.Input.remove($Port)"
--->
+ <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/>
</cell>
</row>
</Table>
- <JPanel id="portMapPanel" layout='{new BorderLayout()}'>
- <!-- Fixme : OpenMapToolPanel, OpenMap
- <OpenMapToolPanel constraints='"BorderLayout.NORTH"' id="portMapTool">
- <OpenMapToolSet id="portMapToolSet" origin="$portMap"/>
- </OpenMapToolPanel>
- <OpenMap id="portMap" origin="$FisheryRegion" selected="$Port/cell"
- selectionMode="1">
- <OpenMapEvents id="portMapEvents" mouseMode="Select"
- onMouseClicked="Update($portMap/selectedCells[1], $Port/cell, refreshView($portCell))"/>
- </OpenMap>
- -->
- </JPanel>
+ <JPanel id="portMapPanel" layout='{new BorderLayout()}'/>
</JSplitPane>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.input.continueSpecies"/>
-<!--
- actionCommand="UIHelper.setTreeSelection('Species')"
--->
+ <JButton text="isisfish.input.continueSpecies" onActionPerformed='goToSpecies()'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -31,6 +31,131 @@
*/
-->
<Table>
+ <script>
+ <![CDATA[
+
+ import fr.ifremer.isisfish.entities.Population;
+ import fr.ifremer.isisfish.entities.Gear;
+ import fr.ifremer.isisfish.entities.Species;
+ import fr.ifremer.isisfish.entities.Formule;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import fr.ifremer.isisfish.ui.widget.editor.EquationTableEditor;
+ import javax.swing.table.DefaultTableModel;
+ import fr.ifremer.isisfish.entities.Selectivity;
+ import fr.ifremer.isisfish.entities.Equation;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+ import org.codelutin.topia.persistence.TopiaEntity;
+ import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+
+ boolean changed = false;
+ public SelectivityUI (InputAction action){
+ setContextValue(action);
+ }
+ public void refresh(){
+ if (getContextValue(InputAction.class).getSelected() != null){
+ fieldSelectivityPopulation.setModel(getSelectivityPopulationModel());
+ }
+ fieldSelectivityEquation.setModel(getSelectivityEquationModel());
+ setSelectivityTableModel();
+ try {
+ fieldSelectivityScript.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
+ } catch (IOException ex) {
+ Logger.getLogger(SelectivityUI.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ protected void setSelectivityTableModel(){
+ DefaultTableModel model = new DefaultTableModel(){
+ @Override
+ public boolean isCellEditable(int row, int column) {
+ boolean result = false;
+ if (column > 0){
+ result =true;
+ }
+ return result;
+ }
+ };
+ Collection<Selectivity> selectivity = getContextValue(InputAction.class).getGear().getPopulationSelectivity();
+ java.util.List<Population> populations = new ArrayList<Population>();
+ java.util.List<Equation> equations = new ArrayList<Equation>();
+ for (Selectivity s : selectivity){
+ populations.add(s.getPopulation());
+ equations.add(s.getEquation());
+ }
+ model.addColumn("Population", populations.toArray());
+ model.addColumn("Equation", equations.toArray());
+
+ selectivityTable.setModel(model);
+ EquationTableEditor cellEditor = new EquationTableEditor();
+ selectivityTable.getColumnModel().getColumn(1).setCellEditor(cellEditor);
+ }
+ protected DefaultComboBoxModel getSelectivityPopulationModel(){
+ java.util.List<Species> species = getContextValue(InputAction.class).getFisheryRegion().getSpecies();
+ DefaultComboBoxModel selectivityPopulationModel = new DefaultComboBoxModel();
+ selectivityPopulationModel.addElement(new GenericCell(" ", null, null));
+ for (Species s : species){
+ for (Population p : s.getPopulation()){
+ selectivityPopulationModel.addElement(new GenericCell(p.getName(), p, Population.class));
+ }
+ }
+ return selectivityPopulationModel;
+ }
+ protected DefaultComboBoxModel getSelectivityEquationModel(){
+ java.util.List<Formule> formules = fr.ifremer.isisfish.datastore.FormuleStorage.getFormules(getContextValue(InputAction.class).getIsisContext(), "Selectivity");
+ DefaultComboBoxModel selectivityEquationModel = new DefaultComboBoxModel();
+ selectivityEquationModel.addElement(new GenericCell(" ", null, null));
+ for (Formule f : formules){
+ GenericCell g = new GenericCell(f.getName(), f, Formule.class);
+ selectivityEquationModel.addElement(g);
+ }
+ return selectivityEquationModel;
+ }
+ protected void saveAsModel(){
+ getContextValue(InputAction.class).saveAsModel("Selectivity", "Java", fieldSelectivityScript.getText());
+ setInfoText(_("isisfish.message.saveModel.finished"));
+ }
+ protected void setInfoText(String txt){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(txt);
+ }
+ protected void openEditor(){
+ getContextValue(InputAction.class).openEditor("Selectivity", "new", fr.ifremer.isisfish.equation.SelectivityEquation.class, fieldSelectivityScript.getText(), fieldSelectivityScript);
+ }
+ protected void add(){
+ getContextValue(InputAction.class).addSelectivity((Population) ((GenericCell) fieldSelectivityPopulation.getSelectedItem()).getValue(), fieldSelectivityScript.getText());
+ valueChanged(true);
+ refresh();
+ }
+ protected void remove(){
+ getContextValue(InputAction.class).removeSelectivity((Selectivity) getContextValue(InputAction.class).getGear().getPopulationSelectivity((Population) selectivityTable.getValueAt(selectivityTable.getSelectedRow(), 0)));
+ refresh();
+ }
+ protected void save(){
+ TopiaEntity topia = getContextValue(InputAction.class).save("Gear");
+ getParentContainer(InputUI.class).setTreeSelection(topia, Gear.class);
+ setInfoText(_("isisfish.message.save.finished"));
+ refresh();
+ valueChanged(false);
+ }
+ protected void cancel(){
+ getContextValue(InputAction.class).cancel("Gear");
+ setInfoText(_("isisfish.message.cancel.finished"));
+ valueChanged(false);
+ refresh();
+ }
+ protected void valueChanged(boolean b){
+ changed=b;
+ cancel.setEnabled(b);
+ save.setEnabled(b);
+ }
+ protected void equationChanged(){
+ GenericCell g = (GenericCell)fieldSelectivityEquation.getSelectedItem();
+ if (g.getValue() != null){
+ fieldSelectivityScript.setText(((Formule)(g).getValue()).getContent());
+ }
+ }
+ ]]>
+ </script>
<row>
<cell fill='both' weightx='1.0' weighty='1.0'>
<Table>
@@ -51,7 +176,7 @@
<JLabel text="isisfish.selectivity.equation"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldSelectivityEquation"/>
+ <JComboBox id="fieldSelectivityEquation" onActionPerformed='equationChanged()'/>
<!-- Fixme : ComboBoxModel
renderer="name" firstNull="true"
actionCommand="update($fieldSelectivityEquation/selectedItem/content, $fieldSelectivityScript/text)"
@@ -64,7 +189,7 @@
<Table>
<row>
<cell fill='horizontal'>
- <JButton text="isisfish.common.saveModel"/>
+ <JButton id='saveModel' text="isisfish.common.saveModel" onActionPerformed='saveAsModel()'/>
<!--
actionCommand='input.Input.saveAsModel("Selectivity", "Java", $fieldSelectivityScript/text);refreshView($fieldSelectivityEquation)'
-->
@@ -72,7 +197,7 @@
</row>
<row>
<cell fill='horizontal'>
- <JButton text="isisfish.common.openEditor"/>
+ <JButton id='openEditor' text="isisfish.common.openEditor" onActionPerformed='openEditor()'/>
<!--
actionCommand='input.Input.openEditor("Selectivity","new","fr.ifremer.isisfish.equation.SelectivityEquation",$fieldSelectivityScript/text,$fieldSelectivityScript)'
-->
@@ -87,10 +212,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane>
-<!-- Fixme : editor
- <editor id="fieldSelectivityScript" askIfNotSaved="false" origin="org.codelutin.util.FileUtil.getTempFile('', '.java')">
- </editor>
--->
+ <org.codelutin.widget.editor.Editor id='fieldSelectivityScript' askIfNotSaved="false"/>
</JScrollPane>
</cell>
</row>
@@ -102,7 +224,7 @@
<Table>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="buttonAddSelectivity" text="isisfish.common.add"/>
+ <JButton id="buttonAddSelectivity" text="isisfish.common.add" onActionPerformed='add()'/>
<!--
origin="$Gear"
actionCommand="input.InputGear.addSelectivity($Gear, $fieldSelectivityPopulation/selectedItem, $fieldSelectivityScript/text)"
@@ -127,7 +249,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="buttonSelectivityRemove" text="isisfish.common.remove"/>
+ <JButton id="buttonSelectivityRemove" text="isisfish.common.remove" onActionPerformed='remove()'/>
<!--
origin="$Gear/populationSelectivity"
actionCommand="input.InputGear.removeSelectivity($Gear, getPopulationSelectivity($Gear)[$selectivityTable/selectedRow + 1])"
@@ -136,14 +258,14 @@
</row>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.common.save"/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='false'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.save("Gear", $Gear);refreshView($inputSelectivity)'
-->
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.common.cancel"/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='false'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("Gear", $Gear);refreshView($inputSelectivity)'
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -37,11 +37,96 @@
+-->
<Table>
<script><![CDATA[
+ import fr.ifremer.isisfish.entities.Gear;
+ import fr.ifremer.isisfish.entities.Species;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import org.codelutin.topia.persistence.TopiaEntity;
+ import org.codelutin.topia.TopiaException;
+
+ protected boolean changed = false;
public SpeciesUI (InputAction action){
setContextValue(action);
}
protected void refresh() {
- }
+ Species s = getContextValue(InputAction.class).getSpecies();
+ if (s != null){
+ fieldSpeciesName.setText(s.getName());
+ fieldSpeciesScientificName.setText(s.getScientificName());
+ fieldSpeciesCodeRubbin.setText(s.getCodeRubbin());
+ fieldSpeciesCEE.setText(s.getCodeCEE() + "");
+ fieldSpeciesDynamicAge.setSelected(s.getAgeGroupType());
+ fieldSpeciesDynamicLength.setSelected(!s.getAgeGroupType());
+ fieldSpeciesComment.setText(s.getComment());
+ }
+ }
+ protected void create(){
+ TopiaEntity topia = getContextValue(InputAction.class).create("Species");
+
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection(topia, Species.class);
+
+ setInfoText(_("isisfish.message.creation.finished"));
+ }
+ protected void save(){
+ TopiaEntity topia = getContextValue(InputAction.class).save("Species");
+ getParentContainer(InputUI.class).setTreeSelection(topia, Species.class);
+ setInfoText(_("isisfish.message.save.finished"));
+ refresh();
+ valueChanged(false);
+ }
+ protected void cancel(){
+ getContextValue(InputAction.class).cancel("Species");
+ setInfoText(_("isisfish.message.cancel.finished"));
+ valueChanged(false);
+ refresh();
+ }
+ protected void remove(){
+ setInfoText(getContextValue(InputAction.class).remove());
+ valueChanged(false);
+ refresh();
+ }
+ protected void goToGear(){
+ getParentContainer(InputUI.class).setTreeSelection(null, Gear.class);
+ }
+ protected void valueChanged(boolean b){
+ changed=b;
+ create.setEnabled(b);
+ save.setEnabled(b);
+ }
+ protected void setInfoText(String txt){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(txt);
+ }
+ protected void commentChanged(){
+ getContextValue(InputAction.class).getSpecies().setComment(fieldSpeciesComment.getText());
+ valueChanged(true);
+ refresh();
+ }
+ protected void dynamicAgeChanged(){
+ getContextValue(InputAction.class).getSpecies().setAgeGroupType(fieldSpeciesDynamicAge.isSelected());
+ valueChanged(true);
+ refresh();
+ }
+ protected void CEEChanged(){
+ getContextValue(InputAction.class).getSpecies().setCodeCEE(Integer.parseInt(fieldSpeciesCEE.getText()));
+ valueChanged(true);
+ refresh();
+ }
+ protected void codeChanged(){
+ getContextValue(InputAction.class).getSpecies().setCodeRubbin(fieldSpeciesCodeRubbin.getText());
+ valueChanged(true);
+ refresh();
+ }
+ protected void scientificNameChanged(){
+ getContextValue(InputAction.class).getSpecies().setScientificName(fieldSpeciesScientificName.getText());
+ valueChanged(true);
+ refresh();
+ }
+ protected void nameChanged(){
+ getContextValue(InputAction.class).getSpecies().setName(fieldSpeciesName.getText());
+ valueChanged(true);
+ refresh();
+ }
]]>
</script>
<row>
@@ -53,7 +138,7 @@
</cell>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JTextField id="fieldSpeciesName"/>
+ <JTextField id="fieldSpeciesName" onKeyTyped='nameChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Species/name"
<DocumentEvents onModified="Update($fieldSpeciesName/text)"/>
@@ -66,7 +151,7 @@
</cell>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JTextField id="fieldSpeciesScientificName"/>
+ <JTextField id="fieldSpeciesScientificName" onKeyTyped='scientificNameChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Species/scientificName"
<DocumentEvents onModified="Update($fieldSpeciesScientificName/text)"/>
@@ -80,7 +165,7 @@
</cell>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JTextField id="fieldSpeciesCodeRubbin"/>
+ <JTextField id="fieldSpeciesCodeRubbin" onKeyTyped='codeChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Species/codeRubbin"
<DocumentEvents onModified="Update($fieldSpeciesCodeRubbin/text)"/>
@@ -93,7 +178,7 @@
</cell>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JTextField id="fieldSpeciesCEE"/>
+ <JTextField id="fieldSpeciesCEE" onKeyTyped='CEEChanged()'/>
<!--
origin="$Species/codeCEE"
<DocumentEvents onModified="Update($fieldSpeciesCEE/text)"/>
@@ -107,7 +192,7 @@
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JRadioButton id="fieldSpeciesDynamicAge" text="isisfish.species.age" buttonGroup="structuredGroup"/>
+ <JRadioButton id="fieldSpeciesDynamicAge" text="isisfish.species.age" buttonGroup="structuredGroup" onItemStateChanged='dynamicAgeChanged()'/>
<!--
origin="$Species/ageGroupType"
actionCommand="Update($fieldSpeciesDynamicAge/selected)"
@@ -137,7 +222,7 @@
</cell>
<cell fill='both' columns='2' weightx='1.0' weighty='1.0'>
<JScrollPane>
- <JTextArea id="fieldSpeciesComment"/>
+ <JTextArea id="fieldSpeciesComment" onKeyTyped='commentChanged()'/>
<!-- Fixme : DocumentEvents
origin="$Species/comment"
<DocumentEvents onModified="Update($fieldSpeciesComment/text)"/>
@@ -156,7 +241,7 @@
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.save"/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.save("Species", $Species);refreshView($inputSpecies)'
@@ -165,7 +250,7 @@
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.cancel"/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("Species", $Species);refreshView($inputSpecies)'
@@ -174,14 +259,14 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.new"/>
+ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/>
<!--
origin="$FisheryRegion"
actionCommand='input.Input.create("Species")'
-->
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.remove"/>
+ <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/>
<!--
origin="$Species"
actionCommand="input.Input.remove($Species)"
@@ -190,7 +275,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.input.continuePopulations"/>
+ <JButton text="isisfish.input.continuePopulations" onActionPerformed='goToGear()'/>
<!--
actionCommand="UIHelper.setTreeSelectionFirstChild($Species)"
-->
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -39,30 +39,156 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Cell;
import fr.ifremer.isisfish.entities.Zone;
+ import fr.ifremer.isisfish.entities.Port;
+ import fr.ifremer.isisfish.map.IsisMapBean;
+ import fr.ifremer.isisfish.map.OpenMapToolPanel;
+ import com.bbn.openmap.gui.OMToolSet;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import org.codelutin.topia.persistence.TopiaEntity;
+ import org.codelutin.topia.TopiaException;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+
+ protected IsisMapBean zoneMap = new IsisMapBean();
+ protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
+ protected OMToolSet toolSet = new OMToolSet();
+ protected boolean changed = false;
public ZoneUI (InputAction action){
setContextValue(action);
+ this.addFocusListener(new FocusListener() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ System.out.println(changed);
+ if (changed){
+ if (!askAndSave()){
+ getParentContainer(InputUI.class).setTreeSelection(getContextValue(InputAction.class).getSelected(), Zone.class);
+ }
+ }
+ }
+ });
}
+ protected boolean askAndSave(){
+ boolean result = true;
+ try {
+ int choice = JOptionPane.showConfirmDialog(null, _("isisfish.message.page.modified"));
+ switch (choice) {
+ case JOptionPane.YES_OPTION:
+ getContextValue(InputAction.class).getIsisContext().commitTransaction();
+ result = true;
+ break;
+ case JOptionPane.NO_OPTION:
+ getContextValue(InputAction.class).getIsisContext().rollbackTransaction();
+ result = true;
+ break;
+ case JOptionPane.CANCEL_OPTION:
+ result = false;
+ break;
+ };
+ } catch (TopiaException ex) {
+ Logger.getLogger(InputUI.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return result;
+ }
protected void refresh() {
Zone z = getContextValue(InputAction.class).getZone();
- System.out.println("refresh" + z);
if (z != null){
+ //DefaultComboBoxModel model = new DefaultComboBoxModel(getContextValue(InputAction.class).getFisheryRegion().getCell().toArray());
+ //zoneCells.setModel(model);
+ DefaultListModel zoneCellsModel = new DefaultListModel();
+ java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
+ for (Cell c : cells){
+ zoneCellsModel.addElement(c);
+ }
+ zoneCells.setModel(zoneCellsModel);
+ java.util.List<Cell> cellsSelected = z.getCell();
+ int[] indexs = new int[zoneCellsModel.size()];
+ int i = 0;
+ for (Cell c : cellsSelected){
+ indexs[i] = zoneCellsModel.indexOf(c);
+ i++;
+ }
+ zoneCells.setSelectedIndices(indexs);
+
fieldZoneName.setText(z.getName());
- DefaultListModel model = new DefaultListModel();
- for (Cell c : getContextValue(InputAction.class).getZone().getCell()){
- model.addElement(c);
- }
- zoneCells.setModel(model);
fieldZoneComment.setText(getContextValue(InputAction.class).getZone().getComment());
+
+ zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
+ toolSet.setupListeners(zoneMap);
+ toolMap.add((Component)toolSet);
+ zoneMapPanel.add(toolMap, BorderLayout.NORTH);
+ zoneMapPanel.add(zoneMap, BorderLayout.CENTER);
+ refreshMap();
}
- }
+ }
+ protected void refreshMap(){
+ java.util.List<Cell> cells = new ArrayList<Cell>();
+ for (Object o : zoneCells.getSelectedValues()){
+ cells.add((Cell) o );
+ }
+ zoneMap.setSelectedCells(cells);
+ }
protected void create(){
+ TopiaEntity topia = getContextValue(InputAction.class).create("Zone");
+
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection(topia, Zone.class);
+
+ setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
+ TopiaEntity topia = getContextValue(InputAction.class).save("Zone");
+ getParentContainer(InputUI.class).setTreeSelection(topia, Zone.class);
+ setInfoText(_("isisfish.message.save.finished"));
+ refresh();
+ valueChanged(false);
}
protected void cancel(){
+ getContextValue(InputAction.class).cancel("Zone");
+ setInfoText(_("isisfish.message.cancel.finished"));
+ valueChanged(false);
+ refresh();
}
protected void remove(){
+ setInfoText(getContextValue(InputAction.class).remove());
+ valueChanged(false);
+ refresh();
}
+ protected void goToPort(){
+ getParentContainer(InputUI.class).setTreeSelection(null, Port.class);
+ }
+ protected void setInfoText(String txt){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(txt);
+ }
+ protected void commentChange(){
+ getContextValue(InputAction.class).getZone().setComment(fieldZoneComment.getText());
+ valueChanged(true);
+ }
+ protected void zoneCellsChange(){
+ java.util.List<Cell> cells = new ArrayList<Cell>();
+ for (Object o : zoneCells.getSelectedValues()){
+ cells.add((Cell) o);
+ }
+ getContextValue(InputAction.class).getZone().setCell(cells);
+ valueChanged(true);
+ refresh();
+ }
+ protected void nameChange(){
+ getContextValue(InputAction.class).getZone().setName(fieldZoneName.getText());
+ valueChanged(true);
+ refresh();
+ }
+ protected void valueChanged(boolean b){
+ changed=b;
+ create.setEnabled(b);
+ save.setEnabled(b);
+ }
]]>
</script>
<row>
@@ -78,105 +204,57 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JTextField id="fieldZoneName"/>
-<!-- Fixme : DocumentEvents
- origin="$Zone/name"
- <DocumentEvents onModified="Update($fieldZoneName/text)"/>
--->
+ <JTextField id="fieldZoneName" onFocusLost='nameChange()'/>
</cell>
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
<JLabel text="isisfish.zone.cells"/>
-
-
</cell>
</row>
<row>
<cell columns='2' fill='both' weighty='0.7' weightx='1.0'>
<JScrollPane>
- <JList id="zoneCells">
-<!-- Fixme : ListModel
- origin="getCell($Zone)" iterate="true" renderer="name"
- <ListModel origin="$FisheryRegion/cell"/>
- <ListSelectionEvents onValueChanged="Update($zoneCells/selectedValues, $Zone/cell, refreshView($zoneMap))"/>
--->
- </JList>
+ <JList id="zoneCells" onMouseClicked='refreshMap()' onFocusLost='zoneCellsChange()'/>
</JScrollPane>
</cell>
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
<JLabel text="isisfish.zone.comments"/>
-
</cell>
</row>
<row>
<cell columns='2' fill='both' weighty='0.3' weightx='1.0'>
<JScrollPane>
- <JTextArea id="fieldZoneComment">
-<!-- Fixme : DocumentEvents
- origin="$Zone/comment"
- <DocumentEvents onModified="Update($fieldZoneComment/text)"/>
--->
- </JTextArea>
+ <JTextArea id="fieldZoneComment" onFocusLost='commentChange()'/>
</JScrollPane>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.new" onActionPerformed='create()'/>
-<!--
- origin="$FisheryRegion"
- actionCommand='input.Input.create("Zone")'
--->
+ <JButton id='create' text="isisfish.common.new" enabled='false' onActionPerformed='create()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.save" onActionPerformed='save()'/>
-<!--
- origin="$EntityModified"
- actionCommand='input.Input.save("Zone", $Zone);refreshView($inputZone)'
--->
+ <JButton id='save' text="isisfish.common.save" enabled='false' onActionPerformed='save()'/>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
<JButton text="isisfish.common.cancel" onActionPerformed='cancel()'/>
-<!--
- origin="$EntityModified"
- actionCommand='input.Input.cancel("Zone", $Zone);refreshView($inputZone)'
--->
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton text="isisfish.common.remove" onActionPerformed='remove()'/>
-<!--
-origin="$Zone"
- actionCommand="input.Input.remove($Zone)"
--->
</cell>
</row>
</Table>
- <JPanel id="zoneMapPanel" layout='{new BorderLayout()}'>
-<!-- Fixme : OpenMapToolPanel, OpenMap
- <OpenMapToolPanel constraints='"BorderLayout.NORTH"' id="zoneMapTool">
- <OpenMapToolSet id="zoneMapToolSet" origin="$zoneMap"/>
- </OpenMapToolPanel>
- <OpenMap id="zoneMap" origin="$FisheryRegion" selected="$Zone/cell"
- selectionMode="2">
- <OpenMapEvents id="zoneMapEvents" mouseMode="Select"
- onMouseClicked="Update($zoneMap/selectedCells, $Zone/cell, refreshView($zoneCells))"/>
- </OpenMap>
--->
- </JPanel>
+ <JPanel id="zoneMapPanel" layout='{new BorderLayout()}'/>
</JSplitPane>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.input.continuePorts" onActionPerformed='create()'/>
-<!--
- actionCommand="UIHelper.setTreeSelection('Ports')"
--->
+ <JButton text="isisfish.input.continuePorts" onActionPerformed='goToPort()'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -39,6 +39,7 @@
<cell fill="horizontal">
<JComboBox id='selSimulation' editable='true' toolTipText='isisfish.result.simulation'/>
<!--
+ model='{new DefaultComboBoxModel(Common.getOldSimulationItem())}'
addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent e){
on_simulation_selection_notify_event(e);
@@ -50,6 +51,7 @@
<cell fill="horizontal" weightx="0.2">
<JButton id='filterSimulationButton' text='isisfish.filter' toolTipText='isisfish.filter.simulation'/>
<!--
+ onActionPerformed='filter()'
result.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e){
on_filterSimulationLogButton_clicked();
@@ -60,6 +62,7 @@
<cell fill="horizontal" weightx="0.2">
<JButton id='openWindowButton' text='isisfish.result.new.window' toolTipText='isisfish.result.openWindowButton'/>
<!--
+ onActionPerformed='open()'
result.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e){
on_openWindowButton_clicked();
@@ -70,6 +73,7 @@
<cell fill="horizontal" weightx="0.2">
<JButton id="supprimerSimulationButton" text='isisfish.result.remove.simulation' toolTipText='isisfish.result.removeSimulationButton'/>
<!--
+ onActionPerformed='open()'
result.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e){
on_supprimerSimulationButton_clicked();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-10-30 17:47:57 UTC (rev 1579)
@@ -300,7 +300,7 @@
<row>
<cell columns="4" fill="both" weightx="1.0" weighty="0.3">
<JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JTextArea id="fieldSimulParamsDesc" text='{getContextValue(SimulAction.class).getSimulationParameter().getDescription()}' onFocusLost='saveDescription()'/>
+ <JTextArea id="fieldSimulParamsDesc" text='{getContextValue(SimulAction.class).getSimulationParameter().getDescription()}' onKeyPressed='saveDescription()'/>
</JScrollPane>
</cell>
</row>
@@ -332,7 +332,7 @@
<row>
<cell fill="both" weightx="1.0" weighty="1.0">
<JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JList id="listSimulParamsStrategies" selectionMode="2" onFocusLost='strategySelected()'/>
+ <JList id="listSimulParamsStrategies" selectionMode="2" onMouseClicked='strategySelected()'/>
</JScrollPane>
</cell>
</row>
@@ -370,7 +370,7 @@
<row>
<cell fill="both" weightx="1.0" weighty="1.0">
<JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JList id="listSimulParamsMesuresList" selectionMode="0" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getRules().toArray())}' onValueChanged='setRulesButton()'/>
+ <JList id="listSimulParamsMesuresList" selectionMode="0" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getRules().toArray())}' onMouseClicked='setRulesButton()'/>
</JScrollPane>
</cell>
</row>
1
0
r1578 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: . input script simulator widget/editor
by sletellierï¼ users.labs.libre-entreprise.org 28 Oct '08
by sletellierï¼ users.labs.libre-entreprise.org 28 Oct '08
28 Oct '08
Author: sletellier
Date: 2008-10-28 11:34:42 +0000 (Tue, 28 Oct 2008)
New Revision: 1578
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterCellEditor.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.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
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java
Log:
InputUI in progress
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeAction.java 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeAction.java 2008-10-28 11:34:42 UTC (rev 1578)
@@ -29,18 +29,12 @@
protected void updateVCS() {
}
- protected void close(WelcomeUI ui) {
- ui.dispose();
- }
protected void showConfig() {
}
protected void showConfigVCS() {
}
protected void help() {
}
- protected void monitorUI() {
- new ApplicationMonitorUI();
- }
protected void aboutUI() {};
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -31,18 +31,27 @@
*/
-->
<JPanel id='welcomePanelUI' layout='{new BorderLayout()}'>
- <script>
+ <script><![CDATA[
import fr.ifremer.isisfish.ui.simulator.SimulAction;
+ import static javax.swing.JOptionPane.showMessageDialog;
+ import fr.ifremer.isisfish.ui.input.InputAction;
+ showMsgBox(simulUI.getContextValue(SimulAction.class).init());
+ protected void showMsgBox(String txt){
+ if (txt != null){
+ showMessageDialog(this, txt);
+ }
+ }
+ ]]>
</script>
<JTabbedPane id="simulTabs" tabPlacement='{JTabbedPane.LEFT}' constraints="BorderLayout.CENTER">
<tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/simulation.gif"))}'>
- <fr.ifremer.isisfish.ui.simulator.SimulUI constructorParams='new SimulAction()'/>
+ <fr.ifremer.isisfish.ui.simulator.SimulUI id='simulUI' constructorParams='new SimulAction()'/>
</tab>
<tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/calc.gif"))}'>
<fr.ifremer.isisfish.ui.result.ResultUI/>
</tab>
<tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/book.gif"))}'>
- <fr.ifremer.isisfish.ui.input.InputUI/>
+ <fr.ifremer.isisfish.ui.input.InputUI constructorParams='new InputAction()'/>
</tab>
<tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/bookPage.gif"))}'>
<fr.ifremer.isisfish.ui.script.ScriptUI/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -52,6 +52,12 @@
f.setVisible(true);
f.pack();
}
+ protected void close() {
+ this.dispose();
+ }
+ protected void monitorUI() {
+ new ApplicationMonitorUI();
+ }
]]>
</script>
<JMenuBar>
@@ -61,15 +67,12 @@
onActionPerformed="getContextValue(WelcomeAction.class).updateVCS()"
-->
<JSeparator/>
- <JMenuItem text="isisfish.welcome.menu.close"/>
-<!--
- onActionPerformed="getContextValue(WelcomeAction.class).close(getContextValue(this.getClass()))"
--->
+ <JMenuItem text="isisfish.welcome.menu.close" onActionPerformed='close()'/>
</JMenu>
<JMenu text="isisfish.welcome.menu.frame">
<JMenuItem text="isisfish.welcome.menu.simulation" onActionPerformed='openFrame(new SimulUI(new SimulAction()), _("isisfish.simulation.title"))'/>
<JMenuItem text="isisfish.welcome.menu.result" onActionPerformed='openFrame(new ResultUI(), _("isisfish.result.title"))'/>
- <JMenuItem text="isisfish.welcome.menu.input" onActionPerformed='openFrame(new InputUI(), _("isisfish.input.title"))'/>
+ <JMenuItem text="isisfish.welcome.menu.input" onActionPerformed='openFrame(new InputUI(new InputAction()), _("isisfish.input.title"))'/>
<JMenuItem text="isisfish.welcome.menu.script" onActionPerformed='openFrame(new ScriptUI(), _("isisfish.script.title"))'/>
<JSeparator/>
<JMenuItem text="isisfish.welcome.menu.queue" onActionPerformed='openFrame(new SimulQueueUI(), _("isisfish.queue.title"))'/>
@@ -94,10 +97,7 @@
onActionPerformed="getContextValue(WelcomeAction.class).help()"
-->
<JSeparator/>
- <JMenuItem text="isisfish.welcome.menu.monitor"/>
-<!--
- onActionPerformed="getContextValue(WelcomeAction.class).monitorUI()"
--->
+ <JMenuItem text="isisfish.welcome.menu.monitor" onActionPerformed='monitorUI()'/>
<JSeparator/>
<JMenuItem text="isisfish.welcome.menu.about"/>
<!--
@@ -106,13 +106,4 @@
</JMenu>
</JMenuBar>
<WelcomePanelUI id="welcomePanelUI"/>
-<!-- <JTabbedPane id="simulTabs" tabPlacement='{JTabbedPane.LEFT}'>
- <tab title='' icon='{new ImageIcon(getClass().getResource("/images/simulation.gif"))}'><fr.ifremer.isisfish.ui.simulator.SimulUI/></tab>
- <tab title='' icon='{new ImageIcon(getClass().getResource("/images/calc.gif"))}'><fr.ifremer.isisfish.ui.result.ResultUI/></tab>
- <tab title='' icon='{new ImageIcon(getClass().getResource("/images/book.gif"))}'><fr.ifremer.isisfish.ui.input.InputUI/></tab>
- <tab title='' icon='{new ImageIcon(getClass().getResource("/images/bookPage.gif"))}'><fr.ifremer.isisfish.ui.script.ScriptUI/></tab>
- </JTabbedPane>
- <JPanel constraints="BorderLayout.SOUTH">
- <StatusBarUI id='statusBar'/>
- </JPanel> -->
</JFrame>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -34,73 +34,118 @@
<!--
+ Cell
+-->
-<JPanel layout='{new BorderLayout()}'>
- <JSplitPane id="CellTab" name="Cells"
- oneTouchExpandable="true" dividerLocation="200" orientation="VERTICAL">
- <JPanel name="isisfish.cell.title">
-<!-- Fixme : ContextDataSource
- <ContextDataSource id="Cell" context="current" source="Cell"/>
--->
- <!-- Widget -->
- <JComboBox id="fieldCell">
+<Table>
+ <script><![CDATA[
+ public CellUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ }
+ ]]>
+ </script>
+ <row>
+ <cell fill='both' weighty='1.0' weightx='1.0'>
+ <JSplitPane id="CellTab" name="Cells"
+ oneTouchExpandable="true" dividerLocation="200" orientation="horizontal">
+ <Table>
+ <row>
+ <cell fill='horizontal' columns='2' weightx='1.0'>
+ <!-- Widget -->
+ <JComboBox id="fieldCell"/>
<!-- Fixme : ComboBoxModel
origin="$Cell" renderer="name"
actionCommand='UIHelper.setTreeSelection($tree, $treeModel, $fieldCell/selectedItem)'
<ComboBoxModel origin="$FisheryRegion/cell"/>
-->
- </JComboBox>
- <JLabel text="isisfish.cell.name"/>
- <JTextField id="fieldCellName">
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.cell.name"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldCellName"/>
<!-- Fixme : DocumentEvents
origin="$Cell/name"
<DocumentEvents onModified="Update($fieldCellName/text)"/>
-->
- </JTextField>
- <JLabel text="isisfish.cell.latitude"/>
- <JTextField id="fieldCellLatitude" editable="false"/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+
+
+ <JLabel text="isisfish.cell.latitude"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldCellLatitude" editable="false"/>
<!--
origin="$Cell/latitude"
--->
- <JLabel text="isisfish.cell.longitude"/>
- <JTextField id="fieldCellLongitude" editable="false"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.cell.longitude"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldCellLongitude" editable="false"/>
<!--
origin="$Cell/longitude"
--->
- <JLabel text="isisfish.cell.land"/>
- <JCheckBox id="fieldCellLand">
+-->
+ </cell>
+ </row>
+ <row>
+ <cell>
+
+
+ <JLabel text="isisfish.cell.land"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JCheckBox id="fieldCellLand"/>
<!-- Fixme : ItemEvents
origin="$Cell/land"
<ItemEvents onStateChanged="Update($fieldCellLand/selected)"/>
--->
- </JCheckBox>
- <JLabel text="isisfish.cell.comments"/>
- <JScrollPane>
- <JTextArea id="fieldCellComment">
+-->
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal'>
+ <JLabel text="isisfish.cell.comments"/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weighty='1.0' weightx='1.0'>
+ <JScrollPane>
+ <JTextArea id="fieldCellComment">
<!--
origin="$Cell/comment"
<DocumentEvents onModified="Update($fieldCellComment/text)"/>
-->
- </JTextArea>
- </JScrollPane>
- <JPanel id="panelCellButtonAction">
- <JButton text="isisfish.common.save"/>
+ </JTextArea>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.save"/>
<!--
origin="$EntityModified"
actionCommand='input.Input.save("Cell", $Cell);refreshView($inputCell)'
--->
- <JButton text="isisfish.common.cancel"/>
+-->
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.cancel"/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("Cell", $Cell);refreshView($inputCell)'
-->
- </JPanel>
- </JPanel>
-
+ </cell>
+ </row>
+ </Table>
+
+ <JPanel id="cellMapPanel" layout='{new BorderLayout()}'/>
<!--
- <xpanel xml="input/Cell.xml" id="inputCell"/>
--->
- <JPanel id="cellMapPanel" layout='{new BorderLayout()}'>
-<!--
<OpenMapToolPanel constraints='"BorderLayout.NORTH"' id="cellMapTool">
<OpenMapToolSet id="cellMapToolSet" origin="$cellMap"/>
</OpenMapToolPanel>
@@ -110,10 +155,17 @@
onMouseClicked="UIHelper.setTreeSelection($cellMap/selectedCells[1])"/>
</OpenMap>
-->
- </JPanel>
- </JSplitPane>
- <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueZones"/>
+ </JSplitPane>
+
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton text="isisfish.input.continueZones"/>
<!--
actionCommand="UIHelper.setTreeSelection('Zones')"
-->
-</JPanel>
\ No newline at end of file
+
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -30,24 +30,133 @@
* by : $Author: sletellier $
*/
-->
-
-
- <!--
- + Gear
- +-->
-<JPanel layout='{new BorderLayout()}'>
- <JTabbedPane constraints='BorderLayout.CENTER' id="GearTab" name="Gear">
- <tab title='{_("isisfish.gear.title")}'><GearUI/></tab>
- <tab title='{_("isisfish.selectivity.title")}'><SelectivityUI/></tab>
+<Table>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.gear.name"/>
+ </cell>
+ <cell columns="2" fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldGearName"/>
+<!-- Fixme : DocumentEvents
+origin="$Gear/name"
+<DocumentEvents onModified="Update($fieldGearName/text)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.gear.effortUnit"/>
+ </cell>
+ <cell columns="2" fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldGearEffortUnit"/>
+<!-- Fixme : DocumentEvents
+origin="$Gear/effortUnit"
+<DocumentEvents onModified="Update($fieldGearEffortUnit/text)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.gear.standardisationFactor"/>
+ </cell>
+ <cell columns="2" fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldGearStandardisationFactor"/>
+<!-- Fixme : DocumentEvents
+origin="$Gear/standardisationFactor"
+<DocumentEvents onModified="Update($fieldGearStandardisationFactor/text)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.gear.technicalParameter"/>
+ </cell>
+ <cell columns="2" fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldGearParamName"/>
+<!-- Fixme : DocumentEvents
+origin="$Gear/parameterName">
+<DocumentEvents onModified="Update($fieldGearParamName/text)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.gear.rangeValues"/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JComboBox id="fieldGearParamType"/>
+ <!-- Fixme : ComboBoxModel
+firstNull="true"
+origin="$Gear/possibleValue/type"
+actionCommand="update(concat($fieldGearParamType/selectedItem, '[', $fieldGearParamPossibleValue/text, ']'), $Gear/possibleValue)"
+<ComboBoxModel origin="fr.ifremer.isisfish.types.RangeOfValues.getPossibleTypes()"/>
+-->
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JTextField id="fieldGearParamPossibleValue"/>
+ <!-- Fixme : DocumentEvents
+origin="$Gear/possibleValue/values"
+<DocumentEvents onModified="Update(concat($fieldGearParamType/selectedItem, '[', $fieldGearParamPossibleValue/text, ']'), $Gear/possibleValue)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.gear.comments"/>
+ </cell>
+ <cell columns="2" fill='both' weightx='1.0' weighty='1.0'>
+ <JScrollPane>
+ <JTextArea id="fieldGearComment">
+<!-- Fixme : DocumentEvents
+origin="$Gear/comment"
+<DocumentEvents onModified="Update($fieldGearComment/text)"/>
+-->
+ </JTextArea>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.new"/>
+ <!--
+origin="$FisheryRegion"
+actionCommand='input.Input.create("Gear")'
+-->
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.save"/>
<!--
- name="isisfish.gear.title"
- name="isisfish.selectivity.title"
- <xpanel xml="input/Gear.xml" id="inputGear"/>
- <xpanel xml="input/Selectivity.xml" id="inputSelectivity"/>
+origin="$EntityModified"
+actionCommand='input.Input.save("Gear", $Gear);refreshView($inputGear)'
-->
- </JTabbedPane>
- <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueMetiers"/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.cancel"/>
<!--
- actionCommand="UIHelper.setTreeSelection('Metiers')"
+origin="$EntityModified"
+actionCommand='input.Input.cancel("Gear", $Gear);refreshView($inputGear)'
-->
-</JPanel>
\ No newline at end of file
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.remove"/>
+<!--
+origin="$Gear"
+actionCommand="input.Input.remove($Gear)"
+-->
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -30,133 +30,31 @@
* by : $Author: sletellier $
*/
-->
-<Table>
- <row>
- <cell fill='both' weightx='1.0' weighty='1.0'>
- <Table>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.gear.name"/>
- </cell>
- <cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearName"/>
-<!-- Fixme : DocumentEvents
-origin="$Gear/name"
-<DocumentEvents onModified="Update($fieldGearName/text)"/>
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.gear.effortUnit"/>
- </cell>
- <cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearEffortUnit"/>
-<!-- Fixme : DocumentEvents
-origin="$Gear/effortUnit"
-<DocumentEvents onModified="Update($fieldGearEffortUnit/text)"/>
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.gear.standardisationFactor"/>
- </cell>
- <cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearStandardisationFactor"/>
-<!-- Fixme : DocumentEvents
-origin="$Gear/standardisationFactor"
-<DocumentEvents onModified="Update($fieldGearStandardisationFactor/text)"/>
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.gear.technicalParameter"/>
- </cell>
- <cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearParamName"/>
-<!-- Fixme : DocumentEvents
-origin="$Gear/parameterName">
-<DocumentEvents onModified="Update($fieldGearParamName/text)"/>
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.gear.rangeValues"/>
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JComboBox id="fieldGearParamType"/>
- <!-- Fixme : ComboBoxModel
-firstNull="true"
-origin="$Gear/possibleValue/type"
-actionCommand="update(concat($fieldGearParamType/selectedItem, '[', $fieldGearParamPossibleValue/text, ']'), $Gear/possibleValue)"
-<ComboBoxModel origin="fr.ifremer.isisfish.types.RangeOfValues.getPossibleTypes()"/>
--->
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JTextField id="fieldGearParamPossibleValue"/>
- <!-- Fixme : DocumentEvents
-origin="$Gear/possibleValue/values"
-<DocumentEvents onModified="Update(concat($fieldGearParamType/selectedItem, '[', $fieldGearParamPossibleValue/text, ']'), $Gear/possibleValue)"/>
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.gear.comments"/>
- </cell>
- <cell columns="2" fill='both' weightx='1.0' weighty='1.0'>
- <JScrollPane>
- <JTextArea id="fieldGearComment">
-<!-- Fixme : DocumentEvents
-origin="$Gear/comment"
-<DocumentEvents onModified="Update($fieldGearComment/text)"/>
--->
- </JTextArea>
- </JScrollPane>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <Table>
- <row>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.new"/>
- <!--
-origin="$FisheryRegion"
-actionCommand='input.Input.create("Gear")'
--->
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.save"/>
+
+
+ <!--
+ + Gear
+ +-->
+<JPanel layout='{new BorderLayout()}'>
+ <script><![CDATA[
+ public GearUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ }
+ ]]></script>
+ <JTabbedPane constraints='BorderLayout.CENTER' id="GearTab" name="Gear">
+ <tab title='{_("isisfish.gear.title")}'><GearTabUI/></tab>
+ <tab title='{_("isisfish.selectivity.title")}'><SelectivityUI/></tab>
<!--
-origin="$EntityModified"
-actionCommand='input.Input.save("Gear", $Gear);refreshView($inputGear)'
+ name="isisfish.gear.title"
+ name="isisfish.selectivity.title"
+ <xpanel xml="input/Gear.xml" id="inputGear"/>
+ <xpanel xml="input/Selectivity.xml" id="inputSelectivity"/>
-->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.cancel"/>
+ </JTabbedPane>
+ <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueMetiers"/>
<!--
-origin="$EntityModified"
-actionCommand='input.Input.cancel("Gear", $Gear);refreshView($inputGear)'
+ actionCommand="UIHelper.setTreeSelection('Metiers')"
-->
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.remove"/>
-<!--
-origin="$Gear"
-actionCommand="input.Input.remove($Gear)"
--->
- </cell>
- </row>
- </Table>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+</JPanel>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-10-28 11:34:42 UTC (rev 1578)
@@ -28,25 +28,231 @@
* Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
* by : $Author: sletellier $
*/
-
package fr.ifremer.isisfish.ui.input;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
+
import java.util.List;
import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.entities.Cell;
+import fr.ifremer.isisfish.entities.FisheryRegion;
+import fr.ifremer.isisfish.entities.Gear;
+import fr.ifremer.isisfish.entities.Metier;
+import fr.ifremer.isisfish.entities.Port;
+import fr.ifremer.isisfish.entities.SetOfVessels;
+import fr.ifremer.isisfish.entities.Species;
+import fr.ifremer.isisfish.entities.Strategy;
+import fr.ifremer.isisfish.entities.TripType;
+import fr.ifremer.isisfish.entities.VesselType;
+import fr.ifremer.isisfish.entities.Zone;
import java.util.ArrayList;
+import javax.swing.JOptionPane;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.TopiaContext;
+import org.codelutin.topia.persistence.TopiaEntity;
+import static org.codelutin.i18n.I18nf._;
-
/**
*
* @author letellier
*/
public class InputAction {
- public InputAction(){
-
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(Input.class);
+ protected RegionStorage regionStorage = null;
+ protected FisheryRegion fisheryRegion = null;
+ protected TopiaContext isisContext = null;
+ protected TopiaEntity selected;
+ protected Class selectedType;
+ protected Cell cell;
+ protected Zone zone;
+ protected Port port;
+ protected Species species;
+ protected Gear gear;
+ protected Metier metier;
+ protected TripType tripType;
+ protected VesselType vesselType;
+ protected SetOfVessels setOfVessels;
+ protected Strategy strategy;
+
+ public InputAction() {
}
-
+
+ public void setValue(Object value, Class type) {
+ if (type == Zone.class){
+ zone = (Zone) value;
+ } else if (type == Cell.class){
+ cell = (Cell) value;
+ } else if (type == Port.class){
+ port = (Port) value;
+ } else if (type == Species.class){
+ species = (Species) value;
+ } else if (type == Gear.class){
+ gear = (Gear) value;
+ } else if (type == Metier.class){
+ metier = (Metier) value;
+ } else if (type == TripType.class){
+ tripType = (TripType) value;
+ } else if (type == VesselType.class){
+ vesselType = (VesselType) value;
+ } else if (type == SetOfVessels.class){
+ setOfVessels = (SetOfVessels) value;
+ } else if (type == Strategy.class){
+ strategy = (Strategy) value;
+ }
+ }
+
+ /**
+ * load region.
+ * <p>
+ * RegionStorage, TopiaContext, FisheryRegion are put in uiContext data.
+ * <p>
+ * tree ans
+ *
+ * @param uiContext
+ * @param frame
+ * @param oldIsisContext
+ * @param oldRegionStorage
+ * @param inputPane
+ * inputPane is put in 'emptyPanel' state
+ * @param name
+ * name of region
+ * @return if ok return null else OutView error
+ */
+ public void loadRegion(String name) {
+ log.debug("loadRegion called");
+ try {
+
+// if (regionStorage != null) {
+// boolean result = askForSave();
+// if (result) {
+// addCommentOnRegion(uiContext, oldRegionStorage);
+// // close old context before change region
+// if (!oldIsisContext.isClosed()) {
+// oldIsisContext.closeContext();
+// }
+// } else {
+// frame.setInfoText(_("isisfish.message.load.region.canceled"));
+// return null;
+// }
+// }
+
+ regionStorage = null;
+ fisheryRegion = null;
+ isisContext = null;
+
+// initContext(uiContext);
+
+ if (name != null && !"".equals(name)) {
+ regionStorage = RegionStorage.getRegion(name);
+ isisContext = regionStorage.getStorage().beginTransaction();
+ fisheryRegion = RegionStorage.getFisheryRegion(isisContext);
+ }
+
+
+// ((CardLayout) inputPane.getLayout()).show(inputPane, "emptyPanel");
+
+ } catch (Exception eee) {
+ log.error("Can't load region", eee);
+ //new OutputView("Error.xml", "error", eee.getMessage());
+ }
+ }
+
+ /**
+ * If some entities has been modified by the user (EntityModified state is
+ * true) then ask the user if he want save, don't save modification, or
+ * cancel current wanted action.
+ *
+ * If this method return true, only button (save, cancel) will be refreshed
+ * not the current input panel
+ *
+ * if this method return false, nothing is do
+ *
+ * @param uiContext
+ * @param frame
+ * @param isisContext
+ * current transaction context
+ * @return false if user want cancel action, true otherwize
+ * @throws TopiaException
+ */
+ protected boolean askForSave() {
+ boolean result = true;
+// int choice = JOptionPane.showConfirmDialog(null,_("isisfish.message.page.modified"));
+// switch (choice) {
+// case JOptionPane.YES_OPTION:
+// isisContext.commitTransaction();
+// result = true;
+// break;
+// case JOptionPane.NO_OPTION:
+// isisContext.rollbackTransaction();
+// result = true;
+// break;
+// case JOptionPane.CANCEL_OPTION:
+// result = false;
+// break;
+// }
+// if (result == true) {
+// // object has been saved or no, we must refresh button
+// uiContext.setData("EntityModified", null);
+// frame.refreshViewPattern("panel.*?ButtonAction");
+// }
+//
+ return result;
+ }
+
+ protected String getFisheryRegionName() {
+ if (fisheryRegion != null) {
+ return fisheryRegion.getName();
+ }
+ return null;
+ }
+
+ protected FisheryRegion getFisheryRegion() {
+ return fisheryRegion;
+ }
+
+ protected Cell getCell() {
+ return cell;
+ }
+
+ protected Zone getZone() {
+ return zone;
+ }
+
+ protected Port getPort() {
+ return port;
+ }
+
+ protected Species getSpecies() {
+ return species;
+ }
+
+ protected Gear getGear() {
+ return gear;
+ }
+
+ protected Metier getMetier() {
+ return metier;
+ }
+
+ protected TripType getTripType() {
+ return tripType;
+ }
+
+ protected VesselType getVesselType() {
+ return vesselType;
+ }
+
+ protected SetOfVessels getSetOfVessels() {
+ return setOfVessels;
+ }
+
+ protected Strategy getStrategy() {
+ return strategy;
+ }
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -32,68 +32,141 @@
-->
<JPanel id="input" visible="true" size='{new Dimension(700,500)}' layout='{new BorderLayout()}' location='{new Point(0,139)}'>
- <script>
-
- setContextValue(new InputAction());
+ <script><![CDATA[
+ import fr.ifremer.isisfish.ui.Common;
+ import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import javax.swing.tree.DefaultMutableTreeNode;
+ import javax.swing.tree.DefaultTreeModel;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+ import fr.ifremer.isisfish.entities.Cell;
+ import fr.ifremer.isisfish.entities.Gear;
+ import fr.ifremer.isisfish.entities.Metier;
+ import fr.ifremer.isisfish.entities.Port;
+ import fr.ifremer.isisfish.entities.SetOfVessels;
+ import fr.ifremer.isisfish.entities.Species;
+ import fr.ifremer.isisfish.entities.Strategy;
+ import fr.ifremer.isisfish.entities.TripType;
+ import fr.ifremer.isisfish.entities.VesselType;
+ import fr.ifremer.isisfish.entities.Zone;
+
+ //setContextValue(new InputAction());
+
+ tree.addTreeSelectionListener(new TreeSelectionListener() {
+ @Override
+ public void valueChanged(TreeSelectionEvent e) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
+ if (node != null) {
+ GenericCell selectedValue = (GenericCell) node.getUserObject();
+ if (selectedValue.getType() != null) {
+ ((CardLayout) inputPane.getLayout()).show(inputPane, selectedValue.getType().getSimpleName());
+ if (selectedValue.getClass() != null) {
+ getContextValue(InputAction.class).setValue(selectedValue.getValue(),selectedValue.getType());
+ if (selectedValue.getType() == Zone.class){
+ zoneUI.refresh();
+ } else if (selectedValue.getType() == Cell.class){
+ cellUI.refresh();
+ } else if (selectedValue.getType() == Port.class){
+ portUI.refresh();
+ } else if (selectedValue.getType() == Species.class){
+ speciesUI.refresh();
+ } else if (selectedValue.getType() == Gear.class){
+ gearUI.refresh();
+ } else if (selectedValue.getType() == Metier.class){
+ metierUI.refresh();
+ } else if (selectedValue.getType() == TripType.class){
+ tripTypeUI.refresh();
+ } else if (selectedValue.getType() == VesselType.class){
+ vesselTypeUI.refresh();
+ } else if (selectedValue.getType() == SetOfVessels.class){
+ setOfVesselsUI.refresh();
+ } else if (selectedValue.getType() == Strategy.class){
+ strategyUI.refresh();
+ }
+ }
+ }
+ else {
+ ((CardLayout) inputPane.getLayout()).show(inputPane, "none");
+ }
+ }
+ }
+ });
+ public InputUI (InputAction action){
+ setContextValue(action);
+ }
+ protected DefaultComboBoxModel getFieldCurrentRegionModel(){
+ return new DefaultComboBoxModel(Common.getRegionItem());
+ }
+ protected void regionChange(){
+ String name = fieldCurrentRegion.getSelectedItem().toString();
+ setInfoText(_("isisfish.message.loading.region", name));
+ getContextValue(InputAction.class).loadRegion(name);
+ setInfoText(_("isisfish.message.load.finished"));
+ setTreeModel();
+ }
+ protected void setTreeModel(){
+ tree.setModel(getTreeModel());
+ }
+ protected DefaultTreeModel getTreeModel(){
+ String regionName = getContextValue(InputAction.class).getFisheryRegionName();
+ DefaultTreeModel treeModel = null;
+ if (regionName != null){
+ try {
+ DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(new GenericCell(regionName, null, null));
+ treeModel = new DefaultTreeModel(rootNode);
+ DefaultMutableTreeNode cellsTreeNode = new DefaultMutableTreeNode(new GenericCell("Cells", null, Cell.class));
+ DefaultMutableTreeNode zonesTreeNode = new DefaultMutableTreeNode(new GenericCell("Zones", null, Zone.class));
+ DefaultMutableTreeNode ports = new DefaultMutableTreeNode(new GenericCell("Ports", null, Port.class));
+ DefaultMutableTreeNode species = new DefaultMutableTreeNode(new GenericCell("Species", null, Species.class));
+ DefaultMutableTreeNode gears = new DefaultMutableTreeNode(new GenericCell("Gears", null, Gear.class));
+ DefaultMutableTreeNode metiers = new DefaultMutableTreeNode(new GenericCell("Metiers", null, Metier.class));
+ DefaultMutableTreeNode tripTypes = new DefaultMutableTreeNode(new GenericCell("TripTypes", null, TripType.class));
+ DefaultMutableTreeNode vesselTypes = new DefaultMutableTreeNode(new GenericCell("VesselTypes", null, VesselType.class));
+ DefaultMutableTreeNode setOfVessels = new DefaultMutableTreeNode(new GenericCell("SetOfVessels", null, SetOfVessels.class));
+ DefaultMutableTreeNode strategies = new DefaultMutableTreeNode(new GenericCell("Strategies", null, Strategy.class));
+
+ setNode(cellsTreeNode, getContextValue(InputAction.class).getFisheryRegion().getCell().toArray(), Cell.class);
+ setNode(zonesTreeNode, getContextValue(InputAction.class).getFisheryRegion().getZone().toArray(), Zone.class);
+ setNode(ports, getContextValue(InputAction.class).getFisheryRegion().getPort().toArray(), Port.class);
+ setNode(species, getContextValue(InputAction.class).getFisheryRegion().getSpecies().toArray(), Species.class);
+ setNode(gears, getContextValue(InputAction.class).getFisheryRegion().getGear().toArray(), Gear.class);
+ setNode(metiers, getContextValue(InputAction.class).getFisheryRegion().getMetier().toArray(), Metier.class);
+ setNode(tripTypes, getContextValue(InputAction.class).getFisheryRegion().getTripType().toArray(), TripType.class);
+ setNode(vesselTypes, getContextValue(InputAction.class).getFisheryRegion().getVesselType().toArray(), VesselType.class);
+ setNode(setOfVessels, getContextValue(InputAction.class).getFisheryRegion().getSetOfVessels().toArray(), SetOfVessels.class);
+ setNode(strategies, getContextValue(InputAction.class).getFisheryRegion().getStrategy().toArray(), Strategy.class);
+
+ treeModel.insertNodeInto(cellsTreeNode, rootNode, 0);
+ treeModel.insertNodeInto(zonesTreeNode, rootNode, 1);
+ treeModel.insertNodeInto(ports, rootNode, 2);
+ treeModel.insertNodeInto(species, rootNode, 3);
+ treeModel.insertNodeInto(gears, rootNode, 4);
+ treeModel.insertNodeInto(metiers, rootNode, 5);
+ treeModel.insertNodeInto(tripTypes, rootNode, 6);
+ treeModel.insertNodeInto(vesselTypes, rootNode, 7);
+ treeModel.insertNodeInto(setOfVessels, rootNode, 8);
+ treeModel.insertNodeInto(strategies, rootNode, 9);
+ } catch (Exception ex) {
+ Logger.getLogger(InputUI.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ return treeModel;
+ }
+ protected void setNode(DefaultMutableTreeNode node, Object[] values, Class type) {
+ for (Object value : values){
+ DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(new GenericCell(value.toString(), value, type));
+ node.add(childNode);
+ }
+ }
+ protected void setInfoText(String s){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText(s);
+ }
+ ]]>
</script>
-<!--
- <JMenuBar id="menu">
- <JMenu text="isisfish.input.menu.file">
- <JMenuItem text="isisfish.input.menu.importRegion" accelerator="accNew"/>
-<! - -
-ActionCommand="thread:input.Input.importRegion()"
-- - >
- <JMenuItem text="isisfish.input.menu.importRenameRegion" accelerator="accNew"/>
-<! - -
-ActionCommand="thread:input.Input.importRegionAndRename()"
-- - >
- <JMenuItem text="isisfish.input.menu.importRegionV2" accelerator="accNew"/>
-<! - -
-ActionCommand="thread:input.Input.importV2Region()"
- - - >
- <JMenuItem text="isisfish.input.menu.importRegionSimulation" accelerator="accImportFromSimulation"/>
-<! - -
-ActionCommand="thread:input.Input.importRegionFromSimulation($fieldCurrentRegion)"
-- - >
- <JMenuItem text="isisfish.input.menu.exportRegion" accelerator="accExport"/>
-<! - -
-ActionCommand="thread:input.Input.exportRegion($RegionStorage)"
-- - >
- <JMenuItem text="isisfish.input.menu.copyRegion" accelerator="accCopy"/>
-<! - -
-ActionCommand="thread:input.Input.copyRegion($RegionStorage)"
- - - >
- <JSeparator/>
- <JMenuItem name="miRemove" text="isisfish.input.menu.removeLocaly" accelerator="accRemove"/>
-<! - -
-ActionCommand="thread:input.Input.removeRegion($RegionStorage, 'false')"
-- - >
- <JSeparator/>
- <JMenuItem name="miClose" text="isisfish.input.menu.close" accelerator="accOpen"/>
-<! - -
-ActionCommand="close"
-- - >
- </JMenu>
- <JMenu text="isisfish.input.menu.server">
- <JMenuItem text="isisfish.input.menu.addRegion" accelerator="accAdd"/>
-<! - -
-ActionCommand="thread:input.Input.commitRegionInCVS($RegionStorage)"
-- - >
- <JMenuItem text="isisfish.input.menu.commit" accelerator="accCommitVCS"/>
-<! - -
-ActionCommand="thread:input.Input.commitRegionInCVS($RegionStorage)"
-- - >
- <JSeparator/>
- <JMenuItem name="miRemove" text="isisfish.input.menu.removeLocalyRemotely" accelerator="accRemove"/>
-<! - -
-ActionCommand="thread:input.Input.removeRegion($RegionStorage, 'true')"
-- - >
- </JMenu>
- <JMenu text="isisfish.input.menu.help">
- <JMenuItem name="miAbout" text="isisfish.input.menu.about" accelerator="accAbout"/>
- </JMenu>
- </JMenuBar>
--->
<JSplitPane oneTouchExpandable="true" dividerLocation="200" orientation="HORIZONTAL">
<JPanel layout='{new BorderLayout()}'>
<Table constraints='BorderLayout.NORTH'>
@@ -113,7 +186,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldCurrentRegion"/>
+ <JComboBox id="fieldCurrentRegion" model='{getFieldCurrentRegionModel()}' onActionPerformed='regionChange()'/>
<!--
model='{new DefaultComboBoxModel(getContextValue(InputAction.class).getCurrentRegionItem())}'
@@ -128,7 +201,7 @@
</Table>
<JPanel id="treePanel" name="treePanel" layout='{new BorderLayout()}'>
<JScrollPane constraints='BorderLayout.CENTER'>
- <JTree id="tree" name="tree">
+ <JTree id="tree" name="tree" model='{getTreeModel()}'/>
<!-- Fixme : NestedTreeModel
<NestedTreeModel id="treeModel">
<TreeNode id="rootTreeNode" origin="$FisheryRegion">
@@ -185,25 +258,23 @@
entityRemoved="input.Input.updateTreeEntityRemoved($tree, $treeModel, $e/initialEvent)"/>
-->
- </JTree>
</JScrollPane>
</JPanel>
</JPanel>
- <JPanel id="inputPane" layout='{new BorderLayout()}'>
-
-<!-- Fixme : CardLayout
-layout='{new Cardlayout()}'
--->
-<!--
- <JLabel horizontalAlignment="0" text="isisfish.input.selectNodeTree" constraints='BorderLayout.CENTER'/>
--->
- <PopulationTabUI/>
+ <JPanel id="inputPane" layout='{new CardLayout()}'>
+ <JLabel horizontalAlignment="0" text="isisfish.input.selectNodeTree" constraints='"none"'/>
+ <CellUI id='cellUI' constraints='"Cell"' constructorParams='getContextValue(InputAction.class)'/>
+ <ZoneUI id='zoneUI' constraints='"Zone"' constructorParams='getContextValue(InputAction.class)'/>
+ <PortUI id='portUI' constraints='"Port"' constructorParams='getContextValue(InputAction.class)'/>
+ <SpeciesUI id='speciesUI' constraints='"Species"' constructorParams='getContextValue(InputAction.class)'/>
+ <GearUI id='gearUI' constraints='"Gear"' constructorParams='getContextValue(InputAction.class)'/>
+ <MetierUI id='metierUI' constraints='"Metier"' constructorParams='getContextValue(InputAction.class)'/>
+ <TripTypeUI id='tripTypeUI' constraints='"TripType"' constructorParams='getContextValue(InputAction.class)'/>
+ <VesselTypeUI id='vesselTypeUI' constraints='"VesselType"' constructorParams='getContextValue(InputAction.class)'/>
+ <SetOfVesselsUI id='setOfVesselsUI' constraints='"SetOfVessels"' constructorParams='getContextValue(InputAction.class)'/>
+ <StrategyUI id='strategyUI' constraints='"Strategy"' constructorParams='getContextValue(InputAction.class)'/>
+ </JPanel>
-
-
-
-
- </JPanel>
</JSplitPane>
<!--
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -30,18 +30,103 @@
* by : $Author: sletellier $
*/
-->
- <!--
- + Metier
- +-->
-<JPanel layout='{new BorderLayout()}'>
- <JTabbedPane id="MetierTab" name="Metier" constraints='BorderLayout.CENTER'>
- <tab title='{_("isisfish.metier.title")}'><MetierUI/></tab>
- <tab title='{_("isisfish.metierSeasonInfoZone.title")}'><MetierSeasonInfoZoneUI/></tab>
- <tab title='{_("isisfish.metierSeasonInfoSpecies.title")}'><MetierSeasonInfoSpeciesUI/></tab>
- </JTabbedPane>
- <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueTripTypes"/>
+<Table>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.metier.name"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldMetierName"/>
+<!-- Fixme : DocumentEvents
+ origin="$Metier/name"
+<DocumentEvents onModified="Update($fieldMetierName/text)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.common.gear"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldMetierGear"/>
+<!-- Fixme : ComboBoxModel
+origin="$Metier/gear" renderer="name" firstNull="true"
+actionCommand="update($fieldMetierGear/selectedItem, $Metier/gear)"
+<ComboBoxModel origin="$FisheryRegion/gear"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.metier.rangeValues"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldMetierParam"/>
+<!-- Fixme : DocumentEvents
+origin="$Metier/gearParameterValue"
+<DocumentEvents onModified="Update($fieldMetierParam/text)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.metier.comments"/>
+ </cell>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
+ <JTextArea id="fieldMetierComment">
+<!-- Fixme : DocumentEvents
+ origin="$Metier/comment"
+<DocumentEvents onModified="Update($fieldMetierComment/text)"/>
+-->
+ </JTextArea>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell fill='both' weightx='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.new"/>
<!--
- actionCommand="UIHelper.setTreeSelection('TripTypes')"
+origin="$FisheryRegion"
+actionCommand='input.Input.create("Metier")'
-->
-</JPanel>
\ No newline at end of file
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.save"/>
+<!--
+origin="$EntityModified"
+actionCommand='input.Input.save("Metier", $Metier);refreshView($inputMetier)'
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.cancel"/>
+<!--
+origin="$EntityModified"
+actionCommand='input.Input.cancel("Metier", $Metier);refreshView($inputMetier)'
+-->
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.remove"/>
+<!--
+origin="$Metier"
+actionCommand="input.Input.remove($Metier)"
+-->
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+</Table>
+
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -1,3 +1,4 @@
+
<!--
/* *##%
* Copyright (C) 2005
@@ -30,103 +31,25 @@
* by : $Author: sletellier $
*/
-->
+ <!--
+ + Metier
+ +-->
+<JPanel layout='{new BorderLayout()}'>
+ <script><![CDATA[
+ public MetierUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ }
+ ]]></script>
+ <JTabbedPane id="MetierTab" name="Metier" constraints='BorderLayout.CENTER'>
+ <tab title='{_("isisfish.metier.title")}'><MetierTabUI/></tab>
+ <tab title='{_("isisfish.metierSeasonInfoZone.title")}'><MetierSeasonInfoZoneUI/></tab>
+ <tab title='{_("isisfish.metierSeasonInfoSpecies.title")}'><MetierSeasonInfoSpeciesUI/></tab>
-<Table>
- <row>
- <cell fill='both' weightx='1.0' weighty='1.0'>
- <Table>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.metier.name"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldMetierName"/>
-<!-- Fixme : DocumentEvents
- origin="$Metier/name"
-<DocumentEvents onModified="Update($fieldMetierName/text)"/>
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.common.gear"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldMetierGear"/>
-<!-- Fixme : ComboBoxModel
-origin="$Metier/gear" renderer="name" firstNull="true"
-actionCommand="update($fieldMetierGear/selectedItem, $Metier/gear)"
-<ComboBoxModel origin="$FisheryRegion/gear"/>
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.metier.rangeValues"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldMetierParam"/>
-<!-- Fixme : DocumentEvents
-origin="$Metier/gearParameterValue"
-<DocumentEvents onModified="Update($fieldMetierParam/text)"/>
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.metier.comments"/>
- </cell>
- <cell fill='both' weightx='1.0' weighty='1.0'>
- <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JTextArea id="fieldMetierComment">
-<!-- Fixme : DocumentEvents
- origin="$Metier/comment"
-<DocumentEvents onModified="Update($fieldMetierComment/text)"/>
--->
- </JTextArea>
- </JScrollPane>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell fill='both' weightx='1.0'>
- <Table>
- <row>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.new"/>
+ </JTabbedPane>
+ <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueTripTypes"/>
<!--
-origin="$FisheryRegion"
-actionCommand='input.Input.create("Metier")'
+ actionCommand="UIHelper.setTreeSelection('TripTypes')"
-->
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.save"/>
-<!--
-origin="$EntityModified"
-actionCommand='input.Input.save("Metier", $Metier);refreshView($inputMetier)'
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.cancel"/>
-<!--
-origin="$EntityModified"
-actionCommand='input.Input.cancel("Metier", $Metier);refreshView($inputMetier)'
--->
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.remove"/>
-<!--
-origin="$Metier"
-actionCommand="input.Input.remove($Metier)"
--->
- </cell>
- </row>
- </Table>
- </cell>
- </row>
-</Table>
-
+</JPanel>
\ No newline at end of file
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationTabUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationTabUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -1,69 +0,0 @@
-<!--
-/* *##%
- * Copyright (C) 2005
- * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * 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 $
- */
- -->
-
-
- <!--
- + Population
- +-->
-<JPanel layout='{new BorderLayout()}'>
- <JTabbedPane id="PopulationTab" name="Populations" constraints='BorderLayout.CENTER'>
- <tab title='{_("isisfish.populationBasics.title")}'>
- <PopulationBasicsUI/>
- </tab>
- <tab title='{_("isisfish.populationGroup.title")}'>
- <PopulationGroupUI/>
- </tab>
- <tab title='{_("isisfish.populationEquation.title")}'>
- <PopulationEquationUI/>
- </tab>
- <tab title='{_("isisfish.populationZones.title")}'>
- <PopulationZonesUI/>
- </tab>
- <tab title='{_("isisfish.populationSeasons.title")}'>
- <PopulationSeasonsUI/>
- </tab>
- <tab title='{_("isisfish.populationCapturability.title")}'>
- <PopulationCapturabilityUI/>
- </tab>
- <tab title='{_("isisfish.populationRecruitment.title")}'>
- <PopulationRecruitmentUI/>
- </tab>
- <tab title='{_("isisfish.populationMigration.title")}'>
- <PopulationMigrationUI/>
- </tab>
- </JTabbedPane>
- <JButton text="isisfish.input.continueGears" constraints='BorderLayout.SOUTH'/>
-<!--
- actionCommand="UIHelper.setTreeSelection('Gears')"
--->
-</JPanel>
\ No newline at end of file
Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx (from rev 1562, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationTabUI.jaxx)
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -0,0 +1,69 @@
+<!--
+/* *##%
+ * Copyright (C) 2005
+ * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * 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 $
+ */
+ -->
+
+
+ <!--
+ + Population
+ +-->
+<JPanel layout='{new BorderLayout()}'>
+ <JTabbedPane id="PopulationTab" name="Populations" constraints='BorderLayout.CENTER'>
+ <tab title='{_("isisfish.populationBasics.title")}'>
+ <PopulationBasicsUI/>
+ </tab>
+ <tab title='{_("isisfish.populationGroup.title")}'>
+ <PopulationGroupUI/>
+ </tab>
+ <tab title='{_("isisfish.populationEquation.title")}'>
+ <PopulationEquationUI/>
+ </tab>
+ <tab title='{_("isisfish.populationZones.title")}'>
+ <PopulationZonesUI/>
+ </tab>
+ <tab title='{_("isisfish.populationSeasons.title")}'>
+ <PopulationSeasonsUI/>
+ </tab>
+ <tab title='{_("isisfish.populationCapturability.title")}'>
+ <PopulationCapturabilityUI/>
+ </tab>
+ <tab title='{_("isisfish.populationRecruitment.title")}'>
+ <PopulationRecruitmentUI/>
+ </tab>
+ <tab title='{_("isisfish.populationMigration.title")}'>
+ <PopulationMigrationUI/>
+ </tab>
+ </JTabbedPane>
+ <JButton text="isisfish.input.continueGears" constraints='BorderLayout.SOUTH'/>
+<!--
+ actionCommand="UIHelper.setTreeSelection('Gears')"
+-->
+</JPanel>
\ No newline at end of file
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -35,84 +35,125 @@
<!--
+ Port
+-->
-<JPanel layout='{new BorderLayout()}'>
- <JSplitPane id="PortTab" name="Ports"
- oneTouchExpandable="true" dividerLocation="270" orientation="VERTICAL">
- <JPanel name="isisfish.port.title">
-
-<!-- ContextDataSource
- <ContextDataSource id="Port" context="current" source="Port"/>
--->
- <JLabel text="isisfish.port.name"/>
- <JTextField id="fieldPortName">
+<Table>
+ <script><![CDATA[
+ public PortUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ }
+ ]]>
+ </script>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <JSplitPane id="PortTab" name="Ports"
+ oneTouchExpandable="true" dividerLocation="270" orientation="horizontal">
+ <Table>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0' >
+ <JLabel text="isisfish.port.name"/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0' >
+ <JTextField id="fieldPortName"/>
<!-- Fixme : DocumentEvents
origin="$Port/name"
<DocumentEvents onModified="Update($fieldPortName/text)"/>
-->
- </JTextField>
- <JLabel text="isisfish.port.cell"/>
- <JScrollPane>
- <JList id="portCell">
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0' >
+ <JLabel text="isisfish.port.cell"/>
+
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weighty='0.7' weightx='1.0'>
+ <JScrollPane>
+ <JList id="portCell"/>
<!-- Fixme : ListModel
SelectionMode="0" renderer="name"
origin="getCell($Port)"
<ListModel origin="$FisheryRegion/cell"/>
<ListSelectionEvents onValueChanged="Update($portCell/selectedValue, $Port/cell, refreshView($portMap))"/>
-->
- </JList>
- </JScrollPane>
- <JLabel text="isisfish.port.comments"/>
- <JScrollPane>
- <JTextArea id="fieldPortComment">
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JLabel text="isisfish.port.comments"/>
+
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weighty='0.3' weightx='1.0' >
+ <JScrollPane>
+ <JTextArea id="fieldPortComment"/>
<!-- Fixme : DocumentEvents
origin="$Port/comment"
<DocumentEvents onModified="Update($fieldPortComment/text)"/>
-->
- </JTextArea>
- </JScrollPane>
- <JPanel id="panelPortButtonAction">
- <JButton text="isisfish.common.new"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.save"/>
<!--
-origin="$FisheryRegion"
- actionCommand='input.Input.create("Port")'
--->
- <JButton text="isisfish.common.save"/>
-<!--
origin="$EntityModified"
actionCommand='input.Input.save("Port", $Port);refreshView($inputPort)'
-->
- <JButton text="isisfish.common.cancel"/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.cancel"/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("Port", $Port);refreshView($inputPort)'
-->
- <JButton text="isisfish.common.remove"/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.new"/>
<!--
+origin="$FisheryRegion"
+ actionCommand='input.Input.create("Port")'
+-->
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.remove"/>
+<!--
origin="$Port"
actionCommand="input.Input.remove($Port)"
-->
- </JPanel>
- </JPanel>
-
+ </cell>
+ </row>
+ </Table>
+ <JPanel id="portMapPanel" layout='{new BorderLayout()}'>
+ <!-- Fixme : OpenMapToolPanel, OpenMap
+ <OpenMapToolPanel constraints='"BorderLayout.NORTH"' id="portMapTool">
+ <OpenMapToolSet id="portMapToolSet" origin="$portMap"/>
+ </OpenMapToolPanel>
+ <OpenMap id="portMap" origin="$FisheryRegion" selected="$Port/cell"
+ selectionMode="1">
+ <OpenMapEvents id="portMapEvents" mouseMode="Select"
+ onMouseClicked="Update($portMap/selectedCells[1], $Port/cell, refreshView($portCell))"/>
+ </OpenMap>
+ -->
+ </JPanel>
+ </JSplitPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton text="isisfish.input.continueSpecies"/>
<!--
-
- <xpanel xml="input/Port.xml" id="inputPort"/>
--->
- <JPanel id="portMapPanel" layout='{new BorderLayout()}'>
-<!-- Fixme : OpenMapToolPanel, OpenMap
- <OpenMapToolPanel constraints='"BorderLayout.NORTH"' id="portMapTool">
- <OpenMapToolSet id="portMapToolSet" origin="$portMap"/>
- </OpenMapToolPanel>
- <OpenMap id="portMap" origin="$FisheryRegion" selected="$Port/cell"
- selectionMode="1">
- <OpenMapEvents id="portMapEvents" mouseMode="Select"
- onMouseClicked="Update($portMap/selectedCells[1], $Port/cell, refreshView($portCell))"/>
- </OpenMap>
--->
- </JPanel>
- </JSplitPane>
- <JButton text="isisfish.input.continueSpecies"/>
-<!--
actionCommand="UIHelper.setTreeSelection('Species')"
-->
-</JPanel>
\ No newline at end of file
+ </cell>
+ </row>
+</Table>
+
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -31,24 +31,183 @@
*/
-->
+<Table>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <Table>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.name"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldSetOfVesselsName"/>
+<!-- Fixmee : DocumentEvents
+ origin="$SetOfVessels/name"
+<DocumentEvents onModified="Update($fieldSetOfVesselsName/text)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.common.port"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldSetOfVesselsPort"/>
+<!-- Fixme : ComboBoxModel
+ origin="$SetOfVessels/port" renderer="name" firstNull="true"
+ actionCommand="update($fieldSetOfVesselsPort/selectedItem, $SetOfVessels/port)"
+ <ComboBoxModel origin="$FisheryRegion/port"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.vesselType"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldSetOfVesselsVesselType"/>
+<!-- Fixme : ComboBoxModel
+ origin="$SetOfVessels/vesselType" renderer="name" firstNull="true"
+ actionCommand="update($fieldSetOfVesselsVesselType/selectedItem, $SetOfVessels/vesselType)"
+<ComboBoxModel origin="$FisheryRegion/vesselType"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.numberOfVessels"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldSetOfVesselsNumberOfVessels"/>
- <!--
- + SetOfVessels
- +-->
-<JPanel layout='{new BorderLayout()}'>
- <JTabbedPane id="SetOfVesselsTab" name="SetOfVessels" constraints='BorderLayout.CENTER'>
- <tab title='{_("isisfish.setOfVessels.title")}'><SetOfVesselsUI/></tab>
- <tab title='{_("isisfish.effortDescription.title")}'><EffortDescriptionUI/></tab>
<!--
-isisfish.setOfVessels.title
-isisfish.effortDescription.title
- <xpanel xml="input/SetOfVessels.xml" id="inputSetOfVessels"/>
- <xpanel xml="input/EffortDescription.xml" id="inputEffortDescription"/>
+ origin="$SetOfVessels/numberOfVessels"
+ <DocumentEvents onModified="Update($fieldSetOfVesselsNumberOfVessels/text)"/>
-->
- </JTabbedPane>
- <JButton text="isisfish.input.continueStrategies" constraints='BorderLayout.SOUTH'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.fixedCosts"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldSetOfVesselsFixedCosts"/>
+
<!--
-
- actionCommand="UIHelper.setTreeSelection('Strategies')"
+ origin="$SetOfVessels/fixedCosts"
+<DocumentEvents onModified="Update($fieldSetOfVesselsFixedCosts/text)"/>
-->
-</JPanel>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.technicalEfficiency"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldSetOfVesselsTechnicalEfficiency"/>
+
+<!--
+ origin="$SetOfVessels/technicalEfficiencyEquation" renderer="name" firstNull="true"
+ actionCommand="Update($fieldSetOfVesselsTechnicalEfficiency/selectedItem/content, $fieldScriptSetOfVesselsTechnicalEfficiency/text)"
+<ComboBoxModel origin='fr.ifremer.isisfish.datastore.FormuleStorage.getFormules($TopiaContext, "TechnicalEfficiency")'/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='both' weighty='0.7'>
+ <Table>
+ <row>
+ <cell fill='horizontal'>
+ <JButton text="isisfish.common.saveModel"/>
+<!--
+ actionCommand='input.Input.saveEquationAsModel($SetOfVessels/technicalEfficiencyEquation);refreshView($fieldSetOfVesselsTechnicalEfficiency)'
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal'>
+ <JButton text="isisfish.common.openEditor"/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <JPanel/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ <cell fill='both' weightx='1.0' weighty='0.7'>
+ <JPanel/>
+ <!-- Fixme : editor
+ actionCommand='input.Input.openEditor($SetOfVessels/technicalEfficiencyEquation/category,$SetOfVessels/technicalEfficiencyEquation/name,$SetOfVessels/technicalEfficiencyEquation/javaInterface,$SetOfVessels/technicalEfficiencyEquation/content,$fieldScriptSetOfVesselsTechnicalEfficiency)'
+ <editor constraints="fieldScriptSetOfVesselsTechnicalEfficiency" askIfNotSaved="false"
+ id="fieldScriptSetOfVesselsTechnicalEfficiency"
+ origin="org.codelutin.util.FileUtil.getTempFile($SetOfVessels/technicalEfficiencyEquation/content, '.java')">
+ <DocumentEvents onModified="Update">
+ <UpdateOrigin
+ target="setEquationTechnicalEfficiency($SetOfVessels, $fieldScriptSetOfVesselsTechnicalEfficiency/text)"/>
+ </DocumentEvents>
+ </editor>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.comments"/>
+ </cell>
+ <cell fill='both' weightx='1.0' weighty='0.3'>
+ <JScrollPane>
+ <JTextArea id="fieldSetOfVesselsComment">
+
+<!-- Fixme : DocumentEvents
+ origin="$SetOfVessels/comment"
+<DocumentEvents onModified="Update($fieldSetOfVesselsComment/text)"/>
+-->
+ </JTextArea>
+<!--
+-->
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton text="isisfish.common.new"/>
+<!--
+ origin="$FisheryRegion"
+ actionCommand='input.Input.create("SetOfVessels")'
+-->
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton text="isisfish.common.save"/>
+<!--
+origin="$EntityModified"
+ actionCommand='input.Input.save("SetOfVessels", $SetOfVessels);refreshView($inputSetOfVessels)'
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton text="isisfish.common.cancel"/>
+<!--
+ origin="$EntityModified"
+ actionCommand='input.Input.cancel("SetOfVessels", $SetOfVessels);refreshView($inputSetOfVessels)'
+-->
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton text="isisfish.common.remove"/>
+<!--
+ origin="$SetOfVessels"
+ actionCommand="input.Input.remove($SetOfVessels)"
+-->
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -31,183 +31,31 @@
*/
-->
-<Table>
- <row>
- <cell fill='both' weightx='1.0' weighty='1.0'>
- <Table>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.name"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldSetOfVesselsName"/>
-<!-- Fixmee : DocumentEvents
- origin="$SetOfVessels/name"
-<DocumentEvents onModified="Update($fieldSetOfVesselsName/text)"/>
--->
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.common.port"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldSetOfVesselsPort"/>
-<!-- Fixme : ComboBoxModel
- origin="$SetOfVessels/port" renderer="name" firstNull="true"
- actionCommand="update($fieldSetOfVesselsPort/selectedItem, $SetOfVessels/port)"
- <ComboBoxModel origin="$FisheryRegion/port"/>
--->
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.vesselType"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldSetOfVesselsVesselType"/>
-<!-- Fixme : ComboBoxModel
- origin="$SetOfVessels/vesselType" renderer="name" firstNull="true"
- actionCommand="update($fieldSetOfVesselsVesselType/selectedItem, $SetOfVessels/vesselType)"
-<ComboBoxModel origin="$FisheryRegion/vesselType"/>
--->
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.numberOfVessels"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldSetOfVesselsNumberOfVessels"/>
+ <!--
+ + SetOfVessels
+ +-->
+<JPanel layout='{new BorderLayout()}'>
+ <script><![CDATA[
+ public SetOfVesselsUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ }
+ ]]></script>
+ <JTabbedPane id="SetOfVesselsTab" name="SetOfVessels" constraints='BorderLayout.CENTER'>
+ <tab title='{_("isisfish.setOfVessels.title")}'><SetOfVesselsTabsUI/></tab>
+ <tab title='{_("isisfish.effortDescription.title")}'><EffortDescriptionUI/></tab>
<!--
- origin="$SetOfVessels/numberOfVessels"
- <DocumentEvents onModified="Update($fieldSetOfVesselsNumberOfVessels/text)"/>
+isisfish.setOfVessels.title
+isisfish.effortDescription.title
+ <xpanel xml="input/SetOfVessels.xml" id="inputSetOfVessels"/>
+ <xpanel xml="input/EffortDescription.xml" id="inputEffortDescription"/>
-->
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.fixedCosts"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldSetOfVesselsFixedCosts"/>
-
+ </JTabbedPane>
+ <JButton text="isisfish.input.continueStrategies" constraints='BorderLayout.SOUTH'/>
<!--
- origin="$SetOfVessels/fixedCosts"
-<DocumentEvents onModified="Update($fieldSetOfVesselsFixedCosts/text)"/>
+
+ actionCommand="UIHelper.setTreeSelection('Strategies')"
-->
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.technicalEfficiency"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldSetOfVesselsTechnicalEfficiency"/>
-
-<!--
- origin="$SetOfVessels/technicalEfficiencyEquation" renderer="name" firstNull="true"
- actionCommand="Update($fieldSetOfVesselsTechnicalEfficiency/selectedItem/content, $fieldScriptSetOfVesselsTechnicalEfficiency/text)"
-<ComboBoxModel origin='fr.ifremer.isisfish.datastore.FormuleStorage.getFormules($TopiaContext, "TechnicalEfficiency")'/>
--->
- </cell>
- </row>
- <row>
- <cell fill='both' weighty='0.7'>
- <Table>
- <row>
- <cell fill='horizontal'>
- <JButton text="isisfish.common.saveModel"/>
-<!--
- actionCommand='input.Input.saveEquationAsModel($SetOfVessels/technicalEfficiencyEquation);refreshView($fieldSetOfVesselsTechnicalEfficiency)'
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal'>
- <JButton text="isisfish.common.openEditor"/>
- </cell>
- </row>
- <row>
- <cell fill='both' weightx='1.0' weighty='1.0'>
- <JPanel/>
- </cell>
- </row>
- </Table>
- </cell>
- <cell fill='both' weightx='1.0' weighty='0.7'>
- <JPanel/>
- <!-- Fixme : editor
- actionCommand='input.Input.openEditor($SetOfVessels/technicalEfficiencyEquation/category,$SetOfVessels/technicalEfficiencyEquation/name,$SetOfVessels/technicalEfficiencyEquation/javaInterface,$SetOfVessels/technicalEfficiencyEquation/content,$fieldScriptSetOfVesselsTechnicalEfficiency)'
- <editor constraints="fieldScriptSetOfVesselsTechnicalEfficiency" askIfNotSaved="false"
- id="fieldScriptSetOfVesselsTechnicalEfficiency"
- origin="org.codelutin.util.FileUtil.getTempFile($SetOfVessels/technicalEfficiencyEquation/content, '.java')">
- <DocumentEvents onModified="Update">
- <UpdateOrigin
- target="setEquationTechnicalEfficiency($SetOfVessels, $fieldScriptSetOfVesselsTechnicalEfficiency/text)"/>
- </DocumentEvents>
- </editor>
--->
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.comments"/>
- </cell>
- <cell fill='both' weightx='1.0' weighty='0.3'>
- <JScrollPane>
- <JTextArea id="fieldSetOfVesselsComment">
-
-<!-- Fixme : DocumentEvents
- origin="$SetOfVessels/comment"
-<DocumentEvents onModified="Update($fieldSetOfVesselsComment/text)"/>
--->
- </JTextArea>
-<!--
--->
- </JScrollPane>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <Table>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.common.new"/>
-<!--
- origin="$FisheryRegion"
- actionCommand='input.Input.create("SetOfVessels")'
--->
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.common.save"/>
-<!--
-origin="$EntityModified"
- actionCommand='input.Input.save("SetOfVessels", $SetOfVessels);refreshView($inputSetOfVessels)'
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.common.cancel"/>
-<!--
- origin="$EntityModified"
- actionCommand='input.Input.cancel("SetOfVessels", $SetOfVessels);refreshView($inputSetOfVessels)'
--->
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.common.remove"/>
-<!--
- origin="$SetOfVessels"
- actionCommand="input.Input.remove($SetOfVessels)"
--->
- </cell>
- </row>
- </Table>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+</JPanel>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -35,48 +35,79 @@
<!--
+ Species
+-->
-<JPanel id="SpeciesTab" layout='{new BorderLayout()}'>
- <JPanel name="isisfish.species.title" constraints='"inputSpecies"'
- layout='{new XMLGridLayout("fr/ifremer/isisfish/ui/input/Species.xgl")}'>
- <script>
- import org.codelutin.widget.XMLGridLayout;
- </script>
-
-<!-- Fixme : ContextDataSource
- <ContextDataSource id="Species" context="current" source="Species"/>
--->
- <JLabel constraints='"labelSpeciesName"' text="isisfish.species.name"/>
- <JTextField constraints='"fieldSpeciesName"' id="fieldSpeciesName">
+<Table>
+ <script><![CDATA[
+ public SpeciesUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ }
+ ]]>
+ </script>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <Table>
+ <row>
+ <cell>
+ <JLabel text="isisfish.species.name"/>
+
+ </cell>
+ <cell fill='horizontal' columns='2' weightx='1.0'>
+ <JTextField id="fieldSpeciesName"/>
<!-- Fixme : DocumentEvents
origin="$Species/name"
<DocumentEvents onModified="Update($fieldSpeciesName/text)"/>
-->
- </JTextField>
- <JLabel constraints='"labelSpeciesScientificName"' text="isisfish.species.scientificName"/>
- <JTextField constraints='"fieldSpeciesScientificName"' id="fieldSpeciesScientificName">
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.species.scientificName"/>
+
+ </cell>
+ <cell fill='horizontal' columns='2' weightx='1.0'>
+ <JTextField id="fieldSpeciesScientificName"/>
<!-- Fixme : DocumentEvents
origin="$Species/scientificName"
<DocumentEvents onModified="Update($fieldSpeciesScientificName/text)"/>
-->
- </JTextField>
- <JLabel constraints='"labelSpeciesCodeRubbin"' text="isisfish.species.rubbinCode"/>
- <JTextField constraints='"fieldSpeciesCodeRubbin"' id="fieldSpeciesCodeRubbin">
+ </cell>
+ </row>
+ <row>
+ <cell>
+
+ <JLabel text="isisfish.species.rubbinCode"/>
+
+ </cell>
+ <cell fill='horizontal' columns='2' weightx='1.0'>
+ <JTextField id="fieldSpeciesCodeRubbin"/>
<!-- Fixme : DocumentEvents
origin="$Species/codeRubbin"
<DocumentEvents onModified="Update($fieldSpeciesCodeRubbin/text)"/>
-->
- </JTextField>
- <JLabel constraints='"labelSpeciesCEE"' text="isisfish.species.cee"/>
- <JTextField constraints="fieldSpeciesCEE" id="fieldSpeciesCEE">
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.species.cee"/>
+
+ </cell>
+ <cell fill='horizontal' columns='2' weightx='1.0'>
+ <JTextField id="fieldSpeciesCEE"/>
<!--
origin="$Species/codeCEE"
<DocumentEvents onModified="Update($fieldSpeciesCEE/text)"/>
-->
- </JTextField>
- <JLabel constraints='"labelSpeciesDynamic"' text="isisfish.species.structured"/>
- <JPanel constraints='"panelFieldSpeciesDynamic"' layout='{new XMLGridLayout("fr/ifremer/isisfish/ui/input/Species.xgl")}'>
- <JRadioButton constraints='"fieldSpeciesDynamicAge"' id="fieldSpeciesDynamicAge"
- text="isisfish.species.age" buttonGroup="structuredGroup"/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.species.structured"/>
+
+
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JRadioButton id="fieldSpeciesDynamicAge" text="isisfish.species.age" buttonGroup="structuredGroup"/>
<!--
origin="$Species/ageGroupType"
actionCommand="Update($fieldSpeciesDynamicAge/selected)"
@@ -85,8 +116,9 @@
<ItemEvents onStateChanged="Update($fieldSpeciesDynamicAge/selected)"/>
</radioButton>
-->
- <JRadioButton constraints='"fieldSpeciesDynamicLength"' id="fieldSpeciesDynamicLength"
- text="isisfish.species.length" buttonGroup="structuredGroup"/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JRadioButton id="fieldSpeciesDynamicLength" text="isisfish.species.length" buttonGroup="structuredGroup"/>
<!--
origin="not(getAgeGroupType($Species))"
actionCommand="Update($fieldSpeciesDynamicAge/selected, $Species/ageGroupType)"
@@ -95,47 +127,77 @@
<ItemEvents onStateChanged="Update($fieldSpeciesDynamicAge/selected, $Species/ageGroupType)"/>
</radioButton>
-->
- </JPanel>
- <JLabel constraints='"labelSpeciesComment"' text="isisfish.species.comments"/>
- <JScrollPane constraints='"fieldSpeciesComment"'>
- <JTextArea id="fieldSpeciesComment">
-<!-- Fixme : DocumentEvents
- origin="$Species/comment"
-<DocumentEvents onModified="Update($fieldSpeciesComment/text)"/>
-<DocumentEvents onModified="Update($fieldSpeciesComment/text)"/>
--->
- </JTextArea>
- </JScrollPane>
- <JPanel id="panelSpeciesButtonAction" constraints='"panelSpeciesButtonAction"'
- layout='{new XMLGridLayout("fr/ifremer/isisfish/ui/input/ActionButton.xgl")}'>
- <JButton constraints='"buttonCreate"' text="isisfish.common.new"/>
+
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.species.comments"/>
+
+ </cell>
+ <cell fill='both' columns='2' weightx='1.0' weighty='1.0'>
+ <JScrollPane>
+ <JTextArea id="fieldSpeciesComment"/>
+ <!-- Fixme : DocumentEvents
+ origin="$Species/comment"
+ <DocumentEvents onModified="Update($fieldSpeciesComment/text)"/>
+ <DocumentEvents onModified="Update($fieldSpeciesComment/text)"/>
+ -->
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+
+
+ <JButton text="isisfish.common.save"/>
<!--
- origin="$FisheryRegion"
- actionCommand='input.Input.create("Species")'
--->
- <JButton constraints='"buttonSave"' text="isisfish.common.save"/>
-<!--
origin="$EntityModified"
actionCommand='input.Input.save("Species", $Species);refreshView($inputSpecies)'
-->
- <JButton constraints='"buttonCancel"' text="isisfish.common.cancel"/>
+
+
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.cancel"/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("Species", $Species);refreshView($inputSpecies)'
-->
- <JButton constraints='"buttonRemove"' text="isisfish.common.remove"/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.new"/>
<!--
+ origin="$FisheryRegion"
+ actionCommand='input.Input.create("Species")'
+-->
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.remove"/>
+<!--
origin="$Species"
actionCommand="input.Input.remove($Species)"
-->
- </JPanel>
- </JPanel>
-
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JButton text="isisfish.input.continuePopulations"/>
<!--
-<xpanel id="inputSpecies" name="Species" xml="input/Species.xml"/>
--->
- <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continuePopulations"/>
-<!--
actionCommand="UIHelper.setTreeSelectionFirstChild($Species)"
-->
-</JPanel>
+
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+</Table>
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 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -31,17 +31,167 @@
*/
-->
- <!--
- + Strategy
- +-->
-<JTabbedPane id="StrategyTab" name="Strategy" >
-
- <tab title='{_("isisfish.strategy.title")}'><StrategyUI/></tab>
- <tab title='{_("isisfish.strategyMonthInfo.title")}'><StrategyMonthInfoUI/></tab>
+<Table>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <Table>
+ <row>
+ <cell anchor='west'>
+ <JLabel text="isisfish.strategy.name"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldStrategyName"/>
+<!-- Fixme : DocumentEvents
+ origin="$Strategy/name"
+<DocumentEvents onModified="Update($fieldStrategyName/text)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell anchor='west'>
+ <JLabel text="isisfish.common.setOfVessels"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldStrategySetOfVessels"/>
+<!-- Fixme : ComboBoxModel
+origin="$Strategy/setOfVessels" renderer="name" firstNull="true"
+ actionCommand="update($fieldStrategySetOfVessels/selectedItem, $Strategy/setOfVessels)"
+<ComboBoxModel origin="$FisheryRegion/setOfVessels"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell anchor='west'>
+ <JLabel text="isisfish.strategy.proportionSetOfVessels"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldStrategyProportionSetOfVessels"/>
+<!-- Fixme : DocumentEvents
+origin="$Strategy/proportionSetOfVessels"
+<DocumentEvents onModified="Update($fieldStrategyProportionSetOfVessels/text)"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JPanel/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JCheckBox id="fieldUseEquationInactivity"/>
+<!-- Fixme : ItemEvents
+ origin="$Strategy/inactivityEquationUsed" text="isisfish.strategy.inactivityEquationUsed"
+<ItemEvents onStateChanged="Update($fieldUseEquationInactivity/selected, $Strategy/inactivityEquationUsed, refreshView($hideablePanelInactivityEquation))"/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell anchor='west'>
+ <JLabel text="isisfish.strategy.inactivity"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldStrategyInactivity"/>
+<!--
+ actionCommand="Update($fieldStrategyInactivity/selectedItem/content, $fieldScriptStrategyInactivity/text)">
+ <ComboBoxModel origin='fr.ifremer.isisfish.datastore.FormuleStorage.getFormules($TopiaContext, "Inactivity")'/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='both' weighty='0.7'>
+ <Table>
+ <row>
+ <cell fill='horizontal'>
+ <JButton text="isisfish.common.saveModel"/>
<!--
-isisfish.strategy.title
-isisfish.strategyMonthInfo.title
- <xpanel xml="input/Strategy.xml" id="inputStrategy"/>
- <xpanel xml="input/StrategyMonthInfo.xml" id="inputStrategyMonthInfo"/>
+ actionCommand='input.Input.saveEquationAsModel($Strategy/inactivityEquation);refreshView($fieldStrategyInactivity)'/>
-->
-</JTabbedPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal'>
+ <JButton text="isisfish.common.openEditor"/>
+<!--
+actionCommand='input.Input.openEditor($Strategy/inactivityEquation/category,$Strategy/inactivityEquation/name,$Strategy/inactivityEquation/javaInterface,$Strategy/inactivityEquation/content,$fieldScriptStrategyInactivity)'/>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='both' weighty='1.0'>
+ <JPanel/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ <cell fill='both' weightx='1.0' weighty='0.7'>
+ <JPanel/>
+<!--
+ <editor constraints='"fieldScriptStrategyInactivity"' askIfNotSaved="false"
+ id="fieldScriptStrategyInactivity"
+ origin="org.codelutin.util.FileUtil.getTempFile($Strategy/inactivityEquation/content, '.java')">
+ <Document </row>
+ </Table>
+ </cell>Events onModified="Update">
+ <UpdateOrigin
+ target="setEquationInactivity($Strategy, $fieldScriptStrategyInactivity/text)"/>
+ </DocumentEvents>
+ </editor>
+-->
+ </cell>
+ </row>
+ <row>
+ <cell anchor='west'>
+ <JLabel text="isisfish.strategy.comments"/>
+ </cell>
+ <cell fill='both' weightx='1.0' weighty='0.3'>
+ <JScrollPane>
+ <JTextArea id="fieldStrategyComment">
+<!-- Fixme : DocumentEvents
+ origin="$Strategy/comment"
+<DocumentEvents onModified="Update($fieldStrategyComment/text)"/>
+-->
+ </JTextArea>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.new"/>
+<!--
+ origin="$FisheryRegion"
+ actionCommand='input.Input.create("Strategy")'
+-->
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.save"/>
+<!--
+ origin="$EntityModified"
+ actionCommand='input.Input.save("Strategy", $Strategy);refreshView($inputStrategy)'
+-->
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.cancel"/>
+<!--
+ origin="$EntityModified"
+ actionCommand='input.Input.cancel("Strategy", $Strategy);refreshView($inputStrategy)'
+-->
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.remove"/>
+<!--
+ origin="$Strategy"
+ actionCommand="input.Input.remove($Strategy)"
+-->
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
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 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -31,167 +31,23 @@
*/
-->
-<Table>
- <row>
- <cell fill='both' weightx='1.0' weighty='1.0'>
- <Table>
- <row>
- <cell anchor='west'>
- <JLabel text="isisfish.strategy.name"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldStrategyName"/>
-<!-- Fixme : DocumentEvents
- origin="$Strategy/name"
-<DocumentEvents onModified="Update($fieldStrategyName/text)"/>
--->
- </cell>
- </row>
- <row>
- <cell anchor='west'>
- <JLabel text="isisfish.common.setOfVessels"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldStrategySetOfVessels"/>
-<!-- Fixme : ComboBoxModel
-origin="$Strategy/setOfVessels" renderer="name" firstNull="true"
- actionCommand="update($fieldStrategySetOfVessels/selectedItem, $Strategy/setOfVessels)"
-<ComboBoxModel origin="$FisheryRegion/setOfVessels"/>
--->
- </cell>
- </row>
- <row>
- <cell anchor='west'>
- <JLabel text="isisfish.strategy.proportionSetOfVessels"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldStrategyProportionSetOfVessels"/>
-<!-- Fixme : DocumentEvents
-origin="$Strategy/proportionSetOfVessels"
-<DocumentEvents onModified="Update($fieldStrategyProportionSetOfVessels/text)"/>
--->
- </cell>
- </row>
- <row>
- <cell>
- <JPanel/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JCheckBox id="fieldUseEquationInactivity"/>
-<!-- Fixme : ItemEvents
- origin="$Strategy/inactivityEquationUsed" text="isisfish.strategy.inactivityEquationUsed"
-<ItemEvents onStateChanged="Update($fieldUseEquationInactivity/selected, $Strategy/inactivityEquationUsed, refreshView($hideablePanelInactivityEquation))"/>
--->
- </cell>
- </row>
- <row>
- <cell anchor='west'>
- <JLabel text="isisfish.strategy.inactivity"/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldStrategyInactivity"/>
-<!--
- actionCommand="Update($fieldStrategyInactivity/selectedItem/content, $fieldScriptStrategyInactivity/text)">
- <ComboBoxModel origin='fr.ifremer.isisfish.datastore.FormuleStorage.getFormules($TopiaContext, "Inactivity")'/>
--->
- </cell>
- </row>
- <row>
- <cell fill='both' weighty='0.7'>
- <Table>
- <row>
- <cell fill='horizontal'>
- <JButton text="isisfish.common.saveModel"/>
+ <!--
+ + Strategy
+ +-->
+<JTabbedPane id="StrategyTab" name="Strategy" >
+ <script><![CDATA[
+ public StrategyUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ }
+ ]]></script>
+ <tab title='{_("isisfish.strategy.title")}'><StrategyTabUI/></tab>
+ <tab title='{_("isisfish.strategyMonthInfo.title")}'><StrategyMonthInfoUI/></tab>
<!--
- actionCommand='input.Input.saveEquationAsModel($Strategy/inactivityEquation);refreshView($fieldStrategyInactivity)'/>
+isisfish.strategy.title
+isisfish.strategyMonthInfo.title
+ <xpanel xml="input/Strategy.xml" id="inputStrategy"/>
+ <xpanel xml="input/StrategyMonthInfo.xml" id="inputStrategyMonthInfo"/>
-->
- </cell>
- </row>
- <row>
- <cell fill='horizontal'>
- <JButton text="isisfish.common.openEditor"/>
-<!--
-actionCommand='input.Input.openEditor($Strategy/inactivityEquation/category,$Strategy/inactivityEquation/name,$Strategy/inactivityEquation/javaInterface,$Strategy/inactivityEquation/content,$fieldScriptStrategyInactivity)'/>
--->
- </cell>
- </row>
- <row>
- <cell fill='both' weighty='1.0'>
- <JPanel/>
- </cell>
- </row>
- </Table>
- </cell>
- <cell fill='both' weightx='1.0' weighty='0.7'>
- <JPanel/>
-<!--
- <editor constraints='"fieldScriptStrategyInactivity"' askIfNotSaved="false"
- id="fieldScriptStrategyInactivity"
- origin="org.codelutin.util.FileUtil.getTempFile($Strategy/inactivityEquation/content, '.java')">
- <Document </row>
- </Table>
- </cell>Events onModified="Update">
- <UpdateOrigin
- target="setEquationInactivity($Strategy, $fieldScriptStrategyInactivity/text)"/>
- </DocumentEvents>
- </editor>
--->
- </cell>
- </row>
- <row>
- <cell anchor='west'>
- <JLabel text="isisfish.strategy.comments"/>
- </cell>
- <cell fill='both' weightx='1.0' weighty='0.3'>
- <JScrollPane>
- <JTextArea id="fieldStrategyComment">
-<!-- Fixme : DocumentEvents
- origin="$Strategy/comment"
-<DocumentEvents onModified="Update($fieldStrategyComment/text)"/>
--->
- </JTextArea>
- </JScrollPane>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <Table>
- <row>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.new"/>
-<!--
- origin="$FisheryRegion"
- actionCommand='input.Input.create("Strategy")'
--->
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.save"/>
-<!--
- origin="$EntityModified"
- actionCommand='input.Input.save("Strategy", $Strategy);refreshView($inputStrategy)'
--->
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.cancel"/>
-<!--
- origin="$EntityModified"
- actionCommand='input.Input.cancel("Strategy", $Strategy);refreshView($inputStrategy)'
--->
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JButton text="isisfish.common.remove"/>
-<!--
- origin="$Strategy"
- actionCommand="input.Input.remove($Strategy)"
--->
- </cell>
- </row>
- </Table>
- </cell>
- </row>
-</Table>
\ No newline at end of file
+</JTabbedPane>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -33,82 +33,130 @@
<!--
+ TripType
+-->
-<JPanel id="TripTypeTab" layout='{new BorderLayout()}'>
- <JPanel name="isisfish.tripType.title" constraints='"inputTripType"'
- layout='{new XMLGridLayout("fr/ifremer/isisfish/ui/input/TripType.xgl")}'>
- <script>
- import org.codelutin.widget.XMLGridLayout;
- </script>
-
-<!--
- <ContextDataSource id="TripType" context="current" source="TripType"/>
--->
- <JLabel constraints='"labelTripTypeName"' text="isisfish.tripType.name"/>
- <JTextField constraints='"fieldTripTypeName"' id="fieldTripTypeName">
+<Table>
+ <script><![CDATA[
+ public TripTypeUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ }
+ ]]>
+ </script>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <Table>
+ <row>
+ <cell>
+ <JLabel text="isisfish.tripType.name"/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldTripTypeName"/>
<!-- Fixme : DocumentEvents
origin="$TripType/name"
<DocumentEvents onModified="Update($fieldTripTypeName/text)"/>
-->
- </JTextField>
- <JLabel constraints='"labelTripTypeDuration"' text="isisfish.tripType.duration"/>
+
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.tripType.duration"/>
<!--
tooltips="In hours"
-->
- <JTextField constraints='"fieldTripTypeDuration"' id="fieldTripTypeDuration">
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldTripTypeDuration"/>
<!-- Fixme : DocumentEvents
origin="$TripType/tripDuration/hour"
tooltips="In hours"
<DocumentEvents onModified="Update($fieldTripTypeDuration/text * 3600, $TripType/tripDuration)"/>
-->
- </JTextField>
- <JLabel constraints='"labelTripTypeMinTimeBetweenTrip"' text="isisfish.tripType.minTime"/>
- <JTextField constraints='"fieldTripTypeMinTimeBetweenTrip"' id="fieldTripTypeMinTimeBetweenTrip">
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.tripType.minTime"/>
+
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldTripTypeMinTimeBetweenTrip"/>
<!-- Fixme : DocumentEvents
origin="$TripType/minTimeBetweenTrip/hour"
<DocumentEvents onModified="Update($fieldTripTypeMinTimeBetweenTrip/text * 3600, $TripType/minTimeBetweenTrip)"/>
-->
- </JTextField>
- <JLabel constraints='"labelTripTypeComment"' text="isisfish.tripType.comments"/>
- <JScrollPane constraints='"fieldTripTypeComment"'>
- <JTextArea id="fieldTripTypeComment">
+
+ </cell>
+ </row>
+ <row>
+ <cell>
+
+ <JLabel text="isisfish.tripType.comments"/>
+ </cell>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <JScrollPane>
+ <JTextArea id="fieldTripTypeComment"/>
<!-- Fixme : DocumentEvents
origin="$TripType/comment"
<DocumentEvents onModified="Update($fieldTripTypeComment/text)"/>
-->
- </JTextArea>
- </JScrollPane>
- <JPanel id="panelTripTypeButtonAction" constraints='"panelTripTypeButtonAction"'
- layout='{new XMLGridLayout("fr/ifremer/isisfish/ui/input/ActionButton.xgl")}'>
- <JButton constraints='"buttonCreate"' text="isisfish.common.new"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.save"/>
<!--
- origin="$FisheryRegion"
- actionCommand='input.Input.create("TripType")'
--->
- <JButton constraints='"buttonSave"' text="isisfish.common.save"/>
-<!--
origin="$EntityModified"
actionCommand='input.Input.save("TripType", $TripType);refreshView($inputTripType)'
-->
- <JButton constraints='"buttonCancel"' text="isisfish.common.cancel"/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.cancel"/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("TripType", $TripType);refreshView($inputTripType)'
-->
- <JButton constraints='"buttonRemove"' text="isisfish.common.remove"/>
+
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.new"/>
<!--
- origin="$TripType"
- actionCommand="input.Input.remove($TripType)"
+ origin="$FisheryRegion"
+ actionCommand='input.Input.create("TripType")'
-->
- </JPanel>
- </JPanel>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+
+ <JButton text="isisfish.common.remove"/>
<!--
- <xpanel xml="input/TripType.xml" id="inputTripType" name="TripType"/>
+ origin="$TripType"
+ actionCommand="input.Input.remove($TripType)"
-->
- <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continueVesselTypes"/>
+
+ </cell>
+ </row>
+ <row>
+ <cell columns ='2' fill='horizontal' weightx='1.0'>
+ <JButton text="isisfish.input.continueVesselTypes"/>
<!--
actionCommand="UIHelper.setTreeSelection('VesselTypes')"
-->
-</JPanel>
\ No newline at end of file
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+</Table>
+
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -32,6 +32,13 @@
-->
<JPanel layout='{new BorderLayout()}'>
+ <script><![CDATA[
+ public VesselTypeUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ }
+ ]]></script>
<Table constraints='BorderLayout.CENTER'>
<row>
<cell fill='both' weightx='1.0' weighty='1.0'>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -31,71 +31,132 @@
*/
-->
+
<!--
+ Zone
+-->
-<JPanel layout='{new BorderLayout()}'>
- <JSplitPane id="ZoneTab" name="Zones"
- oneTouchExpandable="true" dividerLocation="200" orientation="VERTICAL">
- <JPanel name="isisfish.zone.title">
+<Table>
+ <script><![CDATA[
+ import fr.ifremer.isisfish.entities.Cell;
+ import fr.ifremer.isisfish.entities.Zone;
+ public ZoneUI (InputAction action){
+ setContextValue(action);
+ }
+ protected void refresh() {
+ Zone z = getContextValue(InputAction.class).getZone();
+ System.out.println("refresh" + z);
+ if (z != null){
+ fieldZoneName.setText(z.getName());
+ DefaultListModel model = new DefaultListModel();
+ for (Cell c : getContextValue(InputAction.class).getZone().getCell()){
+ model.addElement(c);
+ }
+ zoneCells.setModel(model);
+ fieldZoneComment.setText(getContextValue(InputAction.class).getZone().getComment());
+ }
+ }
+ protected void create(){
+ }
+ protected void save(){
+ }
+ protected void cancel(){
+ }
+ protected void remove(){
+ }
+ ]]>
+ </script>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <JSplitPane id="ZoneTab" name="Zones"
+ oneTouchExpandable="true" dividerLocation="200" orientation="horizontal">
+ <Table>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JLabel text="isisfish.zone.name"/>
-<!--
- <ContextDataSource id="Zone" context="current" source="Zone"/>
--->
- <JLabel text="isisfish.zone.name"/>
- <JTextField id="fieldZoneName">
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldZoneName"/>
<!-- Fixme : DocumentEvents
origin="$Zone/name"
<DocumentEvents onModified="Update($fieldZoneName/text)"/>
-->
- </JTextField>
- <JLabel text="isisfish.zone.cells"/>
- <JScrollPane>
- <JList id="zoneCells">
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JLabel text="isisfish.zone.cells"/>
+
+
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weighty='0.7' weightx='1.0'>
+ <JScrollPane>
+ <JList id="zoneCells">
<!-- Fixme : ListModel
origin="getCell($Zone)" iterate="true" renderer="name"
<ListModel origin="$FisheryRegion/cell"/>
<ListSelectionEvents onValueChanged="Update($zoneCells/selectedValues, $Zone/cell, refreshView($zoneMap))"/>
-->
- </JList>
- </JScrollPane>
- <JLabel text="isisfish.zone.comments"/>
- <JScrollPane>
- <JTextArea id="fieldZoneComment">
+ </JList>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JLabel text="isisfish.zone.comments"/>
+
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weighty='0.3' weightx='1.0'>
+ <JScrollPane>
+ <JTextArea id="fieldZoneComment">
<!-- Fixme : DocumentEvents
origin="$Zone/comment"
<DocumentEvents onModified="Update($fieldZoneComment/text)"/>
-->
- </JTextArea>
- </JScrollPane>
- <JPanel id="panelZoneButtonAction">
- <JButton text="isisfish.common.new"/>
+ </JTextArea>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.new" onActionPerformed='create()'/>
<!--
origin="$FisheryRegion"
actionCommand='input.Input.create("Zone")'
-->
- <JButton text="isisfish.common.save"/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.save" onActionPerformed='save()'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.save("Zone", $Zone);refreshView($inputZone)'
-->
- <JButton text="isisfish.common.cancel"/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.cancel" onActionPerformed='cancel()'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("Zone", $Zone);refreshView($inputZone)'
-->
- <JButton text="isisfish.common.remove"/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton text="isisfish.common.remove" onActionPerformed='remove()'/>
<!--
origin="$Zone"
actionCommand="input.Input.remove($Zone)"
-->
- </JPanel>
- </JPanel>
-
-<!--
- <xpanel xml="input/Zone.xml" id="inputZone"/>
--->
- <JPanel id="zoneMapPanel" layout='{new BorderLayout()}'>
+ </cell>
+ </row>
+ </Table>
+ <JPanel id="zoneMapPanel" layout='{new BorderLayout()}'>
<!-- Fixme : OpenMapToolPanel, OpenMap
<OpenMapToolPanel constraints='"BorderLayout.NORTH"' id="zoneMapTool">
<OpenMapToolSet id="zoneMapToolSet" origin="$zoneMap"/>
@@ -106,10 +167,17 @@
onMouseClicked="Update($zoneMap/selectedCells, $Zone/cell, refreshView($zoneCells))"/>
</OpenMap>
-->
- </JPanel>
- </JSplitPane>
- <JButton constraints='BorderLayout.SOUTH' text="isisfish.input.continuePorts"/>
+ </JPanel>
+ </JSplitPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton text="isisfish.input.continuePorts" onActionPerformed='create()'/>
<!--
actionCommand="UIHelper.setTreeSelection('Ports')"
-->
-</JPanel>
+ </cell>
+ </row>
+</Table>
+
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-10-28 11:34:42 UTC (rev 1578)
@@ -116,7 +116,7 @@
* @param tree TODO
* @return TODO
*/
- public Object newScript(String fileName, String scriptType) {
+ public void newScript(String fileName, String scriptType) {
// log.info("newScript called [" + scriptType + "] " + uiContext);
Exception e;
@@ -130,7 +130,7 @@
ScriptMapping mapping = ScriptMapping.valueOf(scriptType);
if (mapping == null) {
e = new RuntimeException("ScriptType unknown: " + scriptType);
- return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
}
int pos = fileName.lastIndexOf('/');
@@ -139,13 +139,13 @@
// interdit pour le moment ?
String message = _("isisfish.error.invalid.file.name", fileName);
e = new RuntimeException(message);
- return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
}
// il y a un sous type à traiter
if (pos == fileName.length() - 1) {
String message = _("isisfish.error.invalid.file.name", fileName);
e = new RuntimeException(message);
- return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
}
realFilename = fileName.substring(fileName.lastIndexOf('/') + 1);
category = fileName.substring(0, fileName.lastIndexOf('/'));
@@ -156,7 +156,7 @@
if (!realFilename.matches("[A-Z0-9_][a-zA-Z0-9_]*")) {
String message = _("isisfish.error.invalid.file.name", fileName);
e = new RuntimeException(message);
- return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
}
//TODO do test on category
CodeSourceStorage script = null;
@@ -215,7 +215,7 @@
// Message d'erreur si le fichier existe en local.
String message = _("isisfish.error.file.already.exists", fileName);
e = new RuntimeException(message);
- return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
}
// add default script content
@@ -245,15 +245,14 @@
// frame.refreshView("buttonBar");
// frame.refreshView("scriptMenuBar");
} catch (Exception eee) {
- return returnError(_("isisfish.error.script.create",fileName, eee.getMessage()),eee);
+ returnError(_("isisfish.error.script.create",fileName, eee.getMessage()),eee);
}
- return null;
}
- public static Object returnError(String s, Exception eee) {
+ protected void returnError(String s, Exception eee) {
log.error(s,eee);
// return new OutputView("Error.xml", "error", s);
- return null;
+ //return null;
}
public void loadScript(GenericCell c, String fileName, String type){
ScriptMapping mapping = ScriptMapping.valueOf(type);
@@ -285,7 +284,11 @@
}
//frame.setInfoText(_("isisfish.message.load.finished"));
- } finally {
+ } catch (Exception eee) {
+ returnError(_("isisfish.error.script.load",fileName, eee.getMessage()),eee);
+
+ }
+ finally {
code = script;
}
}
@@ -300,7 +303,7 @@
try {
code.setContent(content);
} catch (Exception eee) {
- return returnError(_("isisfish.error.script.save", code.getFile(), eee.getMessage()),eee);
+ returnError(_("isisfish.error.script.save", code.getFile(), eee.getMessage()),eee);
}
return null;
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -91,12 +91,12 @@
protected DefaultTreeModel getTreeModel(){
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode();
DefaultTreeModel treeModel = new DefaultTreeModel(rootNode);
- DefaultMutableTreeNode scriptNode = new DefaultMutableTreeNode(new GenericCell("Script", null));
- DefaultMutableTreeNode simulatorNode = new DefaultMutableTreeNode(new GenericCell("Simulator", null));
- DefaultMutableTreeNode exportNode = new DefaultMutableTreeNode(new GenericCell("Export", null));
- DefaultMutableTreeNode ruleNode = new DefaultMutableTreeNode(new GenericCell("Rule", null));
- DefaultMutableTreeNode analysePlanNode = new DefaultMutableTreeNode(new GenericCell("AnalysePlan", null));
- DefaultMutableTreeNode equationModelNode = new DefaultMutableTreeNode(new GenericCell("EquationModel", null));
+ DefaultMutableTreeNode scriptNode = new DefaultMutableTreeNode(new GenericCell("Script", null, null));
+ DefaultMutableTreeNode simulatorNode = new DefaultMutableTreeNode(new GenericCell("Simulator", null, null));
+ DefaultMutableTreeNode exportNode = new DefaultMutableTreeNode(new GenericCell("Export", null, null));
+ DefaultMutableTreeNode ruleNode = new DefaultMutableTreeNode(new GenericCell("Rule", null, null));
+ DefaultMutableTreeNode analysePlanNode = new DefaultMutableTreeNode(new GenericCell("AnalysePlan", null, null));
+ DefaultMutableTreeNode equationModelNode = new DefaultMutableTreeNode(new GenericCell("EquationModel", null, null));
setNode(scriptNode, getContextValue(ScriptAction.class).getScriptNames(), "Script");
setNode(simulatorNode, getContextValue(ScriptAction.class).getSimulatorNames(), "Simulator");
setNode(exportNode, getContextValue(ScriptAction.class).getExportNames(), "Export");
@@ -118,7 +118,7 @@
}
protected void setNode(DefaultMutableTreeNode node, java.util.List<String> values, String type) {
for (String value : values){
- DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(new GenericCell(value, type));
+ DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(new GenericCell(value, type, null));
node.add(childNode);
}
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -48,6 +48,7 @@
import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
import javax.swing.table.TableColumn;
import fr.ifremer.isisfish.ui.widget.editor.ParameterColumnEditor;
+ import static javax.swing.JOptionPane.showMessageDialog;
setContextValue(new MatrixPanelEditor());
simulParamsNumbers.add(getContextValue(MatrixPanelEditor.class), BorderLayout.CENTER);
@@ -75,7 +76,7 @@
protected void regionChange(){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
root.setInfoText(_("isisfish.message.loading.region"));
- getContextValue(SimulAction.class).regionChange(fieldSimulParamsRegion.getSelectedItem().toString());
+ showMsgBox(getContextValue(SimulAction.class).regionChange(fieldSimulParamsRegion.getSelectedItem().toString()));
refresh();
root.setInfoText(_("isisfish.message.region.loaded"));
}
@@ -87,11 +88,7 @@
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
root.setInfoText(_("isisfish.message.loading.old.simulation"));
- getContextValue(SimulAction.class).loadOldSimulation(fieldSimulParamsSelect.getSelectedItem().toString());
- //Exception eee =
- //if (eee != null){
- // new OutputView("Error.xml", "error", eee.getMessage());
- //}
+ showMsgBox(getContextValue(SimulAction.class).loadOldSimulation(fieldSimulParamsSelect.getSelectedItem().toString()));
refresh();
root.setInfoText(_("isisfish.message.old.simulation.loaded"));
}
@@ -108,7 +105,7 @@
setRulesItems();
}
protected void simul(){
- getContextValue(SimulAction.class).simul(fieldSimulParamsName.getText(), (SimulatorLauncher)comboSelLauncher.getSelectedItem());
+ showMsgBox(getContextValue(SimulAction.class).simul(fieldSimulParamsName.getText(), (SimulatorLauncher)comboSelLauncher.getSelectedItem()));
SimulUI simul = getParentContainer(SimulUI.class);
simul.selTab(6);
}
@@ -208,7 +205,7 @@
for (Iterator<String> it = values.keySet().iterator(); it.hasNext();) {
String name = it.next();
Object properties = getContextValue(SimulAction.class).getRuleParameterValue(name, listSimulParamsMesuresList.getSelectedValue().toString());
- GenericCell value = new GenericCell(name, values.get(name));
+ GenericCell value = new GenericCell(name, values.get(name), null);
model.setValueAt(value, row, 0);
model.setValueAt(properties, row, 1);
row++;
@@ -228,6 +225,11 @@
}
});
}
+ protected void showMsgBox(String txt){
+ if (txt != null){
+ showMessageDialog(this, txt);
+ }
+ }
]]>
</script>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2008-10-28 11:34:42 UTC (rev 1578)
@@ -89,7 +89,7 @@
for (Iterator<String> it = values.keySet().iterator(); it.hasNext();) {
String name = it.next();
Object properties = getContextValue(SimulAction.class).getAnalysePlanParameterValue(name, listSimulParamsAnalysePlansList.getSelectedValue().toString());
- GenericCell value = new GenericCell(name, values.get(name));
+ GenericCell value = new GenericCell(name, values.get(name), null);
model.setValueAt(value, row, 0);
model.setValueAt(properties, row, 1);
row++;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-10-28 11:34:42 UTC (rev 1578)
@@ -68,6 +68,8 @@
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelutin.log.UserLog;
@@ -92,6 +94,10 @@
*/
public SimulAction() {
+ init();
+ }
+
+ public String init(){
log.debug("Init ");
try {
param = new SimulationParameter();
@@ -111,8 +117,11 @@
}
catch (Exception eee) {
log.error("Can't init SimulationParameter", eee);
+ return ("Error.xml" + "error" + eee.getMessage());
}
+ return null;
}
+
/**
* Looking for ResultName.java script and read all fields and fill
@@ -143,13 +152,15 @@
log.info(_("User stop simulation %s", job.getItem().getControl().getId()));
}
- protected void viewLog(SimulationJob job) {
+ protected String viewLog(SimulationJob job) {
String id = job.getItem().getControl().getId();
try {
SimulationLoggerUtil.showSimulationLogConsole(id);
} catch (Exception eee) {
UserLog.error(_("Can't open log for %s", id), eee);
+ return ("Error.xml" + "error" + eee.getMessage());
}
+ return null;
}
protected void clearDoneJobs() {
@@ -162,12 +173,18 @@
*
* @param regionName SimulationParameter/description
*/
- public void regionChange(String regionName) {
- regionStorage = RegionStorage.getRegion(regionName);
- param.setRegionName(regionName);
- for (Rule r : param.getRules()) {
- rules.put(r, RuleStorage.getName(r));
+ public String regionChange(String regionName) {
+ try{
+ regionStorage = RegionStorage.getRegion(regionName);
+ param.setRegionName(regionName);
+ for (Rule r : param.getRules()) {
+ rules.put(r, RuleStorage.getName(r));
+ }
}
+ catch (Exception eee){
+ return ("Error.xml" + "error" + eee.getMessage());
+ }
+ return null;
}
/**
@@ -176,7 +193,7 @@
* @param simulationName name of simulation to load
* @return <code>null</code> if ok, an OutputView otherwise with error
*/
- public void loadOldSimulation(String simulName) {
+ public String loadOldSimulation(String simulName) {
log.debug("call loadOldSimulation: " + simulName);
try {
simulStorage = SimulationStorage.getSimulation(simulName);
@@ -186,7 +203,9 @@
regionStorage = param.getRegion();
} catch (Exception eee) {
log.error("Can't load old Simulation: " + simulName, eee);
+ return ("Error.xml" + "error" + eee.getMessage());
}
+ return null;
}
/*
@@ -490,13 +509,13 @@
* @param simulId id of the simulation to simulate
* @param inQueue flag to say put in queue
*/
- public void simul(String simulId, SimulatorLauncher launcher) {
+ public String simul(String simulId, SimulatorLauncher launcher) {
simulId += " " + dateFormat.format(new java.util.Date());
log.debug("call simulate");
try {
if (simulId == null || "".equals(simulId) ||
- SimulationStorage.localyExists(simulId) ||
- SimulationService.getService().exists(simulId)) {
+ SimulationStorage.localyExists(simulId) ||
+ SimulationService.getService().exists(simulId)) {
UserLog.error(_("Can't start simulation, bad id: %s", simulId));
} else {
SimulationParameter p = param.copy();
@@ -505,6 +524,8 @@
}
} catch (Exception eee) {
log.error("Can't start simulation", eee);
+ return ("Error.xml" + "error" + eee.getMessage());
}
+ return null;
}
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java 2008-10-28 11:34:42 UTC (rev 1578)
@@ -12,9 +12,11 @@
public class GenericCell{
private String name;
private Object value;
- public GenericCell(String n, Object c){
+ private Class type;
+ public GenericCell(String n, Object c, Class t){
name = n;
value = c;
+ type = t;
}
@Override
public String toString(){
@@ -26,4 +28,7 @@
public String getName(){
return name;
}
+ public Class getType(){
+ return type;
+ }
}
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterCellEditor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterCellEditor.java 2008-10-28 11:03:59 UTC (rev 1577)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterCellEditor.java 2008-10-28 11:34:42 UTC (rev 1578)
@@ -1,29 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package fr.ifremer.isisfish.ui.widget.editor;
-
-/**
- *
- * @author letellier
- */
-public class ParameterCellEditor{
- private String name;
- private Class type;
- public ParameterCellEditor(String n, Class c){
- name = n;
- type = c;
- }
- @Override
- public String toString(){
- return name;
- }
- public Class getType(){
- return type;
- }
- public String getName(){
- return name;
- }
-}
1
0
r1577 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/versionning
by chatellierï¼ users.labs.libre-entreprise.org 28 Oct '08
by chatellierï¼ users.labs.libre-entreprise.org 28 Oct '08
28 Oct '08
Author: chatellier
Date: 2008-10-28 11:03:59 +0000 (Tue, 28 Oct 2008)
New Revision: 1577
Removed:
isis-fish/trunk/bin/
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/versionning/ui/
Log:
Remove unused dirs
1
0
Author: chatellier
Date: 2008-10-28 09:34:36 +0000 (Tue, 28 Oct 2008)
New Revision: 1576
Modified:
isis-fish/trunk/pom.xml
Log:
Change encoding
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-10-27 16:12:13 UTC (rev 1575)
+++ isis-fish/trunk/pom.xml 2008-10-28 09:34:36 UTC (rev 1576)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1
0
Author: chatellier
Date: 2008-10-27 16:12:13 +0000 (Mon, 27 Oct 2008)
New Revision: 1575
Modified:
isis-fish/trunk/pom.xml
Log:
Add commons-beanutils, use 0.6-SNAPSHOT of jaxx
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-10-24 18:37:44 UTC (rev 1574)
+++ isis-fish/trunk/pom.xml 2008-10-27 16:12:13 UTC (rev 1575)
@@ -138,32 +138,39 @@
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
- <version>[2.1,]</version>
+ <version>2.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-math</groupId>
<artifactId>commons-math</artifactId>
- <version>[1.1,]</version>
+ <version>1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
- <version>[3.1,]</version>
+ <version>3.2.1</version>
<scope>compile</scope>
</dependency>
+
<dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
- <version>[1.6.1,]</version>
+ <version>1.6.1</version>
<scope>compile</scope>
</dependency>
<!--Other-->
-
<dependency>
<groupId>jfreechart</groupId>
<artifactId>jfreechart</artifactId>
@@ -474,7 +481,7 @@
<current.version>3.2.0.0-SNAPSHOT</current.version>
<!-- jaxx version -->
- <jaxx.version>0.5</jaxx.version>
+ <jaxx.version>0.6-SNAPSHOT</jaxx.version>
<!-- generator version -->
<generator.version>0.60</generator.version>
1
0
r1574 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities
by bpoussinï¼ users.labs.libre-entreprise.org 24 Oct '08
by bpoussinï¼ users.labs.libre-entreprise.org 24 Oct '08
24 Oct '08
Author: bpoussin
Date: 2008-10-24 18:37:44 +0000 (Fri, 24 Oct 2008)
New Revision: 1574
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java
Log:
bug correction: lorsque l'on veut prendre le dernier element
d'une liste, il faut faire size()-1 (ne pas oublier le -1
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java 2008-10-24 08:25:27 UTC (rev 1573)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java 2008-10-24 18:37:44 UTC (rev 1574)
@@ -79,7 +79,7 @@
throw new IllegalArgumentException("listMonth must contains one month or more");
}
Month first = listMonth.get(0);
- Month last = listMonth.get(listMonth.size());
+ Month last = listMonth.get(listMonth.size()-1);
setFirstMonth(first);
setLastMonth(last);
1
0
Author: chatellier
Date: 2008-10-24 08:25:27 +0000 (Fri, 24 Oct 2008)
New Revision: 1573
Modified:
isis-fish/trunk/pom.xml
Log:
Use release of lutinmatrix
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-10-24 07:35:10 UTC (rev 1572)
+++ isis-fish/trunk/pom.xml 2008-10-24 08:25:27 UTC (rev 1573)
@@ -65,7 +65,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinmatrix</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<scope>compile</scope>
</dependency>
1
0
Author: chatellier
Date: 2008-10-24 07:35:10 +0000 (Fri, 24 Oct 2008)
New Revision: 1572
Modified:
isis-fish/trunk/pom.xml
Log:
Remove cglib exclusion
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-10-24 07:32:18 UTC (rev 1571)
+++ isis-fish/trunk/pom.xml 2008-10-24 07:35:10 UTC (rev 1572)
@@ -53,13 +53,6 @@
<artifactId>topia</artifactId>
<version>${topia.version}</version>
<scope>compile</scope>
- <!-- use javassist instead of cglib -->
- <exclusions>
- <exclusion>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
1
0
Author: chatellier
Date: 2008-10-24 07:32:18 +0000 (Fri, 24 Oct 2008)
New Revision: 1571
Modified:
isis-fish/trunk/pom.xml
Log:
Update pom to release for some artifact
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-10-23 13:02:40 UTC (rev 1570)
+++ isis-fish/trunk/pom.xml 2008-10-24 07:32:18 UTC (rev 1571)
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinutil</artifactId>
- <version>0.30</version>
+ <version>0.31</version>
<scope>compile</scope>
</dependency>
<!--
@@ -65,7 +65,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>topia-service</artifactId>
- <version>0.9-SNAPSHOT</version>
+ <version>0.9</version>
<scope>compile</scope>
</dependency>
@@ -481,16 +481,16 @@
<current.version>3.2.0.0-SNAPSHOT</current.version>
<!-- jaxx version -->
- <jaxx.version>0.5-SNAPSHOT</jaxx.version>
+ <jaxx.version>0.5</jaxx.version>
<!-- generator version -->
<generator.version>0.60</generator.version>
<!-- topia version -->
- <topia.version>2.0.27-SNAPSHOT</topia.version>
+ <topia.version>2.0.27</topia.version>
<!-- lutinwidget version -->
- <lutinwidget.version>0.10-SNAPSHOT</lutinwidget.version>
+ <lutinwidget.version>0.10</lutinwidget.version>
<!--Main class in JAR -->
<maven.jar.main.class>fr.ifremer.isisfish.IsisFish</maven.jar.main.class>
1
0
r1570 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: script simulator widget/editor
by sletellierï¼ users.labs.libre-entreprise.org 23 Oct '08
by sletellierï¼ users.labs.libre-entreprise.org 23 Oct '08
23 Oct '08
Author: sletellier
Date: 2008-10-23 13:02:40 +0000 (Thu, 23 Oct 2008)
New Revision: 1570
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterColumnEditor.java
Log:
ScriptUI completed
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-10-23 13:02:01 UTC (rev 1569)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-10-23 13:02:40 UTC (rev 1570)
@@ -9,16 +9,47 @@
*
* @author letellier
*/
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.CodeSourceStorage;
import fr.ifremer.isisfish.datastore.ExportStorage;
import fr.ifremer.isisfish.datastore.FormuleStorage;
+import fr.ifremer.isisfish.datastore.JavaSourceStorage;
import fr.ifremer.isisfish.datastore.RuleStorage;
import fr.ifremer.isisfish.datastore.ScriptStorage;
-import fr.ifremer.isisfish.datastore.SimulationStorage;
-import fr.ifremer.isisfish.ui.script.Action.ScriptMapping;
+import fr.ifremer.isisfish.datastore.SimulatorStorage;
+import fr.ifremer.isisfish.ui.ScriptActionHelper;
+import fr.ifremer.isisfish.ui.script.Action.ScriptFileFilter;
+import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+import fr.ifremer.isisfish.vcs.VCSException;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import static org.codelutin.i18n.I18nf._;
import java.io.File;
+import java.io.FileFilter;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.PrintStream;
+import java.lang.reflect.Method;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
+import javax.swing.JOptionPane;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreePath;
+import org.apache.commons.logging.Log;
+import org.codelutin.util.FileUtil;
+import static org.apache.commons.logging.LogFactory.getLog;
+import static fr.ifremer.isisfish.equation.Language.JAVA;
+
public class ScriptAction {
+ CodeSourceStorage code;
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = getLog(ScriptAction.class);
+ File fileOpen= null;
public ScriptAction(){
}
@@ -34,8 +65,8 @@
public List<String> getScriptNames(){
return ScriptStorage.getScriptNames();
}
- public List<String> getSimulationNames(){
- return SimulationStorage.getSimulationNames();
+ public List<String> getSimulatorNames(){
+ return SimulatorStorage.getSimulatorNames();
}
public List<String> getExportNames(){
return ExportStorage.getExportNames();
@@ -55,8 +86,8 @@
public File getScriptDirectory(){
return ScriptStorage.getScriptDirectory();
}
- public File getSimulationDirectory(){
- return SimulationStorage.getSimulationDirectory();
+ public File getSimulatorDirectory(){
+ return SimulatorStorage.getSimulatorDirectory();
}
public File getExportDirectory(){
return ExportStorage.getExportDirectory();
@@ -70,4 +101,779 @@
public File getFormuleDirectory(){
return FormuleStorage.getFormuleDirectory();
}
+ /*
+ * JButton Action
+ */
+ /**
+ * Creer un nouveau script, ici un script peut-etre un Script, un Simulator,
+ * un Export.
+ *
+ * @param uiContext TODO
+ * @param frame TODO
+ * @param scriptType le type que l'on souhaite Script, Simulator,
+ * ou Export.
+ * @param jmodel TODO
+ * @param tree TODO
+ * @return TODO
+ */
+ public Object newScript(String fileName, String scriptType) {
+// log.info("newScript called [" + scriptType + "] " + uiContext);
+
+ Exception e;
+ try {
+ // Vérifie qu'il n'y pas de caractères spéciaux. Seul les caractre
+ // de a à z (majuscule ou minuscule) ainsi que les nombres sont
+ // autorisés. + pour signifier qu'il doit y avoir
+ // au moins 1 caractère.
+ String realFilename;
+ String category;
+ ScriptMapping mapping = ScriptMapping.valueOf(scriptType);
+ if (mapping == null) {
+ e = new RuntimeException("ScriptType unknown: " + scriptType);
+ return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ }
+
+ int pos = fileName.lastIndexOf('/');
+ if (pos != -1) {
+ if (mapping!= ScriptMapping.EquationModel) {
+ // interdit pour le moment ?
+ String message = _("isisfish.error.invalid.file.name", fileName);
+ e = new RuntimeException(message);
+ return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ }
+ // il y a un sous type à traiter
+ if (pos == fileName.length() - 1) {
+ String message = _("isisfish.error.invalid.file.name", fileName);
+ e = new RuntimeException(message);
+ return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ }
+ realFilename = fileName.substring(fileName.lastIndexOf('/') + 1);
+ category = fileName.substring(0, fileName.lastIndexOf('/'));
+ } else {
+ realFilename = fileName;
+ category = "";
+ }
+ if (!realFilename.matches("[A-Z0-9_][a-zA-Z0-9_]*")) {
+ String message = _("isisfish.error.invalid.file.name", fileName);
+ e = new RuntimeException(message);
+ return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ }
+ //TODO do test on category
+ CodeSourceStorage script = null;
+ String template;
+ template = mapping.getDefaultContent();
+ switch (mapping) {
+ case EquationModel:
+// if (!category.isEmpty()) {
+// // on utilise la category passée dans le nom
+// parentNode = (TreeNodeWrapper) jmodel.getNode(category);
+// if (parentNode == null) {
+// parentNode = (TreeNodeWrapper) jmodel.getNode(scriptType);
+// JTreeNode jparentNode = parentNode.getWrapped();
+// JTreeNode jnode = (JTreeNode) jparentNode.getComponent(0);
+// jnode.setName(category);
+// parentNode.addNode(jnode, category);
+// parentNode = (TreeNodeWrapper) jmodel.getNode(category);
+// UIHelper.setTreeSelection(tree, jmodel, category);
+// }
+// } else {
+// // on utilise la category dans la navigation
+// TreePath path = tree.getSelectionPath();
+// if (path.getPath().length < 2) {
+// // fatal error no category found, and was required
+// String message = _("isisfish.error.invalid.category.name", fileName);
+// e = new RuntimeException(message);
+// return returnError(_("isisfish.error.script.create", fileName, e.getMessage()), e);
+// }
+// TreeNodeWrapper categotyNode = (TreeNodeWrapper) path.getPathComponent(2);
+// parentNode = categotyNode;
+// category = String.valueOf(categotyNode.getUserObject());
+// }
+
+ script = FormuleStorage.createFormule(category, realFilename, JAVA);
+ break;
+ case AnalysePlan:
+ script = AnalysePlanStorage.getAnalysePlan(fileName);
+ break;
+ case Export:
+ script = ExportStorage.getExport(fileName);
+ break;
+ case Rule:
+ script = RuleStorage.getRule(fileName);
+ break;
+ case Script:
+ script = ScriptStorage.getScript(fileName);
+ break;
+ case Simulator:
+ script = SimulatorStorage.getSimulator(fileName);
+ break;
+ default:
+ log.fatal("ScriptType unknown: " + scriptType);
+ }
+
+ if (script.exists()) {
+ // Message d'erreur si le fichier existe en local.
+ String message = _("isisfish.error.file.already.exists", fileName);
+ e = new RuntimeException(message);
+ return returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ }
+
+ // add default script content
+ String content = MessageFormat.format(template,
+ category.isEmpty() ? "" : '.' + category.replaceAll("\\/", "."),
+ realFilename,
+ new Date(),
+ IsisFish.config.getUserName(),
+ IsisFish.config.getUserMail());
+ script.setContent(content);
+ // ajout du nouveau script dans l'arbre
+// if (parentNode == null) {
+// parentNode = (TreeNodeWrapper) jmodel.getNode(scriptType);
+// }
+// if (parentNode != null) {
+// JTreeNode jparentNode = parentNode.getWrapped();
+// JTreeNode jnode = (JTreeNode) jparentNode.getComponent(0);
+// parentNode.addNode(jnode, script.getName());
+// }
+// // selection du nouveau noeud, ce qui appel la methode load
+// UIHelper.setTreeSelection(tree, jmodel, script.getName());
+
+// uiContext.setData(SCRIPT_STORAGE, script);
+ code = script;
+// uiContext.setData(SCRIPT_TYPE, scriptType);
+// frame.refreshView("scriptJedit");
+// frame.refreshView("buttonBar");
+// frame.refreshView("scriptMenuBar");
+ } catch (Exception eee) {
+ return returnError(_("isisfish.error.script.create",fileName, eee.getMessage()),eee);
+ }
+ return null;
+
+ }
+ public static Object returnError(String s, Exception eee) {
+ log.error(s,eee);
+// return new OutputView("Error.xml", "error", s);
+ return null;
+ }
+ public void loadScript(GenericCell c, String fileName, String type){
+ ScriptMapping mapping = ScriptMapping.valueOf(type);
+ CodeSourceStorage script = null;
+
+ try {
+
+ switch (mapping) {
+ case EquationModel:
+ script = FormuleStorage.getFormule((String)c.getValue(), fileName);
+ break;
+ case Rule:
+ script = RuleStorage.getRule(fileName);
+ break;
+ case AnalysePlan:
+ script = AnalysePlanStorage.getAnalysePlan(fileName);
+ break;
+ case Export:
+ script = ExportStorage.getExport(fileName);
+ break;
+ case Script:
+ script = ScriptStorage.getScript(fileName);
+ break;
+ case Simulator:
+ script = SimulatorStorage.getSimulator(fileName);
+ break;
+ default:
+ log.fatal("ScriptType unknown: " + fileName);
+ }
+
+ //frame.setInfoText(_("isisfish.message.load.finished"));
+ } finally {
+ code = script;
+ }
+ }
+ public boolean fileLoaded(){
+ return code != null;
+ }
+ public boolean isJavaScript(){
+ return JavaSourceStorage.class.isInstance(code);
+ }
+ public Object saveScript(String content) {
+ log.info("saveScript called [" + code.getName() + "] ");
+ try {
+ code.setContent(content);
+ } catch (Exception eee) {
+ return returnError(_("isisfish.error.script.save", code.getFile(), eee.getMessage()),eee);
+ }
+ return null;
+ }
+ public String commitScript(String content) {
+ String result = null;
+ try {
+ log.debug("commitScript called for ");
+ // save script before commit
+ code.setContent(content);
+ String msg = JOptionPane.showInputDialog(_("Indiquez vos modifications"));
+// String msg = VCSUIHelper.getCommitMessage(script.getFile(), true);
+ if (msg == null) {
+ result = _("isisfish.message.commit.cancelled");
+ } else {
+ code.commit(msg);
+ code.reload();
+ result = _("isisfish.message.commit.finished");
+ }
+ return null;
+ } catch (Exception ex) {
+ Logger.getLogger(ScriptAction.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return result;
+ }
+ /**
+ * Exporte le(s) script(s) sélectionnés dans l'arbe.
+ * <br>L'arbre doit avoir au moins un script de selectionne
+ *
+ * @param uiContext swixat context
+ * @param frame swiaxt frame
+ * @param tree tree contaings script
+ * @return <code>null</code> if everything is ok,
+ * an <code>OutputVie<</code> with an error to display otherwise
+ */
+ public static String exportScript(TreePath[] selectedPaths) {
+ String message = null;
+ // first step : acquire list of files required
+ int prefixLength = IsisFish.config.getDatabaseDirectory().getAbsolutePath().length() + 1;
+ List<String> listFiles = extractFiles(prefixLength, selectedPaths);
+
+// try {
+// boolean fired = ScriptActionHelper.exportScript(null, listFiles, false, true, frame);
+// if (!fired) {
+// message = _("isisfish.message.export.cancelled");
+// } else {
+// message = _("isisfish.message.export.done");
+// }
+// } catch (Exception eee) {
+// }
+ return message;
+ }
+ protected static List<String> extractFiles(int prefixLength,TreePath[] selectedPaths) {
+ List<String> result = new ArrayList<String>();
+ List<File> dirFound = new ArrayList<File>();
+ List<File> dirWithFileFound = new ArrayList<File>();
+
+ for (TreePath selectedPath : selectedPaths) {
+
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectedPath.getPathComponent(1);
+ String moduleDisplayName = String.valueOf(node.getUserObject());
+ File file = ScriptMapping.valueOf(moduleDisplayName).getModule();
+ int nbPaths = selectedPath.getPathCount();
+ if (nbPaths > 2)
+ for (int i = 2; i < nbPaths; i++) {
+ node = (DefaultMutableTreeNode) selectedPath.getPathComponent(i);
+ String pathName = String.valueOf(node.getUserObject());
+ file = new File(file, pathName);
+ }
+ if (file.isFile()) {
+ File parentFile = file.getParentFile();
+ if (!dirFound.contains(parentFile)) dirFound.add(parentFile);
+ dirWithFileFound.add(parentFile);
+ result.add(file.getAbsolutePath().substring(prefixLength));
+ } else {
+ // mark the file
+ dirFound.add(file);
+ }
+ }
+
+ // keep only user selected directories
+ dirFound.removeAll(dirWithFileFound);
+ dirWithFileFound.clear();
+
+ if (!dirFound.isEmpty()) {
+ List<File> listF = new ArrayList<File>();
+ // there is some directories selected by user
+ for (File dir : dirFound) {
+ // take all files and directories in the dir
+ // (without VCS and data dirs)
+// SVNMigrateHelper.grabbFiles(dir, excludeFilter, listF);
+
+
+ // getFilteredElements use include file filter, we inverse excludeFilter
+ FileFilter filter = new FileFilter() {
+ FileFilter excludeFilter = getSCRIPT_FILE_FILTER();
+ public boolean accept(File pathname) {
+ return !excludeFilter.accept(pathname);
+ }
+ };
+ listF.addAll(FileUtil.getFilteredElements(dir, filter, true));
+ }
+ for (File file : listF)
+ result.add(file.getAbsolutePath().substring(prefixLength));
+ listF.clear();
+ }
+ dirFound.clear();
+ return result;
+ }
+
+ public static FileFilter SCRIPT_FILE_FILTER;
+ public static FileFilter getSCRIPT_FILE_FILTER() {
+ if (SCRIPT_FILE_FILTER == null) {
+ SCRIPT_FILE_FILTER = new ScriptFileFilter(IsisFish.vcs);
+ }
+ return SCRIPT_FILE_FILTER;
+ }
+ //public static Object updateScript()
+ public void updateScript() {
+ try {
+ log.debug("updateScript called for ");
+ //TODO Use VCS UI dialog
+ //TODO Use FileState new mecanism to obtain state
+ code.update();
+ code.reload();
+ } catch (VCSException ex) {
+ Logger.getLogger(ScriptAction.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ public String checkScript(String content) {
+ String resultLog = "";
+ try {
+ log.debug("checkScript called");
+ // save script before commit
+ code.setContent(content);
+ JavaSourceStorage javaCode = (JavaSourceStorage)code;
+ StringWriter result = new StringWriter();
+ PrintWriter out = new PrintWriter(result);
+ int compileResult = 0;
+ Exception e = null;
+ try {
+ compileResult = javaCode.compile(false, out);
+ } catch (Exception eee) {
+ compileResult = -1;
+ e=eee;
+ }
+ if (compileResult != 0) {
+ out.flush();
+ resultLog = result.toString();
+ if (e == null) {
+ e = new RuntimeException("there is some problem in script");
+ }
+ }
+ else{
+ resultLog = "ok";
+ }
+ } catch (IOException ex) {
+ Logger.getLogger(ScriptAction.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return resultLog;
+ }
+ public String evaluateScript(String content) {
+ log.debug("evaluateScript called");
+ String msg = "";
+ try {
+ String checkResult = checkScript(content);
+ if (checkResult != null) {
+ return checkResult;
+ }
+ code.setContent(content);
+ JavaSourceStorage javaCode = (JavaSourceStorage) code;
+ ByteArrayOutputStream result = new ByteArrayOutputStream();
+ PrintStream out = new PrintStream(result);
+ PrintStream err = new PrintStream(result);
+ PrintStream oldOut = System.out;
+ PrintStream oldErr = System.err;
+ System.setOut(out);
+ System.setErr(err);
+ Class clazz = javaCode.getCodeClass();
+ Method main = clazz.getMethod("main", String[].class);
+ //noinspection RedundantArrayCreation
+ main.invoke(null, new Object[]{new String[]{}});
+ System.setOut(oldOut);
+ System.setErr(oldErr);
+ msg = result.toString();
+ } catch (Exception ex) {
+ Logger.getLogger(ScriptAction.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return msg;
+ }
+ /** enum to encapsulate a script module */
+ enum ScriptMapping {
+
+ Script(ScriptStorage.getScriptDirectory(),
+ /**
+ * 0 = package name,
+ * 1 = class name,
+ * 2 = current date,
+ * 3 = author name,
+ * 4 = author email
+ */
+ "package scripts{0};\n" +
+ "\n" +
+ "import org.apache.commons.logging.Log;\n" +
+ "import org.apache.commons.logging.LogFactory;\n" +
+ "\n" +
+ "import fr.ifremer.isisfish.util.Doc;\n" +
+ "\n" +
+ "import org.codelutin.math.matrix.*;\n" +
+ "\n" +
+ "import fr.ifremer.isisfish.entities.*;\n" +
+ "\n" +
+ "/**\n" +
+ " * {0}.{1}.java\n" +
+ " *\n" +
+ " * Created: {2,date, long}\n" +
+ " *\n" +
+ " * @author {3} <{4}>\n" +
+ //" * @version $Revision: 1545 $\n" +
+ " *\n" +
+ //" * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $\n" +
+ //" * by : $Author: sletellier $\n" +
+ " */\n" +
+ "public class {1} '{'\n" +
+ "\n" +
+ " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
+ " static private Log log = LogFactory.getLog({1}.class);\n" +
+ "\n" +
+ " // add your method here\n" +
+ "'}'\n"),
+
+ Simulator(SimulatorStorage.getSimulatorDirectory(),
+ /**
+ * 0 = package name,
+ * 1 = class name,
+ * 2 = current date,
+ * 3 = author name,
+ * 4 = author email
+ */
+ "package simulators{0};\n" +
+ "\n" +
+ "import org.apache.commons.logging.Log;\n" +
+ "import org.apache.commons.logging.LogFactory;\n" +
+ "\n" +
+ "import org.codelutin.math.matrix.*;\n" +
+ "\n" +
+ "import fr.ifremer.isisfish.util.Doc;\n" +
+ "import fr.ifremer.isisfish.entities.*;\n" +
+ "import fr.ifremer.isisfish.simulator.Simulator;\n" +
+ "import fr.ifremer.isisfish.simulator.SimulationContext;\n" +
+ "\n" +
+ "/**\n" +
+ " * {1}.java\n" +
+ " *\n" +
+ " * Created: {2,date, long}\n" +
+ " *\n" +
+ " * @author {3} <{4}>\n" +
+ //" * @version $Revision: 1545 $\n" +
+ " *\n" +
+ //" * Last update$\n" +
+ //" * by : $Author: sletellier $\n" +
+ " */\n" +
+ "public class {1} implements Simulator '{'\n" +
+ "\n" +
+ " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
+ " static private Log log = LogFactory.getLog({1}.class);\n" +
+ "\n" +
+ " public void simulate(SimulationContext context) throws Exception '{'\n" +
+ " // put your code here\n" +
+ " '}'\n" +
+ "\n" +
+ "'}'\n"),
+ Export(ExportStorage.getExportDirectory(),
+ /**
+ * 0 = package name,
+ * 1 = class name,
+ * 2 = current date,
+ * 3 = author name,
+ * 4 = author email
+ */
+ "package exports{0};\n" +
+ "\n" +
+ "import org.apache.commons.logging.Log;\n" +
+ "import org.apache.commons.logging.LogFactory;\n" +
+ "\n" +
+ "import java.io.Writer;\n" +
+ "\n" +
+
+ "import static org.codelutin.i18n.I18nf._;\n" +
+ "import org.codelutin.math.matrix.*;\n" +
+ "\n" +
+ "import fr.ifremer.isisfish.util.Doc;\n" +
+ "import fr.ifremer.isisfish.entities.*;\n" +
+ "import fr.ifremer.isisfish.export.Export;\n" +
+ "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" +
+ "import fr.ifremer.isisfish.datastore.ResultStorage;\n" +
+ "\n" +
+ "/**\n" +
+ " * {1}.java\n" +
+ " *\n" +
+ " * Created: {2,date, long}\n" +
+ " *\n" +
+ " * @author {3} <{4}>\n" +
+ //" * @version $Revision: 1545 $\n" +
+ " *\n" +
+ //" * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $\n" +
+ //" * by : $Author: sletellier $\n" +
+ " */\n" +
+ "public class {1} implements Export '{'\n" +
+ "\n" +
+ " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
+ " static private Log log = LogFactory.getLog({1}.class);\n" +
+ "\n" +
+ " public String [] necessaryResult = '{'\n" +
+ " // put here all necessary result for this rule\n" +
+ " // example: \n" +
+ " // ResultName.MATRIX_BIOMASS,\n" +
+ " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" +
+ " '}';\n" +
+ "\n" +
+ " public String[] getNecessaryResult() '{'\n" +
+ " return this.necessaryResult;\n" +
+ " '}'\n" +
+ "\n" +
+ " public String getExportFilename() '{'\n" +
+ " // remove _(...) if you don''t want translation on filename" +
+ " return _(\"{0}\");\n" +
+ " '}'\n" +
+ "\n" +
+ " public String getExtensionFilename() '{'\n" +
+ " return \".csv\";\n" +
+ " '}'\n" +
+ "\n" +
+ " public String getDescription() '{'\n" +
+ " return _(\"TODO export description\");\n" +
+ " '}'\n" +
+ "\n" +
+ " public void export(SimulationStorage simulation, Writer out) throws Exception '{'\n" +
+ " // put your code here, and write export with: out.write(\"...\")\n" +
+ " '}'\n" +
+ "\n" +
+ "'}'\n"),
+ Rule(RuleStorage.getRuleDirectory(),
+ /**
+ * 0 = package name,
+ * 1 = class name,
+ * 2 = current date,
+ * 3 = author name,
+ * 4 = author email,
+ * 5 = region name
+ */
+ "package rules{0};\n" +
+ "\n" +
+ "import static org.codelutin.i18n.I18nf._;\n" +
+ "\n" +
+ "import org.apache.commons.logging.Log;\n" +
+ "import org.apache.commons.logging.LogFactory;\n" +
+ "\n" +
+ "import scripts.ResultName;\n" +
+ "\n" +
+ "import java.io.Writer;\n" +
+ "\n" +
+ "import org.codelutin.math.matrix.*;\n" +
+ "\n" +
+ "import fr.ifremer.isisfish.util.Doc;\n" +
+ "import fr.ifremer.isisfish.simulator.SimulationContext;\n" +
+ "import fr.ifremer.isisfish.types.Date;\n" +
+ "import fr.ifremer.isisfish.entities.*;\n" +
+ "import fr.ifremer.isisfish.rule.AbstractRule;\n" +
+ "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" +
+ "import fr.ifremer.isisfish.datastore.ResultStorage;\n" +
+ "\n" +
+ "/**\n" +
+ " * {1}.java\n" +
+ " *\n" +
+ " * Created: {2,date, long}\n" +
+ " *\n" +
+ " * @author {3} <{4}>\n" +
+ //" * @version $Revision: 1545 $\n" +
+ " *\n" +
+ //" * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $\n" +
+ //" * by : $Author: sletellier $\n" +
+ " */\n" +
+ "public class {1} extends AbstractRule '{'\n" +
+ "\n" +
+ " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
+ " static private Log log = LogFactory.getLog({1}.class);\n" +
+ "\n" +
+ " public String [] necessaryResult = '{'\n" +
+ " // put here all necessary result for this rule\n" +
+ " // example: \n" +
+ " // ResultName.MATRIX_BIOMASS,\n" +
+ " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" +
+ " '}';\n" +
+ "\n" +
+ " public String[] getNecessaryResult() '{'\n" +
+ " return this.necessaryResult;\n" +
+ " '}'\n" +
+ "\n" +
+ " /**\n" +
+ " * Permet d''afficher a l''utilisateur une aide sur la regle.\n" +
+ " * @return L''aide ou la description de la regle\n" +
+ " */\n" +
+ " public String getDescription() throws Exception '{'\n" +
+ " // TODO\n" +
+ " return _(\"TODO description rule\");\n" +
+ " '}'\n" +
+ " \n" +
+ " /**\n" +
+ " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n" +
+ " * des valeurs\n" +
+ " * @param simulation La simulation pour lequel on utilise cette regle\n" +
+ " */\n" +
+ " public void init(SimulationContext context) throws Exception '{'\n" +
+ " // TODO\n" +
+ " '}'\n" +
+ " /**\n" +
+ " * La condition qui doit etre vrai pour faire les actions\n" +
+ " * @param simulation La simulation pour lequel on utilise cette regle\n" +
+ " * @return vrai si on souhaite que les actions soit faites\n" +
+ " */\n" +
+ " public boolean condition(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" +
+ " // TODO\n" +
+ " return false;\n" +
+ " '}'\n" +
+ " \n" +
+ " /**\n" +
+ " * Si la condition est vrai alors cette action est executée avant le pas\n" +
+ " * de temps de la simulation.\n" +
+ " * @param simulation La simulation pour lequel on utilise cette regle\n" +
+ " */\n" +
+ " public void preAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" +
+ " // TODO\n" +
+ " '}'\n" +
+ " \n" +
+ " /**\n" +
+ " * Si la condition est vrai alors cette action est executée apres le pas\n" +
+ " * de temps de la simulation.\n" +
+ " * @param simulation La simulation pour lequel on utilise cette regle\n" +
+ " */\n" +
+ " public void postAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" +
+ " // TODO\n" +
+ " '}'\n" +
+ "\n" +
+ "'}'\n"),
+ AnalysePlan(AnalysePlanStorage.getAnalysePlanDirectory(),
+ /**
+ * 0 = package name,
+ * 1 = class name,
+ * 2 = current date,
+ * 3 = author name,
+ * 4 = author email,
+ * 5 = region name
+ */
+ "package analyseplans{0};\n" +
+ "\n" +
+ "import static org.codelutin.i18n.I18nf._;\n" +
+ "\n" +
+ "import org.apache.commons.logging.Log;\n" +
+ "import org.apache.commons.logging.LogFactory;\n" +
+ "\n" +
+ "import scripts.ResultName;\n" +
+ "\n" +
+ "import java.io.Writer;\n" +
+ "\n" +
+ "import org.codelutin.math.matrix.*;\n" +
+ "import org.codelutin.util.*;\n" +
+ "import org.codelutin.topia.*;\n" +
+ "\n" +
+ "import fr.ifremer.isisfish.util.Doc;\n" +
+ "import fr.ifremer.isisfish.*;\n" +
+ "import fr.ifremer.isisfish.simulator.SimulationContext;\n" +
+ "import fr.ifremer.isisfish.types.Date;\n" +
+ "import fr.ifremer.isisfish.entities.*;\n" +
+ "import fr.ifremer.isisfish.simulator.AnalysePlan;\n" +
+ "import fr.ifremer.isisfish.simulator.AnalysePlanContext;\n" +
+ "import fr.ifremer.isisfish.simulator.SimulationParameter;\n" +
+ "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" +
+ "import fr.ifremer.isisfish.datastore.ResultStorage;\n" +
+ "\n" +
+ "/**\n" +
+ " * {1}.java\n" +
+ " *\n" +
+ " * Created: {2,date, long}\n" +
+ " *\n" +
+ " * @author {3} <{4}>\n" +
+ //" * @version $Revision: 1545 $\n" +
+ " *\n" +
+ //" * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $\n" +
+ //" * by : $Author: sletellier $\n" +
+ " */\n" +
+ "public class {1} implements AnalysePlan '{'\n" +
+ "\n" +
+ " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
+ " static private Log log = LogFactory.getLog({1}.class);\n" +
+ "\n" +
+ " public String [] necessaryResult = '{'\n" +
+ " // put here all necessary result for this rule\n" +
+ " // example: \n" +
+ " // ResultName.MATRIX_BIOMASS,\n" +
+ " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" +
+ " '}';\n" +
+ "\n" +
+ " public String[] getNecessaryResult() '{'\n" +
+ " return this.necessaryResult;\n" +
+ " '}'\n" +
+ "\n" +
+ " /**\n" +
+ " * Permet d''afficher a l''utilisateur une aide sur le plan.\n" +
+ " * @return L''aide ou la description du plan\n" +
+ " */\n" +
+ " public String getDescription() throws Exception '{'\n" +
+ " // TODO\n" +
+ " return _(\"TODO description plan\");\n" +
+ " '}'\n" +
+ " \n" +
+ " /**\n" +
+ " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n" +
+ " * des valeurs\n" +
+ " * @param simulation La simulation pour lequel on utilise cette regle\n" +
+ " */\n" +
+ " public void init(AnalysePlanContext context) throws Exception '{'\n" +
+ " // TODO\n" +
+ " '}'\n" +
+ " \n" +
+ " /**\n" +
+ " * Call before each simulation\n" +
+ " * @param context plan context\n" +
+ " * @param nextSimulation storage used for next simulation\n" +
+ " * @return true if we must do next simulation, false to stop plan\n" +
+ " * @throws Exception\n" +
+ " */\n" +
+ " public boolean next(AnalysePlanContext context, SimulationStorage nextSimulation) throws Exception '{'\n" +
+ " return false; // TODO\n" +
+ " '}'\n" +
+ "\n" +
+ "'}'\n"),
+ EquationModel(FormuleStorage.getFormuleDirectory(),
+ /**
+ * 0 = package name,
+ * 1 = class name,
+ * 2 = current date,
+ * 3 = author name,
+ * 4 = author email
+ */
+ "/**\n" +
+ " * {1}.java\n" +
+ " *\n" +
+ " * Created: {2,date, long}\n" +
+ " *\n" +
+ " * @author {3} <{4}>\n" +
+ //" * @version $Revision: 1545 $\n" +
+ " *\n" +
+ //" * Last update: $7 $\n" +
+ //" * by : $Author: sletellier $\n" +
+ //" */\n" +
+ "\n" +
+ "// put your code here\n" +
+ "\n");
+
+ private File module;
+ private String defaultContent;
+
+ ScriptMapping(File module, String defaultContent) {
+ this.module = module;
+ this.defaultContent = defaultContent;
+ }
+
+ File getModule() {
+ return module;
+ }
+
+ String getDefaultContent() {
+ return defaultContent;
+ }
+ }
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2008-10-23 13:02:01 UTC (rev 1569)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2008-10-23 13:02:40 UTC (rev 1570)
@@ -37,193 +37,254 @@
import javax.swing.event.TreeSelectionListener;
import jaxx.runtime.swing.JAXXTree;
import javax.swing.tree.TreePath;
-
- protected Map<String, Item> items;
-
+ import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+ import javax.swing.tree.DefaultTreeModel;
+ import javax.swing.tree.DefaultMutableTreeNode;
+ import javax.swing.tree.TreeNode;
+ import static org.codelutin.i18n.I18nf._;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+
setContextValue(new ScriptAction());
- setItems();
tree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
- JAXXTree tree = (JAXXTree)e.getSource();
- String selectedValue = (String)tree.getSelectionValue();
- Item i = items.get(selectedValue);
- File f = null;
- if (i != null){
- Item parent = i.getParent();
- if (parent.equals(scriptItem)){
- f = new File(getContextValue(ScriptAction.class).getScriptDirectory().getPath() + File.separator + selectedValue);
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
+ if (node != null){
+ GenericCell selectedValue = (GenericCell) node.getUserObject();
+ if (selectedValue.getValue() != null){
+ String parent = selectedValue.getValue().toString();
+ File f = null;
+ if (!parent.equals("EquationModel")) {
+ if (parent.equals("Script")) {
+ f = new File(getContextValue(ScriptAction.class).getScriptDirectory().getPath() + File.separator + selectedValue);
+ } else if (parent.equals("Simulator")) {
+ f = new File(getContextValue(ScriptAction.class).getSimulatorDirectory().getPath() + File.separator + selectedValue);
+ } else if (parent.equals("Export")) {
+ f = new File(getContextValue(ScriptAction.class).getExportDirectory().getPath() + File.separator + selectedValue);
+ } else if (parent.equals("Rule")) {
+ f = new File(getContextValue(ScriptAction.class).getRuleDirectory().getPath() + File.separator + selectedValue);
+ } else if (parent.equals("AnalysePlan")) {
+ f = new File(getContextValue(ScriptAction.class).getAnalysePlanDirectory().getPath() + File.separator + selectedValue);
+ } else {
+ f = new File(getContextValue(ScriptAction.class).getFormuleDirectory().getPath() + File.separator + parent + File.separator + selectedValue);
+ parent = "EquationModel";
+ }
+ }
+ if (f != null) {
+ getContextValue(ScriptAction.class).loadScript(selectedValue, selectedValue.getName(), parent);
+ setEditor(f);
+ }
+ setButton();
}
- else if (parent.equals(simulationItem)){
- f = new File(getContextValue(ScriptAction.class).getSimulationDirectory().getPath() + File.separator + selectedValue);
+ else {
+ editor.close();
+ editor.repaint();
}
- else if (parent.equals(exportItem)){
- f = new File(getContextValue(ScriptAction.class).getExportDirectory().getPath() + File.separator + selectedValue);
- }
- else if (parent.equals(ruleItem)){
- f = new File(getContextValue(ScriptAction.class).getRuleDirectory().getPath() + File.separator + selectedValue);
- }
- else if (parent.equals(analysePlanItem)){
- f = new File(getContextValue(ScriptAction.class).getAnalysePlanDirectory().getPath() + File.separator + selectedValue);
- }
- else if (parent.equals(equationModelItem)){
- f = new File(getContextValue(ScriptAction.class).getFormuleDirectory().getPath() + File.separator + selectedValue);
- }
- if (f!=null){
- setEditor(f);
- }
+ actionLogArea.setText("");
+ setButton();
}
}
});
- protected void setItems(){
- items = new HashMap<String, Item>();
- setScriptItems();
- setSimulationItems();
- setExportItems();
- setRuleItems();
- setAnalysePlanItem();
- setEquationModelItem();
+ protected void setTreeModel(){
+ tree.setModel(getTreeModel());
}
- protected void setScriptItems(){
- for (String value : getContextValue(ScriptAction.class).getScriptNames()){
- Item i = new Item(value, null, value, false);
- items.put(value, i);
- scriptItem.addChild(i);
+ protected DefaultTreeModel getTreeModel(){
+ DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode();
+ DefaultTreeModel treeModel = new DefaultTreeModel(rootNode);
+ DefaultMutableTreeNode scriptNode = new DefaultMutableTreeNode(new GenericCell("Script", null));
+ DefaultMutableTreeNode simulatorNode = new DefaultMutableTreeNode(new GenericCell("Simulator", null));
+ DefaultMutableTreeNode exportNode = new DefaultMutableTreeNode(new GenericCell("Export", null));
+ DefaultMutableTreeNode ruleNode = new DefaultMutableTreeNode(new GenericCell("Rule", null));
+ DefaultMutableTreeNode analysePlanNode = new DefaultMutableTreeNode(new GenericCell("AnalysePlan", null));
+ DefaultMutableTreeNode equationModelNode = new DefaultMutableTreeNode(new GenericCell("EquationModel", null));
+ setNode(scriptNode, getContextValue(ScriptAction.class).getScriptNames(), "Script");
+ setNode(simulatorNode, getContextValue(ScriptAction.class).getSimulatorNames(), "Simulator");
+ setNode(exportNode, getContextValue(ScriptAction.class).getExportNames(), "Export");
+ setNode(ruleNode, getContextValue(ScriptAction.class).getRuleNames(), "Rule");
+ setNode(analysePlanNode, getContextValue(ScriptAction.class).getAnalysePlanNames(), "AnalysePlan");
+ setNode(equationModelNode, getContextValue(ScriptAction.class).getCategories(), "EquationModel");
+ for (Enumeration e = equationModelNode.children(); e.hasMoreElements();){
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode)e.nextElement();
+ GenericCell g = (GenericCell)node.getUserObject();
+ setNode(node, getContextValue(ScriptAction.class).getFormuleNames(g.toString()), g.toString());
}
+ treeModel.insertNodeInto(scriptNode, rootNode, 0);
+ treeModel.insertNodeInto(simulatorNode, rootNode, 1);
+ treeModel.insertNodeInto(exportNode, rootNode, 2);
+ treeModel.insertNodeInto(ruleNode, rootNode, 3);
+ treeModel.insertNodeInto(analysePlanNode, rootNode, 4);
+ treeModel.insertNodeInto(equationModelNode, rootNode, 5);
+ return treeModel;
}
- protected void setSimulationItems(){
- for (String value : getContextValue(ScriptAction.class).getSimulationNames()){
- Item i = new Item(value, null, value, false);
- items.put(value, i);
- simulationItem.addChild(i);
+ protected void setNode(DefaultMutableTreeNode node, java.util.List<String> values, String type) {
+ for (String value : values){
+ DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(new GenericCell(value, type));
+ node.add(childNode);
}
}
- protected void setExportItems(){
- for (String value : getContextValue(ScriptAction.class).getExportNames()){
- Item i = new Item(value, null, value, false);
- items.put(value, i);
- exportItem.addChild(i);
- }
+ protected void setEditor(File f){
+ editor.open(f);
+ editor.repaint();
}
- protected void setRuleItems(){
- for (String value : getContextValue(ScriptAction.class).getRuleNames()){
- Item i = new Item(value, null, value, false);
- items.put(value, i);
- ruleItem.addChild(i);
+ protected DefaultMutableTreeNode findNode(DefaultMutableTreeNode root, String value){
+ DefaultMutableTreeNode result= null;
+ for (Enumeration e = root.children(); e.hasMoreElements();){
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode)e.nextElement();
+ GenericCell g = (GenericCell)node.getUserObject();
+ if (value.equals(g.getName())){
+ result = node;
+ }
}
+ return result;
}
- protected void setAnalysePlanItem(){
- for (String value : getContextValue(ScriptAction.class).getAnalysePlanNames()){
- Item i = new Item(value, null, value, false);
- items.put(value, i);
- analysePlanItem.addChild(i);
+
+ protected void setButton(){
+ boolean fileLoaded = getContextValue(ScriptAction.class).fileLoaded();
+ boolean isJavaScript = getContextValue(ScriptAction.class).isJavaScript();
+ buttonScriptExport.setEnabled(tree.getSelectionValue() != null);
+// buttonScriptCommit
+// buttonScriptUpdate
+ buttonScriptSave.setEnabled(fileLoaded);
+ buttonScriptCut.setEnabled(fileLoaded);
+ buttonScriptCopy.setEnabled(fileLoaded);
+ buttonScriptPaste.setEnabled(fileLoaded);
+ buttonScriptCheck.setEnabled(isJavaScript);
+ buttonScriptEval.setEnabled(isJavaScript);
+ }
+ protected void setInfoText(String msg){
+ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ root.setInfoText("msg");
+ }
+/*
+ * JButton Action
+ */
+
+ protected void newScript(){
+ java.util.List<String> values = getContextValue(ScriptAction.class).getCategories();
+ String scriptType = (String)ScriptTypeChoice.getSelectedItem();
+ String equationModelType = "";
+ String equationModelTypePath = "";
+ if (scriptType.equals("EquationModel")){
+ equationModelType = (String)JOptionPane.showInputDialog(
+ this,
+ "Select the equation model's category",
+ "Equation model",
+ JOptionPane.PLAIN_MESSAGE,
+ null,
+ values.toArray(),
+ values.get(0));
+ equationModelTypePath = equationModelType + File.separator;
}
- }
- protected void setEquationModelItem(){
- for (String categorie : getContextValue(ScriptAction.class).getCategories()){
- Item item = new Item(categorie, null, categorie, false);
- equationModelItem.addChild(item);
- for (String formule : getContextValue(ScriptAction.class).getFormuleNames(categorie)){
- Item i = new Item(formule, null, formule, false);
- items.put(formule, i);
- i.addChild(i);
+ if (equationModelType != null){
+ String fileName = JOptionPane.showInputDialog(_("isisfish.message.new.filename"));
+ if (fileName != null){
+ getContextValue(ScriptAction.class).newScript(equationModelTypePath + fileName, scriptType);
+ setTreeModel();
+ setInfoText(_("isisfish.message.creation.done", script.getName()));
+ DefaultMutableTreeNode element = null;
+ element = findNode((DefaultMutableTreeNode) tree.getModel().getRoot(), scriptType);
+ if (!equationModelTypePath.equals("")){
+ element = findNode(element, equationModelType);
+ }
+ element = findNode(element, fileName + ".java");
+ TreeNode[] path = element.getPath();
+ if (log.isDebugEnabled()) {
+ log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path));
+ }
+ TreePath newSelectionPath = new TreePath(path);
+ tree.setSelectionPath(newSelectionPath);
}
}
}
- protected void setEditor(File f){
- editor.open(f);
+ protected void saveScript(){
+ getContextValue(ScriptAction.class).saveScript(editor.getText());
+ setInfoText(_("isisfish.message.save.finished"));
}
+ protected void exportScript(){
+ getContextValue(ScriptAction.class).exportScript(tree.getSelectionPaths());
+ }
+ protected void commitScript(){
+ setInfoText(_(getContextValue(ScriptAction.class).commitScript(editor.getText())));
+ }
+ protected void updateScript(){
+ getContextValue(ScriptAction.class).updateScript();
+ setInfoText(_("isisfish.message.update.finished"));
+ }
+ protected void cut(){
+ }
+ protected void copy(){
+ }
+ protected void paste(){
+ }
+ protected void checkScript(){
+ actionLogArea.setText(getContextValue(ScriptAction.class).checkScript(editor.getText()));
+ setInfoText(_("isisfish.message.check.finished"));
+ }
+ protected void evaluateScript(){
+ actionLogArea.setText(getContextValue(ScriptAction.class).evaluateScript(editor.getText()));
+ setInfoText(_("isisfish.message.evaluation.finished"));
+ }
]]>
</script>
-<!--
-title="isisfish.script.title"
-visible="true" size='{new Dimension(620,400)}'
--->
-
-<!-- Fixme : WindowsEvents
-<WindowEvents id="events" onOpened="script.Action.opened()" />
-Maximizable="true" Closable="true"
-bundle="org.codelutin.i18n.I18nBundleBridge"
--->
-
-<!-- Fixme : ContextDataSource
- <ContextDataSource id="ScriptStorage" context="current" source="ScriptStorage"/>
- <ContextDataSource id="ActionLog" context="current" source="ActionLog"/>
- <ContextDataSource id="ScriptType" context="current" source="ScriptType"/>
- <ContextDataSource id="canCommit" context="current" source="canCommit"/>
- <ContextDataSource id="canUpdate" context="current" source="canUpdate"/>
- <ContextDataSource id="canDiff" context="current" source="canDiff"/>
- <ContextDataSource id="canDelete" context="current" source="canDelete"/>
--->
-
<!--
| Toolbar
+-->
<JPanel id="buttonBar" layout='{new GridLayout()}' constraints='BorderLayout.NORTH'>
<JComboBox id="ScriptTypeChoice" model='{new DefaultComboBoxModel(getContextValue(ScriptAction.class).getScriptTypesNames())}'/>
+ <JButton id="buttonScriptNew" text="isisfish.script.new" onActionPerformed='newScript()'/>
<!--
-origin="ScriptType"
-renderer="org.codelutin.i18n.I18n._(.)"
--->
-
- <!-- no change name in combo box, or change for menu and in Action.newScript too -->
-<!-- Fixme : comboboxmodel
- <comboboxmodel origin="fr.ifremer.isisfish.ui.script.Action.getScriptTypesNames()"/>
--->
- <JButton id="buttonScriptNew" text="isisfish.script.new"/>
-<!--
ToolTipText="Create a new script"
actionCommand="script.Action.newScript($tree, $treeModel, $ScriptTypeChoice/selectedItem)"
-->
- <JButton id="buttonScriptSave" text="isisfish.script.save"/>
+ <JButton id="buttonScriptSave" text="isisfish.script.save" enabled='false' onActionPerformed='saveScript()'/>
<!--
ToolTipText="Save current script"
origin="util:isValid($ScriptStorage)"
actionCommand="script.Action.saveScript($ScriptStorage, $scriptJedit/text)"
-->
- <JButton id="buttonScriptExport" text="isisfish.script.txtExport"/>
+ <JButton id="buttonScriptExport" text="isisfish.script.txtExport" enabled='false' onActionPerformed='exportScript()'/>
<!--
ToolTipText="Export selected script(s) to zip archive"
origin="$tree/selectionPaths"
actionCommand="script.Action.exportScript($tree)"
-->
- <JButton id="buttonScriptCommit" text="isisfish.script.commit"/>
+ <JButton id="buttonScriptCommit" text="isisfish.script.commit" enabled='false' onActionPerformed='commitScript()'/>
<!--
ToolTipText="Commit script to CVS server"
origin="$canCommit"
actionCommand="script.Action.commitScript($tree, $ScriptStorage, $scriptJedit/text)"
-->
- <JButton id="buttonScriptUpdate" text="isisfish.script.update"/>
+ <JButton id="buttonScriptUpdate" text="isisfish.script.update" enabled='false' onActionPerformed='updateScript()'/>
<!--
ToolTipText="Update current script from server"
origin="$canUpdate"
actionCommand="script.Action.updateScript($tree,$ScriptStorage)"
-->
- <JButton id="buttonScriptCut" text="isisfish.script.cut"/>
+ <JButton id="buttonScriptCut" text="isisfish.script.cut" enabled='false' onActionPerformed='cut()'/>
<!--
ToolTipText="Cut current selection (Ctrl-x)"
origin="util:isValid($ScriptStorage)"
actionCommand="xpath:cut($scriptJedit)"
-->
- <JButton id="buttonScriptCopy" text="isisfish.script.copy"/>
+ <JButton id="buttonScriptCopy" text="isisfish.script.copy" enabled='false' onActionPerformed='copy()'/>
<!--
ToolTipText="Copy current selection (Ctrl-c)"
origin="util:isValid($ScriptStorage)"
actionCommand="xpath:copy($scriptJedit)"
-->
- <JButton id="buttonScriptPaste" text="isisfish.script.paste"/>
+ <JButton id="buttonScriptPaste" text="isisfish.script.paste" enabled='false' onActionPerformed='paste()'/>
<!--
ToolTipText="Paste current selection (Ctrl-v)"
origin="util:isValid($ScriptStorage)"
actionCommand="xpath:paste($scriptJedit)"
-->
- <JButton id="buttonScriptCheck" text="isisfish.script.check"/>
+ <JButton id="buttonScriptCheck" text="isisfish.script.check" enabled='false' onActionPerformed='checkScript()'/>
<!--
ToolTipText="Check syntax of the current script"
origin="util:isInstance('fr.ifremer.isisfish.datastore.JavaSourceStorage', $ScriptStorage)"
actionCommand="script.Action.checkScript($ScriptStorage, $scriptJedit/text)"
-->
- <JButton id="buttonScriptEval" text="isisfish.script.evaluate"/>
+ <JButton id="buttonScriptEval" text="isisfish.script.evaluate" enabled='false' onActionPerformed='evaluateScript()'/>
<!--
ToolTipText="Try to eval current script (must be have main method)"
origin="util:isInstance('fr.ifremer.isisfish.datastore.JavaSourceStorage', $ScriptStorage)"
@@ -246,13 +307,7 @@
<!-- Fixme : non plus : JScrollPane does not accept constraints
constraints='"tree"'
-->
- <JTree id="tree" name="tree" rootVisible="false">
- <item id='scriptItem' selected='true' value="Script"/>
- <item id='simulationItem' value="Simulator"/>
- <item id='exportItem' value="Export"/>
- <item id='ruleItem' value="Rule"/>
- <item id='analysePlanItem' value="AnalysePlan"/>
- <item id='equationModelItem' value="EquationModel"/>
+ <javax.swing.JTree id="tree" name="tree" rootVisible="false" model='{getTreeModel()}'/>
<!-- Fixme : NestedTreeModel, TreeRenderer and TreeSelectionEvents
<NestedTreeModel id="treeModel">
@@ -288,7 +343,6 @@
<TreeSelectionEvents id="treeSelectionListener"
onValueChanged="thread:script.Action.loadScript($tree, $tree/selectionPath/path[2]/userObject, $tree/selectionPath/lastPathComponent)"/>
-->
- </JTree>
</JScrollPane>
<JSplitPane oneTouchExpandable="true" dividerLocation="250" orientation="VERTICAL">
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-10-23 13:02:01 UTC (rev 1569)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-10-23 13:02:40 UTC (rev 1570)
@@ -45,9 +45,9 @@
import org.codelutin.math.matrix.gui.MatrixPanelEditor;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
+ import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+ import javax.swing.table.TableColumn;
import fr.ifremer.isisfish.ui.widget.editor.ParameterColumnEditor;
- import javax.swing.table.TableColumn;
-import fr.ifremer.isisfish.ui.widget.editor.ParameterCellEditor;
setContextValue(new MatrixPanelEditor());
simulParamsNumbers.add(getContextValue(MatrixPanelEditor.class), BorderLayout.CENTER);
@@ -208,7 +208,7 @@
for (Iterator<String> it = values.keySet().iterator(); it.hasNext();) {
String name = it.next();
Object properties = getContextValue(SimulAction.class).getRuleParameterValue(name, listSimulParamsMesuresList.getSelectedValue().toString());
- ParameterCellEditor value = new ParameterCellEditor(name, values.get(name));
+ GenericCell value = new GenericCell(name, values.get(name));
model.setValueAt(value, row, 0);
model.setValueAt(properties, row, 1);
row++;
@@ -223,7 +223,7 @@
public void tableChanged(TableModelEvent e) {
int row = e.getFirstRow();
TableModel model = (TableModel)e.getSource();
- ParameterCellEditor data = (ParameterCellEditor) model.getValueAt(row, 0);
+ GenericCell data = (GenericCell) model.getValueAt(row, 0);
getContextValue(SimulAction.class).setRuleParameterValue(data.getName(), listSimulParamsMesuresList.getSelectedValue().toString(), model.getValueAt(row, 1));
}
});
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2008-10-23 13:02:01 UTC (rev 1569)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2008-10-23 13:02:40 UTC (rev 1570)
@@ -38,7 +38,7 @@
import javax.swing.table.TableModel;
import fr.ifremer.isisfish.ui.widget.editor.ParameterColumnEditor;
import javax.swing.table.TableColumn;
- import fr.ifremer.isisfish.ui.widget.editor.ParameterCellEditor;
+ import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
public SensUI (SimulAction action){
setContextValue(action);
@@ -89,7 +89,7 @@
for (Iterator<String> it = values.keySet().iterator(); it.hasNext();) {
String name = it.next();
Object properties = getContextValue(SimulAction.class).getAnalysePlanParameterValue(name, listSimulParamsAnalysePlansList.getSelectedValue().toString());
- ParameterCellEditor value = new ParameterCellEditor(name, values.get(name));
+ GenericCell value = new GenericCell(name, values.get(name));
model.setValueAt(value, row, 0);
model.setValueAt(properties, row, 1);
row++;
@@ -103,7 +103,7 @@
public void tableChanged(TableModelEvent e) {
int row = e.getFirstRow();
TableModel model = (TableModel)e.getSource();
- ParameterCellEditor data = (ParameterCellEditor) model.getValueAt(row, 0);
+ GenericCell data = (GenericCell) model.getValueAt(row, 0);
getContextValue(SimulAction.class).setAnalysePlanParameterValue(data.getName(), listSimulParamsAnalysePlansList.getSelectedValue().toString(), model.getValueAt(row, 1));
}
});
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java 2008-10-23 13:02:40 UTC (rev 1570)
@@ -0,0 +1,29 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package fr.ifremer.isisfish.ui.widget.editor;
+
+/**
+ *
+ * @author letellier
+ */
+public class GenericCell{
+ private String name;
+ private Object value;
+ public GenericCell(String n, Object c){
+ name = n;
+ value = c;
+ }
+ @Override
+ public String toString(){
+ return name;
+ }
+ public Object getValue(){
+ return value;
+ }
+ public String getName(){
+ return name;
+ }
+}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterColumnEditor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterColumnEditor.java 2008-10-23 13:02:01 UTC (rev 1569)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterColumnEditor.java 2008-10-23 13:02:40 UTC (rev 1570)
@@ -152,8 +152,8 @@
// Map.Entry<String, Class> p = (Map.Entry<String, Class>) table.getValueAt(row, 0);
// type = p.getValue();
// log.debug(p.getKey() + " P.type:" + type);
- ParameterCellEditor p = (ParameterCellEditor) table.getValueAt(row, 0);
- type = p.getType();
+ GenericCell p = (GenericCell) table.getValueAt(row, 0);
+ type = (Class)p.getValue();
JComboBox c;
//if (!table.hasFocus()) return null;
1
0