Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
August 2009
- 2 participants
- 48 discussions
r2530 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 26 Aug '09
by chatellier@users.labs.libre-entreprise.org 26 Aug '09
26 Aug '09
Author: chatellier
Date: 2009-08-26 12:24:48 +0000 (Wed, 26 Aug 2009)
New Revision: 2530
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
Log:
AJout d'un todo sur la selection des cellules meme si on fait un clic droit...
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2009-08-26 12:24:06 UTC (rev 2529)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2009-08-26 12:24:48 UTC (rev 2530)
@@ -89,16 +89,18 @@
@Override
public boolean mouseClicked(MouseEvent e) {
boolean result = false;
- if (e.getButton() == MouseEvent.BUTTON1) {
+ // TODO a fixer, le clic droit du menu contextuel
+ // passe aussi par ici et change la selection
+ //if (e.getButton() == MouseEvent.BUTTON1) {
for (Cell c : cellMap.getSelectedCells()) {
if (getBean() != null) {
if (!c.getTopiaId().equals(getBean().getTopiaId())) {
jaxx.runtime.SwingUtil.fillComboBox(fieldCell,getRegion().getCell(), c);
- return true;
+ result = true;
}
}
}
- }
+ //}
return result;
}
};
1
0
r2529 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 26 Aug '09
by chatellier@users.labs.libre-entreprise.org 26 Aug '09
26 Aug '09
Author: chatellier
Date: 2009-08-26 12:24:06 +0000 (Wed, 26 Aug 2009)
New Revision: 2529
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
Log:
Ajout de divers synchronized pour eviter les modification concurrentes (arrive par exemple lorsqu'on recherche la liste des simulation ?\195?\160 l'ouverture d'isis)
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-08-26 08:42:32 UTC (rev 2528)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-08-26 12:24:06 UTC (rev 2529)
@@ -222,11 +222,11 @@
return executors.values();
}
- public Set<SimulationJob> getJobs() {
+ public synchronized Set<SimulationJob> getJobs() {
return jobs;
}
- public Set<SimulationJob> getJobDones() {
+ public synchronized Set<SimulationJob> getJobDones() {
return jobDones;
}
@@ -269,7 +269,7 @@
* les listener {@link SimulationServiceListener#simulationStart}.
* @param job
*/
- protected void fireStartEvent(SimulationJob job) {
+ protected synchronized void fireStartEvent(SimulationJob job) {
// on ajoute au cas on il n'y serait pas
if (jobs.add(job)) {
idJobs.add(job.getItem().getControl().getId());
@@ -287,7 +287,7 @@
* {@link SimulationServiceListener#simulationStop}.
* @param job
*/
- protected void fireStopEvent(SimulationJob job) {
+ protected synchronized void fireStopEvent(SimulationJob job) {
jobs.remove(job);
idJobs.remove(job.getItem().getControl().getId());
1
0
r2528 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/ui/input src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 26 Aug '09
by chatellier@users.labs.libre-entreprise.org 26 Aug '09
26 Aug '09
Author: chatellier
Date: 2009-08-26 08:42:32 +0000 (Wed, 26 Aug 2009)
New Revision: 2528
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CopyMapToClipboardListener.java
Modified:
isis-fish/trunk/changelog.txt
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Add a contextual menu on maps to copy current displayed map to system clipboard.
Modified: isis-fish/trunk/changelog.txt
===================================================================
--- isis-fish/trunk/changelog.txt 2009-08-25 15:40:19 UTC (rev 2527)
+++ isis-fish/trunk/changelog.txt 2009-08-26 08:42:32 UTC (rev 2528)
@@ -1,5 +1,6 @@
isis-fish (3.2.0.5) stable; urgency=low
+ * Can copy openmap map to system clipboard
* Don't extract database for sensitivity analysis (excepted first)
* Add user script javadoc generation
* Move script import/export to Jaxx
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2009-08-25 15:40:19 UTC (rev 2527)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2009-08-26 08:42:32 UTC (rev 2528)
@@ -40,6 +40,8 @@
setButtonTitle(_("isisfish.input.continueZones"));
setNextPath("$root/$zones");
cellMap.addMapMouseListener(getMapListener());
+// add copy to clipboard support
+cellMap.addMapMouseListener(new CopyMapToClipboardListener(cellMap));
toolSet.setupListeners(cellMap);
toolMap.add((Tool)toolSet);
@@ -86,15 +88,18 @@
mapListener = new OpenMapEvents(cellMap, new SelectMouseMode(false), CellSelectionLayer.SINGLE_SELECTION) {
@Override
public boolean mouseClicked(MouseEvent e) {
- for (Cell c : cellMap.getSelectedCells()) {
- if (getBean() != null) {
- if (!c.getTopiaId().equals(getBean().getTopiaId())) {
- jaxx.runtime.SwingUtil.fillComboBox(fieldCell,getRegion().getCell(), c);
- return true;
+ boolean result = false;
+ if (e.getButton() == MouseEvent.BUTTON1) {
+ for (Cell c : cellMap.getSelectedCells()) {
+ if (getBean() != null) {
+ if (!c.getTopiaId().equals(getBean().getTopiaId())) {
+ jaxx.runtime.SwingUtil.fillComboBox(fieldCell,getRegion().getCell(), c);
+ return true;
+ }
}
}
}
- return true;
+ return result;
}
};
}
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CopyMapToClipboardListener.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CopyMapToClipboardListener.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CopyMapToClipboardListener.java 2009-08-26 08:42:32 UTC (rev 2528)
@@ -0,0 +1,201 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.ui.input;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.awt.Graphics;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.Toolkit;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.bbn.openmap.MapBean;
+import com.bbn.openmap.event.MapMouseListener;
+
+/**
+ * Listener for openmap map bean to display popop menu on rigth clic.
+ *
+ * Currently, this listener can :
+ * - copy current map to system clip board
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class CopyMapToClipboardListener implements ActionListener,
+ MapMouseListener {
+
+ /** Class logger. */
+ private static Log log = LogFactory
+ .getLog(CopyMapToClipboardListener.class);
+
+ /** Copy to clic board action command. */
+ protected static final String COPY_TO_CLICBOARD_COMMAND = "copytoclipboard";
+
+ /** Popop menu. */
+ public JPopupMenu menu;
+
+ /** Open map bean. */
+ protected MapBean mapBean;
+
+ /**
+ * Constructor with map.
+ *
+ * @param mapBean open map bean
+ */
+ public CopyMapToClipboardListener(MapBean mapBean) {
+ this.mapBean = mapBean;
+
+ menu = new JPopupMenu();
+ JMenuItem copyClicboardItem = new JMenuItem();
+ copyClicboardItem.setText(_("isisfish.input.map.copytoclicboard"));
+ copyClicboardItem.setActionCommand(COPY_TO_CLICBOARD_COMMAND);
+ copyClicboardItem.addActionListener(this);
+ menu.add(copyClicboardItem);
+ }
+
+ public MapBean getMapBean() {
+ return mapBean;
+ }
+
+ protected void copyToClipBoard() {
+
+ // Get image from mapBean
+ int width = getMapBean().getWidth();
+ int height = getMapBean().getHeight();
+ BufferedImage image = new BufferedImage(width, height,
+ BufferedImage.TYPE_INT_RGB);
+ GraphicsEnvironment ge = GraphicsEnvironment
+ .getLocalGraphicsEnvironment();
+ Graphics g = ge.createGraphics(image);
+ g.setClip(0, 0, width, height);
+ getMapBean().paintAll(g);
+ ImageSelection imgSel = new ImageSelection(image);
+
+ Toolkit.getDefaultToolkit().getSystemClipboard().setContents(imgSel,
+ null);
+
+ if (log.isInfoEnabled()) {
+ log.info("Copy current image to system clipboard");
+ }
+ }
+
+ // This class is used to hold an image while on the clipboard.
+ public static class ImageSelection implements Transferable {
+ private Image image;
+
+ public ImageSelection(Image image) {
+ this.image = image;
+ }
+
+ // Returns supported flavors
+ public DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[] { DataFlavor.imageFlavor };
+ }
+
+ // Returns true if flavor is supported
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ return DataFlavor.imageFlavor.equals(flavor);
+ }
+
+ // Returns image
+ public Object getTransferData(DataFlavor flavor)
+ throws UnsupportedFlavorException, IOException {
+ if (!DataFlavor.imageFlavor.equals(flavor)) {
+ throw new UnsupportedFlavorException(flavor);
+ }
+ return image;
+ }
+ }
+
+ @Override
+ public String[] getMouseModeServiceList() {
+ return null;
+ }
+
+ @Override
+ public boolean mouseClicked(MouseEvent e) {
+
+ // seulement en menu contextuel
+ if (e.getButton() == MouseEvent.BUTTON3) {
+ menu.show(mapBean, e.getX(), e.getY());
+ }
+ return false;
+ }
+
+ @Override
+ public boolean mouseDragged(MouseEvent arg0) {
+ return false;
+ }
+
+ @Override
+ public void mouseEntered(MouseEvent arg0) {
+
+ }
+
+ @Override
+ public void mouseExited(MouseEvent arg0) {
+
+ }
+
+ @Override
+ public void mouseMoved() {
+
+ }
+
+ @Override
+ public boolean mouseMoved(MouseEvent arg0) {
+ return false;
+ }
+
+ @Override
+ public boolean mousePressed(MouseEvent arg0) {
+ return false;
+ }
+
+ @Override
+ public boolean mouseReleased(MouseEvent arg0) {
+ return false;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ if (e.getActionCommand().equals(COPY_TO_CLICBOARD_COMMAND)) {
+ copyToClipBoard();
+ }
+
+ }
+}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CopyMapToClipboardListener.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2009-08-25 15:40:19 UTC (rev 2527)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2009-08-26 08:42:32 UTC (rev 2528)
@@ -32,6 +32,9 @@
toolSet.setupListeners(cellMap);
toolMap.add((Tool)toolSet);
+// add copy to clipboard support
+cellMap.addMapMouseListener(new CopyMapToClipboardListener(cellMap));
+
setButtonTitle(_("isisfish.input.continueCells"));
setNextPath("$root/$cells");
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2009-08-25 15:40:19 UTC (rev 2527)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2009-08-26 08:42:32 UTC (rev 2528)
@@ -39,6 +39,10 @@
toolSet.setupListeners(portMap);
toolMap.add((Tool)toolSet);
+
+// add copy to clipboard support
+portMap.addMapMouseListener(new CopyMapToClipboardListener(portMap));
+
setMapListener();
setButtonTitle(_("isisfish.input.continueSpecies"));
setNextPath("$root/$species");
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2009-08-25 15:40:19 UTC (rev 2527)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2009-08-26 08:42:32 UTC (rev 2528)
@@ -36,6 +36,10 @@
toolSet.setupListeners(zoneMap);
toolMap.add((Tool)toolSet);
+
+// add copy to clipboard support
+zoneMap.addMapMouseListener(new CopyMapToClipboardListener(zoneMap));
+
zoneMap.addMapMouseListener(getMapListener());
setButtonTitle(_("isisfish.input.continuePorts"));
setNextPath("$root/$ports");
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-08-25 15:40:19 UTC (rev 2527)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-08-26 08:42:32 UTC (rev 2528)
@@ -500,6 +500,7 @@
isisfish.input.continueTripTypes=Continue to trip types
isisfish.input.continueVesselTypes=Continue to vessel types
isisfish.input.continueZones=Continue to zones
+isisfish.input.map.copytoclicboard=Copy to clipboard
isisfish.input.menu.addRegion=Add region
isisfish.input.menu.commit=Commit change
isisfish.input.menu.copyRegion=Copy region
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-08-25 15:40:19 UTC (rev 2527)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-08-26 08:42:32 UTC (rev 2528)
@@ -500,6 +500,7 @@
isisfish.input.continueTripTypes=Continuer vers les types de trajets
isisfish.input.continueVesselTypes=Continuer vers les types de navires
isisfish.input.continueZones=Continuer vers les zones
+isisfish.input.map.copytoclicboard=Copier vers de presse-papiers
isisfish.input.menu.addRegion=Ajouter une r\u00E9gion
isisfish.input.menu.commit=Sauvegarder les changements
isisfish.input.menu.copyRegion=Copier r\u00E9gion
1
0
r2527 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
25 Aug '09
Author: chatellier
Date: 2009-08-25 15:40:19 +0000 (Tue, 25 Aug 2009)
New Revision: 2527
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
Log:
Il manquait la liste des exports de sensibilit?\195?\169.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-08-25 14:05:36 UTC (rev 2526)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-08-25 15:40:19 UTC (rev 2527)
@@ -64,6 +64,7 @@
import fr.ifremer.isisfish.datastore.ScriptStorage;
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.datastore.SimulatorStorage;
+import fr.ifremer.isisfish.export.SensitivityExport;
import fr.ifremer.isisfish.mexico.MexicoHelper;
import fr.ifremer.isisfish.rule.Rule;
import fr.ifremer.isisfish.simulator.AnalysePlan;
@@ -943,6 +944,16 @@
new File(tmpDirectory, ExportStorage.EXPORT_PATH
+ File.separator + name));
}
+
+ // copie de tous les exports de sensitivity a utiliser
+ for (SensitivityExport sensitivity : param.getSensitivityExport()) {
+ String name = ExportStorage.getName(sensitivity);
+ name = name.endsWith(".java") ? name : name + ".java";
+ FileUtil.copy(
+ new File(ExportStorage.getExportDirectory(), name),
+ new File(tmpDirectory, ExportStorage.EXPORT_PATH
+ + File.separator + name));
+ }
// copie de tous les scripts a utiliser
FileUtil.copyRecursively(ScriptStorage.getScriptDirectory(),
1
0
r2526 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish: map ui/input
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
25 Aug '09
Author: chatellier
Date: 2009-08-25 14:05:36 +0000 (Tue, 25 Aug 2009)
New Revision: 2526
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/OpenMapToolPanel.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
Log:
Les hacks jaxx pour contourner les hacks faits pour swixat c'est pas indispensable... :-)
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/OpenMapToolPanel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/OpenMapToolPanel.java 2009-08-25 13:41:58 UTC (rev 2525)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/OpenMapToolPanel.java 2009-08-25 14:05:36 UTC (rev 2526)
@@ -1,62 +0,0 @@
-/*
- * *##% Copyright (C) 2005 Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307, USA. ##%
- */
-
-package fr.ifremer.isisfish.map;
-
-import java.awt.Component;
-
-import com.bbn.openmap.gui.Tool;
-import com.bbn.openmap.gui.ToolPanel;
-
-/**
- * Hack class to permit ToolPanel work with SwiXml, because SwiXml call only
- * add(Component) and not add(Tool).
- *
- * EC-20090825 : The hack is still used in Jaxx UI.
- *
- * Created: 6 septembre 2005 00:01:18 CEST
- *
- * @author Benjamin POUSSIN <poussin at codelutin.com>
- *
- * @version $Revision$
- *
- * Last update: $Date$ by : $Author$
- */
-public class OpenMapToolPanel extends ToolPanel { // OpenMapToolPanel
-
- /** serialVersionUID. */
- private static final long serialVersionUID = -1961465978756124241L;
-
- protected boolean inAdd = false;
-
- public Component add(Component child) {
- if (child instanceof Tool && !inAdd) {
- inAdd = true;
- try {
- super.add((Tool) child);
- } finally {
- inAdd = false;
- }
- } else {
- super.add(child);
- }
- return child;
- }
-
-} // OpenMapToolPanel
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2009-08-25 13:41:58 UTC (rev 2525)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2009-08-25 14:05:36 UTC (rev 2526)
@@ -23,11 +23,14 @@
<fr.ifremer.isisfish.entities.CellImpl id='bean' javaBean='null'/>
<script><![CDATA[
+import java.awt.event.MouseEvent;
import fr.ifremer.isisfish.entities.Cell;
import fr.ifremer.isisfish.entities.CellImpl;
+import com.bbn.openmap.gui.Tool;
import com.bbn.openmap.gui.OMToolSet;
import com.bbn.openmap.event.SelectMouseMode;
import fr.ifremer.isisfish.map.CellSelectionLayer;
+import fr.ifremer.isisfish.map.CellSelectionLayer;
import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabUI;
protected OMToolSet toolSet = new OMToolSet();
@@ -38,7 +41,7 @@
setNextPath("$root/$zones");
cellMap.addMapMouseListener(getMapListener());
toolSet.setupListeners(cellMap);
-toolMap.add((Component)toolSet);
+toolMap.add((Tool)toolSet);
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -82,7 +85,7 @@
if (mapListener == null){
mapListener = new OpenMapEvents(cellMap, new SelectMouseMode(false), CellSelectionLayer.SINGLE_SELECTION) {
@Override
- public boolean onMouseClicked() {
+ public boolean mouseClicked(MouseEvent e) {
for (Cell c : cellMap.getSelectedCells()) {
if (getBean() != null) {
if (!c.getTopiaId().equals(getBean().getTopiaId())) {
@@ -187,7 +190,7 @@
</row>
</Table>
<JPanel id='map' layout='{new BorderLayout()}'>
- <fr.ifremer.isisfish.map.OpenMapToolPanel id='toolMap' javaBean='new fr.ifremer.isisfish.map.OpenMapToolPanel()' constraints='BorderLayout.NORTH' decorator='boxed'/>
+ <com.bbn.openmap.gui.ToolPanel id='toolMap' javaBean='new com.bbn.openmap.gui.ToolPanel()' constraints='BorderLayout.NORTH' decorator='boxed'/>
<fr.ifremer.isisfish.map.IsisMapBean id='cellMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()' selectionMode="1" selectedCells='{getBean()}' fisheryRegion='{getRegion()}' constraints='BorderLayout.CENTER' decorator='boxed'/>
</JPanel>
</JSplitPane>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2009-08-25 13:41:58 UTC (rev 2525)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2009-08-25 14:05:36 UTC (rev 2526)
@@ -25,11 +25,12 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.FisheryRegion;
import fr.ifremer.isisfish.entities.FisheryRegionImpl;
+import com.bbn.openmap.gui.Tool;
import com.bbn.openmap.gui.OMToolSet;
protected OMToolSet toolSet = new OMToolSet();
toolSet.setupListeners(cellMap);
-toolMap.add((Component)toolSet);
+toolMap.add((Tool)toolSet);
setButtonTitle(_("isisfish.input.continueCells"));
setNextPath("$root/$cells");
@@ -294,7 +295,7 @@
</row>
</Table>
<JPanel id='map' layout='{new BorderLayout()}'>
- <fr.ifremer.isisfish.map.OpenMapToolPanel id='toolMap' javaBean='new fr.ifremer.isisfish.map.OpenMapToolPanel()'
+ <com.bbn.openmap.gui.ToolPanel id='toolMap' javaBean='new com.bbn.openmap.gui.ToolPanel()'
constraints='BorderLayout.NORTH' decorator='boxed'/>
<fr.ifremer.isisfish.map.IsisMapBean id='cellMap' selectionMode="0" javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'
fisheryRegion='{getBean()}' constraints='BorderLayout.CENTER' decorator='boxed'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java 2009-08-25 13:41:58 UTC (rev 2525)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java 2009-08-25 14:05:36 UTC (rev 2526)
@@ -26,6 +26,7 @@
import com.bbn.openmap.event.ProjectionEvent;
import com.bbn.openmap.event.SelectMouseMode;
+import fr.ifremer.isisfish.map.CellSelectionLayer;
import fr.ifremer.isisfish.map.IsisMapBean;
/**
@@ -44,6 +45,66 @@
/** serialVersionUID. */
private static final long serialVersionUID = -8365120112075269288L;
+ /**
+ * SelectMouseMode property: Null, Distance, Nav, Select
+ */
+ protected MapMouseMode mouseMode;
+ protected IsisMapBean map;
+
+ protected int selectMode = CellSelectionLayer.SINGLE_SELECTION;
+
+ /**
+ * OnMouseDragged property.
+ *
+ * @deprecated as of 3.2.0.5 unused
+ */
+ protected String onMouseDragged = null;
+
+ /**
+ * OnMouseEntered property.
+ *
+ * @deprecated as of 3.2.0.5 unused
+ */
+ protected String onMouseEntered = null;
+
+ /**
+ * OnMouseExited property.
+ *
+ * @deprecated as of 3.2.0.5 unused
+ */
+ protected String onMouseExited = null;
+
+ /**
+ * OnMouseMoved property.
+ *
+ * @deprecated as of 3.2.0.5 unused
+ */
+ protected String onMouseMoved = null;
+
+ /**
+ * OnMousePressed property.
+ *
+ * @deprecated as of 3.2.0.5 unused
+ */
+ protected String onMousePressed = null;
+
+ /**
+ * OnMouseReleased property.
+ *
+ * @deprecated as of 3.2.0.5 unused
+ */
+ protected String onMouseReleased = null;
+
+ /**
+ * Constructor.
+ *
+ * Register himself to {@code map} mapMouseListener.
+ * Also set mouseMode and selectMode on map.
+ *
+ * @param map map bean
+ * @param mouseMode mouse mode
+ * @param selectMode select mode
+ */
public OpenMapEvents(IsisMapBean map, MapMouseMode mouseMode, int selectMode) {
super();
this.mouseMode = mouseMode;
@@ -55,26 +116,17 @@
}
+ @Override
public void projectionChanged(ProjectionEvent e) {
// do nothing, it's not reel layer
}
/**
- * SelectMouseMode property: Null, Distance, Nav, Select
- */
- protected MapMouseMode mouseMode = null;
- protected IsisMapBean map = null;
- protected int selectMode = 1;
-
- /**
- * OnMouseDragged property.
- */
- protected String onMouseDragged = null;
-
- /**
* Get onMouseDragged property.
*
* @return OnMouseDragged property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public String getOnMouseDragged() {
return this.onMouseDragged;
@@ -84,20 +136,19 @@
* Set onMouseDragged property.
*
* @param onMouseDragged New onMouseDragged property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public void setOnMouseDragged(String onMouseDragged) {
this.onMouseDragged = onMouseDragged;
}
/**
- * OnMouseEntered property.
- */
- protected String onMouseEntered = null;
-
- /**
* Get onMouseEntered property.
*
* @return OnMouseEntered property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public String getOnMouseEntered() {
return this.onMouseEntered;
@@ -107,20 +158,19 @@
* Set onMouseEntered property.
*
* @param onMouseEntered New onMouseEntered property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public void setOnMouseEntered(String onMouseEntered) {
this.onMouseEntered = onMouseEntered;
}
/**
- * OnMouseExited property.
- */
- protected String onMouseExited = null;
-
- /**
* Get onMouseExited property.
*
* @return OnMouseExited property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public String getOnMouseExited() {
return this.onMouseExited;
@@ -130,20 +180,19 @@
* Set onMouseExited property.
*
* @param onMouseExited New onMouseExited property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public void setOnMouseExited(String onMouseExited) {
this.onMouseExited = onMouseExited;
}
/**
- * OnMouseMoved property.
- */
- protected String onMouseMoved = null;
-
- /**
* Get onMouseMoved property.
*
* @return OnMouseMoved property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public String getOnMouseMoved() {
return this.onMouseMoved;
@@ -153,20 +202,19 @@
* Set onMouseMoved property.
*
* @param onMouseMoved New onMouseMoved property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public void setOnMouseMoved(String onMouseMoved) {
this.onMouseMoved = onMouseMoved;
}
/**
- * OnMousePressed property.
- */
- protected String onMousePressed = null;
-
- /**
* Get onMousePressed property.
*
* @return OnMousePressed property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public String getOnMousePressed() {
return this.onMousePressed;
@@ -176,20 +224,19 @@
* Set onMousePressed property.
*
* @param onMousePressed New onMousePressed property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public void setOnMousePressed(String onMousePressed) {
this.onMousePressed = onMousePressed;
}
/**
- * OnMouseReleased property.
- */
- protected String onMouseReleased = null;
-
- /**
* Get onMouseReleased property.
*
* @return OnMouseReleased property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public String getOnMouseReleased() {
return this.onMouseReleased;
@@ -199,44 +246,53 @@
* Set onMouseReleased property.
*
* @param onMouseReleased New onMouseReleased property.
+ *
+ * @deprecated as of 3.2.0.5 unused
*/
public void setOnMouseReleased(String onMouseReleased) {
this.onMouseReleased = onMouseReleased;
}
+ @Override
public String[] getMouseModeServiceList() {
return new String[] { SelectMouseMode.modeID };
}
+ @Override
public boolean mouseClicked(MouseEvent e) {
- onMouseClicked();
return true;
}
-
+
+ @Override
public boolean mouseDragged(MouseEvent e) {
return false;
}
+ @Override
public void mouseEntered(MouseEvent e) {
}
+ @Override
public void mouseExited(MouseEvent e) {
}
+ @Override
public void mouseMoved() {
}
+ @Override
public boolean mouseMoved(MouseEvent e) {
return false;
}
+ @Override
public boolean mousePressed(MouseEvent e) {
return false;
}
+ @Override
public boolean mouseReleased(MouseEvent e) {
return false;
}
- public abstract boolean onMouseClicked();
} // OpenMapEvents
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2009-08-25 13:41:58 UTC (rev 2525)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2009-08-25 14:05:36 UTC (rev 2526)
@@ -27,6 +27,7 @@
import fr.ifremer.isisfish.entities.Port;
import fr.ifremer.isisfish.entities.PortImpl;
import fr.ifremer.isisfish.entities.Cell;
+import com.bbn.openmap.gui.Tool;
import com.bbn.openmap.gui.OMToolSet;
import fr.ifremer.isisfish.map.CellSelectionLayer;
import com.bbn.openmap.event.SelectMouseMode;
@@ -37,7 +38,7 @@
boolean portChanged = true;
toolSet.setupListeners(portMap);
-toolMap.add((Component)toolSet);
+toolMap.add((Tool)toolSet);
setMapListener();
setButtonTitle(_("isisfish.input.continueSpecies"));
setNextPath("$root/$species");
@@ -88,7 +89,7 @@
if (mapListener == null) {
mapListener = new OpenMapEvents(portMap, new SelectMouseMode(false), CellSelectionLayer.SINGLE_SELECTION) {
@Override
- public boolean onMouseClicked() {
+ public boolean mouseClicked(MouseEvent e) {
for (Cell c : portMap.getSelectedCells()) {
if (getBean() != null) {
if (getBean().getCell() != null) {
@@ -174,7 +175,7 @@
</row>
</Table>
<JPanel id='map' layout='{new BorderLayout()}'>
- <fr.ifremer.isisfish.map.OpenMapToolPanel id='toolMap' javaBean='new fr.ifremer.isisfish.map.OpenMapToolPanel()' constraints='BorderLayout.NORTH' decorator='boxed'/>
+ <com.bbn.openmap.gui.ToolPanel id='toolMap' javaBean='new com.bbn.openmap.gui.ToolPanel()' constraints='BorderLayout.NORTH' decorator='boxed'/>
<fr.ifremer.isisfish.map.IsisMapBean id='portMap' selectedCells='{getBean().getCell()}' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()' constraints='BorderLayout.CENTER' selectionMode="1" decorator='boxed' fisheryRegion='{getRegion()}'/>
</JPanel>
</JSplitPane>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2009-08-25 13:41:58 UTC (rev 2525)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2009-08-25 14:05:36 UTC (rev 2526)
@@ -28,13 +28,14 @@
import fr.ifremer.isisfish.entities.ZoneImpl;
import fr.ifremer.isisfish.map.CellSelectionLayer;
import com.bbn.openmap.event.SelectMouseMode;
+import com.bbn.openmap.gui.Tool;
import com.bbn.openmap.gui.OMToolSet;
protected OMToolSet toolSet = new OMToolSet();
protected OpenMapEvents mapListener = null;
toolSet.setupListeners(zoneMap);
-toolMap.add((Component)toolSet);
+toolMap.add((Tool)toolSet);
zoneMap.addMapMouseListener(getMapListener());
setButtonTitle(_("isisfish.input.continuePorts"));
setNextPath("$root/$ports");
@@ -96,7 +97,7 @@
if (mapListener == null) {
mapListener = new OpenMapEvents(zoneMap, new SelectMouseMode(false), CellSelectionLayer.MULT_SELECTION) {
@Override
- public boolean onMouseClicked() {
+ public boolean mouseClicked(MouseEvent e) {
getBean().setCell(zoneMap.getSelectedCells());
if (getBean().getCell() != null){
zoneCells.setSelectedValues(getBean().getCell().toArray());
@@ -184,8 +185,8 @@
</row>
</Table>
<JPanel id='map' layout='{new BorderLayout()}'>
- <fr.ifremer.isisfish.map.OpenMapToolPanel id='toolMap'
- javaBean='new fr.ifremer.isisfish.map.OpenMapToolPanel()'
+ <com.bbn.openmap.gui.ToolPanel id='toolMap'
+ javaBean='new com.bbn.openmap.gui.ToolPanel()'
decorator='boxed'
constraints='BorderLayout.NORTH'/>
<fr.ifremer.isisfish.map.IsisMapBean id='zoneMap'
1
0
r2525 - isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
25 Aug '09
Author: chatellier
Date: 2009-08-25 13:41:58 +0000 (Tue, 25 Aug 2009)
New Revision: 2525
Modified:
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java
Log:
Ya un pb sur l'isolation des tests...
Modified: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java 2009-08-25 13:29:03 UTC (rev 2524)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java 2009-08-25 13:41:58 UTC (rev 2525)
@@ -191,7 +191,7 @@
File archive = new File("src" + File.separator + "test"
+ File.separator + "resources" + File.separator + "simulations"
+ File.separator + "test-nonregression-20090203.zip");
- File dest = new File(getCurrentDatabaseDirectory(), "testunzip");
+ File dest = new File(getCurrentDatabaseDirectory(), "testunzip2");
String pattern = ".*/scripts/.*";
if (log.isInfoEnabled()) {
1
0
r2524 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
25 Aug '09
Author: chatellier
Date: 2009-08-25 13:29:03 +0000 (Tue, 25 Aug 2009)
New Revision: 2524
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
Log:
Make new method filtered uncompress deprecated (will be in lutinutil).
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-08-25 13:18:04 UTC (rev 2523)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-08-25 13:29:03 UTC (rev 2524)
@@ -1059,6 +1059,8 @@
* @param targetDir destination file
* @param excludes excludes pattern
* @throws IOException
+ *
+ * @Deprecated this code may be in lutin util later...
*/
protected void uncompressFiltred(File file, File targetDir, String... excludes) throws IOException {
ZipInputStream in = new ZipInputStream(new FileInputStream(file));
1
0
r2523 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/simulator/launcher src/main/resources/i18n src/test/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
25 Aug '09
Author: chatellier
Date: 2009-08-25 13:18:04 +0000 (Tue, 25 Aug 2009)
New Revision: 2523
Modified:
isis-fish/trunk/changelog.txt
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java
Log:
Don't extract everything only in AS case.
Modified: isis-fish/trunk/changelog.txt
===================================================================
--- isis-fish/trunk/changelog.txt 2009-08-25 08:24:53 UTC (rev 2522)
+++ isis-fish/trunk/changelog.txt 2009-08-25 13:18:04 UTC (rev 2523)
@@ -1,5 +1,6 @@
isis-fish (3.2.0.5) stable; urgency=low
+ * Don't extract database for sensitivity analysis (excepted first)
* Add user script javadoc generation
* Move script import/export to Jaxx
* Fix nano time problem (not related to real date)
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-08-25 08:24:53 UTC (rev 2522)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-08-25 13:18:04 UTC (rev 2523)
@@ -20,10 +20,14 @@
import static org.codelutin.i18n.I18n._;
+import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.io.StringWriter;
import java.io.Writer;
import java.rmi.RemoteException;
@@ -32,6 +36,8 @@
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Semaphore;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
@@ -385,8 +391,17 @@
// FIXME too slow methods
//SimulationStorage.importZip(resultZipFile);
//Tbz2Util.uncompress(resultArchiveFile, SimulationStorage.getSimulationDirectory());
- ZipUtil.uncompress(resultArchiveFile, SimulationStorage.getSimulationDirectory());
-
+ //ZipUtil.uncompress(resultArchiveFile, SimulationStorage.getSimulationDirectory());
+
+ // FIXME big hacks here, only extract non first simulation
+ // only for AS
+ if (control.getId().startsWith("as_") && !control.getId().endsWith("_0")) {
+ uncompressFiltred(resultArchiveFile, SimulationStorage.getSimulationDirectory(), ".*/data/.*");
+ }
+ else {
+ uncompressFiltred(resultArchiveFile, SimulationStorage.getSimulationDirectory());
+ }
+
if (log.isDebugEnabled()) {
log.debug("Simulation imported : " + resultArchiveFile.getAbsolutePath());
}
@@ -1036,4 +1051,49 @@
return remotePath;
}
+
+ /**
+ * Unzip compressed archive and keep non exluded patterns.
+ *
+ * @param file archive file
+ * @param targetDir destination file
+ * @param excludes excludes pattern
+ * @throws IOException
+ */
+ protected void uncompressFiltred(File file, File targetDir, String... excludes) throws IOException {
+ ZipInputStream in = new ZipInputStream(new FileInputStream(file));
+ ZipEntry entry;
+ while ((entry = in.getNextEntry()) != null) {
+
+ String name = entry.getName();
+
+ // add continue to break loop
+ if (excludes != null) {
+ boolean excludeEntry = false;
+ for (String exclude : excludes) {
+ if (name.matches(exclude)) {
+ excludeEntry = true;
+ }
+ }
+ if (excludeEntry) {
+ continue;
+ }
+ }
+
+ File target = new File(targetDir, name);
+ if (entry.isDirectory()) {
+ target.mkdirs();
+ } else {
+ target.getParentFile().mkdirs();
+ OutputStream out = new BufferedOutputStream(new FileOutputStream(target));
+ byte[] buffer = new byte[8 * 1024];
+ int len;
+ while ((len = in.read(buffer, 0, 8 * 1024)) != -1) {
+ out.write(buffer, 0, len);
+ }
+ out.close();
+ }
+ }
+ in.close();
+ }
}
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-08-25 08:24:53 UTC (rev 2522)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-08-25 13:18:04 UTC (rev 2523)
@@ -877,7 +877,6 @@
isisfish.script.menu.edit=\u00C9dition
isisfish.script.menu.evaluate=Evaluer
isisfish.script.menu.file=Fichier
-isisfish.script.menu.generatejavadoc=G\u00E9n\u00E9rer la javadoc
isisfish.script.menu.javadocgenerate=G\u00E9n\u00E9rer la javadoc
isisfish.script.menu.javadocgenerated=Javadoc g\u00E9n\u00E9r\u00E9e dans %s
isisfish.script.menu.javadocgenerating=Javadoc en cours de g\u00E9n\u00E9ration dans %s...
Modified: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java 2009-08-25 08:24:53 UTC (rev 2522)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java 2009-08-25 13:18:04 UTC (rev 2523)
@@ -18,14 +18,20 @@
package fr.ifremer.isisfish.simulator.launcher;
+import java.io.File;
import java.io.IOException;
import junit.framework.Assert;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.junit.Test;
+import com.sun.source.tree.AssertTree;
+
import fr.ifremer.isisfish.AbstractIsisFishTest;
import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.simulator.SimulationHelperTest;
import freemarker.template.TemplateException;
/**
@@ -40,6 +46,9 @@
*/
public class SshSimulatorLauncherTest extends AbstractIsisFishTest {
+ /** Commons logging log. */
+ private static Log log = LogFactory.getLog(SshSimulatorLauncherTest.class);
+
/**
* Test l'instantiation du script qsub (caparmor).
*
@@ -65,15 +74,16 @@
SIMULATIONZIP, SIMULATIONRESULTZIP, SIMULATIONPRESCRIPT);
// simulation parameters
- Assert.assertTrue("String \"" + SIMULATIONID
+ Assert
+ .assertTrue("String \"" + SIMULATIONID
+ "\" not found in template", content
.indexOf(SIMULATIONID) > 0);
Assert.assertTrue("String \"" + SIMULATIONZIP
+ "\" not found in template",
content.indexOf(SIMULATIONZIP) > 0);
Assert.assertTrue("String \"" + SIMULATIONRESULTZIP
- + "\" not found in template",
- content.indexOf(SIMULATIONRESULTZIP) > 0);
+ + "\" not found in template", content
+ .indexOf(SIMULATIONRESULTZIP) > 0);
Assert.assertTrue("String \"" + SIMULATIONPRESCRIPT
+ "\" not found in template", content
.indexOf(SIMULATIONPRESCRIPT) > 0);
@@ -113,17 +123,18 @@
SIMULATIONZIP, SIMULATIONRESULTZIP, SIMULATIONPRESCRIPT);
// simulation parameters
- Assert.assertTrue("String \"" + SIMULATIONID
+ Assert
+ .assertTrue("String \"" + SIMULATIONID
+ "\" not found in template", content
.indexOf(SIMULATIONID) > 0);
Assert.assertTrue("String \"" + SIMULATIONZIP
+ "\" not found in template",
content.indexOf(SIMULATIONZIP) > 0);
Assert.assertTrue("String \"" + SIMULATIONRESULTZIP
- + "\" not found in template",
- content.indexOf(SIMULATIONRESULTZIP) > 0);
- Assert.assertTrue("Action --simulateRemotelly not on script",
- content.indexOf(" --simulateRemotelly ") > 0);
+ + "\" not found in template", content
+ .indexOf(SIMULATIONRESULTZIP) > 0);
+ Assert.assertTrue("Action --simulateRemotelly not on script", content
+ .indexOf(" --simulateRemotelly ") > 0);
// isis location
Assert.assertTrue("String \"" + ISISHOME + "\" not found in template",
@@ -141,11 +152,55 @@
public void testValidQsubScript() throws IOException {
SSHSimulatorLauncher launcher = new SSHSimulatorLauncher();
String content = launcher.getSimulationScriptLaunchContent(
- SSHSimulatorLauncher.QSUB_SCRIPT_TEMPLATE, "",
- "", "", "");
+ SSHSimulatorLauncher.QSUB_SCRIPT_TEMPLATE, "", "", "", "");
// simulation parameters
Assert.assertTrue("Invalid qsub script is used", content
- .indexOf("!/bin/csh") > 0);
+ .indexOf("!/bin/csh") > 0);
}
+
+ /**
+ * Test la fonction de decompression sans filtres.
+ *
+ * @throws IOException
+ */
+ @Test
+ public void testPartialUncompress() throws IOException {
+ File archive = new File("src" + File.separator + "test"
+ + File.separator + "resources" + File.separator + "simulations"
+ + File.separator + "test-nonregression-20090203.zip");
+ File dest = new File(getCurrentDatabaseDirectory(), "testunzip");
+
+ if (log.isInfoEnabled()) {
+ log.info("Extracting " + archive + " to " + dest);
+ }
+
+ SSHSimulatorLauncher launcher = new SSHSimulatorLauncher();
+ launcher.uncompressFiltred(archive, dest);
+ File ruleFile = new File(dest, "test-nonregression-20090203" + File.separator + "scripts" + File.separator + "RuleUtil.java");
+ Assert.assertTrue(ruleFile.exists());
+ }
+
+ /**
+ * Test la fonction de decompression avec filtres.
+ *
+ * @throws IOException
+ */
+ @Test
+ public void testPartialUncompressFiltred() throws IOException {
+ File archive = new File("src" + File.separator + "test"
+ + File.separator + "resources" + File.separator + "simulations"
+ + File.separator + "test-nonregression-20090203.zip");
+ File dest = new File(getCurrentDatabaseDirectory(), "testunzip");
+ String pattern = ".*/scripts/.*";
+
+ if (log.isInfoEnabled()) {
+ log.info("Extracting " + archive + " to " + dest + " without " + pattern);
+ }
+
+ SSHSimulatorLauncher launcher = new SSHSimulatorLauncher();
+ launcher.uncompressFiltred(archive, dest, pattern);
+ File ruleFile = new File(dest, "test-nonregression-20090203" + File.separator + "scripts" + File.separator + "RuleUtil.java");
+ Assert.assertFalse(ruleFile.exists());
+ }
}
\ No newline at end of file
1
0
r2522 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
25 Aug '09
Author: chatellier
Date: 2009-08-25 08:24:53 +0000 (Tue, 25 Aug 2009)
New Revision: 2522
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/OpenMapToolPanel.java
Log:
Update hack comments.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/OpenMapToolPanel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/OpenMapToolPanel.java 2009-08-25 08:13:15 UTC (rev 2521)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/OpenMapToolPanel.java 2009-08-25 08:24:53 UTC (rev 2522)
@@ -16,18 +16,6 @@
* Place - Suite 330, Boston, MA 02111-1307, USA. ##%
*/
-/*******************************************************************************
- * OpenMapToolPanel.java
- *
- * Created: 6 septembre 2005 00:01:18 CEST
- *
- * @author Benjamin POUSSIN <poussin at codelutin.com>
- *
- * @version $Revision$
- *
- * Last update: $Date$ by : $Author$
- */
-
package fr.ifremer.isisfish.map;
import java.awt.Component;
@@ -38,10 +26,20 @@
/**
* Hack class to permit ToolPanel work with SwiXml, because SwiXml call only
* add(Component) and not add(Tool).
+ *
+ * EC-20090825 : The hack is still used in Jaxx UI.
+ *
+ * Created: 6 septembre 2005 00:01:18 CEST
+ *
+ * @author Benjamin POUSSIN <poussin at codelutin.com>
+ *
+ * @version $Revision$
+ *
+ * Last update: $Date$ by : $Author$
*/
public class OpenMapToolPanel extends ToolPanel { // OpenMapToolPanel
- /** */
+ /** serialVersionUID. */
private static final long serialVersionUID = -1961465978756124241L;
protected boolean inAdd = false;
1
0
r2521 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
by chatellier@users.labs.libre-entreprise.org 25 Aug '09
25 Aug '09
Author: chatellier
Date: 2009-08-25 08:13:15 +0000 (Tue, 25 Aug 2009)
New Revision: 2521
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/CellSelectionLayer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Coordinate.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMap.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapInfo.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapList.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultDataMap.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultScale.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Motif.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ResultatLayer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Scale.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ZoneDelimiterLayer.java
Log:
Add comment, fix javadocn and some code format.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/CellSelectionLayer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/CellSelectionLayer.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/CellSelectionLayer.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,18 +1,23 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.map;
-/**
-* CellSelectionLayer.java
-* Ce layer permet de dessinner un cadrillage avec une latitude/longitude max et min,
-* ainsi qu un pas de maille. Dans ce cadrillage, il est ensuite possible de selectionner
-* des carres. Cette selection peut se faire avec la souris. Il y a diiferents mode de
-* de selections qui sont NO_SELECTION,SINGLE_SELECTION et MULT_SELECTION.
-*
-* Created: Mon Jan 21 13:42:55 2002
-*
-* @author <a href="mailto:seb.regnier at free.fr"></a>
-* @version
-*/
-
import java.awt.Color;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
@@ -30,98 +35,124 @@
import fr.ifremer.isisfish.entities.FisheryRegion;
-public class CellSelectionLayer extends ZoneDelimiterLayer implements MapMouseListener {
+/**
+ * Ce layer permet de dessinner un cadrillage avec une latitude/longitude max et min,
+ * ainsi qu'un pas de maille. Dans ce cadrillage, il est ensuite possible de selectionner
+ * des carres. Cette selection peut se faire avec la souris. Il y a diiferents mode de
+ * de selections qui sont {@link #NO_SELECTION}, {@link #SINGLE_SELECTION} et
+ * {@link #MULT_SELECTION}.
+ *
+ * Created: Mon Jan 21 13:42:55 2002
+ *
+ * @author <a href="mailto:seb.regnier at free.fr"></a>
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class CellSelectionLayer extends ZoneDelimiterLayer implements
+ MapMouseListener {
- /** */
+ /** serialVersionUID */
private static final long serialVersionUID = 6952137313443302883L;
- /* Type de selections possibles */
+
+ /** Current layer selection mode. */
+ protected int selectionMode;
- protected int selectionMode;
+ /** No selection enabled. */
public static final int NO_SELECTION = 0;
+ /** Only single celle selection enabled. */
public static final int SINGLE_SELECTION = 1;
+ /** Multi selection enabled. */
public static final int MULT_SELECTION = 2;
- public CellSelectionLayer (FisheryRegion fisheryRegion, int selectionMode) throws TopiaException {
+ public CellSelectionLayer(FisheryRegion fisheryRegion, int selectionMode)
+ throws TopiaException {
super(fisheryRegion);
this.selectionMode = selectionMode;
}
/**
- * Get the value of selectionMode.
- * @return value of selectionMode.
- */
+ * Get the value of selectionMode.
+ * @return value of selectionMode.
+ */
public int getSelectionMode() {
return selectionMode;
}
/**
- * Set the value of selectionMode.
- * @param v Value to assign to selectionMode.
- */
- public void setSelectionMode(int v) {
+ * Set the value of selectionMode.
+ * @param v Value to assign to selectionMode.
+ */
+ public void setSelectionMode(int v) {
this.selectionMode = v;
}
/**
- * Permet de retrouver le carre incluant le point donne.
- * @param pt le point pour lequel on cherche le carre correspondant
- * @return le carre correspondant au point donne sinon renvoie null.
- */
- public OMGraphic findXY(LatLonPoint pt){
+ * Permet de retrouver le carre incluant le point donne.
+ * @param pt le point pour lequel on cherche le carre correspondant
+ * @return le carre correspondant au point donne sinon renvoie null.
+ */
+ public OMGraphic findXY(LatLonPoint pt) {
// Recupere le vecteur de tous les carres possibles.
List<OMRect> allRect = graphics.getTargets();
// Parcours le vecteur, et cherche le carre, et le renvoie si il existe
- for(OMRect rect:allRect){
- if (pt.getLatitude()>=rect.getSouthLat() && pt.getLatitude()<rect.getNorthLat() &&
- pt.getLongitude()>=rect.getWestLon() && pt.getLongitude()<rect.getEastLon())
- return rect;
+ for (OMRect rect : allRect) {
+ if (pt.getLatitude() >= rect.getSouthLat()
+ && pt.getLatitude() < rect.getNorthLat()
+ && pt.getLongitude() >= rect.getWestLon()
+ && pt.getLongitude() < rect.getEastLon()) {
+ return rect;
+ }
}
// Renvoie null si pas trouve
return null;
}
/**
- * Renvoie tous les carres selectionnes.
- * @return le vecteur contenant des LatLonPoint des carres selectionnes.
- */
- public List<LatLonPoint> getSelected(){
+ * Renvoie tous les carres selectionnes.
+ * @return le vecteur contenant des LatLonPoint des carres selectionnes.
+ */
+ public List<LatLonPoint> getSelected() {
// Recupere le vecteur de tous les carres possibles.
List<OMRect> allRect = graphics.getTargets();
List<LatLonPoint> result = new ArrayList<LatLonPoint>();
// Parcours le vecteur de tous les carres possibles.
- for(OMRect rect: allRect){
+ for (OMRect rect : allRect) {
// Si le carre est selectionne, on rajoute ses coordonnees au vector results
- if (rect.getFillPaint() != null && !OMGraphic.isClear(rect.getFillPaint())){
- result.add(new LatLonPoint(rect.getSouthLat(),rect.getWestLon()));
+ if (rect.getFillPaint() != null
+ && !OMGraphic.isClear(rect.getFillPaint())) {
+ result.add(new LatLonPoint(rect.getSouthLat(), rect
+ .getWestLon()));
}
}
return result;
}
/**
- * Deselectionne tous les carres.
- */
- public void unSelectAll(){
+ * Deselectionne tous les carres.
+ */
+ public void unSelectAll() {
// Recupere le vecteur de tous les carres possibles.
List<OMRect> allRect = graphics.getTargets();
// Parcours le vecteur et met a null la couleur de fond de chaque carre
- for(OMRect rect:allRect){
+ for (OMRect rect : allRect) {
rect.setFillPaint(null);
}
- // Raffraichit le layer
+ // Rafraichit le layer
repaint();
}
/**
- * Permet de selectionner le carre incluant le point donne.
- * @param pt le point pour lequel on cherche le carre correspondant
- * @return true si reussi sinon false.
- */
- public boolean select(LatLonPoint pt){
+ * Permet de selectionner le carre incluant le point donne.
+ * @param pt le point pour lequel on cherche le carre correspondant
+ * @return true si reussi sinon false.
+ */
+ public boolean select(LatLonPoint pt) {
// Recherche le carre correspondant au point donne
OMGraphic select = findXY(pt);
@@ -130,7 +161,8 @@
return false;
// si trouve et pas deja selectionne
- if (select.getFillPaint() == null || OMGraphic.isClear(select.getFillPaint())){
+ if (select.getFillPaint() == null
+ || OMGraphic.isClear(select.getFillPaint())) {
// Si on est en mode SINGLE_SELECTION, on deselectionne tous les carres avant.
if (getSelectionMode() == SINGLE_SELECTION)
unSelectAll();
@@ -143,127 +175,130 @@
}
/**
- * Permet de selectionner le carre incluant le point donne en latitude et longitude.
- * @param latitude la latitude du point
- * @param longitude la longitude du point
- * @return true si reussi sinon false.
- */
- public boolean select(float latitude,float longitude){
- return select(new LatLonPoint(latitude,longitude));
+ * Permet de selectionner le carre incluant le point donne en latitude et longitude.
+ * @param latitude la latitude du point
+ * @param longitude la longitude du point
+ * @return true si reussi sinon false.
+ */
+ public boolean select(float latitude, float longitude) {
+ return select(new LatLonPoint(latitude, longitude));
}
-
/**
- * Permet de deselectionner le carre incluant le point donne.
- * @param pt le point pour lequel on cherche le carre correspondant
- * @return true si reussi sinon false.
- */
- public boolean unSelect(LatLonPoint pt){
+ * Permet de deselectionner le carre incluant le point donne.
+ * @param pt le point pour lequel on cherche le carre correspondant
+ * @return true si reussi sinon false.
+ */
+ public boolean unSelect(LatLonPoint pt) {
OMGraphic select = findXY(pt);
- if (select == null)
+ if (select == null) {
return false;
- OMRect rect = (OMRect)select;
+ }
+ OMRect rect = (OMRect) select;
rect.setFillPaint(null);
repaint();
return true;
}
/**
- * Permet de deselectionner le carre incluant le point donne en latitude et longitude.
- * @param latitude la latitude du point
- * @param longitude la longitude du point
- * @return true si reussi sinon false.
- */
- public boolean unSelect(float latitude, float longitude){
- return unSelect(new LatLonPoint(latitude,longitude));
+ * Permet de deselectionner le carre incluant le point donne en latitude et longitude.
+ * @param latitude la latitude du point
+ * @param longitude la longitude du point
+ * @return true si reussi sinon false.
+ */
+ public boolean unSelect(float latitude, float longitude) {
+ return unSelect(new LatLonPoint(latitude, longitude));
}
/**
- * Return a list of the modes that are interesting to the
- * MapMouseListener. The source MouseEvents will only get sent to
- * the MapMouseListener if the mode is set to one that the
- * listener is interested in.
- * Layers interested in receiving events should register for
- * receiving events in "select" mode.
- * <code>
- * <pre>
- * return new String[1] {
- * SelectMouseMode.modeID
- * };
- * </pre>
- * <code>
- * @see NavMouseMode#modeID
- * @see SelectMouseMode#modeID
- * @see NullMouseMode#modeID
- */
+ * Return a list of the modes that are interesting to the
+ * MapMouseListener. The source MouseEvents will only get sent to
+ * the MapMouseListener if the mode is set to one that the
+ * listener is interested in.
+ * Layers interested in receiving events should register for
+ * receiving events in "select" mode.
+ * <code>
+ * <pre>
+ * return new String[1] {
+ * SelectMouseMode.modeID
+ * };
+ * </pre>
+ * <code>
+ * @see NavMouseMode#modeID
+ * @see SelectMouseMode#modeID
+ * @see NullMouseMode#modeID
+ */
public String[] getMouseModeServiceList() {
- return new String[] {
- SelectMouseMode.modeID
- };
+ return new String[] { SelectMouseMode.modeID };
}
/**
- * Note: A layer interested in receiving amouse events should
- * implement this function . Otherwise, return the default, which
- * is null.
- */
+ * Note: A layer interested in receiving amouse events should
+ * implement this function . Otherwise, return the default, which
+ * is null.
+ */
public synchronized MapMouseListener getMapMouseListener() {
return this;
}
/**
- * Invoked when a mouse button has been pressed on a component.
- * @param e MouseEvent
- * @return true if the listener was able to process the event.
- */
+ * Invoked when a mouse button has been pressed on a component.
+ * @param e MouseEvent
+ * @return true if the listener was able to process the event.
+ */
public boolean mousePressed(MouseEvent e) {
return false;
}
/**
- * Invoked when a mouse button has been released on a component.
- * @param e MouseEvent
- * @return true if the listener was able to process the event.
- */
+ * Invoked when a mouse button has been released on a component.
+ * @param e MouseEvent
+ * @return true if the listener was able to process the event.
+ */
public boolean mouseReleased(MouseEvent e) {
return false;
}
/**
- * Invoked when the mouse has been clicked on a component.
- * The listener will receive this event if it successfully
- * processed <code>mousePressed()</code>, or if no other listener
- * processes the event. If the listener successfully processes
- * mouseClicked(), then it will receive the next mouseClicked()
- * notifications that have a click count greater than one.
- * @param e MouseListener MouseEvent to handle.
- * @return true if the listener was able to process the event.
- */
+ * Invoked when the mouse has been clicked on a component.
+ * The listener will receive this event if it successfully
+ * processed <code>mousePressed()</code>, or if no other listener
+ * processes the event. If the listener successfully processes
+ * mouseClicked(), then it will receive the next mouseClicked()
+ * notifications that have a click count greater than one.
+ * @param e MouseListener MouseEvent to handle.
+ * @return true if the listener was able to process the event.
+ */
public boolean mouseClicked(MouseEvent e) {
// si on est dans le mode NO_SELECTION, on fait rien!;
- if (getSelectionMode() == NO_SELECTION)
+ if (getSelectionMode() == NO_SELECTION) {
return false;
+ }
// on recherche le carre clique
- OMGraphic select = findXY(getProjection().inverse(e.getX(),e.getY()));
+ OMGraphic select = findXY(getProjection().inverse(e.getX(), e.getY()));
// si on le trouve pas,on renvoie false
- if (select == null)
+ if (select == null) {
return false;
+ }
// si le carre n est pas selectionne, on le selectionne
- if (select.getFillPaint() == null || OMGraphic.isClear(select.getFillPaint())){
+ if (select.getFillPaint() == null
+ || OMGraphic.isClear(select.getFillPaint())) {
// si on est en mode SINGLE_SELECTION, on deselectionne tous avant.
- if (getSelectionMode() == SINGLE_SELECTION)
+ if (getSelectionMode() == SINGLE_SELECTION) {
unSelectAll();
+ }
// on selectionne le carre
select.setFillPaint(Color.green);
}
// si le carre est deja selectionne
- else{
+ else {
// si on est en mode MULT_SELECTION, on le deselectionne
- if (getSelectionMode() == MULT_SELECTION)
+ if (getSelectionMode() == MULT_SELECTION) {
select.setFillPaint(null);
+ }
}
// Raffraichit le layer
repaint();
@@ -271,49 +306,49 @@
}
/**
- * Invoked when the mouse enters a component.
- * @param e MouseListener MouseEvent to handle.
- */
+ * Invoked when the mouse enters a component.
+ * @param e MouseListener MouseEvent to handle.
+ */
public void mouseEntered(MouseEvent e) {
}
/**
- * Invoked when the mouse exits a component.
- * @param e MouseListener MouseEvent to handle.
- */
+ * Invoked when the mouse exits a component.
+ * @param e MouseListener MouseEvent to handle.
+ */
public void mouseExited(MouseEvent e) {
}
/**
- * Invoked when a mouse button is pressed on a component and then
- * dragged. The listener will receive these events if it
- * successfully processes mousePressed(), or if no other listener
- * processes the event.
- * @param e MouseMotionListener MouseEvent to handle.
- * @return true if the listener was able to process the event.
- */
+ * Invoked when a mouse button is pressed on a component and then
+ * dragged. The listener will receive these events if it
+ * successfully processes mousePressed(), or if no other listener
+ * processes the event.
+ * @param e MouseMotionListener MouseEvent to handle.
+ * @return true if the listener was able to process the event.
+ */
public boolean mouseDragged(MouseEvent e) {
return false;
}
/**
- * Invoked when the mouse tton has been moved on a component
- * (with no buttons no down).
- * @param e MouseListener MouseEvent to handle.
- * @return true if the listener was able to process the event.
- */
+ * Invoked when the mouse tton has been moved on a component
+ * (with no buttons no down).
+ * @param e MouseListener MouseEvent to handle.
+ * @return true if the listener was able to process the event.
+ */
public boolean mouseMoved(MouseEvent e) {
return false;
}
/**
- * Handle a mouse cursor moving without the button being pressed.
- * This event is intended to tell the listener that there was a
- * mouse movement, but that the event was consumed by another
- * layer. This will allow a mouse listener to clean up actions
- * that might have happened because of another motion event
- * response.
- */
+ * Handle a mouse cursor moving without the button being pressed.
+ * This event is intended to tell the listener that there was a
+ * mouse movement, but that the event was consumed by another
+ * layer. This will allow a mouse listener to clean up actions
+ * that might have happened because of another motion event
+ * response.
+ */
public void mouseMoved() {
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Coordinate.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Coordinate.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Coordinate.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,21 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.map;
/**
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMap.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMap.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMap.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,21 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.map;
import java.io.Serializable;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapInfo.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapInfo.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapInfo.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,20 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.map;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapList.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapList.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapList.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,20 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.map;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultDataMap.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultDataMap.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultDataMap.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,20 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.map;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultScale.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultScale.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultScale.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,20 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.map;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -2,7 +2,6 @@
* Copyright (C) 2002, 2003, 2004, 2005 Code Lutin,
* Cédric Pineau, Benjamin Poussin
*
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -18,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * IsisMapBean.java
- *
- * Created: 16 mai 2005
- *
- * @author Benjamin Poussin <poussin at codelutin.com>
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-
package fr.ifremer.isisfish.map;
import static org.codelutin.i18n.I18n._;
@@ -64,13 +51,24 @@
import fr.ifremer.isisfish.entities.CellDAO;
import fr.ifremer.isisfish.entities.FisheryRegion;
+/**
+ * IsisMapBean.java
+ *
+ * Created: 16 mai 2005
+ *
+ * @author Benjamin Poussin <poussin at codelutin.com>
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
public class IsisMapBean extends BufferedMapBean {
- /** */
+ /** serialVersionUID. */
private static final long serialVersionUID = -4162103384132928473L;
/** to use log facility, just put in your code: log.info("..."); */
- static private Log log = LogFactory.getLog(IsisMapBean.class);
+ private static Log log = LogFactory.getLog(IsisMapBean.class);
protected FisheryRegion fisheryRegion = null;
protected float pasMailleLatitude;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Motif.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Motif.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Motif.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,20 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.map;
@@ -19,7 +36,6 @@
* @author <a href="mailto:seb.regnier at free.fr"></a>
* @version $Revision$
*/
-
public class Motif implements Serializable {
/** serialVersionUID */
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ResultatLayer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ResultatLayer.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ResultatLayer.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,20 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.map;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Scale.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Scale.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Scale.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,21 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.map;
import java.io.Serializable;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ZoneDelimiterLayer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ZoneDelimiterLayer.java 2009-08-25 07:35:18 UTC (rev 2520)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ZoneDelimiterLayer.java 2009-08-25 08:13:15 UTC (rev 2521)
@@ -1,3 +1,21 @@
+/* *##%
+ * Copyright (C) 2002, 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.map;
import java.awt.Color;
@@ -30,13 +48,14 @@
* @author <a href="mailto:seb.regnier at free.fr"></a>
* @version $Revision$
*/
-public class ZoneDelimiterLayer extends Layer implements TopiaTransactionListener { //ZoneDelimiterLayer
+public class ZoneDelimiterLayer extends Layer implements
+ TopiaTransactionListener { //ZoneDelimiterLayer
/** serialVersionUID */
private static final long serialVersionUID = 1127201121371123690L;
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(ZoneDelimiterLayer.class);
+ private static Log log = LogFactory.getLog(ZoneDelimiterLayer.class);
protected Projection proj = null;
@@ -50,7 +69,8 @@
protected FisheryRegion fisheryRegion;
protected Collection<Cell> cells;
- public ZoneDelimiterLayer (FisheryRegion fisheryRegion) throws TopiaException {
+ public ZoneDelimiterLayer(FisheryRegion fisheryRegion)
+ throws TopiaException {
this.fisheryRegion = fisheryRegion;
this.pasMailleLatitude = fisheryRegion.getCellLengthLatitude();
@@ -66,26 +86,26 @@
}
/**
- * Set the projection.
- * @param proj Projection
- */
- public void setProjection (Projection proj) {
+ * Set the projection.
+ * @param proj Projection
+ */
+ public void setProjection(Projection proj) {
this.proj = proj;
}
/**
- * Get the projection.
- * @return Projection proj
- */
- public Projection getProjection () {
+ * Get the projection.
+ * @return Projection proj
+ */
+ public Projection getProjection() {
return proj;
}
/**
- * Implementing the ProjectionPainter interface.
- */
- public void renderDataForProjection(Projection proj, java.awt.Graphics g){
- if (proj == null){
+ * Implementing the ProjectionPainter interface.
+ */
+ public void renderDataForProjection(Projection proj, java.awt.Graphics g) {
+ if (proj == null) {
return;
} else {
// generateGraphics();
@@ -95,33 +115,33 @@
}
/**
- * Invoked when the projection has changed or this Layer has been
- * added to the MapBean.
- * @param e ProjectionEvent
- */
- public void projectionChanged (ProjectionEvent e) {
+ * Invoked when the projection has changed or this Layer has been
+ * added to the MapBean.
+ * @param e ProjectionEvent
+ */
+ public void projectionChanged(ProjectionEvent e) {
setProjection(e.getProjection());
repaint();
}
/**
- * Create and project the graphics.Creer l ensemble des carres possible et affiche le
- * cadrillage.
- */
- protected void generateGraphics () throws TopiaException {
+ * Create and project the graphics.Creer l ensemble des carres possible et affiche le
+ * cadrillage.
+ */
+ protected void generateGraphics() throws TopiaException {
graphics.clear();
OMRect omrect;
- for(Cell cell:cells){
- omrect = new OMRect((float)(cell.getLatitude() + pasMailleLatitude),
- (float)cell.getLongitude(),
- (float)cell.getLatitude(),
- (float)(cell.getLongitude() + pasMailleLongitude),
+ for (Cell cell : cells) {
+ omrect = new OMRect(
+ (float) (cell.getLatitude() + pasMailleLatitude),
+ (float) cell.getLongitude(), (float) cell.getLatitude(),
+ (float) (cell.getLongitude() + pasMailleLongitude),
OMGraphic.LINETYPE_STRAIGHT);
- if (cell.getLand()){
- omrect.setLinePaint(new Color(Color.red.getRed(), Color.red.getGreen(), Color.red.getBlue(), 0));//completement transparent
- }
- else{
+ if (cell.getLand()) {
+ omrect.setLinePaint(new Color(Color.red.getRed(), Color.red
+ .getGreen(), Color.red.getBlue(), 0));//completement transparent
+ } else {
omrect.setLinePaint(Color.red);
}
omrect.setVisible(true);
@@ -130,37 +150,39 @@
graphics.generate(getProjection());
}
-// /**
-// * Appelé lorsqu'une ou plusieurs entités ont été créées
-// */
-// public void entityCreated(TopiaEntityEvent event){
-// refresh();
-// }
-// /**
-// * Appelé lorsqu'une ou plusieurs entités ont été chargées
-// */
-// public void entityLoaded(TopiaEntityEvent event){
-// }
-// /**
-// * Appelé lorsqu'une ou plusieurs entités ont été modifiées
-// */
-// public void entityUpdated(TopiaEntityEvent event){
-// refresh();
-// }
-// /**
-// * Appelé lorsqu'une ou plusieurs entités ont été supprimées
-// */
-// public void entityDeleted(TopiaEntityEvent event){
-// refresh();
-// }
+ // /**
+ // * Appelé lorsqu'une ou plusieurs entités ont été créées
+ // */
+ // public void entityCreated(TopiaEntityEvent event){
+ // refresh();
+ // }
+ // /**
+ // * Appelé lorsqu'une ou plusieurs entités ont été chargées
+ // */
+ // public void entityLoaded(TopiaEntityEvent event){
+ // }
+ // /**
+ // * Appelé lorsqu'une ou plusieurs entités ont été modifiées
+ // */
+ // public void entityUpdated(TopiaEntityEvent event){
+ // refresh();
+ // }
+ // /**
+ // * Appelé lorsqu'une ou plusieurs entités ont été supprimées
+ // */
+ // public void entityDeleted(TopiaEntityEvent event){
+ // refresh();
+ // }
- protected void refresh(){
- try{
+ protected void refresh() {
+ try {
cells = fisheryRegion.getCell();
generateGraphics();
repaint();
- }catch(TopiaException eee){
- log.warn("Can't refresh view", eee);
+ } catch (TopiaException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't refresh view", eee);
+ }
}
}
@@ -168,18 +190,20 @@
* Paints the layer.
* @param g the Graphics context for painting
*/
- public void paint (Graphics g) {
+ public void paint(Graphics g) {
//generateGraphics();
graphics.generate(getProjection());
graphics.render(g);
}
- /* (non-Javadoc)
+ /*
* @see org.codelutin.topia.event.TopiaTransactionListener#commit(org.codelutin.topia.event.TopiaTransactionEvent)
*/
+ @Override
public void commit(TopiaTransactionEvent event) {
for (TopiaEntity e : event.getEntities()) {
- if (event.isModification(e) && Cell.class.isAssignableFrom(e.getClass())) {
+ if (event.isModification(e)
+ && Cell.class.isAssignableFrom(e.getClass())) {
// on rafraichi que si on commit au moins un Cell
refresh();
break;
@@ -187,10 +211,11 @@
}
}
- /* (non-Javadoc)
+ /*
* @see org.codelutin.topia.event.TopiaTransactionListener#rollback(org.codelutin.topia.event.TopiaTransactionEvent)
*/
+ @Override
public void rollback(TopiaTransactionEvent event) {
// nothing to do
}
-}// ZoneDelimiterLayer
+} // ZoneDelimiterLayer
1
0