|
From: <bma...@us...> - 2016-11-25 14:40:53
|
Revision: 9468
http://sourceforge.net/p/fudaa/svn/9468
Author: bmarchan
Date: 2016-11-25 14:40:50 +0000 (Fri, 25 Nov 2016)
Log Message:
-----------
Fix : Pas de possibilit?\195?\169 de supprimer des vitesses sur le calque vitesses brutes et moyennes.
Modified Paths:
--------------
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivRealView.java
trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/layer/PivVelResultsLayer.java
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivRealView.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivRealView.java 2016-11-25 14:38:35 UTC (rev 9467)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/PivRealView.java 2016-11-25 14:40:50 UTC (rev 9468)
@@ -249,6 +249,7 @@
// Layer des vitesses moyennes.
cqVelResults = new PivVelResultsLayer();
+ cqVelResults.setEditable(false);
cqVelResults.setTitle(PivResource.getS("Vit. surf. moy."));
cqVelResults.setLongTitle(PivResource.getS("Vitesses de surface moyenn\xE9es"));
cqVelResults.setTitleModifiable(true);
@@ -266,6 +267,7 @@
// Layer des vitesses instantan\xE9es brutes.
cqInstantVelResults_ = new PivVelResultsLayer();
+ cqInstantVelResults_.setEditable(false);
cqInstantVelResults_.setTitle(PivResource.getS("Vit. surf. inst. brutes"));
cqInstantVelResults_.setLongTitle(PivResource.getS("Vitesses de surface instantan\xE9es brutes"));
cqInstantVelResults_.setName("cqInstantVel");
@@ -273,16 +275,11 @@
cqInstantVelResults_.setLineModel(0, new TraceLigneModel(TraceLigne.LISSE, 1, Color.ORANGE));
cqInstantVelResults_.setTitleModifiable(true);
cqInstantVelResults_.setVisible(false);
-// cqInstantVelResults_.addPropertyChangeListener(new PropertyChangeListener() {
-// public void propertyChange(PropertyChangeEvent evt) {
-// if ("visible".equals(evt.getPropertyName())) {
-// pnLayers_.getShowVelocitiesAction().setSelected((Boolean)evt.getNewValue());
-// }
-// }
-// });
// Layer des vitesses instantan\xE9es filtr\xE9es.
cqInstantVelFltResults_ = new PivVelResultsLayer();
+ // Editable, pour supprimer des vitesses.
+ cqInstantVelFltResults_.setEditable(true);
cqInstantVelFltResults_.setTitle(PivResource.getS("Vit. surf. inst. filtr\xE9es"));
cqInstantVelFltResults_.setLongTitle(PivResource.getS("Vitesses de surface instantan\xE9es filtr\xE9es"));
cqInstantVelFltResults_.setName("cqInstantVelFlt");
@@ -290,13 +287,6 @@
cqInstantVelFltResults_.setLineModel(0, new TraceLigneModel(TraceLigne.LISSE, 1, Color.GREEN.darker()));
cqInstantVelFltResults_.setTitleModifiable(true);
cqInstantVelFltResults_.setVisible(false);
-// cqInstantVelFltResults_.addPropertyChangeListener(new PropertyChangeListener() {
-// public void propertyChange(PropertyChangeEvent evt) {
-// if ("visible".equals(evt.getPropertyName())) {
-// pnLayers_.getShowVelocitiesAction().setSelected((Boolean)evt.getNewValue());
-// }
-// }
-// });
// Layer des d\xE9bits.
cqFlowResults = new ZCalqueFleche() {
Modified: trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/layer/PivVelResultsLayer.java
===================================================================
--- trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/layer/PivVelResultsLayer.java 2016-11-25 14:38:35 UTC (rev 9467)
+++ trunk/soft/fudaa-lspiv/src/main/java/org/fudaa/fudaa/piv/layer/PivVelResultsLayer.java 2016-11-25 14:40:50 UTC (rev 9468)
@@ -27,6 +27,9 @@
*/
public class PivVelResultsLayer extends ZCalqueFleche implements ZCalqueEditable {
+ /** Defini le caractere editable du calque */
+ private boolean isEditable_=false;
+
@Override
protected String getFlecheUnit() {
return "m/s";
@@ -121,16 +124,34 @@
@Override
public boolean removeSelectedObjects(CtuluCommandContainer _cmd, CtuluUI _ui) {
- FuLog.debug("Remove object");
- if (!isSelectionEmpty()) {
- final boolean r = modeleDonnees().removeVelocity(getSelectedIndex(), _cmd);
- if (r) {
- // Sinon, le calque ne se repaint pas toujours...
- repaint();
+ if (isEditable_) {
+ FuLog.debug("Remove object");
+ if (!isSelectionEmpty()) {
+ final boolean r=modeleDonnees().removeVelocity(getSelectedIndex(), _cmd);
+ if (r) {
+ // Sinon, le calque ne se repaint pas toujours...
+ repaint();
+ }
}
}
return false;
}
+
+ /**
+ * La methode parent n'a aucun sens => On la surcharge.
+ */
+ @Override
+ public boolean isEditable() {
+ return isEditable_;
+ }
+
+ /**
+ * Definit si le calque est editable. Si c'est le cas, les methode d'editions peuvent \xEAtre appel\xE9es.
+ * @param _b True : Le calque est editable.
+ */
+ public void setEditable(boolean _b) {
+ isEditable_=_b;
+ }
// Not used
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|