Examples of CellFactorySPI


Examples of org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI

            return;
        }

        // Next look for a cell type that handles content with this file
        // extension and create a new cell with it.
        CellFactorySPI factory = null;
        try {
            factory = spi.getCellSelection(extension);
        } catch (CellCreationException excp) {
            final JFrame frame = JmeClientMain.getFrame().getFrame();
            LOGGER.log(Level.WARNING,
                    "Could not find cell factory for " + extension);
            String message = BUNDLE.getString("Launch_Failed_Message");
            message = MessageFormat.format(message, uri);
            JOptionPane.showMessageDialog(frame, message,
                    BUNDLE.getString("Launch_Failed"),
                    JOptionPane.ERROR_MESSAGE);
            return;
        }

        // If the returned factory is null, it means that the user has cancelled
        // the action, so we just return
        if (factory == null) {
            return;
        }

        // Get the cell server state, injecting the content URI into it via
        // the properties
        Properties props = new Properties();
        props.put("content-uri", uri);
        CellServerState state = factory.getDefaultCellServerState(props);

        // Create the new cell at a distance away from the avatar
        try {
            // OWL issue #224: api update
            CellUtils.createCell(state);
View Full Code Here

Examples of org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI

            // none (in the case that the Cell only supports DnD, but does not
            // want to appear in the Cell palette), then use the toString()
            // method. XXX This is a hack for now, we'll likely need to update
            // the CellFactorySPI to say explicitly whether it wants to appear
            // in the Cell Palette or not.
            CellFactorySPI factory = (CellFactorySPI)value;
            String s = factory.getDisplayName();
            if (s == null) {
                s = factory.toString();
            }

            setText(s);
            if (isSelected) {
                setBackground(list.getSelectionBackground());
View Full Code Here

Examples of org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI

    // We synchronized around the cellFactoryMap so that this action does not
    // interfere with any changes in the map.
    synchronized (cellFactoryMap) {
        // From the selected value, find the proper means to create the object
        final String cellDisplayName = (String) cellList.getSelectedValue();
        final CellFactorySPI factory = cellFactoryMap.get(cellDisplayName);
        new Thread(new Runnable() {
            public void run() {
                CellServerState setup = factory.getDefaultCellServerState(null);

                // Create the new cell at a distance away from the avatar
                try {
                    // OWL issue #224: api update
                    CellUtils.createCell(setup);
View Full Code Here

Examples of org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI

            }

            // Next, fetch the Cell factory associated with the display name.
            // If it happens to be null (not sure why this would happen), then
            // simply return.
            CellFactorySPI cellFactory = cellFactoryMap.get(selectedName);
            if (cellFactory == null) {
                return;
            }

            // Enable the Insert button
            createButton.setEnabled(true);

            // Otherwise, update the preview image, if one exists, otherwise
            // use the default image.
            Image previewImage = cellFactory.getPreviewImage();
            if (previewImage != null) {
                ImageIcon icon = new ImageIcon(previewImage);
                previewLabel.setIcon(icon);

                // Pass the necessary information for drag and drop
View Full Code Here

Examples of org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI

        /**
         * {@inheritDoc}
         */
        @Override
        protected Transferable createTransferable(JComponent c) {
            CellFactorySPI factory = cellFactoryMap.get((String) componentList.getSelectedValue());

            return new CellServerStateTransferable(factory);
        }
View Full Code Here

Examples of org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI

            Image icon = imageList.get(index);
            label.setIcon(new ImageIcon(icon));

            label.setText("");
            label.setTransferHandler(new ListTransferHandler());
            CellFactorySPI factory = cellFactoryMap.get((String)value);
            label.setToolTipText(factory.getDisplayName());

//            // Set up the drag and drop support for the image
//            DragSource ds = DragSource.getDefaultDragSource();
//            PaletteDragGestureListener listener = new PaletteDragGestureListener();
//            listener.previewImage = icon;
View Full Code Here

Examples of org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI

        // search annotations
        ScannedClassLoader cl = manager.getClassloader();
        Iterator<CellFactorySPI> it = cl.getAll(CellFactory.class,
                                                CellFactorySPI.class);
        while (it.hasNext()) {
            CellFactorySPI factory = it.next();
            addFactory(factory);
            sessionFactories.add(factory);
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI

                        registry.getCellFactoriesByExtension(extension);
                if (factories == null) {
                    logger.warning(
                            "Could not find cell factory for " + extension);
                }
                CellFactorySPI factory = factories.iterator().next();

                // Create the cell, inject the content uri
                Properties props = new Properties();
                props.put("content-uri", uri);
                CellServerState state =
                        factory.getDefaultCellServerState(props);

                // Create the new cell at a distance away from the avatar
                try {
                    // OWL issue #224: api update
                    CellUtils.createCell(state);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.