From 6e70040ee2e4b2316f305485533462656fadc9b7 Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Tue, 3 Jun 2014 13:51:24 -0500 Subject: [PATCH] Omaha #3163 Fix collaboration string differencing Former-commit-id: 310e6562e667297d1a71b8b794e08329138037d7 [formerly ca2210b3e7fe60bda9d1e8dbee4f8304f982fe99 [formerly e6f30c822de26bafae339a8871c4ba98100e6d1a]] Former-commit-id: ca2210b3e7fe60bda9d1e8dbee4f8304f982fe99 Former-commit-id: 2c534e177e4d164cacdadac8497a5332df303641 --- .../events/strings/DrawStringEvent.java | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/strings/DrawStringEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/strings/DrawStringEvent.java index 5f91f8b404..649fb4d9fa 100644 --- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/strings/DrawStringEvent.java +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/strings/DrawStringEvent.java @@ -144,38 +144,40 @@ public class DrawStringEvent extends AbstractRemoteGraphicsRenderEvent { * .graphics.events.rendering.IRenderEvent) */ @Override - public DrawStringEvent createDiffObject(IRenderEvent event) { - DrawStringEvent diffEvent = (DrawStringEvent) event; - DrawStringEvent diffObject = new DrawStringEvent(); - diffObject.alpha = diffEvent.alpha; - diffObject.boxColor = diffEvent.boxColor; - diffObject.shadowColor = diffEvent.shadowColor; - diffObject.xOrColors = diffEvent.xOrColors; - diffObject.fontId = diffEvent.fontId; - diffObject.magnification = diffEvent.magnification; - diffObject.rotation = diffEvent.rotation; - if (Arrays.equals(colors, diffEvent.colors) == false) { - diffObject.colors = diffEvent.colors; + public DrawStringEvent createDiffObject(IRenderEvent newEvent) { + DrawStringEvent newStringEvent = (DrawStringEvent) newEvent; + DrawStringEvent diffStringEvent = new DrawStringEvent(); + diffStringEvent.alpha = newStringEvent.alpha; + diffStringEvent.boxColor = newStringEvent.boxColor; + diffStringEvent.shadowColor = newStringEvent.shadowColor; + diffStringEvent.xOrColors = newStringEvent.xOrColors; + diffStringEvent.fontId = newStringEvent.fontId; + diffStringEvent.magnification = newStringEvent.magnification; + diffStringEvent.rotation = newStringEvent.rotation; + if (Arrays.equals(colors, newStringEvent.colors) == false) { + diffStringEvent.colors = newStringEvent.colors; } - if (Arrays.equals(text, diffEvent.text) == false) { - diffObject.text = diffEvent.text; + if (Arrays.equals(text, newStringEvent.text) == false) { + diffStringEvent.text = newStringEvent.text; } - if (Arrays.equals(point, diffEvent.point) == false) { - diffObject.point = diffEvent.point; + if (Arrays.equals(point, newStringEvent.point) == false) { + diffStringEvent.point = newStringEvent.point; } - if (horizontalAlignment != diffEvent.horizontalAlignment) { - diffObject.horizontalAlignment = diffEvent.horizontalAlignment; + if (horizontalAlignment != newStringEvent.horizontalAlignment) { + diffStringEvent.horizontalAlignment = newStringEvent.horizontalAlignment; } - if (verticalAlignment != diffEvent.verticalAlignment) { - diffObject.verticalAlignment = diffEvent.verticalAlignment; + if (verticalAlignment != newStringEvent.verticalAlignment) { + diffStringEvent.verticalAlignment = newStringEvent.verticalAlignment; } - if (!textStyles.equals(diffEvent.textStyles)) { - diffObject.textStyles = diffEvent.textStyles; + if (newStringEvent.textStyles != null + && newStringEvent.textStyles.equals(textStyles) == false) { + diffStringEvent.textStyles = newStringEvent.textStyles; } - if (diffEvent.textStyleColorMap != null) { - diffObject.textStyleColorMap = diffEvent.textStyleColorMap; + if (newStringEvent.textStyleColorMap != null + && newStringEvent.textStyleColorMap.equals(textStyleColorMap) == false) { + diffStringEvent.textStyleColorMap = newStringEvent.textStyleColorMap; } - return diffObject; + return diffStringEvent; } /*