Package org.jdesktop.wonderland.client.cell

Examples of org.jdesktop.wonderland.client.cell.CellCache$CellCacheListener


    public static void registerCellCache(CellCache clientCellCache, WonderlandSession session) {
        if (cellCaches==null) {
            cellCaches = new HashMap();
        }
       
        CellCache previous = cellCaches.put(session, clientCellCache);
       
        if (previous!=null)
            throw new RuntimeException("registerCellCache can only be called once");
    }
View Full Code Here


     * Get the  cells from the cache and update the nodes in tree
     */
    private void refreshCells(WonderlandSession session) {
        // Fetch the client-side Cell cache, log an error if not found and
        // return
        CellCache cache = ClientContext.getCellCache(session);
        if (cache == null) {
            LOGGER.warning("Unable to find Cell cache for session " + session);
            return;
        }

        // Clear out any existing Cells from the tree. We do this by creating a
        // new tree model
        treeRoot = new SortedTreeNode(cache.getEnvironmentCell(),
                                      BUNDLE.getString("World_Root"));
        DefaultTreeModel treeModel = new DefaultTreeModel(treeRoot);
        cellHierarchyTree.setModel(treeModel);
        cellNodes.clear();
        cellNodes.put(cache.getEnvironmentCell(), treeRoot);

        // Loop through all of the root cells and add into the world
        Collection<Cell> rootCells = cache.getRootCells();
        for (Cell rootCell : rootCells) {
            createJTreeNode(rootCell);
        }
        cellHierarchyTree.repaint();
    }
View Full Code Here

            CellID cellID = new CellID(cellIDInt);

            // Fetch the client-side Cell cache and find the Cell with the
            // dropped CellID
            WonderlandSession session = LoginManager.getPrimary().getPrimarySession();
            CellCache cache = ClientContext.getCellCache(session);
            if (cache == null) {
                LOGGER.warning("Unable to find Cell cache for session " + session);
                return;
            }
            Cell draggedCell = cache.getCell(cellID);
            if (draggedCell == null) {
                LOGGER.warning("Unable to find dragged Cell with ID " + cellID);
                return;
            }
View Full Code Here

        logger.fine("got a message... " + message);

  if (message instanceof ClientConnectResponseMessage) {
      ClientConnectResponseMessage msg = (ClientConnectResponseMessage) message;

      CellCache cellCache = ClientContext.getCellCache(session);

      if (cellCache == null) {
    logger.warning("Can't find cellCache for session " + session);
    return;
      }

      ArrayList<String> nameTagList = new ArrayList();

      PresenceInfo[] presenceInfoList = msg.getPresenceInfoList();

      for (int i = 0; i < presenceInfoList.length; i++) {
    PresenceInfo presenceInfo = presenceInfoList[i];

    logger.fine("Client connected: " + presenceInfo);

    logger.fine("Got ClientConnectResponse:  adding pi " + presenceInfo);
    pm.presenceInfoAdded(presenceInfo);

    String username = presenceInfo.getUserID().getUsername();

    if (presenceInfo.getCellID() == null) {
        logger.warning("CellID is null for " + presenceInfo);
        continue;
    }

    Cell cell = cellCache.getCell(presenceInfo.getCellID());

    if (cell == null) {
        logger.warning("Unable to find cell for " + presenceInfo.getCellID());
        continue;
    }
View Full Code Here

    public void cleanup() {
        sessionManager.removeLifecycleListener(this);
    }

    public void sessionCreated(WonderlandSession session) {
        CellCache cache = ClientContext.getCellCache(session);
        cache.addCellCacheListener(this);
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.client.cell.CellCache$CellCacheListener

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.