Package org.jdesktop.wonderland.client.cell.CellStatistics

Examples of org.jdesktop.wonderland.client.cell.CellStatistics.TimeCellStat


    }

    @Override
    protected Node createSceneGraph(Entity entity) {
        long startTime = System.currentTimeMillis();
        TimeCellStat loadTime = new TimeCellStat("loadtime", "Model Load Time");
       
        try {
            if (modelComponent!=null) {
                return modelComponent.loadModel(entity);
            }

            if (deployedModel!=null) {
                ModelLoader loader = deployedModel.getModelLoader();
                if (loader==null) {
                    logger.warning("No loader for model "+deployedModel.getModelURL());
                    return new Node("No Loader");
                }
                Node ret = loader.loadDeployedModel(deployedModel, entity);
                return ret;
            }

            ModelLoader loader = LoaderManager.getLoaderManager().getLoader(deployedModelURL);
            if (loader==null) {
                logger.warning("No loader for model "+deployedModel.getModelURL());
                return new Node("No Loader");
            }
            deployedModel = new DeployedModel(deployedModelURL, loader);
            deployedModel.setModelTranslation(modelTranslation);
            deployedModel.setModelRotation(modelRotation);
            deployedModel.setModelScale(modelScale);

            return loader.loadDeployedModel(deployedModel, entity);
        } finally {
            // record statistics
            loadTime.setValue(System.currentTimeMillis() - startTime);
            getCell().getCellCache().getStatistics().add(getCell(), loadTime);
        }
    }
View Full Code Here


                changeCellStatus(cell, CellStatus.ACTIVE);
            }

            // record loading time statistic
            long time = System.currentTimeMillis() - startTime;
            TimeCellStat loadStat =
                    new TimeCellStat("LoadTime", "Cell Load Time");
            loadStat.setValue(time);
            getStatistics().add(cell, loadStat);

            return cell;
        } catch(Exception e) {
            // notify listeners
View Full Code Here

            while(currentStatus!=requiredStatus) {
                currentStatus += dir;

                CellStatus nextStatus = CellStatus.values()[currentStatus];
                long startTime = System.currentTimeMillis();
                TimeCellStat loadStat = getLoadStat(cell, nextStatus);
                try {
                    cell.setStatus(nextStatus, increasing);
                } finally {
                    long time = System.currentTimeMillis() - startTime;
                    loadStat.changeValue(time);
                }

                cell.fireCellStatusChanged(nextStatus);
            }
        }
View Full Code Here

        }
    }

    private TimeCellStat getLoadStat(Cell cell, CellStatus status) {
        String statId = status.name() + "-time";
        TimeCellStat loadStat;

        synchronized (getStatistics()) {
            loadStat = (TimeCellStat) getStatistics().get(cell, statId);
            if (loadStat == null) {
                loadStat = new TimeCellStat(statId);
                getStatistics().add(cell, loadStat);
            }
        }

        return loadStat;
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.client.cell.CellStatistics.TimeCellStat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.