r1657 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
Author: sletellier Date: 2008-12-10 16:49:33 +0000 (Wed, 10 Dec 2008) New Revision: 1657 Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java 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/EffortDescriptionUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.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/InputNavigationTreeSelectionAdapter.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/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/StrategyMonthInfoUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 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 Log: Debug vol3 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -34,7 +34,13 @@ <!-- + Cell +--> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Cell; import com.bbn.openmap.gui.OMToolSet; @@ -47,13 +53,12 @@ protected IsisMapBean cellMap = new IsisMapBean(); protected OpenMapToolPanel toolMap = new OpenMapToolPanel(); protected OMToolSet toolSet = new OMToolSet(); - protected boolean changed = false; public CellUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { Cell cell = getContextValue(InputAction.class).getCell(); DefaultComboBoxModel fieldCellModel = new DefaultComboBoxModel(); java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell(); @@ -92,15 +97,17 @@ } } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Cell"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Cell"); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Cell"); + valueChanged(false); + refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+topia.getTopiaId()); setInfoText(_("isisfish.message.cancel.finished")); - refresh(); } protected void goToZone(){ getParentContainer(InputUI.class).setTreeSelection("$root/$zones"); @@ -145,59 +152,59 @@ <Table> <row> <cell fill='horizontal' columns='2' weightx='1.0'> - <JComboBox id="fieldCell" onActionPerformed='fieldCellChanged()'/> + <JComboBox id="fieldCell" onActionPerformed='fieldCellChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.cell.name"/> + <JLabel text="isisfish.cell.name" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldCellName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> + <JTextField id="fieldCellName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.cell.latitude"/> + <JLabel text="isisfish.cell.latitude" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldCellLatitude" editable="false"/> + <JTextField id="fieldCellLatitude" editable="false" enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.cell.longitude"/> + <JLabel text="isisfish.cell.longitude" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldCellLongitude" editable="false"/> + <JTextField id="fieldCellLongitude" editable="false" enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.cell.land"/> + <JLabel text="isisfish.cell.land" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JCheckBox id="fieldCellLand" onActionPerformed='cellLandChanged()'/> + <JCheckBox id="fieldCellLand" onActionPerformed='cellLandChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='horizontal'> - <JLabel text="isisfish.cell.comments"/> + <JLabel text="isisfish.cell.comments" enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='both' weighty='1.0' weightx='1.0'> <JScrollPane> - <JTextArea id="fieldCellComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldCellComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' text="isisfish.common.save" enabled='false' onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' text="isisfish.common.cancel" enabled='false' onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -30,7 +30,13 @@ * by : $Author: sletellier $ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.EffortDescription; @@ -40,7 +46,6 @@ import org.codelutin.topia.persistence.TopiaEntity; import fr.ifremer.isisfish.types.TimeUnit; - boolean changed = false; public EffortDescriptionUI (InputAction action){ setContextValue(action); @@ -107,17 +112,18 @@ fieldEffortDescriptionEffortDescriptionList.setModel(model); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("SetOfVessles"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("SetOfVessles"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("SetOfVessels"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void setInfoText(String txt){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); @@ -168,7 +174,6 @@ if (possibleMetier != null){ possibleMetier.setFishingOperation(Integer.parseInt(fieldEffortDescriptionFishingOperation.getText())); valueChanged(true); - refresh(); } } protected void fishingOperationDurationChanged(){ @@ -176,7 +181,6 @@ if (possibleMetier != null){ possibleMetier.setFishingOperationDuration(new TimeUnit(Double.parseDouble(fieldEffortDescriptionFishingOperationDuration.getText()))); valueChanged(true); - refresh(); } } protected void gearsNumberPerOperationChanged(){ @@ -184,7 +188,6 @@ if (possibleMetier != null){ possibleMetier.setGearsNumberPerOperation(Integer.parseInt(fieldEffortDescriptionGearsNumberPerOperation.getText())); valueChanged(true); - refresh(); } } protected void descriptionCrewSizeChanged(){ @@ -192,7 +195,6 @@ if (possibleMetier != null){ possibleMetier.setCrewSize(Integer.parseInt(fieldEffortDescriptionCrewSize.getText())); valueChanged(true); - refresh(); } } protected void costOfFishingChanged(){ @@ -200,7 +202,6 @@ if (possibleMetier != null){ possibleMetier.setUnitCostOfFishing(Double.parseDouble(fieldEffortDescriptionUnitCostOfFishing.getText())); valueChanged(true); - refresh(); } } protected void fixedCrewSalaryChanged(){ @@ -208,7 +209,6 @@ if (possibleMetier != null){ possibleMetier.setFixedCrewSalary(Double.parseDouble(fieldEffortDescriptionFixedCrewSalary.getText())); valueChanged(true); - refresh(); } } protected void crewFoodCostChanged(){ @@ -216,7 +216,6 @@ if (possibleMetier != null){ possibleMetier.setCrewFoodCost(Double.parseDouble(fieldEffortDescriptionCrewFoodCost.getText())); valueChanged(true); - refresh(); } } protected void crewShareRateChanged(){ @@ -224,7 +223,6 @@ if (possibleMetier != null){ possibleMetier.setCrewShareRate(Double.parseDouble(fieldEffortDescriptionCrewShareRate.getText())); valueChanged(true); - refresh(); } } protected void repairAndMaintenanceGearCostChanged(){ @@ -232,14 +230,12 @@ if (possibleMetier != null){ possibleMetier.setRepairAndMaintenanceGearCost(Double.parseDouble(fieldEffortDescriptionRepairAndMaintenanceGearCost.getText())); valueChanged(true); - refresh(); } } protected void langdingCostsChanged(){ EffortDescription possibleMetier = getEffortDescription(); if (possibleMetier != null){ possibleMetier.setLandingCosts(Double.parseDouble(fieldEffortDescriptionLandingCosts.getText())); - refresh(); } } protected void otherRunningCostChanged(){ @@ -247,7 +243,6 @@ if (possibleMetier != null){ possibleMetier.setOtherRunningCost(Double.parseDouble(fieldEffortDescriptionOtherRunningCost.getText())); valueChanged(true); - refresh(); } } ]]> @@ -255,7 +250,7 @@ <row> <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> <JScrollPane> - <JList id="fieldEffortDescriptionMetierList" selectionMode="0"/> + <JList id="fieldEffortDescriptionMetierList" selectionMode="0" enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -264,13 +259,13 @@ <Table> <row> <cell fill='horizontal' weightx='1.0'> - <JButton id="buttonEffortDescriptionAdd" text="isisfish.common.add" onActionPerformed='add()'/> + <JButton id="buttonEffortDescriptionAdd" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='both' weightx='1.0' weighty='1.0'> <JScrollPane> - <JList id="fieldEffortDescriptionEffortDescriptionList" selectionMode="0" onValueChanged='refresh()'/> + <JList id="fieldEffortDescriptionEffortDescriptionList" selectionMode="0" onValueChanged='refresh()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -280,90 +275,90 @@ <Table> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.fishingOperation"/> + <JLabel text="isisfish.effortDescription.fishingOperation" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionFishingOperation" onKeyTyped='valueChanged(true)' onFocusLost='fishingOperationChanged()'/> + <JTextField id="fieldEffortDescriptionFishingOperation" onKeyTyped='valueChanged(true)' onFocusLost='fishingOperationChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.fishingOperationDuration"/> + <JLabel text="isisfish.effortDescription.fishingOperationDuration" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionFishingOperationDuration" onKeyTyped='valueChanged(true)' onFocusLost='fishingOperationDurationChanged()'/> + <JTextField id="fieldEffortDescriptionFishingOperationDuration" onKeyTyped='valueChanged(true)' onFocusLost='fishingOperationDurationChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.gearsNumberPerOperation"/> + <JLabel text="isisfish.effortDescription.gearsNumberPerOperation" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionGearsNumberPerOperation" onKeyTyped='valueChanged(true)' onFocusLost='gearsNumberPerOperationChanged()'/> + <JTextField id="fieldEffortDescriptionGearsNumberPerOperation" onKeyTyped='valueChanged(true)' onFocusLost='gearsNumberPerOperationChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.crewSize"/> + <JLabel text="isisfish.effortDescription.crewSize" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionCrewSize" onKeyTyped='valueChanged(true)' onFocusLost='descriptionCrewSizeChanged()'/> + <JTextField id="fieldEffortDescriptionCrewSize" onKeyTyped='valueChanged(true)' onFocusLost='descriptionCrewSizeChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.unitCostOfFishing"/> + <JLabel text="isisfish.effortDescription.unitCostOfFishing" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionUnitCostOfFishing" onKeyTyped='valueChanged(true)' onFocusLost='costOfFishingChanged()'/> + <JTextField id="fieldEffortDescriptionUnitCostOfFishing" onKeyTyped='valueChanged(true)' onFocusLost='costOfFishingChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.fixedCrewSalary"/> + <JLabel text="isisfish.effortDescription.fixedCrewSalary" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionFixedCrewSalary" onKeyTyped='valueChanged(true)' onFocusLost='fixedCrewSalaryChanged()'/> + <JTextField id="fieldEffortDescriptionFixedCrewSalary" onKeyTyped='valueChanged(true)' onFocusLost='fixedCrewSalaryChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.crewFoodCost"/> + <JLabel text="isisfish.effortDescription.crewFoodCost" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionCrewFoodCost" onKeyTyped='valueChanged(true)' onFocusLost='crewFoodCostChanged()'/> + <JTextField id="fieldEffortDescriptionCrewFoodCost" onKeyTyped='valueChanged(true)' onFocusLost='crewFoodCostChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.crewShareRate"/> + <JLabel text="isisfish.effortDescription.crewShareRate" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionCrewShareRate" onKeyTyped='valueChanged(true)' onFocusLost='crewShareRateChanged()'/> + <JTextField id="fieldEffortDescriptionCrewShareRate" onKeyTyped='valueChanged(true)' onFocusLost='crewShareRateChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.repairAndMaintenanceGearCost"/> + <JLabel text="isisfish.effortDescription.repairAndMaintenanceGearCost" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionRepairAndMaintenanceGearCost" onKeyTyped='valueChanged(true)' onFocusLost='repairAndMaintenanceGearCostChanged()'/> + <JTextField id="fieldEffortDescriptionRepairAndMaintenanceGearCost" onKeyTyped='valueChanged(true)' onFocusLost='repairAndMaintenanceGearCostChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.landingCosts"/> + <JLabel text="isisfish.effortDescription.landingCosts" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionLandingCosts" onKeyTyped='valueChanged(true)' onFocusLost='langdingCostsChanged()'/> + <JTextField id="fieldEffortDescriptionLandingCosts" onKeyTyped='valueChanged(true)' onFocusLost='langdingCostsChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.effortDescription.otherRunningCost"/> + <JLabel text="isisfish.effortDescription.otherRunningCost" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionOtherRunningCost" onKeyTyped='valueChanged(true)' onFocusLost='otherRunningCostChanged()'/> + <JTextField id="fieldEffortDescriptionOtherRunningCost" onKeyTyped='valueChanged(true)' onFocusLost='otherRunningCostChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -371,13 +366,13 @@ <Table> <row> <cell fill='horizontal' weightx='0.3'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.3'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.3'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -33,7 +33,13 @@ <!-- + FisheryRegion +--> -<JPanel id="inputFisheryRegion" layout='{new BorderLayout()}'> +<Table id="inputFisheryRegion" implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script> <![CDATA[ import fr.ifremer.isisfish.entities.FisheryRegion; @@ -42,7 +48,6 @@ import fr.ifremer.isisfish.map.OpenMapToolPanel; import fr.ifremer.isisfish.ui.WelcomePanelUI; - protected boolean changed = false; protected FisheryRegion region = null; protected IsisMapBean cellMap = null; protected OpenMapToolPanel toolMap = new OpenMapToolPanel(); @@ -88,7 +93,6 @@ fieldMapfiles.setModel(model); } protected void valueChanged(boolean b){ - jaxx.runtime.Util.assignment(changed = b, "changed", fr.ifremer.isisfish.ui.input.FisheryRegionUI.this); save.setEnabled(b); cancel.setEnabled(b); } @@ -141,7 +145,6 @@ } protected void commentChanged(){ region.setComment(fieldComment.getText()); - refreshMap(); } protected void cellFillChanged(){ } @@ -159,7 +162,9 @@ } protected void cancel(){ getContextValue(InputAction.class).cancel("FisheryRegion"); - valueChanged(false); + valueChanged(false); + refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root"); } protected void check(){ getContextValue(InputAction.class).checkFisheryRegion(); @@ -173,216 +178,157 @@ } ]]> </script> - <JSplitPane id="FisheryRegionTab" name="FisheryRegion" - oneTouchExpandable="true" dividerLocation="200" orientation="HORIZONTAL" constraints='BorderLayout.CENTER'> - <Table> - <!-- Widget --> - <row> - <cell columns='3'> - <JLabel text="isisfish.fisheryRegion.name"/> - </cell> - </row> - <row> - <cell columns='3' fill='horizontal' weightx='1.0'> - <JTextField id="fieldRegion" onKeyTyped='valueChanged(true)' onFocusLost='regionChanged()'/> -<!-- Fixme : DocumentEvents -origin="$RegionStorage/name" -<DocumentEvents id="updateRegion" onChangedUpdate="Update($fieldRegion/text)"/> ---> - </cell> - </row> - <row> - <cell columns='3'> - <JLabel text="isisfish.fisheryRegion.area"/> - </cell> - </row> - <row> - <cell> - <JLabel text="isisfish.fisheryRegion.latitude.min"/> - </cell> - <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldLatMin" onKeyTyped='valueChanged(true)' onFocusLost='latMinChanged()'/> -<!-- Fixme : DocumentEvents -origin="$FisheryRegion/minLatitude" -<DocumentEvents onModified="Update($fieldLatMin/text)"/> ---> - </cell> - </row> - <row> - <cell> - <JLabel text="isisfish.fisheryRegion.latitude.max"/> - </cell> - <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldLatMax" onKeyTyped='valueChanged(true)' onFocusLost='latMaxChanged()'/> -<!-- Fixme : DocumentEvents -origin="$FisheryRegion/maxLatitude" -<DocumentEvents onModified="Update($fieldLatMax/text)"/> ---> - </cell> - </row> - <row> - <cell> - <JLabel text="isisfish.fisheryRegion.longitude.min"/> - </cell> - <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldLongMin" onKeyTyped='valueChanged(true)' onFocusLost='longMinChanged()'/> -<!-- Fixme : DocumentEvents -origin="$FisheryRegion/minLongitude" -<DocumentEvents onModified="Update($fieldLongMin/text)"/> ---> - </cell> - </row> - <row> - <cell> - <JLabel text="isisfish.fisheryRegion.longitude.max"/> - </cell> - <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldLongMax" onKeyTyped='valueChanged(true)' onFocusLost='longMaxChanged()'/> -<!-- Fixme : DocumentEvents -origin="$FisheryRegion/maxLongitude" -<DocumentEvents onModified="Update($fieldLongMax/text)"/> ---> - </cell> - </row> - <row> - <cell columns='3'> - <JLabel text="isisfish.fisheryRegion.spatial"/> - </cell> - </row> - <row> - <cell> - <JLabel text="isisfish.fisheryRegion.latitude"/> - </cell> - <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldCellLengthLatitude" onKeyTyped='valueChanged(true)' onFocusLost='cellLenghtLatChanged()'/> -<!-- Fixme : DocumentEvents -origin="$FisheryRegion/cellLengthLatitude" -<DocumentEvents onModified="Update($fieldCellLengthLatitude/text)"/> ---> - </cell> - </row> - <row> - <cell> - <JLabel text="isisfish.fisheryRegion.longitude"/> - </cell> - <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldCellLengthLongitude" onKeyTyped='valueChanged(true)' onFocusLost='cellLenghtLongChanged()'/> -<!-- Fixme : DocumentEvents -origin="$FisheryRegion/cellLengthLongitude" -<DocumentEvents onModified="Update($fieldCellLengthLongitude/text)"/> ---> - </cell> - </row> - <row> - <cell columns='3' fill='both' weightx='1.0' weighty='0.6'> - <JScrollPane> - <JList id="fieldMapfiles" onMouseClicked='mapFieldChanged()'/> - <!-- Fixme : ListModel - <ListModel origin="$FisheryRegion/mapFileList"/> - --> - </JScrollPane> - </cell> - </row> - <row> - <cell columns='3' fill='horizontal' weightx='1.0'> - <Table> - <row> - <cell fill='horizontal' weightx='0.5'> - <JButton id="buttonAddMap" text="isisfish.fisheryRegion.addMap" onActionPerformed='addMap()'/> -<!-- -actionCommand="input.InputFisheryRegion.addMap($FisheryRegion, $fieldMapfiles)" ---> - </cell> - <cell fill='horizontal' weightx='0.5'> - <JButton id="buttonRemoveMap" text="isisfish.fisheryRegion.delMap" onActionPerformed='delMap()'/> -<!-- -actionCommand="input.InputFisheryRegion.removeMap($FisheryRegion, $fieldMapfiles)" ---> - </cell> - </row> - </Table> - </cell> - </row> - <row> - <cell columns='3'> - <JLabel text="isisfish.fisheryRegion.comments"/> - </cell> - </row> - <row> - <cell columns='3' fill='both' weightx='1.0' weighty='0.4'> - <JScrollPane> - <JTextArea id="fieldComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> -<!-- Fixme : DocumentEvents -origin="$FisheryRegion/comment" -<DocumentEvents onModified="Update($fieldComment/text)"/> ---> - </JScrollPane> - </cell> - </row> - <row> - <cell columns='3'> - <JLabel text="isisfish.fisheryRegion.selectFile"/> - </cell> - </row> - <row> - <cell columns='3'> - <JLabel text="isisfish.fisheryRegion.ofCells"/> - </cell> - </row> - <row> - <cell columns='3' fill='horizontal' weightx='1.0'> - <Table> - <row> - <cell columns='4' fill='horizontal' weightx='1.0'> - <JTextField id="fieldCellFile" onKeyTyped='valueChanged(true)' onFocusLost='cellFillChanged()'/> - </cell> - <cell> - <JButton id="buttonCellFile" text="isisfish.common.ellipsis" onActionPerformed='cellFile()'/> -<!-- -actionCommand="input.InputFisheryRegion.loadCellFile($fieldCellFile)" ---> - </cell> - </row> - </Table> - </cell> - </row> - <row> - <cell fill='horizontal' weightx='0.3'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> -<!-- -origin="$EntityModified" -actionCommand='thread:input.InputFisheryRegion.save("FisheryRegion", $FisheryRegion);refreshView($inputFisheryRegion)' ---> - </cell> - <cell fill='horizontal' weightx='0.3'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> -<!-- -origin="$EntityModified" -actionCommand='input.Input.cancel("FisheryRegion", $FisheryRegion);refreshView($inputFisheryRegion)' ---> - </cell> - <cell fill='horizontal' weightx='0.3'> - <JButton id='check' text="isisfish.common.check" onActionPerformed='check()'/> -<!-- -actionCommand='thread:input.InputFisheryRegion.check($FisheryRegion)' ---> - </cell> - </row> - </Table> - <JPanel id="fisheryRegionMapPanel" layout='{new BorderLayout()}'> -<!-- - <OpenMapToolPanel constraints='"BorderLayout.NORTH"' id="fisheryRegionMapTool"> - <OpenMapToolSet id="fisheryRegionMapToolSet" origin="$fisheryRegionMap"/> - </OpenMapToolPanel> - <OpenMap id="fisheryRegionMap" origin="$FisheryRegion" - selectionMode="0"> - <OpenMapEvents id="fisheryRegionMapEvents" mouseMode="Nav"/> - </OpenMap> ---> - </JPanel> - </JSplitPane> - <JButton text="isisfish.input.continueCells" constraints='BorderLayout.SOUTH' onActionPerformed='goToCell()'/> -<!-- - actionCommand="UIHelper.setTreeSelection('Cells')" ---> -</JPanel> + + <row> + <cell fill='both' weightx='1.0' weighty='1.0'> + <JSplitPane id="FisheryRegionTab" name="FisheryRegion" + oneTouchExpandable="true" dividerLocation="200" orientation="HORIZONTAL"> + <Table> + <!-- Widget --> + <row> + <cell columns='3'> + <JLabel text="isisfish.fisheryRegion.name"/> + </cell> + </row> + <row> + <cell columns='3' fill='horizontal' weightx='1.0'> + <JTextField id="fieldRegion" onKeyTyped='valueChanged(true)' onFocusLost='regionChanged()'/> + </cell> + </row> + <row> + <cell columns='3'> + <JLabel text="isisfish.fisheryRegion.area"/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.fisheryRegion.latitude.min"/> + </cell> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JTextField id="fieldLatMin" onKeyTyped='valueChanged(true)' onFocusLost='latMinChanged()'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.fisheryRegion.latitude.max"/> + </cell> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JTextField id="fieldLatMax" onKeyTyped='valueChanged(true)' onFocusLost='latMaxChanged()'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.fisheryRegion.longitude.min"/> + </cell> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JTextField id="fieldLongMin" onKeyTyped='valueChanged(true)' onFocusLost='longMinChanged()'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.fisheryRegion.longitude.max"/> + </cell> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JTextField id="fieldLongMax" onKeyTyped='valueChanged(true)' onFocusLost='longMaxChanged()'/> + </cell> + </row> + <row> + <cell columns='3'> + <JLabel text="isisfish.fisheryRegion.spatial"/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.fisheryRegion.latitude"/> + </cell> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JTextField id="fieldCellLengthLatitude" onKeyTyped='valueChanged(true)' onFocusLost='cellLenghtLatChanged()'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.fisheryRegion.longitude"/> + </cell> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JTextField id="fieldCellLengthLongitude" onKeyTyped='valueChanged(true)' onFocusLost='cellLenghtLongChanged()'/> + </cell> + </row> + <row> + <cell columns='3' fill='both' weightx='1.0' weighty='0.6'> + <JScrollPane> + <JList id="fieldMapfiles" onMouseClicked='mapFieldChanged()'/> + </JScrollPane> + </cell> + </row> + <row> + <cell columns='3' fill='horizontal' weightx='1.0'> + <Table> + <row> + <cell fill='horizontal' weightx='0.5'> + <JButton id="buttonAddMap" text="isisfish.fisheryRegion.addMap" onActionPerformed='addMap()'/> + </cell> + <cell fill='horizontal' weightx='0.5'> + <JButton id="buttonRemoveMap" text="isisfish.fisheryRegion.delMap" onActionPerformed='delMap()'/> + </cell> + </row> + </Table> + </cell> + </row> + <row> + <cell columns='3'> + <JLabel text="isisfish.fisheryRegion.comments"/> + </cell> + </row> + <row> + <cell columns='3' fill='both' weightx='1.0' weighty='0.4'> + <JScrollPane> + <JTextArea id="fieldComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + </JScrollPane> + </cell> + </row> + <row> + <cell columns='3'> + <JLabel text="isisfish.fisheryRegion.selectFile"/> + </cell> + </row> + <row> + <cell columns='3'> + <JLabel text="isisfish.fisheryRegion.ofCells"/> + </cell> + </row> + <row> + <cell columns='3' fill='horizontal' weightx='1.0'> + <Table> + <row> + <cell columns='4' fill='horizontal' weightx='1.0'> + <JTextField id="fieldCellFile" onKeyTyped='valueChanged(true)' onFocusLost='cellFillChanged()'/> + </cell> + <cell> + <JButton id="buttonCellFile" text="isisfish.common.ellipsis" onActionPerformed='cellFile()'/> + </cell> + </row> + </Table> + </cell> + </row> + <row> + <cell fill='horizontal' weightx='0.3'> + <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + </cell> + <cell fill='horizontal' weightx='0.3'> + <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + </cell> + <cell fill='horizontal' weightx='0.3'> + <JButton id='check' text="isisfish.common.check" onActionPerformed='check()'/> + </cell> + </row> + </Table> + <JPanel id="fisheryRegionMapPanel" layout='{new BorderLayout()}'/> + </JSplitPane> + </cell> + </row> + <row> + <cell fill='horizontal' weightx='1.0'> + <JButton text="isisfish.input.continueCells" onActionPerformed='goToCell()'/> + </cell> + </row> +</Table> 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -30,19 +30,24 @@ * by : $Author: sletellier $ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Gear; import fr.ifremer.isisfish.ui.WelcomePanelUI; import org.codelutin.topia.persistence.TopiaEntity; import org.codelutin.topia.TopiaException; - protected boolean changed = false; public GearTabUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { Gear gear = getContextValue(InputAction.class).getGear(); if (gear != null){ fieldGearName.setText(gear.getName()); @@ -76,7 +81,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Gear"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); @@ -84,10 +89,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Gear"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Gear"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -139,54 +145,54 @@ <Table> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.gear.name"/> + <JLabel text="isisfish.gear.name" enabled='{isActif()}'/> </cell> <cell columns="2" fill='horizontal' weightx='1.0'> - <JTextField id="fieldGearName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> + <JTextField id="fieldGearName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.gear.effortUnit"/> + <JLabel text="isisfish.gear.effortUnit" enabled='{isActif()}'/> </cell> <cell columns="2" fill='horizontal' weightx='1.0'> - <JTextField id="fieldGearEffortUnit" onKeyTyped='valueChanged(true)' onFocusLost='effortUnitChanged()'/> + <JTextField id="fieldGearEffortUnit" onKeyTyped='valueChanged(true)' onFocusLost='effortUnitChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.gear.standardisationFactor"/> + <JLabel text="isisfish.gear.standardisationFactor" enabled='{isActif()}'/> </cell> <cell columns="2" fill='horizontal' weightx='1.0'> - <JTextField id="fieldGearStandardisationFactor" onKeyTyped='valueChanged(true)' onFocusLost='standardisationFactorChanged()'/> + <JTextField id="fieldGearStandardisationFactor" onKeyTyped='valueChanged(true)' onFocusLost='standardisationFactorChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.gear.technicalParameter"/> + <JLabel text="isisfish.gear.technicalParameter" enabled='{isActif()}'/> </cell> <cell columns="2" fill='horizontal' weightx='1.0'> - <JTextField id="fieldGearParamName" onKeyTyped='valueChanged(true)' onFocusLost='paramNameChanged()'/> + <JTextField id="fieldGearParamName" onKeyTyped='valueChanged(true)' onFocusLost='paramNameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.gear.rangeValues"/> + <JLabel text="isisfish.gear.rangeValues" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JComboBox id="fieldGearParamType" onActionPerformed='paramTypeChanged()'/> + <JComboBox id="fieldGearParamType" onActionPerformed='paramTypeChanged()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JTextField id="fieldGearParamPossibleValue" onKeyTyped='valueChanged(true)' onFocusLost='paramPossibleValueChanged()'/> + <JTextField id="fieldGearParamPossibleValue" onKeyTyped='valueChanged(true)' onFocusLost='paramPossibleValueChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.gear.comments"/> + <JLabel text="isisfish.gear.comments" enabled='{isActif()}'/> </cell> <cell columns="2" fill='both' weightx='1.0' weighty='1.0'> <JScrollPane> - <JTextArea id="fieldGearComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldGearComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -198,18 +204,18 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id="save" enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id="save" enabled='{isActif()}' text="isisfish.common.save" onActionPerformed='save()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' enabled='{isActif()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/> </cell> </row> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id="create" text="isisfish.common.new" onActionPerformed='create()'/> + <JButton id="create" text="isisfish.common.new" onActionPerformed='create()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -35,14 +35,20 @@ <!-- + Gear +--> -<JPanel layout='{new BorderLayout()}'> +<JPanel id='panel' layout='{new BorderLayout()}' implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Metier; public GearUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { gearTabUI.refresh(); selectivityUI.refresh(); } 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-10 16:49:33 UTC (rev 1657) @@ -530,7 +530,7 @@ * id to refresh after commit * @return if ok return null else OutView error */ - public TopiaEntity save(String idToRefresh) { + public TopiaEntity save() { log.debug("save called"); try { if (selected == null) { @@ -558,7 +558,7 @@ * interface Tab to refresh after rollback and reload * @return if ok return null else OutView error */ - public Object cancel(String type) { + public TopiaEntity cancel(String type) { log.debug("cancel called"); try { isisContext.rollbackTransaction(); @@ -566,12 +566,13 @@ // reload the object if (selected != null) { selected = isisContext.findByTopiaId(selected.getTopiaId()); + setValue(selected); } } catch (Exception eee) { log.error("Can't cancel modification in region", eee); showMsgBox(eee); } - return null; + return selected; } /** Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java 2008-12-10 16:49:33 UTC (rev 1657) @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package fr.ifremer.isisfish.ui.input; + +/** + * + * @author letellier + */ +public interface InputContent { + + void refresh(); + + java.lang.Boolean isActif(); + + java.lang.Boolean isChanged(); + + void setActif(java.lang.Boolean b); + + void setChanged(java.lang.Boolean b); +} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-10 16:49:33 UTC (rev 1657) @@ -16,7 +16,8 @@ import javax.swing.JPanel; import javax.swing.event.TreeSelectionEvent; import java.awt.Component; -import java.lang.reflect.Method; +import javax.swing.JOptionPane; +import static org.codelutin.i18n.I18n._; /** @author letellier */ public class InputNavigationTreeSelectionAdapter extends NavigationTreeSelectionAdapterWithCardLayout { @@ -72,15 +73,54 @@ super.openUI(newUI, node); // apply refresh method (should a contract for all this ui with a method refresh...) try { - Method m = newUI.getClass().getDeclaredMethod("refresh"); - m.setAccessible(true); - m.invoke(newUI); - } catch (NoSuchMethodException e) { - // ok do nothing + InputContent ui = (InputContent) newUI; + boolean parameter = context.getContextValue(InputAction.class).getSelected() != null; + log.debug(parameter); +// Method setActif = newUI.getClass().getDeclaredMethod("setActif", Boolean.class); +// setActif.setAccessible(true); +// setActif.invoke(newUI, parameter); + ui.setActif(parameter); + ui.refresh(); +// Method refresh = newUI.getClass().getDeclaredMethod("refresh"); +// refresh.setAccessible(true); +// refresh.invoke(newUI); + } catch (Exception e) { + log.debug(e.getMessage(), e); } } @Override + protected boolean closeUI(TreeSelectionEvent event, Component component) throws Exception { + // by default, we says that component was succesfull closed + return checkEdit(component); + } + public boolean checkEdit(Component content) { + boolean wasClosed = true; + if (content != null){ + InputContent ui = (InputContent) content; + if (ui.isActif()) { + if (ui.isChanged()) { + // ask user to close edition + // still in edit mode, must warn user + boolean willQuit = askUser(content, _("isisfish.message.page.modified")); + if (!willQuit) { + return false; + } + } + context.getContextValue(InputAction.class).save(); + ui.setChanged(false); + } + } + return wasClosed; + } + + public boolean askUser(Component parent, String message) { + int response = JOptionPane.showConfirmDialog(parent, message, + _("isisfish.input.menu.commit"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); + return response == JOptionPane.OK_OPTION; + } + + @Override protected void addSelectedBeanInContext(NavigationTreeNode node, Object data) { if (log.isDebugEnabled()) { log.debug("find data for contextPath <" + node.getContextPath() + "> : " + (data == null ? null : data.getClass())); Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import com.l2fprod.common.swing.renderer.BooleanCellRenderer; import java.util.logging.Level; @@ -49,12 +55,11 @@ import fr.ifremer.isisfish.entities.Species; import javax.swing.table.TableCellEditor; - boolean changed = false; public MetierSeasonInfoSpeciesUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { if (getContextValue(InputAction.class).getMetier() != null){ if (fieldMetierSeasonInfo.getSelectedIndex() <= 0){ setSeasonModel(); @@ -186,17 +191,18 @@ refresh(); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Metier"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Metier"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void valueChanged(boolean b){ changed=b; Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Season; import fr.ifremer.isisfish.types.Month; @@ -44,14 +50,14 @@ import org.codelutin.topia.persistence.TopiaEntity; import fr.ifremer.isisfish.ui.WelcomePanelUI; - protected boolean changed = false; + protected boolean seasonInit = true; protected IntervalPanel ip = new IntervalPanel(); displayMetierSeason.add(ip, BorderLayout.CENTER); public MetierSeasonInfoZoneUI (InputAction action){ setContextValue(action); } - protected void refresh(boolean seasonInit) { + public void refresh() { Metier metier = getContextValue(InputAction.class).getMetier(); if (metier != null){ if (seasonInit){ @@ -158,28 +164,30 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Metier"); + TopiaEntity topia = getContextValue(InputAction.class).save(); setInfoText(_("isisfish.message.save.finished")); - refresh(false); + seasonInit = false; + refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Metier"); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier"); + valueChanged(false); + refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId()); setInfoText(_("isisfish.message.cancel.finished")); - valueChanged(false); - refresh(false); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); valueChanged(false); - refresh(false); + seasonInit = false; + refresh(); } protected void setInfoText(String txt){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); root.setInfoText(txt); } protected void valueChanged(boolean b){ - changed=b; cancel.setEnabled(b); save.setEnabled(b); } @@ -209,43 +217,50 @@ } valueChanged(true); } + public void setSeasonInit(boolean b){ + seasonInit = b; + } + protected void metierSeasonChanged(){ + seasonInit = false; + refresh(); + } ]]></script> <row> <cell fill='both' weightx='1.0' weighty='1.0'> <Table> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.metierSeasonInfoZone.selectSeason"/> + <JLabel text="isisfish.metierSeasonInfoZone.selectSeason" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldMetierSeasonChoice" onActionPerformed='refresh(false)'/> + <JComboBox id="fieldMetierSeasonChoice" onActionPerformed='metierSeasonChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.metierSeasonInfoZone.season"/> + <JLabel text="isisfish.metierSeasonInfoZone.season" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JPanel id='displayMetierSeason' layout='{new BorderLayout()}'/> + <JPanel id='displayMetierSeason' layout='{new BorderLayout()}' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.common.zone"/> + <JLabel text="isisfish.common.zone" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='0.7'> <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'> - <JList id="metierZones" onValueChanged='zonesChanged()'/> + <JList id="metierZones" onValueChanged='zonesChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.metierSeasonInfoZone.comments"/> + <JLabel text="isisfish.metierSeasonInfoZone.comments" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='0.3'> <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'> - <JTextArea id="fieldMetierSeasonZoneComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldMetierSeasonZoneComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -257,10 +272,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id ='save' text="isisfish.common.save" onActionPerformed='save()' enabled='false'/> + <JButton id ='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='false'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> @@ -268,7 +283,7 @@ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Gear; @@ -43,12 +49,11 @@ import java.util.logging.Level; import java.util.logging.Logger; - protected boolean changed = false; public MetierTabUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { try { Metier metier = getContextValue(InputAction.class).getMetier(); DefaultComboBoxModel model = new DefaultComboBoxModel(getContextValue(InputAction.class).getFisheryRegion().getGear().toArray()); @@ -90,7 +95,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Metier"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); @@ -98,10 +103,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Metier"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -123,35 +129,35 @@ <Table> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.metier.name"/> + <JLabel text="isisfish.metier.name" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldMetierName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> + <JTextField id="fieldMetierName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.common.gear"/> + <JLabel text="isisfish.common.gear" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldMetierGear" onActionPerformed='gearChanged()'/> + <JComboBox id="fieldMetierGear" onActionPerformed='gearChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.metier.rangeValues"/> + <JLabel text="isisfish.metier.rangeValues" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldMetierParam" onKeyTyped='valueChanged(true)' onFocusLost='paramChanged()'/> + <JTextField id="fieldMetierParam" onKeyTyped='valueChanged(true)' onFocusLost='paramChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.metier.comments"/> + <JLabel text="isisfish.metier.comments" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='1.0'> <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'> - <JTextArea id="fieldMetierComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldMetierComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -163,10 +169,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id="save" enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id="save" text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id="cancel" enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id="cancel" text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> @@ -174,7 +180,7 @@ <JButton id="create" text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -34,17 +34,25 @@ <!-- + Metier +--> -<JPanel layout='{new BorderLayout()}'> +<JPanel layout='{new BorderLayout()}' implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.TripType; public MetierUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { metierTabUI.refresh(); metierSeasonSpeciesUI.refresh(); - metierSeasonInfoUI.refresh(true); + + metierSeasonInfoUI.setSeasonInit(true); + metierSeasonInfoUI.refresh(); } protected void goToTripType(){ getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes"); Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Equation; @@ -46,7 +52,6 @@ import java.util.logging.Level; import java.util.logging.Logger; - boolean changed = false; protected Population pop = null; public PopulationBasicsUI (InputAction action){ @@ -269,7 +274,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Population"); + TopiaEntity topia = getContextValue(InputAction.class).save(); Population population = (Population) topia; getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+ population.getSpecies().getTopiaId() +"/$populations/"+topia.getTopiaId()); @@ -278,10 +283,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Population"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Population"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -307,53 +313,53 @@ <Table> <row> <cell anchor='east'> - <JLabel text="isisfish.populationBasics.name"/> + <JLabel text="isisfish.populationBasics.name" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldPopulationBasicsName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> + <JTextField id="fieldPopulationBasicsName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationBasics.geographicID"/> + <JLabel text="isisfish.populationBasics.geographicID" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldPopulationBasicsGeographicID" onKeyTyped='valueChanged(true)' onFocusLost='geographicChanged()'/> + <JTextField id="fieldPopulationBasicsGeographicID" onKeyTyped='valueChanged(true)' onFocusLost='geographicChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationBasics.numberGroup"/> + <JLabel text="isisfish.populationBasics.numberGroup" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JTextField id="fieldPopulationBasicsNbClasses" editable="false"/> + <JTextField id="fieldPopulationBasicsNbClasses" editable="false" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id="buttonPopulationBasicsCreateClasses" text="isisfish.populationBasics.recreateClasses" onActionPerformed='createClasses()'/> + <JButton id="buttonPopulationBasicsCreateClasses" text="isisfish.populationBasics.recreateClasses" onActionPerformed='createClasses()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationBasics.maturityGroup"/> + <JLabel text="isisfish.populationBasics.maturityGroup" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JComboBox id="fieldPopulationBasicsMatureClass" onActionPerformed='matureClassChanged()'/> + <JComboBox id="fieldPopulationBasicsMatureClass" onActionPerformed='matureClassChanged()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JCheckBox id="fieldPopulationBasicsPlusGroup" text="isisfish.populationBasics.plusGroup" onActionPerformed='plusGroupChanged()'/> + <JCheckBox id="fieldPopulationBasicsPlusGroup" text="isisfish.populationBasics.plusGroup" onActionPerformed='plusGroupChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='3' fill='both' weightx='1.0'> - <JTable id='tableAgeLength'/> + <JTable id='tableAgeLength' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationBasics.growth"/> + <JLabel text="isisfish.populationBasics.growth" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <JComboBox id="fieldPopulationBasicsGrowth" onActionPerformed='basicsGrowthChanged()'/> + <JComboBox id="fieldPopulationBasicsGrowth" onActionPerformed='basicsGrowthChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -361,12 +367,12 @@ <Table> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.saveModel" onActionPerformed='saveGrowthModel()'/> + <JButton text="isisfish.common.saveModel" onActionPerformed='saveGrowthModel()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.openEditor" onActionPerformed='openGrowthEditor()'/> + <JButton text="isisfish.common.openEditor" onActionPerformed='openGrowthEditor()' enabled='{isActif()}'/> </cell> </row> <row> @@ -378,16 +384,16 @@ </cell> <cell columns='2' fill='both' weightx='1.0' weighty='0.4'> <JScrollPane> - <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false"/> + <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false" enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationBasics.growthReverse"/> + <JLabel text="isisfish.populationBasics.growthReverse" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <JComboBox id="fieldPopulationBasicsGrowthReverse" onActionPerformed='growthReverseChanged()'/> + <JComboBox id="fieldPopulationBasicsGrowthReverse" onActionPerformed='growthReverseChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -395,12 +401,12 @@ <Table> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.saveModel" onActionPerformed='saveGrowthReverseModel()'/> + <JButton text="isisfish.common.saveModel" onActionPerformed='saveGrowthReverseModel()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.openEditor" onActionPerformed='openGrowthReverseEditor()'/> + <JButton text="isisfish.common.openEditor" onActionPerformed='openGrowthReverseEditor()' enabled='{isActif()}'/> </cell> </row> <row> @@ -412,17 +418,17 @@ </cell> <cell columns='2' fill='both' weightx='1.0' weighty='0.4'> <JScrollPane> - <org.codelutin.widget.editor.Editor id='editorReverse' askIfNotSaved="false"/> + <org.codelutin.widget.editor.Editor id='editorReverse' askIfNotSaved="false" enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.population.comments"/> + <JLabel text="isisfish.population.comments" enabled='{isActif()}'/> </cell> <cell columns='2' fill='both' weightx='1.0' weighty='0.2'> <JScrollPane> - <JTextArea id="fieldPopulationBasicsComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldPopulationBasicsComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -440,10 +446,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> @@ -451,7 +457,7 @@ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Population; @@ -41,7 +47,6 @@ import fr.ifremer.isisfish.ui.WelcomePanelUI; protected Population pop = null; - protected boolean changed = false; public PopulationCapturabilityUI (InputAction action){ setContextValue(action); @@ -74,17 +79,18 @@ valueChanged(true); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Population"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$population/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Metier"); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier"); + valueChanged(false); + refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId()); setInfoText(_("isisfish.message.cancel.finished")); - refresh(); - valueChanged(false); } protected void setInfoText(String txt){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); @@ -99,32 +105,32 @@ </script> <row> <cell columns='2' fill='horizontal' weightx='1.0' anchor='east'> - <JLabel text="isisfish.populationCapturability.selectCoefficient"/> + <JLabel text="isisfish.populationCapturability.selectCoefficient" enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='both' weightx='1.0'> - <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationCapturability'/> + <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationCapturability' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='horizontal' weightx='1.0' anchor='east'> - <JLabel text="isisfish.populationCapturability.comments"/> + <JLabel text="isisfish.populationCapturability.comments" enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> <JScrollPane> - <JTextArea id="fieldPopulationCapturabilityComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldPopulationCapturabilityComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -30,7 +30,13 @@ * by : $Author: sletellier $ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Formule; @@ -39,7 +45,6 @@ import fr.ifremer.isisfish.entities.Population; protected Population pop = null; - boolean changed = false; public PopulationEquationUI (InputAction action){ setContextValue(action); @@ -47,24 +52,28 @@ public void refresh(){ pop = getContextValue(InputAction.class).getPopulation(); if (pop != null){ - naturalDeathRate.refresh(_("isisfish.populationEquation.naturalDeathRate"), (Formule)pop.getNaturalDeathRate(), "NaturalDeathRate", fr.ifremer.isisfish.equation.PopulationNaturalDeathRate.class); - meanWeight.refresh(_("isisfish.populationEquation.meanWeight"), (Formule)pop.getMeanWeight(), "MeanWeight", fr.ifremer.isisfish.equation.PopulationMeanWeight.class); - price.refresh(_("isisfish.populationEquation.price"), (Formule)pop.getPrice(), "Price", fr.ifremer.isisfish.equation.PopulationPrice.class); + naturalDeathRate.init(_("isisfish.populationEquation.naturalDeathRate"), (Formule)pop.getNaturalDeathRate(), "NaturalDeathRate", fr.ifremer.isisfish.equation.PopulationNaturalDeathRate.class); + meanWeight.init(_("isisfish.populationEquation.meanWeight"), (Formule)pop.getMeanWeight(), "MeanWeight", fr.ifremer.isisfish.equation.PopulationMeanWeight.class); + price.init(_("isisfish.populationEquation.price"), (Formule)pop.getPrice(), "Price", fr.ifremer.isisfish.equation.PopulationPrice.class); + naturalDeathRate.refresh(); + meanWeight.refresh(); + price.refresh(); valueChanged(false); } } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Population"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Population"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Population"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void setInfoText(String txt){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); @@ -94,10 +103,10 @@ </row> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' text="isisfish.common.cancel" enabled='false' onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" enabled='{isActif()}' onActionPerformed='cancel()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' text="isisfish.common.save" enabled='false' onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" enabled='{isActif()}' onActionPerformed='save()'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.PopulationGroup; @@ -42,7 +48,6 @@ import org.codelutin.math.matrix.gui.MatrixPanelListener; import org.codelutin.math.matrix.gui.MatrixPanelEvent; - protected boolean changed = false; protected Population pop = null; protected PopulationGroup populationGroup = null; public PopulationGroupUI (InputAction action){ @@ -108,17 +113,18 @@ populationGroup.setComment(fieldPopulationGroupComment.getText()); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Population"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Population"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Population"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void setInfoText(String txt){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); @@ -132,70 +138,70 @@ </script> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.common.populationGroup"/> + <JLabel text="isisfish.common.populationGroup" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <JComboBox id='fieldPopulationGroupPopulationGroup' onActionPerformed='populationGroupChanged()'/> + <JComboBox id='fieldPopulationGroupPopulationGroup' onActionPerformed='populationGroupChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.populationGroup.meanWeigth"/> + <JLabel text="isisfish.populationGroup.meanWeigth" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldPopulationGroupMeanWeight"/> + <JTextField id="fieldPopulationGroupMeanWeight" enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.populationGroup.price"/> + <JLabel text="isisfish.populationGroup.price" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldPopulationGroupPrice"/> + <JTextField id="fieldPopulationGroupPrice" enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.populationGroup.naturalDeathRate"/> + <JLabel text="isisfish.populationGroup.naturalDeathRate" enabled='{isActif()}'/> </cell> <cell columns='2' fill='both' weightx='1.0' weighty='0.5'> - <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationGroupNaturalDeathRate'/> + <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationGroupNaturalDeathRate' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.populationGroup.reproductionRate"/> + <JLabel text="isisfish.populationGroup.reproductionRate" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldPopulationGroupReproductionRate" onKeyTyped='valueChanged(true)' onFocusLost='reproductionRateChanged()'/> + <JTextField id="fieldPopulationGroupReproductionRate" onKeyTyped='valueChanged(true)' onFocusLost='reproductionRateChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.populationGroup.age"/> + <JLabel text="isisfish.populationGroup.age" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldPopulationGroupAge"/> + <JTextField id="fieldPopulationGroupAge" enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.populationGroup.length"/> + <JLabel text="isisfish.populationGroup.length" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='0.5'> - <JTextField id="fieldPopulationGroupMinLength" onKeyTyped='valueChanged(true)' onFocusLost='groupMinLengthChanged()'/> + <JTextField id="fieldPopulationGroupMinLength" onKeyTyped='valueChanged(true)' onFocusLost='groupMinLengthChanged()' enabled='{isActif()}'/> </cell> <cell fill='both' weightx='0.5'> - <JTextField id="fieldPopulationGroupMaxLength" onKeyTyped='valueChanged(true)' onFocusLost='groupMaxLengthChanged()'/> + <JTextField id="fieldPopulationGroupMaxLength" onKeyTyped='valueChanged(true)' onFocusLost='groupMaxLengthChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.populationGroup.comments"/> + <JLabel text="isisfish.populationGroup.comments" enabled='{isActif()}'/> </cell> <cell columns='2' fill='both' weightx='1.0' weighty='0.5'> <JScrollPane> - <JTextArea id="fieldPopulationGroupComment" onKeyTyped='valueChanged(true)' onFocusLost='groupCommentChanged()'/> + <JTextArea id="fieldPopulationGroupComment" onKeyTyped='valueChanged(true)' onFocusLost='groupCommentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -204,10 +210,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' enabled='{isActif()}' text="isisfish.common.save" onActionPerformed='save()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' enabled='{isActif()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -34,7 +34,13 @@ <!-- name="isisfish.populationMigrationEmigration.title" --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Population; import fr.ifremer.isisfish.entities.PopulationSeasonInfo; @@ -56,8 +62,10 @@ setContextValue(action); } - public void refresh(PopulationSeasonInfo pi){ + public void init(PopulationSeasonInfo pi){ popInfo = pi; + } + public void refresh(){ pop = getContextValue(InputAction.class).getPopulation(); if (pop != null){ setFieldPopulationMigrationMigrationGroupChooserModel(); @@ -101,7 +109,7 @@ (Zone) fieldPopulationMigrationEmigrationDepartureZoneChooser.getSelectedItem(), Double.parseDouble(fieldPopulationMigrationEmigrationCoefficient.getText())); getParentContainer(PopulationMigrationUI.class).valueChanged(true); - refresh(popInfo); + refresh(); } protected void remove(){ @@ -119,30 +127,30 @@ log.error("Can't remove migration", eee); // return new OutputView("Error.xml", "error", eee.getMessage()); } - refresh(popInfo); + refresh(); } ]]> </script> <row> <cell> - <JLabel text="isisfish.common.populationGroup"/> + <JLabel text="isisfish.common.populationGroup" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JComboBox id="fieldPopulationMigrationEmigrationGroupChooser"/> + <JComboBox id="fieldPopulationMigrationEmigrationGroupChooser" enabled='{isActif()}'/> </cell> <cell> - <JLabel text="isisfish.populationMigrationEmigration.coefficient"/> + <JLabel text="isisfish.populationMigrationEmigration.coefficient" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JTextField id="fieldPopulationMigrationEmigrationCoefficient"/> + <JTextField id="fieldPopulationMigrationEmigrationCoefficient" enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.populationMigrationEmigration.departureZone"/> + <JLabel text="isisfish.populationMigrationEmigration.departureZone" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JComboBox id="fieldPopulationMigrationEmigrationDepartureZoneChooser"/> + <JComboBox id="fieldPopulationMigrationEmigrationDepartureZoneChooser" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='0.5'> <JPanel/> @@ -150,17 +158,17 @@ </row> <row columns='4'> <cell fill='horizontal' weightx='1.0'> - <JButton id="add" text="isisfish.common.add" onActionPerformed='add()'/> + <JButton id="add" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActif()}'/> </cell> </row> <row columns='4'> <cell fill='both' weightx='1.0' weighty='1.0'> - <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='populationMigrationEmigrationTable'/> + <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='populationMigrationEmigrationTable' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='4' fill='horizontal' weightx='1.0'> - <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -30,7 +30,13 @@ * by : $Author: sletellier $ */ --> -<Table name="isisfish.populationMigrationEquation.title"> +<Table name="isisfish.populationMigrationEquation.title" implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.PopulationSeasonInfo; @@ -38,22 +44,29 @@ import fr.ifremer.isisfish.entities.Formule; protected Population pop = null; + protected PopulationSeasonInfo popInfo = null; public PopulationMigrationEquationUI (InputAction action){ setContextValue(action); } - public void refresh(PopulationSeasonInfo popInfo){ + public void init(PopulationSeasonInfo pi){ + this.popInfo = pi; + } + public void refresh(){ pop = getContextValue(InputAction.class).getPopulation(); if (pop != null){ - migrationEquation.refresh(_("isisfish.common.migration"), (Formule)popInfo.getMigrationEquation(), "Migration", fr.ifremer.isisfish.equation.MigrationEquation.class); - emigrationEquation.refresh(_("isisfish.common.emigration"), (Formule)popInfo.getEmigrationEquation(), "Emigration", fr.ifremer.isisfish.equation.EmigrationEquation.class); - immigrationEquation.refresh(_("isisfish.common.immigration"), (Formule)popInfo.getImmigrationEquation(), "Immigration", fr.ifremer.isisfish.equation.ImmigrationEquation.class); + migrationEquation.init(_("isisfish.common.migration"), (Formule)popInfo.getMigrationEquation(), "Migration", fr.ifremer.isisfish.equation.MigrationEquation.class); + emigrationEquation.init(_("isisfish.common.emigration"), (Formule)popInfo.getEmigrationEquation(), "Emigration", fr.ifremer.isisfish.equation.EmigrationEquation.class); + immigrationEquation.init(_("isisfish.common.immigration"), (Formule)popInfo.getImmigrationEquation(), "Immigration", fr.ifremer.isisfish.equation.ImmigrationEquation.class); } else{ - migrationEquation.refresh(_("isisfish.common.migration"), null, "Migration", fr.ifremer.isisfish.equation.MigrationEquation.class); - emigrationEquation.refresh(_("isisfish.common.emigration"), null, "Emigration", fr.ifremer.isisfish.equation.EmigrationEquation.class); - immigrationEquation.refresh(_("isisfish.common.immigration"), null, "Immigration", fr.ifremer.isisfish.equation.ImmigrationEquation.class); + migrationEquation.init(_("isisfish.common.migration"), null, "Migration", fr.ifremer.isisfish.equation.MigrationEquation.class); + emigrationEquation.init(_("isisfish.common.emigration"), null, "Emigration", fr.ifremer.isisfish.equation.EmigrationEquation.class); + immigrationEquation.init(_("isisfish.common.immigration"), null, "Immigration", fr.ifremer.isisfish.equation.ImmigrationEquation.class); } + migrationEquation.refresh(); + emigrationEquation.refresh(); + immigrationEquation.refresh(); } ]]> </script> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -33,7 +33,13 @@ <!-- Fixme : ContextDataSource name="isisfish.populationMigrationImmigration.title" --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Population; @@ -48,12 +54,15 @@ protected PopulationSeasonInfo popInfo = null; protected Population pop = null; - public PopulationMigrationImmigrationUI (InputAction action){ + public PopulationMigrationImmigrationUI (InputAction action){ setContextValue(action); } - public void refresh(PopulationSeasonInfo pi){ - popInfo = pi; + + public void init(PopulationSeasonInfo pi){ + this.popInfo = pi; + } + public void refresh(){ pop = getContextValue(InputAction.class).getPopulation(); if (pop != null){ setFieldPopulationMigrationMigrationGroupChooserModel(); @@ -96,7 +105,7 @@ (Zone) fieldPopulationMigrationImmigrationArrivalZoneChooser.getSelectedItem(), Double.parseDouble(fieldPopulationMigrationImmigrationCoefficient.getText())); getParentContainer(PopulationMigrationUI.class).valueChanged(true); - refresh(popInfo); + refresh(); } protected void remove(){ int row = populationMigrationImmigrationTable.getTable().getSelectedRow(); @@ -107,30 +116,30 @@ MatrixND mat = popInfo.getImmigrationMatrix().copy(); mat.setValue(group, departure, arrival, 0); popInfo.setImmigrationMatrix(mat); - refresh(popInfo); + refresh(); } ]]> </script> <row> <cell> - <JLabel text="isisfish.common.populationGroup"/> + <JLabel text="isisfish.common.populationGroup" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JComboBox id="fieldPopulationMigrationImmigrationGroupChooser"/> + <JComboBox id="fieldPopulationMigrationImmigrationGroupChooser" enabled='{isActif()}'/> </cell> <cell> - <JLabel text="isisfish.populationMigrationImmigration.coefficient"/> + <JLabel text="isisfish.populationMigrationImmigration.coefficient" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JTextField id="fieldPopulationMigrationImmigrationCoefficient"/> + <JTextField id="fieldPopulationMigrationImmigrationCoefficient" enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.populationMigrationImmigration.arrivalZone"/> + <JLabel text="isisfish.populationMigrationImmigration.arrivalZone" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JComboBox id="fieldPopulationMigrationImmigrationArrivalZoneChooser"/> + <JComboBox id="fieldPopulationMigrationImmigrationArrivalZoneChooser" enabled='{isActif()}'/> </cell> <cell columns='2' fill='horizontal' weightx='0.5'> <JPanel/> @@ -138,18 +147,17 @@ </row> <row columns='4'> <cell fill='horizontal' weightx='1.0'> - <JButton id="buttonPopulationMigrationImmigrationAdd" text="isisfish.common.add" onActionPerformed='add()'/> + <JButton id="buttonPopulationMigrationImmigrationAdd" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActif()}'/> </cell> </row> <row columns='4'> <cell fill='both' weightx='1.0' weighty='1.0'> - <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='populationMigrationImmigrationTable'/> + <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='populationMigrationImmigrationTable' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='4' fill='horizontal' weightx='1.0'> - <JButton id="buttonPopulationImmigrationMigrationRemove" text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id="buttonPopulationImmigrationMigrationRemove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> -</Table> - +</Table> \ No newline at end of file Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.PopulationSeasonInfo; @@ -47,11 +53,15 @@ protected PopulationSeasonInfo popInfo = null; protected Population pop = null; - public PopulationMigrationMigrationUI (InputAction action){ + protected PopulationSeasonInfo pi; + public PopulationMigrationMigrationUI (InputAction action){ setContextValue(action); } - public void refresh(PopulationSeasonInfo pi){ + public void init(PopulationSeasonInfo pi){ + this.pi = pi; + } + public void refresh(){ popInfo = pi; pop = getContextValue(InputAction.class).getPopulation(); if (pop != null){ @@ -106,7 +116,7 @@ (Zone) fieldPopulationMigrationMigrationArrivalZoneChooser.getSelectedItem(), Double.parseDouble(fieldPopulationMigrationMigrationCoefficient.getText())); getParentContainer(PopulationMigrationUI.class).valueChanged(true); - refresh(popInfo); + refresh(); } protected void remove(){ int row = populationMigrationMigrationTable.getTable().getSelectedRow(); @@ -117,51 +127,51 @@ MatrixND mat = popInfo.getMigrationMatrix().copy(); mat.setValue(group, departure, arrival, 0); popInfo.setMigrationMatrix(mat); - refresh(popInfo); + refresh(); } ]]> </script> <row> <cell> - <JLabel text="isisfish.common.populationGroup"/> + <JLabel text="isisfish.common.populationGroup" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JComboBox id="fieldPopulationMigrationMigrationGroupChooser"/> + <JComboBox id="fieldPopulationMigrationMigrationGroupChooser" enabled='{isActif()}'/> </cell> <cell> - <JLabel text="isisfish.populationMigrationMigration.coefficient"/> + <JLabel text="isisfish.populationMigrationMigration.coefficient" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JTextField id="fieldPopulationMigrationMigrationCoefficient"/> + <JTextField id="fieldPopulationMigrationMigrationCoefficient" enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.populationMigrationMigration.departureZone"/> + <JLabel text="isisfish.populationMigrationMigration.departureZone" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JComboBox id="fieldPopulationMigrationMigrationDepartureZoneChooser"/> + <JComboBox id="fieldPopulationMigrationMigrationDepartureZoneChooser" enabled='{isActif()}'/> </cell> <cell> - <JLabel text="isisfish.populationMigrationMigration.arrivalZone"/> + <JLabel text="isisfish.populationMigrationMigration.arrivalZone" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JComboBox id="fieldPopulationMigrationMigrationArrivalZoneChooser"/> + <JComboBox id="fieldPopulationMigrationMigrationArrivalZoneChooser" enabled='{isActif()}'/> </cell> </row> <row columns='4'> <cell fill='horizontal' weightx='1.0'> - <JButton id="buttonPopulationMigrationMigrationAdd" text="isisfish.common.add" onActionPerformed='add()'/> + <JButton id="buttonPopulationMigrationMigrationAdd" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActif()}'/> </cell> </row> <row columns='4'> <cell fill='both' weightx='1.0' weighty='1.0'> - <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='populationMigrationMigrationTable'/> + <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='populationMigrationMigrationTable' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='4' fill='horizontal' weightx='1.0'> - <JButton id="buttonPopulationMigrationMigrationRemove" text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id="buttonPopulationMigrationMigrationRemove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.PopulationSeasonInfo; @@ -43,7 +49,6 @@ import org.apache.commons.logging.LogFactory; protected Population pop; - protected boolean changed; // protected PopulationSeasonInfo populationSeasonInfoSelected = null; public PopulationMigrationUI (InputAction action){ @@ -57,10 +62,14 @@ if (selected != null){ fieldUseEquationMigration.setSelected(selected.getUseEquationMigration()); useEquationChanged(); - populationMigrationEquationUI.refresh(selected); - populationMigrationMigrationUI.refresh(selected); - populationMigrationImmigrationUI.refresh(selected); - populationMigrationEmigrationUI.refresh(selected); + populationMigrationEquationUI.init(selected); + populationMigrationMigrationUI.init(selected); + populationMigrationImmigrationUI.init(selected); + populationMigrationEmigrationUI.init(selected); + populationMigrationEquationUI.refresh(); + populationMigrationMigrationUI.refresh(); + populationMigrationImmigrationUI.refresh(); + populationMigrationEmigrationUI.refresh(); } fieldPopulationMigrationComment.setText(pop.getMigrationComment()); } @@ -106,17 +115,18 @@ valueChanged(true); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Population"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Population"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Population"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void setInfoText(String txt){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); @@ -131,15 +141,15 @@ </script> <row> <cell anchor='east'> - <JLabel text="isisfish.populationMigration.selectSeason"/> + <JLabel text="isisfish.populationMigration.selectSeason" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldPopulationMigrationSeasonChooser" onActionPerformed='seasonChooserChanged()'/> + <JComboBox id="fieldPopulationMigrationSeasonChooser" onActionPerformed='seasonChooserChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' anchor='west'> - <JCheckBox id="fieldUseEquationMigration" text="isisfish.populationMigration.useEquation" onActionPerformed='useEquationChanged()'/> + <JCheckBox id="fieldUseEquationMigration" text="isisfish.populationMigration.useEquation" onActionPerformed='useEquationChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -156,11 +166,11 @@ </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationMigration.comments"/> + <JLabel text="isisfish.populationMigration.comments" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='0.3'> <JScrollPane> - <JTextArea id="fieldPopulationMigrationComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldPopulationMigrationComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -169,10 +179,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.ui.widget.editor.GenericCell; @@ -42,14 +48,23 @@ import java.util.logging.Logger; protected Population pop = null; - protected boolean changed = false; protected Class clazz = null; protected String nameEquation = null; - public PopulationOneEquationUI (InputAction action){ - + protected String lblText; + protected Formule f; + protected String name; + protected Class c; + + public PopulationOneEquationUI (InputAction action){ setContextValue(action); } - public void refresh(String lblText, Formule f, String name, Class c){ + public void init(String lblText, Formule f, String name, Class c){ + this.lblText = lblText; + this.f = f; + this.name = name; + this.c = c; + } + public void refresh(){ lbl.setText(lblText); clazz = c; try { @@ -121,7 +136,7 @@ <JLabel id='lbl'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="combo" onActionPerformed='comboChanged()'/> + <JComboBox id="combo" onActionPerformed='comboChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -129,12 +144,12 @@ <Table> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.saveModel" onActionPerformed='saveModel()'/> + <JButton text="isisfish.common.saveModel" onActionPerformed='saveModel()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.openEditor" onActionPerformed='openEditor()'/> + <JButton text="isisfish.common.openEditor" onActionPerformed='openEditor()' enabled='{isActif()}'/> </cell> </row> <row> @@ -146,7 +161,7 @@ </cell> <cell fill='both' weightx='1.0' weighty='1.0'> <JScrollPane> - <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false" onKeyTyped='valueChanged(true)' onFocusLost='valueChanged(true)'/> + <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false" onKeyTyped='valueChanged(true)' onFocusLost='valueChanged(true)' enabled='{isActif()}'/> </JScrollPane> </cell> </row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -30,7 +30,13 @@ * by : $Author: sletellier $ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Equation; @@ -43,7 +49,6 @@ import java.util.logging.Logger; protected Population pop = null; - protected boolean changed = false; public PopulationRecruitmentUI (InputAction action){ setContextValue(action); @@ -129,17 +134,18 @@ refresh(); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Population"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Metier"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void setInfoText(String txt){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); @@ -157,10 +163,10 @@ <Table> <row> <cell anchor='east'> - <JLabel text="isisfish.populationRecruitment.reproductionEquation"/> + <JLabel text="isisfish.populationRecruitment.reproductionEquation" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldPopulationReproductionEquation" onActionPerformed='equationChanged()'/> + <JComboBox id="fieldPopulationReproductionEquation" onActionPerformed='equationChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -168,12 +174,12 @@ <Table> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.saveModel" onActionPerformed='saveModel()'/> + <JButton text="isisfish.common.saveModel" onActionPerformed='saveModel()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.openEditor" onActionPerformed='openEditor()'/> + <JButton text="isisfish.common.openEditor" onActionPerformed='openEditor()' enabled='{isActif()}'/> </cell> </row> <row> @@ -185,21 +191,21 @@ </cell> <cell fill='both' weightx='1.0' weighty='0.5'> <JScrollPane> - <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false"/> + <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false" enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell anchor='east'> - <JLabel text="Month Gap BetweenRepro Recruitment"/> + <JLabel text="Month Gap BetweenRepro Recruitment" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldPopulationMonthGapBetweenReproRecrutement" onKeyTyped='valueChanged(true)' onFocusLost='monthGapChanged()'/> + <JTextField id="fieldPopulationMonthGapBetweenReproRecrutement" onKeyTyped='valueChanged(true)' onFocusLost='monthGapChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationRecruitment.recruitmentDistribution"/> + <JLabel text="isisfish.populationRecruitment.recruitmentDistribution" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0'> <JTable/> @@ -210,16 +216,16 @@ <JPanel/> </cell> <cell fill='horizontal' weightx='1.0'> - <JButton id="create" text="isisfish.common.newMatrix" onActionPerformed='create()'/> + <JButton id="create" text="isisfish.common.newMatrix" onActionPerformed='create()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationRecruitment.comments"/> + <JLabel text="isisfish.populationRecruitment.comments" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='0.5'> <JScrollPane> - <JTextArea id="fieldPopulationRecruitmentComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldPopulationRecruitmentComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -231,10 +237,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.PopulationSeasonInfo; @@ -44,7 +50,6 @@ import fr.ifremer.isisfish.ui.widget.IntervalPanel; protected Population pop = null; - protected boolean changed = false; protected IntervalPanel ip = new IntervalPanel(); fieldPopulationSeasonInterval.add(ip, BorderLayout.CENTER); public PopulationSeasonsUI (InputAction action){ @@ -159,16 +164,17 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Population"); + TopiaEntity topia = getContextValue(InputAction.class).save(); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Metier"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -191,18 +197,18 @@ <Table> <row> <cell anchor='east'> - <JLabel text="isisfish.populationSeasons.selectSeason"/> + <JLabel text="isisfish.populationSeasons.selectSeason" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldPopulationSeasonInfoChooser" onActionPerformed='infoChooserChanged()'/> + <JComboBox id="fieldPopulationSeasonInfoChooser" onActionPerformed='infoChooserChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.common.season"/> + <JLabel text="isisfish.common.season" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JPanel id='fieldPopulationSeasonInterval' layout='{new BorderLayout()}'/> + <JPanel id='fieldPopulationSeasonInterval' layout='{new BorderLayout()}' enabled='{isActif()}'/> </cell> </row> <row> @@ -210,24 +216,24 @@ <JPanel/> </cell> <cell fill='horizontal' weightx='1.0'> - <JCheckBox id="fieldPopulationSeasonGroupChange" text="isisfish.populationSeasons.changeGroup" onActionPerformed='groupChangedChanged()'/> + <JCheckBox id="fieldPopulationSeasonGroupChange" text="isisfish.populationSeasons.changeGroup" onActionPerformed='groupChangedChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationSeasons.distributionSpawning"/> + <JLabel text="isisfish.populationSeasons.distributionSpawning" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0'> - <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationSeasonReproductionDistribution'/> + <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationSeasonReproductionDistribution' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.populationSeasons.comments"/> + <JLabel text="isisfish.populationSeasons.comments" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='1.0'> <JScrollPane> - <JTextArea id="fieldPopulationSeasonComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldPopulationSeasonComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -239,10 +245,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> @@ -250,7 +256,7 @@ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -35,7 +35,13 @@ <!-- + Population +--> -<JPanel layout='{new BorderLayout()}'> +<JPanel layout='{new BorderLayout()}' implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import jaxx.runtime.swing.JAXXList; @@ -43,7 +49,6 @@ import org.codelutin.math.matrix.gui.MatrixPanelEvent; import org.codelutin.math.matrix.gui.MatrixPanelListener; - protected boolean changed = false; protected Population pop = null; public PopulationZonesUI (InputAction action){ @@ -154,17 +159,18 @@ return selectedZone; } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Population"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Population"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Population"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void setInfoText(String txt){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); @@ -179,40 +185,40 @@ </script> <row> <cell fill='horizontal' weightx='0.3'> - <JLabel text="isisfish.populationZones.selectPopulationAreas"/> + <JLabel text="isisfish.populationZones.selectPopulationAreas" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.3'> - <JLabel text="isisfish.populationZones.selectSpawningAreas"/> + <JLabel text="isisfish.populationZones.selectSpawningAreas" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.3'> - <JLabel text="isisfish.populationZones.selectRecruitmentAreas"/> + <JLabel text="isisfish.populationZones.selectRecruitmentAreas" enabled='{isActif()}'/> </cell> </row> <row> <cell fill='both' weightx='0.3' weighty='0.5'> <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'> - <JList id="populationZonesPresence" onMouseClicked='presenceChanged()'/> + <JList id="populationZonesPresence" onMouseClicked='presenceChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> <cell fill='both' weightx='0.3' weighty='0.5'> <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'> - <JList id="fieldPopulationZonesReproduction" onMouseClicked='reproductionChanged()'/> + <JList id="fieldPopulationZonesReproduction" onMouseClicked='reproductionChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> <cell fill='both' weightx='0.3' weighty='0.5'> <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'> - <JList id="fieldPopulationZonesRecruitment" onMouseClicked='recruitementChanged()'/> + <JList id="fieldPopulationZonesRecruitment" onMouseClicked='recruitementChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell columns='3' anchor='west'> - <JLabel text="isisfish.populationZones.betweenSpawningRecruitmentAreas"/> + <JLabel text="isisfish.populationZones.betweenSpawningRecruitmentAreas" enabled='{isActif()}'/> </cell> </row> <row> <cell columns='3' fill='both' weightx='1.0' weighty='0.5'> - <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationMappingZoneReproZoneRecru'/> + <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationMappingZoneReproZoneRecru' enabled='{isActif()}'/> </cell> </row> <row> @@ -220,12 +226,12 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> </Table> 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -35,7 +35,13 @@ <!-- + Port +--> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Species; @@ -51,12 +57,11 @@ protected IsisMapBean portMap = new IsisMapBean(); protected OpenMapToolPanel toolMap = new OpenMapToolPanel(); protected OMToolSet toolSet = new OMToolSet(); - protected boolean changed = false; public PortUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { Port port = getContextValue(InputAction.class).getPort(); if (port != null){ fieldPortName.setText(port.getName()); @@ -114,7 +119,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Port"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$ports/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); @@ -122,10 +127,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Port"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Port"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$ports/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -147,12 +153,10 @@ protected void nameChanged(){ getContextValue(InputAction.class).getPort().setName(fieldPortName.getText()); valueChanged(true); - refresh(); } protected void portCellChanged(){ getContextValue(InputAction.class).getPort().setCell((Cell)portCell.getSelectedValue()); valueChanged(true); - refresh(); } protected void commentChanged(){ getContextValue(InputAction.class).getPort().setComment(fieldPortComment.getText()); @@ -167,45 +171,45 @@ <Table> <row> <cell columns='2' fill='horizontal' weightx='1.0' > - <JLabel text="isisfish.port.name"/> + <JLabel text="isisfish.port.name" enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='horizontal' weightx='1.0' > - <JTextField id="fieldPortName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> + <JTextField id="fieldPortName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='horizontal' weightx='1.0' > - <JLabel text="isisfish.port.cell"/> + <JLabel text="isisfish.port.cell" enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='both' weighty='0.7' weightx='1.0'> <JScrollPane> - <JList id="portCell" selectionMode="0" onMouseClicked='portCellChanged()'/> + <JList id="portCell" selectionMode="0" onMouseClicked='portCellChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell columns='2' fill='horizontal' weightx='1.0'> - <JLabel text="isisfish.port.comments"/> + <JLabel text="isisfish.port.comments" enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='both' weighty='0.3' weightx='1.0' > <JScrollPane> - <JTextArea id="fieldPortComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldPortComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> @@ -213,7 +217,7 @@ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -30,7 +30,13 @@ * by : $Author: sletellier $ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script> <![CDATA[ @@ -48,7 +54,6 @@ import org.codelutin.topia.persistence.TopiaEntity; import fr.ifremer.isisfish.ui.widget.editor.GenericCell; - boolean changed = false; public SelectivityUI (InputAction action){ setContextValue(action); @@ -144,17 +149,18 @@ refresh(); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Gear"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Gear"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Gear"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void valueChanged(boolean b){ changed=b; @@ -181,18 +187,18 @@ <Table> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.selectivity.selectPopulation"/> + <JLabel text="isisfish.selectivity.selectPopulation" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldSelectivityPopulation"/> + <JComboBox id="fieldSelectivityPopulation" enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.selectivity.equation"/> + <JLabel text="isisfish.selectivity.equation" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldSelectivityEquation" onActionPerformed='equationChanged()'/> + <JComboBox id="fieldSelectivityEquation" onActionPerformed='equationChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -200,12 +206,12 @@ <Table> <row> <cell fill='horizontal'> - <JButton id='saveModel' text="isisfish.common.saveModel" onActionPerformed='saveAsModel()'/> + <JButton id='saveModel' text="isisfish.common.saveModel" onActionPerformed='saveAsModel()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal'> - <JButton id='openEditor' text="isisfish.common.openEditor" onActionPerformed='openEditor()'/> + <JButton id='openEditor' text="isisfish.common.openEditor" onActionPerformed='openEditor()' enabled='{isActif()}'/> </cell> </row> <row> @@ -217,7 +223,7 @@ </cell> <cell fill='both' weightx='1.0' weighty='1.0'> <JScrollPane> - <org.codelutin.widget.editor.Editor id='fieldSelectivityScript' askIfNotSaved="false"/> + <org.codelutin.widget.editor.Editor id='fieldSelectivityScript' askIfNotSaved="false" enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -229,28 +235,27 @@ <Table> <row> <cell columns='2' fill='horizontal' weightx='1.0'> - <JButton id="buttonAddSelectivity" text="isisfish.common.add" onActionPerformed='add()'/> + <JButton id="buttonAddSelectivity" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> <JScrollPane> - <JTable id="selectivityTable"> - </JTable> + <JTable id="selectivityTable" enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell columns='2' fill='horizontal' weightx='1.0'> - <JButton id="buttonSelectivityRemove" text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id="buttonSelectivityRemove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' weightx='1.0'> - <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='false'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='false'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> </Table> 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import org.codelutin.topia.TopiaException; @@ -45,12 +51,11 @@ import java.util.logging.Level; import java.util.logging.Logger; - protected boolean changed = false; public SetOfVesselsTabsUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { fr.ifremer.isisfish.entities.SetOfVessels setOfVessels = getContextValue(InputAction.class).getSetOfVessels(); if (setOfVessels != null){ fieldSetOfVesselsName.setText(setOfVessels.getName()); @@ -146,7 +151,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("SetOfVessels"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); @@ -154,10 +159,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("SetOfVessels"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("SetOfVessels"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -237,50 +243,50 @@ <Table> <row> <cell anchor='east'> - <JLabel text="isisfish.setOfVessels.name"/> + <JLabel text="isisfish.setOfVessels.name" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldSetOfVesselsName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> + <JTextField id="fieldSetOfVesselsName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.common.port"/> + <JLabel text="isisfish.common.port" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldSetOfVesselsPort" onActionPerformed='portChanged()'/> + <JComboBox id="fieldSetOfVesselsPort" onActionPerformed='portChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.setOfVessels.vesselType"/> + <JLabel text="isisfish.setOfVessels.vesselType" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldSetOfVesselsVesselType" onActionPerformed='vesselTypeChanged()'/> + <JComboBox id="fieldSetOfVesselsVesselType" onActionPerformed='vesselTypeChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.setOfVessels.numberOfVessels"/> + <JLabel text="isisfish.setOfVessels.numberOfVessels" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldSetOfVesselsNumberOfVessels" onKeyTyped='valueChanged(true)' onFocusLost='numberOfVesselsChanged()'/> + <JTextField id="fieldSetOfVesselsNumberOfVessels" onKeyTyped='valueChanged(true)' onFocusLost='numberOfVesselsChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.setOfVessels.fixedCosts"/> + <JLabel text="isisfish.setOfVessels.fixedCosts" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldSetOfVesselsFixedCosts" onKeyTyped='valueChanged(true)' onFocusLost='fixedCostsChanged()'/> + <JTextField id="fieldSetOfVesselsFixedCosts" onKeyTyped='valueChanged(true)' onFocusLost='fixedCostsChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.setOfVessels.technicalEfficiency"/> + <JLabel text="isisfish.setOfVessels.technicalEfficiency" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldSetOfVesselsTechnicalEfficiency" onActionPerformed='technicalEfficiencyChanged()'/> + <JComboBox id="fieldSetOfVesselsTechnicalEfficiency" onActionPerformed='technicalEfficiencyChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -288,12 +294,12 @@ <Table> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.saveModel" onActionPerformed='saveAsModel()'/> + <JButton text="isisfish.common.saveModel" onActionPerformed='saveAsModel()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.openEditor" onActionPerformed='openEditor()'/> + <JButton text="isisfish.common.openEditor" onActionPerformed='openEditor()' enabled='{isActif()}'/> </cell> </row> <row> @@ -305,17 +311,17 @@ </cell> <cell fill='both' weightx='1.0' weighty='0.7'> <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'> - <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false"/> + <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false" enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell anchor='east'> - <JLabel text="isisfish.setOfVessels.comments"/> + <JLabel text="isisfish.setOfVessels.comments" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='0.3'> <JScrollPane> - <JTextArea id="fieldSetOfVesselsComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldSetOfVesselsComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -327,10 +333,10 @@ <Table> <row> <cell fill='horizontal' weightx='1.0'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> @@ -338,7 +344,7 @@ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -35,14 +35,20 @@ <!-- + SetOfVessels +--> -<JPanel layout='{new BorderLayout()}'> +<JPanel implements='InputContent' layout='{new BorderLayout()}'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Strategy; public SetOfVesselsUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { setOfVesselsTabsUI.refresh(); effortDescriptionUI.refresh(); } 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -35,7 +35,13 @@ <!-- + Species +--> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Population; import fr.ifremer.isisfish.entities.Species; @@ -43,12 +49,11 @@ import org.codelutin.topia.persistence.TopiaEntity; import org.codelutin.topia.TopiaException; - protected boolean changed = false; public SpeciesUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { Species s = getContextValue(InputAction.class).getSpecies(); if (s != null){ fieldSpeciesName.setText(s.getName()); @@ -78,7 +83,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Species"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+topia.getTopiaId()); @@ -87,10 +92,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Species"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Species"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -147,62 +153,54 @@ <Table> <row> <cell> - <JLabel text="isisfish.species.name"/> - + <JLabel text="isisfish.species.name" enabled='{isActif()}'/> </cell> <cell fill='horizontal' columns='2' weightx='1.0'> - <JTextField id="fieldSpeciesName" onFocusLost='nameChanged()'/> + <JTextField id="fieldSpeciesName" onFocusLost='nameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.species.scientificName"/> - + <JLabel text="isisfish.species.scientificName" enabled='{isActif()}'/> </cell> <cell fill='horizontal' columns='2' weightx='1.0'> - <JTextField id="fieldSpeciesScientificName" onFocusLost='scientificNameChanged()'/> + <JTextField id="fieldSpeciesScientificName" onFocusLost='scientificNameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell> - - <JLabel text="isisfish.species.rubbinCode"/> - + <JLabel text="isisfish.species.rubbinCode" enabled='{isActif()}'/> </cell> <cell fill='horizontal' columns='2' weightx='1.0'> - <JTextField id="fieldSpeciesCodeRubbin" onFocusLost='codeChanged()'/> + <JTextField id="fieldSpeciesCodeRubbin" onFocusLost='codeChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.species.cee"/> - + <JLabel text="isisfish.species.cee" enabled='{isActif()}'/> </cell> <cell fill='horizontal' columns='2' weightx='1.0'> - <JTextField id="fieldSpeciesCEE" onFocusLost='CEEChanged()'/> + <JTextField id="fieldSpeciesCEE" onFocusLost='CEEChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.species.structured"/> - - + <JLabel text="isisfish.species.structured" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JRadioButton id="fieldSpeciesDynamicAge" text="isisfish.species.age" buttonGroup="structuredGroup" onItemStateChanged='dynamicAgeChanged()'/> + <JRadioButton id="fieldSpeciesDynamicAge" text="isisfish.species.age" buttonGroup="structuredGroup" onItemStateChanged='dynamicAgeChanged()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JRadioButton id="fieldSpeciesDynamicLength" text="isisfish.species.length" buttonGroup="structuredGroup"/> + <JRadioButton id="fieldSpeciesDynamicLength" text="isisfish.species.length" buttonGroup="structuredGroup" enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.species.comments"/> - + <JLabel text="isisfish.species.comments" enabled='{isActif()}'/> </cell> <cell fill='both' columns='2' weightx='1.0' weighty='1.0'> <JScrollPane> - <JTextArea id="fieldSpeciesComment" onFocusLost='commentChanged()'/> + <JTextArea id="fieldSpeciesComment" onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -214,10 +212,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> @@ -225,7 +223,7 @@ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,42 +31,61 @@ */ --> -<JPanel layout='{new BorderLayout()}'> +<JPanel layout='{new BorderLayout()}' implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.StrategyMonthInfo; import fr.ifremer.isisfish.types.Month; import fr.ifremer.isisfish.ui.WelcomePanelUI; import org.codelutin.topia.persistence.TopiaEntity; - protected boolean changed = false; public StrategyMonthInfoUI (InputAction action){ setContextValue(action); } - protected void refresh() { - strategyJanuary.refresh(Month.JANUARY); - strategyFebuary.refresh(Month.FEBRUARY); - strategyMarch.refresh(Month.MARCH); - strategyApril.refresh(Month.APRIL); - strategyMay.refresh(Month.MAY); - strategyJune.refresh(Month.JUNE); - strategyJuly.refresh(Month.JULY); - strategyAugust.refresh(Month.AUGUST); - strategySeptember.refresh(Month.SEPTEMBER); - strategyOctober.refresh(Month.OCTOBER); - strategyNovember.refresh(Month.NOVEMBER); - strategyDecember.refresh(Month.DECEMBER); + public void refresh() { + strategyJanuary.init(Month.JANUARY); + strategyFebuary.init(Month.FEBRUARY); + strategyMarch.init(Month.MARCH); + strategyApril.init(Month.APRIL); + strategyMay.init(Month.MAY); + strategyJune.init(Month.JUNE); + strategyJuly.init(Month.JULY); + strategyAugust.init(Month.AUGUST); + strategySeptember.init(Month.SEPTEMBER); + strategyOctober.init(Month.OCTOBER); + strategyNovember.init(Month.NOVEMBER); + strategyDecember.init(Month.DECEMBER); + strategyJanuary.refresh(); + strategyFebuary.refresh(); + strategyMarch.refresh(); + strategyApril.refresh(); + strategyMay.refresh(); + strategyJune.refresh(); + strategyJuly.refresh(); + strategyAugust.refresh(); + strategySeptember.refresh(); + strategyOctober.refresh(); + strategyNovember.refresh(); + strategyDecember.refresh(); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Strategy"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); refresh(); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Strategy"); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Strategy"); + valueChanged(false); + refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId()); setInfoText(_("isisfish.message.cancel.finished")); - refresh(); } protected void setInfoText(String txt){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2008-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.StrategyMonthInfo; @@ -41,15 +47,15 @@ import fr.ifremer.isisfish.ui.widget.editor.GenericCell; protected StrategyMonthInfo strategyMonthInfo = null; - protected boolean changed = false; + Month month = null; public StrategyOneMonthInfoUI (InputAction action){ setContextValue(action); } - protected void refresh(Month m) { + public void refresh() { Strategy strategy = getContextValue(InputAction.class).getStrategy(); - if (strategy != null && m != null){ - strategyMonthInfo = strategy.getStrategyMonthInfo(m); + if (strategy != null && month != null){ + strategyMonthInfo = strategy.getStrategyMonthInfo(month); setFieldStrategyMonthInfoTripTypeModel(); numberOfTrips.setText(strategyMonthInfo.getNumberOfTrips() + ""); fieldStrategyMonthInfoMinInactivityDays.setText(strategyMonthInfo.getMinInactivityDays() + ""); @@ -65,6 +71,9 @@ valueChanged(false); } } + public void init(Month m){ + month = m; + } protected void setFieldStrategyMonthInfoTripTypeModel(){ DefaultComboBoxModel model = new DefaultComboBoxModel(); TripType selected = strategyMonthInfo.getTripType(); @@ -115,41 +124,33 @@ ]]></script> <row> <cell columns='2' fill='horizontal' weightx='1.0' anchor='west'> - <JLabel id='StrategieMonth'/> + <JLabel id='StrategieMonth' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='horizontal' weightx='1.0'> - <JComboBox id="fieldStrategyMonthInfoTripType" onActionPerformed='tripTypeChanged()'/> + <JComboBox id="fieldStrategyMonthInfoTripType" onActionPerformed='tripTypeChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' weightx='0.5' anchor='west'> - <JLabel text="isisfish.strategyMonthInfo.numberOfTrips"/> + <JLabel text="isisfish.strategyMonthInfo.numberOfTrips" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5' anchor='west'> - <JLabel id='numberOfTrips'/> + <JLabel id='numberOfTrips' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' weightx='0.5' anchor='west'> - <JLabel text="isisfish.strategyMonthInfo.minInactivityDays"/> + <JLabel text="isisfish.strategyMonthInfo.minInactivityDays" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JTextField id="fieldStrategyMonthInfoMinInactivityDays" onKeyTyped='valueChanged(true)' onFocusLost='minInactivityDayChanged()'/> + <JTextField id="fieldStrategyMonthInfoMinInactivityDays" onKeyTyped='valueChanged(true)' onFocusLost='minInactivityDayChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> - <org.codelutin.math.matrix.gui.MatrixPanelEditor id="fieldStrategyMonthInfoProportion"/> + <org.codelutin.math.matrix.gui.MatrixPanelEditor id="fieldStrategyMonthInfoProportion" enabled='{isActif()}'/> </cell> </row> -</Table> - - - - - - - - \ No newline at end of file +</Table> \ No newline at end of file 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Equation; import fr.ifremer.isisfish.entities.Formule; @@ -42,13 +48,11 @@ import java.util.logging.Level; import java.util.logging.Logger; - boolean changed = false; - public StrategyTabUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { fr.ifremer.isisfish.entities.Strategy strategy = getContextValue(InputAction.class).getStrategy(); if (strategy != null){ fieldStrategyName.setText(strategy.getName()); @@ -142,7 +146,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Strategy"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); @@ -150,10 +154,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Strategy"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Strategy"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -175,26 +180,26 @@ <Table> <row> <cell anchor='west'> - <JLabel text="isisfish.strategy.name"/> + <JLabel text="isisfish.strategy.name" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldStrategyName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> + <JTextField id="fieldStrategyName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='west'> - <JLabel text="isisfish.common.setOfVessels"/> + <JLabel text="isisfish.common.setOfVessels" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldStrategySetOfVessels" onActionPerformed='setOfVesselsChanged()'/> + <JComboBox id="fieldStrategySetOfVessels" onActionPerformed='setOfVesselsChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='west'> - <JLabel text="isisfish.strategy.proportionSetOfVessels"/> + <JLabel text="isisfish.strategy.proportionSetOfVessels" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldStrategyProportionSetOfVessels" onKeyTyped='valueChanged(true)' onFocusLost='proportionSetOfVesselsChanged()'/> + <JTextField id="fieldStrategyProportionSetOfVessels" onKeyTyped='valueChanged(true)' onFocusLost='proportionSetOfVesselsChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -202,15 +207,15 @@ <JPanel/> </cell> <cell fill='horizontal' weightx='1.0'> - <JCheckBox id="fieldUseEquationInactivity" text="isisfish.strategy.inactivityEquationUsed" onActionPerformed='useInactivityChanged()'/> + <JCheckBox id="fieldUseEquationInactivity" text="isisfish.strategy.inactivityEquationUsed" onActionPerformed='useInactivityChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='west'> - <JLabel text="isisfish.strategy.inactivity"/> + <JLabel text="isisfish.strategy.inactivity" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JComboBox id="fieldStrategyInactivity" onActionPerformed='inactivityChanged()'/> + <JComboBox id="fieldStrategyInactivity" onActionPerformed='inactivityChanged()' enabled='{isActif()}'/> </cell> </row> <row> @@ -218,12 +223,12 @@ <Table> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.saveModel" onActionPerformed='saveModel()'/> + <JButton text="isisfish.common.saveModel" onActionPerformed='saveModel()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal'> - <JButton text="isisfish.common.openEditor" onActionPerformed='openEditor()'/> + <JButton text="isisfish.common.openEditor" onActionPerformed='openEditor()' enabled='{isActif()}'/> </cell> </row> <row> @@ -234,16 +239,16 @@ </Table> </cell> <cell fill='both' weightx='1.0' weighty='0.7'> - <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false"/> + <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false" enabled='{isActif()}'/> </cell> </row> <row> <cell anchor='west'> - <JLabel text="isisfish.strategy.comments"/> + <JLabel text="isisfish.strategy.comments" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='0.3'> <JScrollPane> - <JTextArea id="fieldStrategyComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldStrategyComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -255,10 +260,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> @@ -266,7 +271,7 @@ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -34,13 +34,18 @@ <!-- + Strategy +--> -<JTabbedPane id="StrategyTab" name="Strategy" > +<JTabbedPane id="StrategyTab" name="Strategy" implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ - public StrategyUI (InputAction action){ - + public StrategyUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { strategyTabUI.refresh(); strategyMonthInfoUI.refresh(); } 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -33,7 +33,13 @@ <!-- + TripType +--> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.ui.WelcomePanelUI; import org.codelutin.topia.persistence.TopiaEntity; @@ -41,12 +47,11 @@ import fr.ifremer.isisfish.entities.VesselType; import fr.ifremer.isisfish.types.TimeUnit; - boolean changed = false; public TripTypeUI (InputAction action){ setContextValue(action); } - protected void refresh() { + public void refresh() { if (getContextValue(InputAction.class).getTripType() != null){ fieldTripTypeName.setText(getContextValue(InputAction.class).getTripType().getName()); fieldTripTypeDuration.setText("" + getContextValue(InputAction.class).getTripType().getTripDuration().getHour()); @@ -94,7 +99,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("TripType"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); @@ -102,10 +107,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("TripType"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("TripType"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -122,36 +128,35 @@ <Table> <row> <cell> - <JLabel text="isisfish.tripType.name"/> + <JLabel text="isisfish.tripType.name" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldTripTypeName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> + <JTextField id="fieldTripTypeName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.tripType.duration"/> + <JLabel text="isisfish.tripType.duration" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldTripTypeDuration" onKeyTyped='valueChanged(true)' onFocusLost='typeDurationChanged()'/> + <JTextField id="fieldTripTypeDuration" onKeyTyped='valueChanged(true)' onFocusLost='typeDurationChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell> - <JLabel text="isisfish.tripType.minTime"/> + <JLabel text="isisfish.tripType.minTime" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldTripTypeMinTimeBetweenTrip" onKeyTyped='valueChanged(true)' onFocusLost='minTimeChanged()'/> + <JTextField id="fieldTripTypeMinTimeBetweenTrip" onKeyTyped='valueChanged(true)' onFocusLost='minTimeChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell> - - <JLabel text="isisfish.tripType.comments"/> + <JLabel text="isisfish.tripType.comments" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='1.0'> <JScrollPane> - <JTextArea id="fieldTripTypeComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldTripTypeComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -163,24 +168,23 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> - + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> + <JButton id='create' text="isisfish.common.new" onActionPerformed='create()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> <row> <cell columns ='2' fill='horizontal' weightx='1.0'> - <JButton text="isisfish.input.continueVesselTypes" onActionPerformed='goToVesselTypes()'/> + <JButton text="isisfish.input.continueVesselTypes" onActionPerformed='goToVesselTypes()' enabled='{isActif()}'/> </cell> </row> </Table> 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -31,7 +31,13 @@ */ --> -<JPanel layout='{new BorderLayout()}'> +<JPanel layout='{new BorderLayout()}' implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.VesselType; import fr.ifremer.isisfish.entities.TripType; @@ -40,12 +46,10 @@ import org.codelutin.topia.persistence.TopiaEntity; import fr.ifremer.isisfish.types.TimeUnit; - boolean changed = false; public VesselTypeUI (InputAction action){ - setContextValue(action); } - protected void refresh() { + public void refresh() { VesselType vesselType = getContextValue(InputAction.class).getVesselType(); setVesselTypeTripTypeModel(); if (vesselType != null){ @@ -89,7 +93,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("VesselType"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); @@ -97,10 +101,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("VesselType"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("VesselType"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -112,7 +117,6 @@ root.setInfoText(txt); } protected void valueChanged(boolean b){ - changed=b; cancel.setEnabled(b); save.setEnabled(b); } @@ -158,77 +162,77 @@ <Table> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.vesselType.name"/> + <JLabel text="isisfish.vesselType.name" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldVesselTypeName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> + <JTextField id="fieldVesselTypeName" enabled='{isActif()}' onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.vesselType.length"/> + <JLabel text="isisfish.vesselType.length" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldVesselTypeLength" onKeyTyped='valueChanged(true)' onFocusLost='lenghtChanged()'/> + <JTextField id="fieldVesselTypeLength" enabled='{isActif()}' onKeyTyped='valueChanged(true)' onFocusLost='lenghtChanged()'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.vesselType.speed"/> + <JLabel text="isisfish.vesselType.speed" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldVesselTypeSpeed" onKeyTyped='valueChanged(true)' onFocusLost='speedChanged()'/> + <JTextField id="fieldVesselTypeSpeed" enabled='{isActif()}' onKeyTyped='valueChanged(true)' onFocusLost='speedChanged()'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.vesselType.maxDuration"/> + <JLabel text="isisfish.vesselType.maxDuration" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldVesselTypeMaxTripDuration" onKeyTyped='valueChanged(true)' onFocusLost='tripDurationChanged()'/> + <JTextField id="fieldVesselTypeMaxTripDuration" enabled='{isActif()}' onKeyTyped='valueChanged(true)' onFocusLost='tripDurationChanged()'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.vesselType.activityRange"/> + <JLabel text="isisfish.vesselType.activityRange" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldVesselTypeActivityRange" onKeyTyped='valueChanged(true)' onFocusLost='activityRangeChanged()'/> + <JTextField id="fieldVesselTypeActivityRange" enabled='{isActif()}' onKeyTyped='valueChanged(true)' onFocusLost='activityRangeChanged()'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.vesselType.miniCrew"/> + <JLabel text="isisfish.vesselType.miniCrew" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldVesselTypeMinCrewSize" onKeyTyped='valueChanged(true)' onFocusLost='minCrewChanged()'/> + <JTextField id="fieldVesselTypeMinCrewSize" enabled='{isActif()}' onKeyTyped='valueChanged(true)' onFocusLost='minCrewChanged()'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.vesselType.fuelCost"/> + <JLabel text="isisfish.vesselType.fuelCost" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldVesselTypeUnitFuelCostOfTravel" onKeyTyped='valueChanged(true)' onFocusLost='unitFuelCostChanged()'/> + <JTextField id="fieldVesselTypeUnitFuelCostOfTravel" onKeyTyped='valueChanged(true)' onFocusLost='unitFuelCostChanged()' enabled='{isActif()}'/> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.common.tripType"/> + <JLabel text="isisfish.common.tripType" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='0.7'> <JScrollPane> - <JList id="vesselTypeTripType" onValueChanged='tripTypeChanged()'/> + <JList id="vesselTypeTripType" onValueChanged='tripTypeChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> <row> <cell fill='horizontal' anchor='east'> - <JLabel text="isisfish.vesselType.comments"/> + <JLabel text="isisfish.vesselType.comments" enabled='{isActif()}'/> </cell> <cell fill='both' weightx='1.0' weighty='0.3'> <JScrollPane> - <JTextArea id="fieldVesselTypeComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/> + <JTextArea id="fieldVesselTypeComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/> </JScrollPane> </cell> </row> @@ -240,10 +244,10 @@ <Table> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/> </cell> </row> <row> @@ -251,7 +255,7 @@ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/> </cell> </row> </Table> 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-12-09 17:50:47 UTC (rev 1656) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-10 16:49:33 UTC (rev 1657) @@ -35,7 +35,13 @@ <!-- + Zone +--> -<Table> +<Table implements='InputContent'> + + <!-- ui state when the activite is active --> + <Boolean id='actif' javaBean='false'/> + + <Boolean id='changed' javaBean='false'/> + <script><![CDATA[ import fr.ifremer.isisfish.entities.Cell; import fr.ifremer.isisfish.entities.Zone; @@ -52,7 +58,7 @@ protected IsisMapBean zoneMap = new IsisMapBean(); protected OpenMapToolPanel toolMap = new OpenMapToolPanel(); protected OMToolSet toolSet = new OMToolSet(); - protected boolean changed = false; + public ZoneUI (InputAction action){ setContextValue(action); @@ -96,7 +102,7 @@ } return result; } - protected void refresh() { + public void refresh() { Zone z = getContextValue(InputAction.class).getZone(); if (z != null){ DefaultListModel zoneCellsModel = new DefaultListModel(); @@ -116,16 +122,8 @@ } zoneCells.setSelectedIndices(indexs); } - fieldZoneName.setText(z.getName()); fieldZoneComment.setText(getContextValue(InputAction.class).getZone().getComment()); - - zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion()); - toolSet.setupListeners(zoneMap); - toolMap.add((Component)toolSet); - zoneMapPanel.add(toolMap, BorderLayout.NORTH); - zoneMapPanel.add(zoneMap, BorderLayout.CENTER); - refreshMap(); } else{ DefaultListModel zoneCellsModel = new DefaultListModel(); @@ -136,14 +134,14 @@ zoneCells.setModel(zoneCellsModel); fieldZoneName.setText(""); fieldZoneComment.setText(""); - - zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion()); - toolSet.setupListeners(zoneMap); - toolMap.add((Component)toolSet); - zoneMapPanel.add(toolMap, BorderLayout.NORTH); - zoneMapPanel.add(zoneMap, BorderLayout.CENTER); - refreshMap(); } + zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion()); + toolSet.setupListeners(zoneMap); + toolMap.add((Component)toolSet); + zoneMapPanel.add(toolMap, BorderLayout.NORTH); + zoneMapPanel.add(zoneMap, BorderLayout.CENTER); + valueChanged(false); + refreshMap(); } protected void refreshMap(){ java.util.List<Cell> cells = new ArrayList<Cell>(); @@ -161,7 +159,7 @@ setInfoText(_("isisfish.message.creation.finished")); } protected void save(){ - TopiaEntity topia = getContextValue(InputAction.class).save("Zone"); + TopiaEntity topia = getContextValue(InputAction.class).save(); getParentContainer(InputUI.class).setTreeModel(); getParentContainer(InputUI.class).setTreeSelection("$root/$zones/"+topia.getTopiaId()); setInfoText(_("isisfish.message.save.finished")); @@ -169,10 +167,11 @@ valueChanged(false); } protected void cancel(){ - getContextValue(InputAction.class).cancel("Zone"); - setInfoText(_("isisfish.message.cancel.finished")); + TopiaEntity topia = getContextValue(InputAction.class).cancel("Zone"); valueChanged(false); refresh(); + getParentContainer(InputUI.class).setTreeSelection("$root/$zones/"+topia.getTopiaId()); + setInfoText(_("isisfish.message.cancel.finished")); } protected void remove(){ setInfoText(getContextValue(InputAction.class).remove()); @@ -201,11 +200,12 @@ refreshMap(); } protected void nameChange(){ + System.out.println("InputAction " + getContextValue(InputAction.class) + " getZone "+getContextValue(InputAction.class).getZone()+" fieldZoneName.getText() "+ fieldZoneName.getText()); getContextValue(InputAction.class).getZone().setName(fieldZoneName.getText()); valueChanged(true); } protected void valueChanged(boolean b){ - changed=b; + changed = b; cancel.setEnabled(b); save.setEnabled(b); } @@ -218,45 +218,46 @@ <Table> <row> <cell columns='2' fill='horizontal' weightx='1.0'> - <JLabel text="isisfish.zone.name"/> + <JLabel enabled='{isActif()}' text="isisfish.zone.name"/> </cell> </row> <row> <cell columns='2' fill='horizontal' weightx='1.0'> - <JTextField id="fieldZoneName" onKeyTyped='valueChanged(true)' onFocusLost='nameChange()'/> + <JTextField id="fieldZoneName" enabled='{isActif()}' onKeyTyped='valueChanged(true)'/> +<!-- onFocusLost='nameChange()' --> </cell> </row> <row> <cell columns='2' fill='horizontal' weightx='1.0'> - <JLabel text="isisfish.zone.cells"/> + <JLabel enabled='{isActif()}' text="isisfish.zone.cells"/> </cell> </row> <row> <cell columns='2' fill='both' weighty='0.7' weightx='1.0'> <JScrollPane> - <JList id="zoneCells" onMouseClicked='zoneCellsChange()'/> + <JList id="zoneCells" enabled='{isActif()}' onMouseClicked='zoneCellsChange()'/> </JScrollPane> </cell> </row> <row> <cell columns='2' fill='horizontal' weightx='1.0'> - <JLabel text="isisfish.zone.comments"/> + <JLabel enabled='{isActif()}' text="isisfish.zone.comments"/> </cell> </row> <row> <cell columns='2' fill='both' weighty='0.3' weightx='1.0'> <JScrollPane> - <JTextArea id="fieldZoneComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChange()'/> + <JTextArea id="fieldZoneComment" enabled='{isActif()}' onKeyTyped='valueChanged(true)' onFocusLost='commentChange()'/> </JScrollPane> </cell> </row> <row> <cell fill='horizontal' weightx='0.5'> - <JButton id='save' text="isisfish.common.save" enabled='false' onActionPerformed='save()'/> + <JButton id='save' text="isisfish.common.save" enabled='{isActif()}' onActionPerformed='save()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='cancel' text="isisfish.common.cancel" enabled='false' onActionPerformed='cancel()'/> + <JButton id='cancel' text="isisfish.common.cancel" enabled='{isActif()}' onActionPerformed='cancel()'/> </cell> </row> <row> @@ -264,11 +265,11 @@ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> </cell> <cell fill='horizontal' weightx='0.5'> - <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> + <JButton id='remove' text="isisfish.common.remove" enabled='{isActif()}' onActionPerformed='remove()'/> </cell> </row> </Table> - <JPanel id="zoneMapPanel" layout='{new BorderLayout()}'/> + <JPanel enabled='{isActif()}' id="zoneMapPanel" layout='{new BorderLayout()}'/> </JSplitPane> </cell> </row>
participants (1)
-
sletellier@users.labs.libre-entreprise.org