Package org.jdesktop.wonderland.client.cell

Examples of org.jdesktop.wonderland.client.cell.Cell


     */
    private class DuplicateListener implements ContextMenuActionListener {

        public void actionPerformed(ContextMenuItemEvent event) {
            // Create a new name for the cell, based upon the old name.
            Cell cell = event.getCell();
            String cellName = BUNDLE.getString("Copy_Of");
            cellName = MessageFormat.format(cellName, cell.getName());

            // If we want to delete, send a message to the server as such
            WonderlandSession session =
                    LoginManager.getPrimary().getPrimarySession();
            CellEditChannelConnection connection =
                    (CellEditChannelConnection) session.getConnection(
                    CellEditConnectionType.CLIENT_TYPE);
            CellDuplicateMessage msg =
                    new CellDuplicateMessage(cell.getCellID(), cellName);
            connection.send(msg);

            // Really should receive an OK/Error response from the server!
        }
View Full Code Here


     * Get the parent by iterating through SPI objects until a non-null
     * result is found.
     * @return the cell parent, or null if no SPI objects returned a value
     */
    private Cell getParent() {
        Cell out = null;

        for (CellCreationParentSPI spi : spiList) {
            out = spi.getCellCreationParent();
            if (out != null) {
                return out;
View Full Code Here

      return;
   }
    }

    private void attachOrb(CellID hostCellID, boolean attach) {
  Cell newHostCell = ClientContext.getCellCache(session).getCell(hostCellID);

  if (newHostCell == null) {
      logger.warning("Can't find host cell for " + hostCellID);
      return;
  }

  if (logger.isLoggable(Level.FINE)) {
      String s = "None";

      if (hostCell != null) {
         s = hostCell.getCellID().toString();
      }

      logger.fine("Attach " + attach + " avatarCellID "
    + avatarCell.getCellID() + " new host " + newHostCell.getCellID()
    + " current host " + s);
  }

  if (attach) {
      if (hostCell != null) {
    /*
     * Someone else has attached the Orb.
     */
    logger.fine("Detaching " + orbCell.getCellID() + " from "
        + hostCell.getCellID());
    detachOrb(false);
      }

      synchronized (detachedOrbList) {
    detachedOrbList.remove(orbCell);
      }

      ArrayList<OrbCell> attachedOrbList = attachedOrbMap.get(newHostCell);

      if (attachedOrbList == null) {
    attachedOrbList = new ArrayList();

    attachedOrbMap.put(newHostCell, attachedOrbList);
      }

      synchronized (attachedOrbList) {
    attachedOrbList.remove(orbCell);
    attachedOrbList.add(orbCell);
      }
   
      hostCell = newHostCell;
      newHostCell.addTransformChangeListener(this);
      positionAttachedOrbs(newHostCell);
  } else {
      detachOrb(true);
  }
  return;
View Full Code Here

    public static CellID createCell(CellServerState state)
            throws CellCreationException
    {
        // Find the parent cell for this creation (may be null)
        CellID parentID = null;
        Cell parent = CellCreationParentRegistry.getCellCreationParent();
        if (parent != null) {
            parentID = parent.getCellID();
            logger.info("Using parent with Cell ID " + parentID.toString());
        }
       
        return createCell(state, parentID)
    }
View Full Code Here

        }
       
        // We also need to convert the initial origin of the Cell (in world
        // coordinates to the coordinates of the parent Cell (if non-null)
        if (parentCellID != null) {
            Cell parent = viewCell.getCellCache().getCell(parentCellID);
            CellTransform worldTransform = new CellTransform(null, null);
            CellTransform parentTransform = parent.getWorldTransform();

            logger.info("Transform of the parent cell: translation=" +
                    parentTransform.getTranslation(null).toString() + ", rotation=" +
                    parentTransform.getRotation(null).toString());
View Full Code Here

     * Convienence method that returns the cell associated with the Entity.
     *
     * @return The Cell associated with the currently selected Entity
     */
    public static Cell getCellForEntity(Entity entity) {
       Cell ret = null;
        while(ret==null && entity!=null) {
            CellRefComponent ref = (CellRefComponent) entity.getComponent(CellRefComponent.class);
            if (ref!=null)
                ret = ((CellRefComponent)ref).getCell();
            else
View Full Code Here

     *
     * @param e the entity to check
     * @return true if the entity is selectable, and false if not
     */
    private boolean isSelectable(Entity e) {
        Cell cell = SceneManager.getCellForEntity(e);
        if (cell == null) {
            return true;
        }

        InteractionComponent ic = cell.getComponent(InteractionComponent.class);
        if (ic == null) {
            return true;
        }

        return ic.isSelectable();
View Full Code Here

        }

        HUDComponentState state = (HUDComponentState) hudStateMap.get(component);

        if ((state != null) && (!state.isWorldVisible())) {
            Cell cell = component.getCell();
            if (cell != null) {
                // can only create world views of HUD components that are
                // associated with a cell
                HUDView3D worldView = state.getWorldView();
View Full Code Here

         */
        new Thread(new Runnable() {

            public void run() {
                PresenceManager manager = PresenceManagerFactory.getPresenceManager(session.getPrimarySession());
                Cell cell = ClientContextJME.getViewManager().getPrimaryViewCell();
                PresenceInfo localPresenceInfo = manager.getPresenceInfo(cell.getCellID());
                while(localPresenceInfo==null) {
                    manager = PresenceManagerFactory.getPresenceManager(session.getPrimarySession());
                    cell = ClientContextJME.getViewManager().getPrimaryViewCell();
                    localPresenceInfo = manager.getPresenceInfo(cell.getCellID());
                }
                LOGGER.warning("Presence manager is loaded.");
                WonderlandUserList.INSTANCE.initialize();
                UserListPresenterManager.INSTANCE.intialize();
                UserListPresenterManager.INSTANCE.showActivePresenter();
View Full Code Here

                break;
        }
    }
   
    private void setMyNameTag(EventType eventType) {
        Cell cell = model.getMyCell();
        NameTagComponent ntc = cell.getComponent(NameTagComponent.class);
        PresenceInfo pi = model.getLocalPresenceInfo();
       
       
        ntc.setNameTag(eventType,
                       pi.getUserID().getUsername(),
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.client.cell.Cell

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.