From 05a5ec1cb9e3099509446f38924983bc024ecd26 Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Thu, 20 Mar 2014 13:18:40 -0500 Subject: [PATCH] Issue #2932 improve compatibility of pop skewT and blended resources. Former-commit-id: 12d5339c48f0363253af8e040e77a7ae49ceda9b [formerly 14907292dab43d515023386d162b7180c1710545] [formerly 933b172ca0ecef2fbc2865cd8e9c44cca9daa15b] [formerly 12d5339c48f0363253af8e040e77a7ae49ceda9b [formerly 14907292dab43d515023386d162b7180c1710545] [formerly 933b172ca0ecef2fbc2865cd8e9c44cca9daa15b] [formerly effb0bfcd8a85700099cc153fda24ec69573eb91 [formerly 933b172ca0ecef2fbc2865cd8e9c44cca9daa15b [formerly 49ffd67e77fef3c76f712cdf0eaa9b5e8ecff737]]]] Former-commit-id: effb0bfcd8a85700099cc153fda24ec69573eb91 Former-commit-id: 4d284e5780f02f9f501f903e24edb14c60cee3d0 [formerly 99d9ba964586d55550051a4e8dbeebe8f1d71bc1] [formerly 181bf9e15da48dfb7597e793bcef70990b517993 [formerly ee3cb7e69a9927c3e6ee9c32994ce0e21ddfcf47]] Former-commit-id: dabcb37bdf912273c1bd4907d33758ae655f4417 [formerly b8d6663e15078aee9553ab84642bab12b1aaadfc] Former-commit-id: ebd80c4d49dda43fc5c47ea88976bd45815b5b7f --- .../D2DPopupSkewTDisplayCustomizer.java | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/cave/com.raytheon.uf.viz.d2d.ui.popupskewt/src/com/raytheon/uf/viz/d2d/ui/popupskewt/D2DPopupSkewTDisplayCustomizer.java b/cave/com.raytheon.uf.viz.d2d.ui.popupskewt/src/com/raytheon/uf/viz/d2d/ui/popupskewt/D2DPopupSkewTDisplayCustomizer.java index 8342e67e9e..0004f57cc1 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui.popupskewt/src/com/raytheon/uf/viz/d2d/ui/popupskewt/D2DPopupSkewTDisplayCustomizer.java +++ b/cave/com.raytheon.uf.viz.d2d.ui.popupskewt/src/com/raytheon/uf/viz/d2d/ui/popupskewt/D2DPopupSkewTDisplayCustomizer.java @@ -26,14 +26,15 @@ import java.util.Set; import com.raytheon.uf.viz.cloudheight.rsc.CloudHeightResource; import com.raytheon.uf.viz.cloudheight.rsc.CloudHeightResourceData; -import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.drawables.IRenderableDisplay; import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.rsc.AbstractResourceData; import com.raytheon.uf.viz.core.rsc.AbstractVizResource; import com.raytheon.uf.viz.core.rsc.AbstractVizResource.ResourceStatus; import com.raytheon.uf.viz.core.rsc.IInitListener; +import com.raytheon.uf.viz.core.rsc.IResourceGroup; import com.raytheon.uf.viz.core.rsc.ResourceList; import com.raytheon.uf.viz.core.rsc.ResourceList.AddListener; import com.raytheon.uf.viz.core.rsc.ResourceList.RemoveListener; @@ -53,9 +54,10 @@ import com.raytheon.viz.ui.perspectives.IRenderableDisplayCustomizer; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Jul 31, 2013 2190 mschenke Initial creation + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Jul 31, 2013 2190 mschenke Initial creation + * Mar 20, 2014 2932 bsteffen Better support of blended resources. * * * @@ -198,8 +200,22 @@ public class D2DPopupSkewTDisplayCustomizer implements } private boolean isCompatibleResource(ResourcePair rp) { - return COMPATIBLE_CLASSES.contains(rp.getResourceData().getClass()) - && CloudHeightResource.isValidContributor(rp.getResource()); + AbstractResourceData resourceData = rp.getResourceData(); + if (resourceData != null) { + if (COMPATIBLE_CLASSES + .contains(rp.getResourceData().getClass())) { + return CloudHeightResource.isValidContributor(rp + .getResource()); + } else if (resourceData instanceof IResourceGroup) { + IResourceGroup group = (IResourceGroup) resourceData; + for (ResourcePair internalPair : group.getResourceList()) { + if (isCompatibleResource(internalPair)) { + return true; + } + } + } + } + return false; } private synchronized void addResources(IDescriptor descriptor) {