r2060 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/ui/input java/fr/ifremer/isisfish/ui/script java/fr/ifremer/isisfish/ui/sensitivity java/fr/ifremer/isisfish/ui/simulator java/fr/ifremer/isisfish/ui/widget/renderer resources/i18n
Author: sletellier Date: 2009-04-02 09:55:22 +0000 (Thu, 02 Apr 2009) New Revision: 2060 Removed: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipListRenderer.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipComboBoxRenderer.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListRenderer.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipTableColumnRenderer.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/WithToolTipListModel.java 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/PopulationGroupUI.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/script/ScriptUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties Log: Adding ToolTips 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 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -150,7 +150,7 @@ <JLabel text="isisfish.effortDescription.fishingOperationDuration" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldEffortDescriptionFishingOperationDuration" text='{getEffortDescription().getFishingOperationDuration() == null ? "" : getEffortDescription().getFishingOperationDuration().getHour()}' onKeyReleased='getEffortDescription().setFishingOperationDuration(new TimeUnit(3600 * Double.parseDouble(fieldEffortDescriptionFishingOperationDuration.getText())))' enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FishingOperationDuration"'/> + <JTextField id="fieldEffortDescriptionFishingOperationDuration" text='{getEffortDescription().getFishingOperationDuration() == null ? "" : getEffortDescription().getFishingOperationDuration().getHour()}' toolTipText="in hour" onKeyReleased='getEffortDescription().setFishingOperationDuration(new TimeUnit(3600 * Double.parseDouble(fieldEffortDescriptionFishingOperationDuration.getText())))' enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FishingOperationDuration"'/> </cell> </row> <row> 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 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -161,10 +161,10 @@ <JLabel text="isisfish.populationGroup.length" enabled='{isPopGroupNotNull()}'/> </cell> <cell fill='both' weightx='0.5'> - <JTextField id="fieldPopulationGroupMinLength" text='{getPopulationGroup().getMinLength()}' onKeyReleased='getPopulationGroup().setMinLength(Double.parseDouble(fieldPopulationGroupMinLength.getText()))' enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MinLength"'/> + <JTextField id="fieldPopulationGroupMinLength" text='{getPopulationGroup().getMinLength()}' toolTipText="minimum length" onKeyReleased='getPopulationGroup().setMinLength(Double.parseDouble(fieldPopulationGroupMinLength.getText()))' enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MinLength"'/> </cell> <cell fill='both' weightx='0.5'> - <JTextField id="fieldPopulationGroupMaxLength" text='{getPopulationGroup().getMaxLength()}' onKeyReleased='getPopulationGroup().setMaxLength(Double.parseDouble(fieldPopulationGroupMaxLength.getText()))' enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MaxLength"'/> + <JTextField id="fieldPopulationGroupMaxLength" text='{getPopulationGroup().getMaxLength()}' toolTipText="maximum length" onKeyReleased='getPopulationGroup().setMaxLength(Double.parseDouble(fieldPopulationGroupMaxLength.getText()))' enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MaxLength"'/> </cell> </row> <row> 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 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -89,7 +89,7 @@ <JLabel text="isisfish.tripType.duration" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldTripTypeDuration" text='{getBean().getTripDuration().getHour()}' onKeyReleased='getBean().setTripDuration(new TimeUnit(Double.parseDouble(fieldTripTypeDuration.getText()) * 3600))' enabled='{isActif()}' decorator='boxed' _bean='{TripTypeImpl.class}' _method='"TripDuration"'/> + <JTextField id="fieldTripTypeDuration" text='{getBean().getTripDuration().getHour()}' toolTipText="in hour" onKeyReleased='getBean().setTripDuration(new TimeUnit(Double.parseDouble(fieldTripTypeDuration.getText()) * 3600))' enabled='{isActif()}' decorator='boxed' _bean='{TripTypeImpl.class}' _method='"TripDuration"'/> </cell> </row> <row> 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 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -126,7 +126,7 @@ <JLabel text="isisfish.vesselType.maxDuration" enabled='{isActif()}'/> </cell> <cell fill='horizontal' weightx='1.0'> - <JTextField id="fieldVesselTypeMaxTripDuration" text='{getBean().getMaxTripDuration().getHour()}' enabled='{isActif()}' onKeyReleased='getBean().setMaxTripDuration(new TimeUnit(Double.parseDouble(fieldVesselTypeMaxTripDuration.getText()) * 3600))' decorator='boxed' _bean='{VesselTypeImpl.class}' _method='"MaxTripDuration"'/> + <JTextField id="fieldVesselTypeMaxTripDuration" text='{getBean().getMaxTripDuration().getHour()}' toolTipText="in hour" enabled='{isActif()}' onKeyReleased='getBean().setMaxTripDuration(new TimeUnit(Double.parseDouble(fieldVesselTypeMaxTripDuration.getText()) * 3600))' decorator='boxed' _bean='{VesselTypeImpl.class}' _method='"MaxTripDuration"'/> </cell> </row> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -316,15 +316,15 @@ <JPanel layout='{new BorderLayout()}' constraints='BorderLayout.CENTER'> <JPanel id="buttonBar" layout='{new GridLayout()}' constraints='BorderLayout.NORTH'> <JComboBox id="ScriptTypeChoice" model='{new DefaultComboBoxModel(getContextValue(ScriptAction.class).getScriptTypesNames())}'/> - <JButton id="buttonScriptNew" text="isisfish.script.new" onActionPerformed='newScript()'/> - <JButton id="buttonScriptSave" text="isisfish.script.save" enabled='false' onActionPerformed='saveScript()'/> - <JButton id="buttonScriptExport" text="isisfish.script.txtExport" enabled='false' onActionPerformed='exportScript()'/> - <JButton id="buttonScriptCommit" text="isisfish.script.commit" enabled='false' onActionPerformed='commitScript()'/> - <JButton id="buttonScriptCut" text="isisfish.script.cut" enabled='false' onActionPerformed='cut()'/> - <JButton id="buttonScriptCopy" text="isisfish.script.copy" enabled='false' onActionPerformed='copy()'/> - <JButton id="buttonScriptPaste" text="isisfish.script.paste" enabled='false' onActionPerformed='paste()'/> - <JButton id="buttonScriptCheck" text="isisfish.script.check" enabled='false' onActionPerformed='checkScript()'/> - <JButton id="buttonScriptEval" text="isisfish.script.evaluate" enabled='false' onActionPerformed='evaluateScript()'/> + <JButton id="buttonScriptNew" text="isisfish.script.new" toolTipText='Create a new script' onActionPerformed='newScript()'/> + <JButton id="buttonScriptSave" text="isisfish.script.save" toolTipText="Save current script" enabled='false' onActionPerformed='saveScript()'/> + <JButton id="buttonScriptExport" text="isisfish.script.txtExport" toolTipText="Export selected script(s) to zip archive" enabled='false' onActionPerformed='exportScript()'/> + <JButton id="buttonScriptCommit" text="isisfish.script.commit" toolTipText="Commit script to CVS server" enabled='false' onActionPerformed='commitScript()'/> + <JButton id="buttonScriptCut" text="isisfish.script.cut" toolTipText="Cut current selection (Ctrl-x)" enabled='false' onActionPerformed='cut()'/> + <JButton id="buttonScriptCopy" text="isisfish.script.copy" toolTipText="Copy current selection (Ctrl-c)" enabled='false' onActionPerformed='copy()'/> + <JButton id="buttonScriptPaste" text="isisfish.script.paste" toolTipText="Paste current selection (Ctrl-v)" enabled='false' onActionPerformed='paste()'/> + <JButton id="buttonScriptCheck" text="isisfish.script.check" toolTipText="Check syntax of the current script" enabled='false' onActionPerformed='checkScript()'/> + <JButton id="buttonScriptEval" text="isisfish.script.evaluate" toolTipText="Try to eval current script (must be have main method)" enabled='false' onActionPerformed='evaluateScript()'/> </JPanel> <JSplitPane oneTouchExpandable="true" dividerLocation="250" orientation="HORIZONTAL" constraints='BorderLayout.CENTER'> <JScrollPane> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -111,10 +111,12 @@ result = listResult; } else if (result instanceof JCheckBox){ ((JCheckBox) result).setSelected((Boolean)callMethod(e, fieldName)); - + JCheckBox cOrigin = (JCheckBox)c; + ((JCheckBox) result).setText(cOrigin.getText()); } else if (result instanceof JRadioButton){ ((JRadioButton) result).setSelected((Boolean)callMethod(e, fieldName)); - + JRadioButton cOrigin = (JRadioButton)c; + ((JRadioButton) result).setText(cOrigin.getText()); } else if (result instanceof SpeciesStructuredUI){ SpeciesStructuredUI origine = (SpeciesStructuredUI)c; SpeciesStructuredUI ui = new SpeciesStructuredUI(); @@ -325,10 +327,13 @@ result = listResult; } else if (result instanceof JCheckBox){ ((JCheckBox) result).setSelected((Boolean)value); + JCheckBox ch = (JCheckBox)c; + ((JCheckBox) result).setText(ch.getText()); } else if (result instanceof JRadioButton){ ((JRadioButton) result).setSelected((Boolean)value); - + JRadioButton cOrigin = (JRadioButton) c; + ((JRadioButton) result).setText(cOrigin.getText()); } else if (result instanceof SpeciesStructuredUI){ SpeciesStructuredUI origine = (SpeciesStructuredUI)c; SpeciesStructuredUI ui = new SpeciesStructuredUI(); Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -105,9 +105,12 @@ if (Factor.class.isInstance(o)){ Factor f = (Factor)o; FactorWizard wizard = new FactorWizard(this); - wizard.initExisting(getSimulAction().getFactorComponent(f), f); - wizard.pack(); - wizard.setVisible(true); + JComponent c = getSimulAction().getFactorComponent(f); + if (c != null){ + wizard.initExisting(c, f); + wizard.pack(); + wizard.setVisible(true); + } } } } @@ -146,7 +149,7 @@ DefaultTreeModel model = new DefaultTreeModel(null); navigation.setModel(model); } -protected void setFactorModel(){ +public void setFactorModel(){ TreeNode root = new DefaultMutableTreeNode(getSimulAction().getFactors()); factors.setRootVisible(true); FactorTreeModel model = new FactorTreeModel(root); Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -35,6 +35,7 @@ <script><![CDATA[ import jaxx.runtime.swing.Item; import fr.ifremer.isisfish.ui.WelcomePanelUI; + import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer; refresh(); public ExportUI (SimulAction action){ @@ -56,6 +57,7 @@ items.add(new Item(s, s, s, selected)); } listSimulExportChoose.setItems(items); + listSimulExportChoose.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createExportClassDocsModel(values))); } protected void exportChanged(){ if (listSimulExportChoose.getSelectedIndex() > -1){ Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -66,6 +66,8 @@ import fr.ifremer.isisfish.ui.sensitivity.SensitivityUI; import fr.ifremer.isisfish.entities.FisheryRegionImpl; import fr.ifremer.isisfish.datastore.StorageException; +import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipTableColumnRenderer; +import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer; import fr.ifremer.isisfish.simulator.launcher.SimulationServiceListener; SimulationServiceListener simulationListener; @@ -99,14 +101,16 @@ setListSimulParamsPopulationsItems(); setRulesItems(); fieldSimulParamsRegion.setSelectedItem(getContextValue(SimulAction.class).getSimulationParameter().getRegionName()); - if (getContextValue(SimulAction.class).getSimulationParameter().getUsePreScript()){ - SimulUI simul = getParentContainer(SimulUI.class); - simul.enablePreSimul(); + if (!isSensitivity()){ + if (getContextValue(SimulAction.class).getSimulationParameter().getUsePreScript()){ + SimulUI simul = getParentContainer(SimulUI.class); + simul.enablePreSimul(); + } + if (getContextValue(SimulAction.class).getSimulationParameter().getUseAnalysePlan()){ + SimulUI simul = getParentContainer(SimulUI.class); + simul.enableAnalysePlan(); + } } - if (getContextValue(SimulAction.class).getSimulationParameter().getUseAnalysePlan()){ - SimulUI simul = getParentContainer(SimulUI.class); - simul.enableAnalysePlan(); - } } protected void regionChange(ItemEvent e){ if (e.getStateChange() == ItemEvent.SELECTED) { @@ -139,6 +143,19 @@ }; } } +protected void setFactor(){ + if (isSensitivity()){ + getParentContainer(SensitivityUI.class).getSensitivityTabUI().setFactorModel(); + } +} +protected void setExportSens(){ + if (isSensitivity()){ + } +} +protected void setSensibilities(){ + if (isSensitivity()){ + } +} public void setSimulationParameter(SimulAction simulAction){ getContextValue(SimulAction.class).setSimulationParameter(simulAction.getSimulationParameter()); } @@ -153,6 +170,9 @@ getContextValue(SimulAction.class).loadOldSimulation(selected); refresh(); setFactorRegion(); + setExportSens(); + setSensibilities(); + setFactor(); getParentContainer(WelcomePanelUI.class).setInfoText(_("isisfish.message.old.simulation.loaded")); } }); @@ -181,24 +201,18 @@ getParentContainer(WelcomeTabUI.class).selTab(5); } protected void enablePreSimul(){ - if (fieldUseSimulPreScripts.isSelected()){ + getContextValue(SimulAction.class).getSimulationParameter().setUsePreScript(fieldUseSimulPreScripts.isSelected()); + if (fieldUseSimulPreScripts.isSelected() && !isSensitivity()){ SimulUI simul = getParentContainer(SimulUI.class); - if (simul != null){ - simul.enablePreSimul(); - } + simul.enablePreSimul(); } } protected void enableAnalysePlan(){ - if (fieldSimulUseAnalysePlan.isSelected()){ - getContextValue(SimulAction.class).getSimulationParameter().setUseAnalysePlan(true); + getContextValue(SimulAction.class).getSimulationParameter().setUseAnalysePlan(fieldSimulUseAnalysePlan.isSelected()); + if (fieldSimulUseAnalysePlan.isSelected() && !isSensitivity()){ SimulUI simul = getParentContainer(SimulUI.class); - if (simul != null){ - simul.enableAnalysePlan(); - } + simul.enableAnalysePlan(); } - else{ - getContextValue(SimulAction.class).getSimulationParameter().setUseAnalysePlan(false); - } } protected void enableOnlyExport(){ if (fieldSimulOnlyExport.isSelected()){ @@ -251,6 +265,8 @@ } protected void setRulesItems(){ listSimulParamsMesuresList.setListData(getContextValue(SimulAction.class).getRules().toArray()); + listSimulParamsMesuresList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createRuleDescriptionsModel2(getContextValue(SimulAction.class).getSimulationParameter().getRules(),buttonSimulParamsMesuresClear,listSimulParamsMesuresList))); + setRulesButton(); } protected void populationSelected(){ @@ -318,6 +334,7 @@ getContextValue(SimulAction.class).setRuleParameterValue(data.getName(), listSimulParamsMesuresList.getSelectedValue().toString(), model.getValueAt(row, 1)); } }); + simulParamsRules.getColumnModel().getColumn(0).setCellRenderer(new SimpleToolTipTableColumnRenderer(ToolTipListModelFactory.createRuleParamsModel(listSimulParamsMesuresList.getSelectedValue().toString()))); } protected void selectFilter(){ try { @@ -342,6 +359,12 @@ } return result; } +protected ComboBoxModel getParamsMesuresSelectModel(){ + java.util.List values = getContextValue(SimulAction.class).getRuleNames(); + DefaultComboBoxModel model = new DefaultComboBoxModel(values.toArray()); + fieldSimulParamsMesuresSelect.setRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createRuleDescriptionsModel(values))); + return model; +} protected void resetFilter(){ getContextValue(SimulAction.class).resetOldSimulatorNames(); } @@ -393,6 +416,7 @@ } return result; } + ]]> </script> <row> @@ -526,7 +550,7 @@ </row> <row> <cell fill="horizontal"> - <JComboBox id="fieldSimulParamsMesuresSelect" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getRuleNames().toArray())}'/> + <JComboBox id="fieldSimulParamsMesuresSelect" model='{getParamsMesuresSelectModel()}'/> </cell> </row> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -34,6 +34,7 @@ <script><![CDATA[ import fr.ifremer.isisfish.ui.WelcomePanelUI; import jaxx.runtime.swing.Item; + import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer; setListSimulExportChooseModel(); public ResultChoiceUI (SimulAction action){ @@ -54,6 +55,7 @@ items.add(new Item(s, s, s, selected)); } listResultNames.setItems(items); + listResultNames.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createResultFieldsModel(values))); } protected void saveResultNames(){ if (listResultNames.getSelectedIndex() != -1){ Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060) @@ -38,6 +38,8 @@ import javax.swing.table.TableModel; import fr.ifremer.isisfish.ui.widget.editor.ParameterColumnEditor; import javax.swing.table.TableColumn; + import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipTableColumnRenderer; + import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer; import fr.ifremer.isisfish.ui.widget.editor.GenericCell; import fr.ifremer.isisfish.simulator.AnalysePlan; import jaxx.runtime.swing.Item; @@ -48,10 +50,13 @@ } public void refresh(){ java.util.List<Item> items = new ArrayList<Item>(); - for (AnalysePlan ap : getContextValue(SimulAction.class).getParamAnalysePlans()){ + java.util.List<AnalysePlan> values = getContextValue(SimulAction.class).getParamAnalysePlans(); + + for (AnalysePlan ap : values){ items.add(new Item(ap.toString(), fr.ifremer.isisfish.datastore.AnalysePlanStorage.getName(ap), ap, false)); } listSimulParamsAnalysePlansList.setItems(items); + listSimulParamsAnalysePlansList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel2(values, buttonSimulParamsAnalysePlansClear, listSimulParamsAnalysePlansList))); setSimulParamsAnalysePlans(); } public void addAnalysePlan(){ @@ -120,6 +125,7 @@ getContextValue(SimulAction.class).setAnalysePlanParameterValue(data.getName(), (AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue(), model.getValueAt(row, 1)); } }); + simulParamsAnalysePlans.getColumnModel().getColumn(0).setCellRenderer(new SimpleToolTipTableColumnRenderer(ToolTipListModelFactory.createAnalysePlanParamsModel(listSimulParamsAnalysePlansList.getSelectedValue().toString()))); } } } @@ -127,11 +133,16 @@ SimulUI simul = getParentContainer(SimulUI.class); simul.selTab(0); } + protected DefaultComboBoxModel getAnalysePlansSelectModel(){ + java.util.List values = getContextValue(SimulAction.class).getAnalysePlanNames(); + fieldSimulParamsAnalysePlansSelect.setRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel(values))); + return new DefaultComboBoxModel(values.toArray()); + } ]]> </script> <row> <cell columns="2" fill="horizontal" weightx="1.0"> - <JComboBox id="fieldSimulParamsAnalysePlansSelect" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getAnalysePlanNames().toArray())}'/> + <JComboBox id="fieldSimulParamsAnalysePlansSelect" model='{getAnalysePlansSelectModel()}'/> </cell> </row> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -64,6 +64,7 @@ import fr.ifremer.isisfish.export.Export; import fr.ifremer.isisfish.export.SensitivityExport; import fr.ifremer.isisfish.logging.SimulationLoggerUtil; +import fr.ifremer.isisfish.mexico.MexicoHelper; import fr.ifremer.isisfish.rule.Rule; import fr.ifremer.isisfish.simulator.AnalysePlan; import fr.ifremer.isisfish.simulator.SimulationParameter; @@ -82,7 +83,6 @@ import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil; import fr.ifremer.isisfish.ui.widget.ErrorDialogUI; import fr.ifremer.isisfish.ui.widget.filter.FilterModel; - /** * SimulAction. * @@ -280,6 +280,26 @@ // all time reset number after load param.setAnalysePlanNumber(-1); regionStorage = param.getRegion(); + + // Chargement des sensibilites + sensitivityCalculator = param.getSensitivityCalculator(); + + // Chargement des exports de sensibilites + for (SensitivityExport ex : param.getSensitivityExport()){ + sensitivityExports.put(ex, ex.getExportFilename()); + } + + // Chargement des facteurs + File f = simulStorage.getMexicoDesignPlan(SimulationStorage.getSimulationDirectory(simulName)); + if (f != null){ + log.debug("Import design plan from : " + f.getPath()); + designPlan = MexicoHelper.getDesignPlanFromXML(f.getPath()); + factors.clear(); + for (Factor factor : designPlan.getFactors()){ + log.debug("Find factor : " + factor.getName()); + factors.put(factor.getPath() + factor.getName(), factor); + } + } } catch (Exception eee) { log.error("Can't load old Simulation: " + simulName, eee); showMsgBox(eee); Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -145,8 +145,7 @@ * @param names Rule names * @return the model builded */ - public static ToolTipListModel createRuleDescriptionsModel( - List<String> names) { + public static ToolTipListModel createRuleDescriptionsModel(List<String> names) { List<String> texts = new ArrayList<String>(); List<String> toolTips = new ArrayList<String>(); @@ -185,8 +184,7 @@ * @param list the list containing the renderer * @return the model builded */ - public static ToolTipListModel createRuleDescriptionsModel2( - List<Rule> rules, JButton clearButton, JList list) { + public static ToolTipListModel createRuleDescriptionsModel2(List<Rule> rules, JButton clearButton, JList list) { List<String> texts = new ArrayList<String>(); List<String> toolTips = new ArrayList<String>(); @@ -224,15 +222,16 @@ * @param rules the selected rules (we only use the first one) * @return the model builded */ - public static ToolTipListModel createRuleParamsModel(Collection rules) { + public static ToolTipListModel createRuleParamsModel(String rules) { + System.out.println("createRuleParamsModel for rules : " + rules); List<String> texts = new ArrayList<String>(); List<String> toolTips = new ArrayList<String>(); - if (rules.isEmpty()) { + if (rules == null || rules.equals("")) { return new ToolTipListModel(texts, toolTips); } - String name = RuleStorage.getName(rules.iterator().next()); + String name = RuleStorage.getName(rules); try { @@ -351,15 +350,11 @@ * @param analysePlans the selected analyse plan (we only use the first one) * @return the model builded */ - public static ToolTipListModel createAnalysePlanParamsModel( - Collection analysePlans) { + public static ToolTipListModel createAnalysePlanParamsModel(String name) { List<String> texts = new ArrayList<String>(); List<String> toolTips = new ArrayList<String>(); - if (analysePlans.size() > 0) { - String name = AnalysePlanStorage.getName( - analysePlans.iterator().next()); - + if (name != null && !name.equals("")) { try { AnalysePlanStorage storage = AnalysePlanStorage.getAnalysePlan(name); Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -1,62 +1,66 @@ -//package fr.ifremer.isisfish.ui.widget.renderer; -// -///** -// * Simple implementation of {@link ToolTipComboBoxRenderer} renderer with a cache -// * to store text and tooltip to be displayed. -// * <p/> -// * <p/> -// * To set the cache just use the method {@link #setModel(ToolTipListModel)} . -// * <p/> -// * Internal cache will be based on two list (one for text, and one for doc) -// * <p/> -// * <b>This is a swixat extends, so just for swixat...</b> -// * -// * @author chemit -// * @see ToolTipListRenderer -// * @see WithToolTipListModel -// * @see ToolTipComboBoxRenderer -// */ -//public class SimpleToolTipComboBoxRenderer extends ToolTipComboBoxRenderer { -// -// /** the model to use */ -// protected ToolTipListModel model; -// -// /** -// * set the model to use -// * -// * @param model the mode to use -// */ -// public void setModel(ToolTipListModel model) { -// this.model = model; -// } -// -// /** -// * @param value model contrete value -// * @param index index of the row -// * @return the text to display (this is a pre-computed value) -// */ -// public String getText(Object value, int index) { -// // index should contains the row index but for some mysterious reason -// // we don't have for ComboBox, so must find realIndex by ourself -// if (index==-1) { -// index = model.getIndex(value); -// } -// return model == null ? null : model.getText(index); -// } -// -// /** -// * @param value model concret object -// * @param index index of the row -// * @param text the text to be displayed -// * @return the tooltip to display (this is a pre-computed value) -// */ -// public String getToolTip(Object value, int index, String text) { -// // index should contains the row index but for some mysterious reason -// // we don't have for ComboBox, so must find realIndex by ourself -// if (index==-1) { -// index = model.getIndex(text); -// } -// return model == null ? null : model.getToolTipText(index); -// } -// -//} // SimpleToolTipComboBoxRenderer \ No newline at end of file +package fr.ifremer.isisfish.ui.widget.renderer; + +import java.awt.Component; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.ListCellRenderer; + +/** + * Simple implementation of {@link ToolTipTableColumnRenderer} renderer + * with a cache to store text and tooltip to be displayed. + * <p/> + * <p/> + * To set the cache just use the method {@link #setModel(ToolTipListModel)} . + * <p/> + * Internal cache will be based on two list (one for text, and one for doc) + * <p/> + * <b>This is a swixat extends, so just for swixat...</b> + * + * @author chemit + * @see ToolTipListRenderer + * @see ToolTipListModel + */ +public class SimpleToolTipComboBoxRenderer extends JLabel implements ListCellRenderer { + /** the model to use */ + protected ToolTipListModel model; + + public SimpleToolTipComboBoxRenderer(ToolTipListModel model){ + this.model = model; + } + /** + * set the model to use + * + * @param model the mode to use + */ + public void setModel(ToolTipListModel model) { + this.model = model; + } + + /** + * @param value model contrete value + * @param index index of the row + * @return the text to display (this is a pre-computed value) + */ + public String getText(Object value, int index) { + return model == null ? null : model.getText(index); + } + + /** + * @param value model concret object + * @param index index of the row + * @param text the text to be displayed + * @return the tooltip to display (this is a pre-computed value) + */ + public String getToolTip(Object value, int index, String text) { + return model == null ? null : model.getToolTipText(index); + } + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + String toolTip = model.getToolTipText(index); + setToolTipText(toolTip); + setText(value.toString()); + return this; + } + +} // SimpleToolTipTableColumnRenderer \ No newline at end of file Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipListRenderer.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipListRenderer.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipListRenderer.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -1,50 +0,0 @@ -//package fr.ifremer.isisfish.ui.widget.renderer; -// -///** -// * Simple implementation of {@link ToolTipListRenderer} renderer with a cache -// * to store text and tooltip to be displayed. -// * <p/> -// * <p/> -// * To set the cache just use the method {@link #setModel(ToolTipListModel)} . -// * <p/> -// * Internal cache will be based on two list (one for text, and one for doc) -// * <p/> -// * <b>This is a swixat extends, so just for swixat...</b> -// * -// * @author chemit -// * @see ToolTipListRenderer -// * @see ToolTipListModel -// */ -//public class SimpleToolTipListRenderer extends ToolTipListRenderer { -// /** the model to use */ -// protected ToolTipListModel model; -// -// /** -// * set the model to use -// * -// * @param model the mode to use -// */ -// public void setModel(ToolTipListModel model) { -// this.model = model; -// } -// -// /** -// * @param value model contrete value -// * @param index index of the row -// * @return the text to display (this is a pre-computed value) -// */ -// public String getText(Object value, int index) { -// return model == null ? null : model.getText(index); -// } -// -// /** -// * @param value model concret object -// * @param index index of the row -// * @param text the text to be displayed -// * @return the tooltip to display (this is a pre-computed value) -// */ -// public String getToolTip(Object value, int index, String text) { -// return model == null ? null : model.getToolTipText(index); -// } -// -//} // SimpleToolTipListRenderer \ No newline at end of file Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -1,50 +1,67 @@ -//package fr.ifremer.isisfish.ui.widget.renderer; -// -///** -// * Simple implementation of {@link ToolTipTableColumnRenderer} renderer -// * with a cache to store text and tooltip to be displayed. -// * <p/> -// * <p/> -// * To set the cache just use the method {@link #setModel(ToolTipListModel)} . -// * <p/> -// * Internal cache will be based on two list (one for text, and one for doc) -// * <p/> -// * <b>This is a swixat extends, so just for swixat...</b> -// * -// * @author chemit -// * @see ToolTipListRenderer -// * @see ToolTipListModel -// */ -//public class SimpleToolTipTableColumnRenderer extends ToolTipTableColumnRenderer { -// /** the model to use */ -// protected ToolTipListModel model; -// -// /** -// * set the model to use -// * -// * @param model the mode to use -// */ -// public void setModel(ToolTipListModel model) { -// this.model = model; -// } -// -// /** -// * @param value model contrete value -// * @param index index of the row -// * @return the text to display (this is a pre-computed value) -// */ -// public String getText(Object value, int index) { -// return model == null ? null : model.getText(index); -// } -// -// /** -// * @param value model concret object -// * @param index index of the row -// * @param text the text to be displayed -// * @return the tooltip to display (this is a pre-computed value) -// */ -// public String getToolTip(Object value, int index, String text) { -// return model == null ? null : model.getToolTipText(index); -// } -// -//} // SimpleToolTipTableColumnRenderer \ No newline at end of file +package fr.ifremer.isisfish.ui.widget.renderer; + +import fr.ifremer.isisfish.ui.widget.editor.GenericCell; +import java.awt.Component; +import javax.swing.JLabel; +import javax.swing.JTable; +import javax.swing.table.TableCellRenderer; + +/** + * Simple implementation of {@link ToolTipTableColumnRenderer} renderer + * with a cache to store text and tooltip to be displayed. + * <p/> + * <p/> + * To set the cache just use the method {@link #setModel(ToolTipListModel)} . + * <p/> + * Internal cache will be based on two list (one for text, and one for doc) + * <p/> + * <b>This is a swixat extends, so just for swixat...</b> + * + * @author chemit + * @see ToolTipListRenderer + * @see ToolTipListModel + */ +public class SimpleToolTipTableColumnRenderer extends JLabel implements TableCellRenderer { + /** the model to use */ + protected ToolTipListModel model; + + public SimpleToolTipTableColumnRenderer(ToolTipListModel model){ + this.model = model; + } + /** + * set the model to use + * + * @param model the mode to use + */ + public void setModel(ToolTipListModel model) { + this.model = model; + } + + /** + * @param value model contrete value + * @param index index of the row + * @return the text to display (this is a pre-computed value) + */ + public String getText(Object value, int index) { + return model == null ? null : model.getText(index); + } + + /** + * @param value model concret object + * @param index index of the row + * @param text the text to be displayed + * @return the tooltip to display (this is a pre-computed value) + */ + public String getToolTip(Object value, int index, String text) { + return model == null ? null : model.getToolTipText(index); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + String toolTip = model.getToolTipText(column); + setToolTipText(toolTip); + setText(value.toString()); + return this; + } + +} // SimpleToolTipTableColumnRenderer \ No newline at end of file Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipComboBoxRenderer.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipComboBoxRenderer.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipComboBoxRenderer.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -1,61 +0,0 @@ -//package fr.ifremer.isisfish.ui.widget.renderer; -// -////import org.swixat.databinding.JComboBoxRenderer; -// -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -// -//import javax.swing.JList; -//import java.awt.Component; -// -///** -// * Class to defined an abstract comboBox renderer capable of dispaying some text -// * and tooltip using object in model. -// * <p/> -// * Just implements {@link #getText(Object,int)} and -// * {@link #getToolTip(Object,int, String)} -// * to use it. -// * <p/> -// * <b>This is a swixat extends, so just for swixat...</b> -// * -// * @author chemit -// * @see ToolTipListModel -// * @see WithToolTipListModel -// */ -//public abstract class ToolTipComboBoxRenderer extends JComboBoxRenderer -// implements WithToolTipListModel { -// -// /** to use log facility, just put in your code: log.info(\"...\"); */ -// static private Log log = LogFactory.getLog(ToolTipComboBoxRenderer.class); -// -// @Override -// public Component getListCellRendererComponent(JList list, Object value, -// int index, boolean selected, -// boolean hasFocus) { -// // log.debug(" enter for [" + index + "] " + value + "(" + -// if (value == null) { -// list.setToolTipText(null); -// return this; -// } -// -// String tip = null; -// String text = null; -// -// try { -// -// text = getText(value, index); -// -// tip = getToolTip(value, index, text); -// -// } catch (Exception e) { -// log.warn("can't get text or tooltip for " + value); -// } -// -// list.setToolTipText(tip == null || "".equals(tip) ? null : tip); -// -// // let default behaviour for rendering with specified text computed -// return super.getListCellRendererComponent(list, text, index, -// selected, hasFocus); -// } -// -//} // ToolTipComboBoxRenderer \ No newline at end of file Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListRenderer.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListRenderer.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListRenderer.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -1,63 +0,0 @@ -//package fr.ifremer.isisfish.ui.widget.renderer; -// -// -//import org.swixat.databinding.JListRenderer; -// -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -// -//import javax.swing.JList; -//import java.awt.Component; -// -///** -// * Class to defined an abstract list renderer capable of dispaying some text -// * and tooltip using object in model. -// * <p/> -// * Just implements {@link #getText(Object,int)} and -// * {@link #getToolTip(Object,int, String)} -// * to use it. -// * <p/> -// * <b>This is a swixat extends, so just for swixat...</b> -// * -// * @author chemit -// * @see ToolTipListModel -// * @see WithToolTipListModel -// */ -//public abstract class ToolTipListRenderer extends JListRenderer -// implements WithToolTipListModel { -// -// /** to use log facility, just put in your code: log.info(\"...\"); */ -// static private Log log = LogFactory.getLog(ToolTipListRenderer.class); -// -// @Override -// public Component getListCellRendererComponent(JList list, Object value, -// int index, boolean selected, -// boolean hasFocus) { -// // log.debug(" enter for [" + index + "] " + value + "(" + -// -// if (value == null) { -// list.setToolTipText(null); -// return this; -// } -// -// String tip = null; -// String text = null; -// -// try { -// -// text = getText(value, index); -// -// tip = getToolTip(value, index, text); -// -// } catch (Exception e) { -// log.warn("can't get text or tooltip for " + value); -// } -// -// list.setToolTipText(tip == null || "".equals(tip) ? null : tip); -// -// // let default behaviour for rendering with specified text computed -// return super.getListCellRendererComponent(list, text, index, -// selected, hasFocus); -// } -// -//} //ToolTipListRenderer \ No newline at end of file Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipTableColumnRenderer.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipTableColumnRenderer.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipTableColumnRenderer.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -1,64 +0,0 @@ -//package fr.ifremer.isisfish.ui.widget.renderer; -// -// -//import org.swixat.databinding.JTableColumnRenderer; -// -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; -// -//import javax.swing.JTable; -//import java.awt.Component; -// -///** -// * Class to defined an abstract list renderer capable of dispaying some text -// * and tooltip using object in model. -// * <p/> -// * Just implements {@link #getText(Object,int)} and -// * {@link #getToolTip(Object,int, String)} -// * to use it. -// * <p/> -// * <b>This is a swixat extends, so just for swixat...</b> -// * -// * @author chemit -// * @see ToolTipListModel -// * @see WithToolTipListModel -// */ -//public abstract class ToolTipTableColumnRenderer extends JTableColumnRenderer -// implements WithToolTipListModel { -// -// /** to use log facility, just put in your code: log.info(\"...\"); */ -// static private Log log = LogFactory.getLog(ToolTipTableColumnRenderer.class); -// -// @Override -// public Component getTableCellRendererComponent( -// JTable table, Object value, boolean selected, boolean focus, -// int row, int col) { -// -// if (value == null) { -// table.setToolTipText(null); -// return this; -// } -// -// String tip = null; -// Object realValue = value; -// -// // we only treate tooltip on first column which contains libelle -// -// if (col == 0) { -// try { -// realValue = getText(value, row); -// -// tip = getToolTip(value, row, (String) realValue); -// -// } catch (Exception e) { -// log.warn("can't get text or tooltip for " + value); -// } -// } -// table.setToolTipText(tip == null || "".equals(tip) ? null : tip); -// -// // let default behaviour for rendering -// return super.getTableCellRendererComponent(table, realValue, selected, -// focus, row, col); -// } -// -//} //ToolTipTableColumnRenderer \ No newline at end of file Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/WithToolTipListModel.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/WithToolTipListModel.java 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/WithToolTipListModel.java 2009-04-02 09:55:22 UTC (rev 2060) @@ -1,43 +0,0 @@ -package fr.ifremer.isisfish.ui.widget.renderer; - -import javax.swing.ListCellRenderer; -import javax.swing.table.TableCellRenderer; - -/** - * This is the contract ot be realised by any {@link ListCellRenderer} or {@link TableCellRenderer} which - * wants to have an automatic text - tooltip renderer. - * <p/> - * It used a {@link ToolTipListModel} to store the text and tootltip that - * renderer will display. - * - * @see ToolTipListModel - * @see ToolTipComboBoxRenderer - * @see ToolTipListRenderer - * @see ToolTipTableColumnRenderer - */ -public interface WithToolTipListModel { - /** - * the text to display - * - * @param value current value in model - * @param index row index - * @return the text to display in cell - */ - String getText(Object value, int index); - - /** - * the tooltip to display - * - * @param value current value in model - * @param index row index - * @param text the text already computed to be displayed (could be usefull) - * @return the tootltip to display the this row - */ - String getToolTip(Object value, int index, String text); - - /** - * @param model the model to use by renderer to display text and tooltipText - * @see ToolTipListModel - */ - void setModel(ToolTipListModel model); -} Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties =================================================================== --- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-02 09:55:22 UTC (rev 2060) @@ -18,9 +18,14 @@ Can't\ open\ log\ for\ %s= Can't\ simulate\ %s= Check\ state\ of\ local\ repository\:\ %s= +Check\ syntax\ of\ the\ current\ script= Checkout\ pom.xml\ to\ %s= Command\ '%s'\ fail\ to\ execute= +Commit\ script\ to\ CVS\ server= +Copy\ current\ selection\ (Ctrl-c)= Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s= +Create\ a\ new\ script= +Cut\ current\ selection\ (Ctrl-x)= Error\ during\ vcs\ initialisation= Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys= Generate\ next\ simulation= @@ -37,12 +42,14 @@ Month\ Gap\ BetweenRepro\ Recruitment= Normal\ stop\ thread,\ this\ is\ not\ an\ error= Not\ start\ simulation\ %s\ because\ user\ ask\ stop= +Paste\ current\ selection\ (Ctrl-v)= Process\ template\ error= Region\ %s\ allready\ exist\ in\ repository.\ Can't\ import= Region\ %s\ already\ inited= Remote\ IsisFish\ server= Remote\ control\ file\ doesn't\ exists\ %s= Rename\ data\ directory\ to\ %s= +Save\ current\ script= Show\ help= SimulationExecutor\ started\ with\ %s\ thread\ for\ %s= Ssh\ key\ found\ '%s'\ will\ be\ used\ to\ connect\ to= @@ -51,6 +58,7 @@ SubProcess\ start\:\ %s\ %s= Switch\ repository\ type\ to\ none= The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.= +Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)= Try\ to\ log\ on\ %s@%s\:%d= Use\ branches,\ switch\ not\ needed= User\ stop\ simulation\ %s= @@ -67,6 +75,7 @@ destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite= directory\ %s\ must\ be\ a\ directory= filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines. +in\ hour= isisfish.about.abouthtmltext=<html><b>Isis-Fish (%s)</b><br /><br />Copyright IFREMER-MAERHA 2000-2009.<br /><br /><a href\="http\://isis-fish.labs.libre-entreprise.org">http\://isis-fish.labs.libre-entreprise.org</a><br /><br />Please, report any bug you can found.<html> isisfish.about.licensetext=You can modify and redistribute the program under the conditions of the GNU General Public License (version 2 or later). A copy of the GPL is in the file "LICENSE.txt" provided with Isis-Fish. All rights reserved. No guarantees are provided for use of this program. isisfish.about.title=About Isis-Fish... @@ -1014,6 +1023,8 @@ isisfish.zone.cells=Zone cells isisfish.zone.comments=Comments isisfish.zone.name=Name +maximum\ length= +minimum\ length= not\ started= region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite= simulate\ %s\ with\ file\ %s= Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties =================================================================== --- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-01 16:52:11 UTC (rev 2059) +++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-02 09:55:22 UTC (rev 2060) @@ -18,9 +18,14 @@ Can't\ open\ log\ for\ %s= Can't\ simulate\ %s= Check\ state\ of\ local\ repository\:\ %s= +Check\ syntax\ of\ the\ current\ script= Checkout\ pom.xml\ to\ %s= Command\ '%s'\ fail\ to\ execute= +Commit\ script\ to\ CVS\ server= +Copy\ current\ selection\ (Ctrl-c)= Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s= +Create\ a\ new\ script= +Cut\ current\ selection\ (Ctrl-x)= Error\ during\ vcs\ initialisation= Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys= Generate\ next\ simulation= @@ -37,12 +42,14 @@ Month\ Gap\ BetweenRepro\ Recruitment= Normal\ stop\ thread,\ this\ is\ not\ an\ error= Not\ start\ simulation\ %s\ because\ user\ ask\ stop= +Paste\ current\ selection\ (Ctrl-v)= Process\ template\ error= Region\ %s\ allready\ exist\ in\ repository.\ Can't\ import= Region\ %s\ already\ inited=La r\u00E9gion %s a d\u00E9j\u00E0 \u00E9t\u00E9 initialis\u00E9e Remote\ IsisFish\ server= Remote\ control\ file\ doesn't\ exists\ %s= Rename\ data\ directory\ to\ %s= +Save\ current\ script= Show\ help= SimulationExecutor\ started\ with\ %s\ thread\ for\ %s= Ssh\ key\ found\ '%s'\ will\ be\ used\ to\ connect\ to= @@ -51,6 +58,7 @@ SubProcess\ start\:\ %s\ %s= Switch\ repository\ type\ to\ none= The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.= +Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)= Try\ to\ log\ on\ %s@%s\:%d= Use\ branches,\ switch\ not\ needed= User\ stop\ simulation\ %s= @@ -67,6 +75,7 @@ destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite= directory\ %s\ must\ be\ a\ directory= filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines. +in\ hour= isisfish.about.abouthtmltext=<html><b>Isis-Fish (%s)</b><br /><br />Copyright IFREMER-MAERHA 2000-2009.<br /><br /><a href\="http\://isis-fish.labs.libre-entreprise.org">http\://isis-fish.labs.libre-entreprise.org</a><br /><br />Merci de rapporter les bugs.<html> isisfish.about.licensetext=Vous pouvez modifier et redistribuer ce programme sous les conditions \u00E9nonc\u00E9es par la licence GNU GPL (version 2 ou ult\u00E9rieure). Une copie de la licence GPL est dans le fichier \u00AB\u00A0LICENSE.txt\u00A0\u00BB fourni avec Isis-Fish. Tous droits r\u00E9serv\u00E9s. Aucune garantie n'est fournie pour l'utilisation de ce programme. isisfish.about.title=\u00C0 propos de Isis-Fish... @@ -1014,6 +1023,8 @@ isisfish.zone.cells=cellules de la Zone isisfish.zone.comments=Commentaires isisfish.zone.name=Nom +maximum\ length= +minimum\ length= not\ started= region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite= simulate\ %s\ with\ file\ %s=
participants (1)
-
sletellier@users.labs.libre-entreprise.org