- *
- * 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==--
|