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; - } -}