This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 7664aa103801f85252dd3163f3d430983369cf36 Author: Kevin Morin <morin@codelutin.com> Date: Thu Feb 12 18:21:24 2015 +0100 refs #6538 --- .../operation/catches/EditCatchesSvgHandler.java | 33 ++++++++++++++++------ 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesSvgHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesSvgHandler.java index 2eb927a..8b07843 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesSvgHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesSvgHandler.java @@ -39,6 +39,7 @@ import fr.ifremer.tutti.ui.swing.util.computable.ComputableData; import fr.ifremer.tutti.util.Numbers; import fr.ifremer.tutti.util.Weights; import jaxx.runtime.JAXXUtil; +import org.apache.batik.bridge.UpdateManager; import org.apache.batik.dom.svg.SAXSVGDocumentFactory; import org.apache.batik.dom.svg.SVGOMRectElement; import org.apache.batik.dom.svg.SVGOMTextElement; @@ -298,6 +299,10 @@ public class EditCatchesSvgHandler { svgRelatedPropertyChangeListeners.clear(); if (canvas != null) { + UpdateManager updateManager = canvas.getUpdateManager(); + if (updateManager != null) { + updateManager.suspend(); + } canvas.dispose(); ui.getSvgCanvasPanel().remove(canvas); } @@ -523,9 +528,14 @@ public class EditCatchesSvgHandler { addSvgRelatedPropertyChangeListener(property, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - Integer value = (Integer) evt.getNewValue(); - Element labelElement = svgDocument.getElementById(property + "Value"); - labelElement.setTextContent(JAXXUtil.getStringValue(value)); + final Integer value = (Integer) evt.getNewValue(); + updateOnCanvas(new Runnable() { + @Override + public void run() { + Element labelElement = svgDocument.getElementById(property + "Value"); + labelElement.setTextContent(JAXXUtil.getStringValue(value)); + } + }); } }); } @@ -564,17 +574,22 @@ public class EditCatchesSvgHandler { } - protected void updateTremieCarrouselVisibility(String property) { + protected void updateTremieCarrouselVisibility(final String property) { FishingOperation fishingOperation = model.getFishingOperation(); if (fishingOperation != null) { - boolean tremieCarrouselFieldsVisisble = fishingOperation.getVessel() != null + final boolean tremieCarrouselFieldsVisisble = fishingOperation.getVessel() != null && fishingOperation.getVessel().getId().equals(context.getConfig().getTremieCarousselVesselId()); - Element labelElement = svgDocument.getElementById(property + "Label"); - labelElement.setAttribute("visibility", tremieCarrouselFieldsVisisble ? "visible" : "hidden"); + updateOnCanvas(new Runnable() { + @Override + public void run() { + Element labelElement = svgDocument.getElementById(property + "Label"); + labelElement.setAttribute("visibility", tremieCarrouselFieldsVisisble ? "visible" : "hidden"); - Element valueElement = svgDocument.getElementById(property + "Value"); - valueElement.setAttribute("visibility", tremieCarrouselFieldsVisisble ? "visible" : "hidden"); + Element valueElement = svgDocument.getElementById(property + "Value"); + valueElement.setAttribute("visibility", tremieCarrouselFieldsVisisble ? "visible" : "hidden"); + } + }); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.