Coser-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
- 1259 discussions
r334 - in trunk/coser-ui: . src/main src/main/jnlp
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
02 Dec '10
Author: chatellier
Date: 2010-12-02 14:24:22 +0000 (Thu, 02 Dec 2010)
New Revision: 334
Log:
Increase default jnlp memory
Added:
trunk/coser-ui/src/main/jnlp/
trunk/coser-ui/src/main/jnlp/coser-jnlp.vm
Modified:
trunk/coser-ui/pom.xml
Modified: trunk/coser-ui/pom.xml
===================================================================
--- trunk/coser-ui/pom.xml 2010-12-02 13:09:07 UTC (rev 333)
+++ trunk/coser-ui/pom.xml 2010-12-02 14:24:22 UTC (rev 334)
@@ -266,10 +266,13 @@
<verbose>false</verbose>
<jnlp>
+ <inputTemplateResourcePath>src/main/jnlp</inputTemplateResourcePath>
+ <inputTemplate>coser-jnlp.vm</inputTemplate>
<mainClass>${maven.jar.main.class}</mainClass>
<allPermissions>true</allPermissions>
<offlineAllowed>true</offlineAllowed>
<j2seVersion>1.6+</j2seVersion>
+ <j2seJavaVmArgs>-Xmx1024M</j2seJavaVmArgs>
</jnlp>
<!-- Add some extensions for the already signed libs -->
Added: trunk/coser-ui/src/main/jnlp/coser-jnlp.vm
===================================================================
--- trunk/coser-ui/src/main/jnlp/coser-jnlp.vm (rev 0)
+++ trunk/coser-ui/src/main/jnlp/coser-jnlp.vm 2010-12-02 14:24:22 UTC (rev 334)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp
+ spec="$jnlpspec"
+ codebase="$jnlpCodebase"
+ href="$outputFile">
+ <information>
+ <title>$project.Name</title>
+ <vendor>$project.Organization.Name</vendor>
+ <homepage href="$project.Url"/>
+ <description>$project.Description</description>
+#if($offlineAllowed)
+ <offline-allowed/>
+#end
+ </information>
+#if($allPermissions)
+ <security>
+ <all-permissions/>
+ </security>
+#end
+ <resources>
+ <j2se version="$j2seVersion" java-vm-args="$j2seJavaVmArgs"/>
+ <property name="vradi.remote.endpoint" value="${jnlpCodebase}vradi-services-web" />
+ $dependencies
+ $extensions
+ </resources>
+ <application-desc main-class="$mainClass"/>
+</jnlp>
\ No newline at end of file
1
0
r333 - in trunk: coser-business/src/site coser-business/src/site/rst coser-business/src/site/rst/en coser-ui/src coser-ui/src/site coser-ui/src/site/en coser-web/src coser-web/src/site coser-web/src/site/en src/site src/site/rst src/site/rst/en
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
02 Dec '10
Author: chatellier
Date: 2010-12-02 13:09:07 +0000 (Thu, 02 Dec 2010)
New Revision: 333
Log:
Ajout des site des modules et d'un line de lancement
Added:
trunk/coser-business/src/site/rst/
trunk/coser-business/src/site/rst/en/
trunk/coser-business/src/site/rst/en/index.rst
trunk/coser-business/src/site/rst/index.rst
trunk/coser-business/src/site/site_en.xml
trunk/coser-business/src/site/site_fr.xml
trunk/coser-ui/src/site/
trunk/coser-ui/src/site/en/
trunk/coser-ui/src/site/en/index.rst
trunk/coser-ui/src/site/index.rst
trunk/coser-ui/src/site/site_en.xml
trunk/coser-ui/src/site/site_fr.xml
trunk/coser-web/src/site/
trunk/coser-web/src/site/en/
trunk/coser-web/src/site/en/index.rst
trunk/coser-web/src/site/index.rst
trunk/coser-web/src/site/site_en.xml
trunk/coser-web/src/site/site_fr.xml
trunk/src/site/rst/download.rst
trunk/src/site/rst/en/
trunk/src/site/rst/en/download.rst
trunk/src/site/rst/en/index.rst
Modified:
trunk/src/site/site_en.xml
trunk/src/site/site_fr.xml
Added: trunk/coser-business/src/site/rst/en/index.rst
===================================================================
--- trunk/coser-business/src/site/rst/en/index.rst (rev 0)
+++ trunk/coser-business/src/site/rst/en/index.rst 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,2 @@
+Coser :: Business
+=================
\ No newline at end of file
Added: trunk/coser-business/src/site/rst/index.rst
===================================================================
--- trunk/coser-business/src/site/rst/index.rst (rev 0)
+++ trunk/coser-business/src/site/rst/index.rst 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,2 @@
+Coser :: Business
+=================
\ No newline at end of file
Added: trunk/coser-business/src/site/site_en.xml
===================================================================
--- trunk/coser-business/src/site/site_en.xml (rev 0)
+++ trunk/coser-business/src/site/site_en.xml 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Coser
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <menu ref="parent"/>
+
+ <body>
+
+ <links>
+ <item name="[fr" href="../index.html" />
+ <item name="en]" href="index.html" />
+ </links>
+
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
+
Added: trunk/coser-business/src/site/site_fr.xml
===================================================================
--- trunk/coser-business/src/site/site_fr.xml (rev 0)
+++ trunk/coser-business/src/site/site_fr.xml 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Coser
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <menu ref="parent"/>
+
+ <body>
+
+ <links>
+ <item name="[fr" href="index.html" />
+ <item name="en]" href="en/index.html" />
+ </links>
+
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
+
Added: trunk/coser-ui/src/site/en/index.rst
===================================================================
--- trunk/coser-ui/src/site/en/index.rst (rev 0)
+++ trunk/coser-ui/src/site/en/index.rst 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,2 @@
+Coser :: UI
+===========
\ No newline at end of file
Added: trunk/coser-ui/src/site/index.rst
===================================================================
--- trunk/coser-ui/src/site/index.rst (rev 0)
+++ trunk/coser-ui/src/site/index.rst 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,2 @@
+Coser :: UI
+===========
\ No newline at end of file
Added: trunk/coser-ui/src/site/site_en.xml
===================================================================
--- trunk/coser-ui/src/site/site_en.xml (rev 0)
+++ trunk/coser-ui/src/site/site_en.xml 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Coser
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <menu ref="parent"/>
+
+ <body>
+
+ <links>
+ <item name="[fr" href="../index.html" />
+ <item name="en]" href="index.html" />
+ </links>
+
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
+
Added: trunk/coser-ui/src/site/site_fr.xml
===================================================================
--- trunk/coser-ui/src/site/site_fr.xml (rev 0)
+++ trunk/coser-ui/src/site/site_fr.xml 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Coser
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <menu ref="parent"/>
+
+ <body>
+
+ <links>
+ <item name="[fr" href="index.html" />
+ <item name="en]" href="en/index.html" />
+ </links>
+
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
+
Added: trunk/coser-web/src/site/en/index.rst
===================================================================
--- trunk/coser-web/src/site/en/index.rst (rev 0)
+++ trunk/coser-web/src/site/en/index.rst 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,2 @@
+Coser :: Web
+============
\ No newline at end of file
Added: trunk/coser-web/src/site/index.rst
===================================================================
--- trunk/coser-web/src/site/index.rst (rev 0)
+++ trunk/coser-web/src/site/index.rst 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,2 @@
+Coser :: Web
+============
\ No newline at end of file
Added: trunk/coser-web/src/site/site_en.xml
===================================================================
--- trunk/coser-web/src/site/site_en.xml (rev 0)
+++ trunk/coser-web/src/site/site_en.xml 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Coser
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <menu ref="parent"/>
+
+ <body>
+
+ <links>
+ <item name="[fr" href="../index.html" />
+ <item name="en]" href="index.html" />
+ </links>
+
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
+
Added: trunk/coser-web/src/site/site_fr.xml
===================================================================
--- trunk/coser-web/src/site/site_fr.xml (rev 0)
+++ trunk/coser-web/src/site/site_fr.xml 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Coser
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <menu ref="parent"/>
+
+ <body>
+
+ <links>
+ <item name="[fr" href="index.html" />
+ <item name="en]" href="en/index.html" />
+ </links>
+
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
+
Added: trunk/src/site/rst/download.rst
===================================================================
--- trunk/src/site/rst/download.rst (rev 0)
+++ trunk/src/site/rst/download.rst 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,32 @@
+.. -
+.. * #%L
+.. * Coser
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
+Lancement
+=========
+
+Vous pouvez lancer l'application directement en ligne (JavaWebStart) depuis
+`cette page`_.
+
+.. _cette page: coser-ui/jnlp-report.html
+
Added: trunk/src/site/rst/en/download.rst
===================================================================
--- trunk/src/site/rst/en/download.rst (rev 0)
+++ trunk/src/site/rst/en/download.rst 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,32 @@
+.. -
+.. * #%L
+.. * Coser
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
+Launch
+=========
+
+You can launch application directly from this website with Java WebStart from
+`this page`_.
+
+.. _this page: ../coser-ui/en/jnlp-report.html
+
Added: trunk/src/site/rst/en/index.rst
===================================================================
--- trunk/src/site/rst/en/index.rst (rev 0)
+++ trunk/src/site/rst/en/index.rst 2010-12-02 13:09:07 UTC (rev 333)
@@ -0,0 +1,29 @@
+.. -
+.. * #%L
+.. * Coser
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
+Coser
+=====
+
+Contrôle et Sélection RSufi.
+
Modified: trunk/src/site/site_en.xml
===================================================================
--- trunk/src/site/site_en.xml 2010-12-02 13:08:24 UTC (rev 332)
+++ trunk/src/site/site_en.xml 2010-12-02 13:09:07 UTC (rev 333)
@@ -26,6 +26,8 @@
<project name="${project.name}">
+ <menu ref="parent"/>
+
<bannerLeft>
<name>${project.name}</name>
<href>index.html</href>
@@ -55,6 +57,7 @@
<menu name="Documentation">
<item name="Home" href="index.html"/>
+ <item name="Launch" href="download.html" />
<item name="User" href="user.html">
<item name="Validation" href="user/validation.html" />
</item>
@@ -63,6 +66,8 @@
</item>
</menu>
+ <menu ref="modules"/>
+
<menu ref="reports"/>
</body>
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2010-12-02 13:08:24 UTC (rev 332)
+++ trunk/src/site/site_fr.xml 2010-12-02 13:09:07 UTC (rev 333)
@@ -26,7 +26,7 @@
<project name="${project.name}">
- <publishDate format="dd/MM/yyyy"/>
+ <menu ref="parent"/>
<bannerLeft>
<name>${project.name}</name>
@@ -56,7 +56,8 @@
</links>
<menu name="Documentation">
- <item name="Accueil" href="index.html"/>
+ <item name="Accueil" href="index.html" />
+ <item name="Lancement" href="download.html" />
<item name="Utilisateur" href="user.html">
<item name="Validation" href="user/validation.html" />
</item>
@@ -65,6 +66,8 @@
</item>
</menu>
+ <menu ref="modules"/>
+
<menu ref="reports"/>
</body>
1
0
r332 - in trunk/coser-ui/src/main/java/fr/ifremer/coser/ui: . control
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
02 Dec '10
Author: chatellier
Date: 2010-12-02 13:08:24 +0000 (Thu, 02 Dec 2010)
New Revision: 332
Log:
Retypage en JFrame pour qu'elle soit visible dans la barre des t?\195?\162ches windows
Added:
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphFrame.jaxx
Removed:
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx
Modified:
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-02 10:52:31 UTC (rev 331)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-02 13:08:24 UTC (rev 332)
@@ -92,14 +92,14 @@
/**
* Install le curseur sablier.
*/
- protected void setWaitCursor() {
+ public void setWaitCursor() {
view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
}
/**
* Repositionne le curseur a sa valeur par defaut.
*/
- protected void setDefaultCursor() {
+ public void setDefaultCursor() {
view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
@@ -191,7 +191,7 @@
modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.CONTROL_TYPE_FISH);
modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.SELECTION_FILTER_OCCURRENCE);
modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.SELECTION_FILTER_DENSITY);
-
+
// category misc
modelBuilder.addCategory(_("coser.config.category.misc"), _("coser.config.category.misc.description"));
modelBuilder.addOption(CoserConfig.CoserOption.SMTP_HOST);
Deleted: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx 2010-12-02 10:52:31 UTC (rev 331)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx 2010-12-02 13:08:24 UTC (rev 332)
@@ -1,45 +0,0 @@
-<!--
- #%L
- Coser :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2010 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%
- -->
-<JDialog title="coser.ui.control.graphtitle">
-
- <ControlHandler id="handler" javaBean="null" />
-
- <Table>
- <row>
- <cell>
- <JLabel text="coser.ui.control.graph.species"/>
- </cell>
- <cell fill="horizontal">
- <SpecyComboModel id="specyComboModel" />
- <JComboBox model="{specyComboModel}" onActionPerformed="getHandler().updateCompareNumberCatchGraph(this)" />
- </cell>
- </row>
- <row fill="both" weightx="1" weighty="1" columns="2">
- <cell>
- <JPanel id="controlGraphPanel" layout="{new BorderLayout()}"/>
- </cell>
- </row>
- </Table>
-</JDialog>
Copied: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphFrame.jaxx (from rev 291, trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx)
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphFrame.jaxx (rev 0)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphFrame.jaxx 2010-12-02 13:08:24 UTC (rev 332)
@@ -0,0 +1,45 @@
+<!--
+ #%L
+ Coser :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 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%
+ -->
+<JFrame title="coser.ui.control.graphtitle">
+
+ <ControlHandler id="handler" javaBean="null" />
+
+ <Table>
+ <row>
+ <cell>
+ <JLabel text="coser.ui.control.graph.species"/>
+ </cell>
+ <cell fill="horizontal">
+ <SpecyComboModel id="specyComboModel" />
+ <JComboBox model="{specyComboModel}" onActionPerformed="getHandler().updateCompareNumberCatchGraph(this)" />
+ </cell>
+ </row>
+ <row fill="both" weightx="1" weighty="1" columns="2">
+ <cell>
+ <JPanel id="controlGraphPanel" layout="{new BorderLayout()}"/>
+ </cell>
+ </row>
+ </Table>
+</JFrame>
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java 2010-12-02 10:52:31 UTC (rev 331)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java 2010-12-02 13:08:24 UTC (rev 332)
@@ -26,6 +26,8 @@
import static org.nuiton.i18n.I18n._;
import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.GridBagConstraints;
import java.awt.Insets;
@@ -54,11 +56,11 @@
import javax.swing.JTextField;
import javax.swing.JViewport;
import javax.swing.ListSelectionModel;
+import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.TreeSelectionEvent;
-import javax.swing.table.TableColumn;
import javax.swing.tree.TreePath;
import jaxx.runtime.JAXXUtil;
@@ -103,6 +105,24 @@
private static final Log log = LogFactory.getLog(ControlHandler.class);
/**
+ * Install le curseur sablier.
+ *
+ * @param comp component to set cursor
+ */
+ public void setWaitCursor(Component comp) {
+ comp.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ }
+
+ /**
+ * Repositionne le curseur a sa valeur par defaut.
+ *
+ * @param comp component to set cursor
+ */
+ public void setDefaultCursor(Component comp) {
+ comp.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ }
+
+ /**
* Return l'intance de la table qui est selectionnée.
*
* Les 4 table sont dupliquées juste pour concerver l'etat des colonnes.
@@ -819,20 +839,31 @@
*
* @param view view
*/
- public void displayCompareNumberCatchGraph(ControlView view) {
- Project project = view.getContextValue(Project.class);
- PublicationService publicationService = view.getContextValue(PublicationService.class);
+ public void displayCompareNumberCatchGraph(final ControlView view) {
- Map<String, JFreeChart> charts = publicationService.getCompareCatchLengthGraph(project, project.getControl(), null);
- List<String> species = new ArrayList<String>(charts.keySet());
+ final Project project = view.getContextValue(Project.class);
+ final PublicationService publicationService = view.getContextValue(PublicationService.class);
- ControlGraphDialog dialog = new ControlGraphDialog(view);
- dialog.setHandler(this);
- dialog.setContextValue(charts);
- dialog.getSpecyComboModel().setSpecy(species);
- dialog.pack();
- dialog.setLocationRelativeTo(view);
- dialog.setVisible(true);
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ try {
+ setWaitCursor(view);
+ Map<String, JFreeChart> charts = publicationService.getCompareCatchLengthGraph(project, project.getControl(), null);
+ List<String> species = new ArrayList<String>(charts.keySet());
+
+ ControlGraphFrame frame = new ControlGraphFrame(view);
+ frame.setHandler(ControlHandler.this);
+ frame.setContextValue(charts);
+ frame.getSpecyComboModel().setSpecy(species);
+ frame.pack();
+ frame.setLocationRelativeTo(view);
+ frame.setVisible(true);
+ }
+ finally {
+ setDefaultCursor(view);
+ }
+ }
+ });
}
/**
@@ -850,7 +881,7 @@
*
* @param view view
*/
- public void updateCompareNumberCatchGraph(ControlGraphDialog view) {
+ public void updateCompareNumberCatchGraph(ControlGraphFrame view) {
String specyName = (String)view.getSpecyComboModel().getSelectedItem();
Map<String, JFreeChart> charts = view.getContextValue(Map.class);
JFreeChart chart = charts.get(specyName);
1
0
r331 - in trunk/coser-ui/src/main/java/fr/ifremer/coser: . ui
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
02 Dec '10
Author: chatellier
Date: 2010-12-02 10:52:31 +0000 (Thu, 02 Dec 2010)
New Revision: 331
Log:
Changement du curseur sur les actions longues.
Modified:
trunk/coser-ui/src/main/java/fr/ifremer/coser/Coser.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrame.jaxx
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/SelectionsListMenuItem.java
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/Coser.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/Coser.java 2010-12-02 10:34:35 UTC (rev 330)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/Coser.java 2010-12-02 10:52:31 UTC (rev 331)
@@ -92,7 +92,7 @@
log.error("Global application exception", ex);
}
ErrorHelper errorHelper = new ErrorHelper(coserConfig);
- errorHelper.showErrorDialog(null, "Global application exception", ex);
+ errorHelper.showErrorDialog(null, ex.getMessage(), ex);
}
});
}
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrame.jaxx
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrame.jaxx 2010-12-02 10:34:35 UTC (rev 330)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrame.jaxx 2010-12-02 10:52:31 UTC (rev 331)
@@ -39,10 +39,10 @@
<JMenuItem text="coser.ui.mainframe.menu.quit" onActionPerformed="getHandler().quit()"/>
</JMenu>
- <JMenu id='menuWindow' text="coser.ui.mainframe.menu.data" enabled="false">
+ <JMenu id='menuWindow' text="coser.ui.mainframe.menu.data" enabled="{getProject() != null}">
<JMenuItem text="coser.ui.mainframe.menu.data.summary" onActionPerformed="getHandler().showSummaryView()"/>
<JMenuItem text="coser.ui.mainframe.menu.data.control" onActionPerformed="getHandler().showControlView()"/>
- <SelectionsListMenuItem id="menuWindowSelectionMenuItem"
+ <SelectionsListMenuItem id="menuWindowSelectionMenuItem" project="{getProject()}"
text="coser.ui.mainframe.menu.data.selections" constructorParams="this" />
</JMenu>
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-02 10:34:35 UTC (rev 330)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-02 10:52:31 UTC (rev 331)
@@ -27,6 +27,7 @@
import java.awt.BorderLayout;
import java.awt.Component;
+import java.awt.Cursor;
import java.beans.PropertyChangeEvent;
import java.io.File;
import java.net.URL;
@@ -89,6 +90,20 @@
}
/**
+ * Install le curseur sablier.
+ */
+ protected void setWaitCursor() {
+ view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ }
+
+ /**
+ * Repositionne le curseur a sa valeur par defaut.
+ */
+ protected void setDefaultCursor() {
+ view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ }
+
+ /**
* Switch application locale.
*
* @param frame frame
@@ -190,6 +205,10 @@
dialogUI.setVisible(true);
}
+ /**
+ * Affiche la fenetre de configuration des validateurs personnel de
+ * l'utilisateur.
+ */
public void showValidatorsConfiguration() {
ValidatorDialog validatorDialog = new ValidatorDialog(view);
URL sample = Catch.class.getResource("Catch-error-validation.xml");
@@ -203,7 +222,7 @@
* Retourne une unique instance du file chooser pour conserver
* le répertoire de sélection d'un appel sur l'autre.
*
- * @return
+ * @return l'unique instance de file chooser
*/
protected JFileChooser getFileChooser() {
if (fileChooser == null) {
@@ -288,6 +307,7 @@
// disable create button
projectView.getCreateProjectButton().setEnabled(false);
+ setWaitCursor();
SwingWorker<Project, Void> task = new SwingWorker<Project, Void>() {
long before = System.currentTimeMillis();
@@ -323,6 +343,7 @@
} catch (Exception ex) {
throw new CoserException("Can't create project", ex);
}
+ setDefaultCursor();
}
};
task.execute();
@@ -336,6 +357,7 @@
public void saveProject(ProjectEditView view) {
Project project = view.getProject();
ProjectService projectService = view.getContextValue(ProjectService.class);
+ setWaitCursor();
try {
projectService.saveProject(project);
showSummaryView();
@@ -343,6 +365,9 @@
catch (CoserBusinessException ex) {
throw new CoserException("Can't save project", ex);
}
+ finally {
+ setDefaultCursor();
+ }
}
/**
@@ -354,6 +379,8 @@
final String projectName = (String)projectView.getProjectsComboBox().getSelectedItem();
ProjectService projectService = projectView.getContextValue(ProjectService.class);
+
+ setWaitCursor();
try {
Project project = projectService.openProject(projectName);
projectLoaded(project);
@@ -365,6 +392,7 @@
JOptionPane.showMessageDialog(projectView, ex.getMessage(), _("coser.ui.project.openError"),
JOptionPane.ERROR_MESSAGE);
}
+ setDefaultCursor();
}
/**
@@ -381,8 +409,6 @@
protected void projectLoaded(Project project) {
view.setProject(project);
view.setContextValue(project);
- view.getMenuWindow().setEnabled(true);
- view.getMenuWindowSelectionMenuItem().setProject(project);
}
/**
@@ -415,8 +441,10 @@
// load control
ProjectService projectService = view.getContextValue(ProjectService.class);
Project project = view.getContextValue(Project.class);
+
+ setWaitCursor();
try {
-
+
if (reloadData) {
project = projectService.loadControlData(project);
}
@@ -433,6 +461,9 @@
} catch (CoserBusinessException ex) {
throw new CoserException("Can't load control data", ex);
}
+ finally {
+ setDefaultCursor();
+ }
}
/**
@@ -443,6 +474,8 @@
// create new selection
ProjectService projectService = view.getContextValue(ProjectService.class);
Project project = view.getContextValue(Project.class);
+
+ setWaitCursor();
try {
Selection selection = projectService.initProjectSelection(project);
view.setContextValue(selection);
@@ -474,6 +507,9 @@
JOptionPane.ERROR_MESSAGE);
throw new CoserException("Can't create new selection", ex);
}
+ finally {
+ setDefaultCursor();
+ }
}
/**
@@ -486,6 +522,8 @@
ProjectService projectService = view.getContextValue(ProjectService.class);
Project project = view.getContextValue(Project.class);
Selection selection = project.getSelections().get(selectionName);
+
+ setWaitCursor();
try {
project = projectService.loadSelectionData(project, selection);
view.setContextValue(selection);
@@ -515,6 +553,9 @@
} catch (CoserBusinessException ex) {
throw new CoserException("Can't reload selection data", ex);
}
+ finally {
+ setDefaultCursor();
+ }
}
/**
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/SelectionsListMenuItem.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/SelectionsListMenuItem.java 2010-12-02 10:34:35 UTC (rev 330)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/SelectionsListMenuItem.java 2010-12-02 10:52:31 UTC (rev 331)
@@ -36,7 +36,6 @@
import javax.swing.JMenuItem;
import javax.swing.JSeparator;
-import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -80,8 +79,10 @@
this.project.getControl().removePropertyChangeListener(Control.PROPERTY_VALIDATED, this);
}
this.project = project;
- this.project.addPropertyChangeListener(Project.PROPERTY_SELECTIONS, this);
- this.project.getControl().addPropertyChangeListener(Control.PROPERTY_VALIDATED, this);
+ if (this.project != null) {
+ this.project.addPropertyChangeListener(Project.PROPERTY_SELECTIONS, this);
+ this.project.getControl().addPropertyChangeListener(Control.PROPERTY_VALIDATED, this);
+ }
updateMenuContent();
}
1
0
r330 - in trunk: coser-business/src/main/java/fr/ifremer/coser coser-business/src/main/java/fr/ifremer/coser/control coser-business/src/main/java/fr/ifremer/coser/services coser-business/src/main/java/fr/ifremer/coser/util coser-business/src/test/java/fr/ifremer/coser/services coser-ui/src/main/java/fr/ifremer/coser/ui coser-ui/src/main/java/fr/ifremer/coser/ui/control coser-ui/src/main/java/fr/ifremer/coser/ui/project coser-ui/src/main/java/fr/ifremer/coser/ui/util
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
by chatellier@users.labs.libre-entreprise.org 02 Dec '10
02 Dec '10
Author: chatellier
Date: 2010-12-02 10:34:35 +0000 (Thu, 02 Dec 2010)
New Revision: 330
Log:
Rend les barres de progression indenpendant de l'utilsation.
Ajout de la progression pour la creation d'un projet.
Added:
trunk/coser-business/src/main/java/fr/ifremer/coser/util/
trunk/coser-business/src/main/java/fr/ifremer/coser/util/ProgressMonitor.java
trunk/coser-business/src/main/java/fr/ifremer/coser/util/ProgressReader.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/util/CoserProgressBar.java
Removed:
trunk/coser-business/src/main/java/fr/ifremer/coser/control/ProgressMonitor.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlProgressBar.java
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java
trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java
trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
trunk/coser-business/src/test/java/fr/ifremer/coser/services/CoserTestAbstract.java
trunk/coser-business/src/test/java/fr/ifremer/coser/services/ImportServiceTest.java
trunk/coser-business/src/test/java/fr/ifremer/coser/services/ProjectServiceTest.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlView.jaxx
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/project/ProjectCreationView.jaxx
Deleted: trunk/coser-business/src/main/java/fr/ifremer/coser/control/ProgressMonitor.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/control/ProgressMonitor.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/control/ProgressMonitor.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -1,50 +0,0 @@
-/*
- * #%L
- *
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-package fr.ifremer.coser.control;
-
-/**
- * Progress monitor.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public interface ProgressMonitor {
-
- void setStepCount(int stepCount);
-
- void setStep(int step);
-
- void nextStep();
-
- void setCurrent(int current);
-
- void setTotal(int total);
-
- void setText(String text);
-}
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -65,13 +65,13 @@
import fr.ifremer.coser.bean.Project;
import fr.ifremer.coser.control.ControlError;
import fr.ifremer.coser.control.DiffCatchLengthControlError;
-import fr.ifremer.coser.control.ProgressMonitor;
import fr.ifremer.coser.data.AbstractDataEntity;
import fr.ifremer.coser.data.Catch;
import fr.ifremer.coser.data.Haul;
import fr.ifremer.coser.data.Length;
import fr.ifremer.coser.data.Strata;
import fr.ifremer.coser.storage.DataStorage;
+import fr.ifremer.coser.util.ProgressMonitor;
/**
* Validation service.
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -59,6 +59,8 @@
import fr.ifremer.coser.data.Strata;
import fr.ifremer.coser.storage.DataStorage;
import fr.ifremer.coser.storage.MemoryDataStorage;
+import fr.ifremer.coser.util.ProgressMonitor;
+import fr.ifremer.coser.util.ProgressReader;
/**
* File import/export service.
@@ -83,12 +85,40 @@
* @param project project
* @param category category
* @param file file to load
+ * @return project
+ * @throws CoserBusinessException
+ */
+ public DataStorage loadCSVFile(Project project, Category category, File file) throws CoserBusinessException {
+ return loadCSVFile(project, category, file, null);
+ }
+
+ /**
+ * Load file as csv. Check and affect data in project depending on category type.
+ *
+ * @param project project
+ * @param category category
+ * @param file file to load
+ * @param progress progress monitor (can be null)
+ * @return project
+ * @throws CoserBusinessException
+ */
+ public DataStorage loadCSVFile(Project project, Category category, File file, ProgressMonitor progress) throws CoserBusinessException {
+ return loadCSVFile(project, category, file, null, false);
+ }
+
+ /**
+ * Load file as csv. Check and affect data in project depending on category type.
+ *
+ * @param project project
+ * @param category category
+ * @param file file to load
+ * @param progress progress monitor (can be null)
* @param originalLoading dans le cas d'un reload, la colonne "line" est a prendre en compte
* pour les data (elle est absente dans les jeux de données originaux)
* @return project
* @throws CoserBusinessException
*/
- public DataStorage loadCSVFile(Project project, Category category, File file, boolean originalLoading) throws CoserBusinessException {
+ public DataStorage loadCSVFile(Project project, Category category, File file, ProgressMonitor progress, boolean originalLoading) throws CoserBusinessException {
DataStorage content = new MemoryDataStorage();
@@ -97,6 +127,9 @@
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), CoserConstants.CSV_FILE_ENCODING));
+ if (progress != null) {
+ reader = new ProgressReader(reader, progress);
+ }
csvReader = new CSVReader(reader, CoserConstants.CSV_SEPARATOR_CHAR);
// check header
@@ -128,8 +161,6 @@
content.add(line);
}
}
- } catch (FileNotFoundException ex) {
- throw new CoserBusinessException("Can't read file", ex);
} catch (IOException ex) {
throw new CoserBusinessException("Can't read file", ex);
}
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -82,6 +82,7 @@
import fr.ifremer.coser.data.Length;
import fr.ifremer.coser.data.Strata;
import fr.ifremer.coser.storage.DataStorage;
+import fr.ifremer.coser.util.ProgressMonitor;
/**
* Service business method relative to project.
@@ -136,10 +137,11 @@
*
* @param project project to create
* @param categoriesAndFiles additional files to load
+ * @param progress progress monitor (can be null)
* @return project with filled data
* @throws CoserBusinessException if project can't be created
*/
- public Project createProject(Project project, Map<Category, File> categoriesAndFiles) throws CoserBusinessException {
+ public Project createProject(Project project, Map<Category, File> categoriesAndFiles, ProgressMonitor progress) throws CoserBusinessException {
File projectsDirectory = config.getProjectsDirectory();
if (!projectsDirectory.isDirectory()) {
projectsDirectory.mkdirs();
@@ -155,6 +157,16 @@
// first free memory, clear all data
project.clearData();
+ // get number of total byte to read
+ if (progress != null) {
+ progress.setCurrent(0);
+ int total = 0;
+ for (Map.Entry<Category, File> categoryAndFile : categoriesAndFiles.entrySet()) {
+ total += categoryAndFile.getValue().length();
+ }
+ progress.setTotal(total);
+ }
+
Control control = new Control();
// load each files
@@ -169,7 +181,7 @@
throw new CoserBusinessException(_("Can't read file %s for category %s", dataFile.getAbsolutePath(), _(category.getTranslationKey())));
}
- DataStorage dataStorage = importService.loadCSVFile(project, category, dataFile, true);
+ DataStorage dataStorage = importService.loadCSVFile(project, category, dataFile, progress, true);
addProjectContent(project, control, category, dataStorage, false);
// init empty deleted collection
@@ -319,7 +331,7 @@
category.getStorageFileName());
if (inputFile.isFile()) {
- DataStorage dataStorage = importService.loadCSVFile(project, category, inputFile, false);
+ DataStorage dataStorage = importService.loadCSVFile(project, category, inputFile);
addProjectContent(project, null, category, dataStorage, false);
}
else {
@@ -492,7 +504,7 @@
File inputFile = new File(controlDirectory, storageFileName);
if (inputFile.isFile()) {
- DataStorage dataStorage = importService.loadCSVFile(project, category, inputFile, false);
+ DataStorage dataStorage = importService.loadCSVFile(project, category, inputFile);
addProjectContent(project, control, category, dataStorage, false);
fileLoaded++;
}
@@ -507,7 +519,7 @@
inputFile = new File(controlDirectory, storageFileName);
DataStorage dataStorage = null;
if (inputFile.isFile()) {
- dataStorage = importService.loadCSVFile(project, category, inputFile, false);
+ dataStorage = importService.loadCSVFile(project, category, inputFile);
}
else {
dataStorage = importService.getEmptyStorage(project, category);
@@ -530,7 +542,7 @@
// main data
if (storageDataFile.isFile()) {
- DataStorage dataStorage = importService.loadCSVFile(project, category, storageDataFile, true);
+ DataStorage dataStorage = importService.loadCSVFile(project, category, storageDataFile, null, true);
addProjectContent(project, control, category, dataStorage, false);
}
else {
@@ -605,7 +617,7 @@
File inputFile = new File(selectionDirectory, storageFileName);
if (inputFile.isFile()) {
- DataStorage dataStorage = importService.loadCSVFile(project, category, inputFile, false);
+ DataStorage dataStorage = importService.loadCSVFile(project, category, inputFile);
addProjectContent(project, selection, category, dataStorage, false);
fileLoaded++;
}
Copied: trunk/coser-business/src/main/java/fr/ifremer/coser/util/ProgressMonitor.java (from rev 320, trunk/coser-business/src/main/java/fr/ifremer/coser/control/ProgressMonitor.java)
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/util/ProgressMonitor.java (rev 0)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/util/ProgressMonitor.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -0,0 +1,52 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.util;
+
+/**
+ * Progress monitor.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public interface ProgressMonitor {
+
+ void setStepCount(int stepCount);
+
+ void setStep(int step);
+
+ void nextStep();
+
+ void setCurrent(int current);
+
+ void addCurrent(int addition);
+
+ void setTotal(int total);
+
+ void setText(String text);
+}
Added: trunk/coser-business/src/main/java/fr/ifremer/coser/util/ProgressReader.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/util/ProgressReader.java (rev 0)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/util/ProgressReader.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -0,0 +1,72 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.util;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * Reader that notify read progression.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class ProgressReader extends Reader {
+
+ public Reader delegateReader;
+
+ public ProgressMonitor delegateProgress;
+
+ public ProgressReader(Reader delegateReader, ProgressMonitor delegateProgress) {
+ super();
+ this.delegateReader = delegateReader;
+ this.delegateProgress = delegateProgress;
+ }
+
+ /*
+ * @see java.io.Reader#read(char[], int, int)
+ */
+ @Override
+ public int read(char[] cbuf, int off, int len) throws IOException {
+
+ int nb = delegateReader.read(cbuf, off, len);
+ if (nb >= 0) {
+ delegateProgress.addCurrent(nb);
+ }
+ return nb;
+ }
+
+ /*
+ * @see java.io.Reader#close()
+ */
+ @Override
+ public void close() throws IOException {
+ delegateReader.close();
+ }
+}
Property changes on: trunk/coser-business/src/main/java/fr/ifremer/coser/util/ProgressReader.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/coser-business/src/test/java/fr/ifremer/coser/services/CoserTestAbstract.java
===================================================================
--- trunk/coser-business/src/test/java/fr/ifremer/coser/services/CoserTestAbstract.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-business/src/test/java/fr/ifremer/coser/services/CoserTestAbstract.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -128,7 +128,7 @@
project.setHaulFileName(testHaul.getName());
project.setStrataFileName(testStrata.getName());
- project = projectService.createProject(project, categoriesAndFile);
+ project = projectService.createProject(project, categoriesAndFile, null);
project = projectService.loadControlData(project);
// sans la sauvegarde des données de control, on ne pas creer de
Modified: trunk/coser-business/src/test/java/fr/ifremer/coser/services/ImportServiceTest.java
===================================================================
--- trunk/coser-business/src/test/java/fr/ifremer/coser/services/ImportServiceTest.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-business/src/test/java/fr/ifremer/coser/services/ImportServiceTest.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -59,7 +59,7 @@
URL url = ImportServiceTest.class.getResource("/csv/badformat/capturesbadseparator.csv");
File file = new File(url.getFile());
- service.loadCSVFile(p, Category.CATCH, file, true);
+ service.loadCSVFile(p, Category.CATCH, file, null, true);
}
@Test(expected=CoserBusinessException.class)
@@ -68,7 +68,7 @@
URL url = ImportServiceTest.class.getResource("/csv/badformat/stratesheadername.csv");
File file = new File(url.getFile());
- service.loadCSVFile(p, Category.STRATA, file, true);
+ service.loadCSVFile(p, Category.STRATA, file, null, true);
}
@Test(expected=CoserBusinessException.class)
@@ -77,6 +77,6 @@
URL url = ImportServiceTest.class.getResource("/csv/badformat/traitsheaderorder.csv");
File file = new File(url.getFile());
- service.loadCSVFile(p, Category.HAUL, file, true);
+ service.loadCSVFile(p, Category.HAUL, file, null, true);
}
}
Modified: trunk/coser-business/src/test/java/fr/ifremer/coser/services/ProjectServiceTest.java
===================================================================
--- trunk/coser-business/src/test/java/fr/ifremer/coser/services/ProjectServiceTest.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-business/src/test/java/fr/ifremer/coser/services/ProjectServiceTest.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -78,7 +78,7 @@
public void testDuplicatedProject() throws CoserBusinessException {
Project p = new Project();
p.setName("project2"); // il existe deja dans src/test/resources
- projectService.createProject(p, new HashMap<CoserConstants.Category, File>());
+ projectService.createProject(p, new HashMap<CoserConstants.Category, File>(), null);
}
/**
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -296,7 +296,7 @@
ProjectService projectService = projectView.getContextValue(ProjectService.class);
Project resultProject = null;
try {
- resultProject = projectService.createProject(project, fileToLoad);
+ resultProject = projectService.createProject(project, fileToLoad, projectView.getLoadProgressBar());
} catch (CoserBusinessException ex) {
if (log.isErrorEnabled()) {
log.error("Can't create project", ex);
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -87,6 +87,7 @@
import fr.ifremer.coser.services.ControlService;
import fr.ifremer.coser.services.ProjectService;
import fr.ifremer.coser.services.PublicationService;
+import fr.ifremer.coser.ui.util.CoserProgressBar;
/**
* Control handler for control view.
@@ -372,7 +373,7 @@
final ControlService validationService = view.getContextValue(ControlService.class);
final Project project = view.getContextValue(Project.class);
//final Category category = (Category)view.getCategoryComboBox().getSelectedItem();
- final ControlProgressBar progressBar = view.getCheckProgressBar();
+ final CoserProgressBar progressBar = view.getCheckProgressBar();
SwingWorker<List<ControlError>, Void> task = new SwingWorker<List<ControlError>, Void>() {
Deleted: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlProgressBar.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlProgressBar.java 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlProgressBar.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -1,93 +0,0 @@
-/*
- * #%L
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2010 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.coser.ui.control;
-
-import static org.nuiton.i18n.I18n._;
-
-import javax.swing.JProgressBar;
-import fr.ifremer.coser.control.ProgressMonitor;
-
-/**
- * Control progress bar.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class ControlProgressBar extends JProgressBar implements ProgressMonitor {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = 3383288562693714316L;
-
- protected int stepCount;
-
- protected int step;
-
- /*
- * @see fr.ifremer.coser.control.ProgressMonitor#setStepCount(int)
- */
- @Override
- public void setStepCount(int stepCount) {
- this.stepCount = stepCount;
- }
-
- /*
- * @see fr.ifremer.coser.control.ProgressMonitor#setStep(int)
- */
- @Override
- public void setStep(int step) {
- this.step = step;
- }
-
- /*
- * @see fr.ifremer.coser.control.ProgressMonitor#nextStep()
- */
- @Override
- public void nextStep() {
- step++;
- }
-
- /*
- * @see fr.ifremer.coser.control.ProgressMonitor#setCurrent(double)
- */
- @Override
- public void setCurrent(int current) {
- setValue(current);
- }
-
- /*
- * @see fr.ifremer.coser.control.ProgressMonitor#setTotal(double)
- */
- @Override
- public void setTotal(int total) {
- setMaximum(total);
- }
-
- @Override
- public void setText(String text) {
- setString(_("coser.ui.control.progressStep", step +1, stepCount, text));
- }
-}
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlView.jaxx
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlView.jaxx 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlView.jaxx 2010-12-02 10:34:35 UTC (rev 330)
@@ -178,7 +178,7 @@
</row>
<row>
<cell anchor="center" weightx="1" fill="horizontal" columns="2">
- <ControlProgressBar id="checkProgressBar" stringPainted="true" />
+ <fr.ifremer.coser.ui.util.CoserProgressBar id="checkProgressBar" stringPainted="true" />
</cell>
</row>
</Table>
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/project/ProjectCreationView.jaxx
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/project/ProjectCreationView.jaxx 2010-12-01 17:33:19 UTC (rev 329)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/project/ProjectCreationView.jaxx 2010-12-02 10:34:35 UTC (rev 330)
@@ -193,6 +193,11 @@
onActionPerformed="getHandler().createProject(this)" />
</cell>
</row>
+ <row>
+ <cell columns="4" fill="horizontal">
+ <fr.ifremer.coser.ui.util.CoserProgressBar id="loadProgressBar" stringPainted="true" />
+ </cell>
+ </row>
</Table>
</cell>
</row>
Copied: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/util/CoserProgressBar.java (from rev 320, trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlProgressBar.java)
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/util/CoserProgressBar.java (rev 0)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/util/CoserProgressBar.java 2010-12-02 10:34:35 UTC (rev 330)
@@ -0,0 +1,109 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 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.coser.ui.util;
+
+import static org.nuiton.i18n.I18n._;
+
+import javax.swing.JProgressBar;
+
+import fr.ifremer.coser.util.ProgressMonitor;
+
+/**
+ * Control progress bar.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class CoserProgressBar extends JProgressBar implements ProgressMonitor {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3383288562693714316L;
+
+ /** Default to 1 (= no step). */
+ protected int stepCount = 1;
+
+ protected int step;
+
+ /*
+ * @see fr.ifremer.coser.control.ProgressMonitor#setStepCount(int)
+ */
+ @Override
+ public void setStepCount(int stepCount) {
+ this.stepCount = stepCount;
+ }
+
+ /*
+ * @see fr.ifremer.coser.control.ProgressMonitor#setStep(int)
+ */
+ @Override
+ public void setStep(int step) {
+ this.step = step;
+ }
+
+ /*
+ * @see fr.ifremer.coser.control.ProgressMonitor#nextStep()
+ */
+ @Override
+ public void nextStep() {
+ step++;
+ }
+
+ /*
+ * @see fr.ifremer.coser.control.ProgressMonitor#setCurrent(double)
+ */
+ @Override
+ public void setCurrent(int current) {
+ setValue(current);
+ }
+
+ /*
+ * @see fr.ifremer.coser.control.ProgressMonitor#setTotal(double)
+ */
+ @Override
+ public void setTotal(int total) {
+ setMaximum(total);
+ }
+
+ @Override
+ public void setText(String text) {
+ if (stepCount <= 1) {
+ setString(text);
+ } else {
+ setString(_("coser.ui.control.progressStep", step +1, stepCount, text));
+ }
+ }
+
+ /*
+ * @see fr.ifremer.coser.util.ProgressMonitor#addCurrent(int)
+ */
+ @Override
+ public void addCurrent(int addition) {
+ int current = getValue();
+ current += addition;
+ setValue(current);
+ }
+}
1
0
01 Dec '10
Author: chatellier
Date: 2010-12-01 17:33:19 +0000 (Wed, 01 Dec 2010)
New Revision: 329
Log:
Add favicon
Added:
trunk/coser-web/src/main/webapp/favicon.png
Added: trunk/coser-web/src/main/webapp/favicon.png
===================================================================
(Binary files differ)
Property changes on: trunk/coser-web/src/main/webapp/favicon.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
r328 - in trunk: . coser-web coser-web/src/main/java coser-web/src/main/java/fr coser-web/src/main/java/fr/ifremer coser-web/src/main/java/fr/ifremer/coser coser-web/src/main/java/fr/ifremer/coser/web coser-web/src/main/webapp/WEB-INF
by chatellier@users.labs.libre-entreprise.org 01 Dec '10
by chatellier@users.labs.libre-entreprise.org 01 Dec '10
01 Dec '10
Author: chatellier
Date: 2010-12-01 17:15:55 +0000 (Wed, 01 Dec 2010)
New Revision: 328
Log:
Begin coser web module
Added:
trunk/coser-web/src/main/java/fr/
trunk/coser-web/src/main/java/fr/ifremer/
trunk/coser-web/src/main/java/fr/ifremer/coser/
trunk/coser-web/src/main/java/fr/ifremer/coser/web/
trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserServlet.java
Modified:
trunk/coser-web/pom.xml
trunk/coser-web/src/main/webapp/WEB-INF/web.xml
trunk/pom.xml
Modified: trunk/coser-web/pom.xml
===================================================================
--- trunk/coser-web/pom.xml 2010-12-01 16:27:39 UTC (rev 327)
+++ trunk/coser-web/pom.xml 2010-12-01 17:15:55 UTC (rev 328)
@@ -32,6 +32,10 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.aggregate</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ </dependency>
</dependencies>
<name>Coser :: Web</name>
@@ -42,4 +46,53 @@
<properties>
<license.licenseName>agpl_v3</license.licenseName>
</properties>
+
+ <build>
+ <finalName>coser-${project.version}</finalName>
+
+ <!-- Add main class into war to make it executable -->
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.nuiton.util.war.JettyLauncher</mainClass>
+ </manifest>
+ </archive>
+ <overlays>
+ <overlay>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils</artifactId>
+ <type>jar</type>
+ <includes>
+ <include>**/war/Jetty*</include>
+ </includes>
+ </overlay>
+ <overlay>
+ <groupId>org.eclipse.jetty.aggregate</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ <type>jar</type>
+ </overlay>
+ <overlay>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <type>jar</type>
+ </overlay>
+ </overlays>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <configuration>
+ <connectors>
+ <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+ <port>9000</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserServlet.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserServlet.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserServlet.java 2010-12-01 17:15:55 UTC (rev 328)
@@ -0,0 +1,56 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.web;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Coser main servlet.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class CoserServlet extends HttpServlet {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 8814522533745401133L;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+ resp.getWriter().print("Coser : It's works");
+ }
+
+
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserServlet.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/coser-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/web.xml 2010-12-01 16:27:39 UTC (rev 327)
+++ trunk/coser-web/src/main/webapp/WEB-INF/web.xml 2010-12-01 17:15:55 UTC (rev 328)
@@ -6,7 +6,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2010 Ifremer, Codelutin
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -23,10 +23,20 @@
#L%
-->
-<!DOCTYPE web-app
- PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.5//EN"
- "http://java.sun.com/dtd/web-app_2_5.dtd">
-<web-app>
+<web-app version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>Coser</display-name>
+
+ <servlet>
+ <servlet-name>coser</servlet-name>
+ <servlet-class>fr.ifremer.coser.web.CoserServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>coser</servlet-name>
+ <url-pattern>/coser</url-pattern>
+ </servlet-mapping>
+
</web-app>
-
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-12-01 16:27:39 UTC (rev 327)
+++ trunk/pom.xml 2010-12-01 17:15:55 UTC (rev 328)
@@ -17,7 +17,7 @@
<modules>
<module>coser-business</module>
<module>coser-ui</module>
- <!-- <module>coser-web</module> -->
+ <module>coser-web</module>
</modules>
<dependencyManagement>
@@ -187,6 +187,12 @@
<version>3.8.0.GA</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.aggregate</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ <version>7.2.1.v20101111</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -253,6 +259,11 @@
</configuration>
</plugin>
<plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>7.2.1.v20101111</version>
+ </plugin>
+ <plugin>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<locales>fr,en</locales>
1
0
r327 - in trunk: coser-business/src/main/java/fr/ifremer/coser/bean coser-business/src/main/java/fr/ifremer/coser/services coser-ui/src/main/java/fr/ifremer/coser/ui/result coser-ui/src/main/java/fr/ifremer/coser/ui/selection coser-ui/src/main/resources/fr/ifremer/coser/bean coser-ui/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 01 Dec '10
by chatellier@users.labs.libre-entreprise.org 01 Dec '10
01 Dec '10
Author: chatellier
Date: 2010-12-01 16:27:39 +0000 (Wed, 01 Dec 2010)
New Revision: 327
Log:
Fin de l'impl?\195?\169mentation de l'ajout des r?\195?\169sultats
Added:
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/OtherDataFileListModel.java
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java
trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultTableModel.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectionAddResultDialog.jaxx
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionHandler.java
trunk/coser-ui/src/main/resources/fr/ifremer/coser/bean/RSufiResult-error-validation.xml
trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties
trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java 2010-12-01 16:26:53 UTC (rev 326)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java 2010-12-01 16:27:39 UTC (rev 327)
@@ -45,6 +45,16 @@
protected String rsufiVersion;
+ /** Utilisé seulement pour la validation (sinon, non valorisé). */
+ protected String dataFile1Path;
+
+ /** Utilisé seulement pour la validation (sinon, non valorisé). */
+ protected String dataFile2Path;
+
+ protected String dataFile1Name;
+
+ protected String dataFile2Name;
+
public String getName() {
return name;
}
@@ -64,12 +74,58 @@
this.rsufiVersion = rsufiVersion;
getPropertyChangeSupport().firePropertyChange("name", oldValue, name);
}
-
+
+ public String getDataFile1Path() {
+ return dataFile1Path;
+ }
+
+ public void setDataFile1Path(String dataFile1Path) {
+ String oldValue = this.dataFile1Path;
+ this.dataFile1Path = dataFile1Path;
+ getPropertyChangeSupport().firePropertyChange("dataFile1Path", oldValue, dataFile1Path);
+ }
+
+ public String getDataFile2Path() {
+ return dataFile2Path;
+ }
+
+ public void setDataFile2Path(String dataFile2Path) {
+ String oldValue = this.dataFile2Path;
+ this.dataFile2Path = dataFile2Path;
+ getPropertyChangeSupport().firePropertyChange("dataFile2Path", oldValue, dataFile2Path);
+ }
+
+ public String getDataFile1Name() {
+ return dataFile1Name;
+ }
+
+ public void setDataFile1Name(String dataFile1Name) {
+ String oldValue = this.dataFile1Name;
+ this.dataFile1Name = dataFile1Name;
+ getPropertyChangeSupport().firePropertyChange("dataFile1Name", oldValue, dataFile1Name);
+ }
+
+ public String getDataFile2Name() {
+ return dataFile2Name;
+ }
+
+ public void setDataFile2Name(String dataFile2Name) {
+ String oldValue = this.dataFile2Name;
+ this.dataFile2Name = dataFile2Name;
+ getPropertyChangeSupport().firePropertyChange("dataFile2Name", oldValue, dataFile2Name);
+ }
+
public Properties toProperties() {
Properties props = new Properties();
if (getRsufiVersion() != null) {
props.setProperty("result.rsufiversion", getRsufiVersion());
}
+ if (getDataFile1Name() != null) {
+ props.setProperty("result.datafile1name", getDataFile1Name());
+ }
+ if (getDataFile2Name() != null) {
+ props.setProperty("result.datafile2name", getDataFile2Name());
+ }
return props;
}
@@ -77,5 +133,11 @@
if (props.containsKey("result.rsufiversion")) {
setRsufiVersion(props.getProperty("result.rsufiversion"));
}
+ if (props.containsKey("result.datafile1name")) {
+ setDataFile1Name(props.getProperty("result.datafile1name"));
+ }
+ if (props.containsKey("result.datafile2name")) {
+ setDataFile2Name(props.getProperty("result.datafile2name"));
+ }
}
}
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-01 16:26:53 UTC (rev 326)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-01 16:27:39 UTC (rev 327)
@@ -896,10 +896,11 @@
* @param project project
* @param selection selection
* @param rsufiResult new result to save
+ * @param othersFiles others files and directory
* @throws CoserBusinessException
*/
public void saveRsufiResults(Project project, Selection selection,
- RSufiResult rsufiResult) throws CoserBusinessException {
+ RSufiResult rsufiResult, List<File> othersFiles) throws CoserBusinessException {
File projectsDirectory = config.getProjectsDirectory();
File projectDirectory = new File(projectsDirectory, project.getName());
@@ -907,19 +908,38 @@
File selectionDirectory = new File(selectionsDirectory, selection.getName());
File resultsDirectory = new File(selectionDirectory, CoserConstants.STORAGE_RESULTS_DIRECTORY);
File rsufiResultDirectory = new File(resultsDirectory, rsufiResult.getName());
-
+
// save it
if (rsufiResultDirectory.exists()) {
throw new CoserBusinessException(_("coser.business.result.rsufiResultAlreadyExists", rsufiResult.getName()));
}
else {
rsufiResultDirectory.mkdirs();
-
- // sauvegarde des informations du resultat (properties)
- File propertiesFile = new File(rsufiResultDirectory, "result.properties");
- Properties props = rsufiResult.toProperties();
+
OutputStream outputStream = null;
try {
+ // sauvegarde des 2 fichiers obligatoires
+ File dataFile1 = new File(rsufiResult.getDataFile1Path());
+ File dataFile2 = new File(rsufiResult.getDataFile2Path());
+ rsufiResult.setDataFile1Name(dataFile1.getName());
+ rsufiResult.setDataFile2Name(dataFile2.getName());
+ FileUtils.copyFileToDirectory(dataFile1, rsufiResultDirectory);
+ FileUtils.copyFileToDirectory(dataFile2, rsufiResultDirectory);
+
+ // sauvegarde des fichiers autre
+ File otherFilesDirectory = new File(rsufiResultDirectory, "others");
+ for (File othersFile : othersFiles) {
+ if (othersFile.isDirectory()) {
+ FileUtils.copyDirectoryToDirectory(othersFile, otherFilesDirectory);
+ }
+ else {
+ FileUtils.copyFileToDirectory(othersFile, otherFilesDirectory);
+ }
+ }
+
+ // sauvegarde des informations du resultat (properties)
+ File propertiesFile = new File(rsufiResultDirectory, "result.properties");
+ Properties props = rsufiResult.toProperties();
outputStream = new FileOutputStream(propertiesFile);
props.store(outputStream, null);
@@ -932,13 +952,12 @@
finally {
IOUtils.closeQuietly(outputStream);
}
-
+
List<RSufiResult> results = selection.getRsufiResults();
results.add(rsufiResult);
// this way to fire change event (do not remove)
selection.setRsufiResults(results);
}
-
}
/**
Added: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/OtherDataFileListModel.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/OtherDataFileListModel.java (rev 0)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/OtherDataFileListModel.java 2010-12-01 16:27:39 UTC (rev 327)
@@ -0,0 +1,79 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.ui.result;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.AbstractListModel;
+
+/**
+ * Modele de list pour la list des fichiers et répertoire des fichiers
+ * additionnels.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class OtherDataFileListModel extends AbstractListModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -8652851018076968539L;
+
+ protected List<File> otherFiles;
+
+ public OtherDataFileListModel() {
+ otherFiles = new ArrayList<File>();
+ }
+
+ public List<File> getOtherFiles() {
+ return otherFiles;
+ }
+
+ public void add(File file) {
+ otherFiles.add(file);
+ fireIntervalAdded(this, otherFiles.size() - 1, otherFiles.size() - 1);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ return otherFiles.size();
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return otherFiles.get(index);
+ }
+}
Property changes on: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/OtherDataFileListModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultTableModel.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultTableModel.java 2010-12-01 16:26:53 UTC (rev 326)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultTableModel.java 2010-12-01 16:27:39 UTC (rev 327)
@@ -109,9 +109,12 @@
case 1:
result = rsufiResult.getRsufiVersion();
break;
- default:
- result = "N/A";
+ case 2:
+ result = rsufiResult.getDataFile1Name();
break;
+ case 3:
+ result = rsufiResult.getDataFile2Name();
+ break;
}
return result;
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectionAddResultDialog.jaxx
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectionAddResultDialog.jaxx 2010-12-01 16:26:53 UTC (rev 326)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectionAddResultDialog.jaxx 2010-12-01 16:27:39 UTC (rev 327)
@@ -34,6 +34,8 @@
errorTableModel="errorsTableModel">
<field name="name" component="resultNameField" />
<field name="rsufiVersion" component="resultRsufiVersion" />
+ <field name="dataFile1Path" component="dataFile1TextField" />
+ <field name="dataFile2Path" component="dataFile2TextField" />
</BeanValidator>
<row>
@@ -63,10 +65,14 @@
<JLabel text="coser.ui.result.dataFile1" />
</cell>
<cell weightx="1" fill="horizontal">
- <JTextField />
+ <JTextField id="dataFile1TextField" />
+ <javax.swing.text.Document javaBean="dataFile1TextField.getDocument()"
+ onInsertUpdate='getRsufiResult().setDataFile1Path(dataFile1TextField.getText())'
+ onRemoveUpdate='getRsufiResult().setDataFile1Path(dataFile1TextField.getText())' />
</cell>
<cell fill="horizontal">
- <JButton text="coser.ui.common.selectFile" />
+ <JButton text="coser.ui.common.selectFile"
+ onActionPerformed="getHandler().selectResultFile(this, dataFile1TextField)" />
</cell>
</row>
<row>
@@ -74,10 +80,14 @@
<JLabel text="coser.ui.result.dataFile2" />
</cell>
<cell fill="horizontal">
- <JTextField />
+ <JTextField id="dataFile2TextField" />
+ <javax.swing.text.Document javaBean="dataFile2TextField.getDocument()"
+ onInsertUpdate='getRsufiResult().setDataFile2Path(dataFile2TextField.getText())'
+ onRemoveUpdate='getRsufiResult().setDataFile2Path(dataFile2TextField.getText())' />
</cell>
<cell fill="horizontal">
- <JButton text="coser.ui.common.selectFile" />
+ <JButton text="coser.ui.common.selectFile"
+ onActionPerformed="getHandler().selectResultFile(this, dataFile2TextField)" />
</cell>
</row>
<row>
@@ -88,7 +98,8 @@
<row>
<cell columns="3" weighty="1" fill="both">
<JScrollPane>
- <JList />
+ <OtherDataFileListModel id="otherDataFileListModel" />
+ <JList id="otherDataFileList" model="{otherDataFileListModel}"/>
</JScrollPane>
</cell>
</row>
@@ -97,7 +108,8 @@
<Table>
<row>
<cell>
- <JButton text="coser.ui.result.addOtherDataFile" />
+ <JButton text="coser.ui.result.addOtherDataFile"
+ onActionPerformed="getHandler().selectResultFileOrDirectory(this, otherDataFileList)"/>
</cell>
<cell weightx="1" anchor="east">
<JButton text="coser.ui.result.cancel"
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionHandler.java 2010-12-01 16:26:53 UTC (rev 326)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionHandler.java 2010-12-01 16:27:39 UTC (rev 327)
@@ -42,6 +42,7 @@
import java.util.Set;
import javax.swing.JFileChooser;
+import javax.swing.JList;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
@@ -82,6 +83,12 @@
private static final Log log = LogFactory.getLog(SelectionHandler.class);
+ /** File chooser de l'export de répertoire. */
+ protected JFileChooser exportFileChooser;
+
+ /** File chooser de l'ajout de fichier resultat. */
+ protected JFileChooser resultFileChooser;
+
/**
* Appelé sur un changement d'onglet dans l'interface de sélection.
*
@@ -779,10 +786,11 @@
Project project = view.getContextValue(Project.class);
Selection selection = view.getContextValue(Selection.class);
ProjectService projectService = view.getContextValue(ProjectService.class);
-
+ List<File> otherFiles = view.getOtherDataFileListModel().getOtherFiles();
+
RSufiResult newResult = view.getRsufiResult();
try {
- projectService.saveRsufiResults(project, selection, newResult);
+ projectService.saveRsufiResults(project, selection, newResult, otherFiles);
}
catch (CoserBusinessException ex) {
JOptionPane.showMessageDialog(view, ex.getMessage(), _("coser.ui.result.saveError"), JOptionPane.ERROR_MESSAGE);
@@ -797,20 +805,22 @@
*
* @return
*/
- protected JFileChooser getFileChooser() {
- JFileChooser fileChooser = new JFileChooser();
- fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- return fileChooser;
+ protected JFileChooser getExportFileChooser() {
+ if (exportFileChooser == null) {
+ exportFileChooser = new JFileChooser();
+ exportFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ }
+ return exportFileChooser;
}
/**
- * Extract data as RSufi format.
+ * Selectionne le dossier d'extraction.
*
* @param view view
* @param textComponent text component to set selected directory
*/
public void selectOutputDirectory(SelectionRsufiView view, JTextField textComponent) {
- JFileChooser selectFileChooser = getFileChooser();
+ JFileChooser selectFileChooser = getExportFileChooser();
int result = selectFileChooser.showOpenDialog(view);
if (result == JFileChooser.APPROVE_OPTION) {
@@ -838,4 +848,52 @@
throw new CoserException("Can't extract rsufi files", ex);
}
}
+
+ /**
+ * Retourne une unique instance du file chooser pour conserver
+ * le répertoire de sélection d'un appel sur l'autre.
+ *
+ * @return l'instance a utiliser
+ */
+ protected JFileChooser getResultFileChooser() {
+ if (resultFileChooser == null) {
+ resultFileChooser = new JFileChooser();
+ resultFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+ }
+ return resultFileChooser;
+ }
+
+ /**
+ * Select result file (file only).
+ *
+ * @param view view
+ * @param textComponent text component to set selected directory
+ */
+ public void selectResultFile(SelectionAddResultDialog view, JTextField textComponent) {
+ JFileChooser selectFileChooser = getResultFileChooser();
+ selectFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
+
+ int result = selectFileChooser.showOpenDialog(view);
+ if (result == JFileChooser.APPROVE_OPTION) {
+ File selectedFile = selectFileChooser.getSelectedFile();
+ textComponent.setText(selectedFile.getAbsolutePath());
+ }
+ }
+
+ /**
+ * Select result file (file only).
+ *
+ * @param view view
+ * @param listComponent list component to set selected directory
+ */
+ public void selectResultFileOrDirectory(SelectionAddResultDialog view, JList listComponent) {
+ JFileChooser selectFileChooser = getResultFileChooser();
+ selectFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+
+ int result = selectFileChooser.showOpenDialog(view);
+ if (result == JFileChooser.APPROVE_OPTION) {
+ File selectedFile = selectFileChooser.getSelectedFile();
+ view.getOtherDataFileListModel().add(selectedFile);
+ }
+ }
}
Modified: trunk/coser-ui/src/main/resources/fr/ifremer/coser/bean/RSufiResult-error-validation.xml
===================================================================
--- trunk/coser-ui/src/main/resources/fr/ifremer/coser/bean/RSufiResult-error-validation.xml 2010-12-01 16:26:53 UTC (rev 326)
+++ trunk/coser-ui/src/main/resources/fr/ifremer/coser/bean/RSufiResult-error-validation.xml 2010-12-01 16:27:39 UTC (rev 327)
@@ -39,4 +39,16 @@
<message>coser.ui.result.requiredrsufiVersion</message>
</field-validator>
</field>
+ <field name="dataFile1Path">
+ <field-validator type="requiredstring">
+ <param name="trim">true</param>
+ <message>coser.ui.result.requireddataFile1Path</message>
+ </field-validator>
+ </field>
+ <field name="dataFile2Path">
+ <field-validator type="requiredstring">
+ <param name="trim">true</param>
+ <message>coser.ui.result.requireddataFile2Path</message>
+ </field-validator>
+ </field>
</validators>
Modified: trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties
===================================================================
--- trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties 2010-12-01 16:26:53 UTC (rev 326)
+++ trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties 2010-12-01 16:27:39 UTC (rev 327)
@@ -115,20 +115,22 @@
coser.ui.result.addOtherDataFile=Add file
coser.ui.result.availableDataTitle=Available results \:
coser.ui.result.cancel=Cancel
-coser.ui.result.dataFile1=Data file 1 \:
-coser.ui.result.dataFile2=Data file 2 \:
+coser.ui.result.dataFile1=ESTPOPind file \:
+coser.ui.result.dataFile2=ESTCOMind file \:
coser.ui.result.extractDataButton=Extract as Rsufi format
coser.ui.result.extractDataLabel=Extraction directory \:
coser.ui.result.extractDataTitle=Extract RSufi data
coser.ui.result.newResult=New Result
coser.ui.result.otherDataFile=Other files \:
+coser.ui.result.requireddataFile1Path=
+coser.ui.result.requireddataFile2Path=
coser.ui.result.requiredname=Result name is required
coser.ui.result.requiredrsufiVersion=Rsufi version is required
coser.ui.result.resultName=Result name \:
coser.ui.result.rsufiVersion=RSufi version \:
coser.ui.result.saveError=Save error
-coser.ui.result.table.dataFile1=Data file 1
-coser.ui.result.table.dataFile2=Data file 2
+coser.ui.result.table.dataFile1=ESTPOPind file
+coser.ui.result.table.dataFile2=ESTCOMind file
coser.ui.result.table.resultName=Result name
coser.ui.result.table.rsufiVersion=RSufi Version
coser.ui.result.validNewResult=Add this result
Modified: trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties
===================================================================
--- trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties 2010-12-01 16:26:53 UTC (rev 326)
+++ trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties 2010-12-01 16:27:39 UTC (rev 327)
@@ -115,20 +115,22 @@
coser.ui.result.addOtherDataFile=Ajouter un fichier
coser.ui.result.availableDataTitle=R\u00E9sultats disponibles
coser.ui.result.cancel=Annuler
-coser.ui.result.dataFile1=Fichier r\u00E9sultat 1 \:
-coser.ui.result.dataFile2=Fichier r\u00E9sultat 2 \:
+coser.ui.result.dataFile1=Fichier ESTPOPind \:
+coser.ui.result.dataFile2=Fichier ESTCOMind \:
coser.ui.result.extractDataButton=Extraire au format RSufi
coser.ui.result.extractDataLabel=Dossier d'extraction \:
coser.ui.result.extractDataTitle=Extraction des donn\u00E9es RSufi
coser.ui.result.newResult=Nouveau r\u00E9sultat
coser.ui.result.otherDataFile=Autre fichiers \:
+coser.ui.result.requireddataFile1Path=
+coser.ui.result.requireddataFile2Path=
coser.ui.result.requiredname=Le nom du r\u00E9sultat est requis
coser.ui.result.requiredrsufiVersion=Le champ 'rsufiVersion' est requis
coser.ui.result.resultName=Nom du r\u00E9sultat \:
coser.ui.result.rsufiVersion=Version de RSufi \:
coser.ui.result.saveError=Erreur de sauvegarde
-coser.ui.result.table.dataFile1=Fichier de donn\u00E9es 1
-coser.ui.result.table.dataFile2=Fichier de donn\u00E9es 2
+coser.ui.result.table.dataFile1=Fichier ESTPOPind
+coser.ui.result.table.dataFile2=Fichier ESTCOMind
coser.ui.result.table.resultName=Nom du r\u00E9sultat
coser.ui.result.table.rsufiVersion=Version de RSufi
coser.ui.result.validNewResult=Ajouter le r\u00E9sultat
@@ -139,7 +141,7 @@
coser.ui.selection.details.comment=Commentaire \:
coser.ui.selection.details.dates=Ann\u00E9es \:
coser.ui.selection.details.description=Description \:
-coser.ui.selection.details.displayDiffCatchLengthGraphTip=Affiche les graphiques des diff\u00E9rences captures/tailles pour les esp\u00E8ces s�ctionn�.
+coser.ui.selection.details.displayDiffCatchLengthGraphTip=Affiche les graphiques des diff\u00E9rences captures/tailles pour les esp\u00E8ces s\uFFFDlectionn\uFFFDes.
coser.ui.selection.details.filteredSpecies=Esp\u00E8ces filtr\u00E9es (%d/%d) \:
coser.ui.selection.details.name=Nom de la s\u00E9lection \:
coser.ui.selection.details.removeFromSelectedListTip=Retire les esp\u00E8ces s\u00E9lectionn\u00E9es de la liste des esp\u00E8ces s\u00E9lectionn\u00E9es
1
0
r326 - trunk/coser-ui/src/main/java/fr/ifremer/coser/ui
by chatellier@users.labs.libre-entreprise.org 01 Dec '10
by chatellier@users.labs.libre-entreprise.org 01 Dec '10
01 Dec '10
Author: chatellier
Date: 2010-12-01 16:26:53 +0000 (Wed, 01 Dec 2010)
New Revision: 326
Log:
Restauration de l'ui selection
Modified:
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-01 15:07:17 UTC (rev 325)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-01 16:26:53 UTC (rev 326)
@@ -463,6 +463,11 @@
} catch(Exception e) {
e.printStackTrace();
};
+
+ // restore session size
+ SwingSession session = (SwingSession)view.getContextValue(SwingSession.class);
+ session.add(selectionView);
+
setMainComponent(selectionView);
} catch (CoserBusinessException ex) {
JOptionPane.showMessageDialog(view, ex.getMessage(), _("coser.ui.selection.createError"),
@@ -502,6 +507,10 @@
e.printStackTrace();
};
+ // restore session size
+ SwingSession session = (SwingSession)view.getContextValue(SwingSession.class);
+ session.add(selectionView);
+
setMainComponent(selectionView);
} catch (CoserBusinessException ex) {
throw new CoserException("Can't reload selection data", ex);
1
0
r325 - trunk/coser-business/src/main/java/fr/ifremer/coser/services
by chatellier@users.labs.libre-entreprise.org 01 Dec '10
by chatellier@users.labs.libre-entreprise.org 01 Dec '10
01 Dec '10
Author: chatellier
Date: 2010-12-01 15:07:17 +0000 (Wed, 01 Dec 2010)
New Revision: 325
Log:
Extract listespece file in project directory (not result)
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-01 15:05:25 UTC (rev 324)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-01 15:07:17 UTC (rev 325)
@@ -2179,10 +2179,7 @@
List<String> sizeAllYearSpecies = selection.getSelectedSpeciesSizeAllYear();
List<String> maturitySpecies = selection.getSelectedSpeciesMaturity();
- File resultDirectory = new File(projectDirectory, "result-" + project.getName());
- File prepDirectory = new File(resultDirectory, "prep-" + project.getName());
- prepDirectory.mkdirs();
- File listSpeciesFile = new File(prepDirectory, "ListEspeces" + project.getName() + ".txt");
+ File listSpeciesFile = new File(projectDirectory, "ListEspeces" + project.getName() + ".txt");
PrintStream out = null;
try {
out = new PrintStream(new BufferedOutputStream(new FileOutputStream(listSpeciesFile)));
1
0