Issue #2711 Use level factory more.

Former-commit-id: d7a3ae4fdb [formerly db58ae5999ea088cb93a8016836a6c62efe347e4]
Former-commit-id: 3da086b71f
This commit is contained in:
Ben Steffensmeier 2014-02-26 15:10:20 -06:00
parent b4b6cb655e
commit f45646ae91
2 changed files with 20 additions and 23 deletions

View file

@ -63,17 +63,19 @@ import com.raytheon.viz.grid.rsc.GridResourceData;
* <pre> * <pre>
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* May 21, 2010 bsteffens Initial creation * May 21, 2010 bsteffen Initial creation
* May 26, 2010 mnash Used ProductBrowserLabel implementation instead of requery * May 26, 2010 mnash Used ProductBrowserLabel implementation
* May 02, 2013 1949 bsteffen Switch Product Browser from uengine to * instead of requery
* DbQueryRequest. * May 02, 2013 1949 bsteffen Switch Product Browser from uengine to
* Sep 19, 2013 2391 mpduff refactored some methods to common class. * DbQueryRequest.
* Sep 19, 2013 2391 mpduff refactored some methods to common class.
* Jan 23, 2014 2711 bsteffen Get all levels from LevelFactory.
* *
* </pre> * </pre>
* *
* @author bsteffens * @author bsteffen
* @version 1.0 * @version 1.0
*/ */
public class GridProductBrowserDataDefinition extends public class GridProductBrowserDataDefinition extends
@ -172,11 +174,8 @@ public class GridProductBrowserDataDefinition extends
params = Arrays.asList(value); params = Arrays.asList(value);
} else if (key.equals(GridInventory.MASTER_LEVEL_QUERY)) { } else if (key.equals(GridInventory.MASTER_LEVEL_QUERY)) {
if (levels == null) { if (levels == null) {
levels = new ArrayList<Level>( levels = new ArrayList<Level>(LevelFactory
LevelMappingFactory .getInstance().getAllLevels());
.getInstance(
LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE)
.getAllLevels());
} }
Iterator<Level> iter = levels.iterator(); Iterator<Level> iter = levels.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {

View file

@ -20,11 +20,11 @@
package com.raytheon.uf.common.dataplugin.level.util; package com.raytheon.uf.common.dataplugin.level.util;
import java.text.ParsePosition; import java.text.ParsePosition;
import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.NavigableSet; import java.util.NavigableSet;
import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import javax.measure.unit.Unit; import javax.measure.unit.Unit;
@ -35,7 +35,6 @@ import com.raytheon.uf.common.dataplugin.level.CompareType;
import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.level.LevelFactory;
import com.raytheon.uf.common.dataplugin.level.MasterLevel; import com.raytheon.uf.common.dataplugin.level.MasterLevel;
import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory;
/** /**
* Level utilities * Level utilities
@ -45,11 +44,12 @@ import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 11/21/2009 #3576 rjpeter Initial version * Nov 21, 2009 3576 rjpeter Initial version
* 01/30/2014 #2725 ekladstrup Moved to common and removed * Jan 30, 2014 2725 ekladstrup Moved to common and removed
* usage of VizCommunicationException * usage of VizCommunicationException
* Jan 23, 2014 2711 bsteffen Get all levels from LevelFactory.
* </pre> * </pre>
* *
* @author rjpeter * @author rjpeter
@ -117,9 +117,7 @@ public class LevelUtilities {
}; };
Map<String, NavigableSet<Level>> masterLevelToOrderedSet = new HashMap<String, NavigableSet<Level>>(); Map<String, NavigableSet<Level>> masterLevelToOrderedSet = new HashMap<String, NavigableSet<Level>>();
Set<Level> allLevels; Collection<Level> allLevels = LevelFactory.getInstance()
allLevels = LevelMappingFactory.getInstance(
LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE)
.getAllLevels(); .getAllLevels();
for (Level level : allLevels) { for (Level level : allLevels) {
NavigableSet<Level> levels = masterLevelToOrderedSet.get(level NavigableSet<Level> levels = masterLevelToOrderedSet.get(level