r1613 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish java/fr/ifremer/isisfish/actions java/fr/ifremer/isisfish/ui java/fr/ifremer/isisfish/ui/input java/fr/ifremer/isisfish/ui/result java/fr/ifremer/isisfish/ui/script java/fr/ifremer/isisfish/ui/simulator java/fr/ifremer/isisfish/ui/widget java/fr/ifremer/isisfish/ui/widget/renderer resources/i18n resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities
Author: sletellier Date: 2008-11-21 12:42:36 +0000 (Fri, 21 Nov 2008) New Revision: 1613 Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUI.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIJAXX.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUI.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIJAXX.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUI.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIJAXX.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUI.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIJAXX.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUI.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIJAXX.jaxx Removed: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/swix/ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/ScriptActionHelper.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Welcome.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/Input.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputEffortDescription.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputFisheryRegion.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputGear.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputMetier.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputPopulation.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSpecies.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreation.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIOld.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIOld.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIold.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIOld.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIOld.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/setter/ Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/ExportAction.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/ImportAction.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/VCSAction.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/AboutFrameUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/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/WizardGroupCreationUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResult.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBean.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultView.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultViewUI.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanel.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBean.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/Action.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensWizard.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/SimpleToolTipListRenderer.java 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/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/resources/i18n/isis-fish-en_GB.properties isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ActiveRuleImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/CellImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/EffortDescriptionImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/EquationImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/FisheryRegionImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/GearImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/MetierImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationGroupImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PortImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ResultImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SeasonImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SelectivityImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SetOfVesselsImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SpeciesImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/StrategyImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/TargetSpeciesImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/TripTypeImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/VesselTypeImpl.hbm.xml isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ZoneImpl.hbm.xml Log: Suppression de swixat Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -40,7 +40,7 @@ import fr.ifremer.isisfish.datastore.SimulationStorage; import fr.ifremer.isisfish.datastore.SimulatorStorage; import fr.ifremer.isisfish.simulator.launcher.SimulationService; -import fr.ifremer.isisfish.swix.LayoutConverter; +//import fr.ifremer.isisfish.swix.LayoutConverter; import fr.ifremer.isisfish.types.Date; import fr.ifremer.isisfish.types.Month; import fr.ifremer.isisfish.types.RangeOfValues; @@ -67,16 +67,16 @@ import java.util.Locale; import javax.swing.JOptionPane; import org.apache.commons.logging.Log; -import org.swixat.SwiXAT; -import org.swixat.model.Context; -import org.swixml.ConverterLibrary; +//import org.swixat.SwiXAT; +//import org.swixat.model.Context; +//import org.swixml.ConverterLibrary; import org.codelutin.i18n.I18n; import org.codelutin.log.UserLog; import org.codelutin.topia.TopiaException; import org.codelutin.util.LocaleConverter; import org.codelutin.util.VersionNumber; -import org.swixml.SwingEngine; +//import org.swixml.SwingEngine; import static javax.swing.JOptionPane.showOptionDialog; import fr.ifremer.isisfish.ui.WelcomeAction; import fr.ifremer.isisfish.ui.WelcomeUI; @@ -107,7 +107,7 @@ static public IsisConfig config = null; static public int step = 0; // action step static public VCS vcs = null; - static public Context uiContext = null; +// static public Context uiContext = null; /** * ask for application quit @@ -402,7 +402,7 @@ public static void initConvertersAndMatrixFactory() { // ajout du support de XMLGridLayout dans SwiXml - ConverterLibrary.getInstance().register(java.awt.LayoutManager.class, new LayoutConverter()); +// ConverterLibrary.getInstance().register(java.awt.LayoutManager.class, new LayoutConverter()); ConvertUtils.register(new LocaleConverter(), Locale.class); Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/ExportAction.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/ExportAction.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/ExportAction.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -29,7 +29,6 @@ import fr.ifremer.isisfish.datastore.ScriptStorage; import fr.ifremer.isisfish.datastore.SimulationStorage; import fr.ifremer.isisfish.datastore.SimulatorStorage; -import fr.ifremer.isisfish.ui.ScriptActionHelper; import java.io.File; import java.util.ArrayList; import java.util.Iterator; Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/ImportAction.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/ImportAction.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/ImportAction.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -30,7 +30,6 @@ import fr.ifremer.isisfish.datastore.ScriptStorage; import fr.ifremer.isisfish.datastore.SimulationStorage; import fr.ifremer.isisfish.datastore.SimulatorStorage; -import fr.ifremer.isisfish.ui.ScriptActionHelper; import java.io.File; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -163,7 +162,7 @@ * @throws java.lang.Exception */ public void importScriptModule(boolean force, File file) throws Exception { - ScriptActionHelper.importScript(file, force, false, null); +// ScriptActionHelper.importScript(file, force, false, null); } } Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/VCSAction.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/VCSAction.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/VCSAction.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -23,7 +23,6 @@ import com.sshtools.j2ssh.transport.publickey.OpenSSHPublicKeyFormat; import com.sshtools.j2ssh.transport.publickey.SshKeyGenerator; import fr.ifremer.isisfish.IsisConfig; -import fr.ifremer.isisfish.ui.Welcome; import java.io.File; import java.util.Arrays; import org.apache.commons.logging.Log; @@ -76,7 +75,7 @@ // ATTENTION: il est inutil de d'accepter cette option au premier // lancement! car on a effectue soit un checkout, soit // une migration // !IsisContext.get().isFirstLaunch() - Welcome.updateVCS(null); +// Welcome.updateVCS(null); } public void vcsAdd(File ... file) throws Exception { Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/AboutFrameUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/AboutFrameUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/AboutFrameUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -30,33 +30,8 @@ * by : $Author: sletellier $ */ --> -<JFrame id="aboutFrame" visible="true" size='{new Dimension(250,180)}' title="isisfish.about.title" - layout='{new BorderLayout()}'> -<!-- -Maximizable="false" Closable="true" -bundle="org.codelutin.i18n.I18nBundleBridge" ---> - <JPanel constraints='"BorderLayout.NORTH"' layout='{new GridBagLayout()}'> - <JLabel id="version"> -<!-- Fixme : gridbagconstraints - origin="fr.ifremer.isisfish.IsisConfig.getVERSION()" - <gridbagconstraints id="gbc_1" insets="5,2,2,2" gridx="0" gridy="0" ipadx="5" ipady="5" fill="1" /> ---> - </JLabel> - <JLabel text="isisfish.about.text"> -<!-- Fixme : gridbagconstraints -<gridbagconstraints use="gbc_1" gridx="0" gridy="1"/> ---> - </JLabel> - <JLabel text="isisfish.about.site"> -<!-- Fixme : gridbagconstraints -<gridbagconstraints use="gbc_1" gridx="0" gridy="2"/> ---> - </JLabel> - <JButton text="isisfish.common.ok" actionCommand="cancel"> -<!-- Fixme : gridbagconstraints -<gridbagconstraints use="gbc_1" gridx="0" gridy="3"/> ---> - </JButton> - </JPanel> -</JFrame> +<JPanel id="aboutFrame" layout='{new BorderLayout()}'> + <JLabel id="version" text='{_("isisfish.about.text") + " " + fr.ifremer.isisfish.IsisConfig.getVersion()}' constraints='BorderLayout.NORTH'/> + <JLabel text="isisfish.about.site" constraints='BorderLayout.CENTER'/> + <JButton text="isisfish.common.ok" constraints='BorderLayout.SOUTH' actionCommand='getParentContainer(JFrame.class).dispose()'/> +</JPanel> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -35,7 +35,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.swixat.framework.OutputView; +//import org.swixat.framework.OutputView; /** @@ -66,12 +66,12 @@ // IsisConfig et le lancer en ouvrant la page url // avec jdk1.6 // Desktop.getDesktop().browse(new URL(url)); - return new OutputView("Error.xml", "error", "Not implemented: " + url); +// return new OutputView("Error.xml", "error", "Not implemented: " + url); } catch(Exception eee){ log.error("Can't show help", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); +// return new OutputView("Error.xml", "error", eee.getMessage()); } -// return null; + return null; } } Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/ScriptActionHelper.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/ScriptActionHelper.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/ScriptActionHelper.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,180 +0,0 @@ -/* -* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin, -* Benjamin Poussin, Tony Chemit -* -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -* ##% */ -package fr.ifremer.isisfish.ui; - -import fr.ifremer.isisfish.ui.script.Action; -//import fr.ifremer.isisfish.ui.script.ExportDialog; -//import fr.ifremer.isisfish.ui.script.ImportDialog; -//import fr.ifremer.isisfish.ui.script.action.CancelAction; -//import fr.ifremer.isisfish.ui.script.action.ExportAction; -//import fr.ifremer.isisfish.ui.script.action.ImportAction; -import fr.ifremer.isisfish.IsisFish; -//import org.codelutin.vcs.ui.FieldModelUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import static org.codelutin.i18n.I18nf._; -import org.codelutin.util.FileUtil; -import org.codelutin.util.ZipUtil; -import org.swixat.framework.AbstractFrame; - -import javax.swing.JTextField; -import java.io.File; -import java.io.IOException; -import java.util.Date; -import java.util.List; - -/** - * Cette classe contient des méthodes publiques statiques de haut niveau pour - * executer des actions sur les scripts. - * - * @author tony - */ -public class ScriptActionHelper { - static private Log log = LogFactory.getLog(ScriptActionHelper.class); - - public static boolean importScript(File file, boolean force, boolean useUI, AbstractFrame frame) throws IOException { - // FIXME a reimplanter - throw new UnsupportedOperationException("En reparation"); - -// if (file == null && useUI) { -// // ask user form a .zscript file -// file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.scripts.zipped")); -// } -// if (file == null || !file.exists()) { -// //TODO log -// return false; -// } -// String message = _("isisfish.message.import.scripts.file", file); -// logMessage(useUI, frame, message); -// -// File root = IsisFish.config.getDatabaseDirectory(); -// -// // get two list of relative path (one for new files,one for exisiting files) -// List<String>[] explode = ZipUtil.scanAndExplodeZip( -// file, root, Action.getSCRIPT_FILE_FILTER()); -// -// // build model for dialog (list of new items), (list of exisiting items) -// boolean noNew = explode[0].size() == 0; -// boolean noConflict = explode[1].size() == 0; -// FieldModelUtil.ModuleFile<String> modelNewItems = null; -// FieldModelUtil.ModuleFile<String> modelItems = null; -// ImportAction okAction; -// ImportDialog dialog = null; -// CancelAction cancelAction = null; -// -// if (!noNew) { -// modelNewItems = FieldModelUtil.createModuleFileTableModelWithSelect( -// explode[0]); -// modelNewItems.checkAll(); -// } -// if (!noConflict) { -// modelItems = FieldModelUtil.createModuleFileTableModelWithSelect( -// explode[1]); -// // check if you can overwritte existing files -// if (!useUI && !force) { -// // this is an error, quit -// throw new IllegalArgumentException(_("isisfish.error.import.scripts.force")); -// } -// modelItems.checkAll(); -// } -// -// if (useUI) { -// // create import dialog -// dialog = new ImportDialog(); -// // create cancel action -// cancelAction = new CancelAction(dialog); -// } -// // create import action -// okAction = new ImportAction(dialog, file, root, modelNewItems, modelItems); -// -// if (useUI) { -// // prepare dialog and launch -// dialog.prepareDialog(20, modelNewItems, modelItems, file, okAction, cancelAction, true); -// } else { -// okAction.actionPerformed(null); -// } -// // after action -// return cancelAction == null || !cancelAction.isUsed(); - } - - public static boolean exportScript(File dst, List<String> listFiles, boolean force, boolean useUI, AbstractFrame frame) throws IOException { - // FIXME a reimplanter - throw new UnsupportedOperationException("En reparation"); - -// if (dst == null && useUI) { -// // ask user form a .zscript file -// String f = FileUtil.getDirectory(); -// String pattern = Action.dateFormat.format(new Date()); -// dst = f == null ? null : new File(dst, "exportScript-" + pattern + ".zip"); -// } -// if (dst == null) { -// //TODO log -// return false; -// } -// if (dst.exists()) { -// if (!useUI && !force) { -// // this is an error, quit -// throw new IllegalArgumentException(_("isisfish.error.export.scripts.force")); -// } -// } -// File root = IsisFish.config.getDatabaseDirectory(); -// -// String message = _("isisfish.message.export.scripts.file", dst); -// logMessage(useUI, frame, message); -// -// // create model -// FieldModelUtil.ModuleFile<String> model = FieldModelUtil.createModuleFileTableModelWithSelect(listFiles); -// model.checkAll(); -// ExportDialog dialog = null; -// CancelAction cancelAction = null; -// ExportAction okAction; -// JTextField field; -// -// if (useUI) { -// dialog = new ExportDialog(); -// cancelAction = new CancelAction(dialog); -// field = dialog.getArchivePath(); -// } else { -// field = new JTextField(dst.getAbsolutePath()); -// } -// -// okAction = new ExportAction(dialog, field, root, model); -// -// if (useUI) { -// // launch export dialog -// dialog.prepareDialog(10, model, dst.getAbsolutePath(), okAction, cancelAction, true); -// } else { -// // perform export -// okAction.actionPerformed(null); -// } -// // after action -// return cancelAction == null || !cancelAction.isUsed(); - } - - private static void logMessage(boolean useUI, AbstractFrame frame, String message) { - if (useUI && frame != null) { - frame.setInfoText(message); - } else { - //TODO Should use PrintWriter (for OptionAction to write in console ?) - //TODO Or use a special category logger ? - log.info(message); - } - } -} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -33,7 +33,6 @@ import fr.ifremer.isisfish.ui.util.IDialog; -import org.swixat.databinding.JTreeModel; import org.codelutin.topia.TopiaContext; import org.codelutin.util.FileUtil; @@ -95,41 +94,41 @@ * @param jmodel le JTreeModel de l'arbre * @param o l'objet a selectionner dans l'arbre */ - static public void setTreeSelection(JTree tree, JTreeModel jmodel, Object o) { - try { - log.debug("try to select objet in tree: " + o); - DefaultMutableTreeNode node = jmodel.getNode(o); - TreeNode[] path = node.getPath(); - if (log.isDebugEnabled()) { - log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path)); - } - TreePath newSelectionPath = new TreePath(path); - tree.setSelectionPath(newSelectionPath); - tree.scrollPathToVisible(newSelectionPath); - tree.revalidate(); - tree.repaint(); - } catch (Exception eee) { - log.warn("Can't select object in tree: " + o, eee); - } - } +// static public void setTreeSelection(JTree tree, JTreeModel jmodel, Object o) { +// try { +// log.debug("try to select objet in tree: " + o); +// DefaultMutableTreeNode node = jmodel.getNode(o); +// TreeNode[] path = node.getPath(); +// if (log.isDebugEnabled()) { +// log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path)); +// } +// TreePath newSelectionPath = new TreePath(path); +// tree.setSelectionPath(newSelectionPath); +// tree.scrollPathToVisible(newSelectionPath); +// tree.revalidate(); +// tree.repaint(); +// } catch (Exception eee) { +// log.warn("Can't select object in tree: " + o, eee); +// } +// } - static public void setTreeSelectionFirstChild(JTree tree, JTreeModel jmodel, Object o) { - try { - log.debug("try to select first child of objet in tree: " + o); - DefaultMutableTreeNode node = jmodel.getNode(o); - TreeNode[] path = ((DefaultMutableTreeNode) node.getFirstChild()).getPath(); - if (log.isDebugEnabled()) { - log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path)); - } - TreePath newSelectionPath = new TreePath(path); - tree.setSelectionPath(newSelectionPath); - tree.scrollPathToVisible(newSelectionPath); - tree.revalidate(); - tree.repaint(); - } catch (Exception eee) { - log.warn("Can't select child of object in tree: " + o, eee); - } - } +// static public void setTreeSelectionFirstChild(JTree tree, JTreeModel jmodel, Object o) { +// try { +// log.debug("try to select first child of objet in tree: " + o); +// DefaultMutableTreeNode node = jmodel.getNode(o); +// TreeNode[] path = ((DefaultMutableTreeNode) node.getFirstChild()).getPath(); +// if (log.isDebugEnabled()) { +// log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path)); +// } +// TreePath newSelectionPath = new TreePath(path); +// tree.setSelectionPath(newSelectionPath); +// tree.scrollPathToVisible(newSelectionPath); +// tree.revalidate(); +// tree.repaint(); +// } catch (Exception eee) { +// log.warn("Can't select child of object in tree: " + o, eee); +// } +// } public static void setColumnsWidth(JTable table, int... widths) { Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Welcome.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Welcome.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Welcome.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,216 +0,0 @@ -/* *##% - * Copyright (C) 2006 - * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * Welcome.java - * - * Created: 22 août 2006 10:50:49 - * - * @author poussin - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - -package fr.ifremer.isisfish.ui; - -import fr.ifremer.isisfish.ui.input.Input; -import fr.ifremer.isisfish.ui.result.ResultView; -import fr.ifremer.isisfish.vcs.VCSException; -//import org.codelutin.vcs.VCSAction; -//import org.codelutin.vcs.VCSRepositoryState; -//import org.codelutin.vcs.VCSFileState; -//import org.codelutin.vcs.VCSHelper; -//import fr.ifremer.isisfish.versionning.ui.VCSUIHelper; -//import fr.ifremer.isisfish.versionning.IsisRepositoryState; - -import fr.ifremer.isisfish.IsisFish; -import fr.ifremer.isisfish.actions.VCSAction; -import fr.ifremer.isisfish.datastore.AnalysePlanStorage; -import fr.ifremer.isisfish.datastore.ExportStorage; -import fr.ifremer.isisfish.datastore.FormuleStorage; -import fr.ifremer.isisfish.datastore.RuleStorage; -import fr.ifremer.isisfish.datastore.ScriptStorage; -import fr.ifremer.isisfish.datastore.SimulatorStorage; -import fr.ifremer.isisfish.vcs.VCS; -import org.swixat.framework.AbstractFrame; -import org.swixat.framework.OutputView; -import org.swixat.model.GenericContext; - -import static org.codelutin.i18n.I18nf._; -import org.codelutin.topia.TopiaContext; -//import org.codelutin.option.ui.ConfigUI; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import static javax.swing.JOptionPane.showMessageDialog; -import java.util.List; -import java.util.EnumSet; - -/** @author poussin */ - -public class Welcome { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(Welcome.class); - - static protected VCS getVCS() { - return IsisFish.vcs; - } - - /** - * Permet d'ouvrir une nouvelle fenetre de rendu des resultats - * - * @param frame TODO - * @param isisContext TODO - * @return null ou un fenetre d'erreur - */ - static public Object openResultView(AbstractFrame frame, - TopiaContext isisContext) { - log.debug("openResultView called " + frame + ":" + isisContext); - try { - ResultView resultView = new ResultView(); - resultView.setVisible(true); - } catch (Exception eee) { - log.error("Can't create entity", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Permet d'ouvrir une nouvelle fenetre de saisie - * - * @return null ou un fenetre d'erreur - */ - static public Object openInputView() { - log.debug("openInitView called"); - try { - // create and init context to prevent unitialised log message - GenericContext uiContext = new GenericContext(); - Input.initContext(uiContext); - return new OutputView("input/Input.xml", uiContext); - } catch (Exception eee) { - log.error("Can't create entity", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - } - - /** - * Afficher une boite avec deux listes, une pour les nouveaux et une pour - * les modifiers. <p/> Si on selectionne une fichier dans une des deux - * listes on montre le log. <p/> Apres selection des fichiers souhaites et - * appuie sur le bouton OK update de chaque fichier selectionné. <p/> - * Affichage d'une fenetre resultat avec pour chaque fichier selectionné le - * resultat: OK, merged, merge failed les deux derniers indiquent qu'il y - * avait aussi des modifs locales. <p/> L'utilisateur peut double clique sur - * un fichier pour l'ouvrir dans un editeur. - * - * @param frame swixat frame - * @throws VCSException if any errors while operation - */ - - public static void updateVCS(AbstractFrame frame) - throws VCSException { - // FIXME a reimplanter - throw new UnsupportedOperationException("En reparation"); - -// try { -// -// boolean hasFrame = frame != null; -// -// if (!getVCS().isConnected()) { -// log.error(I18nf._("isisfish.error.not.connected")); -// return; -// } -// if (hasFrame) { -// frame.setInfoText(_("isisfish.message.search.data")); -// } -// -// EnumSet<VCSAction> actions = VCSHelper.getAuthorizedActions(); -// -// // init repo synchronization -// VCSRepositoryState repoState = new IsisRepositoryState( -// IsisFish.config.getDatabaseDirectory(), -// actions, -// AnalysePlanStorage.getAnalysePlanDirectory(), -// ExportStorage.getExportDirectory(), -// FormuleStorage.getFormuleDirectory(), -// RuleStorage.getRuleDirectory(), -// ScriptStorage.getScriptDirectory(), -// SimulatorStorage.getSimulatorDirectory()); -// -// // create ui models -// repoState.createUIModels(); -// -// // obtain from user files to treate from repo state -// List<VCSFileState> filesToTreate = VCSUIHelper.showUpdateDialog(repoState); -// -// if (filesToTreate == null || filesToTreate.isEmpty()) { -// // nothing more to do here -// if (hasFrame) { -// frame.setInfoText(""); -// } -// return; -// } -// // ask user to confirm unsafe operations, then process vcs actions -// boolean notCancel = VCSUIHelper.showConfirmUpdateDialog(repoState.getRoot(), filesToTreate); -// -// if (notCancel && hasFrame) { -// frame.setInfoText(""); -// return; -// } -// -// if (hasFrame) { -// frame.setInfoText(_("isisfish.message.synchronize.done")); -// } -// -// } catch (Exception eee) { -// log.error(_("isisfish.error.update.repository"), eee); -// if (frame != null) { -// frame.viewOutput(new OutputView("Error.xml", "error", eee.getMessage())); -// } -// } - } - -// static ConfigUI ui; - - static public Object showConfig() { - try { - // FIXME a voir avec l'autre FIXME - throw new UnsupportedOperationException("En reparation"); -// getUi().setVisible(true); - } catch (Exception eee) { - new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - // FIXME voir comment remplacer ca -// static ConfigUI getUi() { -// if (ui == null) { -// IsisContext context = IsisContext.get(); -// ui = new ConfigUI().init(IsisFish.config, -// context.getVcsConfig(), context.getH2Config()); -// } -// return ui; -// } -} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -49,7 +49,10 @@ <fr.ifremer.isisfish.ui.simulator.SimulUI id='simulUI' constructorParams='new SimulAction()'/> </tab> <tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/calc.gif"))}'> - <fr.ifremer.isisfish.ui.result.ResultUI constructorParams='new ResultAction()'/> + <fr.ifremer.isisfish.ui.result.ResultView/> +<!-- + constructorParams='new ResultAction()' +--> </tab> <tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/book.gif"))}'> <fr.ifremer.isisfish.ui.input.InputUI constructorParams='new InputAction()'/> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -37,13 +37,14 @@ import fr.ifremer.isisfish.ui.input.InputUI; import fr.ifremer.isisfish.ui.input.InputAction; import fr.ifremer.isisfish.ui.result.ResultAction; - import fr.ifremer.isisfish.ui.result.ResultUI; + import fr.ifremer.isisfish.ui.result.ResultView; import fr.ifremer.isisfish.ui.script.ScriptUI; import fr.ifremer.isisfish.ui.simulator.SimulQueueUI; import fr.ifremer.isisfish.ui.simulator.SimulUI; import fr.ifremer.isisfish.IsisFish; import javax.swing.JFrame; welcomePanelUI.setContent(new WelcomeTabUI()); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); protected void openFrame(Container c, String title){ JFrame f = new JFrame(); f.setLayout(new BorderLayout()); @@ -61,9 +62,26 @@ protected void monitorUI() { new ApplicationMonitorUI(); } -// public void addMenu(JMenu menu){ -// menuBar.add(menu); -// } + protected void updateVCS(){ +// FIXME a reimplanter + } + protected void config(){ +// FIXME a reimplanter + } + protected void configVCS(){ +// FIXME a reimplanter + } + protected void help(){ +// FIXME a reimplanter + } + protected void about(){ + JFrame f = new JFrame(); + f.setLayout(new BorderLayout()); + f.add(new AboutFrameUI(), BorderLayout.CENTER); + f.setTitle("isisfish.about.title"); + f.setVisible(true); + f.pack(); + } ]]> </script> <JMenuBar> @@ -71,47 +89,29 @@ id="menuBar" --> <JMenu text='isisfish.welcome.menu.file'> - <JMenuItem text="isisfish.welcome.menu.synchro" /> -<!-- - onActionPerformed="getContextValue(WelcomeAction.class).updateVCS()" ---> + <JMenuItem text="isisfish.welcome.menu.synchro" onActionPerformed='updateVCS()'/> <JSeparator/> <JMenuItem text="isisfish.welcome.menu.close" onActionPerformed='close()'/> </JMenu> <JMenu text="isisfish.welcome.menu.frame"> <JMenuItem text="isisfish.welcome.menu.simulation" onActionPerformed='openFrame(new SimulUI(new SimulAction()), _("isisfish.simulation.title"))'/> - <JMenuItem text="isisfish.welcome.menu.result" onActionPerformed='openFrame(new ResultUI(new ResultAction()), _("isisfish.result.title"))'/> + <JMenuItem text="isisfish.welcome.menu.result" onActionPerformed='openFrame(new ResultView(), _("isisfish.result.title"))'/> <JMenuItem text="isisfish.welcome.menu.input" onActionPerformed='openFrame(new InputUI(new InputAction()), _("isisfish.input.title"))'/> <JMenuItem text="isisfish.welcome.menu.script" onActionPerformed='openFrame(new ScriptUI(), _("isisfish.script.title"))'/> <JSeparator/> <JMenuItem text="isisfish.welcome.menu.queue" onActionPerformed='openFrame(new SimulQueueUI(), _("isisfish.queue.title"))'/> -<!-- - onActionPerformed="getContextValue(WelcomeAction.class).openSimulQueueUIFrame()" ---> <JSeparator/> <JMenu text="isisfish.welcome.menu.configuration"> - <JMenuItem text="isisfish.welcome.menu.configuration"/> -<!-- - onActionPerformed="getContextValue(WelcomeAction.class).showConfig()" ---> - <JMenuItem text="isisfish.welcome.menu.vcs.configuration"/> -<!-- - onActionPerformed="getContextValue(WelcomeAction.class).showConfigVCS()" ---> + <JMenuItem text="isisfish.welcome.menu.configuration" onActionPerformed='config()'/> + <JMenuItem text="isisfish.welcome.menu.vcs.configuration" onActionPerformed='configVCS()'/> </JMenu> </JMenu> <JMenu text="isisfish.welcome.menu.help"> - <JMenuItem text="isisfish.welcome.menu.help"/> -<!-- - onActionPerformed="getContextValue(WelcomeAction.class).help()" ---> + <JMenuItem text="isisfish.welcome.menu.help" onActionPerformed='help()'/> <JSeparator/> <JMenuItem text="isisfish.welcome.menu.monitor" onActionPerformed='monitorUI()'/> <JSeparator/> - <JMenuItem text="isisfish.welcome.menu.about"/> -<!-- - onActionPerformed="getContextValue(WelcomeAction.class).aboutUI()" ---> + <JMenuItem text="isisfish.welcome.menu.about" onActionPerformed='about()'/> </JMenu> </JMenuBar> <WelcomePanelUI id="welcomePanelUI"/> Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/Input.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/Input.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/Input.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,1333 +0,0 @@ -/* - * *##% Copyright (C) 2005 Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place - Suite 330, Boston, MA 02111-1307, USA. ##% - */ - -/* * - * input.java - * - * Created: 18 août 2005 15:07:36 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * - * @version $Revision$ - * - * Last update: $Date$ by : $Author$ - */ -package fr.ifremer.isisfish.ui.input; - -import fr.ifremer.isisfish.IsisFishDAOHelper; -import fr.ifremer.isisfish.datastore.FormuleStorage; -import fr.ifremer.isisfish.datastore.RegionStorage; -import static fr.ifremer.isisfish.datastore.RegionStorage.getRegionNames; -import fr.ifremer.isisfish.datastore.SimulationStorage; -import static fr.ifremer.isisfish.datastore.SimulationStorage.getSimulationNames; -import fr.ifremer.isisfish.datastore.StorageException; -import fr.ifremer.isisfish.datastore.update.ImportFromV2; -import fr.ifremer.isisfish.entities.Equation; -import fr.ifremer.isisfish.entities.FisheryRegion; -import fr.ifremer.isisfish.entities.Population; -import fr.ifremer.isisfish.entities.Species; -import fr.ifremer.isisfish.ui.UIHelper; -import static fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil.selectSimulation; - -import org.swixat.databinding.JTreeModel; -import org.swixat.databinding.JTreeNode; -import org.swixat.databinding.TreeNodeWrapper; -import org.swixat.framework.AbstractFrame; -import org.swixat.framework.OutputView; -import org.swixat.model.Context; - -import static org.codelutin.i18n.I18nf._; -import org.codelutin.topia.TopiaContext; -import org.codelutin.topia.TopiaException; -import org.codelutin.topia.event.TopiaEntityEvent; -import org.codelutin.topia.event.TopiaTransactionEvent; -import org.codelutin.topia.persistence.TopiaDAO; -import org.codelutin.topia.persistence.TopiaEntity; -import org.codelutin.topia.persistence.TopiaId; -import org.codelutin.util.FileUtil; -import org.codelutin.widget.editor.Editor; - -import org.apache.commons.beanutils.MethodUtils; -import org.apache.commons.lang.ClassUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.swing.JComboBox; -import javax.swing.JOptionPane; -import static javax.swing.JOptionPane.showInputDialog; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.JTree; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.TreePath; -import java.awt.CardLayout; -import java.awt.Component; -import java.awt.Container; -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Method; -import java.util.List; - -/** - * Set of static method used for all input interface user as callback action for - * SwixAt framework - * - * @author poussin - */ -public class Input { // input - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(Input.class); - - static public Object openEditor(String category, String name, - Class javaInterface, String content, Editor editor) { - log.debug("openEditor"); - try { - EquationEditorPaneUI pane = new EquationEditorPaneUI(); - pane.setEquation(category, name, javaInterface, content); - pane.setVisible(true); - if (pane.isOk() && editor != null) { - editor.setText(pane.getEditor().getText()); - } - pane.dispose(); - } catch (Exception eee) { - log.error("Can't open editor", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Permet de creer simplement un nouvelle objet portant un nom par defaut. - * Le nouvel element est automatiquement selectionné dans l'arbre - * - * @param frame - * @param isisContext - * (auto) Le Topia context a utiliser - * @param tree - * (auto) l'arbre ou il faudra selectionner le nouvel element - * @param jmodel - * (auto) le model de l'arbre - * @param type - * le type de l'entite a creer, le type est compose seulement du - * nom de l'entite et pas du package. - * @return null ou un fenetre d'erreur - */ - @SuppressWarnings("unchecked") - static public Object create(AbstractFrame frame, TopiaContext isisContext, - JTree tree, JTreeModel jmodel, String type) { - log.debug("create called for " + type); - try { - String name = type + "_new"; - - Method method = MethodUtils.getAccessibleMethod( - IsisFishDAOHelper.class, "get" + type + "DAO", - TopiaContext.class); - TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke( - null, new Object[] { isisContext }); - - TopiaEntity entity = dao.create("name", name); - entity.update(); - isisContext.commitTransaction(); - - frame.refreshViewPattern("input" + type + ".*"); - UIHelper.setTreeSelection(tree, jmodel, entity); - - frame.setInfoText(_("isisfish.message.creation.finished")); - } catch (Exception eee) { - log.error("Can't create entity", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Save entity passed in argument, and commit - * - * @param frame - * @param idToRefresh - * id to refresh after commit - * @param entity - * entity to save - * @return if ok return null else OutView error - */ - static public Object save(AbstractFrame frame, String idToRefresh, - TopiaEntity entity) { - log.debug("save called"); - try { - if (entity == null) { - log.warn("Try to save null entity"); - return null; - } - // on est pas en autoUpdate donc il faut faire le update avant le - // commit - entity.update(); - - entity.getTopiaContext().commitTransaction(); - if (idToRefresh != null) { - frame.refreshView(idToRefresh); - } - - frame.setInfoText(_("isisfish.message.save.finished")); - } catch (Exception eee) { - log.error("Can't save region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Cancel all modification on entity (rollback), and force reload it and - * refresh all ui component that name match 'type'Tab - * - * @param uiContext - * @param frame - * @param isisContext - * @param type - * entity type (Zone, Gear, Population, ...), prefix of user - * interface Tab to refresh after rollback and reload - * @param entity - * entity to refresh - * @return if ok return null else OutView error - */ - static public Object cancel(Context uiContext, AbstractFrame frame, - TopiaContext isisContext, String type, TopiaEntity entity) { - log.debug("cancel called"); - try { - isisContext.rollbackTransaction(); - - // reload the object - if (entity != null) { - entity = isisContext.findByTopiaId(entity.getTopiaId()); - } - uiContext.setData(type, entity); - - frame.refreshView(type + "Tab"); - - frame.setInfoText(_("isisfish.message.cancel.finished")); - } catch (Exception eee) { - log.error("Can't cancel modification in region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Delete one entity and commit the change, try to selected intelligently - * other node in tree. - * <p> - * Refresh all ui component where name match "input<entity type without - * package >.*" - * - * @param uiContext - * @param frame - * @param isisContext - * @param fisheryRegion - * @param tree - * tree where we want to select other node - * @param jmodel - * tree model - * @param entity - * entuty to remove - * @return if ok return null else OutView error - */ - static public Object remove(Context uiContext, AbstractFrame frame, - TopiaContext isisContext, FisheryRegion fisheryRegion, JTree tree, - JTreeModel jmodel, TopiaEntity entity) { - log.debug("remove called"); - try { - DefaultMutableTreeNode node = jmodel.getNode(entity); - Object nextEntity = null; - - if (node != null) { - DefaultMutableTreeNode nextNode = node.getNextSibling(); - if (nextNode != null) { - nextEntity = nextNode.getUserObject(); - } else { - nextNode = node.getPreviousSibling(); - if (nextNode != null) { - nextEntity = nextNode.getUserObject(); - } else { - nextEntity = ((DefaultMutableTreeNode) node.getParent()) - .getUserObject(); - } - } - } - - boolean doDelete = true; - List<TopiaEntity> allWillBeRemoved = entity.getComposite(); - if (allWillBeRemoved.size() > 0) { - String text = _( - "isisfish.message.delete.object", - entity.toString()); - for (TopiaEntity e : allWillBeRemoved) { - text += ClassUtils.getShortClassName(e.getClass()) + " - " - + e.toString() + "\n"; - } - int resp = JOptionPane.showConfirmDialog(null, text, - _("isisfish.message.delete.entities"), JOptionPane.YES_NO_OPTION); - doDelete = resp == JOptionPane.YES_OPTION; - } else { - String text = _("isisfish.message.confirm.delete.object", entity - .toString()); - int resp = JOptionPane.showConfirmDialog(null, text, - _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION); - doDelete = resp == JOptionPane.YES_OPTION; - } - - if (doDelete) { - uiContext.setData("RegionModified", Boolean.FALSE); - uiContext.setData("InDeletion", Boolean.TRUE); - entity.delete(); - isisContext.commitTransaction(); - - frame.refreshViewPattern("input" - + ClassUtils.getShortClassName(TopiaId - .getClassNameAsString(entity.getTopiaId())) - + ".*"); - if (nextEntity != null) { - UIHelper.setTreeSelection(tree, jmodel, nextEntity); - } - - frame.setInfoText(_("isisfish.message.remove.finished")); - } else { - frame.setInfoText(_("isisfish.message.remove.canceled")); - } - } catch (Exception eee) { - log.error("Can't remove entity: " + entity, eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } finally { - uiContext.removeData("InDeletion"); - } - return null; - } - - /** - * Modify the current selected entity for specific type, and refresh ui - * component where name match "input" + type + ".*" - * - * @param uiContext - * @param frame - * @param type - * type of entity to select (Population, Zone, Gear, ...) - * @param entity - * the entity to put in context for this type - * @return if ok return null else OutView error - */ - static public Object selectEntity(Context uiContext, AbstractFrame frame, - String type, TopiaEntity entity) { - return selectEntityAndRefresh(uiContext, frame, type, entity, "input" - + type + ".*"); - } - - /** - * Modify the current selected entity for specific type, and refresh ui - * component where name match refreshPattern - * - * @param uiContext - * @param frame - * @param type - * @param entity - * @param refreshPattern - * @return if ok return null else OutView error - */ - static public Object selectEntityAndRefresh(Context uiContext, - AbstractFrame frame, String type, TopiaEntity entity, - String refreshPattern) { - log.debug("type: " + type + " selectEntity called : " + entity); - try { - uiContext.setData(type, entity); - frame.refreshViewPattern(refreshPattern); - } catch (Exception eee) { - log.error("Can't select Entity", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Create new region, and select it in combo, and show input pane region in - * input area. - * - * @param uiContext - * @param frame - * @param oldIsisContext - * @param oldRegionStorage - * @param inputPane - * @param combo - * @param name - * name of the new region - * @return if ok return null else OutView error - */ - static public Object newRegion(Context uiContext, AbstractFrame frame, - TopiaContext oldIsisContext, RegionStorage oldRegionStorage, - JPanel inputPane, JComboBox combo, String name) { - try { - log.debug("newRegion called"); - - frame.setInfoText(_("isisfish.message.creating.region", name)); - - if (oldRegionStorage != null && oldIsisContext != null) { - boolean result = askForSave(uiContext, frame, oldIsisContext); - if (result) { - addCommentOnRegion(uiContext, oldRegionStorage); - // close old context before change region - oldIsisContext.closeContext(); - } else { - frame.setInfoText(_("isisfish.message.create.region.canceled")); - return null; - } - } - - if ("".equals(name)) { - return new OutputView("Error.xml", "error", - _("isisfish.error.region.name.empty")); - } - if (getRegionNames().contains(name)) { - return new OutputView("Error.xml", "error", - _("isisfish.error.region.already.exists")); - } - - frame.setInfoText(_("isisfish.message.creating.region", name)); - - RegionStorage.create(name); - - // ajout de la nouvelle region dans la combo - frame.refreshView("fieldCurrentRegion"); - // on selectionne la nouvelle region, ce qui appelle loadRegion - combo.setSelectedItem(name); - - // frame.refreshView("saveStateWatcher"); - // frame.refreshView("fieldCurrentRegion"); - // frame.refreshView("treePanel"); - - ((CardLayout) inputPane.getLayout()).show(inputPane, - "FisheryRegion"); - - frame.setInfoText(_("isisfish.message.creation.finished")); - } catch (Exception eee) { - log.error("Can't create region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * load region. - * <p> - * RegionStorage, TopiaContext, FisheryRegion are put in uiContext data. - * <p> - * tree ans - * - * @param uiContext - * @param frame - * @param oldIsisContext - * @param oldRegionStorage - * @param inputPane - * inputPane is put in 'emptyPanel' state - * @param name - * name of region - * @return if ok return null else OutView error - */ - static public Object loadRegion(Context uiContext, AbstractFrame frame, - TopiaContext oldIsisContext, RegionStorage oldRegionStorage, - JPanel inputPane, String name) { - log.debug("loadRegion called"); - try { - frame.setInfoText(_("isisfish.message.loading.region", name)); - - if (oldRegionStorage != null && oldIsisContext != null) { - boolean result = askForSave(uiContext, frame, oldIsisContext); - if (result) { - addCommentOnRegion(uiContext, oldRegionStorage); - // close old context before change region - if (!oldIsisContext.isClosed()) { - oldIsisContext.closeContext(); - } - } else { - frame.setInfoText(_("isisfish.message.load.region.canceled")); - return null; - } - } - - RegionStorage regionStorage = null; - FisheryRegion fisheryRegion = null; - TopiaContext isisContext = null; - - initContext(uiContext); - - if (name != null && !"".equals(name)) { - regionStorage = RegionStorage.getRegion(name); - isisContext = regionStorage.getStorage().beginTransaction(); - fisheryRegion = RegionStorage.getFisheryRegion(isisContext); - } - uiContext.setData("RegionStorage", regionStorage); - uiContext.setData("TopiaContext", isisContext); - uiContext.setData("FisheryRegion", fisheryRegion); - - // on se met listener sur la nouvelle region - frame.refreshView("saveStateWatcher"); // TODO mettre ca en java - // pure et dure, plutot que - // de passé par SwixAt - // (input.xml), moins de - // risque d'erreur et plus - // rapide. - frame.refreshView("treePanel"); - frame.refreshView("menu"); - - // combo.setSelectedItem(name); - - ((CardLayout) inputPane.getLayout()).show(inputPane, "emptyPanel"); - - frame.setInfoText(_("isisfish.message.load.finished")); - } catch (Exception eee) { - log.error("Can't load region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public void initContext(Context uiContext) { - uiContext.setData("RegionStorage", null); - uiContext.setData("TopiaContext", null); - uiContext.setData("FisheryRegion", null); - - uiContext.setData("Cell", null); - uiContext.setData("Zone", null); - uiContext.setData("Port", null); - uiContext.setData("Species", null); - uiContext.setData("Population", null); - uiContext.setData("PopulationGroup", null); - uiContext.setData("PopulationSeasonInfo", null); - uiContext.setData("Engin", null); - uiContext.setData("Metier", null); - uiContext.setData("MetierSeasonInfo", null); - uiContext.setData("TripType", null); - uiContext.setData("VesselType", null); - uiContext.setData("SetOfVessels", null); - uiContext.setData("EffortDescription", null); - uiContext.setData("Strategy", null); - - uiContext.setData("EntityModified", Boolean.FALSE); - } - - /** - * callback du listener global du TopiaContext utilisé pour la input appelé - * lorsque le TopiaContext est modifié. Met a vrai dans le Context la - * variable 'EntityModified' Appel ensuite le rafraichissement de tous les - * boutons - * - * @param uiContext - * @param frame - * @return - */ - static public Object setEntityModified(Context uiContext, - AbstractFrame frame) { - log.debug("setEntityModified"); - try { - // si on est en train de supprimer des objets alors on ne fait rien - if (!uiContext.containsData("InDeletion")) { - Object oldState = uiContext.getData("EntityModified"); - if (oldState == null || oldState == Context.UNINITIALIZED - || Boolean.FALSE.equals(oldState)) { - uiContext.setData("EntityModified", Boolean.TRUE); - frame.refreshViewPattern("panel.*?ButtonAction"); - } - } - } catch (Exception eee) { - log.error("Can't set EntityModified data on uiContext", eee); - } - return null; - } - - /** - * callback du listener global du TopiaContext utilisé pour la input appelé - * lors d'un commit/rollback Met a null dans le Context la variable - * 'EntityModified' Appel ensuite le rafraichissement de tous les boutons - * - * @param uiContext - * @param frame - * @param commit - * true if this occur after commit else false - * @return - */ - static public Object unsetEntityModified(Context uiContext, - AbstractFrame frame, boolean commit) { - log.debug("unsetEntityModified"); - try { - if (commit) { - // this is commit event, then something in region has been - // modified - // put flag to mark this - uiContext.setData("RegionModified", Boolean.TRUE); - } - - Object oldState = uiContext.getData("EntityModified"); - if (oldState != null && Boolean.TRUE.equals(oldState)) { - uiContext.setData("EntityModified", null); - frame.refreshViewPattern("panel.*?ButtonAction"); - } - } catch (Exception eee) { - log.error("Can't set EntityModified data on uiContext", eee); - } - return null; - } - - /** - * Ask comment to user before close the input frame. This comment will be - * used during region's cvs commit as comment. - * <p> - * comment input by user must be explain modification done on region - * - * @param uiContext - * @param frame - * @param isisContext - * @param regionStorage - * @return - */ - static public Object saveCommentAndExit(Context uiContext, - AbstractFrame frame, TopiaContext isisContext, - RegionStorage regionStorage) { - log.debug("updateExitComment called"); - try { - boolean result = true; - if (regionStorage != null && isisContext != null) { - result = askForSave(uiContext, frame, isisContext); - if (result) { - addCommentOnRegion(uiContext, regionStorage); - // close context before exit - isisContext.closeContext(); - } - } - // 0 == close frame, 1 = don't close frame - return result ? 0 : 1; - } catch (Exception eee) { - log.error("Can't save exit comment", eee); - } - return null; - } - - static private void addCommentOnRegion(Context uiContext, - RegionStorage regionStorage) throws IOException { - Object modified = uiContext.getData("RegionModified"); - if (Boolean.TRUE.equals(modified)) { - String comment = - showInputDialog(_("isisfish.message.comment.region.modification")); - regionStorage.addCommentForNextCommit(comment); - } - } - - /** - * appelé lors d'un commit qui arrive lors d'un save. On gere ici la - * creation/modification, la suppression est geree dans une autre methode. - * - * @param uiContext - * @param isisContext - * @param tree - * @param jmodel - * @param event - * @return - */ - @SuppressWarnings("unchecked") - static public Object updateTreeEntityCommit(Context uiContext, - TopiaContext isisContext, JTree tree, JTreeModel jmodel, - TopiaTransactionEvent event) { - log.debug("updateTreeEntityModified: "); - try { - // sometime tree changes selection during tree modifications, and - // isis ask for save, because unsetEntityModified can be called - // after this method (listener is not in order) - // next line prevent this small bug - uiContext.setData("EntityModified", null); - - for (TopiaEntity e : event.getEntities()) { - if (event.isCreate(e) || event.isUpdate(e)) { - TopiaEntity entity = isisContext.findByTopiaId(e - .getTopiaId()); - if (entity != null) { - DefaultMutableTreeNode node = jmodel.getNode(entity); - if (node != null) { // c une modif - node.setUserObject(entity); - } else { // c une creation - // pour les Pop on gere un peu differement pour - // qu'il - // ne se trompe pas de branche - if (entity instanceof Population) { - Population pop = (Population) entity; - DefaultMutableTreeNode speciesNode = jmodel - .getNode(pop.getSpecies()); - TreeNodeWrapper popNode = (TreeNodeWrapper) speciesNode - .getFirstChild(); - JTreeNode jnode = (JTreeNode) popNode - .getWrapped().getComponent(0); - popNode.addNode(jnode, entity); - // jnode.addNode(entity); - } else { - JTreeNode jnodeParent = findNode(jmodel, entity - .getClass()); - if (jnodeParent != null) { - JTreeNode jnode = (JTreeNode) jnodeParent - .getComponent(0); - List<TreeNodeWrapper> nodes = JTreeModel - .searchNode(jnode); - if (nodes.size() == 1) { - TreeNodeWrapper nodeWrapper = nodes - .get(0); - nodeWrapper.addNode(jnode, entity); - } else { - log - .warn("Can't find node to put new entity: " - + entity); - } - } - } - } - } - } - } - tree.revalidate(); - tree.repaint(); - } catch (Exception eee) { - log.error("Can't modify tree", eee); - } - return null; - } - - /** - * appelé lors d'un rollback de la region. On gere ici la modification - * seulement car les creation et suppression d'objet sont automatiquement - * commité et donc non rollbackable - * - * @param isisContext - * @param tree - * @param jmodel - * @param event - * @return - */ - static public Object updateTreeEntityRollback(TopiaContext isisContext, - JTree tree, JTreeModel jmodel, TopiaTransactionEvent event) { - log.debug("updateTreeEntityRollback: "); - try { - for (TopiaEntity e : event.getEntities()) { - if (event.isModification(e)) { - TopiaEntity entity = isisContext.findByTopiaId(e - .getTopiaId()); - if (entity != null) { - DefaultMutableTreeNode node = jmodel.getNode(entity); - if (node != null) { // c une modif - node.setUserObject(entity); - } - } - } - } - tree.revalidate(); - tree.repaint(); - } catch (Exception eee) { - log.error("Can't modify tree", eee); - } - return null; - } - - /** - * Called when an entity is deleted in Region - * - * @param tree - * @param jmodel - * @param event - * @return - */ - static public Object updateTreeEntityRemoved(JTree tree, JTreeModel jmodel, - TopiaEntityEvent event) { - log.debug("updateTreeEntityRemoved: "); - try { - jmodel.removeNode(event.getEntity()); - - tree.revalidate(); - tree.repaint(); - } catch (Exception eee) { - log.error("Can't modify tree", eee); - } - return null; - } - - /** - * Looking for specific node. Start search in child's parent component and - * if not found call recursively findNode on each child component. - * <p> - * This method is used to find parent Node of newly created entity - * - * @param parent - * component that can contains wanted JTreeNode - * @param clazz - * class search in JTreeNode clientProperty (type) - * @return JTreeNode where type clientProperty is equals to clazz or null - */ - static private JTreeNode findNode(Container parent, Class clazz) { - Component result = null; - Component[] comps = parent.getComponents(); - for (Component comp : comps) { - if (comp instanceof JTreeNode - && ((JTreeNode) comp).getType() != null) { - String typeString = ((JTreeNode) comp).getType(); - try { - Class<?> type = Class.forName(typeString); - if (type.isAssignableFrom(clazz)) { - result = comp; - } - } catch (ClassNotFoundException eee) { - if (log.isWarnEnabled()) { - log.warn("Can't find class: " + typeString, eee); - } - } - } - - if (result == null && comp instanceof Container) { - result = findNode((Container) comp, clazz); - } - if (result != null) { - break; - } - } - return (JTreeNode) result; - } - - /** - * If some entities has been modified by the user (EntityModified state is - * true) then ask the user if he want save, don't save modification, or - * cancel current wanted action. - * - * If this method return true, only button (save, cancel) will be refreshed - * not the current input panel - * - * if this method return false, nothing is do - * - * @param uiContext - * @param frame - * @param isisContext - * current transaction context - * @return false if user want cancel action, true otherwize - * @throws TopiaException - */ - static protected boolean askForSave(Context uiContext, AbstractFrame frame, - TopiaContext isisContext) throws TopiaException { - boolean result = true; - Object oldState = uiContext.getData("EntityModified"); - if (oldState != null && Boolean.TRUE.equals(oldState)) { - int choice = JOptionPane.showConfirmDialog(null, - _("isisfish.message.page.modified")); - switch (choice) { - case JOptionPane.YES_OPTION: - isisContext.commitTransaction(); - result = true; - break; - case JOptionPane.NO_OPTION: - isisContext.rollbackTransaction(); - result = true; - break; - case JOptionPane.CANCEL_OPTION: - result = false; - break; - } - if (result == true) { - // object has been saved or no, we must refresh button - uiContext.setData("EntityModified", null); - frame.refreshViewPattern("panel.*?ButtonAction"); - } - } - return result; - } - - /** - * Called when tree selection change, if current input has been modified - * then before switch to new input pane, ask the user to save modification - * - * @param uiContext - * @param frame - * @param isisContext - * @param inputPane - * @param tree - * @return - */ - static public Object treeSelectionChanged(Context uiContext, - AbstractFrame frame, TopiaContext isisContext, JPanel inputPane, - JTree tree) { - log.debug("treeSelectionChanged called: " + inputPane + " " + tree); - try { - // before change the selection, ask for save if nescessary. - boolean canContinue = askForSave(uiContext, frame, isisContext); - if (!canContinue) { - // cancel asked - return null; - } - - if (tree == null) { - return null; - } - Object node = tree.getLastSelectedPathComponent(); - if (node == null) { - return null; - } - - Object entity = node; - if (node instanceof DefaultMutableTreeNode) { - DefaultMutableTreeNode mutNode = (DefaultMutableTreeNode) node; - entity = mutNode.getUserObject(); - // reload the object - if (entity instanceof TopiaEntity) { - // force reload entity to prevent error after rollback - entity = isisContext.findByTopiaId(((TopiaEntity) entity) - .getTopiaId()); - mutNode.setUserObject(entity); - } - } - - Class type = entity.getClass(); - if (node instanceof TreeNodeWrapper) { - JTreeNode jnode = ((TreeNodeWrapper) node).getWrapped(); - String typeString = (String) jnode.getType(); - if (typeString != null) { - try { - type = Class.forName(typeString); - } catch (Exception eee) { - log.info("Type " + typeString + " is not a class"); - } - } - } - - log.debug("type = " + type); - - if (Population.class.isAssignableFrom(type)) { - Population population = null; - if (type.isInstance(entity)) { - log.debug("Entity is Population"); - population = (Population) entity; - } else { - log.debug("Node is Population container"); - TreePath treePath = tree.getSelectionPath(); - Object nodeSpecies = treePath.getParentPath() - .getLastPathComponent(); - if (nodeSpecies instanceof DefaultMutableTreeNode) { - Object species = ((DefaultMutableTreeNode) nodeSpecies) - .getUserObject(); - if (Species.class.isAssignableFrom(species.getClass())) { - log.debug("Set Species"); - uiContext.setData("Species", species); - } else { - log - .error(_( - "isisfish.error.not.found.species.population.container", - species)); - } - } else { - log - .error(_("isisfish.error.not.species.node.population.container")); - } - - } - uiContext.setData("Population", population); - ((CardLayout) inputPane.getLayout()).show(inputPane, - "inputPopulation"); - - frame.refreshView("PopulationTab"); - } else { - // recuperation du nom de la classe - // fr.ifremer.isisfish.entities.FisheryRegionImpl -> - // FisheryRegion - // fr.ifremer.isisfish.entities.Population -> Population - String panelName = type.getName().replaceAll( - "^.*\\.(.*?)(Impl)?$", "$1"); - log.debug("ask editor for: " + panelName); - - // on bind dans le context la valeur de l'entity avec le - // nom de la classe - if (entity instanceof TopiaEntity) { - uiContext.setData(panelName, entity); - } else { - uiContext.setData(panelName, null); - } - - // on montre la page de input de ce type d'entity - ((CardLayout) inputPane.getLayout()).show(inputPane, "input" - + panelName); - - // on rafraichi la page que l'on vient de mettre en avant plan - frame.refreshView(panelName + "Tab"); - } - } catch (Exception eee) { - log.error("Can't change tree selection", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Save an Equation as model, to reuse it for other equation - * - * @param uiContext - * @param frame - * @param isisfish - * @param eq - * equation to put in models - * @return if ok return null else OutputView error message - */ - static public Object saveEquationAsModel(Context uiContext, - AbstractFrame frame, TopiaContext isisfish, Equation eq) { - try { - if (eq != null) { - String name = showInputDialog(""); - if ("".equals(name)) { - return new OutputView("Error.xml", "error", - _("isisfish.error.invalid.equation.name")); - } - if (name != null) { - FormuleStorage storage = FormuleStorage.createFormule(eq - .getCategory(), name, eq.getLanguage()); - storage.setContent(eq.getContent()); - } - - frame.setInfoText(_("isisfish.message.saveModel.finished")); - } - } catch (Exception eee) { - log.error("Can't save equation as model", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Save an Equation as model, to reuse it for other equation - * - * @param uiContext - * @param frame - * @param isisfish - * @param category - * categoy for this equation - * @param isisfish - * equation to put in models - * @param language - * @return if ok return null else OutputView error message - */ - static public Object saveAsModel(Context uiContext, AbstractFrame frame, - TopiaContext isisfish, String category, String language, - String content) { - try { - String name = showInputDialog(""); - if ("".equals(name)) { - return new OutputView("Error.xml", "error", - _("isisfish.error.invalid.equation.name")); - } - if (name != null) { - FormuleStorage storage = FormuleStorage.createFormule(category, - name, language); - storage.setContent(content); - } - - frame.setInfoText(_("isisfish.message.saveModel.finished")); - } catch (Exception eee) { - log.error("Can't save equation as model", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Exporter la region dans un zip - * - * @param uiContext - * @param frame - * @return - */ - static public Object importRegion(Context uiContext, AbstractFrame frame) { - try { - File file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped")); - if (file != null) { - frame.setInfoText(_("isisfish.message.import.zip" + file)); - - RegionStorage.importZip(file); - frame.refreshView("fieldCurrentRegion"); - } - frame.setInfoText(_("isisfish.message.import.finished")); - } catch (Exception eee) { - log.error("Can't import region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Exporter la region dans un zip - * - * @param uiContext - * @param frame - * @return - */ - static public Object importRegionAndRename(Context uiContext, - AbstractFrame frame) { - try { - File file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped")); - if (file != null) { - frame.setInfoText(_("isisfish.message.import.zip" + file)); - - String newName = - showInputDialog(_("isisfish.message.name.imported.region")); - RegionStorage.importAndRenameZip(file, newName); - frame.refreshView("fieldCurrentRegion"); - } - frame.setInfoText(_("isisfish.message.import.finished")); - } catch (Exception eee) { - log.error("Can't import region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Importer la region depuis un fichier XML de la version 2 - * - * @param uiContext - * @param frame - * @return - */ - static public Object importV2Region(Context uiContext, AbstractFrame frame) { - try { - File file = FileUtil.getFile(".*.xml$", _("isisfish.message.import.region.xml")); - if (file != null) { - frame.setInfoText(_("isisfish.message.import.xml.v2.file " + file)); - - new ImportFromV2(true).importXML(file); - - frame.refreshView("fieldCurrentRegion"); - } - frame.setInfoText(_("isisfish.message.import.finished")); - } catch (Exception eee) { - log.error("Can't import region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Exporter la region dans un zip - * - * @param uiContext - * @param frame - * @param regionStorage - * @return - */ - static public Object exportRegion(Context uiContext, AbstractFrame frame, - RegionStorage regionStorage) { - try { - File file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped")); - if (file != null) { - frame.setInfoText(_("isisfish.message.export.zip", file)); - int resp = JOptionPane.YES_OPTION; - if (file.exists()) { - resp = JOptionPane.showConfirmDialog(null, - _("isisfish.message.file.overwrite")); - } - if (resp == JOptionPane.YES_OPTION) { - regionStorage.createZip(file); - } - } - frame.setInfoText(_("isisfish.message.export.done")); - } catch (Exception eee) { - log.error("Can't export region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Copy la region avec un autre nom - * - * @param uiContext - * @param frame - * @param regionStorage - * @return - */ - static public Object copyRegion(Context uiContext, AbstractFrame frame, - RegionStorage regionStorage) { - try { - String newName = - showInputDialog(_("isisfish.message.new.region.name")); - frame.setInfoText(_("isisfish.message.copy.region", newName)); - - File zip = regionStorage.createZip(); - RegionStorage.importAndRenameZip(zip, newName); - - frame.refreshView("fieldCurrentRegion"); - frame.setInfoText(_("isisfish.message.copy.finished")); - } catch (Exception eee) { - log.error("Can't copy region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Remove region - * - * @param uiContext - * @param frame - * @param regionStorage - * region to remove - * @param cvsDelete - * if true delete region in CVS too - * @return - */ - static public Object removeRegion(Context uiContext, AbstractFrame frame, - RegionStorage regionStorage, boolean cvsDelete) { - try { - int resp = JOptionPane.showConfirmDialog(null, _( - "isisfish.message.confirm.remove.region", - regionStorage.getName())); - if (resp == JOptionPane.YES_OPTION) { - frame.setInfoText(_("isisfish.message.removing.region" - + regionStorage.getName())); - regionStorage.delete(cvsDelete); - frame.setInfoText(_("isisfish.message.region.removed")); - - uiContext.setData("RegionStorage", null); - uiContext.setData("TopiaContext", null); - uiContext.setData("FisheryRegion", null); - - frame.refreshView("fieldCurrentRegion"); - frame.refreshView("treePanel"); - } else { - frame.setInfoText(_("isisfish.message.region.remove.canceled")); - } - } catch (Exception eee) { - log.error("Can't remove region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Remove region - * - * @param uiContext - * @param frame - * @param regionStorage - * region to remove - * @return - */ - static public Object commitRegionInCVS(Context uiContext, - AbstractFrame frame, RegionStorage regionStorage) { - try { - String msg = regionStorage.getCommentForNextCommit(); - JTextArea text = new JTextArea(msg); - int resp = JOptionPane.showOptionDialog(null, - new JScrollPane(text), "Enter commit message", - JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, - null, // icon - null, null); - if (resp == JOptionPane.OK_OPTION) { - frame.setInfoText(_("isisfish.message.commiting.region" - + regionStorage.getName())); - regionStorage.commit(text.getText()); - regionStorage.clearCommentForNextCommit(); - frame.setInfoText(_("isisfish.message.region.commited")); - } else { - frame.setInfoText(_("isisfish.message.commit.region.canceled")); - } - } catch (Exception eee) { - log.error("Can't export region", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Extract from a simulation the region, and rename it with name given - * by user. - * - * @param frame the siwxat frame - * @param combo combo containing list of regions names - * @param uiContext the swixat context - */ - static public void importRegionFromSimulation( - Context uiContext,AbstractFrame frame, JComboBox combo) { - - // first step select a simulation and new region name - String simulationName; - try { - //TODO Should use a shared model ? - simulationName = selectSimulation(getSimulationNames()); - if (simulationName == null) { - { - frame.viewOutput(new OutputView("Error.xml", "error", _("isisfish.error.no.selected.simulation"))); - return; - } - } - - } catch (Exception e) { - String msg = _("isisfish.error.no.select.simulation"); - log.warn(msg); - e.printStackTrace(); - frame.viewOutput(new OutputView("Error.xml", "error", msg)); - return; - } - - log.info("simulation used " + simulationName); - - // ask new region name - String regionName = showInputDialog(_("isisfish.message.import.region.name"),"region from "+simulationName); - if (regionName == null || "".equals(regionName)) { - frame.viewOutput(new OutputView("Error.xml", "error", _("isisfish.error.region.name.empty"))); - return; - } - if (getRegionNames().contains(regionName)) { - frame.viewOutput(new OutputView("Error.xml", "error", _("isisfish.error.region.already.exists"))); - return; - } - - - log.info("new region name " + regionName); - - frame.setInfoText(_("isisfish.message.import", regionName)); - - try { - - SimulationStorage.getSimulation(simulationName).extractRegion(regionName); - - // ajout de la nouvelle region dans la combo - frame.refreshView("fieldCurrentRegion"); - - // on selectionne la nouvelle region, ce qui appelle loadRegion - //TODO du au bug, on ne selectionne pas la nouvelle region importée - //TODO pour le moment - //combo.setSelectedItem(regionName); - - //TODO Fix Bug : the call to loadRegion don't appear since a - // ``thread:input.Input.loadRegion($inputPane, $fieldCurrentRegion/selectedItem);'' : - // Undefined argument: $inputPane : at Line: 1 : in file: inline evaluation of: - // ``thread:input.Input.loadRegion($inputPane, $fieldCurrentRegion/selectedItem);'' - // : ( $inputPane , $fieldCurrentRegion / selectedItem )... - - - } catch (StorageException e) { - log.error("Can't extract region", e); - frame.viewOutput(new OutputView("Error.xml", "error", e.getMessage())); - } - - } - -} // input - 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-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -39,6 +39,9 @@ import java.util.List; import fr.ifremer.isisfish.datastore.RegionStorage; +import fr.ifremer.isisfish.datastore.SimulationStorage; +import fr.ifremer.isisfish.datastore.StorageException; +import fr.ifremer.isisfish.datastore.update.ImportFromV2; import fr.ifremer.isisfish.entities.Cell; import fr.ifremer.isisfish.entities.EffortDescription; import fr.ifremer.isisfish.entities.EffortDescriptionDAO; @@ -51,6 +54,7 @@ import fr.ifremer.isisfish.entities.MetierSeasonInfoDAO; import fr.ifremer.isisfish.entities.Population; import fr.ifremer.isisfish.entities.PopulationGroup; +import fr.ifremer.isisfish.entities.PopulationGroupDAO; import fr.ifremer.isisfish.entities.PopulationSeasonInfo; import fr.ifremer.isisfish.entities.Port; import fr.ifremer.isisfish.entities.Selectivity; @@ -64,9 +68,12 @@ import fr.ifremer.isisfish.entities.VesselType; import fr.ifremer.isisfish.entities.Zone; import fr.ifremer.isisfish.types.Month; +import java.io.File; import java.lang.reflect.Method; import java.util.ArrayList; import javax.swing.JOptionPane; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; import org.apache.commons.beanutils.MethodUtils; import org.apache.commons.lang.ClassUtils; import org.apache.commons.logging.Log; @@ -76,9 +83,11 @@ import org.codelutin.topia.TopiaContext; import org.codelutin.topia.persistence.TopiaDAO; import org.codelutin.topia.persistence.TopiaEntity; +import org.codelutin.util.FileUtil; import org.codelutin.widget.editor.Editor; import static org.codelutin.i18n.I18nf._; import static javax.swing.JOptionPane.showInputDialog; +import static fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil.selectSimulation; /** * @@ -87,7 +96,7 @@ public class InputAction { /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(Input.class); + static private Log log = LogFactory.getLog(InputAction.class); protected RegionStorage regionStorage = null; protected FisheryRegion fisheryRegion = null; protected TopiaContext isisContext = null; @@ -139,7 +148,269 @@ public TopiaContext getIsisContext(){ return isisContext; } + public RegionStorage getRegionStorage(){ + return regionStorage; + } + /** + * Exporter la region dans un zip + * + * @param uiContext + * @param frame + * @return + */ + public File importRegion() { + File file = null; + try { + file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped")); + if (file != null) { + RegionStorage.importZip(file); + } + } catch (Exception eee) { + log.error("Can't import region", eee); +// return new OutputView("Error.xml", "error", eee.getMessage()); + } + return file; + } + + /** + * Exporter la region dans un zip + * + * @param uiContext + * @param frame + * @return + */ + public File importRegionAndRename() { + File file = null; + try { + file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped")); + if (file != null) { + + String newName = + showInputDialog(_("isisfish.message.name.imported.region")); + RegionStorage.importAndRenameZip(file, newName); + } + } catch (Exception eee) { + log.error("Can't import region", eee); +// return new OutputView("Error.xml", "error", eee.getMessage()); + } + return file; + } + + + /** + * Importer la region depuis un fichier XML de la version 2 + * + * @param uiContext + * @param frame + * @return + */ + public File importV2Region() { + File file = null; + try { + file = FileUtil.getFile(".*.xml$", _("isisfish.message.import.region.xml")); + if (file != null) { + + new ImportFromV2(true).importXML(file); + + } + } catch (Exception eee) { + log.error("Can't import region", eee); +// return new OutputView("Error.xml", "error", eee.getMessage()); + } + return file; + } + + /** + * Extract from a simulation the region, and rename it with name given + * by user. + * + * @param frame the siwxat frame + * @param combo combo containing list of regions names + * @param uiContext the swixat context + */ + public String importRegionFromSimulation() { + + // first step select a simulation and new region name + String simulationName; + try { + //TODO Should use a shared model ? + simulationName = selectSimulation(SimulationStorage.getSimulationNames()); + if (simulationName == null) { + { +// frame.viewOutput(new OutputView("Error.xml", "error", _("isisfish.error.no.selected.simulation"))); + return null; + } + } + + } catch (Exception e) { + String msg = _("isisfish.error.no.select.simulation"); + log.warn(msg); + e.printStackTrace(); +// frame.viewOutput(new OutputView("Error.xml", "error", msg)); + return null; + } + + log.info("simulation used " + simulationName); + + // ask new region name + String regionName = showInputDialog(_("isisfish.message.import.region.name"),"region from "+simulationName); + if (regionName == null || "".equals(regionName)) { +// frame.viewOutput(new OutputView("Error.xml", "error", _("isisfish.error.region.name.empty"))); + return null; + } + if (RegionStorage.getRegionNames().contains(regionName)) { +// frame.viewOutput(new OutputView("Error.xml", "error", _("isisfish.error.region.already.exists"))); + return null; + } + + + log.info("new region name " + regionName); + + // frame.setInfoText(_("isisfish.message.import", regionName)); + + try { + + SimulationStorage.getSimulation(simulationName).extractRegion(regionName); + + // ajout de la nouvelle region dans la combo +// frame.refreshView("fieldCurrentRegion"); + + // on selectionne la nouvelle region, ce qui appelle loadRegion + //TODO du au bug, on ne selectionne pas la nouvelle region import?e + //TODO pour le moment + //combo.setSelectedItem(regionName); + + //TODO Fix Bug : the call to loadRegion don't appear since a + // ``thread:input.Input.loadRegion($inputPane, $fieldCurrentRegion/selectedItem);'' : + // Undefined argument: $inputPane : at Line: 1 : in file: inline evaluation of: + // ``thread:input.Input.loadRegion($inputPane, $fieldCurrentRegion/selectedItem);'' + // : ( $inputPane , $fieldCurrentRegion / selectedItem )... + + + } catch (StorageException e) { + log.error("Can't extract region", e); +// frame.viewOutput(new OutputView("Error.xml", "error", e.getMessage())); + } + return regionName; + } + + /** + * Exporter la region dans un zip + * + * @param uiContext + * @param frame + * @param regionStorage + * @return + */ + public File exportRegion() { + File file = null; + try { + file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped")); + if (file != null) { + int resp = JOptionPane.YES_OPTION; + if (file.exists()) { + resp = JOptionPane.showConfirmDialog(null, + _("isisfish.message.file.overwrite")); + } + if (resp == JOptionPane.YES_OPTION) { + regionStorage.createZip(file); + } + } + } catch (Exception eee) { + log.error("Can't export region", eee); +// return new OutputView("Error.xml", "error", eee.getMessage()); + } + return file; + } + + /** + * Copy la region avec un autre nom + * + * @param uiContext + * @param frame + * @param regionStorage + * @return + */ + public String copyRegion() { + String newName = null; + try { + newName = showInputDialog(_("isisfish.message.new.region.name")); + + File zip = regionStorage.createZip(); + RegionStorage.importAndRenameZip(zip, newName); + + } catch (Exception eee) { + log.error("Can't copy region", eee); +// return new OutputView("Error.xml", "error", eee.getMessage()); + } + return newName; + } + + /** + * Remove region + * + * @param uiContext + * @param frame + * @param regionStorage + * region to remove + * @param cvsDelete + * if true delete region in CVS too + * @return + */ + public String removeRegion(boolean cvsDelete) { + String result = null; + try { + int resp = JOptionPane.showConfirmDialog(null, _( + "isisfish.message.confirm.remove.region", + regionStorage.getName())); + if (resp == JOptionPane.YES_OPTION) { + regionStorage.delete(cvsDelete); + result = _("isisfish.message.region.removed"); + + } else { + result = _("isisfish.message.region.remove.canceled"); + } + } catch (Exception eee) { + log.error("Can't remove region", eee); +// return new OutputView("Error.xml", "error", eee.getMessage()); + } + return result; + } + + /** + * Remove region + * + * @param uiContext + * @param frame + * @param regionStorage + * region to remove + * @return + */ + public String commitRegionInCVS() { + String result = null; + try { + String msg = regionStorage.getCommentForNextCommit(); + JTextArea text = new JTextArea(msg); + int resp = JOptionPane.showOptionDialog(null, + new JScrollPane(text), "Enter commit message", + JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, + null, // icon + null, null); + if (resp == JOptionPane.OK_OPTION) { + regionStorage.commit(text.getText()); + regionStorage.clearCommentForNextCommit(); + result = _("isisfish.message.region.commited"); + } else { + result = _("isisfish.message.commit.region.canceled"); + } + } catch (Exception eee) { + log.error("Can't export region", eee); +// return new OutputView("Error.xml", "error", eee.getMessage()); + } + return result; + } + /** * load region. * <p> @@ -744,22 +1015,24 @@ } // Population - - public void wizardGroupOpen() { - log.debug("wizardGroupOpen"); - -// TODO : convertir WizardGroupCreation en jaxx - WizardGroupCreation model = new WizardGroupCreation(); - model.setAgeType(population.getSpecies().getAgeGroupType()); - if (model.isAgeType()) { - model.setState("singleGroupAge"); - } else { - model.setState("beginGroupLength"); - } - -// return new OutputView("input/WizardGroupCreation.xml", ctx); - } +// +// public void wizardGroupOpen() { +// log.debug("wizardGroupOpen"); +// +//// TODO : convertir WizardGroupCreation en jaxx +// WizardGroupCreationUI model = new WizardGroupCreationUI(); +//// model.setAgeType(population.getSpecies().getAgeGroupType()); +//// if (model.isAgeType()) { +//// model.setState("singleGroupAge"); +//// } else { +//// model.setState("beginGroupLength"); +//// } +// +//// return new OutputView("input/WizardGroupCreation.xml", ctx); +// } + + public Object createRecruitmentDistribution() { log.debug("createRecruitmentDistributionontext called: " + population); try { Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputEffortDescription.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputEffortDescription.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputEffortDescription.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,98 +0,0 @@ -/* *##% - * Copyright (C) 2002, 2003 Code Lutin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * inputSpecies.java - * - * Created: 12 sept. 2005 - * - * @author Arnaud Thimel <thimel at codelutin.com> - * Copyright Code Lutin - * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ - */ -package fr.ifremer.isisfish.ui.input; - -import static org.codelutin.i18n.I18nf._; - -import javax.swing.JTree; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.TopiaContext; -import org.swixat.databinding.JTreeModel; -import org.swixat.framework.AbstractFrame; -import org.swixat.framework.OutputView; -import org.swixat.model.Context; - -import fr.ifremer.isisfish.IsisFishDAOHelper; -import fr.ifremer.isisfish.entities.EffortDescription; -import fr.ifremer.isisfish.entities.EffortDescriptionDAO; -import fr.ifremer.isisfish.entities.FisheryRegion; -import fr.ifremer.isisfish.entities.Metier; -import fr.ifremer.isisfish.entities.SetOfVessels; - -public class InputEffortDescription { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(InputEffortDescription.class); - - static public Object addEffortDescription( - Context uiContext, TopiaContext isisContext, AbstractFrame frame, - SetOfVessels setOfVessels, Metier metier) { - log.debug("addEffortDescription called: " + setOfVessels + " metier: " + metier); - try { - - EffortDescriptionDAO effortDescriptionPS = IsisFishDAOHelper.getEffortDescriptionDAO(isisContext); - EffortDescription effortDescription = effortDescriptionPS.create(); - effortDescription.setPossibleMetiers(metier); - effortDescription.update(); - setOfVessels.addPossibleMetiers(effortDescription); - setOfVessels.update(); -// isisContext.commitTransaction(); - - uiContext.setData("EffortDescription", effortDescription); - - frame.refreshView("inputEffortDescription"); - }catch(Exception eee){ - log.error("Can't create EffortDescription", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object remove(Context uiContext, AbstractFrame frame, - TopiaContext isisContext, FisheryRegion fisheryRegion, - JTree tree, JTreeModel jmodel, SetOfVessels sov, EffortDescription effort) { - log.debug("remove called"); - try { - sov.removePossibleMetiers(effort); - isisContext.commitTransaction(); - - frame.refreshView("inputEffortDescription"); - frame.setInfoText(_("isisfish.message.remove.finished")); - } catch (Exception eee) { - log.error("Can't remove entity: " + effort, eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - -} Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputFisheryRegion.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputFisheryRegion.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputFisheryRegion.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,252 +0,0 @@ -/* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * inputFisheryRegion.java - * - * Created: 18 août 2005 14:09:07 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - -package fr.ifremer.isisfish.ui.input; - -import static org.codelutin.i18n.I18nf._; - -import java.awt.geom.Point2D; -import java.io.File; -import java.util.Collections; -import java.util.List; - -import javax.swing.JList; -import javax.swing.JTextField; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.TopiaContext; -import org.codelutin.util.FileUtil; -import org.swixat.framework.AbstractFrame; -import org.swixat.framework.OutputView; - -import com.bbn.openmap.layer.shape.SpatialIndex; - -import fr.ifremer.isisfish.IsisFishDAOHelper; -import fr.ifremer.isisfish.datastore.RegionStorage; -import fr.ifremer.isisfish.entities.Cell; -import fr.ifremer.isisfish.entities.CellDAO; -import fr.ifremer.isisfish.entities.FisheryRegion; -import fr.ifremer.isisfish.entities.Population; -import fr.ifremer.isisfish.entities.PopulationSeasonInfo; -import fr.ifremer.isisfish.entities.Species; -import fr.ifremer.isisfish.ui.input.check.CheckRegion; -import fr.ifremer.isisfish.ui.input.check.CheckResult; -import fr.ifremer.isisfish.ui.input.check.CheckResultFrame; -import fr.ifremer.isisfish.util.CellPointcomparator; - -public class InputFisheryRegion { // inputFisheryRegion - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(InputFisheryRegion.class); - - /** - * @param list la list dans lequel il faut ajouter la carte - */ - static public Object addMap(AbstractFrame frame, TopiaContext isisContext, - FisheryRegion region, JList list){ - log.debug("AddMap called"); - - File shp = FileUtil.getFile(".*\\.shp", "shp file"); - try { - if (shp != null) { - // copy shp and ssx to region map directory - String basename = FileUtil.basename(shp, ".shp"); - - String srcMap = shp.getPath(); - srcMap = srcMap.substring(0, srcMap.length() - ".shp".length()); - File ssx = new File(srcMap + ".ssx"); - - RegionStorage regionStorage = RegionStorage.getRegion(region.getName()); - File destDir = regionStorage.getMapRepository(); - - // copy shp file - File destShp = new File(destDir, basename + ".shp"); - FileUtil.copy(shp, destShp); - - // copy ssx file - File destSsx = new File(destDir, basename + ".ssx"); - if (ssx.exists()) { - FileUtil.copy(ssx, destSsx); - } else { - log.info("Ssx file don't exist, try to generate it"); - SpatialIndex.createIndex(destShp.getPath(), destSsx.getPath()); - } - - List<String> maps = region.getMapFileList(); - maps.add(basename); - region.setMapFileList(maps); - - frame.getXmlEngine().refreshView(list); - } - }catch(Exception eee){ - log.error("Can't copy .shp or .ssx file for: " + shp, eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * @param list la list dans lequel il faut retirer la carte - */ - static public Object removeMap(AbstractFrame frame, TopiaContext isisContext, - FisheryRegion region, JList list){ - log.debug("removeMap called"); - try { - - List<String> maps = region.getMapFileList(); - Object [] selectedMaps = list.getSelectedValues(); - - RegionStorage regionStorage = RegionStorage.getRegion(region.getName()); - File mapDir = regionStorage.getMapRepository(); - - for (Object map : selectedMaps) { - maps.remove(map); - // remove on disk too, if possible - File shp = new File(mapDir, map + ".shp"); - shp.delete(); - File ssx = new File(mapDir, map + ".ssx"); - ssx.delete(); - } - - region.setMapFileList(maps); - - frame.getXmlEngine().refreshView(list); - }catch(Exception eee){ - log.error("Can't remove map", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - /** - * Affiche une boite de dialogue demandant a l'utilisateur de rentrer - * un nom de fichier, et met ce nom dans la textField. - * Passe le saveButton en enabled pour marque que la region a ete modifié - */ - static public void loadCellFile(AbstractFrame frame, JTextField textField){ - log.debug("loadCell called"); - // FIXME todo loadCellFile - } - - static public Object save(AbstractFrame frame, - String type, FisheryRegion fisheryRegion){ - log.debug("save called"); - try{ - TopiaContext isisContext = fisheryRegion.getTopiaContext(); - - frame.setInfoText(_("isisfish.message.checking.cell")); - int latNumber = (int)Math.round((fisheryRegion.getMaxLatitude() - fisheryRegion.getMinLatitude()) / fisheryRegion.getCellLengthLatitude()); - int lonNumber = (int)Math.round((fisheryRegion.getMaxLongitude() - fisheryRegion.getMinLongitude()) / fisheryRegion.getCellLengthLongitude()); - - frame.setProgressMin(0); - frame.setProgressMax(latNumber * lonNumber); - int progresscpt = 0; - - // il faut peut-etre creer ou supprimer des mailles - CellPointcomparator cellPointcomparator = new CellPointcomparator(); - CellDAO cellPS = IsisFishDAOHelper.getCellDAO(isisContext); - List<Cell> cells = cellPS.findAll(); - Collections.sort(cells, cellPointcomparator); - Point2D.Float point = new Point2D.Float(); - - for(float lati = fisheryRegion.getMinLatitude();lati<fisheryRegion.getMaxLatitude();lati+=fisheryRegion.getCellLengthLatitude()){ - lati = Math.round(lati*1000f); - lati= lati / 1000.0f; - for(float longi = fisheryRegion.getMinLongitude();longi<fisheryRegion.getMaxLongitude();longi+=fisheryRegion.getCellLengthLongitude()){ - longi = Math.round(longi*1000f) / 1000.0f; - point.setLocation(lati, longi); - int position = Collections.binarySearch(cells, point, cellPointcomparator); - if(position >= 0){ - // deja existant on l'enleve de la liste, et on ne cree rien - cells.remove(position); - } else { - // n'existe pas on la cree - Cell cell = cellPS.create(); - cell.setName("La"+lati+"Lo"+longi); - cell.setLatitude(lati); - cell.setLongitude(longi); - cell.setLand(false); - cell.update(); - } - frame.setProgressValue(++progresscpt); - } - } - - // on est pas en autoUpdate donc il faut faire le update avant le commit - fisheryRegion.update(); - - // toutes les mailles restantes dans la liste sont des mailles en trop - // on les supprimes - frame.setInfoText(_("isisfish.message.remove.unnecessary.cells")); - frame.setProgressMin(0); - frame.setProgressMax(cells.size()); - progresscpt = 0; - for(Cell cell:cells){ - // FIXME il faudrait aussi rechercher les objets dependants - // des mailles que l'on va supprimer et demander confirmation - // a l'utilisateur qu'il souhaite reellement supprimer tous - // ces objets. Si ce n'est pas le cas, on sort tout de suite - // avant le commit - cellPS.delete(cell); - frame.setProgressValue(++progresscpt); - } - - frame.setInfoText(_("isisfish.message.commit")); - isisContext.commitTransaction(); - frame.refreshView("inputFisheryRegion"); - - frame.setInfoText(_("isisfish.message.save.finished")); - }catch(Exception eee){ - log.error(_("isisfish.error.save.region"), eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object check(AbstractFrame frame, FisheryRegion fisheryRegion){ - try { - log.debug("check called: "); - frame.setInfoText(_("isisfish.message.check.region")); - CheckResult result = new CheckResult(); - CheckRegion.check(fisheryRegion, result); - CheckResultFrame dialog = new CheckResultFrame(); - dialog.setCheckResult(result); - dialog.setVisible(true); - }catch(Exception eee){ - log.error(_("isisfish.error.check.region"), eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - -} // inputFisheryRegion - Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputGear.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputGear.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputGear.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,90 +0,0 @@ -/* *##% - * Copyright (C) 2002, 2003 Code Lutin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * inputSpecies.java - * - * Created: 12 sept. 2005 - * - * @author Arnaud Thimel <thimel at codelutin.com> - * Copyright Code Lutin - * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ - */ -package fr.ifremer.isisfish.ui.input; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.TopiaContext; -import org.swixat.framework.AbstractFrame; -import org.swixat.framework.OutputView; - -import fr.ifremer.isisfish.IsisFishDAOHelper; -import fr.ifremer.isisfish.entities.Gear; -import fr.ifremer.isisfish.entities.Population; -import fr.ifremer.isisfish.entities.Selectivity; -import fr.ifremer.isisfish.entities.SelectivityDAO; - -public class InputGear { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(InputGear.class); - - static public Object addSelectivity( - AbstractFrame frame, TopiaContext isisContext, - Gear gear, Population pop, String equation) { - try { - - SelectivityDAO dao = IsisFishDAOHelper.getSelectivityDAO(isisContext); - Selectivity selectivity = dao.create(); - - selectivity.setGear(gear); - selectivity.setPopulation(pop); - selectivity.getEquation().setContent(equation); - selectivity.update(); - - gear.addPopulationSelectivity(selectivity); - gear.update(); - - frame.refreshView("selectivityTable"); - } catch (Exception eee) { - log.error("Can't add selectivity", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object removeSelectivity(AbstractFrame frame, - Gear gear, Selectivity selectivity){ - log.debug("removeTargetSpecies called: " + selectivity); - try { - if (gear != null && selectivity != null) { - gear.removePopulationSelectivity(selectivity); - - frame.refreshView("selectivityTable"); - } - }catch(Exception eee){ - log.error("Can't remove TargetSpecies", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - -} Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputMetier.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputMetier.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputMetier.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,146 +0,0 @@ -/* *##% - * Copyright (C) 2002, 2003 Code Lutin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * inputSpecies.java - * - * Created: 12 sept. 2005 - * - * @author Arnaud Thimel <thimel at codelutin.com> - * Copyright Code Lutin - * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ - */ -package fr.ifremer.isisfish.ui.input; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.TopiaContext; -import org.swixat.framework.AbstractFrame; -import org.swixat.framework.OutputView; -import org.swixat.model.Context; - -import fr.ifremer.isisfish.IsisFishDAOHelper; -import fr.ifremer.isisfish.entities.Metier; -import fr.ifremer.isisfish.entities.MetierSeasonInfo; -import fr.ifremer.isisfish.entities.MetierSeasonInfoDAO; -import fr.ifremer.isisfish.entities.Species; -import fr.ifremer.isisfish.entities.TargetSpecies; -import fr.ifremer.isisfish.entities.TargetSpeciesDAO; -import fr.ifremer.isisfish.types.Month; - -public class InputMetier { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(InputMetier.class); - - static public Object createSeasonInfo( - Context uiContext, TopiaContext isisContext, AbstractFrame frame, - Metier metier){ - log.debug("createSeasonInfo called"); - try { - MetierSeasonInfoDAO metierSeasonInfoPS = IsisFishDAOHelper.getMetierSeasonInfoDAO(isisContext); - MetierSeasonInfo metierSeasonInfo = metierSeasonInfoPS.create(); - metierSeasonInfo.setFirstMonth(Month.MONTH[0]); - metierSeasonInfo.setLastMonth(Month.MONTH[3]); - metier.addMetierSeasonInfo(metierSeasonInfo); - metierSeasonInfo.update(); - metier.update(); -// isisContext.commitTransaction(); - - Input.selectEntity(uiContext, frame, "MetierSeasonInfo", metierSeasonInfo); - }catch(Exception eee){ - log.error("Can't create MetierSeasonInfo", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object removeSeasonInfo( - Context uiContext, TopiaContext isisContext, AbstractFrame frame, - Metier metier, MetierSeasonInfo info){ - log.debug("createSeasonInfo called"); - try { - metier.removeMetierSeasonInfo(info); - metier.update(); - isisContext.commitTransaction(); - - Input.selectEntity(uiContext, frame, "MetierSeasonInfo", null); - }catch(Exception eee){ - log.error("Can't create MetierSeasonInfo", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - -// static public Object selectSeasonInfo( -// Context uiContext, AbstractFrame frame, -// MetierSeasonInfo metierSeasonInfo){ -// log.debug("selectSeasonInfo called"); -// try { -// uiContext.setData("MetierSeasonInfo", metierSeasonInfo); -// -// frame.refreshView("inputMetierSeasonInfoZone"); -// frame.refreshView("inputMetierSeasonInfoSpecies"); -// }catch(Exception eee){ -// log.error("Can't create MetierSeasonInfo", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); -// } -// return null; -// } - - static public Object addTargetSpecies(AbstractFrame frame, TopiaContext isisContext, - MetierSeasonInfo metier, Species species, - String targetFactorEquation, boolean primaryCatch){ - log.debug("addTargetSpecies called: " + metier + " " + species + " " + primaryCatch + " " + targetFactorEquation); - try { - TargetSpeciesDAO dao = IsisFishDAOHelper.getTargetSpeciesDAO(isisContext); - TargetSpecies targetSpecies = dao.create(); - - targetSpecies.setSpecies(species); - targetSpecies.getTargetFactorEquation().setContent(targetFactorEquation); - targetSpecies.setPrimaryCatch(primaryCatch); - metier.addSpeciesTargetSpecies(targetSpecies); - - frame.refreshView("inputMetierSeasonInfoSpecies"); - }catch(Exception eee){ - log.error("Can't add TargetSpecies", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object removeTargetSpecies(AbstractFrame frame, - MetierSeasonInfo metier, TargetSpecies targetSpecies){ - log.debug("removeTargetSpecies called: " + targetSpecies); - try { - if (targetSpecies != null) { - metier.removeSpeciesTargetSpecies(targetSpecies); - - frame.refreshView("inputMetierSeasonInfoSpecies"); - } - }catch(Exception eee){ - log.error("Can't remove TargetSpecies", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - -} Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputPopulation.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputPopulation.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputPopulation.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,534 +0,0 @@ -/* *##% - * Copyright (C) 2002, 2003 Code Lutin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * inputSpecies.java - * - * Created: 12 sept. 2005 - * - * @author Arnaud Thimel <thimel at codelutin.com> - * Copyright Code Lutin - * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ - */ -package fr.ifremer.isisfish.ui.input; - -import static org.codelutin.i18n.I18nf._; - -import java.util.ArrayList; -import java.util.List; - -import javax.swing.JOptionPane; -import javax.swing.JTree; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.math.matrix.MatrixFactory; -import org.codelutin.math.matrix.MatrixND; -import org.codelutin.math.matrix.gui.MatrixPanelEditor; -import org.codelutin.topia.TopiaContext; -import org.swixat.databinding.JTreeModel; -import org.swixat.framework.AbstractFrame; -import org.swixat.framework.OutputView; -import org.swixat.model.Context; -import org.swixat.model.GenericContext; - -import fr.ifremer.isisfish.IsisFishDAOHelper; -import fr.ifremer.isisfish.entities.Equation; -import fr.ifremer.isisfish.entities.Population; -import fr.ifremer.isisfish.entities.PopulationDAO; -import fr.ifremer.isisfish.entities.PopulationGroup; -import fr.ifremer.isisfish.entities.PopulationGroupDAO; -import fr.ifremer.isisfish.entities.PopulationSeasonInfo; -import fr.ifremer.isisfish.entities.PopulationSeasonInfoDAO; -import fr.ifremer.isisfish.entities.Species; -import fr.ifremer.isisfish.entities.Zone; -import fr.ifremer.isisfish.types.Month; -import fr.ifremer.isisfish.ui.UIHelper; - -public class InputPopulation { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(InputPopulation.class); - - static public Object create(Context uiContext, - TopiaContext isisContext, AbstractFrame frame, - JTree tree, JTreeModel jmodel, Species species) { - log.debug("create called"); - try { - String name = "Population_new"; - - PopulationDAO dao = IsisFishDAOHelper - .getPopulationDAO(isisContext); - Population pop = dao.create(); - pop.setName(name); - - species.addPopulation(pop); - pop.setSpecies(species); - pop.update(); - species.update(); - isisContext.commitTransaction(); - - uiContext.setData("Population", pop); - - UIHelper.setTreeSelection(tree, jmodel, pop); - - } catch (Exception eee) { - log.error("Can't create Population", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object createSeasonInfo(Context uiContext, - TopiaContext isisContext, AbstractFrame frame, - Population pop) { - log.debug("createSeasonInfo called"); - try { - PopulationSeasonInfoDAO dao = IsisFishDAOHelper.getPopulationSeasonInfoDAO(isisContext); - PopulationSeasonInfo seasonInfo = dao.create(); - seasonInfo.setFirstMonth(Month.MONTH[0]); - seasonInfo.setLastMonth(Month.MONTH[3]); - pop.addPopulationSeasonInfo(seasonInfo); - seasonInfo.setPopulation(pop); - seasonInfo.update(); - pop.update(); -// isisContext.commitTransaction(); - - Input.selectEntity(uiContext, frame, "PopulationSeasonInfo", seasonInfo); - } catch (Exception eee) { - log.error("Can't create PopulationSeasonInfo", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object removeSeasonInfo(Context uiContext, - TopiaContext isisContext, AbstractFrame frame, - Population pop, PopulationSeasonInfo populationSeasonInfo) { - log.debug("removeSeasonInfo called"); - try { - pop.removePopulationSeasonInfo(populationSeasonInfo); - pop.update(); - isisContext.commitTransaction(); - - Input.selectEntity(uiContext, frame, "PopulationSeasonInfo", null); - } catch (Exception eee) { - log.error("Can't remove PopulationSeasonInfo", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object createRecruitmentDistribution(Context uiContext, - TopiaContext isisContext, AbstractFrame frame, - Population pop) { - log.debug("createRecruitmentDistributionontext called: " + pop); - try { - String val = JOptionPane.showInputDialog(_("isisfish.message.recruitment.number.month")); - int num = -1; - - - if (val != null && !"".equals(val)) { - try { - num = Integer.parseInt(val); - } catch (RuntimeException eee) { - if (log.isWarnEnabled()) { - log.warn("Can't parse val: " + val, eee); - } - } - } - - if ( num > 0) { - List<String> sem = new ArrayList<String>(num); - for (int i=0; i<num; i++) { - sem.add(_("isisfish.common.month", i)); - } - MatrixND newMat = MatrixFactory.getInstance().create(new List[]{sem}); - - MatrixND mat = pop.getRecruitmentDistribution(); - if (mat != null) { - newMat.paste(mat); - } - pop.setRecruitmentDistribution(newMat); - pop.update(); - frame.refreshView("fieldPopulationRecruitmentDistribution"); - } else { - new OutputView("Error.xml", "error", _("isisfish.error.integer.positif")); - } - - } catch (Exception eee) { - log.error("Can't remove PopulationSeasonInfo", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object addMigration(AbstractFrame frame, PopulationSeasonInfo info, - PopulationGroup group, Zone departure, Zone arrival, double coeff) { - log.debug("addMigration called"); - try { - MatrixND mat = info.getMigrationMatrix().copy(); - mat.setValue(group, departure, arrival, coeff); - info.setMigrationMatrix(mat); - - frame.refreshView("PopulationMigrationMigrationTable"); - }catch(Exception eee){ - log.error("Can't add migration", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object removeMigration(AbstractFrame frame, PopulationSeasonInfo info, - MatrixPanelEditor panel) { - log.debug("removeMigration called"); - try { - int row = panel.getTable().getSelectedRow(); - Object group = panel.getTable().getValueAt(row, 0); - Object departure = panel.getTable().getValueAt(row, 1); - Object arrival = panel.getTable().getValueAt(row, 2); - - MatrixND mat = info.getMigrationMatrix().copy(); - mat.setValue(group, departure, arrival, 0); - info.setMigrationMatrix(mat); - - frame.refreshView("PopulationMigrationMigrationTable"); - }catch(Exception eee){ - log.error("Can't remove migration", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object addEmigration(AbstractFrame frame, PopulationSeasonInfo info, - PopulationGroup group, Zone departure, double coeff) { - log.debug("addEmigration called"); - try { - MatrixND mat = info.getEmigrationMatrix().copy(); - mat.setValue(group, departure, coeff); - info.setEmigrationMatrix(mat); - - frame.refreshView("PopulationMigrationEmigrationTable"); - }catch(Exception eee){ - log.error("Can't add emigration", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object removeEmigration(AbstractFrame frame, PopulationSeasonInfo info, - MatrixPanelEditor panel) { - log.debug("removeEmigration called"); - try { - int row = panel.getTable().getSelectedRow(); - Object group = panel.getTable().getValueAt(row, 0); - Object departure = panel.getTable().getValueAt(row, 1); - - MatrixND mat = info.getEmigrationMatrix().copy(); - mat.setValue(group, departure, 0); - info.setEmigrationMatrix(mat); - - frame.refreshView("PopulationMigrationEmigrationTable"); - }catch(Exception eee){ - log.error("Can't remove migration", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - - - - static public Object addImmigration(AbstractFrame frame, PopulationSeasonInfo info, - PopulationGroup group, Zone arrival, double coeff) { - log.debug("addImmigration called"); - try { - MatrixND mat = info.getImmigrationMatrix().copy(); - mat.setValue(group, arrival, coeff); - info.setImmigrationMatrix(mat); - - frame.refreshView("PopulationMigrationImmigrationTable"); - }catch(Exception eee){ - log.error("Can't add immigration", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object removeImmigration(AbstractFrame frame, PopulationSeasonInfo info, - MatrixPanelEditor panel) { - log.debug("removeImmigration called"); - try { - int row = panel.getTable().getSelectedRow(); - Object group = panel.getTable().getValueAt(row, 0); - Object arrival = panel.getTable().getValueAt(row, 2); - - MatrixND mat = info.getImmigrationMatrix().copy(); - mat.setValue(group, arrival, 0); - info.setImmigrationMatrix(mat); - - frame.refreshView("PopulationMigrationImmigrationTable"); - }catch(Exception eee){ - log.error("Can't remove immigration", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object computeMatrixChangeOfGroup(AbstractFrame frame, - Context uiContext, TopiaContext isisContext, - PopulationSeasonInfo popInfo) { - log.debug("computeMatrixChangeOfGroup"); - try { - MatrixND mat = popInfo.computeLengthChangeMatrix(); - if(!popInfo.getSimpleLengthChangeMatrix()){ - mat = popInfo.spacializeLengthChangeMatrix(mat); - } - popInfo.setLengthChangeMatrix(mat); - popInfo.update(); - frame.refreshView("fieldPopulationSeasonGroupChangeLength"); - }catch(Exception eee){ - log.error("Can't create compute Matrix Change Of Group", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object toggleSpacializedMatrixLengthChangeOfGroup(AbstractFrame frame, - Context uiContext, TopiaContext isisContext, - PopulationSeasonInfo popInfo) { - log.debug("call toggleSpacializedMatrixLengthChangeOfGroup"); - try { - MatrixND mat = popInfo.getLengthChangeMatrix(); - if (popInfo.getSimpleLengthChangeMatrix()) { - mat = popInfo.unspacializeLengthChangeMatrix(mat); - } else { - mat = popInfo.spacializeLengthChangeMatrix(mat); - } - popInfo.setLengthChangeMatrix(mat); - popInfo.update(); - frame.refreshView("fieldPopulationSeasonGroupChangeLength"); - } catch(Exception eee){ - log.error("Can't (un)spacialize Matrix Change Of Group", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } finally { - frame.refreshView("labelPopulationSeasonGroupChangeLengthButtonShow"); - } - return null; - } - - static public Object spacializedMatrixLengthChangeOfGroup(AbstractFrame frame, - Context uiContext, TopiaContext isisContext, - PopulationSeasonInfo popInfo) { - log.debug("call spacializedMatrixLengthChangeOfGroup"); - try { - if (popInfo.getSimpleLengthChangeMatrix()) { - return null; - } - MatrixND mat = popInfo.getLengthChangeMatrix(); - mat = popInfo.spacializeLengthChangeMatrix(mat); - popInfo.setLengthChangeMatrix(mat); - popInfo.update(); - frame.refreshView("labelPopulationSeasonGroupChangeLengthButtonShow"); - }catch(Exception eee){ - log.error("Can't spacialize Matrix Change Of Group", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - static public Object showSpacializedMatrixChangeOfGroup(Context uiContext, TopiaContext isisContext, - PopulationSeasonInfo popInfo) { - log.debug("computeMatrixChangeOfGroup"); - try { - MatrixND mat = popInfo.getLengthChangeMatrix(); - if(popInfo.getSimpleLengthChangeMatrix()){ - mat = popInfo.spacializeLengthChangeMatrix(mat); - } - MatrixPanelEditor panel = new MatrixPanelEditor(false, 800, 300); - panel.setMatrix(mat); - JOptionPane.showMessageDialog(null, panel, - _("isisfish.message.spacialized.visualisation"), JOptionPane.INFORMATION_MESSAGE); - - }catch(Exception eee){ - log.error("Can't create compute Matrix Change Of Group", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - - -// static public Object selectSeasonInfo( -// Context uiContext, AbstractFrame frame, -// PopulationSeasonInfo seasonInfo){ -// log.debug("selectSeasonInfo called"); -// try { -// uiContext.setData("PopulationSeasonInfo", seasonInfo); -// -// frame.refreshView("inputPopulationSeasonInfo"); -// }catch(Exception eee){ -// log.error("Can't create PopulationSeasonInfo", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); -// } -// return null; -// } -// -// static public Object selectPopulationGroup( -// Context uiContext, AbstractFrame frame, -// PopulationGroup group){ -// log.debug("selectPopulationGroup called : " + group); -// try { -// uiContext.setData("PopulationGroup", group); -// -// frame.refreshView("inputPopulationGroup"); -// }catch(Exception eee){ -// log.error("Can't create PopulationSeasonInfo", eee); -// return new OutputView("Error.xml", "error", eee.getMessage()); -// } -// return null; -// } - - static public Object wizardGroupOpen(Context uiContext, TopiaContext isisContext, - Population pop) { - log.debug("wizardGroupOpen"); - - WizardGroupCreation model = new WizardGroupCreation(); - model.setAgeType(pop.getSpecies().getAgeGroupType()); - if (model.isAgeType()) { - model.setState("singleGroupAge"); - } else { - model.setState("beginGroupLength"); - } - - Context ctx = new GenericContext(); - ctx.setData("Population", pop); - ctx.setData("TopiaContext", isisContext); - ctx.setData("wizardModel", model); - - return new OutputView("input/WizardGroupCreation.xml", ctx); - } - - static public Object wizardGroupFinish(Context uiContext, AbstractFrame frame, - TopiaContext isisContext, Population pop, - WizardGroupCreation model) { - log.debug("wizardGroupFinish called"); - try { - // remove all old group - pop.clearPopulationGroup(); - - PopulationGroupDAO dao = IsisFishDAOHelper.getPopulationGroupDAO(isisContext); - - if (model.isAgeType()) { - double ageFirst = model.getFirst(); - double ageLast = model.getLast(); - for (int id=0; id + ageFirst <= ageLast; id++) { - PopulationGroup group = dao.create(); - group.setId(id); - group.setPopulation(pop); - group.setAge(ageFirst + id); - pop.addPopulationGroup(group); - group.update(); - } - } else if (model.isInputType()) { - double minLength = model.getFirst(); - String [] values = model.getMaxLength().split(";"); - for(int i=0; i<values.length; i++){ - if (!"".equals(values[i])) { - double length = Double.parseDouble(values[i]); - PopulationGroup group = dao.create(); - group.setId(i); - group.setPopulation(pop); - group.setMinLength(minLength); - group.setMaxLength(length); - pop.addPopulationGroup(group); - group.update(); - minLength = length; - } - } - - } else if (model.isSameSizeType()) { - double minLength = model.getFirst(); - int numberOfGroup = model.getNumberOfGroup(); - double step = model.getGroupSize(); - if (numberOfGroup < 0){ - return new OutputView("Error.xml", "error", _("isisfish.error.number.classes.upper.zero")); - } - if (step == 0){ - return new OutputView("Error.xml", "error", _("isisfish.error.no.null.time.step")); - } - - double maxLength = minLength; - for(int i=0; i<numberOfGroup; i++){ - maxLength = minLength + step; - PopulationGroup group = dao.create(); - group.setId(i); - group.setPopulation(pop); - group.setMinLength(minLength); - group.setMaxLength(maxLength); - pop.addPopulationGroup(group); - group.update(); - minLength = maxLength; - } - } else if (model.isGrowthCurveType()) { - double minLength = model.getFirst(); - int numberOfGroup = model.getNumberOfGroup(); - int step = (int)model.getStep(); - - Equation equation = pop.getGrowth(); - if(equation == null){ - return new OutputView("Error.xml", "error", _("isisfish.error.growth.equation.before.create.group.population")); - } - double deltat = -1; - double Lmin = minLength; - for(int i=0; i<numberOfGroup; i++){ - // on creer la classe avec une valeur Lmax fausses ... - PopulationGroup group = dao.create(); - group.setId(i); - group.setPopulation(pop); - group.setMinLength(Lmin); - group.setMaxLength(Lmin); - pop.addPopulationGroup(group); - - if(deltat < 0) { - // premier passage, recuperation de l'age minimum - deltat = pop.getAge(minLength, group); - } - // incrementation pour calculer la longueur max de la classe - deltat += step; - - // ... pour pouvoir avoir la classe pour l'equation - double Lmax = pop.getLength(deltat, group); - group.setMaxLength(Lmax); - Lmin = Lmax; - } - } - - frame.windowClosing(null); - frame.getActualContext().getParent().getFrame().refreshView("PopulationTab"); - }catch(Exception eee){ - log.error("Can't create PopulationGroup", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - - } - -} Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSpecies.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSpecies.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSpecies.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,83 +0,0 @@ -/* - * *##% Copyright (C) 2002, 2003 Code Lutin - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place - Suite 330, Boston, MA 02111-1307, USA. ##% - */ - -/******************************************************************************* - * inputSpecies.java - * - * Created: 12 sept. 2005 - * - * @author Arnaud Thimel <thimel at codelutin.com> Copyright Code Lutin - * - * @version $Revision$ - * - * Mise a jour: $Date$ par : $Author$ - */ - -package fr.ifremer.isisfish.ui.input; - -import javax.swing.JButton; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.topia.TopiaContext; -import org.swixat.framework.AbstractFrame; -import org.swixat.framework.OutputView; -import org.swixat.model.Context; - -import fr.ifremer.isisfish.IsisFishDAOHelper; -import fr.ifremer.isisfish.entities.Population; -import fr.ifremer.isisfish.entities.PopulationDAO; -import fr.ifremer.isisfish.entities.Species; - -public class InputSpecies { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(InputSpecies.class); - - static public Object createPopulation(Context uiContext, - TopiaContext isisContext, AbstractFrame frame, Species species, - String populationName, String populationGeographicID, - JButton removeButton) { - log.debug("create called"); - try { - TopiaContext subIsisContext = isisContext; //.beginTransaction(); - - PopulationDAO populationPS = IsisFishDAOHelper - .getPopulationDAO(subIsisContext); - Population population = populationPS.create(); - population.setName(populationName); - population.setGeographicId(populationGeographicID); - - species.addPopulation(population); - population.setSpecies(species); - populationPS.update(population); - species.update(); - subIsisContext.commitTransaction(); - - uiContext.setData("Population", population); - - removeButton.setEnabled(true); - frame.refreshView(); - } catch (Exception eee) { - log.error("Can't create Population", eee); - return new OutputView("Error.xml", "error", eee.getMessage()); - } - return null; - } - -} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -252,9 +252,64 @@ protected void newChanged(){ JButtonNewRegion.setEnabled(true); } + protected void importRegion(){ + setInfoText(_("isisfish.message.import.zip" + getContextValue(InputAction.class).importRegion())); + setInfoText(_("isisfish.message.import.finished")); + } + protected void importRegionAndRename(){ + setInfoText(_("isisfish.message.import.zip" + getContextValue(InputAction.class).importRegionAndRename())); + setInfoText(_("isisfish.message.import.finished")); + } + protected void importV2Region(){ + setInfoText(_("isisfish.message.import.xml.v2.file " + getContextValue(InputAction.class).importV2Region())); + setInfoText(_("isisfish.message.import.finished")); + } + protected void importRegionFromSimulation(){ + setInfoText(_("isisfish.message.import", getContextValue(InputAction.class).importRegionFromSimulation())); + } + protected void exportRegion(){ + setInfoText(_("isisfish.message.export.zip", getContextValue(InputAction.class).exportRegion())); + setInfoText(_("isisfish.message.export.done")); + } + protected void copyRegion(){ + setInfoText(_("isisfish.message.copy.region", getContextValue(InputAction.class).copyRegion())); + setInfoText(_("isisfish.message.copy.finished")); + } + protected void removeRegion(){ + setInfoText(_("isisfish.message.removing.region" + getContextValue(InputAction.class).getRegionStorage().getName())); + setInfoText(getContextValue(InputAction.class).removeRegion(false)); + } + protected void commitRegionInCVS(){ + setInfoText(_("isisfish.message.commiting.region" + getContextValue(InputAction.class).getRegionStorage().getName())); + setInfoText(getContextValue(InputAction.class).commitRegionInCVS()); + } + protected void about(){ + // TODO + } ]]> </script> - <JSplitPane oneTouchExpandable="true" dividerLocation="200" orientation="HORIZONTAL"> + <JMenuBar id="menu" constraints='BorderLayout.NORTH'> + <JMenu text="isisfish.common.region"> + <JMenuItem text="isisfish.input.menu.importRegion" onActionPerformed="importRegion()" accelerator="accNew"/> + <JMenuItem text="isisfish.input.menu.importRenameRegion" onActionPerformed="importRegionAndRename()" accelerator="accNew"/> + <JMenuItem text="isisfish.input.menu.importRegionV2" onActionPerformed="importV2Region()" accelerator="accNew"/> + <JMenuItem text="isisfish.input.menu.importRegionSimulation" onActionPerformed="importRegionFromSimulation()" accelerator="accImportFromSimulation"/> + <JMenuItem text="isisfish.input.menu.exportRegion" onActionPerformed="exportRegion()" accelerator="accExport"/> + <JMenuItem text="isisfish.input.menu.copyRegion" onActionPerformed="copyRegion()" accelerator="accExport"/> + <JSeparator/> + <JMenuItem name="miRemove" text="isisfish.input.menu.removeLocaly" onActionPerformed="removeRegion()" accelerator="accRemove"/> + </JMenu> + <JMenu text="isisfish.input.menu.server"> + <JMenuItem text="isisfish.input.menu.addRegion" onActionPerformed="commitRegionInCVS()" accelerator="accAdd"/> + <JMenuItem text="isisfish.input.menu.commit" onActionPerformed="commitRegionInCVS()" accelerator="accCommitVCS"/> + <JSeparator/> + <JMenuItem name="miRemove" text="isisfish.input.menu.removeLocalyRemotely" onActionPerformed="removeRegion()" accelerator="accRemove"/> + </JMenu> + <!--JMenu text="isisfish.input.menu.help"> + <JMenuItem name="miAbout" text="isisfish.input.menu.about" onActionPerformed="about()" accelerator="accAbout"/> + </JMenu--> + </JMenuBar> + <JSplitPane oneTouchExpandable="true" dividerLocation="200" orientation="HORIZONTAL" constraints='BorderLayout.CENTER'> <JPanel layout='{new BorderLayout()}'> <Table constraints='BorderLayout.NORTH'> <row> @@ -291,6 +346,5 @@ <SetOfVesselsUI id='setOfVesselsUI' constraints='"SetOfVessels"' constructorParams='getContextValue(InputAction.class)'/> <StrategyUI id='strategyUI' constraints='"Strategy"' constructorParams='getContextValue(InputAction.class)'/> </JPanel> - </JSplitPane> </JPanel> \ No newline at end of file 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-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -152,7 +152,22 @@ pop.setGeographicId(fieldPopulationBasicsGeographicID.getText()); } protected void createClasses(){ - getContextValue(InputAction.class).wizardGroupOpen(); + if (pop != null){ + JFrame wizardFrame = new JFrame(); + wizardFrame.setLayout(new BorderLayout()); + WizardGroupCreationUI wizard = new WizardGroupCreationUI(getContextValue(InputAction.class), this); + wizardFrame.add(wizard, BorderLayout.CENTER); + wizardFrame.setTitle(_("isisfish.wizardGroupCreation.title")); + wizardFrame.setVisible(true); + wizardFrame.pack(); + wizard.setAgeType(pop.getSpecies().getAgeGroupType()); + if (wizard.isAgeType()) { + wizard.setCard("singleGroupAge"); + } else { + wizard.setCard("beginGroupLength"); + } + refresh(); + } } protected void matureClassChanged(){ Object selected = fieldPopulationBasicsMatureClass.getSelectedItem(); @@ -265,10 +280,6 @@ </cell> <cell columns='2' fill='horizontal' weightx='1.0'> <JTextField id="fieldPopulationBasicsName" onKeyTyped='nameChanged()'/> -<!-- Fixme : DocumentEvents -origin="$Population/name" -<DocumentEvents onModified="Update($fieldPopulationBasicsName/text)"/> ---> </cell> </row> <row> @@ -277,10 +288,6 @@ </cell> <cell columns='2' fill='horizontal' weightx='1.0'> <JTextField id="fieldPopulationBasicsGeographicID" onKeyTyped='geographicChanged()'/> -<!-- Fixme : DocumentEvents -origin="$Population/geographicId" -<DocumentEvents onModified="Update($fieldPopulationBasicsGeographicID/text)"/> ---> </cell> </row> <row> @@ -289,15 +296,9 @@ </cell> <cell fill='horizontal' weightx='0.5'> <JTextField id="fieldPopulationBasicsNbClasses" editable="false"/> -<!-- -origin="sizePopulationGroup($Population)" ---> </cell> <cell fill='horizontal' weightx='0.5'> <JButton id="buttonPopulationBasicsCreateClasses" text="isisfish.populationBasics.recreateClasses" onActionPerformed='createClasses()'/> -<!-- -actionCommand="input.InputPopulation.wizardGroupOpen($Population)" ---> </cell> </row> <row> @@ -306,32 +307,14 @@ </cell> <cell fill='horizontal' weightx='0.5'> <JComboBox id="fieldPopulationBasicsMatureClass" onActionPerformed='matureClassChanged()'/> -<!-- -firstNull="true" -origin="$Population/maturityGroup" renderer="concat(population/name, ' - ', id)" -actionCommand="update($fieldPopulationBasicsMatureClass/selectedItem, $Population/maturityGroup)" -<ComboBoxModel origin="$Population/populationGroup"/> ---> </cell> <cell fill='horizontal' weightx='0.5'> <JCheckBox id="fieldPopulationBasicsPlusGroup" text="isisfish.populationBasics.plusGroup" onActionPerformed='plusGroupChanged()'/> -<!-- Fixme : MouseEvents -origin="$Population/plusGroup" -<MouseEvents onClicked="Update($fieldPopulationBasicsPlusGroup/selected)"/> ---> </cell> </row> <row> <cell columns='3' fill='both' weightx='1.0'> - <JTable id='tableAgeLength'> -<!-- Fixme : tableModel - layDown="true" - <tableModel origin="$Population/populationGroup"> - <column title="Age" property="age"/> - <column title="Length" property="length"/> - </tableModel> ---> - </JTable> + <JTable id='tableAgeLength'/> </cell> </row> <row> @@ -340,11 +323,6 @@ </cell> <cell columns='2' fill='horizontal' weightx='1.0'> <JComboBox id="fieldPopulationBasicsGrowth" onActionPerformed='basicsGrowthChanged()'/> -<!-- -origin="$Population/growth" renderer="name" firstNull="true" -actionCommand="update($fieldPopulationBasicsGrowth/selectedItem/content, $fieldScriptPopulationBasicsGrowth/text)" -<ComboBoxModel origin='fr.ifremer.isisfish.datastore.FormuleStorage.getFormules($TopiaContext, "Growth")'/> ---> </cell> </row> <row> @@ -353,9 +331,6 @@ <row> <cell fill='horizontal'> <JButton text="isisfish.common.saveModel" onActionPerformed='saveGrowthModel()'/> -<!-- -actionCommand='input.Input.saveEquationAsModel($Population/growth);refreshView($fieldPopulationBasicsGrowth)' ---> </cell> </row> <row> @@ -374,17 +349,6 @@ <JScrollPane> <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false"/> </JScrollPane> -<!-- Fixme : editor and DocumentEvents -actionCommand='input.Input.openEditor($Population/growth/category,$Population/growth/name,$Population/growth/javaInterface,$Population/growth/content,$fieldScriptPopulationBasicsGrowth)' - <editor constraints='"fieldScriptPopulationBasicsGrowth"' askIfNotSaved="false" - id="fieldScriptPopulationBasicsGrowth" - origin="org.codelutin.util.FileUtil.getTempFile($Population/growth/content, '.java')"> - <DocumentEvents onModified="Update"> - <UpdateOrigin - target="setEquationGrowth($Population, $fieldScriptPopulationBasicsGrowth/text)"/> - </DocumentEvents> - </editor> ---> </cell> </row> <row> @@ -393,11 +357,6 @@ </cell> <cell columns='2' fill='horizontal' weightx='1.0'> <JComboBox id="fieldPopulationBasicsGrowthReverse" onActionPerformed='growthReverseChanged()'/> -<!-- Fixme : ComboBoxModel -origin="$Population/growthReverse" renderer="name" firstNull="true" -actionCommand="update($fieldPopulationBasicsGrowthReverse/selectedItem/content, $fieldScriptPopulationBasicsGrowthReverse/text)" -<ComboBoxModel origin='fr.ifremer.isisfish.datastore.FormuleStorage.getFormules($TopiaContext, "GrowthReverse")'/> ---> </cell> </row> <row> @@ -406,9 +365,6 @@ <row> <cell fill='horizontal'> <JButton text="isisfish.common.saveModel" onActionPerformed='saveGrowthReverseModel()'/> -<!-- -actionCommand='input.Input.saveEquationAsModel($Population/growthReverse);refreshView($fieldPopulationBasicsGrowthReverse)' ---> </cell> </row> <row> @@ -427,16 +383,6 @@ <JScrollPane> <org.codelutin.widget.editor.Editor id='editorReverse' askIfNotSaved="false"/> </JScrollPane> -<!-- Fixme : editor -actionCommand='input.Input.openEditor($Population/growthReverse/category,$Population/growthReverse/name,$Population/growthReverse/javaInterface,$Population/growthReverse/content,$fieldScriptPopulationBasicsGrowthReverse)' - - <editor constraints='"fieldScriptPopulationBasicsGrowthReverse"' askIfNotSaved="false" id="fieldScriptPopulationBasicsGrowthReverse" origin="org.codelutin.util.FileUtil.getTempFile($Population/growthReverse/content, '.java')"> - <DocumentEvents onModified="Update"> - <UpdateOrigin - target="setEquationGrowthReverse($Population, $fieldScriptPopulationBasicsGrowthReverse/text)"/> - </DocumentEvents> - </editor> ---> </cell> </row> <row> @@ -446,10 +392,6 @@ <cell columns='2' fill='both' weightx='1.0' weighty='0.2'> <JScrollPane> <JTextArea id="fieldPopulationBasicsComment" onKeyTyped='commentChanged()'> -<!-- Fixme : DocumentEvents -origin="$Population/comment" -<DocumentEvents onModified="Update($fieldPopulationBasicsComment/text)"/> ---> </JTextArea> </JScrollPane> </cell> @@ -469,33 +411,17 @@ <row> <cell fill='horizontal' weightx='0.5'> <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/> -<!-- -origin="$FisheryRegion" -actionCommand='input.InputPopulation.create()' ---> </cell> <cell fill='horizontal' weightx='0.5'> <JButton id='save' text="isisfish.common.save" onActionPerformed='save()'/> -<!-- -origin="$EntityModified" -actionCommand='input.Input.save("Population", $Population);refreshView($inputPopulationBasics)' ---> </cell> </row> <row> <cell fill='horizontal' weightx='0.5'> <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()'/> -<!-- -origin="$EntityModified" -actionCommand='input.Input.cancel("Population", $Population);refreshView($inputPopulationBasics)' ---> </cell> <cell fill='horizontal' weightx='0.5'> <JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/> -<!-- -origin="$Population" -actionCommand="input.Input.remove($Population)" ---> </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-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -56,7 +56,6 @@ @Override public void matrixChanged(MatrixPanelEvent arg0) { pop.setCapturability(fieldPopulationCapturability.getMatrix()); - refresh(); valueChanged(true); } }); Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreation.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreation.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreation.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,228 +0,0 @@ -/* *##% - * Copyright (C) 2006 - * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * WizardGroupCreation.java - * - * Created: 12 mars 2006 23:04:06 - * - * @author poussin - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - -package fr.ifremer.isisfish.ui.input; - -import org.swixat.databinding.CardPanelModel; - - -/** - * @author poussin - * - */ - -public class WizardGroupCreation extends CardPanelModel { - - private boolean ageType = false; - private boolean inputType = false; - private boolean sameSizeType = false; - private boolean growthCurveType = false; - - private double first = 0; - private double last = 0; - - private String maxLength = ""; - private int numberOfGroup = 0; - private double groupSize = 0; - - private double step = 1; - - - /** - * @return Returns the ageType. - */ - public boolean isAgeType() { - return this.ageType; - } - - /** - * @param ageType The ageType to set. - */ - public void setAgeType(boolean ageType) { - this.ageType = ageType; - } - - /** - * @return Returns the inputType. - */ - public boolean isInputType() { - return this.inputType; - } - - /** - * @param inputType The inputType to set. - */ - public void setInputType(boolean inputType) { - this.inputType = inputType; - } - - /** - * @return Returns the sameSizeType. - */ - public boolean isSameSizeType() { - return this.sameSizeType; - } - - /** - * @param sameSizeType The sameSizeType to set. - */ - public void setSameSizeType(boolean sameSizeType) { - this.sameSizeType = sameSizeType; - } - - /** - * @return Returns the growthCurveType. - */ - public boolean isGrowthCurveType() { - return this.growthCurveType; - } - - /** - * @param growthCurveType The growthCurveType to set. - */ - public void setGrowthCurveType(boolean growthCurveType) { - this.growthCurveType = growthCurveType; - } - - /** - * @return Returns the first. - */ - public double getFirst() { - return this.first; - } - - /** - * @param first The first to set. - */ - public void setFirst(double first) { - this.first = first; - } - - /** - * @return Returns the last. - */ - public double getLast() { - return this.last; - } - - /** - * @param last The last to set. - */ - public void setLast(double last) { - this.last = last; - } - - /** - * @return Returns the maxLength. - */ - public String getMaxLength() { - return this.maxLength; - } - - /** - * @param maxLength The maxLength to set. - */ - public void setMaxLength(String maxLength) { - this.maxLength = maxLength; - } - - /** - * @return Returns the numberOfGroup. - */ - public int getNumberOfGroup() { - return this.numberOfGroup; - } - - /** - * @param numberOfGroup The numberOfGroup to set. - */ - public void setNumberOfGroup(int numberOfGroup) { - this.numberOfGroup = numberOfGroup; - } - - /** - * @return Returns the groupSize. - */ - public double getGroupSize() { - return this.groupSize; - } - - /** - * @param groupSize The groupSize to set. - */ - public void setGroupSize(double groupSize) { - this.groupSize = groupSize; - } - - /** - * @return Returns the step. - */ - public double getStep() { - return this.step; - } - - /** - * @param step The step to set. - */ - public void setStep(double step) { - this.step = step; - } - - /* (non-Javadoc) - * @see org.swixat.databinding.CardPanelModel#next() - */ - @Override - public void nextPanel() { - if (isAgeType()) { - // do nothing only one panel - } else if (isInputType()) { - setState("endInputGroupLength"); - } else if (isSameSizeType()) { - setState("endSameSizeGroupLength"); - } else if (isGrowthCurveType()) { - setState("endGrowthCurveGroupLength"); - } - } - /* (non-Javadoc) - * @see org.swixat.databinding.CardPanelModel#prev() - */ - @Override - public void prevPanel() { - if (isAgeType()) { - // do nothing only one panel - } else { - setState("beginGroupLength"); - } - } - -} - - Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -30,152 +30,505 @@ * by : $Author: sletellier $ */ --> -<JFrame id="wizardGroup" visible="true" size='{new Dimension(400,200)}' title="isisfish.wizardGroupCreation.title" - layout='{new BorderLayout()}'> -<!-- - Resizable="true" Closable="true" - bundle="org.codelutin.i18n.I18nBundleBridge" ---> - +<JPanel id="wizardGroup" layout='{new BorderLayout()}'> <script> - import org.codelutin.widget.XMLGridLayout; - </script> - -<!-- Fixme : ContextDataSource, cardPanel - <ContextDataSource id="Population" context="current" source="Population"/> - <ContextDataSource id="wizardModel" context="current" source="wizardModel"/> + <![CDATA[ - <cardPanel id="wizardPanels" origin="$wizardModel" constraints="CENTER"> - - <panel constraints="singleGroupAge" layout="XMLGridLayout(fr/ifremer/isisfish/ui/input/WizardGroupCreation.xgl)"> - <label constraints="beginGroupAgeTitle" text="isisfish.wizardGroupCreation.populationCharacteristics" - horizontalAlignment="CENTER"/> - <label constraints="labelFirstAge" text="isisfish.wizardGroupCreation.firstAge"/> - <textfield constraints="firstAge" id="firstAge" - origin="$wizardModel/first"> - <DocumentEvents onModified="update($firstAge/text)"/> - </textfield> - <label constraints="labelLastAge" text="isisfish.wizardGroupCreation.lastAge"/> - <textfield constraints="lastAge" id="lastAge" - origin="$wizardModel/last"> - <DocumentEvents onModified="update($lastAge/text)"/> - </textfield> - <multilabel constraints="beginGroupAgeHelp"> -First age = minimal age -Last age = maximal age + import org.codelutin.topia.TopiaContext; + import fr.ifremer.isisfish.IsisFishDAOHelper; + import fr.ifremer.isisfish.entities.Equation; + import fr.ifremer.isisfish.entities.Population; + import fr.ifremer.isisfish.entities.PopulationGroup; + import fr.ifremer.isisfish.entities.PopulationGroupDAO; + + protected String current = null; + protected boolean ageType = false; + protected boolean inputType = false; + protected boolean sameSizeType = false; + protected boolean growthCurveType = false; -gap between to group is 1 year. - </multilabel> - </panel> + protected double first = 0; + protected double last = 0; - <panel constraints="beginGroupLength" layout="XMLGridLayout(fr/ifremer/isisfish/ui/input/WizardGroupCreation.xgl)"> - <label constraints="beginGroupLengthTitle" text="isisfish.wizardGroupCreation.selectGroupLengthType" - horizontalAlignment="CENTER"/> - <radioButton constraints="beginGroupLengthTypeInput" - id="beginGroupLengthTypeInput" buttonGroup="groupLengthType" - text="isisfish.wizardGroupCreation.allValues" origin="$wizardModel/inputType"> - <ItemEvents onStateChanged="update($beginGroupLengthTypeInput/selected)"/> - </radioButton> + protected String maxLength = ""; + protected int numberOfGroup = 0; + protected double groupSize = 0; - <radioButton constraints="beginGroupLengthTypeSameSize" - id="beginGroupLengthTypeSameSize" buttonGroup="groupLengthType" - text="isisfish.wizardGroupCreation.allGroupsSameSize" origin="$wizardModel/sameSizeType"> - <ItemEvents onStateChanged="update($beginGroupLengthTypeSameSize/selected)"/> - </radioButton> + protected double step = 1; + protected PopulationBasicsUI popBasic; - <radioButton constraints="beginGroupLengthTypeGrowthCurve" - id="beginGroupLengthTypeGrowthCurve" buttonGroup="groupLengthType" - text="isisfish.wizardGroupCreation.computedGrowthCurve" origin="$wizardModel/growthCurveType"> - <ItemEvents onStateChanged="update($beginGroupLengthTypeGrowthCurve/selected)"/> - </radioButton> - </panel> + public WizardGroupCreationUI(InputAction action, PopulationBasicsUI p){ + delegateContext = new jaxx.runtime.DefaultJAXXContext(this); + setContextValue(action); + popBasic = p; + } - <panel constraints="endInputGroupLength" layout="XMLGridLayout(fr/ifremer/isisfish/ui/input/WizardGroupCreation.xgl)"> - <label constraints="inputGroupLengthTitle" text="isisfish.wizardGroupCreation.populationCharacteristics" - horizontalAlignment="CENTER"/> - <label constraints="labelFirstInputLength" text="isisfish.wizardGroupCreation.firstLength"/> - <textfield constraints="firstInputLength" id="firstInputLength" - origin="$wizardModel/first"> - <DocumentEvents onModified="update($firstInputLength/text)"/> - </textfield> - <label constraints="labelMaximalGroupsLenght" text="isisfish.wizardGroupCreation.maxGroupsLength"/> - <textfield constraints="maximalGroupsLenght" id="maximalGroupsLenght" - origin="$wizardModel/maxLength"> - <DocumentEvents onModified="update($maximalGroupsLenght/text)"/> - </textfield> - <multilabel constraints="inputGroupAgeHelp" text="A semicolon ';' must separe maximal length of each group"/> - </panel> + /** + * @return Returns the ageType. + */ + public boolean isAgeType() { + return this.ageType; + } - <panel constraints="endSameSizeGroupLength" layout="XMLGridLayout(fr/ifremer/isisfish/ui/input/WizardGroupCreation.xgl)"> - <label constraints="sameSizeGroupLengthTitle" text="isisfish.wizardGroupCreation.populationCharacteristics" - horizontalAlignment="CENTER"/> - <label constraints="labelFirstSizeLength" text="isisfish.wizardGroupCreation.firstLength"/> - <textfield constraints="firstSizeLength" id="firstSizeLength" - origin="$wizardModel/first"> - <DocumentEvents onModified="update($firstSizeLength/text)"/> - </textfield> - <label constraints="labelSameSizeNumberOfGroup" text="isisfish.wizardGroupCreation.numberGroup"/> - <textfield constraints="sameSizeNumberOfGroup" id="sameSizeNumberOfGroup" - origin="$wizardModel/numberOfGroup"> - <DocumentEvents onModified="update($sameSizeNumberOfGroup/text)"/> - </textfield> - <label constraints="labelWidth" text="isisfish.wizardGroupCreation.groupWidth"/> - <textfield constraints="width" id="width" - origin="$wizardModel/groupSize"> - <DocumentEvents onModified="update($width/text)"/> - </textfield> - <multilabel constraints="sameSizeGroupLengthHelp"> -First length = minimal length of first group -number of Group = number of group wanted -Group width = width of group - </multilabel> - </panel> + /** + * @param ageType The ageType to set. + */ + public void setAgeType(boolean ageType) { + this.ageType = ageType; + } - <panel constraints="endGrowthCurveGroupLength" layout="XMLGridLayout(fr/ifremer/isisfish/ui/input/WizardGroupCreation.xgl)"> - <label constraints="growthCurveGroupLengthTitle" text="isisfish.wizardGroupCreation.populationCharacteristics" - horizontalAlignment="CENTER"/> - <label constraints="labelGrowthCurveFirstGroup" text="isisfish.wizardGroupCreation.firstGroup"/> - <textfield constraints="growthCurveFirstGroup" id="growthCurveFirstGroup" - origin="$wizardModel/first"> - <DocumentEvents onModified="update($growthCurveFirstGroup/text)"/> - </textfield> - <label constraints="labelNumberOfGroup" text="isisfish.wizardGroupCreation.numberGroups"/> - <textfield constraints="numberOfGroup" id="numberOfGroup" - origin="$wizardModel/numberOfGroup"> - <DocumentEvents onModified="update($numberOfGroup/text)"/> - </textfield> - <label constraints="labelStep" text="isisfish.wizardGroupCreation.timeStep"/> - <textfield constraints="step" id="step" - origin="$wizardModel/step"> - <DocumentEvents onModified="update($step/text)"/> - </textfield> - <multilabel constraints="growthCurveGroupLengthHelp" text="The equation used is the population's growth curve, it needs to be defined first."/> - </panel> - </cardPanel> ---> - <JPanel id="navButton" constraints='"SOUTH"'> - <JButton text="isisfish.common.prev"/> -<!-- - origin="not(isBegin($wizardPanels))" - actionCommand="prev ---> - - <JButton text="isisfish.common.next"/> -<!-- - origin="not(isEnd($wizardPanels))" - actionCommand="next" ---> - - <JButton text="isisfish.common.finish"/> -<!-- - origin="$wizardPanels/end" - actionCommand="input.InputPopulation.wizardGroupFinish($wizardPanels/model)" ---> - - <JButton text="isisfish.common.cancel"/> -<!-- - actionCommand="cancel" - --> + /** + * @return Returns the inputType. + */ + public boolean isInputType() { + return this.inputType; + } + + /** + * @param inputType The inputType to set. + */ + public void setInputType(boolean inputType) { + this.inputType = inputType; + } + + /** + * @return Returns the sameSizeType. + */ + public boolean isSameSizeType() { + return this.sameSizeType; + } + + /** + * @param sameSizeType The sameSizeType to set. + */ + public void setSameSizeType(boolean sameSizeType) { + this.sameSizeType = sameSizeType; + } + + /** + * @return Returns the growthCurveType. + */ + public boolean isGrowthCurveType() { + return this.growthCurveType; + } + + /** + * @param growthCurveType The growthCurveType to set. + */ + public void setGrowthCurveType(boolean growthCurveType) { + this.growthCurveType = growthCurveType; + } + + /** + * @return Returns the first. + */ + public double getFirst() { + return this.first; + } + + /** + * @param first The first to set. + */ + public void setFirst(double first) { + this.first = first; + } + + /** + * @return Returns the last. + */ + public double getLast() { + return this.last; + } + + /** + * @param last The last to set. + */ + public void setLast(double last) { + this.last = last; + } + + /** + * @return Returns the maxLength. + */ + public String getMaxLength() { + return this.maxLength; + } + + /** + * @param maxLength The maxLength to set. + */ + public void setMaxLength(String maxLength) { + this.maxLength = maxLength; + } + + /** + * @return Returns the numberOfGroup. + */ + public int getNumberOfGroup() { + return this.numberOfGroup; + } + + /** + * @param numberOfGroup The numberOfGroup to set. + */ + public void setNumberOfGroup(int numberOfGroup) { + this.numberOfGroup = numberOfGroup; + } + + /** + * @return Returns the groupSize. + */ + public double getGroupSize() { + return this.groupSize; + } + + /** + * @param groupSize The groupSize to set. + */ + public void setGroupSize(double groupSize) { + this.groupSize = groupSize; + } + + /** + * @return Returns the step. + */ + public double getStep() { + return this.step; + } + + /** + * @param step The step to set. + */ + public void setStep(double step) { + this.step = step; + } + + public void setCard(String name){ + current = name; + ((CardLayout) wizardPanels.getLayout()).show(wizardPanels, name); + } + protected void prev(){ + if (isAgeType()) { + // do nothing only one panel + } else { + setCard("beginGroupLength"); + } + prev.setEnabled(false); + next.setEnabled(true); + finish.setEnabled(false); + } + protected void next(){ + if (isAgeType()) { + // do nothing only one panel + } else if (isInputType()) { + setCard("endInputGroupLength"); + } else if (isSameSizeType()) { + setCard("endSameSizeGroupLength"); + } else if (isGrowthCurveType()) { + setCard("endGrowthCurveGroupLength"); + } + prev.setEnabled(true); + next.setEnabled(false); + finish.setEnabled(true); + } + protected void finish(){ + log.debug("wizardGroupFinish called"); + + try { + // remove all old group + Population pop = getContextValue(InputAction.class).getPopulation(); + TopiaContext isisContext = getContextValue(InputAction.class).getIsisContext(); + pop.clearPopulationGroup(); + + PopulationGroupDAO dao = IsisFishDAOHelper.getPopulationGroupDAO(isisContext); + + if (isAgeType()) { + double ageFirst = getFirst(); + double ageLast = getLast(); + for (int id=0; id + ageFirst <= ageLast; id++) { + PopulationGroup group = dao.create(); + group.setId(id); + group.setPopulation(pop); + group.setAge(ageFirst + id); + pop.addPopulationGroup(group); + group.update(); + } + } else if (isInputType()) { + double minLength = getFirst(); + String [] values = getMaxLength().split(";"); + for(int i=0; i<values.length; i++){ + if (!"".equals(values[i])) { + double length = Double.parseDouble(values[i]); + PopulationGroup group = dao.create(); + group.setId(i); + group.setPopulation(pop); + group.setMinLength(minLength); + group.setMaxLength(length); + pop.addPopulationGroup(group); + group.update(); + minLength = length; + } + } + + } else if (isSameSizeType()) { + double minLength = getFirst(); + int numberOfGroup = getNumberOfGroup(); + double step = getGroupSize(); + if (numberOfGroup < 0){ +// return new OutputView("Error.xml", "error", _("isisfish.error.number.classes.upper.zero")); + } + if (step == 0){ +// return new OutputView("Error.xml", "error", _("isisfish.error.no.null.time.step")); + } + + double maxLength = minLength; + for(int i=0; i<numberOfGroup; i++){ + maxLength = minLength + step; + PopulationGroup group = dao.create(); + group.setId(i); + group.setPopulation(pop); + group.setMinLength(minLength); + group.setMaxLength(maxLength); + pop.addPopulationGroup(group); + group.update(); + minLength = maxLength; + } + } else if (isGrowthCurveType()) { + double minLength = getFirst(); + int numberOfGroup = getNumberOfGroup(); + int step = (int)getStep(); + + Equation equation = pop.getGrowth(); + if(equation == null){ +// return new OutputView("Error.xml", "error", _("isisfish.error.growth.equation.before.create.group.population")); + } + double deltat = -1; + double Lmin = minLength; + for(int i=0; i<numberOfGroup; i++){ + // on creer la classe avec une valeur Lmax fausses ... + PopulationGroup group = dao.create(); + group.setId(i); + group.setPopulation(pop); + group.setMinLength(Lmin); + group.setMaxLength(Lmin); + pop.addPopulationGroup(group); + + if(deltat < 0) { + // premier passage, recuperation de l'age minimum + deltat = pop.getAge(minLength, group); + } + // incrementation pour calculer la longueur max de la classe + deltat += step; + + // ... pour pouvoir avoir la classe pour l'equation + double Lmax = pop.getLength(deltat, group); +// pop.setMaxLength(Lmax); + Lmin = Lmax; + } + } + popBasic.refresh(); + cancel(); + }catch(Exception eee){ + log.error("Can't create PopulationGroup", eee); + } + + } + protected void cancel(){ + getParentContainer(JFrame.class).dispose(); + } + protected void refreshChoice(){ + setInputType(beginGroupLengthTypeInput.isSelected()); + setSameSizeType(beginGroupLengthTypeSameSize.isSelected()); + setGrowthCurveType(beginGroupLengthTypeGrowthCurve.isSelected()); + } + ]]> + </script> + <JPanel id="wizardPanels" layout='{new CardLayout()}' constraints='BorderLayout.CENTER'> + <Table constraints='"singleGroupAge"'> + <row> + <cell fill='horizontal' weightx='1.0' columns='2'> + <JLabel text="isisfish.wizardGroupCreation.populationCharacteristics" horizontalAlignment="CENTER"/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.firstAge"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="firstAge" onKeyTyped='setFirst(Double.parseDouble(firstAge.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.lastAge"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="lastAge" onFocusLost='setLast(Double.parseDouble(lastAge.getText()))'/> + </cell> + </row> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text='First age = minimal age'/> + </cell> + </row> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text='Last age = maximal age'/> + </cell> + </row> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text='gap between to group is 1 year.'/> + </cell> + </row> + </Table> + <Table constraints='"beginGroupLength"'> + <row> + <cell fill='horizontal' weightx='1.0'> + <JLabel text="isisfish.wizardGroupCreation.selectGroupLengthType" horizontalAlignment="CENTER"/> + </cell> + </row> + <row> + <cell fill='horizontal' weightx='1.0'> + <JRadioButton id="beginGroupLengthTypeInput" buttonGroup="groupLengthType" text="isisfish.wizardGroupCreation.allValues" onActionPerformed='refreshChoice()'/> + </cell> + </row> + <row> + <cell fill='horizontal' weightx='1.0'> + <JRadioButton id="beginGroupLengthTypeSameSize" buttonGroup="groupLengthType" text="isisfish.wizardGroupCreation.allGroupsSameSize" onActionPerformed='refreshChoice()'/> + </cell> + </row> + <row> + <cell fill='horizontal' weightx='1.0'> + <JRadioButton id="beginGroupLengthTypeGrowthCurve" buttonGroup="groupLengthType" text="isisfish.wizardGroupCreation.computedGrowthCurve" onActionPerformed='refreshChoice()'/> + </cell> + </row> + </Table> + <Table constraints='"endInputGroupLength"'> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text="isisfish.wizardGroupCreation.populationCharacteristics" horizontalAlignment="CENTER"/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.firstLength"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="firstInputLength" onFocusLost='setFirst(Double.parseDouble(firstInputLength.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.maxGroupsLength"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="maximalGroupsLength" onKeyTyped='setMaxLength(maximalGroupsLength.getText())'/> + </cell> + </row> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text="A semicolon ';' must separe maximal length of each group"/> + </cell> + </row> + </Table> + <Table constraints='"endSameSizeGroupLength"'> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text="isisfish.wizardGroupCreation.populationCharacteristics" horizontalAlignment="CENTER"/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.firstLength"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="firstSizeLength" onFocusLost='setFirst(Double.parseDouble(firstSizeLength.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.numberGroup"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="sameSizeNumberOfGroup" onFocusLost='setNumberOfGroup(Integer.parseInt(sameSizeNumberOfGroup.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.groupWidth"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="groupWidth" onFocusLost='setGroupSize(Double.parseDouble(groupWidth.getText()))'/> + </cell> + </row> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text='First length = minimal length of first group'/> + </cell> + </row> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text='number of Group = number of group wanted'/> + </cell> + </row> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text='Group width = width of group'/> + </cell> + </row> + </Table> + <Table constraints='"endGrowthCurveGroupLength"'> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text="isisfish.wizardGroupCreation.populationCharacteristics" horizontalAlignment="CENTER"/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.firstGroup"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="growthCurveFirstGroup" onFocusLost='setFirst(Double.parseDouble(growthCurveFirstGroup.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.numberGroups"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="fieldNumberOfGroup" onFocusLost='setNumberOfGroup(Integer.parseInt(fieldNumberOfGroup.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.wizardGroupCreation.timeStep"/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JTextField id="fieldStep" onFocusLost='setStep(Double.parseDouble(fieldStep.getText()))'/> + </cell> + </row> + <row> + <cell columns='2' fill='horizontal' weightx='1.0'> + <JLabel text="The equation used is the population's growth curve, it needs to be defined first."/> + </cell> + </row> + </Table> </JPanel> - -</JFrame> \ No newline at end of file + <Table id="navButton" constraints='BorderLayout.SOUTH'> + <row> + <cell fill='horizontal' weightx='0.2'> + <JButton id='prev' enabled='false' text="isisfish.common.prev" onActionPerformed='prev()'/> + </cell> + <cell fill='horizontal' weightx='0.2'> + <JButton id='next' text="isisfish.common.next" onActionPerformed='next()'/> + </cell> + <cell fill='horizontal' weightx='0.2'> + <JButton id='finish' enabled='false' text="isisfish.common.finish" onActionPerformed='finish()'/> + </cell> + <cell fill='horizontal' weightx='0.2'> + <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()'/> + </cell> + </row> + </Table> +</JPanel> \ No newline at end of file Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResult.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResult.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResult.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -25,7 +25,7 @@ * Objet permettant l'affichage des donnees resultats sous forme de * matrice. */ -public class DataResult extends DataResultUIOld { // IfremerSimulation +public class DataResult extends DataResultUI { // IfremerSimulation protected MatrixND matrix; Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUI.java (from rev 1593, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIOld.java) =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUI.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUI.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,224 @@ +/** + * DataResult + * + * Generated: Thu Jul 27 22:04:41 CEST 2006 + * By GGen Copyright Code Lutin + * http://www.codelutin.com + * + */ + +package fr.ifremer.isisfish.ui.result; + +import static org.codelutin.i18n.I18nf._; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Toolkit; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.HashMap; +import java.util.Vector; + +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JViewport; +import javax.swing.ListSelectionModel; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.JTableHeader; + +public abstract class DataResultUI extends JPanel implements DataResultUICallback{ + + protected void init(){ + DataResultUI result = this; + this.setLayout(new BorderLayout()); + Vector childs = getDataResultChilds(); + if(childs.size() >= 1) + result.add((Component)childs.get(0), + BorderLayout.CENTER); + + result.setBounds(0,0,0,0); + } + + public void center(){ + // Center the screen + Toolkit tk = this.getToolkit(); + Dimension d = this.getSize(); + int x = (tk.getScreenSize().width - d.width) / 2; + int y = (tk.getScreenSize().height - d.height) / 2; + this.setLocation(x, y); + } + + protected HashMap<String,ButtonGroup> hashGroup = null; + /** + * Ajoute un bouton a un groupe + * @param b the button + * @param groupName name fo group + */ + protected void group(AbstractButton b, String groupName){ + if(hashGroup == null) + hashGroup = new HashMap<String,ButtonGroup>(); + ButtonGroup bg = hashGroup.get(groupName); + if(bg == null){ + bg = new ButtonGroup(); + hashGroup.put(groupName, bg); + } + bg.add(b); + } + + public Vector getDataResultChilds(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable2()); + return result; + } + + private JPanel __table2__ = null; + public JPanel getTable2(){ + if(__table2__ == null){ + Vector childs = getTable2Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 6; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[1] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 2; + c.weightx = 1; + c.weighty = 5; + c.gridwidth = 1; + c.gridheight = 4; + c.fill = GridBagConstraints.BOTH; + cs[2] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.dataResult.table2")); + + __table2__ = result; + } + return __table2__; + } + + public Vector getTable2Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getDescriptionLabel()); + result.add(getExportButton()); + result.add(getScrolledwindow2()); + return result; + } + + private JLabel __descriptionLabel__ = null; + public JLabel getDescriptionLabel(){ + if(__descriptionLabel__ == null){ + JLabel result = new JLabel(_("isisfish.simulation.name")); + result.setToolTipText(_("isisfish.dataResult.descriptionLabel")); + + __descriptionLabel__ = result; + } + return __descriptionLabel__; + } + + private JButton __exportButton__ = null; + public JButton getExportButton(){ + if(__exportButton__ == null){ + ImageIcon icon = null; + + JButton result = new JButton(_("isisfish.dataResult.export.csv"), icon); + result.setToolTipText(_("isisfish.dataResult.exportButton")); + result.addMouseListener(new MouseAdapter(){ + public void mouseClicked(MouseEvent e){ + on_exportButton_clicked(); + } + }); + + __exportButton__ = result; + } + return __exportButton__; + } + + private JScrollPane __scrolledwindow2__ = null; + public JScrollPane getScrolledwindow2(){ + if(__scrolledwindow2__ == null){ + Vector childs = getScrolledwindow2Childs(); + Component child = null; + if(childs.size() >= 1) + child = (Component)childs.get(0); + + JScrollPane result; + if(child instanceof JViewport){ + result = new JScrollPane(); + result.setViewport((JViewport)child); + } + else + result = new JScrollPane(child); + result.setToolTipText(_("isisfish.dataResult.scrolledwindow2")); + + __scrolledwindow2__ = result; + } + return __scrolledwindow2__; + } + + public Vector getScrolledwindow2Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getMatriceTable()); + return result; + } + + private JTable __matriceTable__ = null; + public JTable getMatriceTable(){ + if(__matriceTable__ == null){ + Vector head = getMatriceTableHead(); + JTable result = + new JTable(new DefaultTableModel(new Vector(), head)); + result.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + setSignalMatriceTableHeader(result); + result.setToolTipText(_("isisfish.dataResult.matriceTable")); + + __matriceTable__ = result; + } + return __matriceTable__; + } + + public Vector getMatriceTableHead(){ + Vector<String> result = new Vector<String>(); + result.add(_("isisfish.dataResult.label")); + result.add(_("isisfish.dataResult.label")); + result.add(_("isisfish.dataResult.label")); + return result; + } + + public void setSignalMatriceTableHeader(JTable table){ + JTableHeader result = table.getTableHeader(); + } + + + +} Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,57 +0,0 @@ -<!-- -/* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * DataResult.jaxx - * - * Created: 1 aout 2005 18:37:25 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * @version $Revision: 1312 $ - * - * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ - * by : $Author: sletellier $ - */ - --> -<Table> - <script> - <![CDATA[ - public DataResultUI (ResultAction action){ - delegateContext = new jaxx.runtime.DefaultJAXXContext(this); - setContextValue(action); - } - ]]> - </script> - <row> - <cell fill='horizontal' weightx='1.0'> - <JLabel id='descriptionLabel' text="isisfish.simulation.name"/> - </cell> - </row> - <row> - <cell fill='both' weightx='1.0' weighty='1.0'> - <JTable id="matriceTable"/> - </cell> - </row> - <row> - <cell fill='horizontal' weightx='1.0'> - <JButton id="exportButton" text="isisfish.dataResult.export.csv"/> - </cell> - </row> -</Table> Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIJAXX.jaxx (from rev 1593, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUI.jaxx) =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIJAXX.jaxx (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIJAXX.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,57 @@ +<!-- +/* *##% + * Copyright (C) 2005 + * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * DataResult.jaxx + * + * Created: 1 aout 2005 18:37:25 CEST + * + * @author Benjamin POUSSIN <poussin at codelutin.com> + * @version $Revision: 1312 $ + * + * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ + * by : $Author: sletellier $ + */ + --> +<Table> + <script> + <![CDATA[ + public DataResultUIJAXX (ResultAction action){ + delegateContext = new jaxx.runtime.DefaultJAXXContext(this); + setContextValue(action); + } + ]]> + </script> + <row> + <cell fill='horizontal' weightx='1.0'> + <JLabel id='descriptionLabel' text="isisfish.simulation.name"/> + </cell> + </row> + <row> + <cell fill='both' weightx='1.0' weighty='1.0'> + <JTable id="matriceTable"/> + </cell> + </row> + <row> + <cell fill='horizontal' weightx='1.0'> + <JButton id="exportButton" text="isisfish.dataResult.export.csv"/> + </cell> + </row> +</Table> Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIJAXX.jaxx ___________________________________________________________________ Name: svn:mergeinfo + Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIOld.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIOld.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIOld.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,224 +0,0 @@ -/** - * DataResult - * - * Generated: Thu Jul 27 22:04:41 CEST 2006 - * By GGen Copyright Code Lutin - * http://www.codelutin.com - * - */ - -package fr.ifremer.isisfish.ui.result; - -import static org.codelutin.i18n.I18nf._; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Toolkit; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.HashMap; -import java.util.Vector; - -import javax.swing.AbstractButton; -import javax.swing.ButtonGroup; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JViewport; -import javax.swing.ListSelectionModel; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.JTableHeader; - -public abstract class DataResultUIOld extends JPanel implements DataResultUICallback{ - - protected void init(){ - DataResultUIOld result = this; - this.setLayout(new BorderLayout()); - Vector childs = getDataResultChilds(); - if(childs.size() >= 1) - result.add((Component)childs.get(0), - BorderLayout.CENTER); - - result.setBounds(0,0,0,0); - } - - public void center(){ - // Center the screen - Toolkit tk = this.getToolkit(); - Dimension d = this.getSize(); - int x = (tk.getScreenSize().width - d.width) / 2; - int y = (tk.getScreenSize().height - d.height) / 2; - this.setLocation(x, y); - } - - protected HashMap<String,ButtonGroup> hashGroup = null; - /** - * Ajoute un bouton a un groupe - * @param b the button - * @param groupName name fo group - */ - protected void group(AbstractButton b, String groupName){ - if(hashGroup == null) - hashGroup = new HashMap<String,ButtonGroup>(); - ButtonGroup bg = hashGroup.get(groupName); - if(bg == null){ - bg = new ButtonGroup(); - hashGroup.put(groupName, bg); - } - bg.add(b); - } - - public Vector getDataResultChilds(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable2()); - return result; - } - - private JPanel __table2__ = null; - public JPanel getTable2(){ - if(__table2__ == null){ - Vector childs = getTable2Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 6; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[1] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 2; - c.weightx = 1; - c.weighty = 5; - c.gridwidth = 1; - c.gridheight = 4; - c.fill = GridBagConstraints.BOTH; - cs[2] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.dataResult.table2")); - - __table2__ = result; - } - return __table2__; - } - - public Vector getTable2Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getDescriptionLabel()); - result.add(getExportButton()); - result.add(getScrolledwindow2()); - return result; - } - - private JLabel __descriptionLabel__ = null; - public JLabel getDescriptionLabel(){ - if(__descriptionLabel__ == null){ - JLabel result = new JLabel(_("isisfish.simulation.name")); - result.setToolTipText(_("isisfish.dataResult.descriptionLabel")); - - __descriptionLabel__ = result; - } - return __descriptionLabel__; - } - - private JButton __exportButton__ = null; - public JButton getExportButton(){ - if(__exportButton__ == null){ - ImageIcon icon = null; - - JButton result = new JButton(_("isisfish.dataResult.export.csv"), icon); - result.setToolTipText(_("isisfish.dataResult.exportButton")); - result.addMouseListener(new MouseAdapter(){ - public void mouseClicked(MouseEvent e){ - on_exportButton_clicked(); - } - }); - - __exportButton__ = result; - } - return __exportButton__; - } - - private JScrollPane __scrolledwindow2__ = null; - public JScrollPane getScrolledwindow2(){ - if(__scrolledwindow2__ == null){ - Vector childs = getScrolledwindow2Childs(); - Component child = null; - if(childs.size() >= 1) - child = (Component)childs.get(0); - - JScrollPane result; - if(child instanceof JViewport){ - result = new JScrollPane(); - result.setViewport((JViewport)child); - } - else - result = new JScrollPane(child); - result.setToolTipText(_("isisfish.dataResult.scrolledwindow2")); - - __scrolledwindow2__ = result; - } - return __scrolledwindow2__; - } - - public Vector getScrolledwindow2Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getMatriceTable()); - return result; - } - - private JTable __matriceTable__ = null; - public JTable getMatriceTable(){ - if(__matriceTable__ == null){ - Vector head = getMatriceTableHead(); - JTable result = - new JTable(new DefaultTableModel(new Vector(), head)); - result.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - setSignalMatriceTableHeader(result); - result.setToolTipText(_("isisfish.dataResult.matriceTable")); - - __matriceTable__ = result; - } - return __matriceTable__; - } - - public Vector getMatriceTableHead(){ - Vector<String> result = new Vector<String>(); - result.add(_("isisfish.dataResult.label")); - result.add(_("isisfish.dataResult.label")); - result.add(_("isisfish.dataResult.label")); - return result; - } - - public void setSignalMatriceTableHeader(JTable table){ - JTableHeader result = table.getTableHeader(); - } - - - -} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBean.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBean.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBean.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -27,7 +27,7 @@ * @version */ -public class GraphBean extends GraphBeanUIOld implements GraphBeanUICallback,GraphListener { +public class GraphBean extends GraphBeanUI implements GraphBeanUICallback,GraphListener { protected GraphBeanModel model; protected ChartPropertyEditPanel graphPalette; Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUI.java (from rev 1593, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIOld.java) =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUI.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUI.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,390 @@ +/** + * GraphBean + * + * Generated: Thu Jul 27 22:04:40 CEST 2006 + * By GGen Copyright Code Lutin + * http://www.codelutin.com + * + */ + +package fr.ifremer.isisfish.ui.result; + +import static org.codelutin.i18n.I18nf._; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Toolkit; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.HashMap; +import java.util.Vector; + +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import javax.swing.JViewport; + +public abstract class GraphBeanUI extends JPanel implements GraphBeanUICallback{ + + protected void init(){ + GraphBeanUI result = this; + this.setLayout(new BorderLayout()); + Vector childs = getGraphBeanChilds(); + if(childs.size() >= 1) + result.add((Component)childs.get(0), + BorderLayout.CENTER); + + result.setBounds(0,0,0,0); + } + + public void center(){ + // Center the screen + Toolkit tk = this.getToolkit(); + Dimension d = this.getSize(); + int x = (tk.getScreenSize().width - d.width) / 2; + int y = (tk.getScreenSize().height - d.height) / 2; + this.setLocation(x, y); + } + + protected HashMap<String,ButtonGroup> hashGroup = null; + + protected void group(AbstractButton b, String groupName){ + if(hashGroup == null) + hashGroup = new HashMap<String,ButtonGroup>(); + ButtonGroup bg = hashGroup.get(groupName); + if(bg == null){ + bg = new ButtonGroup(); + hashGroup.put(groupName, bg); + } + bg.add(b); + } + + public Vector getGraphBeanChilds(){ + Vector<Object> result = new Vector<Object>(); + result.add(getGraphSplitPane()); + return result; + } + + private JSplitPane __graphSplitPane__ = null; + public JSplitPane getGraphSplitPane(){ + if(__graphSplitPane__ == null){ + Vector childs = getGraphSplitPaneChilds(); + Component child1 = null; + Component child2 = null; + if(childs.size() >= 1) + child1 = (Component)childs.get(0); + if(childs.size() >= 2) + child2 = (Component)childs.get(1); + + JSplitPane result = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, + child1, child2); + result.setOneTouchExpandable(true); + result.setDividerSize(10); + + result.setToolTipText(_("isisfish.graphBean.graphSplitPane")); + + __graphSplitPane__ = result; + } + return __graphSplitPane__; + } + + public Vector getGraphSplitPaneChilds(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable3()); + result.add(getTable1()); + return result; + } + + private JPanel __table3__ = null; + public JPanel getTable3(){ + if(__table3__ == null){ + Vector childs = getTable3Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 0; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 1; + c.weightx = 1; + c.weighty = 3; + c.gridwidth = 2; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[1] = c; + + c = new GridBagConstraints(); + c.gridx = 1; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.HORIZONTAL; + cs[2] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.graphBean.table3")); + + __table3__ = result; + } + return __table3__; + } + + public Vector getTable3Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getLabel1()); + result.add(getScrolledwindow1()); + result.add(getGraphRendererCombo()); + return result; + } + + private JLabel __label1__ = null; + public JLabel getLabel1(){ + if(__label1__ == null){ + JLabel result = new JLabel(_("isisfish.graphBean.graph.render")); + result.setToolTipText(_("isisfish.graphBean.label")); + + __label1__ = result; + } + return __label1__; + } + + private JScrollPane __scrolledwindow1__ = null; + public JScrollPane getScrolledwindow1(){ + if(__scrolledwindow1__ == null){ + Vector childs = getScrolledwindow1Childs(); + Component child = null; + if(childs.size() >= 1) + child = (Component)childs.get(0); + + JScrollPane result; + if(child instanceof JViewport){ + result = new JScrollPane(); + result.setViewport((JViewport)child); + } + else + result = new JScrollPane(child); + result.setToolTipText(_("isisfish.graphBean.scrolledwindow")); + + __scrolledwindow1__ = result; + } + return __scrolledwindow1__; + } + + public Vector getScrolledwindow1Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getViewport1()); + return result; + } + + private JViewport __viewport1__ = null; + public JViewport getViewport1(){ + if(__viewport1__ == null){ + JViewport result = new JViewport(); + Vector childs = getViewport1Childs(); + for (Object child : childs) result.add((Component) child); + + __viewport1__ = result; + } + return __viewport1__; + } + + public Vector getViewport1Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable99()); + return result; + } + + private JPanel __table99__ = null; + public JPanel getTable99(){ + if(__table99__ == null){ + Vector childs = getTable99Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[0] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.graphBean.table")); + + __table99__ = result; + } + return __table99__; + } + + public Vector getTable99Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getGraphPanel()); + return result; + } + + private javax.swing.JPanel __graphPanel__ = null; + public javax.swing.JPanel getGraphPanel(){ + if(__graphPanel__ == null){ + javax.swing.JPanel result = new javax.swing.JPanel(); + result.setToolTipText(_("isisfish.graphBean.graphPanel")); + + __graphPanel__ = result; + } + return __graphPanel__; + } + + private JComboBox __graphRendererCombo__ = null; + public JComboBox getGraphRendererCombo(){ + if(__graphRendererCombo__ == null){ + JComboBox result = new JComboBox(); + result.setEditable(true); + result.setToolTipText(_("isisfish.graphBean.graphRendererCombo")); + result.addItemListener(new ItemListener(){ + public void itemStateChanged(ItemEvent e){ + on_graphRendererCombo_selectionChanged(e); + } + }); + + __graphRendererCombo__ = result; + } + return __graphRendererCombo__; + } + + private JPanel __table1__ = null; + public JPanel getTable1(){ + if(__table1__ == null){ + Vector childs = getTable1Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 1; + c.weightx = 1; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[1] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.graphBean.table")); + + __table1__ = result; + } + return __table1__; + } + + public Vector getTable1Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable2()); + result.add(getAppliquer()); + return result; + } + + private JPanel __table2__ = null; + public JPanel getTable2(){ + if(__table2__ == null){ + Vector childs = getTable2Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[0] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.graphBean.table")); + + __table2__ = result; + } + return __table2__; + } + + public Vector getTable2Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getPalettePanel()); + return result; + } + + private javax.swing.JPanel __palettePanel__ = null; + public javax.swing.JPanel getPalettePanel(){ + if(__palettePanel__ == null){ + javax.swing.JPanel result = new javax.swing.JPanel(); + result.setToolTipText(_("isisfish.graphBean.palettePanel")); + + __palettePanel__ = result; + } + return __palettePanel__; + } + + private JButton __appliquer__ = null; + public JButton getAppliquer(){ + if(__appliquer__ == null){ + ImageIcon icon = null; + + JButton result = new JButton(_("isisfish.common.apply"), icon); + result.setToolTipText(_("isisfish.common.apply")); + result.addMouseListener(new MouseAdapter(){ + public void mouseClicked(MouseEvent e){ + on_appliquer_clicked(); + } + }); + + __appliquer__ = result; + } + return __appliquer__; + } + + + +} Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,149 +0,0 @@ -<!-- -/* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * DataResult.jaxx - * - * Created: 1 aout 2005 18:37:25 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * @version $Revision: 1312 $ - * - * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ - * by : $Author: sletellier $ - */ - --> -<Table> - <script> - <![CDATA[ - import com.jrefinery.chart.*; - import com.jrefinery.chart.ui.ChartPropertyEditPanel; - - protected GraphBeanModel model; - protected JFreeChart chart; - protected ChartPropertyEditPanel graphPalette; - protected ChartPanel chartPanel; - - init(); - public GraphBeanUI (ResultAction action){ - delegateContext = new jaxx.runtime.DefaultJAXXContext(this); - setContextValue(action); - } - protected void init(){ - model = new GraphBeanModel(); - JFreeChart chart = new JFreeChart(model.getTitle(), - JFreeChart.DEFAULT_TITLE_FONT, - model.getCategoryPlot(), - true); - graphPalette = new ChartPropertyEditPanel(chart); - jpanel1.add(graphPalette); - chartPanel = new ChartPanel(chart,true,true,true,true,true); - jpanel2.add(chartPanel); - model.addGraphListener(new GraphListener() { - - @Override - public void graphChanged(GraphEvent e) { - - } - public void on_graphRendererCombo_selectionChanged(ItemEvent e){ - if (e.getStateChange() == ItemEvent.SELECTED){ - model.setRenderer((CategoryItemRenderer)graphRenderer.getSelectedItem()); - } - } - - }); - } - protected DefaultComboBoxModel loadGraphRendererCombo(){ - DefaultComboBoxModel model = new DefaultComboBoxModel(); - model.addElement(new VerticalBarRenderer()); - model.addElement(new VerticalBarRenderer3D()); - model.addElement(new StackedVerticalBarRenderer()); - // model.addElement(new VerticalIntervalBarRenderer()); - //model.addElement(new VerticalStatisticalBarRenderer()); - model.addElement(new HorizontalBarRenderer()); - // model.addElement(new HorizontalBarRenderer3D()); - model.addElement(new StackedHorizontalBarRenderer()); - // model.addElement(new HorizontalIntervalBarRenderer()); - //model.addElement(new HorizontalShapeRenderer()); - model.addElement(new AreaCategoryItemRenderer()); - model.addElement(new LineAndShapeRenderer()); - model.addElement(new MinMaxCategoryRenderer()); - model.setSelectedItem(null); - return model; - } - - protected void displayGraph(){ - - jaxx.runtime.Util.assignment(chart = new JFreeChart(model.getTitle(), JFreeChart.DEFAULT_TITLE_FONT, model.getCategoryPlot(), true), "chart", fr.ifremer.isisfish.ui.result.GraphBeanUI.this); - - jaxx.runtime.Util.assignment(chartPanel = new ChartPanel(chart,true,true,true,true,true), "chartPanel", fr.ifremer.isisfish.ui.result.GraphBeanUI.this); - jaxx.runtime.Util.assignment(graphPalette = new ChartPropertyEditPanel(chart), "graphPalette", fr.ifremer.isisfish.ui.result.GraphBeanUI.this); - - //getGraphSplitPane().setDividerLocation(1.0); - - graphPalette.removeAll(); - palettePanel.removeAll(); - graphPalette.add(chartPanel); - palettePanel.add(graphPalette); - graphPalette.invalidate(); - palettePanel.invalidate(); - graphPalette.validate(); - palettePanel.validate(); - graphPalette.repaint(); - palettePanel.repaint(); - } - protected void graphRenderChanged(){ - model.setRenderer((CategoryItemRenderer)graphRenderer.getSelectedItem()); - displayGraph(); - } - public void appliquer(){ - graphPalette.updateChartProperties(chart); - } - ]]> - </script> - <row> - <cell fill='horizontal' weightx='0.5'> - <JLabel id='label' text='isisfish.graphBean.graph.render'/> - </cell> - <cell fill='horizontal' weightx='0.5'> - <JComboBox id='graphRenderer' model='{loadGraphRendererCombo()}' renderer='{new GraphComboRenderer()}' onActionPerformed='graphRenderChanged()'/> - </cell> - </row> - <row> - <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> - <JPanel id='jpanel1' layout='{new BorderLayout()}'/> - </cell> - </row> - <row> - <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> - <JPanel id='jpanel2' layout='{new BorderLayout()}'/> - </cell> - </row> - <row> - <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> - <JPanel id='palettePanel' layout='{new BorderLayout()}'/> - </cell> - </row> - <row> - <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> - <JButton id='appliquer' text="isisfish.common.apply" onActionPerformed='appliquer()'/> - </cell> - </row> -</Table> Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIJAXX.jaxx (from rev 1593, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUI.jaxx) =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIJAXX.jaxx (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIJAXX.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,149 @@ +<!-- +/* *##% + * Copyright (C) 2005 + * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * DataResult.jaxx + * + * Created: 1 aout 2005 18:37:25 CEST + * + * @author Benjamin POUSSIN <poussin at codelutin.com> + * @version $Revision: 1312 $ + * + * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ + * by : $Author: sletellier $ + */ + --> +<Table> + <script> + <![CDATA[ + import com.jrefinery.chart.*; + import com.jrefinery.chart.ui.ChartPropertyEditPanel; + + protected GraphBeanModel model; + protected JFreeChart chart; + protected ChartPropertyEditPanel graphPalette; + protected ChartPanel chartPanel; + + init(); + public GraphBeanUIJAXX (ResultAction action){ + delegateContext = new jaxx.runtime.DefaultJAXXContext(this); + setContextValue(action); + } + protected void init(){ + model = new GraphBeanModel(); + JFreeChart chart = new JFreeChart(model.getTitle(), + JFreeChart.DEFAULT_TITLE_FONT, + model.getCategoryPlot(), + true); + graphPalette = new ChartPropertyEditPanel(chart); + jpanel1.add(graphPalette); + chartPanel = new ChartPanel(chart,true,true,true,true,true); + jpanel2.add(chartPanel); + model.addGraphListener(new GraphListener() { + + @Override + public void graphChanged(GraphEvent e) { + + } + public void on_graphRendererCombo_selectionChanged(ItemEvent e){ + if (e.getStateChange() == ItemEvent.SELECTED){ + model.setRenderer((CategoryItemRenderer)graphRenderer.getSelectedItem()); + } + } + + }); + } + protected DefaultComboBoxModel loadGraphRendererCombo(){ + DefaultComboBoxModel model = new DefaultComboBoxModel(); + model.addElement(new VerticalBarRenderer()); + model.addElement(new VerticalBarRenderer3D()); + model.addElement(new StackedVerticalBarRenderer()); + // model.addElement(new VerticalIntervalBarRenderer()); + //model.addElement(new VerticalStatisticalBarRenderer()); + model.addElement(new HorizontalBarRenderer()); + // model.addElement(new HorizontalBarRenderer3D()); + model.addElement(new StackedHorizontalBarRenderer()); + // model.addElement(new HorizontalIntervalBarRenderer()); + //model.addElement(new HorizontalShapeRenderer()); + model.addElement(new AreaCategoryItemRenderer()); + model.addElement(new LineAndShapeRenderer()); + model.addElement(new MinMaxCategoryRenderer()); + model.setSelectedItem(null); + return model; + } + + protected void displayGraph(){ + + jaxx.runtime.Util.assignment(chart = new JFreeChart(model.getTitle(), JFreeChart.DEFAULT_TITLE_FONT, model.getCategoryPlot(), true), "chart", fr.ifremer.isisfish.ui.result.GraphBeanUIJAXX.this); + + jaxx.runtime.Util.assignment(chartPanel = new ChartPanel(chart,true,true,true,true,true), "chartPanel", fr.ifremer.isisfish.ui.result.GraphBeanUIJAXX.this); + jaxx.runtime.Util.assignment(graphPalette = new ChartPropertyEditPanel(chart), "graphPalette", fr.ifremer.isisfish.ui.result.GraphBeanUIJAXX.this); + + //getGraphSplitPane().setDividerLocation(1.0); + + graphPalette.removeAll(); + palettePanel.removeAll(); + graphPalette.add(chartPanel); + palettePanel.add(graphPalette); + graphPalette.invalidate(); + palettePanel.invalidate(); + graphPalette.validate(); + palettePanel.validate(); + graphPalette.repaint(); + palettePanel.repaint(); + } + protected void graphRenderChanged(){ + model.setRenderer((CategoryItemRenderer)graphRenderer.getSelectedItem()); + displayGraph(); + } + public void appliquer(){ + graphPalette.updateChartProperties(chart); + } + ]]> + </script> + <row> + <cell fill='horizontal' weightx='0.5'> + <JLabel id='label' text='isisfish.graphBean.graph.render'/> + </cell> + <cell fill='horizontal' weightx='0.5'> + <JComboBox id='graphRenderer' model='{loadGraphRendererCombo()}' renderer='{new GraphComboRenderer()}' onActionPerformed='graphRenderChanged()'/> + </cell> + </row> + <row> + <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> + <JPanel id='jpanel1' layout='{new BorderLayout()}'/> + </cell> + </row> + <row> + <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> + <JPanel id='jpanel2' layout='{new BorderLayout()}'/> + </cell> + </row> + <row> + <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> + <JPanel id='palettePanel' layout='{new BorderLayout()}'/> + </cell> + </row> + <row> + <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> + <JButton id='appliquer' text="isisfish.common.apply" onActionPerformed='appliquer()'/> + </cell> + </row> +</Table> Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIJAXX.jaxx ___________________________________________________________________ Name: svn:mergeinfo + Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIOld.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIOld.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIOld.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,390 +0,0 @@ -/** - * GraphBean - * - * Generated: Thu Jul 27 22:04:40 CEST 2006 - * By GGen Copyright Code Lutin - * http://www.codelutin.com - * - */ - -package fr.ifremer.isisfish.ui.result; - -import static org.codelutin.i18n.I18nf._; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Toolkit; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.HashMap; -import java.util.Vector; - -import javax.swing.AbstractButton; -import javax.swing.ButtonGroup; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JSplitPane; -import javax.swing.JViewport; - -public abstract class GraphBeanUIOld extends JPanel implements GraphBeanUICallback{ - - protected void init(){ - GraphBeanUIOld result = this; - this.setLayout(new BorderLayout()); - Vector childs = getGraphBeanChilds(); - if(childs.size() >= 1) - result.add((Component)childs.get(0), - BorderLayout.CENTER); - - result.setBounds(0,0,0,0); - } - - public void center(){ - // Center the screen - Toolkit tk = this.getToolkit(); - Dimension d = this.getSize(); - int x = (tk.getScreenSize().width - d.width) / 2; - int y = (tk.getScreenSize().height - d.height) / 2; - this.setLocation(x, y); - } - - protected HashMap<String,ButtonGroup> hashGroup = null; - - protected void group(AbstractButton b, String groupName){ - if(hashGroup == null) - hashGroup = new HashMap<String,ButtonGroup>(); - ButtonGroup bg = hashGroup.get(groupName); - if(bg == null){ - bg = new ButtonGroup(); - hashGroup.put(groupName, bg); - } - bg.add(b); - } - - public Vector getGraphBeanChilds(){ - Vector<Object> result = new Vector<Object>(); - result.add(getGraphSplitPane()); - return result; - } - - private JSplitPane __graphSplitPane__ = null; - public JSplitPane getGraphSplitPane(){ - if(__graphSplitPane__ == null){ - Vector childs = getGraphSplitPaneChilds(); - Component child1 = null; - Component child2 = null; - if(childs.size() >= 1) - child1 = (Component)childs.get(0); - if(childs.size() >= 2) - child2 = (Component)childs.get(1); - - JSplitPane result = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, - child1, child2); - result.setOneTouchExpandable(true); - result.setDividerSize(10); - - result.setToolTipText(_("isisfish.graphBean.graphSplitPane")); - - __graphSplitPane__ = result; - } - return __graphSplitPane__; - } - - public Vector getGraphSplitPaneChilds(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable3()); - result.add(getTable1()); - return result; - } - - private JPanel __table3__ = null; - public JPanel getTable3(){ - if(__table3__ == null){ - Vector childs = getTable3Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 0; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 1; - c.weightx = 1; - c.weighty = 3; - c.gridwidth = 2; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[1] = c; - - c = new GridBagConstraints(); - c.gridx = 1; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.HORIZONTAL; - cs[2] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.graphBean.table3")); - - __table3__ = result; - } - return __table3__; - } - - public Vector getTable3Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getLabel1()); - result.add(getScrolledwindow1()); - result.add(getGraphRendererCombo()); - return result; - } - - private JLabel __label1__ = null; - public JLabel getLabel1(){ - if(__label1__ == null){ - JLabel result = new JLabel(_("isisfish.graphBean.graph.render")); - result.setToolTipText(_("isisfish.graphBean.label")); - - __label1__ = result; - } - return __label1__; - } - - private JScrollPane __scrolledwindow1__ = null; - public JScrollPane getScrolledwindow1(){ - if(__scrolledwindow1__ == null){ - Vector childs = getScrolledwindow1Childs(); - Component child = null; - if(childs.size() >= 1) - child = (Component)childs.get(0); - - JScrollPane result; - if(child instanceof JViewport){ - result = new JScrollPane(); - result.setViewport((JViewport)child); - } - else - result = new JScrollPane(child); - result.setToolTipText(_("isisfish.graphBean.scrolledwindow")); - - __scrolledwindow1__ = result; - } - return __scrolledwindow1__; - } - - public Vector getScrolledwindow1Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getViewport1()); - return result; - } - - private JViewport __viewport1__ = null; - public JViewport getViewport1(){ - if(__viewport1__ == null){ - JViewport result = new JViewport(); - Vector childs = getViewport1Childs(); - for (Object child : childs) result.add((Component) child); - - __viewport1__ = result; - } - return __viewport1__; - } - - public Vector getViewport1Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable99()); - return result; - } - - private JPanel __table99__ = null; - public JPanel getTable99(){ - if(__table99__ == null){ - Vector childs = getTable99Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[0] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.graphBean.table")); - - __table99__ = result; - } - return __table99__; - } - - public Vector getTable99Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getGraphPanel()); - return result; - } - - private javax.swing.JPanel __graphPanel__ = null; - public javax.swing.JPanel getGraphPanel(){ - if(__graphPanel__ == null){ - javax.swing.JPanel result = new javax.swing.JPanel(); - result.setToolTipText(_("isisfish.graphBean.graphPanel")); - - __graphPanel__ = result; - } - return __graphPanel__; - } - - private JComboBox __graphRendererCombo__ = null; - public JComboBox getGraphRendererCombo(){ - if(__graphRendererCombo__ == null){ - JComboBox result = new JComboBox(); - result.setEditable(true); - result.setToolTipText(_("isisfish.graphBean.graphRendererCombo")); - result.addItemListener(new ItemListener(){ - public void itemStateChanged(ItemEvent e){ - on_graphRendererCombo_selectionChanged(e); - } - }); - - __graphRendererCombo__ = result; - } - return __graphRendererCombo__; - } - - private JPanel __table1__ = null; - public JPanel getTable1(){ - if(__table1__ == null){ - Vector childs = getTable1Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 1; - c.weightx = 1; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[1] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.graphBean.table")); - - __table1__ = result; - } - return __table1__; - } - - public Vector getTable1Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable2()); - result.add(getAppliquer()); - return result; - } - - private JPanel __table2__ = null; - public JPanel getTable2(){ - if(__table2__ == null){ - Vector childs = getTable2Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[0] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.graphBean.table")); - - __table2__ = result; - } - return __table2__; - } - - public Vector getTable2Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getPalettePanel()); - return result; - } - - private javax.swing.JPanel __palettePanel__ = null; - public javax.swing.JPanel getPalettePanel(){ - if(__palettePanel__ == null){ - javax.swing.JPanel result = new javax.swing.JPanel(); - result.setToolTipText(_("isisfish.graphBean.palettePanel")); - - __palettePanel__ = result; - } - return __palettePanel__; - } - - private JButton __appliquer__ = null; - public JButton getAppliquer(){ - if(__appliquer__ == null){ - ImageIcon icon = null; - - JButton result = new JButton(_("isisfish.common.apply"), icon); - result.setToolTipText(_("isisfish.common.apply")); - result.addMouseListener(new MouseAdapter(){ - public void mouseClicked(MouseEvent e){ - on_appliquer_clicked(); - } - }); - - __appliquer__ = result; - } - return __appliquer__; - } - - - -} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -55,7 +55,7 @@ import fr.ifremer.isisfish.simulator.SimulationParameter; import fr.ifremer.isisfish.types.Date; -public class ResultEdit extends ResultEditUIold { // ResultatEdit2 +public class ResultEdit extends ResultEditUI { // ResultatEdit2 /** to use log facility, just put in your code: log.info("..."); */ static private Log log = LogFactory.getLog(ResultEdit.class); Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUI.java (from rev 1593, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIold.java) =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUI.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUI.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,703 @@ +/** + * ResultEdit + * + * Generated: Thu Jul 27 22:04:42 CEST 2006 + * By GGen Copyright Code Lutin + * http://www.codelutin.com + * + */ + +package fr.ifremer.isisfish.ui.result; + +import static org.codelutin.i18n.I18nf._; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Toolkit; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.HashMap; +import java.util.Vector; + +import javax.swing.AbstractButton; +import javax.swing.Box; +import javax.swing.ButtonGroup; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JInternalFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JSplitPane; +import javax.swing.JViewport; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +public abstract class ResultEditUI extends JInternalFrame implements ResultEditUICallback{ + + public ResultEditUI(){ + super(_("isisfish.result.title")); + } + + protected void init(){ + ResultEditUI result = this; + this.getContentPane().setLayout(new BorderLayout()); + Vector childs = getResultatEditChilds(); + if(childs.size() >= 1) + result.getContentPane().add((Component)childs.get(0), + BorderLayout.CENTER); + + this.setJMenuBar(getMenubar2()); + this.pack(); + + } + + public void center(){ + // Center the screen + Toolkit tk = this.getToolkit(); + Dimension d = this.getSize(); + int x = (tk.getScreenSize().width - d.width) / 2; + int y = (tk.getScreenSize().height - d.height) / 2; + this.setLocation(x, y); + } + + protected HashMap<String,ButtonGroup> hashGroup = null; + /** + * Ajoute un bouton a un groupe + * @param b the button + * @param groupName name fo group + */ + protected void group(AbstractButton b, String groupName){ + if(hashGroup == null) + hashGroup = new HashMap<String,ButtonGroup>(); + ButtonGroup bg = hashGroup.get(groupName); + if(bg == null){ + bg = new ButtonGroup(); + hashGroup.put(groupName, bg); + } + bg.add(b); + } + + public Vector getResultatEditChilds(){ + Vector<Object> result = new Vector<Object>(); + result.add(getVbox2()); + return result; + } + + private Box __vbox2__ = null; + public Box getVbox2(){ + if(__vbox2__ == null){ + Vector childs = getVbox2Childs(); + Box result = Box.createVerticalBox(); + for (Object child : childs) result.add((Component) child); + result.setToolTipText(_("isisfish.result.vbox")); + + __vbox2__ = result; + } + return __vbox2__; + } + + public Vector getVbox2Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable23()); + return result; + } + + private JMenuBar __menubar2__ = null; + public JMenuBar getMenubar2(){ + if(__menubar2__ == null){ + Vector childs = getMenubar2Childs(); + JMenuBar result = new JMenuBar(); + for (Object child : childs) result.add((JMenuItem) child); + result.setToolTipText(_("isisfish.result.menubar")); + + __menubar2__ = result; + } + return __menubar2__; + } + + public Vector getMenubar2Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getMenuExport()); + return result; + } + + private JMenu __menuExport__ = null; + public JMenu getMenuExport(){ + if(__menuExport__ == null){ + Vector childs = getMenuExport_menuChilds(); + JMenu result = new JMenu(_("isisfish.result.export")); + for (Object child : childs) result.add((Component) child); + result.setToolTipText(_("isisfish.result.menuExport")); + + __menuExport__ = result; + } + return __menuExport__; + } + + public Vector getMenuExport_menuChilds(){ + Vector<Object> result = new Vector<Object>(); + result.add(getMenuitem6()); + return result; + } + + private JSeparator __menuitem6__ = null; + public JSeparator getMenuitem6(){ + if(__menuitem6__ == null){ + JSeparator result = new JSeparator(); + result.setToolTipText(_("isisfish.result.menuitem")); + + __menuitem6__ = result; + } + return __menuitem6__; + } + + private JPanel __table23__ = null; + public JPanel getTable23(){ + if(__table23__ == null){ + Vector childs = getTable23Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 1; + c.weightx = 0; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.HORIZONTAL; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[1] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.result.table")); + + __table23__ = result; + } + return __table23__; + } + + public Vector getTable23Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable22()); + result.add(getHpaned2()); + return result; + } + + private JPanel __table22__ = null; + public JPanel getTable22(){ + if(__table22__ == null){ + Vector childs = getTable22Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 1; + c.gridy = 0; + c.weightx = 0; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.HORIZONTAL; + cs[1] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.result.table")); + + __table22__ = result; + } + return __table22__; + } + + public Vector getTable22Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getStatusImage()); + result.add(getStatusbar1()); + return result; + } + + private JButton __statusImage__ = null; + public JButton getStatusImage(){ + if(__statusImage__ == null){ + ImageIcon icon = null; + + JButton result = new JButton(_("isisfish.common.blank"), icon); + result.setToolTipText(_("isisfish.result.statusImage")); + + __statusImage__ = result; + } + return __statusImage__; + } + + private JLabel __statusbar1__ = null; + public JLabel getStatusbar1(){ + if(__statusbar1__ == null){ + JLabel result = new JLabel(_("isisfish.result.statusBar")); + result.setToolTipText(_("isisfish.result.statusBar")); + + __statusbar1__ = result; + } + return __statusbar1__; + } + + private JSplitPane __hpaned2__ = null; + public JSplitPane getHpaned2(){ + if(__hpaned2__ == null){ + Vector childs = getHpaned2Childs(); + Component child1 = null; + Component child2 = null; + if(childs.size() >= 1) + child1 = (Component)childs.get(0); + if(childs.size() >= 2) + child2 = (Component)childs.get(1); + + JSplitPane result = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, + child1, child2); + result.setOneTouchExpandable(true); + result.setDividerSize(10); + + result.setToolTipText(_("isisfish.result.hpaned")); + + __hpaned2__ = result; + } + return __hpaned2__; + } + + public Vector getHpaned2Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable1()); + result.add(getTable25()); + return result; + } + + private JPanel __table1__ = null; + public JPanel getTable1(){ + if(__table1__ == null){ + Vector childs = getTable1Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 1; + c.weightx = 1; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.HORIZONTAL; + cs[1] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.result.table")); + + __table1__ = result; + } + return __table1__; + } + + public Vector getTable1Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable7()); + result.add(getResultat()); + return result; + } + + private JPanel __table7__ = null; + public JPanel getTable7(){ + if(__table7__ == null){ + Vector childs = getTable7Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 1; + c.gridy = 0; + c.weightx = 0; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[1] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.result.table")); + + __table7__ = result; + } + return __table7__; + } + + public Vector getTable7Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable8()); + result.add(getScroll()); + return result; + } + + private JPanel __table8__ = null; + public JPanel getTable8(){ + if(__table8__ == null){ + Vector childs = getTable8Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 0; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[0] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.result.table")); + + __table8__ = result; + } + return __table8__; + } + + public Vector getTable8Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getAjoutRendu()); + return result; + } + + private JButton __ajoutRendu__ = null; + public JButton getAjoutRendu(){ + if(__ajoutRendu__ == null){ + ImageIcon icon = null; + + JButton result = new JButton(_("isisfish.common.add.short"), icon); + result.setToolTipText(_("isisfish.result.add")); + result.addMouseListener(new MouseAdapter(){ + public void mouseClicked(MouseEvent e){ + on_ajoutRendu_clicked(); + } + }); + + __ajoutRendu__ = result; + } + return __ajoutRendu__; + } + + private JScrollPane __scroll__ = null; + public JScrollPane getScroll(){ + if(__scroll__ == null){ + Vector childs = getScrollChilds(); + Component child = null; + if(childs.size() >= 1) + child = (Component)childs.get(0); + + JScrollPane result; + if(child instanceof JViewport){ + result = new JScrollPane(); + result.setViewport((JViewport)child); + } + else + result = new JScrollPane(child); + result.setToolTipText(_("isisfish.result.scroll")); + + __scroll__ = result; + } + return __scroll__; + } + + public Vector getScrollChilds(){ + Vector<Object> result = new Vector<Object>(); + result.add(getInfoPanel()); + return result; + } + + private JPanel __infoPanel__ = null; + public JPanel getInfoPanel(){ + if(__infoPanel__ == null){ + Vector childs = getInfoPanelChilds(); + GridBagConstraints [] cs; + cs = new GridBagConstraints[childs.size()]; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.result.infoPanel")); + + __infoPanel__ = result; + } + return __infoPanel__; + } + + public Vector getInfoPanelChilds(){ + Vector<Object> result; + result = new Vector<Object>(); + return result; + } + + private JComboBox __resultat__ = null; + public JComboBox getResultat(){ + if(__resultat__ == null){ + JComboBox result = new JComboBox(); + result.setEditable(true); + result.setToolTipText(_("isisfish.result.resultat")); + result.addItemListener(new ItemListener(){ + public void itemStateChanged(ItemEvent e){ + on_resultat_selection_notify_event(e); + } + }); + + __resultat__ = result; + } + return __resultat__; + } + + private JPanel __table25__ = null; + public JPanel getTable25(){ + if(__table25__ == null){ + Vector childs = getTable25Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 1; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.HORIZONTAL; + cs[1] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.result.table")); + + __table25__ = result; + } + return __table25__; + } + + public Vector getTable25Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getViewPanel()); + result.add(getTable26()); + return result; + } + + private javax.swing.JPanel __viewPanel__ = null; + public javax.swing.JPanel getViewPanel(){ + if(__viewPanel__ == null){ + javax.swing.JPanel result = new javax.swing.JPanel(); + result.setToolTipText(_("isisfish.result.viewPanel")); + + __viewPanel__ = result; + } + return __viewPanel__; + } + + private JPanel __table26__ = null; + public JPanel getTable26(){ + if(__table26__ == null){ + Vector childs = getTable26Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 1; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[1] = c; + + c = new GridBagConstraints(); + c.gridx = 2; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[2] = c; + + c = new GridBagConstraints(); + c.gridx = 3; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.NONE; + cs[3] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.result.table")); + + __table26__ = result; + } + return __table26__; + } + + public Vector getTable26Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getGraphRadioButton()); + result.add(getMapRadioButton()); + result.add(getDonneeRadioButton()); + result.add(getResumeRadioButton()); + return result; + } + + private JRadioButton __graphRadioButton__ = null; + public JRadioButton getGraphRadioButton(){ + if(__graphRadioButton__ == null){ + JRadioButton result = new JRadioButton(_("isisfish.result.graph"), false); + result.setToolTipText(_("isisfish.result.graphRadioButton")); + result.addChangeListener(new ChangeListener(){ + public void stateChanged(ChangeEvent e){ + on_graphRadioButton_toggled(e); + } + }); + + __graphRadioButton__ = result; + } + return __graphRadioButton__; + } + + private JRadioButton __mapRadioButton__ = null; + public JRadioButton getMapRadioButton(){ + if(__mapRadioButton__ == null){ + JRadioButton result = new JRadioButton(_("isisfish.result.map"), false); + result.setToolTipText(_("isisfish.result.mapRadioButton")); + result.addChangeListener(new ChangeListener(){ + public void stateChanged(ChangeEvent e){ + on_mapRadioButton_toggled(e); + } + }); + + __mapRadioButton__ = result; + } + return __mapRadioButton__; + } + + private JRadioButton __donneeRadioButton__ = null; + public JRadioButton getDonneeRadioButton(){ + if(__donneeRadioButton__ == null){ + JRadioButton result = new JRadioButton(_("isisfish.result.datas"), false); + result.setToolTipText(_("isisfish.result.datasRadioButton")); + result.addChangeListener(new ChangeListener(){ + public void stateChanged(ChangeEvent e){ + on_donneeRadioButton_toggled(e); + } + }); + + __donneeRadioButton__ = result; + } + return __donneeRadioButton__; + } + + private JRadioButton __resumeRadioButton__ = null; + public JRadioButton getResumeRadioButton(){ + if(__resumeRadioButton__ == null){ + JRadioButton result = new JRadioButton(_("isisfish.result.summary"), false); + result.setToolTipText(_("isisfish.result.summaryRadioButton")); + result.addChangeListener(new ChangeListener(){ + public void stateChanged(ChangeEvent e){ + on_resumeRadioButton_toggled(e); + } + }); + + __resumeRadioButton__ = result; + } + return __resumeRadioButton__; + } + + + +} Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,205 +0,0 @@ -<!-- -/* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * IsisFish.java - * - * Created: 1 aout 2005 18:37:25 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * @version $Revision: 1312 $ - * - * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ - * by : $Author: sletellier $ - */ - --> -<JInternalFrame title='{getFrameName()}' size='{new Dimension(800,600)}' resizable="true" location='{new Point(0,23)}' layout='{new BorderLayout()}'> - <script> - <![CDATA[ - public ResultEditUI (ResultAction action){ - delegateContext = new jaxx.runtime.DefaultJAXXContext(this); - setContextValue(action); - } - protected String getFrameName(){ - return getContextValue(ResultAction.class).getSimulationStorage().getName(); - } - protected void resultatChanged(){ - } - protected void changePanel(String s) { - ((CardLayout) content.getLayout()).show(content, s); - } - ]]> - </script> - <JSplitPane constraints='BorderLayout.CENTER' orientation="HORIZONTAL"> - <JPanel layout='{new BorderLayout()}'> - <JComboBox id='resultat' constraints='BorderLayout.NORTH' onActionPerformed='resultatChanged()'/> -<!-- - JComboBox result = new JComboBox(); - result.setEditable(true); - result.setToolTipText(_("isisfish.result.resultat")); - result.addItemListener(new ItemListener(){ - public void itemStateChanged(ItemEvent e){ - on_resultat_selection_notify_event(e); - } - }); ---> - <JTree constraints='BorderLayout.CENTER'> - - </JTree> - </JPanel> - <JPanel layout='{new BorderLayout()}'> - <JPanel id='content' layout='{new CardLayout()}' constraints='BorderLayout.CENTER'> - <DataResultUI id='dataResult' constraints='new String("dataResult")' constructorParams='getContextValue(ResultAction.class)'/> -<!-- -DataResult -SimpleResultatMapBean -GraphBean -ResumePanel ---> - <SimpleResultatMapBeanUI id='simpleResultatMapBean' constraints='new String("simpleResultatMapBean")' constructorParams='getContextValue(ResultAction.class)'/> - <GraphBeanUI id='graphBean' constraints='new String("graphBean")' constructorParams='getContextValue(ResultAction.class)'/> - <ResumePanelUI id='resumeBean' constraints='new String("resumeBean")' constructorParams='getContextValue(ResultAction.class)'/> - </JPanel> - <Table constraints='BorderLayout.SOUTH'> - <row> - <cell fill='horizontal' weightx='0.2'> - <JRadioButton id='graphRadioButton' text='isisfish.result.graph' buttonGroup='radioGroup' onActionPerformed='changePanel("graphBean")'/> - </cell> - <cell fill='horizontal' weightx='0.2'> - <JRadioButton id='mapRadioButton' text='isisfish.result.map' buttonGroup='radioGroup' onActionPerformed='changePanel("simpleResultatMapBean")'/> - </cell> - <cell fill='horizontal' weightx='0.2'> - <JRadioButton id='donneeRadioButton' text='isisfish.result.datas' buttonGroup='radioGroup' onActionPerformed='changePanel("dataResult")'/> - </cell> - <cell fill='horizontal' weightx='0.2'> - <JRadioButton id='resumeRadioButton' text='isisfish.result.summary' buttonGroup='radioGroup' onActionPerformed='changePanel("resumeBean")'/> - </cell> -<!-- - - - - <item value='{progressBarDemo}'/> - </JTree> - </JScrollPane> - - <java.awt.CardLayout id='cardLayout'/> - - <JPanel id='preview' layout='{cardLayout}'> - - - - - private JRadioButton __graphRadioButton__ = null; - public JRadioButton getGraphRadioButton(){ - if(__graphRadioButton__ == null){ - JRadioButton result = new JRadioButton(_("isisfish.result.graph"), false); - result.setToolTipText(_("isisfish.result.graphRadioButton")); - result.addChangeListener(new ChangeListener(){ - public void stateChanged(ChangeEvent e){ - on_graphRadioButton_toggled(e); - } - }); - - __graphRadioButton__ = result; - } - return __graphRadioButton__; - } - - private JRadioButton __mapRadioButton__ = null; - public JRadioButton getMapRadioButton(){ - if(__mapRadioButton__ == null){ - JRadioButton result = new JRadioButton(_("isisfish.result.map"), false); - result.setToolTipText(_("isisfish.result.mapRadioButton")); - result.addChangeListener(new ChangeListener(){ - public void stateChanged(ChangeEvent e){ - on_mapRadioButton_toggled(e); - } - }); - - __mapRadioButton__ = result; - } - return __mapRadioButton__; - } - - private JRadioButton __donneeRadioButton__ = null; - public JRadioButton getDonneeRadioButton(){ - if(__donneeRadioButton__ == null){ - JRadioButton result = new JRadioButton(_("isisfish.result.datas"), false); - result.setToolTipText(_("isisfish.result.datasRadioButton")); - result.addChangeListener(new ChangeListener(){ - public void stateChanged(ChangeEvent e){ - on_donneeRadioButton_toggled(e); - } - }); - - __donneeRadioButton__ = result; - } - return __donneeRadioButton__; - } - - private JRadioButton __resumeRadioButton__ = null; - public JRadioButton getResumeRadioButton(){ - if(__resumeRadioButton__ == null){ - JRadioButton result = new JRadioButton(_("isisfish.result.summary"), false); - result.setToolTipText(_("isisfish.result.summaryRadioButton")); - result.addChangeListener(new ChangeListener(){ - public void stateChanged(ChangeEvent e){ - on_resumeRadioButton_toggled(e); - } - }); - - __resumeRadioButton__ = result; - } - return __resumeRadioButton__; - } - ---> - </row> - </Table> - </JPanel> - </JSplitPane> - <JPanel constraints='BorderLayout.SOUTH' layout='{new BorderLayout()}'> - <JLabel id='statusbar' constraints='BorderLayout.WEST'/> -<!-- -public JLabel getStatusbar1(){ - if(__statusbar1__ == null){ - JLabel result = new JLabel(_("isisfish.result.statusBar")); - result.setToolTipText(_("isisfish.result.statusBar")); - - __statusbar1__ = result; - } ---> - - <JPanel constraints='BorderLayout.CENTER'/> - <JButton id='ajoutRendu' constraints='BorderLayout.EAST' text='isisfish.common.add.short'/> -<!-- - - ImageIcon icon = null; - - JButton result = new JButton(_("isisfish.common.add.short"), icon); - result.setToolTipText(_("isisfish.result.add")); - result.addMouseListener(new MouseAdapter(){ - public void mouseClicked(MouseEvent e){ - on_ajoutRendu_clicked(); - } - }); ---> - </JPanel> -</JInternalFrame> \ No newline at end of file Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIJAXX.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIJAXX.jaxx (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIJAXX.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,205 @@ +<!-- +/* *##% + * Copyright (C) 2005 + * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * IsisFish.java + * + * Created: 1 aout 2005 18:37:25 CEST + * + * @author Benjamin POUSSIN <poussin at codelutin.com> + * @version $Revision: 1312 $ + * + * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ + * by : $Author: sletellier $ + */ + --> +<JInternalFrame title='{getFrameName()}' size='{new Dimension(800,600)}' resizable="true" location='{new Point(0,23)}' layout='{new BorderLayout()}'> + <script> + <![CDATA[ + public ResultEditUIJAXX (ResultAction action){ + delegateContext = new jaxx.runtime.DefaultJAXXContext(this); + setContextValue(action); + } + protected String getFrameName(){ + return getContextValue(ResultAction.class).getSimulationStorage().getName(); + } + protected void resultatChanged(){ + } + protected void changePanel(String s) { + ((CardLayout) content.getLayout()).show(content, s); + } + ]]> + </script> + <JSplitPane constraints='BorderLayout.CENTER' orientation="HORIZONTAL"> + <JPanel layout='{new BorderLayout()}'> + <JComboBox id='resultat' constraints='BorderLayout.NORTH' onActionPerformed='resultatChanged()'/> +<!-- + JComboBox result = new JComboBox(); + result.setEditable(true); + result.setToolTipText(_("isisfish.result.resultat")); + result.addItemListener(new ItemListener(){ + public void itemStateChanged(ItemEvent e){ + on_resultat_selection_notify_event(e); + } + }); +--> + <JTree constraints='BorderLayout.CENTER'> + + </JTree> + </JPanel> + <JPanel layout='{new BorderLayout()}'> + <JPanel id='content' layout='{new CardLayout()}' constraints='BorderLayout.CENTER'> + <DataResultUIJAXX id='dataResult' constraints='new String("dataResult")' constructorParams='getContextValue(ResultAction.class)'/> +<!-- +DataResult +SimpleResultatMapBean +GraphBean +ResumePanel +--> + <SimpleResultatMapBeanUIJAXX id='simpleResultatMapBean' constraints='new String("simpleResultatMapBean")' constructorParams='getContextValue(ResultAction.class)'/> + <GraphBeanUIJAXX id='graphBean' constraints='new String("graphBean")' constructorParams='getContextValue(ResultAction.class)'/> + <ResumePanelUIJAXX id='resumeBean' constraints='new String("resumeBean")' constructorParams='getContextValue(ResultAction.class)'/> + </JPanel> + <Table constraints='BorderLayout.SOUTH'> + <row> + <cell fill='horizontal' weightx='0.2'> + <JRadioButton id='graphRadioButton' text='isisfish.result.graph' buttonGroup='radioGroup' onActionPerformed='changePanel("graphBean")'/> + </cell> + <cell fill='horizontal' weightx='0.2'> + <JRadioButton id='mapRadioButton' text='isisfish.result.map' buttonGroup='radioGroup' onActionPerformed='changePanel("simpleResultatMapBean")'/> + </cell> + <cell fill='horizontal' weightx='0.2'> + <JRadioButton id='donneeRadioButton' text='isisfish.result.datas' buttonGroup='radioGroup' onActionPerformed='changePanel("dataResult")'/> + </cell> + <cell fill='horizontal' weightx='0.2'> + <JRadioButton id='resumeRadioButton' text='isisfish.result.summary' buttonGroup='radioGroup' onActionPerformed='changePanel("resumeBean")'/> + </cell> +<!-- + + + + <item value='{progressBarDemo}'/> + </JTree> + </JScrollPane> + + <java.awt.CardLayout id='cardLayout'/> + + <JPanel id='preview' layout='{cardLayout}'> + + + + + private JRadioButton __graphRadioButton__ = null; + public JRadioButton getGraphRadioButton(){ + if(__graphRadioButton__ == null){ + JRadioButton result = new JRadioButton(_("isisfish.result.graph"), false); + result.setToolTipText(_("isisfish.result.graphRadioButton")); + result.addChangeListener(new ChangeListener(){ + public void stateChanged(ChangeEvent e){ + on_graphRadioButton_toggled(e); + } + }); + + __graphRadioButton__ = result; + } + return __graphRadioButton__; + } + + private JRadioButton __mapRadioButton__ = null; + public JRadioButton getMapRadioButton(){ + if(__mapRadioButton__ == null){ + JRadioButton result = new JRadioButton(_("isisfish.result.map"), false); + result.setToolTipText(_("isisfish.result.mapRadioButton")); + result.addChangeListener(new ChangeListener(){ + public void stateChanged(ChangeEvent e){ + on_mapRadioButton_toggled(e); + } + }); + + __mapRadioButton__ = result; + } + return __mapRadioButton__; + } + + private JRadioButton __donneeRadioButton__ = null; + public JRadioButton getDonneeRadioButton(){ + if(__donneeRadioButton__ == null){ + JRadioButton result = new JRadioButton(_("isisfish.result.datas"), false); + result.setToolTipText(_("isisfish.result.datasRadioButton")); + result.addChangeListener(new ChangeListener(){ + public void stateChanged(ChangeEvent e){ + on_donneeRadioButton_toggled(e); + } + }); + + __donneeRadioButton__ = result; + } + return __donneeRadioButton__; + } + + private JRadioButton __resumeRadioButton__ = null; + public JRadioButton getResumeRadioButton(){ + if(__resumeRadioButton__ == null){ + JRadioButton result = new JRadioButton(_("isisfish.result.summary"), false); + result.setToolTipText(_("isisfish.result.summaryRadioButton")); + result.addChangeListener(new ChangeListener(){ + public void stateChanged(ChangeEvent e){ + on_resumeRadioButton_toggled(e); + } + }); + + __resumeRadioButton__ = result; + } + return __resumeRadioButton__; + } + +--> + </row> + </Table> + </JPanel> + </JSplitPane> + <JPanel constraints='BorderLayout.SOUTH' layout='{new BorderLayout()}'> + <JLabel id='statusbar' constraints='BorderLayout.WEST'/> +<!-- +public JLabel getStatusbar1(){ + if(__statusbar1__ == null){ + JLabel result = new JLabel(_("isisfish.result.statusBar")); + result.setToolTipText(_("isisfish.result.statusBar")); + + __statusbar1__ = result; + } +--> + + <JPanel constraints='BorderLayout.CENTER'/> + <JButton id='ajoutRendu' constraints='BorderLayout.EAST' text='isisfish.common.add.short'/> +<!-- + + ImageIcon icon = null; + + JButton result = new JButton(_("isisfish.common.add.short"), icon); + result.setToolTipText(_("isisfish.result.add")); + result.addMouseListener(new MouseAdapter(){ + public void mouseClicked(MouseEvent e){ + on_ajoutRendu_clicked(); + } + }); +--> + </JPanel> +</JInternalFrame> \ No newline at end of file Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIold.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIold.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIold.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,702 +0,0 @@ -/** - * ResultEdit - * - * Generated: Thu Jul 27 22:04:42 CEST 2006 - * By GGen Copyright Code Lutin - * http://www.codelutin.com - * - */ - -package fr.ifremer.isisfish.ui.result; - -import static org.codelutin.i18n.I18nf._; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Toolkit; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.HashMap; -import java.util.Vector; - -import javax.swing.AbstractButton; -import javax.swing.Box; -import javax.swing.ButtonGroup; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JSeparator; -import javax.swing.JSplitPane; -import javax.swing.JViewport; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - -public abstract class ResultEditUIold extends JFrame implements ResultEditUICallback{ - - public ResultEditUIold(){ - super(_("isisfish.result.title")); - } - - protected void init(){ - ResultEditUIold result = this; - this.getContentPane().setLayout(new BorderLayout()); - Vector childs = getResultatEditChilds(); - if(childs.size() >= 1) - result.getContentPane().add((Component)childs.get(0), - BorderLayout.CENTER); - - this.setJMenuBar(getMenubar2()); - this.pack(); - - } - - public void center(){ - // Center the screen - Toolkit tk = this.getToolkit(); - Dimension d = this.getSize(); - int x = (tk.getScreenSize().width - d.width) / 2; - int y = (tk.getScreenSize().height - d.height) / 2; - this.setLocation(x, y); - } - - protected HashMap<String,ButtonGroup> hashGroup = null; - /** - * Ajoute un bouton a un groupe - * @param b the button - * @param groupName name fo group - */ - protected void group(AbstractButton b, String groupName){ - if(hashGroup == null) - hashGroup = new HashMap<String,ButtonGroup>(); - ButtonGroup bg = hashGroup.get(groupName); - if(bg == null){ - bg = new ButtonGroup(); - hashGroup.put(groupName, bg); - } - bg.add(b); - } - - public Vector getResultatEditChilds(){ - Vector<Object> result = new Vector<Object>(); - result.add(getVbox2()); - return result; - } - - private Box __vbox2__ = null; - public Box getVbox2(){ - if(__vbox2__ == null){ - Vector childs = getVbox2Childs(); - Box result = Box.createVerticalBox(); - for (Object child : childs) result.add((Component) child); - result.setToolTipText(_("isisfish.result.vbox")); - - __vbox2__ = result; - } - return __vbox2__; - } - - public Vector getVbox2Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable23()); - return result; - } - - private JMenuBar __menubar2__ = null; - public JMenuBar getMenubar2(){ - if(__menubar2__ == null){ - Vector childs = getMenubar2Childs(); - JMenuBar result = new JMenuBar(); - for (Object child : childs) result.add((JMenuItem) child); - result.setToolTipText(_("isisfish.result.menubar")); - - __menubar2__ = result; - } - return __menubar2__; - } - - public Vector getMenubar2Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getMenuExport()); - return result; - } - - private JMenu __menuExport__ = null; - public JMenu getMenuExport(){ - if(__menuExport__ == null){ - Vector childs = getMenuExport_menuChilds(); - JMenu result = new JMenu(_("isisfish.result.export")); - for (Object child : childs) result.add((Component) child); - result.setToolTipText(_("isisfish.result.menuExport")); - - __menuExport__ = result; - } - return __menuExport__; - } - - public Vector getMenuExport_menuChilds(){ - Vector<Object> result = new Vector<Object>(); - result.add(getMenuitem6()); - return result; - } - - private JSeparator __menuitem6__ = null; - public JSeparator getMenuitem6(){ - if(__menuitem6__ == null){ - JSeparator result = new JSeparator(); - result.setToolTipText(_("isisfish.result.menuitem")); - - __menuitem6__ = result; - } - return __menuitem6__; - } - - private JPanel __table23__ = null; - public JPanel getTable23(){ - if(__table23__ == null){ - Vector childs = getTable23Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 1; - c.weightx = 0; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.HORIZONTAL; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[1] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.result.table")); - - __table23__ = result; - } - return __table23__; - } - - public Vector getTable23Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable22()); - result.add(getHpaned2()); - return result; - } - - private JPanel __table22__ = null; - public JPanel getTable22(){ - if(__table22__ == null){ - Vector childs = getTable22Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 1; - c.gridy = 0; - c.weightx = 0; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.HORIZONTAL; - cs[1] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.result.table")); - - __table22__ = result; - } - return __table22__; - } - - public Vector getTable22Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getStatusImage()); - result.add(getStatusbar1()); - return result; - } - - private JButton __statusImage__ = null; - public JButton getStatusImage(){ - if(__statusImage__ == null){ - ImageIcon icon = null; - - JButton result = new JButton(_("isisfish.common.blank"), icon); - result.setToolTipText(_("isisfish.result.statusImage")); - - __statusImage__ = result; - } - return __statusImage__; - } - - private JLabel __statusbar1__ = null; - public JLabel getStatusbar1(){ - if(__statusbar1__ == null){ - JLabel result = new JLabel(_("isisfish.result.statusBar")); - result.setToolTipText(_("isisfish.result.statusBar")); - - __statusbar1__ = result; - } - return __statusbar1__; - } - - private JSplitPane __hpaned2__ = null; - public JSplitPane getHpaned2(){ - if(__hpaned2__ == null){ - Vector childs = getHpaned2Childs(); - Component child1 = null; - Component child2 = null; - if(childs.size() >= 1) - child1 = (Component)childs.get(0); - if(childs.size() >= 2) - child2 = (Component)childs.get(1); - - JSplitPane result = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, - child1, child2); - result.setOneTouchExpandable(true); - result.setDividerSize(10); - - result.setToolTipText(_("isisfish.result.hpaned")); - - __hpaned2__ = result; - } - return __hpaned2__; - } - - public Vector getHpaned2Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable1()); - result.add(getTable25()); - return result; - } - - private JPanel __table1__ = null; - public JPanel getTable1(){ - if(__table1__ == null){ - Vector childs = getTable1Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 1; - c.weightx = 1; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.HORIZONTAL; - cs[1] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.result.table")); - - __table1__ = result; - } - return __table1__; - } - - public Vector getTable1Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable7()); - result.add(getResultat()); - return result; - } - - private JPanel __table7__ = null; - public JPanel getTable7(){ - if(__table7__ == null){ - Vector childs = getTable7Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 1; - c.gridy = 0; - c.weightx = 0; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[1] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.result.table")); - - __table7__ = result; - } - return __table7__; - } - - public Vector getTable7Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable8()); - result.add(getScroll()); - return result; - } - - private JPanel __table8__ = null; - public JPanel getTable8(){ - if(__table8__ == null){ - Vector childs = getTable8Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 0; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[0] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.result.table")); - - __table8__ = result; - } - return __table8__; - } - - public Vector getTable8Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getAjoutRendu()); - return result; - } - - private JButton __ajoutRendu__ = null; - public JButton getAjoutRendu(){ - if(__ajoutRendu__ == null){ - ImageIcon icon = null; - - JButton result = new JButton(_("isisfish.common.add.short"), icon); - result.setToolTipText(_("isisfish.result.add")); - result.addMouseListener(new MouseAdapter(){ - public void mouseClicked(MouseEvent e){ - on_ajoutRendu_clicked(); - } - }); - - __ajoutRendu__ = result; - } - return __ajoutRendu__; - } - - private JScrollPane __scroll__ = null; - public JScrollPane getScroll(){ - if(__scroll__ == null){ - Vector childs = getScrollChilds(); - Component child = null; - if(childs.size() >= 1) - child = (Component)childs.get(0); - - JScrollPane result; - if(child instanceof JViewport){ - result = new JScrollPane(); - result.setViewport((JViewport)child); - } - else - result = new JScrollPane(child); - result.setToolTipText(_("isisfish.result.scroll")); - - __scroll__ = result; - } - return __scroll__; - } - - public Vector getScrollChilds(){ - Vector<Object> result = new Vector<Object>(); - result.add(getInfoPanel()); - return result; - } - - private JPanel __infoPanel__ = null; - public JPanel getInfoPanel(){ - if(__infoPanel__ == null){ - Vector childs = getInfoPanelChilds(); - GridBagConstraints [] cs; - cs = new GridBagConstraints[childs.size()]; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.result.infoPanel")); - - __infoPanel__ = result; - } - return __infoPanel__; - } - - public Vector getInfoPanelChilds(){ - Vector<Object> result; - result = new Vector<Object>(); - return result; - } - - private JComboBox __resultat__ = null; - public JComboBox getResultat(){ - if(__resultat__ == null){ - JComboBox result = new JComboBox(); - result.setEditable(true); - result.setToolTipText(_("isisfish.result.resultat")); - result.addItemListener(new ItemListener(){ - public void itemStateChanged(ItemEvent e){ - on_resultat_selection_notify_event(e); - } - }); - - __resultat__ = result; - } - return __resultat__; - } - - private JPanel __table25__ = null; - public JPanel getTable25(){ - if(__table25__ == null){ - Vector childs = getTable25Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 1; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.HORIZONTAL; - cs[1] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.result.table")); - - __table25__ = result; - } - return __table25__; - } - - public Vector getTable25Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getViewPanel()); - result.add(getTable26()); - return result; - } - - private javax.swing.JPanel __viewPanel__ = null; - public javax.swing.JPanel getViewPanel(){ - if(__viewPanel__ == null){ - javax.swing.JPanel result = new javax.swing.JPanel(); - result.setToolTipText(_("isisfish.result.viewPanel")); - - __viewPanel__ = result; - } - return __viewPanel__; - } - - private JPanel __table26__ = null; - public JPanel getTable26(){ - if(__table26__ == null){ - Vector childs = getTable26Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 1; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[1] = c; - - c = new GridBagConstraints(); - c.gridx = 2; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[2] = c; - - c = new GridBagConstraints(); - c.gridx = 3; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.NONE; - cs[3] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.result.table")); - - __table26__ = result; - } - return __table26__; - } - - public Vector getTable26Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getGraphRadioButton()); - result.add(getMapRadioButton()); - result.add(getDonneeRadioButton()); - result.add(getResumeRadioButton()); - return result; - } - - private JRadioButton __graphRadioButton__ = null; - public JRadioButton getGraphRadioButton(){ - if(__graphRadioButton__ == null){ - JRadioButton result = new JRadioButton(_("isisfish.result.graph"), false); - result.setToolTipText(_("isisfish.result.graphRadioButton")); - result.addChangeListener(new ChangeListener(){ - public void stateChanged(ChangeEvent e){ - on_graphRadioButton_toggled(e); - } - }); - - __graphRadioButton__ = result; - } - return __graphRadioButton__; - } - - private JRadioButton __mapRadioButton__ = null; - public JRadioButton getMapRadioButton(){ - if(__mapRadioButton__ == null){ - JRadioButton result = new JRadioButton(_("isisfish.result.map"), false); - result.setToolTipText(_("isisfish.result.mapRadioButton")); - result.addChangeListener(new ChangeListener(){ - public void stateChanged(ChangeEvent e){ - on_mapRadioButton_toggled(e); - } - }); - - __mapRadioButton__ = result; - } - return __mapRadioButton__; - } - - private JRadioButton __donneeRadioButton__ = null; - public JRadioButton getDonneeRadioButton(){ - if(__donneeRadioButton__ == null){ - JRadioButton result = new JRadioButton(_("isisfish.result.datas"), false); - result.setToolTipText(_("isisfish.result.datasRadioButton")); - result.addChangeListener(new ChangeListener(){ - public void stateChanged(ChangeEvent e){ - on_donneeRadioButton_toggled(e); - } - }); - - __donneeRadioButton__ = result; - } - return __donneeRadioButton__; - } - - private JRadioButton __resumeRadioButton__ = null; - public JRadioButton getResumeRadioButton(){ - if(__resumeRadioButton__ == null){ - JRadioButton result = new JRadioButton(_("isisfish.result.summary"), false); - result.setToolTipText(_("isisfish.result.summaryRadioButton")); - result.addChangeListener(new ChangeListener(){ - public void stateChanged(ChangeEvent e){ - on_resumeRadioButton_toggled(e); - } - }); - - __resumeRadioButton__ = result; - } - return __resumeRadioButton__; - } - - - -} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -53,7 +53,7 @@ // intFrame.setVisible(true); // intFrame.pack(); // intFrame.setSize(new Dimension(800,700)); - desktopPane.add(new ResultEditUI(getContextValue(ResultAction.class))); + desktopPane.add(new ResultEdit(getContextValue(ResultAction.class).getSimulationStorage())); // try{ // intFrame.setSelected(true); // } catch (PropertyVetoException eee) { Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultView.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultView.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultView.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -63,7 +63,7 @@ } public void on_Resultat_destroy_event(){ - dispose(); +// dispose(); } public void on_simulation_selection_notify_event(ItemEvent e){ Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultViewUI.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultViewUI.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultViewUI.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -24,25 +24,29 @@ import java.util.HashMap; import java.util.Vector; -public abstract class ResultViewUI extends JFrame implements ResultViewUICallback{ +public abstract class ResultViewUI extends JPanel implements ResultViewUICallback{ public ResultViewUI(){ - super(_("isisfish.result.title")); +// super(_("isisfish.result.title")); } protected void init(){ ResultViewUI result = this; - this.getContentPane().setLayout(new BorderLayout()); +// this.getContentPane().setLayout(new BorderLayout()); + this.setLayout(new BorderLayout()); Vector childs = getResultatViewChilds(); if(childs.size() >= 1) - result.getContentPane().add((Component)childs.get(0), - BorderLayout.CENTER); +// result.getContentPane().add((Component)childs.get(0), BorderLayout.CENTER); + result.add((Component)childs.get(0), BorderLayout.CENTER); - this.setJMenuBar(getMenubar1()); result.addWindowListener(new WindowAdapter(){ - public void windowClosing(WindowEvent e){ - on_Resultat_destroy_event(); - } - }); +// TODO : MENUS + +// this.add(getMenubar1()); +// result.addWindowListener(new WindowAdapter(){ +// public void windowClosing(WindowEvent e){ +// on_Resultat_destroy_event(); +// } +// }); result.setBounds(10,10,640,480); } Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanel.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanel.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanel.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -10,7 +10,7 @@ * @version */ -public class ResumePanel extends ResumePanelUIOld { +public class ResumePanel extends ResumePanelUI { protected String resume; // protected Vector vmatInfo; Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUI.java (from rev 1593, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIOld.java) =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUI.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUI.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,184 @@ +/** + * ResumePanel + * + * Generated: Thu Jul 27 22:04:44 CEST 2006 + * By GGen Copyright Code Lutin + * http://www.codelutin.com + * + */ + +package fr.ifremer.isisfish.ui.result; + +import static org.codelutin.i18n.I18nf._; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Toolkit; +import java.util.HashMap; +import java.util.Vector; + +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.JViewport; + +public abstract class ResumePanelUI extends JPanel implements ResumePanelUICallback{ + + protected void init(){ + ResumePanelUI result = this; + this.setLayout(new BorderLayout()); + Vector childs = getResumePanelChilds(); + if(childs.size() >= 1) + result.add((Component)childs.get(0), + BorderLayout.CENTER); + + result.setBounds(0,0,0,0); + } + + public void center(){ + // Center the screen + Toolkit tk = this.getToolkit(); + Dimension d = this.getSize(); + int x = (tk.getScreenSize().width - d.width) / 2; + int y = (tk.getScreenSize().height - d.height) / 2; + this.setLocation(x, y); + } + + protected HashMap<String,ButtonGroup> hashGroup = null; + /** + * Ajoute un bouton a un groupe + * @param b the button + * @param groupName name fo group + */ + protected void group(AbstractButton b, String groupName){ + if(hashGroup == null) + hashGroup = new HashMap<String,ButtonGroup>(); + ButtonGroup bg = (ButtonGroup)hashGroup.get(groupName); + if(bg == null){ + bg = new ButtonGroup(); + hashGroup.put(groupName, bg); + } + bg.add(b); + } + + public Vector getResumePanelChilds(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable1()); + return result; + } + + private JPanel __table1__ = null; + public JPanel getTable1(){ + if(__table1__ == null){ + Vector childs = getTable1Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 1; + c.weightx = 2; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[1] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.resume.table")); + + __table1__ = result; + } + return __table1__; + } + + public Vector getTable1Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getScrolledwindow2()); + result.add(getMatriceInfoGrid()); + return result; + } + + private JScrollPane __scrolledwindow2__ = null; + public JScrollPane getScrolledwindow2(){ + if(__scrolledwindow2__ == null){ + Vector childs = getScrolledwindow2Childs(); + Component child = null; + if(childs.size() >= 1) + child = (Component)childs.get(0); + + JScrollPane result; + if(child instanceof JViewport){ + result = new JScrollPane(); + result.setViewport((JViewport)child); + } + else + result = new JScrollPane(child); + result.setToolTipText(_("isisfish.resume.scrolledwindow")); + + __scrolledwindow2__ = result; + } + return __scrolledwindow2__; + } + + public Vector getScrolledwindow2Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getResumeTextArea()); + return result; + } + + private JTextArea __resumeTextArea__ = null; + public JTextArea getResumeTextArea(){ + if(__resumeTextArea__ == null){ + JTextArea result = new JTextArea(_("isisfish.common.blank")); + result.setEditable(false); + result.setToolTipText(_("isisfish.resume.resumeTextArea")); + + __resumeTextArea__ = result; + } + return __resumeTextArea__; + } + + private JPanel __matriceInfoGrid__ = null; + public JPanel getMatriceInfoGrid(){ + if(__matriceInfoGrid__ == null){ + Vector childs = getMatriceInfoGridChilds(); + GridBagConstraints [] cs; + cs = new GridBagConstraints[childs.size()]; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.resume.matrixInfoGrid")); + + __matriceInfoGrid__ = result; + } + return __matriceInfoGrid__; + } + + public Vector getMatriceInfoGridChilds(){ + Vector result; + result = new Vector(); + return result; + } + + + +} Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,45 +0,0 @@ -<!-- -/* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * DataResult.jaxx - * - * Created: 1 aout 2005 18:37:25 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * @version $Revision: 1312 $ - * - * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ - * by : $Author: sletellier $ - */ - --> -<JPanel layout='{new BorderLayout()}'> - <script> - <![CDATA[ - public ResumePanelUI (ResultAction action){ - delegateContext = new jaxx.runtime.DefaultJAXXContext(this); - setContextValue(action); - } - ]]> - </script> - <JScrollPane> - <JTextArea id='resumeTextArea' text='isisfish.common.blank' editable='false'/> - </JScrollPane> -</JPanel> Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIJAXX.jaxx (from rev 1593, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUI.jaxx) =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIJAXX.jaxx (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIJAXX.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,45 @@ +<!-- +/* *##% + * Copyright (C) 2005 + * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * DataResult.jaxx + * + * Created: 1 aout 2005 18:37:25 CEST + * + * @author Benjamin POUSSIN <poussin at codelutin.com> + * @version $Revision: 1312 $ + * + * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ + * by : $Author: sletellier $ + */ + --> +<JPanel layout='{new BorderLayout()}'> + <script> + <![CDATA[ + public ResumePanelUIJAXX (ResultAction action){ + delegateContext = new jaxx.runtime.DefaultJAXXContext(this); + setContextValue(action); + } + ]]> + </script> + <JScrollPane> + <JTextArea id='resumeTextArea' text='isisfish.common.blank' editable='false'/> + </JScrollPane> +</JPanel> Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIJAXX.jaxx ___________________________________________________________________ Name: svn:mergeinfo + Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIOld.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIOld.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIOld.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,184 +0,0 @@ -/** - * ResumePanel - * - * Generated: Thu Jul 27 22:04:44 CEST 2006 - * By GGen Copyright Code Lutin - * http://www.codelutin.com - * - */ - -package fr.ifremer.isisfish.ui.result; - -import static org.codelutin.i18n.I18nf._; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Toolkit; -import java.util.HashMap; -import java.util.Vector; - -import javax.swing.AbstractButton; -import javax.swing.ButtonGroup; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.JViewport; - -public abstract class ResumePanelUIOld extends JPanel implements ResumePanelUICallback{ - - protected void init(){ - ResumePanelUIOld result = this; - this.setLayout(new BorderLayout()); - Vector childs = getResumePanelChilds(); - if(childs.size() >= 1) - result.add((Component)childs.get(0), - BorderLayout.CENTER); - - result.setBounds(0,0,0,0); - } - - public void center(){ - // Center the screen - Toolkit tk = this.getToolkit(); - Dimension d = this.getSize(); - int x = (tk.getScreenSize().width - d.width) / 2; - int y = (tk.getScreenSize().height - d.height) / 2; - this.setLocation(x, y); - } - - protected HashMap<String,ButtonGroup> hashGroup = null; - /** - * Ajoute un bouton a un groupe - * @param b the button - * @param groupName name fo group - */ - protected void group(AbstractButton b, String groupName){ - if(hashGroup == null) - hashGroup = new HashMap<String,ButtonGroup>(); - ButtonGroup bg = (ButtonGroup)hashGroup.get(groupName); - if(bg == null){ - bg = new ButtonGroup(); - hashGroup.put(groupName, bg); - } - bg.add(b); - } - - public Vector getResumePanelChilds(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable1()); - return result; - } - - private JPanel __table1__ = null; - public JPanel getTable1(){ - if(__table1__ == null){ - Vector childs = getTable1Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 1; - c.weightx = 2; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[1] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.resume.table")); - - __table1__ = result; - } - return __table1__; - } - - public Vector getTable1Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getScrolledwindow2()); - result.add(getMatriceInfoGrid()); - return result; - } - - private JScrollPane __scrolledwindow2__ = null; - public JScrollPane getScrolledwindow2(){ - if(__scrolledwindow2__ == null){ - Vector childs = getScrolledwindow2Childs(); - Component child = null; - if(childs.size() >= 1) - child = (Component)childs.get(0); - - JScrollPane result; - if(child instanceof JViewport){ - result = new JScrollPane(); - result.setViewport((JViewport)child); - } - else - result = new JScrollPane(child); - result.setToolTipText(_("isisfish.resume.scrolledwindow")); - - __scrolledwindow2__ = result; - } - return __scrolledwindow2__; - } - - public Vector getScrolledwindow2Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getResumeTextArea()); - return result; - } - - private JTextArea __resumeTextArea__ = null; - public JTextArea getResumeTextArea(){ - if(__resumeTextArea__ == null){ - JTextArea result = new JTextArea(_("isisfish.common.blank")); - result.setEditable(false); - result.setToolTipText(_("isisfish.resume.resumeTextArea")); - - __resumeTextArea__ = result; - } - return __resumeTextArea__; - } - - private JPanel __matriceInfoGrid__ = null; - public JPanel getMatriceInfoGrid(){ - if(__matriceInfoGrid__ == null){ - Vector childs = getMatriceInfoGridChilds(); - GridBagConstraints [] cs; - cs = new GridBagConstraints[childs.size()]; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.resume.matrixInfoGrid")); - - __matriceInfoGrid__ = result; - } - return __matriceInfoGrid__; - } - - public Vector getMatriceInfoGridChilds(){ - Vector result; - result = new Vector(); - return result; - } - - - -} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBean.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBean.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBean.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -18,7 +18,7 @@ * @version */ -public class SimpleResultatMapBean extends SimpleResultatMapBeanUIOld { +public class SimpleResultatMapBean extends SimpleResultatMapBeanUI { public SimpleResultatMapBean (){ super(); init(); Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUI.java (from rev 1593, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIOld.java) =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUI.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUI.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,187 @@ +/** + * SimpleResultatMapBean + * + * Generated: Thu Jul 27 22:04:14 CEST 2006 + * By GGen Copyright Code Lutin + * http://www.codelutin.com + * + */ + +package fr.ifremer.isisfish.ui.result; + +import static org.codelutin.i18n.I18nf._; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Toolkit; +import java.util.HashMap; +import java.util.Vector; + +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; + +public abstract class SimpleResultatMapBeanUI extends JPanel implements SimpleResultatMapBeanUICallback{ + + protected void init(){ + SimpleResultatMapBeanUI result = this; + this.setLayout(new BorderLayout()); + Vector childs = getSimpleResultatMapBeanChilds(); + if(childs.size() >= 1) + result.add((Component)childs.get(0), + BorderLayout.CENTER); + + result.setBounds(0,0,0,0); + } + + public void center(){ + // Center the screen + Toolkit tk = this.getToolkit(); + Dimension d = this.getSize(); + int x = (tk.getScreenSize().width - d.width) / 2; + int y = (tk.getScreenSize().height - d.height) / 2; + this.setLocation(x, y); + } + + protected HashMap<String,ButtonGroup> hashGroup = null; + /** + * Ajoute un bouton a un groupe + * @param b the button + * @param groupName name fo group + */ + protected void group(AbstractButton b, String groupName){ + if(hashGroup == null) + hashGroup = new HashMap<String,ButtonGroup>(); + ButtonGroup bg = hashGroup.get(groupName); + if(bg == null){ + bg = new ButtonGroup(); + hashGroup.put(groupName, bg); + } + bg.add(b); + } + + public Vector getSimpleResultatMapBeanChilds(){ + Vector<Object> result = new Vector<Object>(); + result.add(getTable12()); + return result; + } + + private JPanel __table12__ = null; + public JPanel getTable12(){ + if(__table12__ == null){ + Vector childs = getTable12Childs(); + GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; + GridBagConstraints c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 1; + c.weightx = 1; + c.weighty = 1; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[0] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 2; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[1] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 0; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[2] = c; + + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 3; + c.weightx = 1; + c.weighty = 0; + c.gridwidth = 1; + c.gridheight = 1; + c.fill = GridBagConstraints.BOTH; + cs[3] = c; + + JPanel result = new JPanel(new GridBagLayout()); + for(int i=0; i<childs.size(); i++) + result.add((Component)childs.get(i), cs[i]); + result.setToolTipText(_("isisfish.simpleResult.table")); + + __table12__ = result; + } + return __table12__; + } + + public Vector getTable12Childs(){ + Vector<Object> result = new Vector<Object>(); + result.add(getIsisMapBean()); + result.add(getInformationDelegator()); + result.add(getIsisMapBeanToolBar()); + result.add(getLegendPanel()); + return result; + } + + private fr.ifremer.isisfish.map.IsisMapBean __resultatMap__ = null; + public fr.ifremer.isisfish.map.IsisMapBean getIsisMapBean(){ + if(__resultatMap__ == null){ + fr.ifremer.isisfish.map.IsisMapBean result = new fr.ifremer.isisfish.map.IsisMapBean(); + result.setToolTipText(_("isisfish.simpleResult.resultatMap")); + + __resultatMap__ = result; + } + return __resultatMap__; + } + + private com.bbn.openmap.InformationDelegator __informationDelegator__ = null; + public com.bbn.openmap.InformationDelegator getInformationDelegator(){ + if(__informationDelegator__ == null){ + com.bbn.openmap.InformationDelegator result; + result = new com.bbn.openmap.InformationDelegator(); + __informationDelegator__ = result; + } + return __informationDelegator__; + } + + private com.bbn.openmap.gui.ToolPanel + __resultatMapToolBar__ = null; + public com.bbn.openmap.gui.ToolPanel + getIsisMapBeanToolBar(){ + if(__resultatMapToolBar__ == null){ + com.bbn.openmap.gui.ToolPanel + result = new com.bbn.openmap.gui.ToolPanel +(); + result.setToolTipText(_("isisfish.simpleResult.resultatMapToolBar")); + + __resultatMapToolBar__ = result; + } + return __resultatMapToolBar__; + } + + private LegendPanel __legendPanel__ = null; + public LegendPanel getLegendPanel(){ + if(__legendPanel__ == null){ + LegendPanel result = new LegendPanel(); + result.setToolTipText(_("isisfish.simpleResult.legendPanel")); + + __legendPanel__ = result; + } + return __legendPanel__; + } + + + +} Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,54 +0,0 @@ -<!-- -/* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * DataResult.jaxx - * - * Created: 1 aout 2005 18:37:25 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * @version $Revision: 1312 $ - * - * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ - * by : $Author: sletellier $ - */ - --> -<JPanel id="simpleResultMapBean" layout='{new BorderLayout()}'> - <script> - <![CDATA[ - import fr.ifremer.isisfish.map.IsisMapBean; - import com.bbn.openmap.InformationDelegator; - import com.bbn.openmap.gui.ToolPanel; - init(); - public SimpleResultatMapBeanUI (ResultAction action){ - delegateContext = new jaxx.runtime.DefaultJAXXContext(this); - setContextValue(action); - } - protected void init(){ - simpleResultMapBean.add(new InformationDelegator(), BorderLayout.NORTH); - simpleResultMapBean.add(new IsisMapBean(), BorderLayout.CENTER); - simpleResultMapBean.add(new ToolPanel(), BorderLayout.SOUTH); - } - ]]> - </script> - <!--InformationDelegator constraints='BorderLayout.NORTH'/> - <IsisMapBean constraints='BorderLayout.CENTER'/> - <ToolPanel constraints='BorderLayout.SOUTH'/--> -</JPanel> Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIJAXX.jaxx (from rev 1593, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUI.jaxx) =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIJAXX.jaxx (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIJAXX.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -0,0 +1,54 @@ +<!-- +/* *##% + * Copyright (C) 2005 + * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * DataResult.jaxx + * + * Created: 1 aout 2005 18:37:25 CEST + * + * @author Benjamin POUSSIN <poussin at codelutin.com> + * @version $Revision: 1312 $ + * + * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $ + * by : $Author: sletellier $ + */ + --> +<JPanel id="simpleResultMapBean" layout='{new BorderLayout()}'> + <script> + <![CDATA[ + import fr.ifremer.isisfish.map.IsisMapBean; + import com.bbn.openmap.InformationDelegator; + import com.bbn.openmap.gui.ToolPanel; + init(); + public SimpleResultatMapBeanUIJAXX (ResultAction action){ + delegateContext = new jaxx.runtime.DefaultJAXXContext(this); + setContextValue(action); + } + protected void init(){ + simpleResultMapBean.add(new InformationDelegator(), BorderLayout.NORTH); + simpleResultMapBean.add(new IsisMapBean(), BorderLayout.CENTER); + simpleResultMapBean.add(new ToolPanel(), BorderLayout.SOUTH); + } + ]]> + </script> + <!--InformationDelegator constraints='BorderLayout.NORTH'/> + <IsisMapBean constraints='BorderLayout.CENTER'/> + <ToolPanel constraints='BorderLayout.SOUTH'/--> +</JPanel> Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIJAXX.jaxx ___________________________________________________________________ Name: svn:mergeinfo + Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIOld.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIOld.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIOld.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,187 +0,0 @@ -/** - * SimpleResultatMapBean - * - * Generated: Thu Jul 27 22:04:14 CEST 2006 - * By GGen Copyright Code Lutin - * http://www.codelutin.com - * - */ - -package fr.ifremer.isisfish.ui.result; - -import static org.codelutin.i18n.I18nf._; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Toolkit; -import java.util.HashMap; -import java.util.Vector; - -import javax.swing.AbstractButton; -import javax.swing.ButtonGroup; -import javax.swing.JPanel; - -public abstract class SimpleResultatMapBeanUIOld extends JPanel implements SimpleResultatMapBeanUICallback{ - - protected void init(){ - SimpleResultatMapBeanUIOld result = this; - this.setLayout(new BorderLayout()); - Vector childs = getSimpleResultatMapBeanChilds(); - if(childs.size() >= 1) - result.add((Component)childs.get(0), - BorderLayout.CENTER); - - result.setBounds(0,0,0,0); - } - - public void center(){ - // Center the screen - Toolkit tk = this.getToolkit(); - Dimension d = this.getSize(); - int x = (tk.getScreenSize().width - d.width) / 2; - int y = (tk.getScreenSize().height - d.height) / 2; - this.setLocation(x, y); - } - - protected HashMap<String,ButtonGroup> hashGroup = null; - /** - * Ajoute un bouton a un groupe - * @param b the button - * @param groupName name fo group - */ - protected void group(AbstractButton b, String groupName){ - if(hashGroup == null) - hashGroup = new HashMap<String,ButtonGroup>(); - ButtonGroup bg = hashGroup.get(groupName); - if(bg == null){ - bg = new ButtonGroup(); - hashGroup.put(groupName, bg); - } - bg.add(b); - } - - public Vector getSimpleResultatMapBeanChilds(){ - Vector<Object> result = new Vector<Object>(); - result.add(getTable12()); - return result; - } - - private JPanel __table12__ = null; - public JPanel getTable12(){ - if(__table12__ == null){ - Vector childs = getTable12Childs(); - GridBagConstraints [] cs = new GridBagConstraints[childs.size()]; - GridBagConstraints c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 1; - c.weightx = 1; - c.weighty = 1; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[0] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 2; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[1] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[2] = c; - - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 3; - c.weightx = 1; - c.weighty = 0; - c.gridwidth = 1; - c.gridheight = 1; - c.fill = GridBagConstraints.BOTH; - cs[3] = c; - - JPanel result = new JPanel(new GridBagLayout()); - for(int i=0; i<childs.size(); i++) - result.add((Component)childs.get(i), cs[i]); - result.setToolTipText(_("isisfish.simpleResult.table")); - - __table12__ = result; - } - return __table12__; - } - - public Vector getTable12Childs(){ - Vector<Object> result = new Vector<Object>(); - result.add(getIsisMapBean()); - result.add(getInformationDelegator()); - result.add(getIsisMapBeanToolBar()); - result.add(getLegendPanel()); - return result; - } - - private fr.ifremer.isisfish.map.IsisMapBean __resultatMap__ = null; - public fr.ifremer.isisfish.map.IsisMapBean getIsisMapBean(){ - if(__resultatMap__ == null){ - fr.ifremer.isisfish.map.IsisMapBean result = new fr.ifremer.isisfish.map.IsisMapBean(); - result.setToolTipText(_("isisfish.simpleResult.resultatMap")); - - __resultatMap__ = result; - } - return __resultatMap__; - } - - private com.bbn.openmap.InformationDelegator __informationDelegator__ = null; - public com.bbn.openmap.InformationDelegator getInformationDelegator(){ - if(__informationDelegator__ == null){ - com.bbn.openmap.InformationDelegator result; - result = new com.bbn.openmap.InformationDelegator(); - __informationDelegator__ = result; - } - return __informationDelegator__; - } - - private com.bbn.openmap.gui.ToolPanel - __resultatMapToolBar__ = null; - public com.bbn.openmap.gui.ToolPanel - getIsisMapBeanToolBar(){ - if(__resultatMapToolBar__ == null){ - com.bbn.openmap.gui.ToolPanel - result = new com.bbn.openmap.gui.ToolPanel -(); - result.setToolTipText(_("isisfish.simpleResult.resultatMapToolBar")); - - __resultatMapToolBar__ = result; - } - return __resultatMapToolBar__; - } - - private LegendPanel __legendPanel__ = null; - public LegendPanel getLegendPanel(){ - if(__legendPanel__ == null){ - LegendPanel result = new LegendPanel(); - result.setToolTipText(_("isisfish.simpleResult.legendPanel")); - - __legendPanel__ = result; - } - return __legendPanel__; - } - - - -} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/Action.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/Action.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/Action.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,1150 +1,1150 @@ -/* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * File.java - * - * Created: 18 août 2005 15:07:36 CEST - * - * @author Grégoire DESSARD <dessard at codelutin.com> - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - -package fr.ifremer.isisfish.ui.script; - -import fr.ifremer.isisfish.IsisFish; -import fr.ifremer.isisfish.datastore.AnalysePlanStorage; -import fr.ifremer.isisfish.datastore.CodeSourceStorage; -import fr.ifremer.isisfish.datastore.ExportStorage; -import fr.ifremer.isisfish.datastore.FormuleStorage; -import fr.ifremer.isisfish.datastore.JavaSourceStorage; -import fr.ifremer.isisfish.datastore.RuleStorage; -import fr.ifremer.isisfish.datastore.ScriptStorage; -import fr.ifremer.isisfish.datastore.SimulatorStorage; -import static fr.ifremer.isisfish.equation.Language.JAVA; -import fr.ifremer.isisfish.ui.UIHelper; -import fr.ifremer.isisfish.ui.ScriptActionHelper; -//import fr.ifremer.isisfish.versionning.vcsSvn.SVNMigrateHelper; -//import org.codelutin.vcs.VCSState; -//import org.codelutin.vcs.VCSAction; -//import org.codelutin.vcs.VCSFileState; -//import org.codelutin.vcs.VCSFileStateManager; -//import org.codelutin.vcs.VCSHelper; -//import fr.ifremer.isisfish.versionning.ui.VCSUIHelper; -import org.apache.commons.logging.Log; -import static org.apache.commons.logging.LogFactory.getLog; -import static org.codelutin.i18n.I18nf._; -import org.swixat.databinding.JTreeModel; -import org.swixat.databinding.JTreeNode; -import org.swixat.databinding.TreeNodeWrapper; -import org.swixat.framework.AbstractFrame; -import org.swixat.framework.OutputView; -import org.swixat.model.Context; - -import javax.swing.JOptionPane; -import javax.swing.JTree; -import javax.swing.tree.TreePath; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileFilter; -import java.io.PrintStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.reflect.Method; -import java.text.MessageFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import org.codelutin.util.FileUtil; - -/** - * @author dessard - * @author tchemit - */ -public class Action { - - /** Clef du stockage dans le context de scriptStorage */ - private static final String SCRIPT_STORAGE = "ScriptStorage"; - /** Clef du stockage dans le context de scriptType */ - private static final String SCRIPT_TYPE = "ScriptType"; - /** Clef du stockage dans le log de la derniere action */ - private static final String ACTION_LOG = "ActionLog"; - - private static final String CAN_COMMIT = "canCommit"; - private static final String CAN_UPDATE = "canUpdate"; - private static final String CAN_DIFF = "canDiff"; - private static final String CAN_DELETE= "canDelete"; - - private static final String VCS_STATE = "VCSState"; - public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm"); - - //public static Object opened(Context uiContext, AbstractFrame frame) { - public static Object opened(Context uiContext) { - - // updateVCSContext(uiContext,null,-1); - - // TODO compute if this action is allowed or not, this permit - // to disable some action in ui - uiContext.setData(CAN_COMMIT, false); - uiContext.setData(CAN_UPDATE, false); - uiContext.setData(CAN_DELETE, false); - uiContext.setData(CAN_DIFF, false); - - return null; - } - - public static Object loadScript(Context uiContext, AbstractFrame frame, - JTree tree, String scriptType, String filename) { - log.info("loadScript called [" + scriptType + "/" + filename + "]"); - - int pathCount = tree.getSelectionPath().getPathCount(); - ScriptMapping mapping = guessMapping(tree); - - CodeSourceStorage script = null; - - try { - if (mapping == null || pathCount < 3 || filename == null) { - scriptType = null; - return null; - } - - switch (mapping) { - case EquationModel: - if (pathCount < 4) return null; - TreePath path = tree.getSelectionPath(); - TreeNodeWrapper categoryNode = (TreeNodeWrapper) path.getPathComponent(2); - String category = (String) categoryNode.getUserObject(); - script = FormuleStorage.getFormule(category, filename); - break; - case Rule: - script = RuleStorage.getRule(filename); - break; - case AnalysePlan: - script = AnalysePlanStorage.getAnalysePlan(filename); - break; - case Export: - script = ExportStorage.getExport(filename); - break; - case Script: - script = ScriptStorage.getScript(filename); - break; - case Simulator: - script = SimulatorStorage.getSimulator(filename); - break; - default: - log.fatal("ScriptType unknown: " + scriptType); - } - - //frame.setInfoText(_("isisfish.message.load.finished")); - } catch (Exception eee) { - return returnError(_("isisfish.error.script.load",filename, eee.getMessage()),eee); - - } finally { - //TC We must delete log area content each time we load a new script - //TC and also delete editor view - uiContext.setData(ACTION_LOG, ""); - uiContext.setData(SCRIPT_STORAGE, script); - uiContext.setData(SCRIPT_TYPE, scriptType); - - // FIXME a remettre en place - // updateVCSContext(uiContext,script,script==null?-1:script.getFile().lastModified()); - - frame.refreshView("scriptJedit"); - frame.refreshView("actionLogArea"); - frame.refreshView("buttonBar"); - frame.refreshView("scriptMenuBar"); - } - return null; - } - -// //TODO this method should be call when a evetn occurs in editor to compute -// // TODO new filte state -// public static void updateVCSState(Context uiContext, CodeSourceStorage script,String content) { -// VCSFileState state = (VCSFileState) uiContext.getData(VCS_STATE); -// if (state==null) { -// return; -// } -// //TODO finish it -// log.info("state "+state); +///* *##% +// * Copyright (C) 2005 +// * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin +// * +// * This program is free software; you can redistribute it and/or +// * modify it under the terms of the GNU General Public License +// * as published by the Free Software Foundation; either version 2 +// * of the License, or (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have received a copy of the GNU General Public License +// * along with this program; if not, write to the Free Software +// * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// *##%*/ +// +///* * +// * File.java +// * +// * Created: 18 août 2005 15:07:36 CEST +// * +// * @author Grégoire DESSARD <dessard at codelutin.com> +// * @version $Revision$ +// * +// * Last update: $Date$ +// * by : $Author$ +// */ +// +//package fr.ifremer.isisfish.ui.script; +// +//import fr.ifremer.isisfish.IsisFish; +//import fr.ifremer.isisfish.datastore.AnalysePlanStorage; +//import fr.ifremer.isisfish.datastore.CodeSourceStorage; +//import fr.ifremer.isisfish.datastore.ExportStorage; +//import fr.ifremer.isisfish.datastore.FormuleStorage; +//import fr.ifremer.isisfish.datastore.JavaSourceStorage; +//import fr.ifremer.isisfish.datastore.RuleStorage; +//import fr.ifremer.isisfish.datastore.ScriptStorage; +//import fr.ifremer.isisfish.datastore.SimulatorStorage; +//import static fr.ifremer.isisfish.equation.Language.JAVA; +//import fr.ifremer.isisfish.ui.UIHelper; +////import fr.ifremer.isisfish.ui.ScriptActionHelper; +////import fr.ifremer.isisfish.versionning.vcsSvn.SVNMigrateHelper; +////import org.codelutin.vcs.VCSState; +////import org.codelutin.vcs.VCSAction; +////import org.codelutin.vcs.VCSFileState; +////import org.codelutin.vcs.VCSFileStateManager; +////import org.codelutin.vcs.VCSHelper; +////import fr.ifremer.isisfish.versionning.ui.VCSUIHelper; +//import org.apache.commons.logging.Log; +//import static org.apache.commons.logging.LogFactory.getLog; +//import static org.codelutin.i18n.I18nf._; +////import org.swixat.databinding.JTreeModel; +////import org.swixat.databinding.JTreeNode; +////import org.swixat.databinding.TreeNodeWrapper; +////import org.swixat.framework.AbstractFrame; +////import org.swixat.framework.OutputView; +////import org.swixat.model.Context; +// +//import javax.swing.JOptionPane; +//import javax.swing.JTree; +//import javax.swing.tree.TreePath; +//import java.io.ByteArrayOutputStream; +//import java.io.File; +//import java.io.FileFilter; +//import java.io.PrintStream; +//import java.io.PrintWriter; +//import java.io.StringWriter; +//import java.lang.reflect.Method; +//import java.text.MessageFormat; +//import java.text.SimpleDateFormat; +//import java.util.ArrayList; +//import java.util.Date; +//import java.util.List; +//import org.codelutin.util.FileUtil; +// +///** +// * @author dessard +// * @author tchemit +// */ +//public class Action { +// +// /** Clef du stockage dans le context de scriptStorage */ +// private static final String SCRIPT_STORAGE = "ScriptStorage"; +// /** Clef du stockage dans le context de scriptType */ +// private static final String SCRIPT_TYPE = "ScriptType"; +// /** Clef du stockage dans le log de la derniere action */ +// private static final String ACTION_LOG = "ActionLog"; +// +// private static final String CAN_COMMIT = "canCommit"; +// private static final String CAN_UPDATE = "canUpdate"; +// private static final String CAN_DIFF = "canDiff"; +// private static final String CAN_DELETE= "canDelete"; +// +// private static final String VCS_STATE = "VCSState"; +// public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm"); +// +// //public static Object opened(Context uiContext, AbstractFrame frame) { +// public static Object opened(Context uiContext) { +// +// // updateVCSContext(uiContext,null,-1); +// +// // TODO compute if this action is allowed or not, this permit +// // to disable some action in ui +// uiContext.setData(CAN_COMMIT, false); +// uiContext.setData(CAN_UPDATE, false); +// uiContext.setData(CAN_DELETE, false); +// uiContext.setData(CAN_DIFF, false); +// +// return null; // } - -// private static void updateVCSContext(Context uiContext, CodeSourceStorage script,long oldTilestamp) { -// Boolean canCommit=false; -// Boolean canUpdate=false; -// Boolean canDelete=false; -// Boolean canDiff=false; -// boolean write=false; -// if (script!=null && VCSHelper.isConnected()) { -// write = VCSHelper.hasWriteAccess(); -// VCSFileState state = VCSFileStateManager.getState(oldTilestamp, script.getFile()); -// uiContext.setData(VCS_STATE, state); -// VCSState vcsState = state.getState(); -// canCommit = write && vcsState != VCSState.OUT_OF_DATE && vcsState != VCSState.OUT_OF_DATE_AND_MODIFIED; -// //canCommit = write && vcsState.authorizeAction(VCSAction.COMMIT,VCSAction.ADD); -// canDelete = write && vcsState != VCSState.UNVERSIONNED; -// //canDelete = write && vcsState!= VCSState.UNVERSIONNED && vcsState.authorizeAction(VCSAction.DELETE); -// canUpdate = vcsState != VCSState.UNVERSIONNED && (vcsState == VCSState.OUT_OF_DATE || vcsState != VCSState.OUT_OF_DATE_AND_MODIFIED); -// //canUpdate= vcsState.authorizeAction(VCSAction.UPDATE,VCSAction.OVERWRITE_AND_UPDATE,VCSAction.REVERT); -// canDiff = vcsState.authorizeAction(VCSAction.DIFF); -// log.info(vcsState); -// } -// log.info("can write " + (write)); -// log.info("can commit " + (canCommit)); -// log.info("can update " + (canUpdate)); -// log.info("can delete " + (canDelete)); -// log.info("can diff "+(canDiff)); // +// public static Object loadScript(Context uiContext, AbstractFrame frame, +// JTree tree, String scriptType, String filename) { +// log.info("loadScript called [" + scriptType + "/" + filename + "]"); // -// uiContext.setData(CAN_COMMIT, canCommit); -// uiContext.setData(CAN_UPDATE, canUpdate); -// uiContext.setData(CAN_DELETE, canDelete); -// uiContext.setData(CAN_DIFF, canDiff); -// } - - /** - * Creer un nouveau script, ici un script peut-etre un Script, un Simulator, - * un Export. - * - * @param uiContext TODO - * @param frame TODO - * @param scriptType le type que l'on souhaite Script, Simulator, - * ou Export. - * @param jmodel TODO - * @param tree TODO - * @return TODO - */ - public static Object newScript(Context uiContext, AbstractFrame frame, - JTree tree, JTreeModel jmodel, - String scriptType) { - log.info("newScript called [" + scriptType + "] " + uiContext); - - String filename=null; - Exception e; - try { - filename = JOptionPane.showInputDialog(_("isisfish.message.new.filename")); - - if (filename == null) { - //TC Fix bug when you cancel dialog, filename is null - // just keep action - return null; - } - // Vérifie qu'il n'y pas de caractères spéciaux. Seul les caractre - // de a à z (majuscule ou minuscule) ainsi que les nombres sont - // autorisés. + pour signifier qu'il doit y avoir - // au moins 1 caractère. - String realFilename; - String category; - ScriptMapping mapping = ScriptMapping.valueOf(scriptType); - if (mapping == null) { - e = new RuntimeException("ScriptType unknown: " + scriptType); - return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); - } - - int pos = filename.lastIndexOf('/'); - if (pos != -1) { - if (mapping!= ScriptMapping.EquationModel) { - // interdit pour le moment ? - String message = _("isisfish.error.invalid.file.name", filename); - e = new RuntimeException(message); - return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); - } - // il y a un sous type à traiter - if (pos == filename.length() - 1) { - String message = _("isisfish.error.invalid.file.name", filename); - e = new RuntimeException(message); - return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); - } - realFilename = filename.substring(filename.lastIndexOf('/') + 1); - category = filename.substring(0, filename.lastIndexOf('/')); - } else { - realFilename = filename; - category = ""; - } - if (!realFilename.matches("[A-Z0-9_][a-zA-Z0-9_]*")) { - String message = _("isisfish.error.invalid.file.name", filename); - e = new RuntimeException(message); - return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); - } - //TODO do test on category - CodeSourceStorage script = null; - String template; - TreeNodeWrapper parentNode = null; - - template = mapping.getDefaultContent(); - switch (mapping) { - case EquationModel: - if (!category.isEmpty()) { - // on utilise la category passée dans le nom - parentNode = (TreeNodeWrapper) jmodel.getNode(category); - if (parentNode == null) { - parentNode = (TreeNodeWrapper) jmodel.getNode(scriptType); - JTreeNode jparentNode = parentNode.getWrapped(); - JTreeNode jnode = (JTreeNode) jparentNode.getComponent(0); - jnode.setName(category); - parentNode.addNode(jnode, category); - parentNode = (TreeNodeWrapper) jmodel.getNode(category); - UIHelper.setTreeSelection(tree, jmodel, category); - } - } else { - // on utilise la category dans la navigation - TreePath path = tree.getSelectionPath(); - if (path.getPath().length < 2) { - // fatal error no category found, and was required - String message = _("isisfish.error.invalid.category.name", filename); - e = new RuntimeException(message); - return returnError(_("isisfish.error.script.create", filename, e.getMessage()), e); - } - TreeNodeWrapper categotyNode = (TreeNodeWrapper) path.getPathComponent(2); - parentNode = categotyNode; - category = String.valueOf(categotyNode.getUserObject()); - } - - script = FormuleStorage.createFormule(category, realFilename, JAVA); - break; - case AnalysePlan: - script = AnalysePlanStorage.getAnalysePlan(filename); - break; - case Export: - script = ExportStorage.getExport(filename); - break; - case Rule: - script = RuleStorage.getRule(filename); - break; - case Script: - script = ScriptStorage.getScript(filename); - break; - case Simulator: - script = SimulatorStorage.getSimulator(filename); - break; - default: - log.fatal("ScriptType unknown: " + scriptType); - } - - if (script.exists()) { - // Message d'erreur si le fichier existe en local. - String message = _("isisfish.error.file.already.exists", filename); - e = new RuntimeException(message); - return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); - } - - // add default script content - String content = MessageFormat.format(template, - category.isEmpty() ? "" : '.' + category.replaceAll("\\/", "."), - realFilename, - new Date(), - IsisFish.config.getUserName(), - IsisFish.config.getUserMail()); - script.setContent(content); - // ajout du nouveau script dans l'arbre - if (parentNode == null) { - parentNode = (TreeNodeWrapper) jmodel.getNode(scriptType); - } - if (parentNode != null) { - JTreeNode jparentNode = parentNode.getWrapped(); - JTreeNode jnode = (JTreeNode) jparentNode.getComponent(0); - parentNode.addNode(jnode, script.getName()); - } - // selection du nouveau noeud, ce qui appel la methode load - UIHelper.setTreeSelection(tree, jmodel, script.getName()); - +// int pathCount = tree.getSelectionPath().getPathCount(); +// ScriptMapping mapping = guessMapping(tree); +// +// CodeSourceStorage script = null; +// +// try { +// if (mapping == null || pathCount < 3 || filename == null) { +// scriptType = null; +// return null; +// } +// +// switch (mapping) { +// case EquationModel: +// if (pathCount < 4) return null; +// TreePath path = tree.getSelectionPath(); +// TreeNodeWrapper categoryNode = (TreeNodeWrapper) path.getPathComponent(2); +// String category = (String) categoryNode.getUserObject(); +// script = FormuleStorage.getFormule(category, filename); +// break; +// case Rule: +// script = RuleStorage.getRule(filename); +// break; +// case AnalysePlan: +// script = AnalysePlanStorage.getAnalysePlan(filename); +// break; +// case Export: +// script = ExportStorage.getExport(filename); +// break; +// case Script: +// script = ScriptStorage.getScript(filename); +// break; +// case Simulator: +// script = SimulatorStorage.getSimulator(filename); +// break; +// default: +// log.fatal("ScriptType unknown: " + scriptType); +// } +// +// //frame.setInfoText(_("isisfish.message.load.finished")); +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.load",filename, eee.getMessage()),eee); +// +// } finally { +// //TC We must delete log area content each time we load a new script +// //TC and also delete editor view +// uiContext.setData(ACTION_LOG, ""); // uiContext.setData(SCRIPT_STORAGE, script); // uiContext.setData(SCRIPT_TYPE, scriptType); +// +// // FIXME a remettre en place +// // updateVCSContext(uiContext,script,script==null?-1:script.getFile().lastModified()); +// // frame.refreshView("scriptJedit"); +// frame.refreshView("actionLogArea"); // frame.refreshView("buttonBar"); // frame.refreshView("scriptMenuBar"); - frame.setInfoText(_("isisfish.message.creation.done", script.getName())); - } catch (Exception eee) { - return returnError(_("isisfish.error.script.create",filename, eee.getMessage()),eee); - } - return null; - - } - - - public static Object saveScript(Context uiContext, AbstractFrame frame, - CodeSourceStorage script, String content) { - log.info("saveScript called [" + script.getName() + "] " + uiContext); - try { - script.setContent(content); - frame.setInfoText(_("isisfish.message.save.finished")); - } catch (Exception eee) { - return returnError(_("isisfish.error.script.save", script.getFile(), eee.getMessage()),eee); - } - return null; - } - - public static Object deleteScript(Context uiContext, AbstractFrame frame, - JTree tree, CodeSourceStorage script, - boolean remote) { - log.debug("deleteScript called"); - ScriptMapping mapping = guessMapping(tree); - if (mapping == null) { - return null; - } - try { - int resp = JOptionPane.showConfirmDialog(frame.getRootComponent(),_("isisfish.message.confirm.remove.script" , script.getName())); - //TODO desactive editor - //TODO Review this because after delete fi file saw previously - //TODO modified, it ask if we want to save, and then we have - //TODO again the file in panel but not in tree panel ? - if (resp == JOptionPane.YES_OPTION) { - - script.delete(remote); - if (script.getFile().exists()) { - RuntimeException exception = new RuntimeException("file could not be deleted"); - return returnError(_("isisfish.error.script.delete",script.getFile(), exception.getMessage()), exception); - } - uiContext.setData(SCRIPT_STORAGE, null); - - frame.refreshView(); - frame.setInfoText(_("isisfish.message.delete.finished")); - } else { - frame.setInfoText(_("isisfish.message.delete.canceled")); - } - } catch (Exception eee) { - return returnError(_("isisfish.error.script.delete",script==null?null:script.getFile(), eee.getMessage()),eee); - } - return null; - } - - public static Object commitScript(Context uiContext, AbstractFrame frame, - JTree tree, CodeSourceStorage script, - String content) { - log.debug("commitScript called for " + uiContext); - - ScriptMapping mapping = guessMapping(tree); - if (mapping == null) { - return null; - } - try { - // save script before commit - script.setContent(content); - - String msg = JOptionPane.showInputDialog(_("Indiquez vos modifications")); - -// String msg = VCSUIHelper.getCommitMessage(script.getFile(), true); - if (msg == null) { - frame.setInfoText(_("isisfish.message.commit.cancelled")); - } else { - script.commit(msg); - script.reload(); - frame.refreshView(); - frame.setInfoText(_("isisfish.message.commit.finished")); - } - } catch (Exception eee) { - return returnError(_("isisfish.error.script.commit",script==null?null:script.getFile(), eee.getMessage()),eee); - } - return null; - } - - - //public static Object updateScript(Context uiContext, AbstractFrame frame, - public static Object updateScript(Context uiContext, AbstractFrame frame, - JTree tree, CodeSourceStorage script) { - log.debug("updateScript called for " + uiContext); - - ScriptMapping mapping = guessMapping(tree); - if (mapping == null) { - return null; - } - //TODO Use VCS UI dialog - //TODO Use FileState new mecanism to obtain state - try { - script.update(); - script.reload(); - frame.refreshView(); - frame.setInfoText(_("isisfish.message.update.finished")); - } catch (Exception eee) { - return returnError(_("isisfish.error.script.update",script.getFile(), eee.getMessage()),eee); - } - return null; - } - - public static Object diffScript(Context uiContext, AbstractFrame frame, - JTree tree, CodeSourceStorage script, - String content) { - log.debug("commitScript called"); -// TODO a refaire - throw new UnsupportedOperationException("En reparation"); +// } +// return null; +// } +// +//// //TODO this method should be call when a evetn occurs in editor to compute +//// // TODO new filte state +//// public static void updateVCSState(Context uiContext, CodeSourceStorage script,String content) { +//// VCSFileState state = (VCSFileState) uiContext.getData(VCS_STATE); +//// if (state==null) { +//// return; +//// } +//// //TODO finish it +//// log.info("state "+state); +//// } +// +//// private static void updateVCSContext(Context uiContext, CodeSourceStorage script,long oldTilestamp) { +//// Boolean canCommit=false; +//// Boolean canUpdate=false; +//// Boolean canDelete=false; +//// Boolean canDiff=false; +//// boolean write=false; +//// if (script!=null && VCSHelper.isConnected()) { +//// write = VCSHelper.hasWriteAccess(); +//// VCSFileState state = VCSFileStateManager.getState(oldTilestamp, script.getFile()); +//// uiContext.setData(VCS_STATE, state); +//// VCSState vcsState = state.getState(); +//// canCommit = write && vcsState != VCSState.OUT_OF_DATE && vcsState != VCSState.OUT_OF_DATE_AND_MODIFIED; +//// //canCommit = write && vcsState.authorizeAction(VCSAction.COMMIT,VCSAction.ADD); +//// canDelete = write && vcsState != VCSState.UNVERSIONNED; +//// //canDelete = write && vcsState!= VCSState.UNVERSIONNED && vcsState.authorizeAction(VCSAction.DELETE); +//// canUpdate = vcsState != VCSState.UNVERSIONNED && (vcsState == VCSState.OUT_OF_DATE || vcsState != VCSState.OUT_OF_DATE_AND_MODIFIED); +//// //canUpdate= vcsState.authorizeAction(VCSAction.UPDATE,VCSAction.OVERWRITE_AND_UPDATE,VCSAction.REVERT); +//// canDiff = vcsState.authorizeAction(VCSAction.DIFF); +//// log.info(vcsState); +//// } +//// log.info("can write " + (write)); +//// log.info("can commit " + (canCommit)); +//// log.info("can update " + (canUpdate)); +//// log.info("can delete " + (canDelete)); +//// log.info("can diff "+(canDiff)); +//// +//// +//// uiContext.setData(CAN_COMMIT, canCommit); +//// uiContext.setData(CAN_UPDATE, canUpdate); +//// uiContext.setData(CAN_DELETE, canDelete); +//// uiContext.setData(CAN_DIFF, canDiff); +//// } +// +// /** +// * Creer un nouveau script, ici un script peut-etre un Script, un Simulator, +// * un Export. +// * +// * @param uiContext TODO +// * @param frame TODO +// * @param scriptType le type que l'on souhaite Script, Simulator, +// * ou Export. +// * @param jmodel TODO +// * @param tree TODO +// * @return TODO +// */ +// public static Object newScript(Context uiContext, AbstractFrame frame, +// JTree tree, JTreeModel jmodel, +// String scriptType) { +// log.info("newScript called [" + scriptType + "] " + uiContext); +// +// String filename=null; +// Exception e; +// try { +// filename = JOptionPane.showInputDialog(_("isisfish.message.new.filename")); +// +// if (filename == null) { +// //TC Fix bug when you cancel dialog, filename is null +// // just keep action +// return null; +// } +// // Vérifie qu'il n'y pas de caractères spéciaux. Seul les caractre +// // de a à z (majuscule ou minuscule) ainsi que les nombres sont +// // autorisés. + pour signifier qu'il doit y avoir +// // au moins 1 caractère. +// String realFilename; +// String category; +// ScriptMapping mapping = ScriptMapping.valueOf(scriptType); +// if (mapping == null) { +// e = new RuntimeException("ScriptType unknown: " + scriptType); +// return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); +// } +// +// int pos = filename.lastIndexOf('/'); +// if (pos != -1) { +// if (mapping!= ScriptMapping.EquationModel) { +// // interdit pour le moment ? +// String message = _("isisfish.error.invalid.file.name", filename); +// e = new RuntimeException(message); +// return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); +// } +// // il y a un sous type à traiter +// if (pos == filename.length() - 1) { +// String message = _("isisfish.error.invalid.file.name", filename); +// e = new RuntimeException(message); +// return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); +// } +// realFilename = filename.substring(filename.lastIndexOf('/') + 1); +// category = filename.substring(0, filename.lastIndexOf('/')); +// } else { +// realFilename = filename; +// category = ""; +// } +// if (!realFilename.matches("[A-Z0-9_][a-zA-Z0-9_]*")) { +// String message = _("isisfish.error.invalid.file.name", filename); +// e = new RuntimeException(message); +// return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); +// } +// //TODO do test on category +// CodeSourceStorage script = null; +// String template; +// TreeNodeWrapper parentNode = null; +// +// template = mapping.getDefaultContent(); +// switch (mapping) { +// case EquationModel: +// if (!category.isEmpty()) { +// // on utilise la category passée dans le nom +// parentNode = (TreeNodeWrapper) jmodel.getNode(category); +// if (parentNode == null) { +// parentNode = (TreeNodeWrapper) jmodel.getNode(scriptType); +// JTreeNode jparentNode = parentNode.getWrapped(); +// JTreeNode jnode = (JTreeNode) jparentNode.getComponent(0); +// jnode.setName(category); +// parentNode.addNode(jnode, category); +// parentNode = (TreeNodeWrapper) jmodel.getNode(category); +// UIHelper.setTreeSelection(tree, jmodel, category); +// } +// } else { +// // on utilise la category dans la navigation +// TreePath path = tree.getSelectionPath(); +// if (path.getPath().length < 2) { +// // fatal error no category found, and was required +// String message = _("isisfish.error.invalid.category.name", filename); +// e = new RuntimeException(message); +// return returnError(_("isisfish.error.script.create", filename, e.getMessage()), e); +// } +// TreeNodeWrapper categotyNode = (TreeNodeWrapper) path.getPathComponent(2); +// parentNode = categotyNode; +// category = String.valueOf(categotyNode.getUserObject()); +// } +// +// script = FormuleStorage.createFormule(category, realFilename, JAVA); +// break; +// case AnalysePlan: +// script = AnalysePlanStorage.getAnalysePlan(filename); +// break; +// case Export: +// script = ExportStorage.getExport(filename); +// break; +// case Rule: +// script = RuleStorage.getRule(filename); +// break; +// case Script: +// script = ScriptStorage.getScript(filename); +// break; +// case Simulator: +// script = SimulatorStorage.getSimulator(filename); +// break; +// default: +// log.fatal("ScriptType unknown: " + scriptType); +// } +// +// if (script.exists()) { +// // Message d'erreur si le fichier existe en local. +// String message = _("isisfish.error.file.already.exists", filename); +// e = new RuntimeException(message); +// return returnError(_("isisfish.error.script.create",filename, e.getMessage()),e); +// } +// +// // add default script content +// String content = MessageFormat.format(template, +// category.isEmpty() ? "" : '.' + category.replaceAll("\\/", "."), +// realFilename, +// new Date(), +// IsisFish.config.getUserName(), +// IsisFish.config.getUserMail()); +// script.setContent(content); +// // ajout du nouveau script dans l'arbre +// if (parentNode == null) { +// parentNode = (TreeNodeWrapper) jmodel.getNode(scriptType); +// } +// if (parentNode != null) { +// JTreeNode jparentNode = parentNode.getWrapped(); +// JTreeNode jnode = (JTreeNode) jparentNode.getComponent(0); +// parentNode.addNode(jnode, script.getName()); +// } +// // selection du nouveau noeud, ce qui appel la methode load +// UIHelper.setTreeSelection(tree, jmodel, script.getName()); +// +//// uiContext.setData(SCRIPT_STORAGE, script); +//// uiContext.setData(SCRIPT_TYPE, scriptType); +//// frame.refreshView("scriptJedit"); +//// frame.refreshView("buttonBar"); +//// frame.refreshView("scriptMenuBar"); +// frame.setInfoText(_("isisfish.message.creation.done", script.getName())); +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.create",filename, eee.getMessage()),eee); +// } +// return null; +// +// } +// +// +// public static Object saveScript(Context uiContext, AbstractFrame frame, +// CodeSourceStorage script, String content) { +// log.info("saveScript called [" + script.getName() + "] " + uiContext); +// try { +// script.setContent(content); +// frame.setInfoText(_("isisfish.message.save.finished")); +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.save", script.getFile(), eee.getMessage()),eee); +// } +// return null; +// } +// +// public static Object deleteScript(Context uiContext, AbstractFrame frame, +// JTree tree, CodeSourceStorage script, +// boolean remote) { +// log.debug("deleteScript called"); // ScriptMapping mapping = guessMapping(tree); -// if (mapping == null) return null; +// if (mapping == null) { +// return null; +// } // try { -// long oldTilestamp = script.getFile().lastModified(); +// int resp = JOptionPane.showConfirmDialog(frame.getRootComponent(),_("isisfish.message.confirm.remove.script" , script.getName())); +// //TODO desactive editor +// //TODO Review this because after delete fi file saw previously +// //TODO modified, it ask if we want to save, and then we have +// //TODO again the file in panel but not in tree panel ? +// if (resp == JOptionPane.YES_OPTION) { +// +// script.delete(remote); +// if (script.getFile().exists()) { +// RuntimeException exception = new RuntimeException("file could not be deleted"); +// return returnError(_("isisfish.error.script.delete",script.getFile(), exception.getMessage()), exception); +// } +// uiContext.setData(SCRIPT_STORAGE, null); +// +// frame.refreshView(); +// frame.setInfoText(_("isisfish.message.delete.finished")); +// } else { +// frame.setInfoText(_("isisfish.message.delete.canceled")); +// } +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.delete",script==null?null:script.getFile(), eee.getMessage()),eee); +// } +// return null; +// } +// +// public static Object commitScript(Context uiContext, AbstractFrame frame, +// JTree tree, CodeSourceStorage script, +// String content) { +// log.debug("commitScript called for " + uiContext); +// +// ScriptMapping mapping = guessMapping(tree); +// if (mapping == null) { +// return null; +// } +// try { // // save script before commit // script.setContent(content); // -// String diff; -// VCSFileState state = VCSFileStateManager.getState(oldTilestamp,script.getFile()); -// boolean canDiff = state.getState().authorizeAction(VCSAction.DIFF); -// if (canDiff) { -// diff = script.diff(); +// String msg = JOptionPane.showInputDialog(_("Indiquez vos modifications")); +// +//// String msg = VCSUIHelper.getCommitMessage(script.getFile(), true); +// if (msg == null) { +// frame.setInfoText(_("isisfish.message.commit.cancelled")); // } else { -// diff = _("isisfish.message.no.diff" , script.getFile(),state.getState().libelle() ); +// script.commit(msg); +// script.reload(); +// frame.refreshView(); +// frame.setInfoText(_("isisfish.message.commit.finished")); // } +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.commit",script==null?null:script.getFile(), eee.getMessage()),eee); +// } +// return null; +// } // -// frame.setInfoText(_("isisfish.message.diff.finished" , state.getState().libelle() )); -// uiContext.setData(ACTION_LOG, diff); +// +// //public static Object updateScript(Context uiContext, AbstractFrame frame, +// public static Object updateScript(Context uiContext, AbstractFrame frame, +// JTree tree, CodeSourceStorage script) { +// log.debug("updateScript called for " + uiContext); +// +// ScriptMapping mapping = guessMapping(tree); +// if (mapping == null) { +// return null; +// } +// //TODO Use VCS UI dialog +// //TODO Use FileState new mecanism to obtain state +// try { +// script.update(); +// script.reload(); +// frame.refreshView(); +// frame.setInfoText(_("isisfish.message.update.finished")); +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.update",script.getFile(), eee.getMessage()),eee); +// } +// return null; +// } +// +// public static Object diffScript(Context uiContext, AbstractFrame frame, +// JTree tree, CodeSourceStorage script, +// String content) { +// log.debug("commitScript called"); +//// TODO a refaire +// throw new UnsupportedOperationException("En reparation"); +//// ScriptMapping mapping = guessMapping(tree); +//// if (mapping == null) return null; +//// try { +//// long oldTilestamp = script.getFile().lastModified(); +//// // save script before commit +//// script.setContent(content); +//// +//// String diff; +//// VCSFileState state = VCSFileStateManager.getState(oldTilestamp,script.getFile()); +//// boolean canDiff = state.getState().authorizeAction(VCSAction.DIFF); +//// if (canDiff) { +//// diff = script.diff(); +//// } else { +//// diff = _("isisfish.message.no.diff" , script.getFile(),state.getState().libelle() ); +//// } +//// +//// frame.setInfoText(_("isisfish.message.diff.finished" , state.getState().libelle() )); +//// uiContext.setData(ACTION_LOG, diff); +//// frame.refreshView("actionLogArea"); +//// +//// } catch (Exception eee) { +//// return returnError(_("isisfish.error.script.diff",script==null?null:script.getFile(), eee.getMessage()),eee); +//// } +//// return null; +// } +// +// public static Object checkScript(Context uiContext, AbstractFrame frame, +// JavaSourceStorage script, String content) { +// log.debug("checkScript called"); +// try { +// // save script before commit +// script.setContent(content); +// +// StringWriter result = new StringWriter(); +// PrintWriter out = new PrintWriter(result); +// int compileResult; +// Exception e=null; +// try { +// compileResult = script.compile(false, out); +// } catch (Exception eee) { +// compileResult = -1; +// e=eee; +// } +// if (compileResult != 0) { +// out.flush(); +// uiContext.setData(ACTION_LOG, result.toString()); +// frame.refreshView("actionLogArea"); +// if (e==null) { +// e = new RuntimeException("there is some problem in script"); +// } +// return returnError(_("isisfish.error.script.evaluate",script.getFile(), e.getMessage()), e); +// } +// uiContext.setData(ACTION_LOG, "ok"); // frame.refreshView("actionLogArea"); +// frame.setInfoText(_("isisfish.message.check.finished")); // // } catch (Exception eee) { -// return returnError(_("isisfish.error.script.diff",script==null?null:script.getFile(), eee.getMessage()),eee); +// return returnError(_("isisfish.error.script.check",script.getFile(), eee.getMessage()),eee); // } // return null; - } - - public static Object checkScript(Context uiContext, AbstractFrame frame, - JavaSourceStorage script, String content) { - log.debug("checkScript called"); - try { - // save script before commit - script.setContent(content); - - StringWriter result = new StringWriter(); - PrintWriter out = new PrintWriter(result); - int compileResult; - Exception e=null; - try { - compileResult = script.compile(false, out); - } catch (Exception eee) { - compileResult = -1; - e=eee; - } - if (compileResult != 0) { - out.flush(); - uiContext.setData(ACTION_LOG, result.toString()); - frame.refreshView("actionLogArea"); - if (e==null) { - e = new RuntimeException("there is some problem in script"); - } - return returnError(_("isisfish.error.script.evaluate",script.getFile(), e.getMessage()), e); - } - uiContext.setData(ACTION_LOG, "ok"); - frame.refreshView("actionLogArea"); - frame.setInfoText(_("isisfish.message.check.finished")); - - } catch (Exception eee) { - return returnError(_("isisfish.error.script.check",script.getFile(), eee.getMessage()),eee); - } - return null; - } - - @SuppressWarnings("unchecked") - public static Object evaluateScript(Context uiContext, AbstractFrame frame, - JavaSourceStorage script, String content) { - log.debug("evaluateScript called"); - try { - Object checkResult = checkScript(uiContext, frame, script, content); - if (checkResult != null) { - return checkResult; - } - - ByteArrayOutputStream result = new ByteArrayOutputStream(); - PrintStream out = new PrintStream(result); - PrintStream err = new PrintStream(result); - - PrintStream oldOut = System.out; - PrintStream oldErr = System.err; - - try { - System.setOut(out); - System.setErr(err); - Class clazz = script.getCodeClass(); - Method main = clazz.getMethod("main", String[].class); - //noinspection RedundantArrayCreation - main.invoke(null, new Object[]{new String[]{}}); - } catch (Exception eee) { - return returnError(_("isisfish.error.script.evaluate", script.getFile(), eee.getMessage()), eee); - } finally { - System.setOut(oldOut); - System.setErr(oldErr); - uiContext.setData(ACTION_LOG, result.toString()); - frame.refreshView("actionLogArea"); - } - frame.setInfoText(_("isisfish.message.evaluation.finished")); - } catch (Exception eee) { - return returnError(_("isisfish.error.script.evaluate",script.getFile(), eee.getMessage()),eee); - } - return null; - } - - /** - * Import des scripts - * - * @param uiContext TODO - * @param frame TODO - * @param tree TODO - * @param jmodel TODO - * @param script TODO - * @return null si tout est ok, sinon un Error - */ - public static Object importScript(Context uiContext, AbstractFrame frame,JTree tree,JTreeModel jmodel,CodeSourceStorage script) { - log.debug("importScript " + uiContext + " : " + frame + ":" + tree); - try { - boolean fired = ScriptActionHelper.importScript(null, false, true, frame); - if (!fired) { - frame.setInfoText(_("isisfish.message.import.scripts.file.cancelled")); - return null; - } - frame.setInfoText(_("isisfish.message.import.scripts.file.done")); - frame.refreshView(); - if (script!=null) { - UIHelper.setTreeSelection(tree, jmodel, script.getName()); - } - } catch (Exception eee) { - return returnError(_("isisfish.error.script.import", eee.getMessage()), eee); - } - return null; - } - - public static Object returnError(String s, Exception eee) { - log.error(s,eee); - return new OutputView("Error.xml", "error", s); - } - - - /** - * Exporte le(s) script(s) sélectionnés dans l'arbe. - * <br>L'arbre doit avoir au moins un script de selectionne - * - * @param uiContext swixat context - * @param frame swiaxt frame - * @param tree tree contaings script - * @return <code>null</code> if everything is ok, - * an <code>OutputVie<</code> with an error to display otherwise - */ - public static Object exportScript(Context uiContext, AbstractFrame frame,JTree tree) { - log.debug("exportScript " + uiContext); - TreePath[] selectedPaths = tree.getSelectionPaths(); - if (selectedPaths.length == 0) { - return null; - } - // first step : acquire list of files required - int prefixLength = IsisFish.config.getDatabaseDirectory().getAbsolutePath().length() + 1; - List<String> listFiles = extractFiles(prefixLength, selectedPaths); - if (listFiles.isEmpty()) { - return null; - } - try { - boolean fired = ScriptActionHelper.exportScript(null, listFiles, false, true, frame); - String message; - if (!fired) { - message = _("isisfish.message.export.cancelled"); - } else { - message = _("isisfish.message.export.done"); - } - frame.setInfoText(message); - } catch (Exception eee) { - return returnError(_("isisfish.error.script.export", eee.getMessage()), eee); - } - return null; - } - - protected static ScriptMapping guessMapping(JTree tree) throws IllegalArgumentException { - int pathCount = tree.getSelectionPath().getPathCount(); - - if (pathCount < 2) { - throw new IllegalArgumentException("no mapping found..."); - } - String scriptType = tree.getSelectionPath().getPath()[1].toString(); - return ScriptMapping.valueOf(scriptType); - } - - protected static List<String> extractFiles(int prefixLength,TreePath[] selectedPaths) { - List<String> result = new ArrayList<String>(); - List<File> dirFound = new ArrayList<File>(); - List<File> dirWithFileFound = new ArrayList<File>(); - - for (TreePath selectedPath : selectedPaths) { - - TreeNodeWrapper node = (TreeNodeWrapper) selectedPath.getPathComponent(1); - String moduleDisplayName = String.valueOf(node.getUserObject()); - File file = ScriptMapping.valueOf(moduleDisplayName).getModule(); - int nbPaths = selectedPath.getPathCount(); - if (nbPaths > 2) - for (int i = 2; i < nbPaths; i++) { - node = (TreeNodeWrapper) selectedPath.getPathComponent(i); - String pathName = String.valueOf(node.getUserObject()); - file = new File(file, pathName); - } - if (file.isFile()) { - File parentFile = file.getParentFile(); - if (!dirFound.contains(parentFile)) dirFound.add(parentFile); - dirWithFileFound.add(parentFile); - result.add(file.getAbsolutePath().substring(prefixLength)); - } else { - // mark the file - dirFound.add(file); - } - } - - // keep only user selected directories - dirFound.removeAll(dirWithFileFound); - dirWithFileFound.clear(); - - if (!dirFound.isEmpty()) { - List<File> listF = new ArrayList<File>(); - // there is some directories selected by user - for (File dir : dirFound) { - // take all files and directories in the dir - // (without VCS and data dirs) -// SVNMigrateHelper.grabbFiles(dir, excludeFilter, listF); - - - // getFilteredElements use include file filter, we inverse excludeFilter - FileFilter filter = new FileFilter() { - FileFilter excludeFilter = getSCRIPT_FILE_FILTER(); - public boolean accept(File pathname) { - return !excludeFilter.accept(pathname); - } - }; - listF.addAll(FileUtil.getFilteredElements(dir, filter, true)); - } - for (File file : listF) - result.add(file.getAbsolutePath().substring(prefixLength)); - listF.clear(); - } - dirFound.clear(); - return result; - } - - /** enum to encapsulate a script module */ - enum ScriptMapping { - - Script(ScriptStorage.getScriptDirectory(), - /** - * 0 = package name, - * 1 = class name, - * 2 = current date, - * 3 = author name, - * 4 = author email - */ - "package scripts{0};\n" + - "\n" + - "import org.apache.commons.logging.Log;\n" + - "import org.apache.commons.logging.LogFactory;\n" + - "\n" + - "import fr.ifremer.isisfish.util.Doc;\n" + - "\n" + - "import org.codelutin.math.matrix.*;\n" + - "\n" + - "import fr.ifremer.isisfish.entities.*;\n" + - "\n" + - "/**\n" + - " * {0}.{1}.java\n" + - " *\n" + - " * Created: {2,date, long}\n" + - " *\n" + - " * @author {3} <{4}>\n" + - //" * @version $Revision$\n" + - " *\n" + - //" * Last update: $Date$\n" + - //" * by : $Author$\n" + - " */\n" + - "public class {1} '{'\n" + - "\n" + - " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + - " static private Log log = LogFactory.getLog({1}.class);\n" + - "\n" + - " // add your method here\n" + - "'}'\n"), - - Simulator(SimulatorStorage.getSimulatorDirectory(), - /** - * 0 = package name, - * 1 = class name, - * 2 = current date, - * 3 = author name, - * 4 = author email - */ - "package simulators{0};\n" + - "\n" + - "import org.apache.commons.logging.Log;\n" + - "import org.apache.commons.logging.LogFactory;\n" + - "\n" + - "import org.codelutin.math.matrix.*;\n" + - "\n" + - "import fr.ifremer.isisfish.util.Doc;\n" + - "import fr.ifremer.isisfish.entities.*;\n" + - "import fr.ifremer.isisfish.simulator.Simulator;\n" + - "import fr.ifremer.isisfish.simulator.SimulationContext;\n" + - "\n" + - "/**\n" + - " * {1}.java\n" + - " *\n" + - " * Created: {2,date, long}\n" + - " *\n" + - " * @author {3} <{4}>\n" + - //" * @version $Revision$\n" + - " *\n" + - //" * Last update$\n" + - //" * by : $Author$\n" + - " */\n" + - "public class {1} implements Simulator '{'\n" + - "\n" + - " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + - " static private Log log = LogFactory.getLog({1}.class);\n" + - "\n" + - " public void simulate(SimulationContext context) throws Exception '{'\n" + - " // put your code here\n" + - " '}'\n" + - "\n" + - "'}'\n"), - Export(ExportStorage.getExportDirectory(), - /** - * 0 = package name, - * 1 = class name, - * 2 = current date, - * 3 = author name, - * 4 = author email - */ - "package exports{0};\n" + - "\n" + - "import org.apache.commons.logging.Log;\n" + - "import org.apache.commons.logging.LogFactory;\n" + - "\n" + - "import java.io.Writer;\n" + - "\n" + - - "import static org.codelutin.i18n.I18nf._;\n" + - "import org.codelutin.math.matrix.*;\n" + - "\n" + - "import fr.ifremer.isisfish.util.Doc;\n" + - "import fr.ifremer.isisfish.entities.*;\n" + - "import fr.ifremer.isisfish.export.Export;\n" + - "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" + - "import fr.ifremer.isisfish.datastore.ResultStorage;\n" + - "\n" + - "/**\n" + - " * {1}.java\n" + - " *\n" + - " * Created: {2,date, long}\n" + - " *\n" + - " * @author {3} <{4}>\n" + - //" * @version $Revision$\n" + - " *\n" + - //" * Last update: $Date$\n" + - //" * by : $Author$\n" + - " */\n" + - "public class {1} implements Export '{'\n" + - "\n" + - " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + - " static private Log log = LogFactory.getLog({1}.class);\n" + - "\n" + - " public String [] necessaryResult = '{'\n" + - " // put here all necessary result for this rule\n" + - " // example: \n" + - " // ResultName.MATRIX_BIOMASS,\n" + - " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" + - " '}';\n" + - "\n" + - " public String[] getNecessaryResult() '{'\n" + - " return this.necessaryResult;\n" + - " '}'\n" + - "\n" + - " public String getExportFilename() '{'\n" + - " // remove _(...) if you don''t want translation on filename" + - " return _(\"{0}\");\n" + - " '}'\n" + - "\n" + - " public String getExtensionFilename() '{'\n" + - " return \".csv\";\n" + - " '}'\n" + - "\n" + - " public String getDescription() '{'\n" + - " return _(\"TODO export description\");\n" + - " '}'\n" + - "\n" + - " public void export(SimulationStorage simulation, Writer out) throws Exception '{'\n" + - " // put your code here, and write export with: out.write(\"...\")\n" + - " '}'\n" + - "\n" + - "'}'\n"), - Rule(RuleStorage.getRuleDirectory(), - /** - * 0 = package name, - * 1 = class name, - * 2 = current date, - * 3 = author name, - * 4 = author email, - * 5 = region name - */ - "package rules{0};\n" + - "\n" + - "import static org.codelutin.i18n.I18nf._;\n" + - "\n" + - "import org.apache.commons.logging.Log;\n" + - "import org.apache.commons.logging.LogFactory;\n" + - "\n" + - "import scripts.ResultName;\n" + - "\n" + - "import java.io.Writer;\n" + - "\n" + - "import org.codelutin.math.matrix.*;\n" + - "\n" + - "import fr.ifremer.isisfish.util.Doc;\n" + - "import fr.ifremer.isisfish.simulator.SimulationContext;\n" + - "import fr.ifremer.isisfish.types.Date;\n" + - "import fr.ifremer.isisfish.entities.*;\n" + - "import fr.ifremer.isisfish.rule.AbstractRule;\n" + - "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" + - "import fr.ifremer.isisfish.datastore.ResultStorage;\n" + - "\n" + - "/**\n" + - " * {1}.java\n" + - " *\n" + - " * Created: {2,date, long}\n" + - " *\n" + - " * @author {3} <{4}>\n" + - //" * @version $Revision$\n" + - " *\n" + - //" * Last update: $Date$\n" + - //" * by : $Author$\n" + - " */\n" + - "public class {1} extends AbstractRule '{'\n" + - "\n" + - " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + - " static private Log log = LogFactory.getLog({1}.class);\n" + - "\n" + - " public String [] necessaryResult = '{'\n" + - " // put here all necessary result for this rule\n" + - " // example: \n" + - " // ResultName.MATRIX_BIOMASS,\n" + - " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" + - " '}';\n" + - "\n" + - " public String[] getNecessaryResult() '{'\n" + - " return this.necessaryResult;\n" + - " '}'\n" + - "\n" + - " /**\n" + - " * Permet d''afficher a l''utilisateur une aide sur la regle.\n" + - " * @return L''aide ou la description de la regle\n" + - " */\n" + - " public String getDescription() throws Exception '{'\n" + - " // TODO\n" + - " return _(\"TODO description rule\");\n" + - " '}'\n" + - " \n" + - " /**\n" + - " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n" + - " * des valeurs\n" + - " * @param simulation La simulation pour lequel on utilise cette regle\n" + - " */\n" + - " public void init(SimulationContext context) throws Exception '{'\n" + - " // TODO\n" + - " '}'\n" + - " /**\n" + - " * La condition qui doit etre vrai pour faire les actions\n" + - " * @param simulation La simulation pour lequel on utilise cette regle\n" + - " * @return vrai si on souhaite que les actions soit faites\n" + - " */\n" + - " public boolean condition(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" + - " // TODO\n" + - " return false;\n" + - " '}'\n" + - " \n" + - " /**\n" + - " * Si la condition est vrai alors cette action est executée avant le pas\n" + - " * de temps de la simulation.\n" + - " * @param simulation La simulation pour lequel on utilise cette regle\n" + - " */\n" + - " public void preAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" + - " // TODO\n" + - " '}'\n" + - " \n" + - " /**\n" + - " * Si la condition est vrai alors cette action est executée apres le pas\n" + - " * de temps de la simulation.\n" + - " * @param simulation La simulation pour lequel on utilise cette regle\n" + - " */\n" + - " public void postAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" + - " // TODO\n" + - " '}'\n" + - "\n" + - "'}'\n"), - AnalysePlan(AnalysePlanStorage.getAnalysePlanDirectory(), - /** - * 0 = package name, - * 1 = class name, - * 2 = current date, - * 3 = author name, - * 4 = author email, - * 5 = region name - */ - "package analyseplans{0};\n" + - "\n" + - "import static org.codelutin.i18n.I18nf._;\n" + - "\n" + - "import org.apache.commons.logging.Log;\n" + - "import org.apache.commons.logging.LogFactory;\n" + - "\n" + - "import scripts.ResultName;\n" + - "\n" + - "import java.io.Writer;\n" + - "\n" + - "import org.codelutin.math.matrix.*;\n" + - "import org.codelutin.util.*;\n" + - "import org.codelutin.topia.*;\n" + - "\n" + - "import fr.ifremer.isisfish.util.Doc;\n" + - "import fr.ifremer.isisfish.*;\n" + - "import fr.ifremer.isisfish.simulator.SimulationContext;\n" + - "import fr.ifremer.isisfish.types.Date;\n" + - "import fr.ifremer.isisfish.entities.*;\n" + - "import fr.ifremer.isisfish.simulator.AnalysePlan;\n" + - "import fr.ifremer.isisfish.simulator.AnalysePlanContext;\n" + - "import fr.ifremer.isisfish.simulator.SimulationParameter;\n" + - "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" + - "import fr.ifremer.isisfish.datastore.ResultStorage;\n" + - "\n" + - "/**\n" + - " * {1}.java\n" + - " *\n" + - " * Created: {2,date, long}\n" + - " *\n" + - " * @author {3} <{4}>\n" + - //" * @version $Revision$\n" + - " *\n" + - //" * Last update: $Date$\n" + - //" * by : $Author$\n" + - " */\n" + - "public class {1} implements AnalysePlan '{'\n" + - "\n" + - " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + - " static private Log log = LogFactory.getLog({1}.class);\n" + - "\n" + - " public String [] necessaryResult = '{'\n" + - " // put here all necessary result for this rule\n" + - " // example: \n" + - " // ResultName.MATRIX_BIOMASS,\n" + - " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" + - " '}';\n" + - "\n" + - " public String[] getNecessaryResult() '{'\n" + - " return this.necessaryResult;\n" + - " '}'\n" + - "\n" + - " /**\n" + - " * Permet d''afficher a l''utilisateur une aide sur le plan.\n" + - " * @return L''aide ou la description du plan\n" + - " */\n" + - " public String getDescription() throws Exception '{'\n" + - " // TODO\n" + - " return _(\"TODO description plan\");\n" + - " '}'\n" + - " \n" + - " /**\n" + - " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n" + - " * des valeurs\n" + - " * @param simulation La simulation pour lequel on utilise cette regle\n" + - " */\n" + - " public void init(AnalysePlanContext context) throws Exception '{'\n" + - " // TODO\n" + - " '}'\n" + - " \n" + - " /**\n" + - " * Call before each simulation\n" + - " * @param context plan context\n" + - " * @param nextSimulation storage used for next simulation\n" + - " * @return true if we must do next simulation, false to stop plan\n" + - " * @throws Exception\n" + - " */\n" + - " public boolean next(AnalysePlanContext context, SimulationStorage nextSimulation) throws Exception '{'\n" + - " return false; // TODO\n" + - " '}'\n" + - "\n" + - "'}'\n"), - EquationModel(FormuleStorage.getFormuleDirectory(), - /** - * 0 = package name, - * 1 = class name, - * 2 = current date, - * 3 = author name, - * 4 = author email - */ - "/**\n" + - " * {1}.java\n" + - " *\n" + - " * Created: {2,date, long}\n" + - " *\n" + - " * @author {3} <{4}>\n" + - //" * @version $Revision$\n" + - " *\n" + - //" * Last update: $7 $\n" + - //" * by : $Author$\n" + - //" */\n" + - "\n" + - "// put your code here\n" + - "\n"); - - private File module; - private String defaultContent; - - ScriptMapping(File module, String defaultContent) { - this.module = module; - this.defaultContent = defaultContent; - } - - File getModule() { - return module; - } - - String getDefaultContent() { - return defaultContent; - } - } - - /** @return an array of all script's modules names managed by this screen */ - public static String[] getScriptTypesNames() { - ScriptMapping[] values = ScriptMapping.values(); - String[] result = new String[values.length]; - for (int i = 0; i < result.length; i++) { - result[i] = values[i].name(); - } - return result; - } - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = getLog(Action.class); - - public static FileFilter SCRIPT_FILE_FILTER; - - public static FileFilter getSCRIPT_FILE_FILTER() { - if (SCRIPT_FILE_FILTER == null) { - SCRIPT_FILE_FILTER = new ScriptFileFilter(IsisFish.vcs); - } - return SCRIPT_FILE_FILTER; - } - - public static class ScriptFileFilter implements FileFilter { - final FileFilter filter; - - public ScriptFileFilter(FileFilter filter) { - this.filter = filter; - } - - public boolean accept(File dir) { - return !filter.accept(dir) || dir.getName().equals("data"); - } - } -} +// } +// +// @SuppressWarnings("unchecked") +// public static Object evaluateScript(Context uiContext, AbstractFrame frame, +// JavaSourceStorage script, String content) { +// log.debug("evaluateScript called"); +// try { +// Object checkResult = checkScript(uiContext, frame, script, content); +// if (checkResult != null) { +// return checkResult; +// } +// +// ByteArrayOutputStream result = new ByteArrayOutputStream(); +// PrintStream out = new PrintStream(result); +// PrintStream err = new PrintStream(result); +// +// PrintStream oldOut = System.out; +// PrintStream oldErr = System.err; +// +// try { +// System.setOut(out); +// System.setErr(err); +// Class clazz = script.getCodeClass(); +// Method main = clazz.getMethod("main", String[].class); +// //noinspection RedundantArrayCreation +// main.invoke(null, new Object[]{new String[]{}}); +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.evaluate", script.getFile(), eee.getMessage()), eee); +// } finally { +// System.setOut(oldOut); +// System.setErr(oldErr); +// uiContext.setData(ACTION_LOG, result.toString()); +// frame.refreshView("actionLogArea"); +// } +// frame.setInfoText(_("isisfish.message.evaluation.finished")); +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.evaluate",script.getFile(), eee.getMessage()),eee); +// } +// return null; +// } +// +// /** +// * Import des scripts +// * +// * @param uiContext TODO +// * @param frame TODO +// * @param tree TODO +// * @param jmodel TODO +// * @param script TODO +// * @return null si tout est ok, sinon un Error +// */ +// public static Object importScript(Context uiContext, AbstractFrame frame,JTree tree,JTreeModel jmodel,CodeSourceStorage script) { +// log.debug("importScript " + uiContext + " : " + frame + ":" + tree); +// try { +// boolean fired = ScriptActionHelper.importScript(null, false, true, frame); +// if (!fired) { +// frame.setInfoText(_("isisfish.message.import.scripts.file.cancelled")); +// return null; +// } +// frame.setInfoText(_("isisfish.message.import.scripts.file.done")); +// frame.refreshView(); +// if (script!=null) { +// UIHelper.setTreeSelection(tree, jmodel, script.getName()); +// } +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.import", eee.getMessage()), eee); +// } +// return null; +// } +// +// public static Object returnError(String s, Exception eee) { +// log.error(s,eee); +// return new OutputView("Error.xml", "error", s); +// } +// +// +// /** +// * Exporte le(s) script(s) sélectionnés dans l'arbe. +// * <br>L'arbre doit avoir au moins un script de selectionne +// * +// * @param uiContext swixat context +// * @param frame swiaxt frame +// * @param tree tree contaings script +// * @return <code>null</code> if everything is ok, +// * an <code>OutputVie<</code> with an error to display otherwise +// */ +// public static Object exportScript(Context uiContext, AbstractFrame frame,JTree tree) { +// log.debug("exportScript " + uiContext); +// TreePath[] selectedPaths = tree.getSelectionPaths(); +// if (selectedPaths.length == 0) { +// return null; +// } +// // first step : acquire list of files required +// int prefixLength = IsisFish.config.getDatabaseDirectory().getAbsolutePath().length() + 1; +// List<String> listFiles = extractFiles(prefixLength, selectedPaths); +// if (listFiles.isEmpty()) { +// return null; +// } +// try { +// boolean fired = ScriptActionHelper.exportScript(null, listFiles, false, true, frame); +// String message; +// if (!fired) { +// message = _("isisfish.message.export.cancelled"); +// } else { +// message = _("isisfish.message.export.done"); +// } +// frame.setInfoText(message); +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.export", eee.getMessage()), eee); +// } +// return null; +// } +// +// protected static ScriptMapping guessMapping(JTree tree) throws IllegalArgumentException { +// int pathCount = tree.getSelectionPath().getPathCount(); +// +// if (pathCount < 2) { +// throw new IllegalArgumentException("no mapping found..."); +// } +// String scriptType = tree.getSelectionPath().getPath()[1].toString(); +// return ScriptMapping.valueOf(scriptType); +// } +// +// protected static List<String> extractFiles(int prefixLength,TreePath[] selectedPaths) { +// List<String> result = new ArrayList<String>(); +// List<File> dirFound = new ArrayList<File>(); +// List<File> dirWithFileFound = new ArrayList<File>(); +// +// for (TreePath selectedPath : selectedPaths) { +// +// TreeNodeWrapper node = (TreeNodeWrapper) selectedPath.getPathComponent(1); +// String moduleDisplayName = String.valueOf(node.getUserObject()); +// File file = ScriptMapping.valueOf(moduleDisplayName).getModule(); +// int nbPaths = selectedPath.getPathCount(); +// if (nbPaths > 2) +// for (int i = 2; i < nbPaths; i++) { +// node = (TreeNodeWrapper) selectedPath.getPathComponent(i); +// String pathName = String.valueOf(node.getUserObject()); +// file = new File(file, pathName); +// } +// if (file.isFile()) { +// File parentFile = file.getParentFile(); +// if (!dirFound.contains(parentFile)) dirFound.add(parentFile); +// dirWithFileFound.add(parentFile); +// result.add(file.getAbsolutePath().substring(prefixLength)); +// } else { +// // mark the file +// dirFound.add(file); +// } +// } +// +// // keep only user selected directories +// dirFound.removeAll(dirWithFileFound); +// dirWithFileFound.clear(); +// +// if (!dirFound.isEmpty()) { +// List<File> listF = new ArrayList<File>(); +// // there is some directories selected by user +// for (File dir : dirFound) { +// // take all files and directories in the dir +// // (without VCS and data dirs) +//// SVNMigrateHelper.grabbFiles(dir, excludeFilter, listF); +// +// +// // getFilteredElements use include file filter, we inverse excludeFilter +// FileFilter filter = new FileFilter() { +// FileFilter excludeFilter = getSCRIPT_FILE_FILTER(); +// public boolean accept(File pathname) { +// return !excludeFilter.accept(pathname); +// } +// }; +// listF.addAll(FileUtil.getFilteredElements(dir, filter, true)); +// } +// for (File file : listF) +// result.add(file.getAbsolutePath().substring(prefixLength)); +// listF.clear(); +// } +// dirFound.clear(); +// return result; +// } +// +// /** enum to encapsulate a script module */ +// enum ScriptMapping { +// +// Script(ScriptStorage.getScriptDirectory(), +// /** +// * 0 = package name, +// * 1 = class name, +// * 2 = current date, +// * 3 = author name, +// * 4 = author email +// */ +// "package scripts{0};\n" + +// "\n" + +// "import org.apache.commons.logging.Log;\n" + +// "import org.apache.commons.logging.LogFactory;\n" + +// "\n" + +// "import fr.ifremer.isisfish.util.Doc;\n" + +// "\n" + +// "import org.codelutin.math.matrix.*;\n" + +// "\n" + +// "import fr.ifremer.isisfish.entities.*;\n" + +// "\n" + +// "/**\n" + +// " * {0}.{1}.java\n" + +// " *\n" + +// " * Created: {2,date, long}\n" + +// " *\n" + +// " * @author {3} <{4}>\n" + +// //" * @version $Revision$\n" + +// " *\n" + +// //" * Last update: $Date$\n" + +// //" * by : $Author$\n" + +// " */\n" + +// "public class {1} '{'\n" + +// "\n" + +// " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + +// " static private Log log = LogFactory.getLog({1}.class);\n" + +// "\n" + +// " // add your method here\n" + +// "'}'\n"), +// +// Simulator(SimulatorStorage.getSimulatorDirectory(), +// /** +// * 0 = package name, +// * 1 = class name, +// * 2 = current date, +// * 3 = author name, +// * 4 = author email +// */ +// "package simulators{0};\n" + +// "\n" + +// "import org.apache.commons.logging.Log;\n" + +// "import org.apache.commons.logging.LogFactory;\n" + +// "\n" + +// "import org.codelutin.math.matrix.*;\n" + +// "\n" + +// "import fr.ifremer.isisfish.util.Doc;\n" + +// "import fr.ifremer.isisfish.entities.*;\n" + +// "import fr.ifremer.isisfish.simulator.Simulator;\n" + +// "import fr.ifremer.isisfish.simulator.SimulationContext;\n" + +// "\n" + +// "/**\n" + +// " * {1}.java\n" + +// " *\n" + +// " * Created: {2,date, long}\n" + +// " *\n" + +// " * @author {3} <{4}>\n" + +// //" * @version $Revision$\n" + +// " *\n" + +// //" * Last update$\n" + +// //" * by : $Author$\n" + +// " */\n" + +// "public class {1} implements Simulator '{'\n" + +// "\n" + +// " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + +// " static private Log log = LogFactory.getLog({1}.class);\n" + +// "\n" + +// " public void simulate(SimulationContext context) throws Exception '{'\n" + +// " // put your code here\n" + +// " '}'\n" + +// "\n" + +// "'}'\n"), +// Export(ExportStorage.getExportDirectory(), +// /** +// * 0 = package name, +// * 1 = class name, +// * 2 = current date, +// * 3 = author name, +// * 4 = author email +// */ +// "package exports{0};\n" + +// "\n" + +// "import org.apache.commons.logging.Log;\n" + +// "import org.apache.commons.logging.LogFactory;\n" + +// "\n" + +// "import java.io.Writer;\n" + +// "\n" + +// +// "import static org.codelutin.i18n.I18nf._;\n" + +// "import org.codelutin.math.matrix.*;\n" + +// "\n" + +// "import fr.ifremer.isisfish.util.Doc;\n" + +// "import fr.ifremer.isisfish.entities.*;\n" + +// "import fr.ifremer.isisfish.export.Export;\n" + +// "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" + +// "import fr.ifremer.isisfish.datastore.ResultStorage;\n" + +// "\n" + +// "/**\n" + +// " * {1}.java\n" + +// " *\n" + +// " * Created: {2,date, long}\n" + +// " *\n" + +// " * @author {3} <{4}>\n" + +// //" * @version $Revision$\n" + +// " *\n" + +// //" * Last update: $Date$\n" + +// //" * by : $Author$\n" + +// " */\n" + +// "public class {1} implements Export '{'\n" + +// "\n" + +// " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + +// " static private Log log = LogFactory.getLog({1}.class);\n" + +// "\n" + +// " public String [] necessaryResult = '{'\n" + +// " // put here all necessary result for this rule\n" + +// " // example: \n" + +// " // ResultName.MATRIX_BIOMASS,\n" + +// " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" + +// " '}';\n" + +// "\n" + +// " public String[] getNecessaryResult() '{'\n" + +// " return this.necessaryResult;\n" + +// " '}'\n" + +// "\n" + +// " public String getExportFilename() '{'\n" + +// " // remove _(...) if you don''t want translation on filename" + +// " return _(\"{0}\");\n" + +// " '}'\n" + +// "\n" + +// " public String getExtensionFilename() '{'\n" + +// " return \".csv\";\n" + +// " '}'\n" + +// "\n" + +// " public String getDescription() '{'\n" + +// " return _(\"TODO export description\");\n" + +// " '}'\n" + +// "\n" + +// " public void export(SimulationStorage simulation, Writer out) throws Exception '{'\n" + +// " // put your code here, and write export with: out.write(\"...\")\n" + +// " '}'\n" + +// "\n" + +// "'}'\n"), +// Rule(RuleStorage.getRuleDirectory(), +// /** +// * 0 = package name, +// * 1 = class name, +// * 2 = current date, +// * 3 = author name, +// * 4 = author email, +// * 5 = region name +// */ +// "package rules{0};\n" + +// "\n" + +// "import static org.codelutin.i18n.I18nf._;\n" + +// "\n" + +// "import org.apache.commons.logging.Log;\n" + +// "import org.apache.commons.logging.LogFactory;\n" + +// "\n" + +// "import scripts.ResultName;\n" + +// "\n" + +// "import java.io.Writer;\n" + +// "\n" + +// "import org.codelutin.math.matrix.*;\n" + +// "\n" + +// "import fr.ifremer.isisfish.util.Doc;\n" + +// "import fr.ifremer.isisfish.simulator.SimulationContext;\n" + +// "import fr.ifremer.isisfish.types.Date;\n" + +// "import fr.ifremer.isisfish.entities.*;\n" + +// "import fr.ifremer.isisfish.rule.AbstractRule;\n" + +// "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" + +// "import fr.ifremer.isisfish.datastore.ResultStorage;\n" + +// "\n" + +// "/**\n" + +// " * {1}.java\n" + +// " *\n" + +// " * Created: {2,date, long}\n" + +// " *\n" + +// " * @author {3} <{4}>\n" + +// //" * @version $Revision$\n" + +// " *\n" + +// //" * Last update: $Date$\n" + +// //" * by : $Author$\n" + +// " */\n" + +// "public class {1} extends AbstractRule '{'\n" + +// "\n" + +// " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + +// " static private Log log = LogFactory.getLog({1}.class);\n" + +// "\n" + +// " public String [] necessaryResult = '{'\n" + +// " // put here all necessary result for this rule\n" + +// " // example: \n" + +// " // ResultName.MATRIX_BIOMASS,\n" + +// " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" + +// " '}';\n" + +// "\n" + +// " public String[] getNecessaryResult() '{'\n" + +// " return this.necessaryResult;\n" + +// " '}'\n" + +// "\n" + +// " /**\n" + +// " * Permet d''afficher a l''utilisateur une aide sur la regle.\n" + +// " * @return L''aide ou la description de la regle\n" + +// " */\n" + +// " public String getDescription() throws Exception '{'\n" + +// " // TODO\n" + +// " return _(\"TODO description rule\");\n" + +// " '}'\n" + +// " \n" + +// " /**\n" + +// " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n" + +// " * des valeurs\n" + +// " * @param simulation La simulation pour lequel on utilise cette regle\n" + +// " */\n" + +// " public void init(SimulationContext context) throws Exception '{'\n" + +// " // TODO\n" + +// " '}'\n" + +// " /**\n" + +// " * La condition qui doit etre vrai pour faire les actions\n" + +// " * @param simulation La simulation pour lequel on utilise cette regle\n" + +// " * @return vrai si on souhaite que les actions soit faites\n" + +// " */\n" + +// " public boolean condition(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" + +// " // TODO\n" + +// " return false;\n" + +// " '}'\n" + +// " \n" + +// " /**\n" + +// " * Si la condition est vrai alors cette action est executée avant le pas\n" + +// " * de temps de la simulation.\n" + +// " * @param simulation La simulation pour lequel on utilise cette regle\n" + +// " */\n" + +// " public void preAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" + +// " // TODO\n" + +// " '}'\n" + +// " \n" + +// " /**\n" + +// " * Si la condition est vrai alors cette action est executée apres le pas\n" + +// " * de temps de la simulation.\n" + +// " * @param simulation La simulation pour lequel on utilise cette regle\n" + +// " */\n" + +// " public void postAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" + +// " // TODO\n" + +// " '}'\n" + +// "\n" + +// "'}'\n"), +// AnalysePlan(AnalysePlanStorage.getAnalysePlanDirectory(), +// /** +// * 0 = package name, +// * 1 = class name, +// * 2 = current date, +// * 3 = author name, +// * 4 = author email, +// * 5 = region name +// */ +// "package analyseplans{0};\n" + +// "\n" + +// "import static org.codelutin.i18n.I18nf._;\n" + +// "\n" + +// "import org.apache.commons.logging.Log;\n" + +// "import org.apache.commons.logging.LogFactory;\n" + +// "\n" + +// "import scripts.ResultName;\n" + +// "\n" + +// "import java.io.Writer;\n" + +// "\n" + +// "import org.codelutin.math.matrix.*;\n" + +// "import org.codelutin.util.*;\n" + +// "import org.codelutin.topia.*;\n" + +// "\n" + +// "import fr.ifremer.isisfish.util.Doc;\n" + +// "import fr.ifremer.isisfish.*;\n" + +// "import fr.ifremer.isisfish.simulator.SimulationContext;\n" + +// "import fr.ifremer.isisfish.types.Date;\n" + +// "import fr.ifremer.isisfish.entities.*;\n" + +// "import fr.ifremer.isisfish.simulator.AnalysePlan;\n" + +// "import fr.ifremer.isisfish.simulator.AnalysePlanContext;\n" + +// "import fr.ifremer.isisfish.simulator.SimulationParameter;\n" + +// "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" + +// "import fr.ifremer.isisfish.datastore.ResultStorage;\n" + +// "\n" + +// "/**\n" + +// " * {1}.java\n" + +// " *\n" + +// " * Created: {2,date, long}\n" + +// " *\n" + +// " * @author {3} <{4}>\n" + +// //" * @version $Revision$\n" + +// " *\n" + +// //" * Last update: $Date$\n" + +// //" * by : $Author$\n" + +// " */\n" + +// "public class {1} implements AnalysePlan '{'\n" + +// "\n" + +// " /** to use log facility, just put in your code: log.info(\"...\"); */\n" + +// " static private Log log = LogFactory.getLog({1}.class);\n" + +// "\n" + +// " public String [] necessaryResult = '{'\n" + +// " // put here all necessary result for this rule\n" + +// " // example: \n" + +// " // ResultName.MATRIX_BIOMASS,\n" + +// " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" + +// " '}';\n" + +// "\n" + +// " public String[] getNecessaryResult() '{'\n" + +// " return this.necessaryResult;\n" + +// " '}'\n" + +// "\n" + +// " /**\n" + +// " * Permet d''afficher a l''utilisateur une aide sur le plan.\n" + +// " * @return L''aide ou la description du plan\n" + +// " */\n" + +// " public String getDescription() throws Exception '{'\n" + +// " // TODO\n" + +// " return _(\"TODO description plan\");\n" + +// " '}'\n" + +// " \n" + +// " /**\n" + +// " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n" + +// " * des valeurs\n" + +// " * @param simulation La simulation pour lequel on utilise cette regle\n" + +// " */\n" + +// " public void init(AnalysePlanContext context) throws Exception '{'\n" + +// " // TODO\n" + +// " '}'\n" + +// " \n" + +// " /**\n" + +// " * Call before each simulation\n" + +// " * @param context plan context\n" + +// " * @param nextSimulation storage used for next simulation\n" + +// " * @return true if we must do next simulation, false to stop plan\n" + +// " * @throws Exception\n" + +// " */\n" + +// " public boolean next(AnalysePlanContext context, SimulationStorage nextSimulation) throws Exception '{'\n" + +// " return false; // TODO\n" + +// " '}'\n" + +// "\n" + +// "'}'\n"), +// EquationModel(FormuleStorage.getFormuleDirectory(), +// /** +// * 0 = package name, +// * 1 = class name, +// * 2 = current date, +// * 3 = author name, +// * 4 = author email +// */ +// "/**\n" + +// " * {1}.java\n" + +// " *\n" + +// " * Created: {2,date, long}\n" + +// " *\n" + +// " * @author {3} <{4}>\n" + +// //" * @version $Revision$\n" + +// " *\n" + +// //" * Last update: $7 $\n" + +// //" * by : $Author$\n" + +// //" */\n" + +// "\n" + +// "// put your code here\n" + +// "\n"); +// +// private File module; +// private String defaultContent; +// +// ScriptMapping(File module, String defaultContent) { +// this.module = module; +// this.defaultContent = defaultContent; +// } +// +// File getModule() { +// return module; +// } +// +// String getDefaultContent() { +// return defaultContent; +// } +// } +// +// /** @return an array of all script's modules names managed by this screen */ +// public static String[] getScriptTypesNames() { +// ScriptMapping[] values = ScriptMapping.values(); +// String[] result = new String[values.length]; +// for (int i = 0; i < result.length; i++) { +// result[i] = values[i].name(); +// } +// return result; +// } +// +// /** to use log facility, just put in your code: log.info(\"...\"); */ +// static private Log log = getLog(Action.class); +// +// public static FileFilter SCRIPT_FILE_FILTER; +// +// public static FileFilter getSCRIPT_FILE_FILTER() { +// if (SCRIPT_FILE_FILTER == null) { +// SCRIPT_FILE_FILTER = new ScriptFileFilter(IsisFish.vcs); +// } +// return SCRIPT_FILE_FILTER; +// } +// +// public static class ScriptFileFilter implements FileFilter { +// final FileFilter filter; +// +// public ScriptFileFilter(FileFilter filter) { +// this.filter = filter; +// } +// +// public boolean accept(File dir) { +// return !filter.accept(dir) || dir.getName().equals("data"); +// } +// } +//} Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -18,8 +18,6 @@ import fr.ifremer.isisfish.datastore.RuleStorage; import fr.ifremer.isisfish.datastore.ScriptStorage; import fr.ifremer.isisfish.datastore.SimulatorStorage; -import fr.ifremer.isisfish.ui.ScriptActionHelper; -import fr.ifremer.isisfish.ui.script.Action.ScriptFileFilter; import fr.ifremer.isisfish.ui.widget.editor.GenericCell; import fr.ifremer.isisfish.vcs.VCSException; import java.io.ByteArrayOutputStream; @@ -45,6 +43,17 @@ import static org.apache.commons.logging.LogFactory.getLog; import static fr.ifremer.isisfish.equation.Language.JAVA; +class ScriptFileFilter implements FileFilter { + final FileFilter filter; + + public ScriptFileFilter(FileFilter filter) { + this.filter = filter; + } + + public boolean accept(File dir) { + return !filter.accept(dir) || dir.getName().equals("data"); + } +} public class ScriptAction { CodeSourceStorage code; /** to use log facility, just put in your code: log.info(\"...\"); */ @@ -53,6 +62,9 @@ public ScriptAction(){ } + public CodeSourceStorage getCode(){ + return code; + } /** @return an array of all script's modules names managed by this screen */ public static String[] getScriptTypesNames() { ScriptMapping[] values = ScriptMapping.values(); @@ -493,6 +505,84 @@ } return msg; } + public String importScript(){ + String msg = null; + log.debug("importScript "); + // TODO : a reimplanter + try { +// boolean fired = fr.ifremer.isisfish.ui.ScriptActionHelper.importScript(null, false, true, frame); +// if (!fired) { + msg = _("isisfish.message.import.scripts.file.cancelled"); +// return null; +// } +// msg = _("isisfish.message.import.scripts.file.done"); +// if (script!=null) { +// UIHelper.setTreeSelection(tree, jmodel, script.getName()); +// } + } catch (Exception eee) { +// return returnError(_("isisfish.error.script.import", eee.getMessage()), eee); + } + return msg; + } + public String deleteScript(int resp, boolean remote) { + String msg = ""; + log.debug("deleteScript called"); + try { + + //TODO desactive editor + //TODO Review this because after delete fi file saw previously + //TODO modified, it ask if we want to save, and then we have + //TODO again the file in panel but not in tree panel ? + if (resp == JOptionPane.YES_OPTION) { + + code.delete(remote); + if (code.getFile().exists()) { + RuntimeException exception = new RuntimeException("file could not be deleted"); +// return returnError(_("isisfish.error.script.delete",code.getFile(), exception.getMessage()), exception); + } +// uiContext.setData(SCRIPT_STORAGE, null); + +// frame.refreshView(); + msg = _("isisfish.message.delete.finished"); + } else { + msg = _("isisfish.message.delete.canceled"); + } + } catch (Exception eee) { +// return returnError(_("isisfish.error.script.delete",script==null?null:script.getFile(), eee.getMessage()),eee); + } + return msg; + } + + public String diffScript(String content) { + log.debug("commitScript called"); +// TODO a refaire + throw new UnsupportedOperationException("En reparation"); +// ScriptMapping mapping = guessMapping(tree); +// if (mapping == null) return null; +// try { +// long oldTilestamp = script.getFile().lastModified(); +// // save script before commit +// script.setContent(content); +// +// String diff; +// VCSFileState state = VCSFileStateManager.getState(oldTilestamp,script.getFile()); +// boolean canDiff = state.getState().authorizeAction(VCSAction.DIFF); +// if (canDiff) { +// diff = script.diff(); +// } else { +// diff = _("isisfish.message.no.diff" , script.getFile(),state.getState().libelle() ); +// } +// +// frame.setInfoText(_("isisfish.message.diff.finished" , state.getState().libelle() )); +// uiContext.setData(ACTION_LOG, diff); +// frame.refreshView("actionLogArea"); +// +// } catch (Exception eee) { +// return returnError(_("isisfish.error.script.diff",script==null?null:script.getFile(), eee.getMessage()),eee); +// } +// return null; + } + /** enum to encapsulate a script module */ enum ScriptMapping { Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2008-11-21 12:42:36 UTC (rev 1613) @@ -45,6 +45,7 @@ import fr.ifremer.isisfish.ui.WelcomePanelUI; setContextValue(new ScriptAction()); + setButton(); tree.addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(TreeSelectionEvent e) { @@ -74,15 +75,14 @@ getContextValue(ScriptAction.class).loadScript(selectedValue, selectedValue.getName(), parent); setEditor(f); } - setButton(); } else { editor.close(); editor.repaint(); } actionLogArea.setText(""); - setButton(); } + setButton(); } }); protected void setTreeModel(){ @@ -142,26 +142,35 @@ boolean fileLoaded = getContextValue(ScriptAction.class).fileLoaded(); boolean isJavaScript = getContextValue(ScriptAction.class).isJavaScript(); buttonScriptExport.setEnabled(tree.getSelectionValue() != null); + miExport.setEnabled(tree.getSelectionValue() != null); // buttonScriptCommit // buttonScriptUpdate buttonScriptSave.setEnabled(fileLoaded); + miSave.setEnabled(fileLoaded); buttonScriptCut.setEnabled(fileLoaded); + miCut.setEnabled(fileLoaded); buttonScriptCopy.setEnabled(fileLoaded); + miCopy.setEnabled(fileLoaded); buttonScriptPaste.setEnabled(fileLoaded); + miPaste.setEnabled(fileLoaded); buttonScriptCheck.setEnabled(isJavaScript); + miCheckSyntax.setEnabled(isJavaScript); buttonScriptEval.setEnabled(isJavaScript); + miEvaluate.setEnabled(isJavaScript); } protected void setInfoText(String msg){ WelcomePanelUI root = getParentContainer(WelcomePanelUI.class); root.setInfoText("msg"); } /* - * JButton Action + * JButton and JMenu Action */ - + protected void newScript(){ + newScript((String)ScriptTypeChoice.getSelectedItem()); + } + protected void newScript(String scriptType){ java.util.List<String> values = getContextValue(ScriptAction.class).getCategories(); - String scriptType = (String)ScriptTypeChoice.getSelectedItem(); String equationModelType = ""; String equationModelTypePath = ""; if (scriptType.equals("EquationModel")){ @@ -224,155 +233,94 @@ actionLogArea.setText(getContextValue(ScriptAction.class).evaluateScript(editor.getText())); setInfoText(_("isisfish.message.evaluation.finished")); } + protected void importScript(){ + setInfoText(getContextValue(ScriptAction.class).importScript()); + } + protected void deleteScript(boolean b){ + int resp = JOptionPane.showConfirmDialog(this,_("isisfish.message.confirm.remove.script" , getContextValue(ScriptAction.class).getCode().getName())); + setInfoText(getContextValue(ScriptAction.class).deleteScript(resp,b)); + } + protected void diffScript(){ + setInfoText(getContextValue(ScriptAction.class).diffScript(editor.getText())); + } + protected void editorHelp(){ + } + protected void javaHelp(){ + } ]]> </script> + <!-- - | Toolbar + | Menu +--> - <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()'/> -<!-- -ToolTipText="Create a new script" -actionCommand="script.Action.newScript($tree, $treeModel, $ScriptTypeChoice/selectedItem)" ---> - <JButton id="buttonScriptSave" text="isisfish.script.save" enabled='false' onActionPerformed='saveScript()'/> -<!-- -ToolTipText="Save current script" -origin="util:isValid($ScriptStorage)" -actionCommand="script.Action.saveScript($ScriptStorage, $scriptJedit/text)" ---> - <JButton id="buttonScriptExport" text="isisfish.script.txtExport" enabled='false' onActionPerformed='exportScript()'/> -<!-- -ToolTipText="Export selected script(s) to zip archive" -origin="$tree/selectionPaths" -actionCommand="script.Action.exportScript($tree)" ---> - <JButton id="buttonScriptCommit" text="isisfish.script.commit" enabled='false' onActionPerformed='commitScript()'/> -<!-- -ToolTipText="Commit script to CVS server" -origin="$canCommit" -actionCommand="script.Action.commitScript($tree, $ScriptStorage, $scriptJedit/text)" ---> - <JButton id="buttonScriptUpdate" text="isisfish.script.update" enabled='false' onActionPerformed='updateScript()'/> -<!-- -ToolTipText="Update current script from server" -origin="$canUpdate" -actionCommand="script.Action.updateScript($tree,$ScriptStorage)" ---> - <JButton id="buttonScriptCut" text="isisfish.script.cut" enabled='false' onActionPerformed='cut()'/> -<!-- -ToolTipText="Cut current selection (Ctrl-x)" -origin="util:isValid($ScriptStorage)" -actionCommand="xpath:cut($scriptJedit)" ---> - <JButton id="buttonScriptCopy" text="isisfish.script.copy" enabled='false' onActionPerformed='copy()'/> -<!-- -ToolTipText="Copy current selection (Ctrl-c)" -origin="util:isValid($ScriptStorage)" -actionCommand="xpath:copy($scriptJedit)" ---> - <JButton id="buttonScriptPaste" text="isisfish.script.paste" enabled='false' onActionPerformed='paste()'/> -<!-- -ToolTipText="Paste current selection (Ctrl-v)" -origin="util:isValid($ScriptStorage)" -actionCommand="xpath:paste($scriptJedit)" ---> - <JButton id="buttonScriptCheck" text="isisfish.script.check" enabled='false' onActionPerformed='checkScript()'/> -<!-- -ToolTipText="Check syntax of the current script" -origin="util:isInstance('fr.ifremer.isisfish.datastore.JavaSourceStorage', $ScriptStorage)" -actionCommand="script.Action.checkScript($ScriptStorage, $scriptJedit/text)" ---> - <JButton id="buttonScriptEval" text="isisfish.script.evaluate" enabled='false' onActionPerformed='evaluateScript()'/> -<!-- -ToolTipText="Try to eval current script (must be have main method)" -origin="util:isInstance('fr.ifremer.isisfish.datastore.JavaSourceStorage', $ScriptStorage)" -actionCommand="script.Action.evaluateScript($ScriptStorage, $scriptJedit/text)" ---> - </JPanel> - - <!-- - | Content editor - +--> - <JSplitPane oneTouchExpandable="true" dividerLocation="250" orientation="HORIZONTAL" constraints='BorderLayout.CENTER'> - -<!-- Fixme : pas compris : JSplitPane does not accept constraints -constraints='"contentPanel"' ---> - <!-- - | Tree script selection - +--> - <JScrollPane> -<!-- Fixme : non plus : JScrollPane does not accept constraints -constraints='"tree"' ---> - <javax.swing.JTree id="tree" name="tree" rootVisible="false" model='{getTreeModel()}'/> -<!-- Fixme : NestedTreeModel, TreeRenderer and TreeSelectionEvents - <NestedTreeModel id="treeModel"> - <TreeNode name="Root"> - <TreeNode name="Script" userObject="'Script'"> - <TreeNode origin="fr.ifremer.isisfish.datastore.ScriptStorage.getScriptNames()"/> - </TreeNode> - <TreeNode name="Simulator" userObject="'Simulator'"> - <TreeNode origin="fr.ifremer.isisfish.datastore.SimulatorStorage.getSimulatorNames()"/> - </TreeNode> - <TreeNode name="Export" userObject="'Export'"> - <TreeNode origin="fr.ifremer.isisfish.datastore.ExportStorage.getExportNames()"/> - </TreeNode> - <TreeNode name="Rule" userObject="'Rule'"> - <TreeNode origin="fr.ifremer.isisfish.datastore.RuleStorage.getRuleNames()"/> - </TreeNode> - <TreeNode name="AnalysePlan" userObject="'AnalysePlan'"> - <TreeNode origin="fr.ifremer.isisfish.datastore.AnalysePlanStorage.getAnalysePlanNames()"/> - </TreeNode> - <TreeNode name="EquationModel" userObject="'EquationModel'"> - <TreeNode origin="fr.ifremer.isisfish.datastore.FormuleStorage.getCategories()"> - <TreeNode treeOrigin=".." childsPropertyName="fr.ifremer.isisfish.datastore.FormuleStorage.getFormuleNames(.)"/> - </TreeNode> - </TreeNode> - </TreeNode> - </NestedTreeModel> - - <TreeRenderer> - <DefaultTreeRenderer type="fr.ifremer.isisfish.datastore.RegionStorage" childsPropertyName="name"/> - <DefaultTreeRenderer type="java.lang.String" childsPropertyName="org.codelutin.i18n.I18n._(.)"/> - </TreeRenderer> - - <TreeSelectionEvents id="treeSelectionListener" - onValueChanged="thread:script.Action.loadScript($tree, $tree/selectionPath/path[2]/userObject, $tree/selectionPath/lastPathComponent)"/> ---> - </JScrollPane> - <JSplitPane oneTouchExpandable="true" dividerLocation="250" orientation="VERTICAL"> + <JMenuBar id="scriptMenuBar" constraints='BorderLayout.NORTH'> + <JMenu id="scriptTxtFile" text="isisfish.script.menu.file"> + <JMenu id="scriptNewMenu" text="isisfish.script.menu.new"> + <JMenuItem id="miNewScript" text="isisfish.script.menu.txtNewScript" onActionPerformed='newScript("Script")' accelerator="accNewScript"/> + <JMenuItem id="miNewSimulator" text="isisfish.script.menu.txtNewSimulator" onActionPerformed='newScript("Simulator")' accelerator="accNewSimulator"/> + <JMenuItem id="miNewExport" text="isisfish.script.menu.txtNewExport" onActionPerformed='newScript("Export")' accelerator="accNewExport"/> + <JMenuItem id="miNewRule" text="isisfish.script.menu.txtNewRule" onActionPerformed='newScript("Rule")' accelerator="accNewRule"/> + <JMenuItem id="miNewAnalysePlan" text="isisfish.script.menu.txtNewAnalysePlan" onActionPerformed='newScript("AnalysePlan")' accelerator="accNewAnalysePlan"/> + <JMenuItem id="miNewEquationModel" text="isisfish.script.menu.txtNewEquationModel" onActionPerformed='newScript("EquationModel")' accelerator="accNewEquationModel"/> + </JMenu> + <JMenuItem id="miSave" text="isisfish.script.menu.save" onActionPerformed="saveScript()" accelerator="accSave"/> + <JSeparator/> + <JMenuItem id="miImport" text="isisfish.script.menu.txtImport" onActionPerformed="importScript()" accelerator="accImport"/> + <JMenuItem id="miExport" text="isisfish.script.menu.txtExport" onActionPerformed="exportScript()" accelerator="accExport"/> + <JSeparator/> + <JMenuItem id="miDelete" text="isisfish.script.menu.deleteLocaly" onActionPerformed='deleteScript(false)' accelerator="accDelete"/> + </JMenu> + <JMenu id="scriptTxtEdit" text="isisfish.script.menu.edit"> + <JMenuItem id="miCut" text="isisfish.script.menu.cut" onActionPerformed="cut()" accelerator="accCut"/> + <JMenuItem id="miCopy" text="isisfish.script.menu.copy" onActionPerformed="copy()" accelerator="accCopy"/> + <JMenuItem id="miPaste" text="isisfish.script.menu.paste" onActionPerformed="paste()" accelerator="accPaste"/> + <JSeparator/> + </JMenu> + <JMenu id="scriptTxtVCS" text="isisfish.script.menu.txtVCS"> + <JMenuItem id="miCommitVCS" text="isisfish.script.menu.commit" accelerator="accCommitVCS" onActionPerformed="commitScript()"/> + <JMenuItem id="miDiffVCS" text="isisfish.script.menu.diff" accelerator="mnDiffVCS" onActionPerformed="diffScript()"/> + <JMenuItem id="miUpdateVCS" text="isisfish.script.menu.update" accelerator="accUpdateVCS" onActionPerformed="updateScript()"/> + <JSeparator/> + <JMenuItem id="miDeleteVCS" text="isisfish.script.menu.deleteLocalyServer" onActionPerformed='deleteScript(true)' accelerator="accDeleteVCS"/> + </JMenu> + <JMenu id="scriptTxtCode" text="isisfish.script.menu.code"> + <JMenuItem id="miCheckSyntax" text="isisfish.script.menu.checkSyntax" accelerator="accCheckSyntax" onActionPerformed="checkScript()"/> + <JMenuItem id="miEvaluate" text="isisfish.script.menu.evaluate" accelerator="accEvaluate" onActionPerformed="evaluateScript()"/> + </JMenu> - <!-- - | Editor script - +--> - <org.codelutin.widget.editor.Editor id='editor'/> -<!-- Fixme : editor -origin="$ScriptStorage/file" ---> - <!-- - | Log area - +--> - <JScrollPane> - <JTextArea id="actionLogArea" editable="false"/> -<!-- Fixme : Pas compris non plus (constraints) -constraints='"actionLogArea"' -origin="$ActionLog" ---> - </JScrollPane> - </JSplitPane> - </JSplitPane> + <JMenu text="isisfish.script.menu.txtHelp"> + <JMenuItem id="miEditorHelp" text="isisfish.script.menu.txtEditorHelp" accelerator="accEditorHelp" onActionPerformed="editorHelp()"/> + <JMenuItem id="miJavaHelp" text="isisfish.script.menu.txtJavaHelp" accelerator="accJavaHelp" onActionPerformed="javaHelp()"/> + </JMenu> + </JMenuBar> <!-- - | Status bar + | Toolbar +--> - - -<!-- -<xpanel constraints='"scriptStatusBar"' xml="StatusBar.xml"/> -<StatusBar2/> ---> + <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()'/> + </JPanel> + <JSplitPane oneTouchExpandable="true" dividerLocation="250" orientation="HORIZONTAL" constraints='BorderLayout.CENTER'> + <JScrollPane> + <javax.swing.JTree id="tree" name="tree" rootVisible="false" model='{getTreeModel()}'/> + </JScrollPane> + <JSplitPane oneTouchExpandable="true" dividerLocation="250" orientation="VERTICAL"> + <org.codelutin.widget.editor.Editor id='editor'/> + <JScrollPane> + <JTextArea id="actionLogArea" editable="false"/> + </JScrollPane> + </JSplitPane> + </JSplitPane> + </JPanel> </JPanel> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensWizard.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensWizard.java 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensWizard.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -33,7 +33,6 @@ import javax.swing.JButton; import javax.swing.JTabbedPane; -import org.swixat.model.Context; public class SensWizard { @@ -42,7 +41,7 @@ * wizard * @return l'index de la tab a selectionner */ - public static int newTab(Context currentContext, JButton prev, JButton next, + public static int newTab(JButton prev, JButton next, JButton finish, JTabbedPane tabPane) { // La direction du changement de tab (+1, -1) //int step = ((Integer)currentContext.getData("_step")).intValue(); 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 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,62 +1,62 @@ -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; +// +///** +// * 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 Modified: 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 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipListRenderer.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,50 +1,50 @@ -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 +//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 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,50 +1,50 @@ -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; +// +///** +// * 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 Modified: 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 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipComboBoxRenderer.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,61 +1,61 @@ -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 +//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 Modified: 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 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListRenderer.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,63 +1,63 @@ -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 +//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 Modified: 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 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipTableColumnRenderer.java 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,64 +1,64 @@ -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 +//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 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 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,3 +1,9 @@ +\ maximal\ age= +\ minimal\ age= +\ minimal\ length\ of\ first\ group= +\ number\ of\ group\ wanted= +\ width\ of\ group= +A\ semicolon\ ';'\ must\ separe\ maximal\ length\ of\ each\ group= Add\ to\ %s\ queue= Add\ to\ default\ queue= Analyse\ plan\ error,\ too\ many\ simulation\ for\ %s\ \:\ %s= @@ -28,13 +34,17 @@ Connection\ to\ serveur\ available,\ switch\ on\ line\:\ %s= Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s= Error\ during\ vcs\ initialisation= +First\ age\ = +First\ length\ = Generate\ next\ simulation= +Group\ width\ = Import\ one\ java\ file\ script\ source= Import\ simulation\ file\ %s\ in\ directory\ %s\ and\ rename\ from\ %s\ to\ %s= Import\ zipped\ file\ containing\ all\ scripts\ directory\ structure= Indiquez\ vos\ modifications= Info=Info Jobs\ submited\ is\ not\ ItemSimulation\ but\ was\ %s= +Last\ age\ = Last\ entry\ was\ %s\ extract\ name\ %s= Launcher\ %s\ will\ be\ stopped\ because\ there\ are\ too\ many\ error\ (%s)= Local\ repository\ don't\ exist= @@ -58,6 +68,7 @@ Switch\ repository\ tag\ from\ %s\ to\ %s= Switch\ repository\ type\ to\ none= Tag\ %s\ don't\ exist= +The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.= Use\ branches,\ switch\ not\ needed= User\ stop\ simulation\ %s= View\ log= @@ -76,6 +87,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. +gap\ between\ to\ group\ is\ 1\ year.= in\ Process= isisfish.about.site=site isisfish.about.text=text @@ -1158,6 +1170,7 @@ msg= no\ properties\ found\ or\ unsafe\ properties\ found\ %1$s=no properties found or unsafe properties found %1$s not\ started= +number\ of\ Group\ = region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite= repository\ host\ change\ from\ %s\ to\ %s= repository\ protocol\ change\ from\ %s\ to\ %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 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,3 +1,9 @@ +\ maximal\ age= +\ minimal\ age= +\ minimal\ length\ of\ first\ group= +\ number\ of\ group\ wanted= +\ width\ of\ group= +A\ semicolon\ ';'\ must\ separe\ maximal\ length\ of\ each\ group= Add\ to\ %s\ queue= Add\ to\ default\ queue= Analyse\ plan\ error,\ too\ many\ simulation\ for\ %s\ \:\ %s= @@ -28,13 +34,17 @@ Connection\ to\ serveur\ available,\ switch\ on\ line\:\ %s= Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s= Error\ during\ vcs\ initialisation= +First\ age\ = +First\ length\ = Generate\ next\ simulation= +Group\ width\ = Import\ one\ java\ file\ script\ source= Import\ simulation\ file\ %s\ in\ directory\ %s\ and\ rename\ from\ %s\ to\ %s= Import\ zipped\ file\ containing\ all\ scripts\ directory\ structure= Indiquez\ vos\ modifications= Info=Info Jobs\ submited\ is\ not\ ItemSimulation\ but\ was\ %s= +Last\ age\ = Last\ entry\ was\ %s\ extract\ name\ %s= Launcher\ %s\ will\ be\ stopped\ because\ there\ are\ too\ many\ error\ (%s)= Local\ repository\ don't\ exist= @@ -58,6 +68,7 @@ Switch\ repository\ tag\ from\ %s\ to\ %s= Switch\ repository\ type\ to\ none= Tag\ %s\ don't\ exist= +The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.= Use\ branches,\ switch\ not\ needed= User\ stop\ simulation\ %s= View\ log= @@ -76,6 +87,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. +gap\ between\ to\ group\ is\ 1\ year.= in\ Process= isisfish.about.site=http\://isisfish.labs.libre-entreprise.org - by B.Poussin isisfish.about.text=Simulateur Isis-Fish @@ -1158,6 +1170,7 @@ msg= no\ properties\ found\ or\ unsafe\ properties\ found\ %1$s=no properties found or unsafe properties found %1$s not\ started= +number\ of\ Group\ = region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite= repository\ host\ change\ from\ %s\ to\ %s= repository\ protocol\ change\ from\ %s\ to\ %s= Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ActiveRuleImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ActiveRuleImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ActiveRuleImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.ActiveRuleImpl" table="activeRule" node="fr.ifremer.isisfish.entities.ActiveRuleImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.ActiveRule" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="activeRuleDate" type="fr.ifremer.isisfish.types.hibernate.DateType" access="field" column="activeRuleDate" node="activeRuleDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="param" type="text" access="field" column="param" node="param"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.ActiveRuleImpl" node="fr.ifremer.isisfish.entities.ActiveRuleImpl" proxy="fr.ifremer.isisfish.entities.ActiveRule" table="activeRule"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="activeRuleDate" name="activeRuleDate" node="activeRuleDate" type="fr.ifremer.isisfish.types.hibernate.DateType"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="param" name="param" node="param" type="text"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/CellImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/CellImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/CellImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.CellImpl" table="cell" node="fr.ifremer.isisfish.entities.CellImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Cell" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="latitude" type="float" access="field" column="latitude" node="latitude"/> - <property name="longitude" type="float" access="field" column="longitude" node="longitude"/> - <property name="land" type="boolean" access="field" column="land" node="land"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.CellImpl" node="fr.ifremer.isisfish.entities.CellImpl" proxy="fr.ifremer.isisfish.entities.Cell" table="cell"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="latitude" name="latitude" node="latitude" type="float"/> + <property access="field" column="longitude" name="longitude" node="longitude" type="float"/> + <property access="field" column="land" name="land" node="land" type="boolean"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/EffortDescriptionImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/EffortDescriptionImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/EffortDescriptionImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.EffortDescriptionImpl" table="effortDescription" node="fr.ifremer.isisfish.entities.EffortDescriptionImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.EffortDescription" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="fishingOperation" type="int" access="field" column="fishingOperation" node="fishingOperation"/> - <property name="fishingOperationDuration" type="fr.ifremer.isisfish.types.hibernate.TimeUnitType" access="field" column="fishingOperationDuration" node="fishingOperationDuration"/> - <property name="gearsNumberPerOperation" type="int" access="field" column="gearsNumberPerOperation" node="gearsNumberPerOperation"/> - <property name="crewSize" type="int" access="field" column="crewSize" node="crewSize"/> - <property name="unitCostOfFishing" type="double" access="field" column="unitCostOfFishing" node="unitCostOfFishing"/> - <property name="fixedCrewSalary" type="double" access="field" column="fixedCrewSalary" node="fixedCrewSalary"/> - <property name="crewShareRate" type="double" access="field" column="crewShareRate" node="crewShareRate"/> - <property name="crewFoodCost" type="double" access="field" column="crewFoodCost" node="crewFoodCost"/> - <property name="repairAndMaintenanceGearCost" type="double" access="field" column="repairAndMaintenanceGearCost" node="repairAndMaintenanceGearCost"/> - <property name="otherRunningCost" type="double" access="field" column="otherRunningCost" node="otherRunningCost"/> - <property name="landingCosts" type="double" access="field" column="landingCosts" node="landingCosts"/> - <many-to-one name="setOfVessels" class="fr.ifremer.isisfish.entities.SetOfVesselsImpl" column="setOfVessels" node="setOfVessels/@topiaId" embed-xml="false"/> - <many-to-one name="possibleMetiers" class="fr.ifremer.isisfish.entities.MetierImpl" column="possibleMetiers" node="possibleMetiers/@topiaId" embed-xml="false"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.EffortDescriptionImpl" node="fr.ifremer.isisfish.entities.EffortDescriptionImpl" proxy="fr.ifremer.isisfish.entities.EffortDescription" table="effortDescription"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="fishingOperation" name="fishingOperation" node="fishingOperation" type="int"/> + <property access="field" column="fishingOperationDuration" name="fishingOperationDuration" node="fishingOperationDuration" type="fr.ifremer.isisfish.types.hibernate.TimeUnitType"/> + <property access="field" column="gearsNumberPerOperation" name="gearsNumberPerOperation" node="gearsNumberPerOperation" type="int"/> + <property access="field" column="crewSize" name="crewSize" node="crewSize" type="int"/> + <property access="field" column="unitCostOfFishing" name="unitCostOfFishing" node="unitCostOfFishing" type="double"/> + <property access="field" column="fixedCrewSalary" name="fixedCrewSalary" node="fixedCrewSalary" type="double"/> + <property access="field" column="crewShareRate" name="crewShareRate" node="crewShareRate" type="double"/> + <property access="field" column="crewFoodCost" name="crewFoodCost" node="crewFoodCost" type="double"/> + <property access="field" column="repairAndMaintenanceGearCost" name="repairAndMaintenanceGearCost" node="repairAndMaintenanceGearCost" type="double"/> + <property access="field" column="otherRunningCost" name="otherRunningCost" node="otherRunningCost" type="double"/> + <property access="field" column="landingCosts" name="landingCosts" node="landingCosts" type="double"/> + <many-to-one class="fr.ifremer.isisfish.entities.SetOfVesselsImpl" column="setOfVessels" embed-xml="false" name="setOfVessels" node="setOfVessels/@topiaId"/> + <many-to-one class="fr.ifremer.isisfish.entities.MetierImpl" column="possibleMetiers" embed-xml="false" name="possibleMetiers" node="possibleMetiers/@topiaId"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/EquationImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/EquationImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/EquationImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.EquationImpl" table="equation" node="fr.ifremer.isisfish.entities.EquationImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Equation" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="content" type="text" access="field" column="content" node="content"/> - <property name="category" type="text" access="field" column="category" node="category"/> - <property name="language" type="text" access="field" column="language" node="language"/> - <property name="javaInterface" type="java.lang.Class" access="field" column="javaInterface" node="javaInterface"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.EquationImpl" node="fr.ifremer.isisfish.entities.EquationImpl" proxy="fr.ifremer.isisfish.entities.Equation" table="equation"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="content" name="content" node="content" type="text"/> + <property access="field" column="category" name="category" node="category" type="text"/> + <property access="field" column="language" name="language" node="language" type="text"/> + <property access="field" column="javaInterface" name="javaInterface" node="javaInterface" type="java.lang.Class"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/FisheryRegionImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/FisheryRegionImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/FisheryRegionImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,18 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.FisheryRegionImpl" table="fisheryRegion" node="fr.ifremer.isisfish.entities.FisheryRegionImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.FisheryRegion" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="minLongitude" type="float" access="field" column="minLongitude" node="minLongitude"/> - <property name="maxLongitude" type="float" access="field" column="maxLongitude" node="maxLongitude"/> - <property name="minLatitude" type="float" access="field" column="minLatitude" node="minLatitude"/> - <property name="maxLatitude" type="float" access="field" column="maxLatitude" node="maxLatitude"/> - <property name="cellLengthLongitude" type="float" access="field" column="cellLengthLongitude" node="cellLengthLongitude"/> - <property name="cellLengthLatitude" type="float" access="field" column="cellLengthLatitude" node="cellLengthLatitude"/> - <property name="mapFiles" type="text" access="field" column="mapFiles" node="mapFiles"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.FisheryRegionImpl" node="fr.ifremer.isisfish.entities.FisheryRegionImpl" proxy="fr.ifremer.isisfish.entities.FisheryRegion" table="fisheryRegion"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="minLongitude" name="minLongitude" node="minLongitude" type="float"/> + <property access="field" column="maxLongitude" name="maxLongitude" node="maxLongitude" type="float"/> + <property access="field" column="minLatitude" name="minLatitude" node="minLatitude" type="float"/> + <property access="field" column="maxLatitude" name="maxLatitude" node="maxLatitude" type="float"/> + <property access="field" column="cellLengthLongitude" name="cellLengthLongitude" node="cellLengthLongitude" type="float"/> + <property access="field" column="cellLengthLatitude" name="cellLengthLatitude" node="cellLengthLatitude" type="float"/> + <property access="field" column="mapFiles" name="mapFiles" node="mapFiles" type="text"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/GearImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/GearImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/GearImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,20 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.GearImpl" table="gear" node="fr.ifremer.isisfish.entities.GearImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Gear" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="effortUnit" type="text" access="field" column="effortUnit" node="effortUnit"/> - <property name="standardisationFactor" type="double" access="field" column="standardisationFactor" node="standardisationFactor"/> - <property name="parameterName" type="text" access="field" column="parameterName" node="parameterName"/> - <property name="cost" type="double" access="field" column="cost" node="cost"/> - <property name="possibleValue" type="fr.ifremer.isisfish.types.hibernate.RangeOfValuesType" access="field" column="possibleValue" node="possibleValue"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <bag name="populationSelectivity" lazy="true" cascade="all,delete-orphan" node="populationSelectivity" embed-xml="true"> - <key column="gear"/> - <one-to-many class="fr.ifremer.isisfish.entities.SelectivityImpl" node="topiaId" embed-xml="false"/> - </bag> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.GearImpl" node="fr.ifremer.isisfish.entities.GearImpl" proxy="fr.ifremer.isisfish.entities.Gear" table="gear"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="effortUnit" name="effortUnit" node="effortUnit" type="text"/> + <property access="field" column="standardisationFactor" name="standardisationFactor" node="standardisationFactor" type="double"/> + <property access="field" column="parameterName" name="parameterName" node="parameterName" type="text"/> + <property access="field" column="cost" name="cost" node="cost" type="double"/> + <property access="field" column="possibleValue" name="possibleValue" node="possibleValue" type="fr.ifremer.isisfish.types.hibernate.RangeOfValuesType"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <bag cascade="all,delete-orphan" embed-xml="true" lazy="true" name="populationSelectivity" node="populationSelectivity"> + <key column="gear"/> + <one-to-many class="fr.ifremer.isisfish.entities.SelectivityImpl" embed-xml="false" node="topiaId"/> + </bag> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/MetierImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/MetierImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/MetierImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.MetierImpl" table="metier" node="fr.ifremer.isisfish.entities.MetierImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Metier" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="gearParameterValue" type="text" access="field" column="gearParameterValue" node="gearParameterValue"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <property name="capturableSpeciesComment" type="text" access="field" column="capturableSpeciesComment" node="capturableSpeciesComment"/> - <many-to-one name="gear" class="fr.ifremer.isisfish.entities.GearImpl" column="gear" node="gear/@topiaId" embed-xml="false"/> - <bag name="setOfVesselsEffortDescription" inverse="true" lazy="true" cascade="all,delete-orphan" node="setOfVesselsEffortDescription" embed-xml="true"> - <key column="possibleMetiers"/> - <one-to-many class="fr.ifremer.isisfish.entities.EffortDescriptionImpl" node="topiaId" embed-xml="false"/> - </bag> - <bag name="metierSeasonInfo" order-by="firstMonth, lastMonth" inverse="true" lazy="true" cascade="all,delete-orphan" node="metierSeasonInfo" embed-xml="true"> - <key column="metier"/> - <one-to-many class="fr.ifremer.isisfish.entities.MetierSeasonInfoImpl" node="topiaId" embed-xml="false"/> - </bag> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.MetierImpl" node="fr.ifremer.isisfish.entities.MetierImpl" proxy="fr.ifremer.isisfish.entities.Metier" table="metier"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="gearParameterValue" name="gearParameterValue" node="gearParameterValue" type="text"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <property access="field" column="capturableSpeciesComment" name="capturableSpeciesComment" node="capturableSpeciesComment" type="text"/> + <many-to-one class="fr.ifremer.isisfish.entities.GearImpl" column="gear" embed-xml="false" name="gear" node="gear/@topiaId"/> + <bag cascade="all,delete-orphan" embed-xml="true" inverse="true" lazy="true" name="setOfVesselsEffortDescription" node="setOfVesselsEffortDescription"> + <key column="possibleMetiers"/> + <one-to-many class="fr.ifremer.isisfish.entities.EffortDescriptionImpl" embed-xml="false" node="topiaId"/> + </bag> + <bag cascade="all,delete-orphan" embed-xml="true" inverse="true" lazy="true" name="metierSeasonInfo" node="metierSeasonInfo" order-by="firstMonth, lastMonth"> + <key column="metier"/> + <one-to-many class="fr.ifremer.isisfish.entities.MetierSeasonInfoImpl" embed-xml="false" node="topiaId"/> + </bag> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,18 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <union-subclass name="fr.ifremer.isisfish.entities.MetierSeasonInfoImpl" extends="fr.ifremer.isisfish.entities.SeasonImpl" table="metierSeasonInfo" node="fr.ifremer.isisfish.entities.MetierSeasonInfoImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.MetierSeasonInfo" > - <!--key column="topiaId"/--> - <property name="seasonZoneComment" type="text" access="field" column="seasonZoneComment" node="seasonZoneComment"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <bag name="speciesTargetSpecies" lazy="true" cascade="all,delete-orphan" node="speciesTargetSpecies" embed-xml="true"> - <key column="metierSeasonInfo"/> - <one-to-many class="fr.ifremer.isisfish.entities.TargetSpeciesImpl" node="topiaId" embed-xml="false"/> - </bag> - <many-to-one name="metier" class="fr.ifremer.isisfish.entities.MetierImpl" column="metier" node="metier/@topiaId" embed-xml="false"/> - <bag name="zone" table="metierseasoninfo_zone" lazy="true" node="zone" embed-xml="true"> - <key column="metierSeasonInfo"/> - <many-to-many class="fr.ifremer.isisfish.entities.ZoneImpl" column="zone" node="topiaId"/> - </bag> - </union-subclass> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <union-subclass abstract="false" extends="fr.ifremer.isisfish.entities.SeasonImpl" name="fr.ifremer.isisfish.entities.MetierSeasonInfoImpl" node="fr.ifremer.isisfish.entities.MetierSeasonInfoImpl" proxy="fr.ifremer.isisfish.entities.MetierSeasonInfo" table="metierSeasonInfo"> + <!--key column="topiaId"/--> + <property access="field" column="seasonZoneComment" name="seasonZoneComment" node="seasonZoneComment" type="text"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <bag cascade="all,delete-orphan" embed-xml="true" lazy="true" name="speciesTargetSpecies" node="speciesTargetSpecies"> + <key column="metierSeasonInfo"/> + <one-to-many class="fr.ifremer.isisfish.entities.TargetSpeciesImpl" embed-xml="false" node="topiaId"/> + </bag> + <many-to-one class="fr.ifremer.isisfish.entities.MetierImpl" column="metier" embed-xml="false" name="metier" node="metier/@topiaId"/> + <bag embed-xml="true" lazy="true" name="zone" node="zone" table="metierseasoninfo_zone"> + <key column="metierSeasonInfo"/> + <many-to-many class="fr.ifremer.isisfish.entities.ZoneImpl" column="zone" node="topiaId"/> + </bag> + </union-subclass> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationGroupImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationGroupImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationGroupImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.PopulationGroupImpl" table="populationGroup" node="fr.ifremer.isisfish.entities.PopulationGroupImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.PopulationGroup" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="id" type="int" access="field" column="id" node="id"/> - <property name="reproductionRate" type="double" access="field" column="reproductionRate" node="reproductionRate"/> - <property name="age" type="double" access="field" column="age" node="age"/> - <property name="minLength" type="double" access="field" column="minLength" node="minLength"/> - <property name="maxLength" type="double" access="field" column="maxLength" node="maxLength"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <many-to-one name="population" class="fr.ifremer.isisfish.entities.PopulationImpl" column="population" node="population/@topiaId" embed-xml="false"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.PopulationGroupImpl" node="fr.ifremer.isisfish.entities.PopulationGroupImpl" proxy="fr.ifremer.isisfish.entities.PopulationGroup" table="populationGroup"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="id" name="id" node="id" type="int"/> + <property access="field" column="reproductionRate" name="reproductionRate" node="reproductionRate" type="double"/> + <property access="field" column="age" name="age" node="age" type="double"/> + <property access="field" column="minLength" name="minLength" node="minLength" type="double"/> + <property access="field" column="maxLength" name="maxLength" node="maxLength" type="double"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <many-to-one class="fr.ifremer.isisfish.entities.PopulationImpl" column="population" embed-xml="false" name="population" node="population/@topiaId"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,73 +1,73 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.PopulationImpl" table="population" node="fr.ifremer.isisfish.entities.PopulationImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Population" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="geographicId" type="text" access="field" column="geographicId" node="geographicId"/> - <property name="plusGroup" type="boolean" access="field" column="plusGroup" node="plusGroup"/> - <many-to-one name="growth" class="fr.ifremer.isisfish.entities.EquationImpl" column="growth" cascade="delete" node="growth/@topiaId" embed-xml="false"/> - <many-to-one name="growthReverse" class="fr.ifremer.isisfish.entities.EquationImpl" column="growthReverse" cascade="delete" node="growthReverse/@topiaId" embed-xml="false"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <many-to-one name="meanWeight" class="fr.ifremer.isisfish.entities.EquationImpl" column="meanWeight" cascade="delete" node="meanWeight/@topiaId" embed-xml="false"/> - <many-to-one name="price" class="fr.ifremer.isisfish.entities.EquationImpl" column="price" cascade="delete" node="price/@topiaId" embed-xml="false"/> - <many-to-one name="naturalDeathRate" class="fr.ifremer.isisfish.entities.EquationImpl" column="naturalDeathRate" cascade="delete" node="naturalDeathRate/@topiaId" embed-xml="false"/> - <property name="caractBioComment" type="text" access="field" column="caractBioComment" node="caractBioComment"/> - <many-to-one name="reproductionEquation" class="fr.ifremer.isisfish.entities.EquationImpl" column="reproductionEquation" cascade="delete" node="reproductionEquation/@topiaId" embed-xml="false"/> - <property name="monthGapBetweenReproRecrutement" type="int" access="field" column="monthGapBetweenReproRecrutement" node="monthGapBetweenReproRecrutement"/> - <property name="recruitmentDistribution" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="recruitmentDistribution_name"/> - <column name="recruitmentDistribution_dim"/> - <column name="recruitmentDistribution_dimNames"/> - <column name="recruitmentDistribution_semantics"/> - <column name="recruitmentDistribution_data"/> - </property> - <property name="recruitmentComment" type="text" access="field" column="recruitmentComment" node="recruitmentComment"/> - <property name="zonesComment" type="text" access="field" column="zonesComment" node="zonesComment"/> - <property name="seasonsComment" type="text" access="field" column="seasonsComment" node="seasonsComment"/> - <property name="capturabilityComment" type="text" access="field" column="capturabilityComment" node="capturabilityComment"/> - <property name="migrationComment" type="text" access="field" column="migrationComment" node="migrationComment"/> - <property name="mappingZoneReproZoneRecru" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="mappingZoneReproZoneRecru_name"/> - <column name="mappingZoneReproZoneRecru_dim"/> - <column name="mappingZoneReproZoneRecru_dimNames"/> - <column name="mappingZoneReproZoneRecru_semantics"/> - <column name="mappingZoneReproZoneRecru_data"/> - </property> - <property name="capturability" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="capturability_name"/> - <column name="capturability_dim"/> - <column name="capturability_dimNames"/> - <column name="capturability_semantics"/> - <column name="capturability_data"/> - </property> - <bag name="gearSelectivity" inverse="true" lazy="true" cascade="all,delete-orphan" node="gearSelectivity" embed-xml="true"> - <key column="population"/> - <one-to-many class="fr.ifremer.isisfish.entities.SelectivityImpl" node="topiaId" embed-xml="false"/> - </bag> - <bag name="populationGroup" order-by="id" lazy="true" cascade="all,delete-orphan" node="populationGroup" embed-xml="true"> - <key column="population"/> - <one-to-many class="fr.ifremer.isisfish.entities.PopulationGroupImpl" node="topiaId" embed-xml="false"/> - </bag> - <bag name="populationSeasonInfo" order-by="firstMonth, lastMonth" inverse="true" lazy="true" cascade="all,delete-orphan" node="populationSeasonInfo" embed-xml="true"> - <key column="population"/> - <one-to-many class="fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl" node="topiaId" embed-xml="false"/> - </bag> - <many-to-one name="species" class="fr.ifremer.isisfish.entities.SpeciesImpl" column="species" node="species/@topiaId" embed-xml="false"/> - <bag name="reproductionZone" table="population_reproductionzone" lazy="true" node="reproductionZone" embed-xml="true"> - <key column="population"/> - <many-to-many class="fr.ifremer.isisfish.entities.ZoneImpl" column="reproductionZone" node="topiaId"/> - </bag> - <bag name="populationZone" table="population_populationzone" lazy="true" node="populationZone" embed-xml="true"> - <key column="population"/> - <many-to-many class="fr.ifremer.isisfish.entities.ZoneImpl" column="populationZone" node="topiaId"/> - </bag> - <bag name="recruitmentZone" table="population_recruitmentzone" lazy="true" node="recruitmentZone" embed-xml="true"> - <key column="population"/> - <many-to-many class="fr.ifremer.isisfish.entities.ZoneImpl" column="recruitmentZone" node="topiaId"/> - </bag> - <many-to-one name="maturityGroup" class="fr.ifremer.isisfish.entities.PopulationGroupImpl" column="maturityGroup" unique="true" node="maturityGroup/@topiaId" embed-xml="false"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.PopulationImpl" node="fr.ifremer.isisfish.entities.PopulationImpl" proxy="fr.ifremer.isisfish.entities.Population" table="population"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="geographicId" name="geographicId" node="geographicId" type="text"/> + <property access="field" column="plusGroup" name="plusGroup" node="plusGroup" type="boolean"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="growth" embed-xml="false" name="growth" node="growth/@topiaId"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="growthReverse" embed-xml="false" name="growthReverse" node="growthReverse/@topiaId"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="meanWeight" embed-xml="false" name="meanWeight" node="meanWeight/@topiaId"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="price" embed-xml="false" name="price" node="price/@topiaId"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="naturalDeathRate" embed-xml="false" name="naturalDeathRate" node="naturalDeathRate/@topiaId"/> + <property access="field" column="caractBioComment" name="caractBioComment" node="caractBioComment" type="text"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="reproductionEquation" embed-xml="false" name="reproductionEquation" node="reproductionEquation/@topiaId"/> + <property access="field" column="monthGapBetweenReproRecrutement" name="monthGapBetweenReproRecrutement" node="monthGapBetweenReproRecrutement" type="int"/> + <property access="field" name="recruitmentDistribution" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="recruitmentDistribution_name"/> + <column name="recruitmentDistribution_dim"/> + <column name="recruitmentDistribution_dimNames"/> + <column name="recruitmentDistribution_semantics"/> + <column name="recruitmentDistribution_data"/> + </property> + <property access="field" column="recruitmentComment" name="recruitmentComment" node="recruitmentComment" type="text"/> + <property access="field" column="zonesComment" name="zonesComment" node="zonesComment" type="text"/> + <property access="field" column="seasonsComment" name="seasonsComment" node="seasonsComment" type="text"/> + <property access="field" column="capturabilityComment" name="capturabilityComment" node="capturabilityComment" type="text"/> + <property access="field" column="migrationComment" name="migrationComment" node="migrationComment" type="text"/> + <property access="field" name="mappingZoneReproZoneRecru" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="mappingZoneReproZoneRecru_name"/> + <column name="mappingZoneReproZoneRecru_dim"/> + <column name="mappingZoneReproZoneRecru_dimNames"/> + <column name="mappingZoneReproZoneRecru_semantics"/> + <column name="mappingZoneReproZoneRecru_data"/> + </property> + <property access="field" name="capturability" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="capturability_name"/> + <column name="capturability_dim"/> + <column name="capturability_dimNames"/> + <column name="capturability_semantics"/> + <column name="capturability_data"/> + </property> + <bag cascade="all,delete-orphan" embed-xml="true" inverse="true" lazy="true" name="gearSelectivity" node="gearSelectivity"> + <key column="population"/> + <one-to-many class="fr.ifremer.isisfish.entities.SelectivityImpl" embed-xml="false" node="topiaId"/> + </bag> + <bag cascade="all,delete-orphan" embed-xml="true" lazy="true" name="populationGroup" node="populationGroup" order-by="id"> + <key column="population"/> + <one-to-many class="fr.ifremer.isisfish.entities.PopulationGroupImpl" embed-xml="false" node="topiaId"/> + </bag> + <bag cascade="all,delete-orphan" embed-xml="true" inverse="true" lazy="true" name="populationSeasonInfo" node="populationSeasonInfo" order-by="firstMonth, lastMonth"> + <key column="population"/> + <one-to-many class="fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl" embed-xml="false" node="topiaId"/> + </bag> + <many-to-one class="fr.ifremer.isisfish.entities.SpeciesImpl" column="species" embed-xml="false" name="species" node="species/@topiaId"/> + <bag embed-xml="true" lazy="true" name="reproductionZone" node="reproductionZone" table="population_reproductionzone"> + <key column="population"/> + <many-to-many class="fr.ifremer.isisfish.entities.ZoneImpl" column="reproductionZone" node="topiaId"/> + </bag> + <bag embed-xml="true" lazy="true" name="populationZone" node="populationZone" table="population_populationzone"> + <key column="population"/> + <many-to-many class="fr.ifremer.isisfish.entities.ZoneImpl" column="populationZone" node="topiaId"/> + </bag> + <bag embed-xml="true" lazy="true" name="recruitmentZone" node="recruitmentZone" table="population_recruitmentzone"> + <key column="population"/> + <many-to-many class="fr.ifremer.isisfish.entities.ZoneImpl" column="recruitmentZone" node="topiaId"/> + </bag> + <many-to-one class="fr.ifremer.isisfish.entities.PopulationGroupImpl" column="maturityGroup" embed-xml="false" name="maturityGroup" node="maturityGroup/@topiaId" unique="true"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,50 +1,50 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <union-subclass name="fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl" extends="fr.ifremer.isisfish.entities.SeasonImpl" table="populationSeasonInfo" node="fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.PopulationSeasonInfo" > - <!--key column="topiaId"/--> - <property name="reproductionDistribution" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="reproductionDistribution_name"/> - <column name="reproductionDistribution_dim"/> - <column name="reproductionDistribution_dimNames"/> - <column name="reproductionDistribution_semantics"/> - <column name="reproductionDistribution_data"/> - </property> - <property name="groupChange" type="boolean" access="field" column="groupChange" node="groupChange"/> - <property name="simpleLengthChangeMatrix" type="boolean" access="field" column="simpleLengthChangeMatrix" node="simpleLengthChangeMatrix"/> - <property name="lengthChangeMatrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="lengthChangeMatrix_name"/> - <column name="lengthChangeMatrix_dim"/> - <column name="lengthChangeMatrix_dimNames"/> - <column name="lengthChangeMatrix_semantics"/> - <column name="lengthChangeMatrix_data"/> - </property> - <property name="reproduction" type="boolean" access="field" column="reproduction" node="reproduction"/> - <property name="useEquationMigration" type="boolean" access="field" column="useEquationMigration" node="useEquationMigration"/> - <property name="migrationMatrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="migrationMatrix_name"/> - <column name="migrationMatrix_dim"/> - <column name="migrationMatrix_dimNames"/> - <column name="migrationMatrix_semantics"/> - <column name="migrationMatrix_data"/> - </property> - <property name="emigrationMatrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="emigrationMatrix_name"/> - <column name="emigrationMatrix_dim"/> - <column name="emigrationMatrix_dimNames"/> - <column name="emigrationMatrix_semantics"/> - <column name="emigrationMatrix_data"/> - </property> - <property name="immigrationMatrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="immigrationMatrix_name"/> - <column name="immigrationMatrix_dim"/> - <column name="immigrationMatrix_dimNames"/> - <column name="immigrationMatrix_semantics"/> - <column name="immigrationMatrix_data"/> - </property> - <many-to-one name="migrationEquation" class="fr.ifremer.isisfish.entities.EquationImpl" column="migrationEquation" cascade="delete" node="migrationEquation/@topiaId" embed-xml="false"/> - <many-to-one name="emigrationEquation" class="fr.ifremer.isisfish.entities.EquationImpl" column="emigrationEquation" cascade="delete" node="emigrationEquation/@topiaId" embed-xml="false"/> - <many-to-one name="immigrationEquation" class="fr.ifremer.isisfish.entities.EquationImpl" column="immigrationEquation" cascade="delete" node="immigrationEquation/@topiaId" embed-xml="false"/> - <many-to-one name="population" class="fr.ifremer.isisfish.entities.PopulationImpl" column="population" node="population/@topiaId" embed-xml="false"/> - </union-subclass> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <union-subclass abstract="false" extends="fr.ifremer.isisfish.entities.SeasonImpl" name="fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl" node="fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl" proxy="fr.ifremer.isisfish.entities.PopulationSeasonInfo" table="populationSeasonInfo"> + <!--key column="topiaId"/--> + <property access="field" name="reproductionDistribution" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="reproductionDistribution_name"/> + <column name="reproductionDistribution_dim"/> + <column name="reproductionDistribution_dimNames"/> + <column name="reproductionDistribution_semantics"/> + <column name="reproductionDistribution_data"/> + </property> + <property access="field" column="groupChange" name="groupChange" node="groupChange" type="boolean"/> + <property access="field" column="simpleLengthChangeMatrix" name="simpleLengthChangeMatrix" node="simpleLengthChangeMatrix" type="boolean"/> + <property access="field" name="lengthChangeMatrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="lengthChangeMatrix_name"/> + <column name="lengthChangeMatrix_dim"/> + <column name="lengthChangeMatrix_dimNames"/> + <column name="lengthChangeMatrix_semantics"/> + <column name="lengthChangeMatrix_data"/> + </property> + <property access="field" column="reproduction" name="reproduction" node="reproduction" type="boolean"/> + <property access="field" column="useEquationMigration" name="useEquationMigration" node="useEquationMigration" type="boolean"/> + <property access="field" name="migrationMatrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="migrationMatrix_name"/> + <column name="migrationMatrix_dim"/> + <column name="migrationMatrix_dimNames"/> + <column name="migrationMatrix_semantics"/> + <column name="migrationMatrix_data"/> + </property> + <property access="field" name="emigrationMatrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="emigrationMatrix_name"/> + <column name="emigrationMatrix_dim"/> + <column name="emigrationMatrix_dimNames"/> + <column name="emigrationMatrix_semantics"/> + <column name="emigrationMatrix_data"/> + </property> + <property access="field" name="immigrationMatrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="immigrationMatrix_name"/> + <column name="immigrationMatrix_dim"/> + <column name="immigrationMatrix_dimNames"/> + <column name="immigrationMatrix_semantics"/> + <column name="immigrationMatrix_data"/> + </property> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="migrationEquation" embed-xml="false" name="migrationEquation" node="migrationEquation/@topiaId"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="emigrationEquation" embed-xml="false" name="emigrationEquation" node="emigrationEquation/@topiaId"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="immigrationEquation" embed-xml="false" name="immigrationEquation" node="immigrationEquation/@topiaId"/> + <many-to-one class="fr.ifremer.isisfish.entities.PopulationImpl" column="population" embed-xml="false" name="population" node="population/@topiaId"/> + </union-subclass> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PortImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PortImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/PortImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.PortImpl" table="port" node="fr.ifremer.isisfish.entities.PortImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Port" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <many-to-one name="cell" class="fr.ifremer.isisfish.entities.CellImpl" column="cell" node="cell/@topiaId" embed-xml="false"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.PortImpl" node="fr.ifremer.isisfish.entities.PortImpl" proxy="fr.ifremer.isisfish.entities.Port" table="port"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <many-to-one class="fr.ifremer.isisfish.entities.CellImpl" column="cell" embed-xml="false" name="cell" node="cell/@topiaId"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ResultImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ResultImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ResultImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,18 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.ResultImpl" table="result" node="fr.ifremer.isisfish.entities.ResultImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Result" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="resultDate" type="fr.ifremer.isisfish.types.hibernate.DateType" access="field" column="resultDate" node="resultDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="matrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="matrix_name"/> - <column name="matrix_dim"/> - <column name="matrix_dimNames"/> - <column name="matrix_semantics"/> - <column name="matrix_data"/> - </property> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.ResultImpl" node="fr.ifremer.isisfish.entities.ResultImpl" proxy="fr.ifremer.isisfish.entities.Result" table="result"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="resultDate" name="resultDate" node="resultDate" type="fr.ifremer.isisfish.types.hibernate.DateType"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" name="matrix" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="matrix_name"/> + <column name="matrix_dim"/> + <column name="matrix_dimNames"/> + <column name="matrix_semantics"/> + <column name="matrix_data"/> + </property> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SeasonImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SeasonImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SeasonImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.SeasonImpl" table="season" node="fr.ifremer.isisfish.entities.SeasonImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Season" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="firstMonth" type="fr.ifremer.isisfish.types.hibernate.MonthType" access="field" column="firstMonth" node="firstMonth"/> - <property name="lastMonth" type="fr.ifremer.isisfish.types.hibernate.MonthType" access="field" column="lastMonth" node="lastMonth"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.SeasonImpl" node="fr.ifremer.isisfish.entities.SeasonImpl" proxy="fr.ifremer.isisfish.entities.Season" table="season"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="firstMonth" name="firstMonth" node="firstMonth" type="fr.ifremer.isisfish.types.hibernate.MonthType"/> + <property access="field" column="lastMonth" name="lastMonth" node="lastMonth" type="fr.ifremer.isisfish.types.hibernate.MonthType"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SelectivityImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SelectivityImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SelectivityImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.SelectivityImpl" table="selectivity" node="fr.ifremer.isisfish.entities.SelectivityImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Selectivity" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <many-to-one name="equation" class="fr.ifremer.isisfish.entities.EquationImpl" column="equation" cascade="delete" node="equation/@topiaId" embed-xml="false"/> - <many-to-one name="gear" class="fr.ifremer.isisfish.entities.GearImpl" column="gear" node="gear/@topiaId" embed-xml="false"/> - <many-to-one name="population" class="fr.ifremer.isisfish.entities.PopulationImpl" column="population" node="population/@topiaId" embed-xml="false"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.SelectivityImpl" node="fr.ifremer.isisfish.entities.SelectivityImpl" proxy="fr.ifremer.isisfish.entities.Selectivity" table="selectivity"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="equation" embed-xml="false" name="equation" node="equation/@topiaId"/> + <many-to-one class="fr.ifremer.isisfish.entities.GearImpl" column="gear" embed-xml="false" name="gear" node="gear/@topiaId"/> + <many-to-one class="fr.ifremer.isisfish.entities.PopulationImpl" column="population" embed-xml="false" name="population" node="population/@topiaId"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SetOfVesselsImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SetOfVesselsImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SetOfVesselsImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.SetOfVesselsImpl" table="setOfVessels" node="fr.ifremer.isisfish.entities.SetOfVesselsImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.SetOfVessels" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="numberOfVessels" type="int" access="field" column="numberOfVessels" node="numberOfVessels"/> - <property name="fixedCosts" type="double" access="field" column="fixedCosts" node="fixedCosts"/> - <property name="vesselCosts" type="double" access="field" column="vesselCosts" node="vesselCosts"/> - <property name="capitalDeprecation" type="double" access="field" column="capitalDeprecation" node="capitalDeprecation"/> - <property name="interestCost" type="double" access="field" column="interestCost" node="interestCost"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <many-to-one name="port" class="fr.ifremer.isisfish.entities.PortImpl" column="port" node="port/@topiaId" embed-xml="false"/> - <bag name="possibleMetiers" lazy="true" cascade="all,delete-orphan" node="possibleMetiers" embed-xml="true"> - <key column="setOfVessels"/> - <one-to-many class="fr.ifremer.isisfish.entities.EffortDescriptionImpl" node="topiaId" embed-xml="false"/> - </bag> - <many-to-one name="vesselType" class="fr.ifremer.isisfish.entities.VesselTypeImpl" column="vesselType" node="vesselType/@topiaId" embed-xml="false"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.SetOfVesselsImpl" node="fr.ifremer.isisfish.entities.SetOfVesselsImpl" proxy="fr.ifremer.isisfish.entities.SetOfVessels" table="setOfVessels"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="numberOfVessels" name="numberOfVessels" node="numberOfVessels" type="int"/> + <property access="field" column="fixedCosts" name="fixedCosts" node="fixedCosts" type="double"/> + <property access="field" column="vesselCosts" name="vesselCosts" node="vesselCosts" type="double"/> + <property access="field" column="capitalDeprecation" name="capitalDeprecation" node="capitalDeprecation" type="double"/> + <property access="field" column="interestCost" name="interestCost" node="interestCost" type="double"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <many-to-one class="fr.ifremer.isisfish.entities.PortImpl" column="port" embed-xml="false" name="port" node="port/@topiaId"/> + <bag cascade="all,delete-orphan" embed-xml="true" lazy="true" name="possibleMetiers" node="possibleMetiers"> + <key column="setOfVessels"/> + <one-to-many class="fr.ifremer.isisfish.entities.EffortDescriptionImpl" embed-xml="false" node="topiaId"/> + </bag> + <many-to-one class="fr.ifremer.isisfish.entities.VesselTypeImpl" column="vesselType" embed-xml="false" name="vesselType" node="vesselType/@topiaId"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SpeciesImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SpeciesImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/SpeciesImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,23 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.SpeciesImpl" table="species" node="fr.ifremer.isisfish.entities.SpeciesImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Species" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="scientificName" type="text" access="field" column="scientificName" node="scientificName"/> - <property name="codeRubbin" type="text" access="field" column="codeRubbin" node="codeRubbin"/> - <property name="codeCEE" type="int" access="field" column="codeCEE" node="codeCEE"/> - <property name="ageGroupType" type="boolean" access="field" column="ageGroupType" node="ageGroupType"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <bag name="metierSeasonInfoTargetSpecies" inverse="true" lazy="true" cascade="all,delete-orphan" node="metierSeasonInfoTargetSpecies" embed-xml="true"> - <key column="species"/> - <one-to-many class="fr.ifremer.isisfish.entities.TargetSpeciesImpl" node="topiaId" embed-xml="false"/> - </bag> - <bag name="population" inverse="true" lazy="true" cascade="all,delete-orphan" node="population" embed-xml="true"> - <key column="species"/> - <one-to-many class="fr.ifremer.isisfish.entities.PopulationImpl" node="topiaId" embed-xml="false"/> - </bag> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.SpeciesImpl" node="fr.ifremer.isisfish.entities.SpeciesImpl" proxy="fr.ifremer.isisfish.entities.Species" table="species"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="scientificName" name="scientificName" node="scientificName" type="text"/> + <property access="field" column="codeRubbin" name="codeRubbin" node="codeRubbin" type="text"/> + <property access="field" column="codeCEE" name="codeCEE" node="codeCEE" type="int"/> + <property access="field" column="ageGroupType" name="ageGroupType" node="ageGroupType" type="boolean"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <bag cascade="all,delete-orphan" embed-xml="true" inverse="true" lazy="true" name="metierSeasonInfoTargetSpecies" node="metierSeasonInfoTargetSpecies"> + <key column="species"/> + <one-to-many class="fr.ifremer.isisfish.entities.TargetSpeciesImpl" embed-xml="false" node="topiaId"/> + </bag> + <bag cascade="all,delete-orphan" embed-xml="true" inverse="true" lazy="true" name="population" node="population"> + <key column="species"/> + <one-to-many class="fr.ifremer.isisfish.entities.PopulationImpl" embed-xml="false" node="topiaId"/> + </bag> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/StrategyImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/StrategyImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/StrategyImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,17 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.StrategyImpl" table="strategy" node="fr.ifremer.isisfish.entities.StrategyImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Strategy" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="proportionSetOfVessels" type="double" access="field" column="proportionSetOfVessels" node="proportionSetOfVessels"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <many-to-one name="setOfVessels" class="fr.ifremer.isisfish.entities.SetOfVesselsImpl" column="setOfVessels" node="setOfVessels/@topiaId" embed-xml="false"/> - <bag name="strategyMonthInfo" order-by="month" inverse="true" lazy="true" cascade="all,delete-orphan" node="strategyMonthInfo" embed-xml="true"> - <key column="strategy"/> - <one-to-many class="fr.ifremer.isisfish.entities.StrategyMonthInfoImpl" node="topiaId" embed-xml="false"/> - </bag> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.StrategyImpl" node="fr.ifremer.isisfish.entities.StrategyImpl" proxy="fr.ifremer.isisfish.entities.Strategy" table="strategy"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="proportionSetOfVessels" name="proportionSetOfVessels" node="proportionSetOfVessels" type="double"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <many-to-one class="fr.ifremer.isisfish.entities.SetOfVesselsImpl" column="setOfVessels" embed-xml="false" name="setOfVessels" node="setOfVessels/@topiaId"/> + <bag cascade="all,delete-orphan" embed-xml="true" inverse="true" lazy="true" name="strategyMonthInfo" node="strategyMonthInfo" order-by="month"> + <key column="strategy"/> + <one-to-many class="fr.ifremer.isisfish.entities.StrategyMonthInfoImpl" embed-xml="false" node="topiaId"/> + </bag> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,21 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.StrategyMonthInfoImpl" table="strategyMonthInfo" node="fr.ifremer.isisfish.entities.StrategyMonthInfoImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.StrategyMonthInfo" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="month" type="fr.ifremer.isisfish.types.hibernate.MonthType" access="field" column="month" node="month"/> - <property name="minInactivityDays" type="int" access="field" column="minInactivityDays" node="minInactivityDays"/> - <property name="numberOfTrips" type="int" access="field" column="numberOfTrips" node="numberOfTrips"/> - <property name="proportionMetier" type="fr.ifremer.isisfish.types.hibernate.MatrixType" access="field" > - <column name="proportionMetier_name"/> - <column name="proportionMetier_dim"/> - <column name="proportionMetier_dimNames"/> - <column name="proportionMetier_semantics"/> - <column name="proportionMetier_data"/> - </property> - <many-to-one name="tripType" class="fr.ifremer.isisfish.entities.TripTypeImpl" column="tripType" node="tripType/@topiaId" embed-xml="false"/> - <many-to-one name="strategy" class="fr.ifremer.isisfish.entities.StrategyImpl" column="strategy" node="strategy/@topiaId" embed-xml="false"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.StrategyMonthInfoImpl" node="fr.ifremer.isisfish.entities.StrategyMonthInfoImpl" proxy="fr.ifremer.isisfish.entities.StrategyMonthInfo" table="strategyMonthInfo"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="month" name="month" node="month" type="fr.ifremer.isisfish.types.hibernate.MonthType"/> + <property access="field" column="minInactivityDays" name="minInactivityDays" node="minInactivityDays" type="int"/> + <property access="field" column="numberOfTrips" name="numberOfTrips" node="numberOfTrips" type="int"/> + <property access="field" name="proportionMetier" type="fr.ifremer.isisfish.types.hibernate.MatrixType"> + <column name="proportionMetier_name"/> + <column name="proportionMetier_dim"/> + <column name="proportionMetier_dimNames"/> + <column name="proportionMetier_semantics"/> + <column name="proportionMetier_data"/> + </property> + <many-to-one class="fr.ifremer.isisfish.entities.TripTypeImpl" column="tripType" embed-xml="false" name="tripType" node="tripType/@topiaId"/> + <many-to-one class="fr.ifremer.isisfish.entities.StrategyImpl" column="strategy" embed-xml="false" name="strategy" node="strategy/@topiaId"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/TargetSpeciesImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/TargetSpeciesImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/TargetSpeciesImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.TargetSpeciesImpl" table="targetSpecies" node="fr.ifremer.isisfish.entities.TargetSpeciesImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.TargetSpecies" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <many-to-one name="targetFactorEquation" class="fr.ifremer.isisfish.entities.EquationImpl" column="targetFactorEquation" cascade="delete" node="targetFactorEquation/@topiaId" embed-xml="false"/> - <property name="primaryCatch" type="boolean" access="field" column="primaryCatch" node="primaryCatch"/> - <many-to-one name="species" class="fr.ifremer.isisfish.entities.SpeciesImpl" column="species" node="species/@topiaId" embed-xml="false"/> - <many-to-one name="metierSeasonInfo" class="fr.ifremer.isisfish.entities.MetierSeasonInfoImpl" column="metierSeasonInfo" node="metierSeasonInfo/@topiaId" embed-xml="false"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.TargetSpeciesImpl" node="fr.ifremer.isisfish.entities.TargetSpeciesImpl" proxy="fr.ifremer.isisfish.entities.TargetSpecies" table="targetSpecies"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <many-to-one cascade="delete" class="fr.ifremer.isisfish.entities.EquationImpl" column="targetFactorEquation" embed-xml="false" name="targetFactorEquation" node="targetFactorEquation/@topiaId"/> + <property access="field" column="primaryCatch" name="primaryCatch" node="primaryCatch" type="boolean"/> + <many-to-one class="fr.ifremer.isisfish.entities.SpeciesImpl" column="species" embed-xml="false" name="species" node="species/@topiaId"/> + <many-to-one class="fr.ifremer.isisfish.entities.MetierSeasonInfoImpl" column="metierSeasonInfo" embed-xml="false" name="metierSeasonInfo" node="metierSeasonInfo/@topiaId"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/TripTypeImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/TripTypeImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/TripTypeImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.TripTypeImpl" table="tripType" node="fr.ifremer.isisfish.entities.TripTypeImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.TripType" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="tripDuration" type="fr.ifremer.isisfish.types.hibernate.TimeUnitType" access="field" column="tripDuration" node="tripDuration"/> - <property name="minTimeBetweenTrip" type="fr.ifremer.isisfish.types.hibernate.TimeUnitType" access="field" column="minTimeBetweenTrip" node="minTimeBetweenTrip"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.TripTypeImpl" node="fr.ifremer.isisfish.entities.TripTypeImpl" proxy="fr.ifremer.isisfish.entities.TripType" table="tripType"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="tripDuration" name="tripDuration" node="tripDuration" type="fr.ifremer.isisfish.types.hibernate.TimeUnitType"/> + <property access="field" column="minTimeBetweenTrip" name="minTimeBetweenTrip" node="minTimeBetweenTrip" type="fr.ifremer.isisfish.types.hibernate.TimeUnitType"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/VesselTypeImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/VesselTypeImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/VesselTypeImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,21 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.VesselTypeImpl" table="vesselType" node="fr.ifremer.isisfish.entities.VesselTypeImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.VesselType" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="length" type="int" access="field" column="length" node="length"/> - <property name="speed" type="double" access="field" column="speed" node="speed"/> - <property name="maxTripDuration" type="fr.ifremer.isisfish.types.hibernate.TimeUnitType" access="field" column="maxTripDuration" node="maxTripDuration"/> - <property name="activityRange" type="double" access="field" column="activityRange" node="activityRange"/> - <property name="minCrewSize" type="int" access="field" column="minCrewSize" node="minCrewSize"/> - <property name="unitFuelCostOfTravel" type="double" access="field" column="unitFuelCostOfTravel" node="unitFuelCostOfTravel"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <bag name="tripType" table="triptype_vesseltype" lazy="true" node="tripType" embed-xml="true"> - <key column="vesselType"/> - <many-to-many class="fr.ifremer.isisfish.entities.TripTypeImpl" column="tripType" node="topiaId"/> - </bag> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.VesselTypeImpl" node="fr.ifremer.isisfish.entities.VesselTypeImpl" proxy="fr.ifremer.isisfish.entities.VesselType" table="vesselType"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="length" name="length" node="length" type="int"/> + <property access="field" column="speed" name="speed" node="speed" type="double"/> + <property access="field" column="maxTripDuration" name="maxTripDuration" node="maxTripDuration" type="fr.ifremer.isisfish.types.hibernate.TimeUnitType"/> + <property access="field" column="activityRange" name="activityRange" node="activityRange" type="double"/> + <property access="field" column="minCrewSize" name="minCrewSize" node="minCrewSize" type="int"/> + <property access="field" column="unitFuelCostOfTravel" name="unitFuelCostOfTravel" node="unitFuelCostOfTravel" type="double"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <bag embed-xml="true" lazy="true" name="tripType" node="tripType" table="triptype_vesseltype"> + <key column="vesselType"/> + <many-to-many class="fr.ifremer.isisfish.entities.TripTypeImpl" column="tripType" node="topiaId"/> + </bag> + </class> </hibernate-mapping> Modified: isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ZoneImpl.hbm.xml =================================================================== --- isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ZoneImpl.hbm.xml 2008-11-21 09:44:51 UTC (rev 1612) +++ isis-fish/trunk/src/main/resources/oldmappings/IsisFish/0/fr/ifremer/isisfish/entities/ZoneImpl.hbm.xml 2008-11-21 12:42:36 UTC (rev 1613) @@ -1,15 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.isisfish.entities"> - <class name="fr.ifremer.isisfish.entities.ZoneImpl" table="zone" node="fr.ifremer.isisfish.entities.ZoneImpl" abstract="false" proxy="fr.ifremer.isisfish.entities.Zone" > - <id name="topiaId" type="string" length="255" node="@topiaId"/> - <version name="topiaVersion" type="long" node="@topiaVersion"/> - <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/> - <property name="name" type="text" access="field" column="name" node="name"/> - <property name="comment" type="text" access="field" column="comment" node="comment"/> - <bag name="cell" table="cell_zone" lazy="true" node="cell" embed-xml="true"> - <key column="zone"/> - <many-to-many class="fr.ifremer.isisfish.entities.CellImpl" column="cell" node="topiaId"/> - </bag> - </class> +<hibernate-mapping auto-import="true" default-access="field" package="fr.ifremer.isisfish.entities"> + <class abstract="false" name="fr.ifremer.isisfish.entities.ZoneImpl" node="fr.ifremer.isisfish.entities.ZoneImpl" proxy="fr.ifremer.isisfish.entities.Zone" table="zone"> + <id length="255" name="topiaId" node="@topiaId" type="string"/> + <version name="topiaVersion" node="@topiaVersion" type="long"/> + <property name="topiaCreateDate" node="@topiaCreateDate" type="date"/> + <property access="field" column="name" name="name" node="name" type="text"/> + <property access="field" column="comment" name="comment" node="comment" type="text"/> + <bag embed-xml="true" lazy="true" name="cell" node="cell" table="cell_zone"> + <key column="zone"/> + <many-to-many class="fr.ifremer.isisfish.entities.CellImpl" column="cell" node="topiaId"/> + </bag> + </class> </hibernate-mapping>
participants (1)
-
sletellier@users.labs.libre-entreprise.org