/** * Get a Map of the supported Unit or Force Element symbols * @return a Map of UnitDefs keyed by symbol code. */ public Map<String, UnitDef> getSupportedFETypes(int symStd) { return UnitDefTable.getInstance().GetAllUnitDefs(symStd); }
public static synchronized UnitDefTable getInstance() { if(_instance == null) _instance = new UnitDefTable(); return _instance; }
private UnitDefTable() { Init(); }
private ArrayList<MilStdDef> getAllMilStdDefs(int symStd) Map<String,UnitDef> UDs = UnitDefTable.getInstance().GetAllUnitDefs(symStd); ArrayList<UnitDef> UDDups = UnitDefTable.getInstance().GetUnitDefDups(symStd);
UnitDefTable udt = UnitDefTable.getInstance(); String temp = strRetSymbolID; for(int i = 0; i < 2; i++) if(udt.HasUnitDef(temp,i)==true) if(udt.HasUnitDef(temp,i)==true) if(udt.HasUnitDef(temp,i)==true)
/** * Try to make sure everything is loaded during server creation so later * calls to the renderer don't crap out due to the font files not being * loaded. Sometimes the 'X's appear because of font loading errors. * This is an attempt to fix that. * * @author Spinelli */ private void preloadRenderer() { try { if (_preloadedRenderer == false) { MilStdSymbol foo = null; foo = new MilStdSymbol("SFGPUCDM-------", "", null, null); UnitFontLookup.getInstance(); SinglePointLookup.getInstance(); SymbolDefTable.getInstance(); UnitDefTable.getInstance(); foo = null; SinglePointFont.getInstance().getSPFont(50); SinglePointFont.getInstance().getUnitFont(50); _preloadedRenderer = true; // System.out.println("preloaded"); } } catch (Exception exc) { // System.err.println(exc.getMessage()); // System.err.println(ErrorLogger.getStackTrace(exc)); ErrorLogger.LogException("SinglePointServer", "preloadRenderer", exc, Level.WARNING); } }
private void Init() { _UnitDefinitionsB = new HashMap<String, UnitDef>(); _UnitDefDupsB = new ArrayList<UnitDef>(); _UnitDefinitionsC = new HashMap<String, UnitDef>(); _UnitDefDupsC = new ArrayList<UnitDef>(); String xmlPathB = "XML/UnitConstantsB.xml"; String xmlPathC = "XML/UnitConstantsC.xml"; InputStream xmlStreamB = this.getClass().getClassLoader().getResourceAsStream(xmlPathB); InputStream xmlStreamC = this.getClass().getClassLoader().getResourceAsStream(xmlPathC); String lookupXmlB = FileHandler.InputStreamToString(xmlStreamB); String lookupXmlC = FileHandler.InputStreamToString(xmlStreamC); //String lookupXml = FileHandler.fileToString("C:\\UnitFontMappings.xml"); populateLookup(lookupXmlB, RendererSettings.Symbology_2525B); populateLookup(lookupXmlC, RendererSettings.Symbology_2525C); }
/** * Try to make sure everything is loaded during server creation so later * calls to the renderer don't crap out due to the font files not being * loaded. Sometimes the 'X's appear because of font loading errors. * This is an attempt to fix that. * * @author Spinelli */ private void preloadRenderer() { try { if (_preloadedRenderer == false) { MilStdSymbol foo = null; foo = new MilStdSymbol("SFGPUCDM-------", "", null, null); UnitFontLookup.getInstance(); SinglePointLookup.getInstance(); SymbolDefTable.getInstance(); UnitDefTable.getInstance(); foo = null; SinglePointFont.getInstance().getSPFont(50); SinglePointFont.getInstance().getUnitFont(50); _preloadedRenderer = true; // System.out.println("preloaded"); } } catch (Exception exc) { // System.err.println(exc.getMessage()); // System.err.println(ErrorLogger.getStackTrace(exc)); ErrorLogger.LogException("SinglePointServer", "preloadRenderer", exc, Level.WARNING); } }
/** * Get a Map of the supported Unit or Force Element symbols * @return a Map of UnitDefs keyed by symbol code. */ public Map<String, UnitDef> getSupportedFETypes(int symStd) { return UnitDefTable.getInstance().GetAllUnitDefs(symStd); }