Package org.jdesktop.wonderland.common.cell

Examples of org.jdesktop.wonderland.common.cell.CellID


     */
    public void messageReceived(WonderlandClientSender sender,
                                WonderlandClientID clientID,
                                CellMessage message ) {

        CellID msgCellID = message.getCellID();
        if (!msgCellID.equals(cellID)) {
//            ManagedReference<ChannelComponentRefMO> refMO = refChannelComponents.get(msgCellID);
//            if (refMO==null) {
//                Logger.getAnonymousLogger().severe("Unable to find ChannelComponentRef for cell "+msgCellID);
//                return;
//            }
View Full Code Here


     */
    private void addComponent(CellComponentFactorySPI spi) {
        // Fetch the default server state for the factory, and cell id. Make
        // sure we make it dynamically added
        CellComponentServerState state = spi.getDefaultCellComponentServerState();
        CellID cellID = selectedCell.getCellID();
       
        // Send a ADD component message on the cell channel. Wait for a
        // response. If OK, then update the GUI with the new component.
        // Otherwise, display an error dialog box.
        CellServerComponentMessage message =
View Full Code Here

        CellComponentServerState s = spi.getDefaultCellComponentServerState();
        String className = s.getServerComponentClassName();

        // Send a message to remove the component giving the class name. Wait
        // for a response.
        CellID cellID = selectedCell.getCellID();

        // Send a message to the server with the cell id and class name and
        // wait for a response
        CellServerComponentMessage cscm =
                CellServerComponentMessage.newRemoveMessage(cellID, className);
View Full Code Here

     * Returns a unique cell id and registers the cell with the system
     * @return
     */
    CellID createCellID(CellMO cell) {
        DataManager dm = AppContext.getDataManager();
        CellID cellID;

        if (cell instanceof EnvironmentCellMO) {
            // special case: environment cell is a singleton that has a fixed id
            cellID = CellID.getEnvironmentCellID();
        } else {
            // default case: assign a new cell ID
            CellCounter counter;
            try {
                counter = (CellCounter) dm.getBindingForUpdate(COUNTER_BINDING_NAME);
            } catch (NameNotBoundException nnbe) {
                counter = new CellCounter();
                dm.setBinding(COUNTER_BINDING_NAME, counter);
            }

            cellID = new CellID(counter.nextCellID());
        }

        dm.setBinding(getCellBinding(cellID), cell);
        return cellID;
    }
View Full Code Here

     */
    private void addMovableComponent() {

        // Go ahead and try to add the affordance. If we cannot, then log an
        // error and return.
        CellID cellID = cell.getCellID();
        String className = "org.jdesktop.wonderland.server.cell.MovableComponentMO";
        CellServerComponentMessage cscm =
                CellServerComponentMessage.newAddMessage(cellID, className);
        ResponseMessage response = cell.sendCellMessageAndWait(cscm);
        if (response instanceof ErrorMessage) {
View Full Code Here

            cell.addParentChangeListener(this);
            cell.addComponentChangeListener(this);
        }

        public void parentChanged(CellMO cell, CellMO parent) {
            CellID parentCellID = null;
            if (parent != null) {
                parentCellID = parent.getCellID();
            }

            // make sure this cell's parent is up-to-date
View Full Code Here

        @Override
        public void messageReceived(WonderlandClientSender sender,
                                    WonderlandClientID clientID,
                                    CellMessage message)
        {
            CellID requestCellID = null;
            if (message instanceof PermissionsRequestMessage) {
                requestCellID = ((PermissionsRequestMessage) message).getRequestCellID();
            }

            componentRef.get().sendUserPermissions(sender, clientID,
View Full Code Here

    public Resource checkMessage(WonderlandClientID clientID,
                                 Message message)
    {
        if (message instanceof CellMessage) {
            CellResourceManager crm = AppContext.getManager(CellResourceManager.class);
            CellID id = ((CellMessage) message).getCellID();
            Resource rsrc = crm.getCellResource(id);
            return rsrc;
        }

        return null;
View Full Code Here

            } catch (Exception excp) {
                LOGGER.log(Level.WARNING, "Unable to fetch Cell ID integer " +
                        "from the drop target", excp);
                return;
            }
            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;
            }

            // Find out what Cell ID this was dropped over. This will form the
            // new parent. If the Cell is dropped over the world root, then set
            // the CellID to InvalidCellID
            CellID parentCellID = CellID.getInvalidCellID();
            SortedTreeNode treeNode = (SortedTreeNode) path.getLastPathComponent();
            Object userObject = treeNode.getUserObject();
            Cell newParent = null;
            if (userObject instanceof Cell && !(userObject instanceof EnvironmentCell)) {
                parentCellID = ((Cell) userObject).getCellID();
View Full Code Here

        if (cell == null) {
            return null;
        }

        // find this cell's parent
        CellID parentID = null;
        if (cell.getParent() != null) {
            parentID = cell.getParent().getCellID();
        }

        // collect all the actions associated with this cell and its
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.common.cell.CellID

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.