From chatellier@users.labs.libre-entreprise.org Mon Jun 15 00:26:18 2026 From: chatellier@users.labs.libre-entreprise.org To: isis-fish-commits@list.isis-fish.org Subject: [Isis-fish-commits] r2521 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map Date: Tue, 25 Aug 2009 10:13:15 +0200 Message-ID: <20090825081315.BB393258BA6@labs.libre-entreprise.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4525586397490765089==" --===============4525586397490765089== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.j= ava 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.j= ava Log: Add comment, fix javadocn and some code format. Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/CellSelection= Layer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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, US= A. + *##%*/ + package fr.ifremer.isisfish.map; =20 -/** -* 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 diiferent= s mode de -* de selections qui sont NO_SELECTION,SINGLE_SELECTION et MULT_SELECTION. -* -* Created: Mon Jan 21 13:42:55 2002 -* -* @author -* @version -*/ - import java.awt.Color; import java.awt.event.MouseEvent; import java.util.ArrayList; @@ -30,98 +35,124 @@ =20 import fr.ifremer.isisfish.entities.FisheryRegion; =20 -public class CellSelectionLayer extends ZoneDelimiterLayer implements MapMou= seListener { +/** + * Ce layer permet de dessinner un cadrillage avec une latitude/longitude ma= x 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 diiferen= ts 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 + * @version $Revision$ + *=20 + * Last update : $Date$ + * By : $Author$ + */ +public class CellSelectionLayer extends ZoneDelimiterLayer implements + MapMouseListener { =20 - /** */ + /** serialVersionUID */ private static final long serialVersionUID =3D 6952137313443302883L; - /* Type de selections possibles */ + + /** Current layer selection mode. */ + protected int selectionMode; =20 - protected int selectionMode; + /** No selection enabled. */ public static final int NO_SELECTION =3D 0; + /** Only single celle selection enabled. */ public static final int SINGLE_SELECTION =3D 1; + /** Multi selection enabled. */ public static final int MULT_SELECTION =3D 2; =20 - public CellSelectionLayer (FisheryRegion fisheryRegion, int selectionMod= e) throws TopiaException { + public CellSelectionLayer(FisheryRegion fisheryRegion, int selectionMode) + throws TopiaException { super(fisheryRegion); this.selectionMode =3D selectionMode; } =20 /** - * Get the value of selectionMode. - * @return value of selectionMode. - */ + * Get the value of selectionMode. + * @return value of selectionMode. + */ public int getSelectionMode() { return selectionMode; } =20 /** - * 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 =3D v; } =20 /** - * 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 allRect =3D graphics.getTargets(); =20 // Parcours le vecteur, et cherche le carre, et le renvoie si il exi= ste - for(OMRect rect:allRect){ - if (pt.getLatitude()>=3Drect.getSouthLat() && pt.getLatitude()=3Drect.getWestLon() && pt.getLongitude()<= rect.getEastLon()) - return rect; + for (OMRect rect : allRect) { + if (pt.getLatitude() >=3D rect.getSouthLat() + && pt.getLatitude() < rect.getNorthLat() + && pt.getLongitude() >=3D rect.getWestLon() + && pt.getLongitude() < rect.getEastLon()) { + return rect; + } } // Renvoie null si pas trouve return null; } =20 /** - * Renvoie tous les carres selectionnes. - * @return le vecteur contenant des LatLonPoint des carres selectionnes. - */ - public List getSelected(){ + * Renvoie tous les carres selectionnes. + * @return le vecteur contenant des LatLonPoint des carres selectionnes. + */ + public List getSelected() { // Recupere le vecteur de tous les carres possibles. List allRect =3D graphics.getTargets(); =20 List result =3D new ArrayList(); =20 // 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 ve= ctor results - if (rect.getFillPaint() !=3D null && !OMGraphic.isClear(rect.get= FillPaint())){ - result.add(new LatLonPoint(rect.getSouthLat(),rect.getWestLo= n())); + if (rect.getFillPaint() !=3D null + && !OMGraphic.isClear(rect.getFillPaint())) { + result.add(new LatLonPoint(rect.getSouthLat(), rect + .getWestLon())); } } return result; } =20 /** - * Deselectionne tous les carres. - */ - public void unSelectAll(){ + * Deselectionne tous les carres. + */ + public void unSelectAll() { // Recupere le vecteur de tous les carres possibles. List allRect =3D graphics.getTargets(); =20 // Parcours le vecteur et met a null la couleur de fond de chaque ca= rre - for(OMRect rect:allRect){ + for (OMRect rect : allRect) { rect.setFillPaint(null); } - // Raffraichit le layer + // Rafraichit le layer repaint(); } =20 /** - * 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 =3D findXY(pt); =20 @@ -130,7 +161,8 @@ return false; =20 // si trouve et pas deja selectionne - if (select.getFillPaint() =3D=3D null || OMGraphic.isClear(select.ge= tFillPaint())){ + if (select.getFillPaint() =3D=3D null + || OMGraphic.isClear(select.getFillPaint())) { // Si on est en mode SINGLE_SELECTION, on deselectionne tous les= carres avant. if (getSelectionMode() =3D=3D SINGLE_SELECTION) unSelectAll(); @@ -143,127 +175,130 @@ } =20 /** - * 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 e= t 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)); } =20 - /** - * 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 =3D findXY(pt); - if (select =3D=3D null) + if (select =3D=3D null) { return false; - OMRect rect =3D (OMRect)select; + } + OMRect rect =3D (OMRect) select; rect.setFillPaint(null); repaint(); return true; } =20 /** - * 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)); } =20 /** - * 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. - * - *
-    *	return new String[1] {
-        *	    SelectMouseMode.modeID
-    *	};
-    * 
- * - * @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. + * + *
+     *	return new String[1] {
+     *      SelectMouseMode.modeID
+     *	};
+     * 
+ * + * @see NavMouseMode#modeID + * @see SelectMouseMode#modeID + * @see NullMouseMode#modeID + */ public String[] getMouseModeServiceList() { - return new String[] { - SelectMouseMode.modeID - }; + return new String[] { SelectMouseMode.modeID }; } =20 /** - * 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; } =20 /** - * 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; } =20 /** - * 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; } =20 /** - * Invoked when the mouse has been clicked on a component. - * The listener will receive this event if it successfully - * processed mousePressed(), 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 mousePressed(), 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() =3D=3D NO_SELECTION) + if (getSelectionMode() =3D=3D NO_SELECTION) { return false; + } =20 // on recherche le carre clique - OMGraphic select =3D findXY(getProjection().inverse(e.getX(),e.getY(= ))); + OMGraphic select =3D findXY(getProjection().inverse(e.getX(), e.getY= ())); =20 // si on le trouve pas,on renvoie false - if (select =3D=3D null) + if (select =3D=3D null) { return false; + } =20 // si le carre n est pas selectionne, on le selectionne - if (select.getFillPaint() =3D=3D null || OMGraphic.isClear(select.ge= tFillPaint())){ + if (select.getFillPaint() =3D=3D null + || OMGraphic.isClear(select.getFillPaint())) { // si on est en mode SINGLE_SELECTION, on deselectionne tous ava= nt. - if (getSelectionMode() =3D=3D SINGLE_SELECTION) + if (getSelectionMode() =3D=3D 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() =3D=3D MULT_SELECTION) + if (getSelectionMode() =3D=3D MULT_SELECTION) { select.setFillPaint(null); + } } // Raffraichit le layer repaint(); @@ -271,49 +306,49 @@ } =20 /** - * 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) { } =20 /** - * 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) { } =20 /** - * 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; } =20 /** - * 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; } =20 /** - * 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() { } =20 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Coordinate.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Coordinate.java 200= 9-08-25 07:35:18 UTC (rev 2520) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Coordinate.java 200= 9-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, US= A. + *##%*/ + package fr.ifremer.isisfish.map; =20 /** Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMap.java 2009-0= 8-25 07:35:18 UTC (rev 2520) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMap.java 2009-0= 8-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, US= A. + *##%*/ + package fr.ifremer.isisfish.map; =20 import java.io.Serializable; Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapInfo.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapInfo.java 20= 09-08-25 07:35:18 UTC (rev 2520) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapInfo.java 20= 09-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, US= A. + *##%*/ =20 package fr.ifremer.isisfish.map; =20 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapList.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapList.java 20= 09-08-25 07:35:18 UTC (rev 2520) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DataMapList.java 20= 09-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, US= A. + *##%*/ =20 package fr.ifremer.isisfish.map; =20 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultDataMa= p.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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, US= A. + *##%*/ =20 package fr.ifremer.isisfish.map; =20 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultScale.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultScale.java 2= 009-08-25 07:35:18 UTC (rev 2520) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/DefaultScale.java 2= 009-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, US= A. + *##%*/ =20 package fr.ifremer.isisfish.map; =20 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java 20= 09-08-25 07:35:18 UTC (rev 2520) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java 20= 09-08-25 08:13:15 UTC (rev 2521) @@ -2,7 +2,6 @@ * Copyright (C) 2002, 2003, 2004, 2005 Code Lutin, * C=C3=A9dric 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, US= A. *##%*/ =20 -/* * - * IsisMapBean.java - * - * Created: 16 mai 2005 - * - * @author Benjamin Poussin - * @version $Revision$ - * - * Mise a jour: $Date$ - * par : $Author$ - */ - package fr.ifremer.isisfish.map; =20 import static org.codelutin.i18n.I18n._; @@ -64,13 +51,24 @@ import fr.ifremer.isisfish.entities.CellDAO; import fr.ifremer.isisfish.entities.FisheryRegion; =20 +/** + * IsisMapBean.java + * + * Created: 16 mai 2005 + * + * @author Benjamin Poussin + * @version $Revision$ + * + * Mise a jour: $Date$ + * par : $Author$ + */ public class IsisMapBean extends BufferedMapBean { =20 - /** */ + /** serialVersionUID. */ private static final long serialVersionUID =3D -4162103384132928473L; =20 /** to use log facility, just put in your code: log.info("..."); */ - static private Log log =3D LogFactory.getLog(IsisMapBean.class); + private static Log log =3D LogFactory.getLog(IsisMapBean.class); =20 protected FisheryRegion fisheryRegion =3D null; protected float pasMailleLatitude; Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Motif.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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, US= A. + *##%*/ =20 package fr.ifremer.isisfish.map; =20 @@ -19,7 +36,6 @@ * @author * @version $Revision$ */ - public class Motif implements Serializable { =20 /** serialVersionUID */ Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ResultatLayer= .java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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, US= A. + *##%*/ =20 package fr.ifremer.isisfish.map; =20 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/Scale.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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, US= A. + *##%*/ + package fr.ifremer.isisfish.map; =20 import java.io.Serializable; Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/ZoneDelimiter= Layer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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, US= A. + *##%*/ + package fr.ifremer.isisfish.map; =20 import java.awt.Color; @@ -30,13 +48,14 @@ * @author * @version $Revision$ */ -public class ZoneDelimiterLayer extends Layer implements TopiaTransactionLis= tener { //ZoneDelimiterLayer +public class ZoneDelimiterLayer extends Layer implements + TopiaTransactionListener { //ZoneDelimiterLayer =20 /** serialVersionUID */ private static final long serialVersionUID =3D 1127201121371123690L; =20 /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log =3D LogFactory.getLog(ZoneDelimiterLayer.class); + private static Log log =3D LogFactory.getLog(ZoneDelimiterLayer.class); =20 protected Projection proj =3D null; =20 @@ -50,7 +69,8 @@ protected FisheryRegion fisheryRegion; protected Collection cells; =20 - public ZoneDelimiterLayer (FisheryRegion fisheryRegion) throws TopiaExce= ption { + public ZoneDelimiterLayer(FisheryRegion fisheryRegion) + throws TopiaException { this.fisheryRegion =3D fisheryRegion; =20 this.pasMailleLatitude =3D fisheryRegion.getCellLengthLatitude(); @@ -66,26 +86,26 @@ } =20 /** - * Set the projection. - * @param proj Projection - */ - public void setProjection (Projection proj) { + * Set the projection. + * @param proj Projection + */ + public void setProjection(Projection proj) { this.proj =3D proj; } =20 /** - * Get the projection. - * @return Projection proj - */ - public Projection getProjection () { + * Get the projection. + * @return Projection proj + */ + public Projection getProjection() { return proj; } =20 /** - * Implementing the ProjectionPainter interface. - */ - public void renderDataForProjection(Projection proj, java.awt.Graphics g= ){ - if (proj =3D=3D null){ + * Implementing the ProjectionPainter interface. + */ + public void renderDataForProjection(Projection proj, java.awt.Graphics g= ) { + if (proj =3D=3D null) { return; } else { // generateGraphics(); @@ -95,33 +115,33 @@ } =20 /** - * 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(); } =20 /** - * Create and project the graphics.Creer l ensemble des carres possible e= t 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(); =20 OMRect omrect; - for(Cell cell:cells){ - omrect =3D new OMRect((float)(cell.getLatitude() + pasMailleLati= tude), - (float)cell.getLongitude(), - (float)cell.getLatitude(), - (float)(cell.getLongitude() + pasMailleLongitude), + for (Cell cell : cells) { + omrect =3D 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()); } =20 -// /** -// * Appel=C3=A9 lorsqu'une ou plusieurs entit=C3=A9s ont =C3=A9t=C3=A9 c= r=C3=A9=C3=A9es -// */ -// public void entityCreated(TopiaEntityEvent event){ -// refresh(); -// } -// /** -// * Appel=C3=A9 lorsqu'une ou plusieurs entit=C3=A9s ont =C3=A9t=C3=A9 = charg=C3=A9es -// */ -// public void entityLoaded(TopiaEntityEvent event){ -// } -// /** -// * Appel=C3=A9 lorsqu'une ou plusieurs entit=C3=A9s ont =C3=A9t=C3=A9 m= odifi=C3=A9es -// */ -// public void entityUpdated(TopiaEntityEvent event){ -// refresh(); -// } -// /** -// * Appel=C3=A9 lorsqu'une ou plusieurs entit=C3=A9s ont =C3=A9t=C3=A9 s= upprim=C3=A9es -// */ -// public void entityDeleted(TopiaEntityEvent event){ -// refresh(); -// } + // /** + // * Appel=C3=A9 lorsqu'une ou plusieurs entit=C3=A9s ont =C3=A9t=C3= =A9 cr=C3=A9=C3=A9es + // */ + // public void entityCreated(TopiaEntityEvent event){ + // refresh(); + // } + // /** + // * Appel=C3=A9 lorsqu'une ou plusieurs entit=C3=A9s ont =C3=A9t=C3= =A9 charg=C3=A9es + // */ + // public void entityLoaded(TopiaEntityEvent event){ + // } + // /** + // * Appel=C3=A9 lorsqu'une ou plusieurs entit=C3=A9s ont =C3=A9t=C3= =A9 modifi=C3=A9es + // */ + // public void entityUpdated(TopiaEntityEvent event){ + // refresh(); + // } + // /** + // * Appel=C3=A9 lorsqu'une ou plusieurs entit=C3=A9s ont =C3=A9t=C3= =A9 supprim=C3=A9es + // */ + // public void entityDeleted(TopiaEntityEvent event){ + // refresh(); + // } =20 - protected void refresh(){ - try{ + protected void refresh() { + try { cells =3D 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); + } } } =20 @@ -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); } =20 - /* (non-Javadoc) + /* * @see org.codelutin.topia.event.TopiaTransactionListener#commit(org.co= delutin.topia.event.TopiaTransactionEvent) */ + @Override public void commit(TopiaTransactionEvent event) { for (TopiaEntity e : event.getEntities()) { - if (event.isModification(e) && Cell.class.isAssignableFrom(e.get= Class())) { + 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 @@ } } =20 - /* (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 --===============4525586397490765089==--