Issue #664 Changed hydro legend resource to be system resource

Change-Id: I769463a967ee1ec76a9a3c09d48d27106caa0937

Former-commit-id: 85a7897b1e [formerly 9a726e2686e7ed79c1a436156a16e98083608e14]
Former-commit-id: 3cd4f75170
This commit is contained in:
Max Schenkelberg 2012-06-05 13:44:48 -05:00
parent 373db85359
commit dbb8a6b93d
3 changed files with 30 additions and 16 deletions

View file

@ -276,8 +276,22 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
public LocalizationContext[] getLocalSearchHierarchy(LocalizationType type) {
synchronized (this.contexts) {
LocalizationContext[] ctx = this.contexts.get(type);
LocalizationLevel[] levels = getAvailableLevels();
if (ctx != null) {
// Check for new available levels
Set<LocalizationLevel> levelSet = new HashSet<LocalizationLevel>(
Arrays.asList(levels));
for (LocalizationContext context : ctx) {
if (levelSet.contains(context.getLocalizationLevel()) == false) {
// New level detected, regenerate search hierarchy
ctx = null;
break;
}
}
}
if (ctx == null) {
LocalizationLevel[] levels = getAvailableLevels();
Arrays.sort(levels, LocalizationLevel.REVERSE_COMPARATOR);
ctx = new LocalizationContext[levels.length];

View file

@ -734,13 +734,11 @@ public class HydroDisplayManager {
}
}
GenericResourceData legendResourceData = new GenericResourceData();
legendResourceData.setClazz(MPELegendResource.class.getName());
ResourcePair resourcePair = new ResourcePair();
resourcePair.setResourceData(legendResourceData);
md.getResourceList().add(resourcePair);
md.getResourceList()
.add(ResourcePair
.constructSystemResourcePair(new GenericResourceData(
MPELegendResource.class)));
md.getResourceList().instantiateResources(md, true);
// bestEstRsc = (XmrgResource) resourcePair.getResource();
pane.refresh();
}
}

View file

@ -59,7 +59,8 @@ import com.raytheon.viz.hydrocommon.HydroDisplayManager;
*/
public class MPELegendResource extends
AbstractVizResource<GenericResourceData, IDescriptor> implements ISamplingResource {
AbstractVizResource<GenericResourceData, IDescriptor> implements
ISamplingResource {
private double scale;
@ -68,12 +69,8 @@ public class MPELegendResource extends
private double width;
private AbstractVizResource<?, ?> rsc;
private boolean sampling = false;
public MPELegendResource() {
super(null, null);
}
private boolean sampling = false;
public MPELegendResource(GenericResourceData rscData,
LoadProperties loadProps) {
@ -216,7 +213,9 @@ public class MPELegendResource extends
return "";
}
/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.sampling.ISamplingResource#isSampling()
*/
@Override
@ -224,8 +223,11 @@ public class MPELegendResource extends
return sampling;
}
/* (non-Javadoc)
* @see com.raytheon.uf.viz.core.sampling.ISamplingResource#setSampling(boolean)
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.sampling.ISamplingResource#setSampling(boolean)
*/
@Override
public void setSampling(boolean sampling) {