Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- 3175 discussions
r4205 - in trunk: . src/main/java/fr/ifremer/isisfish/logging src/main/java/fr/ifremer/isisfish/logging/console src/main/java/fr/ifremer/isisfish/logging/io src/main/java/fr/ifremer/isisfish/ui/logging src/main/java/fr/ifremer/isisfish/ui/queue src/main/java/fr/ifremer/isisfish/ui/result src/main/java/fr/ifremer/isisfish/ui/widget src/main/java/fr/ifremer/isisfish/ui/widget/text src/main/resources/i18n
by echatellier@users.forge.codelutin.com 22 Apr '15
by echatellier@users.forge.codelutin.com 22 Apr '15
22 Apr '15
Author: echatellier
Date: 2015-04-22 15:09:18 +0000 (Wed, 22 Apr 2015)
New Revision: 4205
Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4205
Log:
Improve log console (broken offset with accent)
Added:
trunk/src/main/java/fr/ifremer/isisfish/ui/logging/LoggingFrame.java
trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/
trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java
trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java
trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java
trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java
trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/package-info.java
Modified:
trunk/pom.xml
trunk/src/main/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java
trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogConsole.java
trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogConsoleHandler.java
trunk/src/main/java/fr/ifremer/isisfish/logging/io/OffsetReader.java
trunk/src/main/java/fr/ifremer/isisfish/ui/queue/QueueAction.java
trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultHandler.java
trunk/src/main/resources/i18n/isis-fish_en_GB.properties
trunk/src/main/resources/i18n/isis-fish_fr_FR.properties
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2015-04-21 14:25:19 UTC (rev 4204)
+++ trunk/pom.xml 2015-04-22 15:09:18 UTC (rev 4205)
@@ -115,6 +115,12 @@
<version>2.5.0</version>
<scope>compile</scope>
</dependency>
+
+ <dependency>
+ <groupId>com.fifesoft</groupId>
+ <artifactId>rstaui</artifactId>
+ <version>2.5.0</version>
+ </dependency>
<dependency>
<groupId>javax.mail</groupId>
Modified: trunk/src/main/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java 2015-04-21 14:25:19 UTC (rev 4204)
+++ trunk/src/main/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -27,6 +27,7 @@
import static org.nuiton.i18n.I18n.t;
+import java.awt.Component;
import java.io.File;
import java.io.IOException;
@@ -54,9 +55,6 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(SimulationLoggerUtil.class);
- /** pattern to use for simulation appender */
- public static final String LOG_PATTERN = "%p|%d{ABSOLUTE}|%F|%L|%M|%m%n";
-
/**
* Open a new log console for the given simulation
*
@@ -64,7 +62,7 @@
* @throws IOException
* @throws IllegalArgumentException
*/
- public static void showSimulationLogConsole(String simulationName) throws IllegalArgumentException, IOException {
+ public static void showSimulationLogConsole(Component parent, String simulationName) throws IllegalArgumentException, IOException {
SimulationStorage storage;
storage = SimulationStorage.getSimulation(simulationName);
@@ -76,7 +74,9 @@
String title = t("isisfish.simulation.log.console.title", simulationName);
- LogConsole.newConsole(logFile, smtpServer, defaultFrom, null, title);
+ LogConsole ui = LogConsole.newConsole(logFile, smtpServer, defaultFrom, null, title);
+ ui.setLocationRelativeTo(parent);
+ ui.setVisible(true);
if (log.isInfoEnabled()) {
log.info(t("isisfish.simulation.log.showConsole", simulationName));
Modified: trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogConsole.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogConsole.java 2015-04-21 14:25:19 UTC (rev 4204)
+++ trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogConsole.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -120,9 +120,6 @@
// create ui
ui = new LogConsole(handler, title);
- // launchUI ui
- ui.setVisible(true);
-
// notify the model to adjust the nbLinesInEditor
ui.firePropertyChange(EDITOR_SIZE_CHANGED_PROPERTY, null, ui.getContent());
@@ -263,7 +260,7 @@
sendMail.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- handler.openLogMail();
+ handler.openLogMail(LogConsole.this);
}
});
}
Modified: trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogConsoleHandler.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogConsoleHandler.java 2015-04-21 14:25:19 UTC (rev 4204)
+++ trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogConsoleHandler.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -429,7 +429,7 @@
propertyListeners.removePropertyChangeListener(propertyName, listener);
}
- public void openLogMail() {
+ public void openLogMail(LogConsole parent) {
if (logMail==null) {
logMail = new LogMail(
model.getFrom(),
@@ -437,6 +437,7 @@
model.getLogFile().getParentFile(),
model.getSmtpServer());
}
+ logMail.setLocationRelativeTo(parent);
logMail.setVisible(true);
}
}
Modified: trunk/src/main/java/fr/ifremer/isisfish/logging/io/OffsetReader.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/logging/io/OffsetReader.java 2015-04-21 14:25:19 UTC (rev 4204)
+++ trunk/src/main/java/fr/ifremer/isisfish/logging/io/OffsetReader.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -29,6 +29,7 @@
import java.io.FileReader;
import java.io.IOException;
import java.io.RandomAccessFile;
+import java.nio.charset.StandardCharsets;
import java.util.regex.Pattern;
/**
@@ -128,7 +129,7 @@
storeOffset(nbLines + nbNewLines, offset);
}
- int lineSize = line.length();
+ int lineSize = line.getBytes(StandardCharsets.UTF_8).length;
offset += lineSize;
// must find how many cars after the last car of the line
@@ -201,7 +202,7 @@
long offset = 0;
String line;
while (!(line = readLine(reader)).isEmpty()) {
- int lineSize = line.length();
+ int lineSize = line.getBytes(StandardCharsets.UTF_8).length;
if (lineReader.match(line)) {
storeOffset(nbLines, offset);
nbLines++;
@@ -214,7 +215,7 @@
return nbLines;
}
- protected long createOffsetsForLog(LineReader lineReader) throws IOException {
+ /*protected long createOffsetsForLog(LineReader lineReader) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(lineReader.getFile()));
long nbLines = 0;
@@ -251,7 +252,7 @@
reader.close();
}
return nbLines;
- }
+ }*/
protected long createOffsets(LineReader lineReader, LineReader parent) throws IOException {
long nbLines = 0;
Added: trunk/src/main/java/fr/ifremer/isisfish/ui/logging/LoggingFrame.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/logging/LoggingFrame.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/logging/LoggingFrame.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -0,0 +1,68 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * 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 3 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, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+package fr.ifremer.isisfish.ui.logging;
+
+import static org.nuiton.i18n.I18n.t;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.swing.JFrame;
+
+import org.apache.commons.io.FileUtils;
+
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.ui.widget.text.IsisSyntaxContants;
+import fr.ifremer.isisfish.ui.widget.text.IsisSyntaxEditor;
+
+/**
+ * Standalone frame to display log file with syntax highlight.
+ *
+ * @author Eric Chatellier
+ */
+public class LoggingFrame extends JFrame {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -655585012872692567L;
+
+ protected IsisSyntaxEditor editor;
+
+ public LoggingFrame() {
+ editor = new IsisSyntaxEditor();
+ editor.setStyle(IsisSyntaxContants.SYNTAX_STYLE_LOG);
+
+ add(editor);
+
+ setJMenuBar(editor.createMenuBar(this));
+ setSize(800, 600);
+ }
+
+ public void loadSimulationLog(String simulationName) throws IOException {
+ setTitle(t("isisfish.simulation.log.console.title", simulationName));
+
+ SimulationStorage storage = SimulationStorage.getSimulation(simulationName);
+ File logFile = new File(storage.getSimulationLogFile());
+ String content = FileUtils.readFileToString(logFile);
+ editor.setText(content);
+ }
+}
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/ui/logging/LoggingFrame.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/queue/QueueAction.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/queue/QueueAction.java 2015-04-21 14:25:19 UTC (rev 4204)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/queue/QueueAction.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -126,7 +126,7 @@
String id = selectedJob.getItem().getControl().getId();
try {
- SimulationLoggerUtil.showSimulationLogConsole(id);
+ SimulationLoggerUtil.showSimulationLogConsole(queueUI, id);
} catch (Exception eee) {
if (log.isErrorEnabled()) {
log.error(t("Can't open log for %s", id), eee);
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultHandler.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultHandler.java 2015-04-21 14:25:19 UTC (rev 4204)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultHandler.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -161,7 +161,7 @@
public void showLog(ResultUI resultUI) {
String selected = (String)resultUI.getSimulationComboBox().getSelectedItem();
try {
- SimulationLoggerUtil.showSimulationLogConsole(selected);
+ SimulationLoggerUtil.showSimulationLogConsole(resultUI, selected);
} catch (Exception ex) {
throw new IsisFishRuntimeException("Can't display simulation log", ex);
}
Added: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -0,0 +1,36 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * 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 3 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, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+package fr.ifremer.isisfish.ui.widget.text;
+
+import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
+
+/**
+ * Extends rsyntaxtextarea contantx to add isis specific.
+ *
+ * @author Eric Chatellier
+ */
+public interface IsisSyntaxContants extends SyntaxConstants {
+
+ public static final String SYNTAX_STYLE_LOG = "isisfish-log";
+
+}
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -0,0 +1,221 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * 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 3 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, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+package fr.ifremer.isisfish.ui.widget.text;
+
+import static org.nuiton.i18n.I18n.t;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.KeyStroke;
+import javax.swing.UIManager;
+import javax.swing.text.BadLocationException;
+
+import org.fife.rsta.ui.GoToDialog;
+import org.fife.rsta.ui.search.FindDialog;
+import org.fife.rsta.ui.search.ReplaceDialog;
+import org.fife.rsta.ui.search.SearchDialogSearchContext;
+import org.fife.ui.rsyntaxtextarea.RSyntaxDocument;
+import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
+import org.fife.ui.rsyntaxtextarea.SyntaxScheme;
+import org.fife.ui.rsyntaxtextarea.Token;
+import org.fife.ui.rtextarea.RTextScrollPane;
+import org.fife.ui.rtextarea.SearchEngine;
+
+/**
+ * {@link RSyntaxTextArea} component property configured for isis fish.
+ *
+ * @author Eric Chatellier
+ */
+public class IsisSyntaxEditor extends JPanel implements ActionListener {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1427883892685276516L;
+
+ protected RSyntaxTextArea textArea;
+ private FindDialog findDialog;
+ private ReplaceDialog replaceDialog;
+
+ public IsisSyntaxEditor() {
+ super(new BorderLayout());
+ textArea = new RSyntaxTextArea();
+ add(new RTextScrollPane(textArea), BorderLayout.CENTER);
+ setAutoscrolls(false);
+ }
+
+ /**
+ * Set highligth style.
+ *
+ * @param style new style
+ * @see IsisSyntaxContants
+ */
+ public void setStyle(String style) {
+ RSyntaxDocument doc = new RSyntaxDocument(new IsisTokenManagerFactory(), style);
+ textArea.setDocument(doc);
+
+ // special theme for log
+ if (IsisSyntaxContants.SYNTAX_STYLE_LOG.equals(style)) {
+ SyntaxScheme scheme = textArea.getSyntaxScheme();
+ scheme.getStyle(Token.RESERVED_WORD_2).foreground = Color.RED;
+ }
+ }
+
+ public void setText(String text) {
+ textArea.setText(text);
+ textArea.invalidate();
+ }
+
+ /**
+ * Return menu bar configured for {@code textArea} component.
+ *
+ * @param parent parent
+ * @return JMenuBar instance
+ */
+ public JMenuBar createMenuBar(Frame parent) {
+ JMenuBar mb = new JMenuBar();
+ JMenu menu = new JMenu(t("isisfish.script.search"));
+ menu.add(new JMenuItem(new ShowFindDialogAction()));
+ menu.add(new JMenuItem(new ShowReplaceDialogAction()));
+ menu.add(new JMenuItem(new GoToLineAction(parent)));
+ mb.add(menu);
+
+ initSearchDialogs(parent);
+
+ return mb;
+ }
+
+ /**
+ * Creates our Find and Replace dialogs.
+ */
+ protected void initSearchDialogs(Frame parent) {
+
+ findDialog = new FindDialog(parent, this);
+ replaceDialog = new ReplaceDialog(parent, this);
+
+ // This ties the properties of the two dialogs together (match
+ // case, regex, etc.).
+ replaceDialog.setSearchContext(findDialog.getSearchContext());
+
+ }
+
+ private class GoToLineAction extends AbstractAction {
+ protected Frame parent;
+ public GoToLineAction(Frame parent) {
+ super(t("isisfish.script.gotoline"));
+ this.parent = parent;
+ int c = getToolkit().getMenuShortcutKeyMask();
+ putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_L, c));
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ if (findDialog.isVisible()) {
+ findDialog.setVisible(false);
+ }
+ if (replaceDialog.isVisible()) {
+ replaceDialog.setVisible(false);
+ }
+ GoToDialog dialog = new GoToDialog(this.parent);
+ dialog.setMaxLineNumberAllowed(textArea.getLineCount());
+ dialog.setVisible(true);
+ int line = dialog.getLineNumber();
+ if (line>0) {
+ try {
+ textArea.setCaretPosition(textArea.getLineStartOffset(line-1));
+ } catch (BadLocationException ble) { // Never happens
+ UIManager.getLookAndFeel().provideErrorFeedback(textArea);
+ ble.printStackTrace();
+ }
+ }
+ }
+
+ }
+
+ private class ShowFindDialogAction extends AbstractAction {
+
+ public ShowFindDialogAction() {
+ super(t("isisfish.script.find"));
+ int c = getToolkit().getMenuShortcutKeyMask();
+ putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F, c));
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ if (replaceDialog.isVisible()) {
+ replaceDialog.setVisible(false);
+ }
+ findDialog.setVisible(true);
+ }
+
+ }
+
+ private class ShowReplaceDialogAction extends AbstractAction {
+
+ public ShowReplaceDialogAction() {
+ super(t("isisfish.script.replace"));
+ int c = getToolkit().getMenuShortcutKeyMask();
+ putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_H, c));
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ if (findDialog.isVisible()) {
+ findDialog.setVisible(false);
+ }
+ replaceDialog.setVisible(true);
+ }
+
+ }
+
+ /**
+ * Listens for events from our search dialogs and actually does the dirty
+ * work.
+ */
+ public void actionPerformed(ActionEvent e) {
+
+ String command = e.getActionCommand();
+ SearchDialogSearchContext context = findDialog.getSearchContext();
+
+ if (FindDialog.ACTION_FIND.equals(command)) {
+ if (!SearchEngine.find(textArea, context)) {
+ UIManager.getLookAndFeel().provideErrorFeedback(textArea);
+ }
+ } else if (ReplaceDialog.ACTION_REPLACE.equals(command)) {
+ if (!SearchEngine.replace(textArea, context)) {
+ UIManager.getLookAndFeel().provideErrorFeedback(textArea);
+ }
+ } else if (ReplaceDialog.ACTION_REPLACE_ALL.equals(command)) {
+ int count = SearchEngine.replaceAll(textArea, context);
+ JOptionPane.showMessageDialog(null, count
+ + " occurrences replaced.");
+ }
+
+ }
+}
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -0,0 +1,60 @@
+package fr.ifremer.isisfish.ui.widget.text;
+
+import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
+
+/**
+ * Extends rsyntaxtextarea factory to add Isis fish specific style.
+ *
+ * @author Eric Chatellier
+ */
+public class IsisTokenManagerFactory extends AbstractTokenMakerFactory implements IsisSyntaxContants {
+
+ @Override
+ protected void initTokenMakerMap() {
+ // isis support for log
+ putMapping(SYNTAX_STYLE_LOG, IsisTokenMarker.class.getName());
+
+ // default code
+ String pkg = "org.fife.ui.rsyntaxtextarea.modes.";
+
+ putMapping(SYNTAX_STYLE_NONE, pkg + "PlainTextTokenMaker");
+ putMapping(SYNTAX_STYLE_ACTIONSCRIPT, pkg + "ActionScriptTokenMaker");
+ putMapping(SYNTAX_STYLE_ASSEMBLER_X86, pkg + "AssemblerX86TokenMaker");
+ putMapping(SYNTAX_STYLE_BBCODE, pkg + "BBCodeTokenMaker");
+ putMapping(SYNTAX_STYLE_C, pkg + "CTokenMaker");
+ putMapping(SYNTAX_STYLE_CLOJURE, pkg + "ClojureTokenMaker");
+ putMapping(SYNTAX_STYLE_CPLUSPLUS, pkg + "CPlusPlusTokenMaker");
+ putMapping(SYNTAX_STYLE_CSHARP, pkg + "CSharpTokenMaker");
+ putMapping(SYNTAX_STYLE_CSS, pkg + "CSSTokenMaker");
+ putMapping(SYNTAX_STYLE_DELPHI, pkg + "DelphiTokenMaker");
+ putMapping(SYNTAX_STYLE_DTD, pkg + "DtdTokenMaker");
+ putMapping(SYNTAX_STYLE_FORTRAN, pkg + "FortranTokenMaker");
+ putMapping(SYNTAX_STYLE_GROOVY, pkg + "GroovyTokenMaker");
+ putMapping(SYNTAX_STYLE_HTACCESS, pkg + "HtaccessTokenMaker");
+ putMapping(SYNTAX_STYLE_HTML, pkg + "HTMLTokenMaker");
+ putMapping(SYNTAX_STYLE_JAVA, pkg + "JavaTokenMaker");
+ putMapping(SYNTAX_STYLE_JAVASCRIPT, pkg + "JavaScriptTokenMaker");
+ putMapping(SYNTAX_STYLE_JSON, pkg + "JsonTokenMaker");
+ putMapping(SYNTAX_STYLE_JSP, pkg + "JSPTokenMaker");
+ putMapping(SYNTAX_STYLE_LATEX, pkg + "LatexTokenMaker");
+ putMapping(SYNTAX_STYLE_LISP, pkg + "LispTokenMaker");
+ putMapping(SYNTAX_STYLE_LUA, pkg + "LuaTokenMaker");
+ putMapping(SYNTAX_STYLE_MAKEFILE, pkg + "MakefileTokenMaker");
+ putMapping(SYNTAX_STYLE_MXML, pkg + "MxmlTokenMaker");
+ putMapping(SYNTAX_STYLE_NSIS, pkg + "NSISTokenMaker");
+ putMapping(SYNTAX_STYLE_PERL, pkg + "PerlTokenMaker");
+ putMapping(SYNTAX_STYLE_PHP, pkg + "PHPTokenMaker");
+ putMapping(SYNTAX_STYLE_PROPERTIES_FILE,pkg + "PropertiesFileTokenMaker");
+ putMapping(SYNTAX_STYLE_PYTHON, pkg + "PythonTokenMaker");
+ putMapping(SYNTAX_STYLE_RUBY, pkg + "RubyTokenMaker");
+ putMapping(SYNTAX_STYLE_SAS, pkg + "SASTokenMaker");
+ putMapping(SYNTAX_STYLE_SCALA, pkg + "ScalaTokenMaker");
+ putMapping(SYNTAX_STYLE_SQL, pkg + "SQLTokenMaker");
+ putMapping(SYNTAX_STYLE_TCL, pkg + "TclTokenMaker");
+ putMapping(SYNTAX_STYLE_UNIX_SHELL, pkg + "UnixShellTokenMaker");
+ putMapping(SYNTAX_STYLE_VISUAL_BASIC, pkg + "VisualBasicTokenMaker");
+ putMapping(SYNTAX_STYLE_WINDOWS_BATCH, pkg + "WindowsBatchTokenMaker");
+ putMapping(SYNTAX_STYLE_XML, pkg + "XMLTokenMaker");
+ }
+
+}
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -0,0 +1,244 @@
+package fr.ifremer.isisfish.ui.widget.text;
+
+import javax.swing.text.Segment;
+
+import org.fife.ui.rsyntaxtextarea.AbstractTokenMaker;
+import org.fife.ui.rsyntaxtextarea.RSyntaxUtilities;
+import org.fife.ui.rsyntaxtextarea.Token;
+import org.fife.ui.rsyntaxtextarea.TokenMap;
+
+public class IsisTokenMarker extends AbstractTokenMaker {
+
+ private int currentTokenStart;
+ private int currentTokenType;
+
+ @Override
+ public Token getTokenList(Segment text, int initialTokenType, int startOffset) {
+ resetTokenList();
+
+ char[] array = text.array;
+ int offset = text.offset;
+ int count = text.count;
+ int end = offset + count;
+
+ // See, when we find a token, its starting position is always of the form:
+ // 'startOffset + (currentTokenStart-offset)'; but since startOffset and
+ // offset are constant, tokens' starting positions become:
+ // 'newStartOffset+currentTokenStart' for one less subtraction operation.
+ int newStartOffset = startOffset - offset;
+
+ currentTokenStart = offset;
+ currentTokenType = initialTokenType;
+
+//beginning:
+ for (int i=offset; i<end; i++) {
+
+ char c = array[i];
+
+ switch (currentTokenType) {
+
+ case Token.NULL:
+
+ currentTokenStart = i; // Starting a new token here.
+
+ switch (c) {
+
+ case ' ':
+ case '\t':
+ currentTokenType = Token.WHITESPACE;
+ break;
+
+ case '"':
+ currentTokenType = Token.ERROR_STRING_DOUBLE;
+ break;
+
+ // The "separators".
+ case '|':
+ addToken(text, currentTokenStart,i, Token.SEPARATOR, newStartOffset+currentTokenStart);
+ currentTokenType = Token.NULL;
+ break;
+
+ default:
+
+ // Just to speed things up a tad, as this will usually be the case (if spaces above failed).
+ if (RSyntaxUtilities.isLetterOrDigit(c) || c=='\\') {
+ currentTokenType = Token.IDENTIFIER;
+ break;
+ }
+
+
+ currentTokenType = Token.IDENTIFIER;
+ break;
+
+ } // End of switch (c).
+
+ break;
+
+ case Token.WHITESPACE:
+
+ switch (c) {
+
+ case ' ':
+ case '\t':
+ break; // Still whitespace.
+
+ case '"':
+ addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart);
+ currentTokenStart = i;
+ currentTokenType = Token.ERROR_STRING_DOUBLE;
+ break;
+
+ // The "separators".
+ case '|':
+ addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart);
+ addToken(text, i,i, Token.SEPARATOR, newStartOffset+i);
+ currentTokenType = Token.NULL;
+ break;
+
+ default: // Add the whitespace token and start anew.
+
+ addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart);
+ currentTokenStart = i;
+
+ // Just to speed things up a tad, as this will usually be the case (if spaces above failed).
+ if (RSyntaxUtilities.isLetterOrDigit(c) || c=='\\') {
+ currentTokenType = Token.IDENTIFIER;
+ break;
+ }
+
+
+ currentTokenType = Token.IDENTIFIER;
+
+ } // End of switch (c).
+
+ break;
+
+ default: // Should never happen
+ case Token.IDENTIFIER:
+
+ switch (c) {
+
+ case ' ':
+ case '\t':
+ // Check for REM comments.
+ if (i-currentTokenStart==3 &&
+ (array[i-3]=='r' || array[i-3]=='R') &&
+ (array[i-2]=='e' || array[i-2]=='E') &&
+ (array[i-1]=='m' || array[i-1]=='M')) {
+ currentTokenType = Token.COMMENT_EOL;
+ break;
+ }
+ addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart);
+ currentTokenStart = i;
+ currentTokenType = Token.WHITESPACE;
+ break;
+
+ case '"':
+ addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart);
+ currentTokenStart = i;
+ currentTokenType = Token.ERROR_STRING_DOUBLE;
+ break;
+
+ // The "separators".
+ case '|':
+ addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart);
+ addToken(text, i,i, Token.SEPARATOR, newStartOffset+i);
+ currentTokenType = Token.NULL;
+ break;
+
+
+ default:
+
+ // Just to speed things up a tad, as this will usually be the case.
+ if (RSyntaxUtilities.isLetterOrDigit(c) || c=='\\') {
+ break;
+ }
+
+ // Otherwise, fall through and assume we're still okay as an IDENTIFIER...
+
+ } // End of switch (c).
+
+ break;
+
+ case Token.COMMENT_EOL:
+ i = end - 1;
+ addToken(text, currentTokenStart,i, Token.COMMENT_EOL, newStartOffset+currentTokenStart);
+ // We need to set token type to null so at the bottom we don't add one more token.
+ currentTokenType = Token.NULL;
+ break;
+
+ case Token.PREPROCESSOR: // Used for labels
+ i = end - 1;
+ addToken(text, currentTokenStart,i, Token.PREPROCESSOR, newStartOffset+currentTokenStart);
+ // We need to set token type to null so at the bottom we don't add one more token.
+ currentTokenType = Token.NULL;
+ break;
+
+ case Token.ERROR_STRING_DOUBLE:
+
+ if (c=='"') {
+ addToken(text, currentTokenStart,i, Token.LITERAL_STRING_DOUBLE_QUOTE, newStartOffset+currentTokenStart);
+ currentTokenStart = i + 1;
+ currentTokenType = Token.NULL;
+ }
+ // Otherwise, we're still an unclosed string...
+
+ break;
+
+ } // End of switch (currentTokenType).
+
+ } // End of for (int i=offset; i<end; i++).
+
+ // Deal with the (possibly there) last token.
+ if (currentTokenType != Token.NULL) {
+
+ // Check for REM comments.
+ if (end-currentTokenStart==3 &&
+ (array[end-3]=='r' || array[end-3]=='R') &&
+ (array[end-2]=='e' || array[end-2]=='E') &&
+ (array[end-1]=='m' || array[end-1]=='M')) {
+ currentTokenType = Token.COMMENT_EOL;
+ }
+
+ addToken(text, currentTokenStart,end-1, currentTokenType, newStartOffset+currentTokenStart);
+ }
+
+ addNullToken();
+
+ // Return the first token in our linked list.
+ return firstToken;
+
+ }
+
+ @Override
+ public TokenMap getWordsToHighlight() {
+ TokenMap tokenMap = new TokenMap();
+
+ tokenMap.put("FATAL", Token.RESERVED_WORD_2);
+ tokenMap.put("ERROR", Token.RESERVED_WORD_2);
+ tokenMap.put("INFO", Token.RESERVED_WORD);
+ tokenMap.put("DEBUG", Token.RESERVED_WORD);
+ tokenMap.put("TRACE", Token.RESERVED_WORD);
+
+ return tokenMap;
+ }
+
+ @Override
+ public void addToken(Segment segment, int start, int end, int tokenType, int startOffset) {
+
+ switch (tokenType) {
+ // Since reserved words, functions, and data types are all passed
+ // into here as "identifiers," we have to see what the token
+ // really is...
+ case Token.IDENTIFIER:
+ int value = wordsToHighlight.get(segment, start,end);
+ if (value!=-1)
+ tokenType = value;
+ break;
+ }
+
+ super.addToken(segment, start, end, tokenType, startOffset);
+
+ }
+
+}
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/package-info.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/package-info.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/package-info.java 2015-04-22 15:09:18 UTC (rev 4205)
@@ -0,0 +1,28 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2015 Ifremer, CodeLutin, Chatellier Eric
+ * %%
+ * 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 3 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, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Customization of rsyntaxtextarea editor for isisfish.
+ */
+package fr.ifremer.isisfish.ui.widget.text;
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/src/main/resources/i18n/isis-fish_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/isis-fish_en_GB.properties 2015-04-21 14:25:19 UTC (rev 4204)
+++ trunk/src/main/resources/i18n/isis-fish_en_GB.properties 2015-04-22 15:09:18 UTC (rev 4205)
@@ -867,6 +867,8 @@
isisfish.script.export.tooltip=Export selected script(s) to zip archive
isisfish.script.export.tooltip.checkAll=(Un)Check all scripts to export
isisfish.script.export.tooltip.chooseDir=Choose directory to export script to
+isisfish.script.find=Find...
+isisfish.script.gotoline=Got to line...
isisfish.script.import=Import scripts from archive
isisfish.script.import.cancel=Cancel
isisfish.script.import.checkAll=(Un)Check all script to import
@@ -914,8 +916,10 @@
isisfish.script.newplus=New ►
isisfish.script.paste=Paste
isisfish.script.paste.tooltip=Paste current selection (Ctrl-v)
+isisfish.script.replace=Replace...
isisfish.script.save=Save
isisfish.script.save.tooltip=Save script
+isisfish.script.search=Search
isisfish.script.title=Script Editor
isisfish.season.toString=season %1$s-%2$s
isisfish.selectivity.equation=Equation
Modified: trunk/src/main/resources/i18n/isis-fish_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/isis-fish_fr_FR.properties 2015-04-21 14:25:19 UTC (rev 4204)
+++ trunk/src/main/resources/i18n/isis-fish_fr_FR.properties 2015-04-22 15:09:18 UTC (rev 4205)
@@ -865,6 +865,8 @@
isisfish.script.export.tooltip=Exporter les scripts sélectionnés vers une archive zip
isisfish.script.export.tooltip.checkAll=(Dé-)Sélectionner tous les scripts à exporter
isisfish.script.export.tooltip.chooseDir=Choisir le répertoire où exporter les scripts
+isisfish.script.find=Rechercher...
+isisfish.script.gotoline=Aller à la ligne...
isisfish.script.import=Importer des scripts depuis une archive zip
isisfish.script.import.cancel=Annuler
isisfish.script.import.checkAll=Tout (dé-)sélectionner
@@ -912,8 +914,10 @@
isisfish.script.newplus=Nouveau ►
isisfish.script.paste=Coller
isisfish.script.paste.tooltip=Colle la sélection courante (Ctrl-v)
+isisfish.script.replace=Remplacer...
isisfish.script.save=Sauver
isisfish.script.save.tooltip=Sauve le script
+isisfish.script.search=Rechercher
isisfish.script.title=Editeur de scripts
isisfish.season.toString=saison %1$s-%2$s
isisfish.selectivity.equation=Equation
1
0
r4204 - trunk/src/main/java/fr/ifremer/isisfish/ui
by echatellier@users.forge.codelutin.com 21 Apr '15
by echatellier@users.forge.codelutin.com 21 Apr '15
21 Apr '15
Author: echatellier
Date: 2015-04-21 14:25:19 +0000 (Tue, 21 Apr 2015)
New Revision: 4204
Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4204
Log:
Update java 8 api
Modified:
trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeHandler.java
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeHandler.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeHandler.java 2015-04-21 14:06:30 UTC (rev 4203)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeHandler.java 2015-04-21 14:25:19 UTC (rev 4204)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2011 Ifremer, Codelutin, Chatellier Eric
+ * Copyright (C) 2011 - 2015 Ifremer, Codelutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -87,7 +87,7 @@
static {
URLSALIAS.put("ISISFISH", "http://www.isis-fish.org/");
- URLSALIAS.put("JAVA_API", "http://docs.oracle.com/javase/6/docs/api/index.html");
+ URLSALIAS.put("JAVA_API", "https://docs.oracle.com/javase/8/docs/api/");
URLSALIAS.put("ISIS_API", "http://www.isis-fish.org/apidocs/index.html");
URLSALIAS.put("MATRIX_API", "http://maven-site.nuiton.org/nuiton-matrix/apidocs/index.html");
URLSALIAS.put("TOPIA_API", "http://maven-site.nuiton.org/topia/topia-persistence/apidocs/index.html");
1
0
r4203 - in trunk/src/main: java/fr/ifremer/isisfish/ui/result resources/i18n
by echatellier@users.forge.codelutin.com 21 Apr '15
by echatellier@users.forge.codelutin.com 21 Apr '15
21 Apr '15
Author: echatellier
Date: 2015-04-21 14:06:30 +0000 (Tue, 21 Apr 2015)
New Revision: 4203
Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4203
Log:
Some fix in result ui
Added:
trunk/src/main/java/fr/ifremer/isisfish/ui/result/package-info.java
Modified:
trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendGraphic.java
trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendModel.java
trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendPanel.java
trunk/src/main/java/fr/ifremer/isisfish/ui/result/MapRendererUI.jaxx
trunk/src/main/java/fr/ifremer/isisfish/ui/result/MatrixMapRenderer.java
trunk/src/main/java/fr/ifremer/isisfish/ui/result/MatrixSummaryRenderer.java
trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultHandler.java
trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultMatrixFilter.java
trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultSimulationFrame.jaxx
trunk/src/main/resources/i18n/isis-fish_en_GB.properties
trunk/src/main/resources/i18n/isis-fish_fr_FR.properties
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendGraphic.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendGraphic.java 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendGraphic.java 2015-04-21 14:06:30 UTC (rev 4203)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2011 Ifremer, Codelutin, Chatellier Eric
+ * Copyright (C) 2011 - 2015 Ifremer, Codelutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -47,7 +47,9 @@
protected LegendModel model;
/**
- * Constructeur
+ * Constructeur.
+ *
+ * @param m model
*/
public LegendGraphic(LegendModel m) {
setModel(m);
@@ -59,7 +61,9 @@
}
/**
- * Dessine sur le graphique la legende courante
+ * Dessine sur le graphique la legende courante.
+ *
+ * @param g graphics
*/
protected void redraw(Graphics g) {
//double coef = (double)getSize().width / (double)(model.getMax()-model.getMin());
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendModel.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendModel.java 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendModel.java 2015-04-21 14:06:30 UTC (rev 4203)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2002 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ * Copyright (C) 2002 - 2015 Ifremer, CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendPanel.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendPanel.java 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/LegendPanel.java 2015-04-21 14:06:30 UTC (rev 4203)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2002 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ * Copyright (C) 2002 - 2015 Ifremer, CodeLutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -73,9 +73,6 @@
graph = new LegendGraphic(this.model);
labelMin = new JLabel(Double.toString(model.getMin()));
labelMax = new JLabel(Double.toString(model.getMax()));
- labelMin.setVisible(true);
- labelMax.setVisible(true);
- graph.setVisible(true);
GridBagConstraints c = null;
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/MapRendererUI.jaxx
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/MapRendererUI.jaxx 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/MapRendererUI.jaxx 2015-04-21 14:06:30 UTC (rev 4203)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2011 Ifremer, CodeLutin, Chatellier Eric
+ Copyright (C) 2011 - 2015 Ifremer, CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -24,11 +24,10 @@
-->
<Table>
<import>
- static org.nuiton.i18n.I18n.t
</import>
<script><![CDATA[
protected void $afterCompleteSetup() {
- //isisMapBean.init(informationDelegator);
+
}
]]></script>
<!-- <row>
@@ -44,12 +43,6 @@
</row>
<row>
<cell fill="horizontal">
- <com.bbn.openmap.InformationDelegator id="informationDelegator"
- showLights="false" />
- </cell>
- </row>
- <row>
- <cell fill="horizontal">
<LegendPanel id="legendPanel" />
</cell>
</row>
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/MatrixMapRenderer.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/MatrixMapRenderer.java 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/MatrixMapRenderer.java 2015-04-21 14:06:30 UTC (rev 4203)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2011 Ifremer, Codelutin, Chatellier Eric
+ * Copyright (C) 2011 - 2015 Ifremer, Codelutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -50,25 +50,11 @@
public MatrixMapRenderer(FisheryRegion fisheryRegion) {
mapRendererUI = new MapRendererUI();
-
- // Create the directional and zoom control tool
- //OMToolSet resultatMapOMTS = new OMToolSet();
- // Associate the tool with the map
- //resultatMapOMTS.setupListeners(mapRendererUI.getIsisMapBean());
- // Add the tool to the map toolbar
- //mapRendererUI.getToolPanel().add((Tool)resultatMapOMTS);
- //mapRendererUI.getInformationDelegator().setMap(getIsisMapBean());
- //mapRendererUI.getInformationDelegator().setShowLights(false);
- //mapRendererUI.getInformationDelegator().setLabel(t("isisfish.simpleResult.more.information"));
-
// set fishery region
mapRendererUI.getIsisMapBean().setFisheryRegion(fisheryRegion);
}
- /*
- * @see org.nuiton.math.matrix.viewer.MatrixRenderer#getComponent(org.nuiton.math.matrix.MatrixND)
- */
@Override
public Component getComponent(MatrixND matrix) {
@@ -78,23 +64,15 @@
mapRendererUI.getIsisMapBean().addResultatLayer(matrix.getName(), layer);
mapRendererUI.getLegendPanel().setModel(new LegendModel(0,Math.round(layer.getDataMapList().getMaxDataMapValue())));
- // poussin 20060822 FIXME: migration vers v3, je ne sais pas comment ca merchait avant, la methode n'existe pas :(
- // getInformationDelegator().addLayer(layer);
return mapRendererUI;
}
- /*
- * @see org.nuiton.math.matrix.viewer.MatrixRenderer#getIcon()
- */
@Override
public Icon getIcon() {
return null;
}
- /*
- * @see org.nuiton.math.matrix.viewer.MatrixRenderer#getName()
- */
@Override
public String getName() {
return t("isisfish.result.map");
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/MatrixSummaryRenderer.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/MatrixSummaryRenderer.java 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/MatrixSummaryRenderer.java 2015-04-21 14:06:30 UTC (rev 4203)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2011 Ifremer, Codelutin, Chatellier Eric
+ * Copyright (C) 2011 - 2015 Ifremer, Codelutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -55,8 +55,8 @@
public class MatrixSummaryRenderer implements MatrixRenderer {
protected static final String ABONDANCE_STRING = n("matrixAbundance");
- protected static final String CAPTUREPARMETIER_STRING = t("matrixCatchPerStrategyMetPerZoneMet");
- protected static final String REJETPARMETIER_STRING = t("matrixDiscardsPerStrMetPerZonePop");
+ protected static final String CAPTUREPARMETIER_STRING = n("matrixCatchPerStrategyMetPerZoneMet");
+ protected static final String REJETPARMETIER_STRING = n("matrixDiscardsPerStrMetPerZonePop");
protected SimulationStorage simulationStorage;
@@ -72,9 +72,6 @@
this.topiaContext = topiaContext;
}
- /*
- * @see org.nuiton.math.matrix.viewer.MatrixRenderer#getComponent(org.nuiton.math.matrix.MatrixND)
- */
@Override
public Component getComponent(MatrixND matrix) {
if (cachedComponent == null) {
@@ -85,10 +82,8 @@
StringBuilder resume = new StringBuilder(params);
resume.append("\n");
- for(String name : resultStorage.getResultName()) {
+ for (String name : resultStorage.getResultName()) {
try {
-
- // TODO EC20090717 ca marche plus ca
if (name.startsWith(ABONDANCE_STRING)){
MatrixND mat1 = resultStorage.getMatrix(new TimeStep(0), name, topiaContext);
mat1 = mat1.sumOverDim(0);
@@ -102,8 +97,6 @@
mat1 = mat1.reduce();
resume.append(t("isisfish.result.end.simulation")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
}
- /*
- un peu long
else if(name.startsWith(REJETPARMETIER_STRING)){
MatrixND mat1 = resultStorage.getMatrix(name, topiaContext);
mat1 = mat1.sumOverDim(0);
@@ -112,7 +105,7 @@
mat1 = mat1.sumOverDim(3);
mat1 = mat1.reduce();
- resume.append(t("isisfish.common.sum")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
+ resume.append(t("isisfish.common.sum")).append(" ").append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
}
else if (!name.startsWith(CAPTUREPARMETIER_STRING)){
MatrixND mat1 = resultStorage.getMatrix(name, topiaContext);
@@ -121,10 +114,10 @@
mat1 = mat1.sumOverDim(2);
mat1 = mat1.reduce();
- resume.append(t("isisfish.common.sum")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
- }*/
+ resume.append(t("isisfish.common.sum")).append(" ").append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
+ }
} catch (Exception eee) {
- resume.append(t("isisfish.error.no.matrix", name));
+ resume.append(t("isisfish.error.no.matrix", name)).append("\n");
}
}
@@ -137,17 +130,11 @@
return cachedComponent;
}
- /*
- * @see org.nuiton.math.matrix.viewer.MatrixRenderer#getIcon()
- */
@Override
public Icon getIcon() {
return null;
}
- /*
- * @see org.nuiton.math.matrix.viewer.MatrixRenderer#getName()
- */
@Override
public String getName() {
return t("isisfish.result.summary");
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultHandler.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultHandler.java 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultHandler.java 2015-04-21 14:06:30 UTC (rev 4203)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2011 Ifremer, Codelutin, Chatellier Eric
+ * Copyright (C) 2011 - 2015 Ifremer, Codelutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -23,8 +23,6 @@
package fr.ifremer.isisfish.ui.result;
-import fr.ifremer.isisfish.IsisConfig;
-
import static org.nuiton.i18n.I18n.t;
import java.awt.BorderLayout;
@@ -33,15 +31,11 @@
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.beans.PropertyVetoException;
-import java.io.BufferedWriter;
import java.io.File;
-import java.io.Writer;
import java.util.List;
import javax.swing.JMenuItem;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.math.matrix.MatrixND;
@@ -57,20 +51,13 @@
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.datastore.StorageException;
import fr.ifremer.isisfish.entities.FisheryRegion;
-import fr.ifremer.isisfish.export.Export;
import fr.ifremer.isisfish.export.ExportHelper;
-import fr.ifremer.isisfish.export.ExportInfo;
-import fr.ifremer.isisfish.export.ExportStep;
import fr.ifremer.isisfish.logging.SimulationLoggerUtil;
import fr.ifremer.isisfish.simulator.launcher.SimulationJob;
import fr.ifremer.isisfish.simulator.launcher.SimulationService;
import fr.ifremer.isisfish.simulator.launcher.SimulationServiceListener;
-import fr.ifremer.isisfish.types.TimeStep;
import fr.ifremer.isisfish.ui.CommonHandler;
import fr.ifremer.isisfish.ui.models.common.GenericComboModel;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-import java.util.zip.GZIPOutputStream;
/**
* Handler for result UIs.
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultMatrixFilter.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultMatrixFilter.java 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultMatrixFilter.java 2015-04-21 14:06:30 UTC (rev 4203)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2011 Ifremer, Codelutin, Chatellier Eric
+ * Copyright (C) 2011 - 2015 Ifremer, Codelutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultSimulationFrame.jaxx
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultSimulationFrame.jaxx 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultSimulationFrame.jaxx 2015-04-21 14:06:30 UTC (rev 4203)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2011 Ifremer, CodeLutin, Chatellier Eric
+ Copyright (C) 2011 - 2015 Ifremer, CodeLutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
Added: trunk/src/main/java/fr/ifremer/isisfish/ui/result/package-info.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/result/package-info.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/result/package-info.java 2015-04-21 14:06:30 UTC (rev 4203)
@@ -0,0 +1,28 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2015 Ifremer, CodeLutin, Chatellier Eric
+ * %%
+ * 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 3 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, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Result view.
+ */
+package fr.ifremer.isisfish.ui.result;
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/ui/result/package-info.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/src/main/resources/i18n/isis-fish_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/isis-fish_en_GB.properties 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/resources/i18n/isis-fish_en_GB.properties 2015-04-21 14:06:30 UTC (rev 4203)
@@ -836,7 +836,7 @@
isisfish.result.choose.simulation=Simulation \:
isisfish.result.end.simulation=Simuation end \:
isisfish.result.export=Export
-isisfish.result.export.file=Export text file
+isisfish.result.export.file=Export CSV file
isisfish.result.map=Map
isisfish.result.matrix.sumbyyearlabel=Year %d
isisfish.result.new.window=Open
Modified: trunk/src/main/resources/i18n/isis-fish_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/isis-fish_fr_FR.properties 2015-04-21 12:44:28 UTC (rev 4202)
+++ trunk/src/main/resources/i18n/isis-fish_fr_FR.properties 2015-04-21 14:06:30 UTC (rev 4203)
@@ -832,9 +832,9 @@
isisfish.queue.title=Queue
isisfish.result.begin.simulation=En début de simulation \:
isisfish.result.choose.simulation=Simulation \:
-isisfish.result.end.simulation=En fin de Simulation\:
+isisfish.result.end.simulation=En fin de simulation \:
isisfish.result.export=Export
-isisfish.result.export.file=Exporter un fichier texte
+isisfish.result.export.file=Exporter un fichier CSV
isisfish.result.map=Carte
isisfish.result.matrix.sumbyyearlabel=Année %d
isisfish.result.new.window=Ouvrir
1
0
21 Apr '15
Author: echatellier
Date: 2015-04-21 12:44:28 +0000 (Tue, 21 Apr 2015)
New Revision: 4202
Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4202
Log:
Prepare next iteration
Modified:
trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
Modified: trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2015-04-21 09:51:00 UTC (rev 4201)
+++ trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2015-04-21 12:44:28 UTC (rev 4202)
@@ -1112,7 +1112,7 @@
public static enum Option implements ConfigOptionDef {
CONFIG_FILE(CONFIG_FILE_NAME, n("isisfish.config.main.configFileName.description"), "isis-config-" + ISIS_FISH_MAJOR_VERSION),
- ISIS_HOME_DIRECTORY("isis.home.directory", n("isisfish.config.main.compileDirectory.description"), getUserHome() + File.separator + "isis-fish-" + ISIS_FISH_MAJOR_VERSION + "-rc"),
+ ISIS_HOME_DIRECTORY("isis.home.directory", n("isisfish.config.main.compileDirectory.description"), getUserHome() + File.separator + "isis-fish-" + ISIS_FISH_MAJOR_VERSION),
COMPILATION_DIRECTORY("compilation.directory", n("isisfish.config.main.compileDirectory.description"), "${isis.home.directory}" + File.separator + "isis-build"),
MONITORING_DIRECTORY("monitoring.directory", n("isisfish.config.main.monitoringDirectory.description"), "${isis.home.directory}" + File.separator + "isis-monitoring"),
JAVADOC_DIRECTORY("javadoc.directory", n("isisfish.config.main.javadocDirectory.description"), "${isis.home.directory}" + File.separator + "isis-docs"),
1
0
The ISIS-Fish team is pleased to announce the isis-fish-4.4.0.0-rc-1 release!
Simulateur de pecherie complexe.
Documentation of the project can be found here:
http://doc.codelutin.com/isis-fish
Changes
-------
Changes in this version include:
New features:
o changement reproduction/recrutement Issue: 6194. Thanks to stephanie MAHEVAS. Resolved by smahevas.
o Détecter les metiers qui ne couvre pas toutes les saisons Issue: 5191. Thanks to Eric Chatellier. Resolved by echatellier.
o Compress export file Issue: 6320. Thanks to Benjamin Poussin. Resolved by bpoussin.
o Add Historic object on SimulationPlan and Optimization to store some value (parameter, objective, ...) Issue: 6321. Thanks to Benjamin Poussin. Resolved by bpoussin.
o Améliorer l'affichage des informations d'une simulation Issue: 6341. Thanks to Benjamin Poussin. Resolved by bpoussin.
o Matrix returned by ResultManager must be not modifiable Issue: 1728. Thanks to Benjamin Poussin. Resolved by bpoussin.
o export de resultats durant la simulation Issue: 5844. Thanks to Sigrid Lehuta. Resolved by bpoussin.
o Add new method on ResultManager to get matrix for multiple step Issue: 1729. Thanks to Benjamin Poussin. Resolved by bpoussin.
o Passer le niveau de log des valeurs négative en warn Issue: 5936. Thanks to Eric Chatellier. Resolved by echatellier.
o Change DefaultSimulator, SiMatrix and GravityModel to permit easy overwrite method to create new simulator Issue: 6322. Thanks to Benjamin Poussin. Resolved by bpoussin.
Fixed Bugs:
o simule decembre 1 alors qu on demande 20 mois de simu Issue: 6311. Thanks to Sigrid Lehuta. Resolved by echatellier.
o Matrix decorator fail to decorate semantics outside simulation Issue: 5632. Thanks to Eric Chatellier. Resolved by bpoussin.
o Impossible de remplir la matrice de migration dans l'interface Issue: 5935. Thanks to Eric Chatellier. Resolved by kmorin.
o IsisFish n'execute pas les simulations sous Java 8 Issue: 6259. Thanks to Eric Chatellier. Resolved by echatellier.
o IsisFish ne détecte pas R 3.x sous windows Issue: 4296. Thanks to Eric Chatellier. Resolved by echatellier.
o Parametrer les simulations en mois Issue: 5932. Thanks to Eric Chatellier. Resolved by kmorin.
o Use R system jri library Issue: 5689. Thanks to Eric Chatellier. Resolved by echatellier.
o Dépendances non incluses dans la simulation Issue: 568. Thanks to Jean Couteau. Resolved by echatellier.
o pour un graphique dans l interface de resultats Issue: 5646. Thanks to Sigrid Lehuta. Resolved by echatellier.
o Charger une région depuis une simulation Issue: 3884. Thanks to Sigrid Lehuta. Resolved by kmorin.
o zone de selection Issue: 3885. Thanks to Sigrid Lehuta. Resolved by kmorin.
o Erreur après la copie ou l'export d'une région Issue: 5491. Thanks to Eric Chatellier. Resolved by kmorin.
Changes:
o Extract static version to properties file Issue: 5688. Thanks to Eric Chatellier. Resolved by echatellier.
Downloads
---------
For a manual installation, you can download files here:
http://forge.codelutin.com/projects/isis-fish/files
* isis-fish-4.4.0.0-rc-1-bin.zip - http://forge.codelutin.com/attachments/download/3151
Maven artifacts
---------------
Artifacts are deployed in nuiton maven repository
http://maven.nuiton.org/other-releases/
Have fun!
-ISIS-Fish team
1
0
Author: echatellier
Date: 2015-04-21 09:51:00 +0000 (Tue, 21 Apr 2015)
New Revision: 4201
Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4201
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2015-04-21 09:50:52 UTC (rev 4200)
+++ trunk/pom.xml 2015-04-21 09:51:00 UTC (rev 4201)
@@ -11,7 +11,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>isis-fish</artifactId>
- <version>4.4.0.0-rc-1</version>
+ <version>4.4.0.0-SNAPSHOT</version>
<!-- POM Relationships : Inheritance : Dependencies -->
<dependencies>
@@ -733,9 +733,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:https://svn.codelutin.com/isis-fish/tags/isis-fish-4.4.0.0-rc-1</connection>
- <developerConnection>scm:svn:https://svn.codelutin.com/isis-fish/tags/isis-fish-4.4.0.0-rc-1</developerConnection>
- <url>https://svn.codelutin.com/isis-fish/tags/isis-fish-4.4.0.0-rc-1</url>
+ <connection>scm:svn:https://svn.codelutin.com/isis-fish/trunk</connection>
+ <developerConnection>scm:svn:https://svn.codelutin.com/isis-fish/trunk</developerConnection>
+ <url>https://svn.codelutin.com/isis-fish/trunk</url>
</scm>
<repositories>
1
0
21 Apr '15
Author: echatellier
Date: 2015-04-21 09:50:52 +0000 (Tue, 21 Apr 2015)
New Revision: 4200
Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4200
Log:
[maven-release-plugin] copy for tag isis-fish-4.4.0.0-rc-1
Added:
tags/isis-fish-4.4.0.0-rc-1/
Property changes on: tags/isis-fish-4.4.0.0-rc-1
___________________________________________________________________
Added: svn:ignore
+ maven.log
target
velocity.log
.classpath
.project
isis-fish.ipr
isis-fish.iws
isis-fish.iml
.settings
bin
nbproject
Inputs_Langoustine
.idea
Added: svn:mergeinfo
+ /branches/4.0.0-svnkit:3665-3698
/branches/4.0.1:3616-3968
/branches/4.1:3601-3670
/branches/4.3.0-log4j2:4048-4129
/branches/isis-fish-4.3.1.x:4144-4183
1
0
Author: echatellier
Date: 2015-04-21 09:50:42 +0000 (Tue, 21 Apr 2015)
New Revision: 4199
Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4199
Log:
[maven-release-plugin] prepare release isis-fish-4.4.0.0-rc-1
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2015-04-21 09:20:51 UTC (rev 4198)
+++ trunk/pom.xml 2015-04-21 09:50:42 UTC (rev 4199)
@@ -11,7 +11,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>isis-fish</artifactId>
- <version>4.4.0.0-rc-1-SNAPSHOT</version>
+ <version>4.4.0.0-rc-1</version>
<!-- POM Relationships : Inheritance : Dependencies -->
<dependencies>
@@ -733,9 +733,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:https://svn.codelutin.com/isis-fish/trunk</connection>
- <developerConnection>scm:svn:https://svn.codelutin.com/isis-fish/trunk</developerConnection>
- <url>https://svn.codelutin.com/isis-fish/trunk</url>
+ <connection>scm:svn:https://svn.codelutin.com/isis-fish/tags/isis-fish-4.4.0.0-rc-1</connection>
+ <developerConnection>scm:svn:https://svn.codelutin.com/isis-fish/tags/isis-fish-4.4.0.0-rc-1</developerConnection>
+ <url>https://svn.codelutin.com/isis-fish/tags/isis-fish-4.4.0.0-rc-1</url>
</scm>
<repositories>
1
0
r4198 - in trunk: . src/main/java/fr/ifremer/isisfish src/main/java/fr/ifremer/isisfish/datastore/migration src/main/java/fr/ifremer/isisfish/entities src/main/java/fr/ifremer/isisfish/equation src/main/java/fr/ifremer/isisfish/export src/main/java/fr/ifremer/isisfish/simulator src/main/java/fr/ifremer/isisfish/types src/main/java/fr/ifremer/isisfish/ui/input src/main/resources src/main/resources/i18n src/main/xmi src/test/resources/test-database/simulators
by echatellier@users.forge.codelutin.com 21 Apr '15
by echatellier@users.forge.codelutin.com 21 Apr '15
21 Apr '15
Author: echatellier
Date: 2015-04-21 09:20:51 +0000 (Tue, 21 Apr 2015)
New Revision: 4198
Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4198
Log:
fixes #6194: changement reproduction/recrutement
Added:
trunk/src/main/java/fr/ifremer/isisfish/equation/PopulationRecruitmentEquation.java
trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionData.java
trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionDataMap.java
Modified:
trunk/pom.xml
trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV33V40.java
trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV43V44.java
trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java
trunk/src/main/java/fr/ifremer/isisfish/export/ExportHelper.java
trunk/src/main/java/fr/ifremer/isisfish/export/ExportStep.java
trunk/src/main/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java
trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
trunk/src/main/resources/i18n/isis-fish_en_GB.properties
trunk/src/main/resources/i18n/isis-fish_fr_FR.properties
trunk/src/main/resources/sensitivity.properties
trunk/src/main/xmi/isis-fish.zargo
trunk/src/test/resources/test-database/simulators/DefaultSimulator.java
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/pom.xml 2015-04-21 09:20:51 UTC (rev 4198)
@@ -11,7 +11,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>isis-fish</artifactId>
- <version>4.4.0.0-SNAPSHOT</version>
+ <version>4.4.0.0-rc-1-SNAPSHOT</version>
<!-- POM Relationships : Inheritance : Dependencies -->
<dependencies>
Modified: trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -1112,7 +1112,7 @@
public static enum Option implements ConfigOptionDef {
CONFIG_FILE(CONFIG_FILE_NAME, n("isisfish.config.main.configFileName.description"), "isis-config-" + ISIS_FISH_MAJOR_VERSION),
- ISIS_HOME_DIRECTORY("isis.home.directory", n("isisfish.config.main.compileDirectory.description"), getUserHome() + File.separator + "isis-fish-" + ISIS_FISH_MAJOR_VERSION),
+ ISIS_HOME_DIRECTORY("isis.home.directory", n("isisfish.config.main.compileDirectory.description"), getUserHome() + File.separator + "isis-fish-" + ISIS_FISH_MAJOR_VERSION + "-rc"),
COMPILATION_DIRECTORY("compilation.directory", n("isisfish.config.main.compileDirectory.description"), "${isis.home.directory}" + File.separator + "isis-build"),
MONITORING_DIRECTORY("monitoring.directory", n("isisfish.config.main.monitoringDirectory.description"), "${isis.home.directory}" + File.separator + "isis-monitoring"),
JAVADOC_DIRECTORY("javadoc.directory", n("isisfish.config.main.javadocDirectory.description"), "${isis.home.directory}" + File.separator + "isis-docs"),
Modified: trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV33V40.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV33V40.java 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV33V40.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2011 - 2014 Ifremer, Codelutin, Chatellier Eric
+ * Copyright (C) 2011 - 2015 Ifremer, Codelutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -108,7 +108,7 @@
tx.executeSQL("alter table POPULATION add column groupmax integer default 0");
// migration v 4.4 (mais necessaire de la faire avant sinon le from va planter)
- tx.executeSQL("alter table POPULATION add column IF NOT EXISTS reproductionEquationIsRecruitment boolean default false");
+ tx.executeSQL("alter table POPULATION add column IF NOT EXISTS RecruitmentEQUATION VARCHAR(255);");
// build new equation for maturity group
for (Object[] maturityRow : maturityGroupResult) {
Modified: trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV43V44.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV43V44.java 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV43V44.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 - 2014 Ifremer, Codelutin, Chatellier Eric
+ * Copyright (C) 2012 - 2015 Ifremer, Codelutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -59,7 +59,8 @@
protected void prepareMigrationScript(TopiaContextImplementor tx,
List<String> queries, boolean showSql, boolean showProgression)
throws TopiaException {
-
- queries.add("alter table POPULATION add column IF NOT EXISTS reproductionEquationIsRecruitment boolean default false");
+
+ queries.add("alter table POPULATION add column IF NOT EXISTS RecruitmentEQUATION VARCHAR(255);");
+
}
}
Modified: trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2006 - 2011 Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin, Chatellier Eric
+ * Copyright (C) 2006 - 2015 Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -25,8 +25,8 @@
package fr.ifremer.isisfish.entities;
+import static org.nuiton.i18n.I18n.n;
import static org.nuiton.i18n.I18n.t;
-import static org.nuiton.i18n.I18n.n;
import java.util.Arrays;
import java.util.Collection;
@@ -50,9 +50,13 @@
import fr.ifremer.isisfish.equation.PopulationMeanWeight;
import fr.ifremer.isisfish.equation.PopulationNaturalDeathRate;
import fr.ifremer.isisfish.equation.PopulationPrice;
+import fr.ifremer.isisfish.equation.PopulationRecruitmentEquation;
import fr.ifremer.isisfish.equation.PopulationReproductionEquation;
import fr.ifremer.isisfish.equation.PopulationReproductionRateEquation;
+import fr.ifremer.isisfish.types.ReproductionData;
+import fr.ifremer.isisfish.types.ReproductionDataMap;
import fr.ifremer.isisfish.types.Month;
+import fr.ifremer.isisfish.types.TimeStep;
/**
* PopulationImpl.
@@ -132,6 +136,10 @@
if (eq != null) {
eq.setName(getName());
}
+ eq = getRecruitmentEquation();
+ if (eq != null) {
+ eq.setName(getName());
+ }
eq = getMaturityOgiveEquation();
if (eq != null) {
eq.setName(getName());
@@ -173,7 +181,39 @@
t("isisfish.error.change.equation"), eee);
}
}
+
+ public void setRecruitmentEquationContent(String content) {
+ try {
+ Equation eq = getRecruitmentEquation();
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ eq = dao.create();
+ eq.setCategory("Recruitment");
+ eq.setJavaInterface(PopulationRecruitmentEquation.class);
+ eq.setLanguage(Language.JAVA);
+ setRecruitmentEquation(eq);
+ }
+
+ eq.setName(getName());
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ t("isisfish.error.change.equation"), eee);
+ }
+ }
+
public void setGrowthContent(String content) {
try {
Equation eq = getGrowth();
@@ -724,4 +764,22 @@
return result;
}
+ @Override
+ public MatrixND getRecruitmentMatrix(TimeStep step, Population pop, ReproductionDataMap abundanceAndRepros,
+ MatrixND result) {
+
+ try {
+ //recuperation de l'equation de reproduction
+ Equation e = pop.getRecruitmentEquation();
+
+ // l'equation doit mettre les resultats dans la matrice result
+ e.evaluate("step", step, "pop", pop, "aboundanceAndRepros", abundanceAndRepros,
+ "result", result);
+
+ } catch (Exception eee) {
+ log.fatal("Error in matrix recruitment creation", eee);
+ }
+ return result;
+ }
+
}
Added: trunk/src/main/java/fr/ifremer/isisfish/equation/PopulationRecruitmentEquation.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/equation/PopulationRecruitmentEquation.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/equation/PopulationRecruitmentEquation.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -0,0 +1,67 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2015 Ifremer, Code Lutin, Chatellier Eric
+ * %%
+ * 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 3 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, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.equation;
+
+import org.nuiton.math.matrix.MatrixND;
+
+import fr.ifremer.isisfish.entities.Population;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.types.ReproductionDataMap;
+import fr.ifremer.isisfish.types.TimeStep;
+import fr.ifremer.isisfish.util.ArgTypes;
+import fr.ifremer.isisfish.util.Args;
+
+/**
+ * Population recruitment equation.
+ *
+ * @author echatellier
+ * @since 4.4.0.0
+ */
+public interface PopulationRecruitmentEquation {
+
+ /**
+ * Compute recruitment equation.
+ *
+ * @param context simulation context
+ * @param step current time step
+ * @param pop population pour lequel on souhaite la matrice de recrutement
+ * @param reproductions les abundances, biomasses et reproduction correspondant au recrutement courant
+ * @param result la matrice resultat que l'equation doit remplir, il s'agit
+ * d'une matrice groupes/zones
+ * @return la valeur retournée n'est pas utilisée, par exemple 'return 0;' convient.
+ * @throws Exception
+ */
+ @Args({"context", "step", "pop", "reproductions", "result"})
+ @ArgTypes({
+ "fr.ifremer.isisfish.simulator.SimulationContext",
+ "fr.ifremer.isisfish.types.TimeStep",
+ "fr.ifremer.isisfish.entities.Population",
+ "fr.ifremer.isisfish.types.AbundanceAndReproMap",
+ "org.nuiton.math.matrix.MatrixND"})
+ public double compute(SimulationContext context, TimeStep step,
+ Population pop, ReproductionDataMap reproductions, MatrixND result) throws Exception;
+
+}
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/equation/PopulationRecruitmentEquation.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/src/main/java/fr/ifremer/isisfish/export/ExportHelper.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/export/ExportHelper.java 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/java/fr/ifremer/isisfish/export/ExportHelper.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -161,12 +161,10 @@
/**
* Do single export.
*
- * @param simulation la simulation pour lequel il faut faire les exports
- * @param destdir le repertoire dans lequel il faut ecrire les exports
- * @param export le nom des exports a faire
+ * @param simulationStorage la simulation pour lequel il faut faire les exports
+ * @param file le fichier de destination
+ * @param exportName le nom de l'exports a faire
*
- * @return number of byte written on disk
- *
* @throws Exception si une erreur survient
*/
public static void exportToFile(SimulationStorage simulationStorage, String exportName, File file) throws Exception {
Modified: trunk/src/main/java/fr/ifremer/isisfish/export/ExportStep.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/export/ExportStep.java 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/java/fr/ifremer/isisfish/export/ExportStep.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -50,7 +50,7 @@
* Exporte les resultats, cette methode est appellee a la fin de chaque pas
* de temps. Elle peut ecrire dans le fichier via le parametre out,
* ou collecter les informations et les ecrires a la fin de la simulation
- * lorsque la methode {@link #export(fr.ifremer.isisfish.datastore.SimulationStorage, java.io.Writer)
+ * lorsque la methode {@link #exportEnd(fr.ifremer.isisfish.datastore.SimulationStorage, java.io.Writer)}
* est appelee.
*
* @param simulation la simulation dont on souhaite exporter les resultats
Modified: trunk/src/main/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2006 - 2011 Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin, Chatellier Eric
+ * Copyright (C) 2006 - 2015 Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -26,6 +26,7 @@
package fr.ifremer.isisfish.simulator;
import fr.ifremer.isisfish.IsisFishRuntimeException;
+
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -42,8 +43,11 @@
import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
import fr.ifremer.isisfish.entities.Species;
import fr.ifremer.isisfish.entities.Zone;
+import fr.ifremer.isisfish.types.ReproductionData;
+import fr.ifremer.isisfish.types.ReproductionDataMap;
import fr.ifremer.isisfish.types.TimeStep;
import fr.ifremer.isisfish.types.Month;
+
import java.util.AbstractMap;
import java.util.Collections;
@@ -71,15 +75,15 @@
/** La liste des pops monitorer par cette instance */
protected List<Population> pops = null;
/** current number of fish by Pop */
- protected Map<Population, MatrixND> Ns = new HashMap<Population, MatrixND>();
+ protected Map<Population, MatrixND> Ns = new HashMap<>();
/** reproduction key: <date, pop> value:<MatrixND> */
- protected Map<Population, Map<TimeStep, MatrixND>> reproductions = new HashMap<Population, Map<TimeStep, MatrixND>>();
+ protected Map<Population, Map<TimeStep, ReproductionData>> reproductions = new HashMap<>();
/** discard key: <date, pop> value:<MatrixND> */
- protected Map<Population, Map.Entry<TimeStep, MatrixND>> discards = new HashMap<Population, Map.Entry<TimeStep, MatrixND>>();
+ protected Map<Population, Map.Entry<TimeStep, MatrixND>> discards = new HashMap<>();
/** catch per population, only last catch is remaining */
- protected Map<Population, MatrixND> catchs = new HashMap<Population, MatrixND>();
+ protected Map<Population, MatrixND> catchs = new HashMap<>();
/** catch per population, only last catch is remaining */
- protected Map<Population, MatrixND> holdCatchs = new HashMap<Population, MatrixND>();
+ protected Map<Population, MatrixND> holdCatchs = new HashMap<>();
protected double totalHoldCatch = 0;
@@ -98,7 +102,7 @@
this.pops = Collections
.unmodifiableList(new ArrayList<Population>(pops));
for (Population pop : this.pops) {
- reproductions.put(pop, new HashMap<TimeStep, MatrixND>());
+ reproductions.put(pop, new HashMap<TimeStep, ReproductionData>());
}
}
@@ -179,7 +183,7 @@
* @return the reproduction
*/
public MatrixND getReproduction(TimeStep step, Population pop) {
- return this.reproductions.get(pop).get(step);
+ return this.reproductions.get(pop).get(step).getRepro();
}
/**
@@ -187,10 +191,12 @@
*
* @param step step
* @param pop population
+ * @param aN aboundance
+ * @param aBiomass biomass
* @param repro reproduction to set
*/
- public void setReproduction(TimeStep step, Population pop, MatrixND repro) {
- reproductions.get(pop).put(step, repro);
+ public void setReproduction(TimeStep step, Population pop, MatrixND aN, MatrixND aBiomass, MatrixND repro) {
+ reproductions.get(pop).put(step, new ReproductionData(aN, aBiomass, repro));
}
/**
@@ -199,26 +205,25 @@
* @param pop
*/
public void applyReproductionMortality(Population pop) {
- if (!pop.isReproductionEquationIsRecruitment()){
- for (MatrixND reproduction : reproductions.get(pop).values()) {
- if (log.isTraceEnabled()) {
- log.trace("Matrix repro before mortality: " + reproduction);
- }
+ for (ReproductionData nAndRepro : reproductions.get(pop).values()) {
+ MatrixND reproduction = nAndRepro.getRepro();
+ if (log.isTraceEnabled()) {
+ log.trace("Matrix repro before mortality: " + reproduction);
+ }
- for (MatrixIterator mi = reproduction.iteratorNotZero(); mi.next();) {
- Object[] sems = mi.getSemanticsCoordinates();
- Zone z = (Zone) sems[0];
- double coeff = pop.getNaturalDeathBirth(z);
- if (log.isTraceEnabled()) {
- log.trace("NaturalDeath zone " + z + "=" + coeff);
- }
- mi.setValue(mi.getValue()
- * Math.exp(-coeff / Month.NUMBER_OF_MONTH));
- }
+ for (MatrixIterator mi = reproduction.iteratorNotZero(); mi.next();) {
+ Object[] sems = mi.getSemanticsCoordinates();
+ Zone z = (Zone) sems[0];
+ double coeff = pop.getNaturalDeathBirth(z);
if (log.isTraceEnabled()) {
- log.trace("Matrix repro after mortality: " + reproduction);
+ log.trace("NaturalDeath zone " + z + "=" + coeff);
}
+ mi.setValue(mi.getValue()
+ * Math.exp(-coeff / Month.NUMBER_OF_MONTH));
}
+ if (log.isTraceEnabled()) {
+ log.trace("Matrix repro after mortality: " + reproduction);
+ }
}
}
@@ -242,14 +247,20 @@
new List[] { pop.getPopulationGroup(),
pop.getPopulationZone() });
+ ReproductionDataMap mapAAndRs = new ReproductionDataMap();
+
// pour chaque
for (int e = 0; e < etalement; e++) {
// recuperation de la reproduction stucture en zone repro
TimeStep t = new TimeStep(step.getStep() - e
- pop.getMonthGapBetweenReproRecrutement());
- MatrixND repro = (MatrixND) reproductions.get(pop).get(t);
+
+ ReproductionData aAndR = reproductions.get(pop).get(t);
- if (repro != null) { // si une repro existe pour le mois
+ if (aAndR != null) { // si une repro existe pour le mois
+
+ mapAAndRs.put(t, aAndR);
+ MatrixND repro = aAndR.getRepro();
// on fait la correspondance entre les zones repro et
// recrutement
@@ -288,7 +299,7 @@
}
}
- if (pop.getSpecies().isAgeGroupType() && !pop.isReproductionEquationIsRecruitment()) {
+ if (pop.getSpecies().isAgeGroupType()) {
// conversion et retour de la matrice en vecteur
MatrixND N = pop.N2DToN1D(result);
// on applique les migrations et le changement d'age sur le resultat
@@ -322,6 +333,10 @@
}
result = pop.split2D(N);
}
+
+ // calcul recrutement par l'equation
+ result = pop.getRecruitmentMatrix(step, pop, mapAAndRs, result);
+
return result;
}
Added: trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionData.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionData.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionData.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -0,0 +1,62 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2015 Ifremer, Code Lutin, Benjamin Poussin, Chatellier Eric
+ * %%
+ * 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 3 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, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+package fr.ifremer.isisfish.types;
+
+import org.nuiton.math.matrix.MatrixND;
+
+/**
+ * Aboundance, biomass and reproduction used during population migration.
+ *
+ * @since 4.4.0.0
+ */
+public class ReproductionData {
+
+ /** Aboundance. */
+ protected MatrixND aboundance;
+
+ /** Biomass. */
+ protected MatrixND biomass;
+
+ /** Reproduction. */
+ protected MatrixND repro;
+
+ public ReproductionData(MatrixND aboundance, MatrixND biomass, MatrixND repro) {
+ this.aboundance = aboundance;
+ this.biomass = biomass;
+ this.repro = repro;
+ }
+
+ public MatrixND getAboundance() {
+ return aboundance;
+ }
+
+ public MatrixND getBiomass() {
+ return biomass;
+ }
+
+ public MatrixND getRepro() {
+ return repro;
+ }
+}
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionData.java
___________________________________________________________________
Added: svn:eol-style
+ native
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionDataMap.java
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionDataMap.java (rev 0)
+++ trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionDataMap.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -0,0 +1,39 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2015 Ifremer, Code Lutin, Benjamin Poussin, Chatellier Eric
+ * %%
+ * 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 3 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, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+package fr.ifremer.isisfish.types;
+
+import java.util.HashMap;
+
+/**
+ * Map instance to use a sinplier object in model.
+ *
+ * @since 4.4.0.0
+ */
+public class ReproductionDataMap extends HashMap<TimeStep, ReproductionData> {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 2765995771062359295L;
+
+}
Property changes on: trunk/src/main/java/fr/ifremer/isisfish/types/ReproductionDataMap.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
===================================================================
--- trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2015-04-21 09:20:51 UTC (rev 4198)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2009 - 2014 Ifremer, Code Lutin, Chatellier Eric
+ Copyright (C) 2009 - 2015 Ifremer, Code Lutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -89,32 +89,9 @@
<cell fill='both' weightx='1.0' weighty='1.0'>
<Table>
<row>
- <cell>
- <JPanel/>
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JRadioButton id="radioPopulationRecruitmentEquationIsReproduction"
- buttonGroup="radioPopulationRecruitmentEquationType"
- selected='{!getBean().isReproductionEquationIsRecruitment()}'
- enabled='{isActive()}'
- text="isisfish.populationRecruitment.reproductionEquationIsReproduction"
- onActionPerformed='getBean().setReproductionEquationIsRecruitment(radioPopulationRecruitmentEquationIsRecruitment.isSelected())'
- decorator='boxed' />
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JRadioButton id="radioPopulationRecruitmentEquationIsRecruitment"
- buttonGroup="radioPopulationRecruitmentEquationType"
- selected='{getBean().isReproductionEquationIsRecruitment()}'
- enabled='{isActive()}'
- text="isisfish.populationRecruitment.reproductionEquationIsRecruitment"
- onActionPerformed='getBean().setReproductionEquationIsRecruitment(radioPopulationRecruitmentEquationIsRecruitment.isSelected())'
- decorator='boxed' />
- </cell>
- </row>
- <row>
- <cell columns='3' fill='both' weightx='1.0' weighty='0.5'>
+ <cell columns='3' fill='both' weightx='1.0' weighty='1'>
<InputOneEquationUI id='reproductionEquation' constructorParams='this'
- active="{isActive()}"
+ active="{isActive()}" text='isisfish.populationEquation.reproductionEquation'
bean='{getBean()}' formuleCategory='Reproduction' beanProperty='ReproductionEquation'
clazz='{fr.ifremer.isisfish.equation.PopulationReproductionEquation.class}'
decorator='boxed' _sensitivityBean='{Population.class}' _sensitivityMethod='"ReproductionEquation"'/>
@@ -138,20 +115,26 @@
<cell anchor='east'>
<JLabel text="isisfish.populationRecruitment.recruitmentDistribution" enabled='{isActive()}'/>
</cell>
- <cell columns='2' fill='both' weightx='1.0' weighty='0.5'>
+ <cell fill='both' weightx='1.0' weighty='0.3'>
<org.nuiton.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationRecruitmentDistribution'
matrix='{getBean() == null ? null : bean.getRecruitmentDistribution().copy()}'
enabled='{isActive()}' decorator='boxed' _sensitivityBean='{Population.class}' _sensitivityMethod='"RecruitmentDistribution"'
onMatrixChanged="populationRecruitmentDistributionMatrixChanged(event)" />
</cell>
+ <cell>
+ <JButton icon="table.png" toolTipText="isisfish.common.newMatrix"
+ onActionPerformed="getAction().createRecruitmentDistribution(getBean())"
+ enabled='{isActive()}' decorator='boxed' />
+ </cell>
</row>
<row>
- <cell>
- <JPanel/>
+ <cell columns='3' fill='both' weightx='1.0' weighty='1'>
+ <InputOneEquationUI id='recruitmentEquation' constructorParams='this'
+ active="{isActive()}" text='isisfish.populationEquation.recruitmentEquation'
+ bean='{getBean()}' formuleCategory='Recruitment' beanProperty='RecruitmentEquation'
+ clazz='{fr.ifremer.isisfish.equation.PopulationRecruitmentEquation.class}'
+ decorator='boxed' _sensitivityBean='{Population.class}' _sensitivityMethod='"RecruitmentEquation"'/>
</cell>
- <cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="create" text="isisfish.common.newMatrix" onActionPerformed='getAction().createRecruitmentDistribution(getBean())' enabled='{isActive()}' decorator='boxed'/>
- </cell>
</row>
<row>
<cell anchor='east'>
Modified: trunk/src/main/resources/i18n/isis-fish_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/isis-fish_en_GB.properties 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/resources/i18n/isis-fish_en_GB.properties 2015-04-21 09:20:51 UTC (rev 4198)
@@ -751,6 +751,8 @@
isisfish.populationEquation.meanWeight=Mean weight
isisfish.populationEquation.naturalDeathRate=Natural death rate
isisfish.populationEquation.price=Price
+isisfish.populationEquation.recruitmentEquation=Recruitment equation
+isisfish.populationEquation.reproductionEquation=Reproduction equation
isisfish.populationEquation.reproductionRate=Reproduction rate
isisfish.populationEquation.title=Equations
isisfish.populationGroup.age=Age
Modified: trunk/src/main/resources/i18n/isis-fish_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/isis-fish_fr_FR.properties 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/resources/i18n/isis-fish_fr_FR.properties 2015-04-21 09:20:51 UTC (rev 4198)
@@ -749,6 +749,8 @@
isisfish.populationEquation.meanWeight=Poids moyen
isisfish.populationEquation.naturalDeathRate=Taux de mortalité naturelle
isisfish.populationEquation.price=Prix
+isisfish.populationEquation.recruitmentEquation=Équation de recrutement
+isisfish.populationEquation.reproductionEquation=Équation de reproduction
isisfish.populationEquation.reproductionRate=Taux de reproduction
isisfish.populationEquation.title=Traits de vie
isisfish.populationGroup.age=Age
Modified: trunk/src/main/resources/sensitivity.properties
===================================================================
--- trunk/src/main/resources/sensitivity.properties 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/main/resources/sensitivity.properties 2015-04-21 09:20:51 UTC (rev 4198)
@@ -49,6 +49,7 @@
Population.naturalDeathRate
Population.price
Population.recruitmentDistribution
+Population.recruitmentEquation
Population.reproductionEquation
Population.reproductionRateEquation
PopulationSeasonInfo.lengthChangeMatrix
Modified: trunk/src/main/xmi/isis-fish.zargo
===================================================================
(Binary files differ)
Modified: trunk/src/test/resources/test-database/simulators/DefaultSimulator.java
===================================================================
--- trunk/src/test/resources/test-database/simulators/DefaultSimulator.java 2015-04-20 09:04:45 UTC (rev 4197)
+++ trunk/src/test/resources/test-database/simulators/DefaultSimulator.java 2015-04-21 09:20:51 UTC (rev 4198)
@@ -364,8 +364,8 @@
// N is reassigned during computation
resManager.addResult(step, pop, N);
+ MatrixND biomass = siMatrix.matrixBiomass(N, pop, step);
if (resManager.isEnabled(ResultName.MATRIX_BIOMASS)) {
- MatrixND biomass = siMatrix.matrixBiomass(N, pop, step);
resManager.addResult(step, pop, biomass);
}
@@ -415,7 +415,7 @@
// ajout de la matrice R dans le suivi de la pop comme etant
// la reproduction pour le mois courant.
- popMon.setReproduction(step, pop, R);
+ popMon.setReproduction(step, pop, N, biomass, R);
// recrutement
MatrixND recruitment = popMon.getRecruitment(step, pop);
1
0
Author: echatellier
Date: 2015-04-20 09:04:45 +0000 (Mon, 20 Apr 2015)
New Revision: 4197
Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4197
Log:
Update commons-math
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2015-04-17 14:49:42 UTC (rev 4196)
+++ trunk/pom.xml 2015-04-20 09:04:45 UTC (rev 4197)
@@ -199,7 +199,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
- <version>3.4.1</version>
+ <version>3.5</version>
<scope>runtime</scope> <!--script -->
</dependency>
1
0