From 0e296ab1ba3e2b6ed4ebc6736c70295307939cf0 Mon Sep 17 00:00:00 2001 From: James Korman Date: Fri, 14 Sep 2012 09:46:08 -0500 Subject: [PATCH] Issue #1172 - Corrected update problem Change-Id: Id600728f8f9352b9c44c261c24bf1af8ae6c8e32 Former-commit-id: 60d3a92995b67a24dd63ffba5c1ba050be8fb647 [formerly 26ed32cb19b719f2ee2b643cc81c56a8a3db2b84] [formerly c228b73624a9ae0073173a2823f710d6b0ede6b0] [formerly f0eafc3839aa25749f9c0fca57bf47c6d2b649f5 [formerly c228b73624a9ae0073173a2823f710d6b0ede6b0 [formerly d436841050e4d96dbe3b3cb1e54a9d62525c5d08]]] Former-commit-id: f0eafc3839aa25749f9c0fca57bf47c6d2b649f5 Former-commit-id: 8d27acff59c764cb79fa7e930c179c5b01df9096 [formerly 5c79be21d8c97a3c0689de4b812bff80d707bf08] Former-commit-id: f90f5fadb166174ff575cb22d1ace1ef806431f2 --- .../rsc/PlotBlendedResourceData.java | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotBlendedResourceData.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotBlendedResourceData.java index ddbdf16d67..98fac9957b 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotBlendedResourceData.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotBlendedResourceData.java @@ -44,7 +44,10 @@ import com.raytheon.uf.viz.core.rsc.ResourceList; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 7, 2009 jsanchez Initial creation - * + * ====================================== + * AWIPS2 DR Work + * 20120913 1172 jkorman Added code to call postAddListeners when + * creating sub-resources. * * * @author jsanchez @@ -78,6 +81,18 @@ public class PlotBlendedResourceData extends AbstractResourceData implements } + /** + * Constructs a resource(s) from this resource data. + * + * @param loadProperties + * The load properties + * @param descriptor + * The descriptor that the resource will be loaded onto + * @throws VizException + * if construction fails + * @return The renderable capability. Will return null if any of the sub-resources + * fail to construct. + */ @Override public PlotBlendedResource construct(LoadProperties loadProperties, IDescriptor descriptor) throws VizException { @@ -85,13 +100,16 @@ public class PlotBlendedResourceData extends AbstractResourceData implements for (ResourcePair rp : resourceList) { if (!rp.instantiateResource(descriptor, false)) { - // failure to create any sub resources is a failure to construct + // failure to create any sub-resource is a failure to construct // the blended resource. return null; } - this.addChangeListener((IResourceDataChanged) rp.getResource()); } - + // All sub-resources have been instantiated, add the listeners. + for (ResourcePair rp : resourceList) { + addChangeListener((IResourceDataChanged) rp.getResource()); + resourceList.firePostAddListeners(rp); + } return rsc; }