public void run() { while (!loadingDone && !MechSummaryCache.getInstance().isInitialized()) { updateCounts(); try { Thread.sleep(UPDATE_FREQUENCY); } catch (InterruptedException e) { // not supposed to come here } } } };
while(!msc.isInitialized()) { try { Thread.sleep(1000);
private synchronized void initialize() { // Give the MSC some time to initialize MechSummaryCache msc = MechSummaryCache.getInstance(); long waitLimit = System.currentTimeMillis() + 3000; /* 3 seconds */ while( !interrupted && !msc.isInitialized() && waitLimit > System.currentTimeMillis() ) { try { Thread.sleep(50); } catch(InterruptedException e) { // Ignore } } loadFactions(); for (File f : Configuration.forceGeneratorDir().listFiles()) { if (f.getName().matches("\\d+\\.xml")) { eraSet.add(Integer.parseInt(f.getName().replace(".xml", ""))); } } if (!interrupted) { rg.initialized = true; rg.notifyListenersOfInitialization(); } if (dispose) { clear(); dispose = false; } }
MechSummaryCache mechSummaryCache = MechSummaryCache.getInstance(); mechSummaryCache.addListener(mechSummaryCacheListener); mscLoaded = mechSummaryCache.isInitialized(); butLoad.setEnabled(mscLoaded && rngLoaded); butArmy.setEnabled(mscLoaded && rngLoaded);
return; while (!MechSummaryCache.getInstance().isInitialized()) { try { Thread.sleep(50);
public SkinEditorMainGUI() { super(new BorderLayout()); this.addComponentListener(this); panMain.setLayout(cardsMain); panSecondary.setLayout(cardsSecondary); JPanel panDisplay = new JPanel(new BorderLayout()); panDisplay.add(panMain, BorderLayout.CENTER); panDisplay.add(panSecondary, BorderLayout.SOUTH); add(panDisplay, BorderLayout.CENTER); UnitLoadingDialog unitLoadingDialog = new UnitLoadingDialog(frame); if (!MechSummaryCache.getInstance().isInitialized()) { unitLoadingDialog.setVisible(true); } try { MechSummary ms = MechSummaryCache.getInstance().getMech( "Archer ARC-2W"); testEntity = new MechFileParser(ms.getSourceFile(), ms.getEntryName()).getEntity(); } catch (EntityLoadingException e) { e.printStackTrace(); } }
public synchronized void populateUnits() { initRats(); initRatTree(); // Give the MSC some time to initialize MechSummaryCache msc = MechSummaryCache.getInstance(); long waitLimit = System.currentTimeMillis() + 3000; /* 3 seconds */ while( !interrupted && !msc.isInitialized() && waitLimit > System.currentTimeMillis() ) { try { Thread.sleep(50); } catch(InterruptedException e) { // Ignore } } loadRatsFromDirectory(Configuration.armyTablesDir(), msc); cleanupNode(ratTree); if (!interrupted) { rug.initialized = true; rug.notifyListenersOfInitialization(); } if (dispose) { clear(); dispose = false; } }
public static void main(String[] args) { int bad = 0; MechSummaryCache msc = MechSummaryCache.getInstance(); while (!msc.isInitialized()) { try { Thread.sleep(50);
if (mscInstance.isInitialized() && !useAlternate)
if (MechSummaryCache.getInstance().isInitialized()) { RandomUnitGenerator.getInstance();
client.changePhase(IGame.Phase.PHASE_UNKNOWN); UnitLoadingDialog unitLoadingDialog = new UnitLoadingDialog(frame); if (!MechSummaryCache.getInstance().isInitialized()) { unitLoadingDialog.setVisible(true);
e.printStackTrace(); while (!MechSummaryCache.getInstance().isInitialized()) {