Package org.jdesktop.wonderland.modules.avatarbase.client.registry.spi

Examples of org.jdesktop.wonderland.modules.avatarbase.client.registry.spi.AvatarSPI


        });
        avatarSet.addAll(registry.getAllAvatars());

        // We want to make sure the default avatar if the first, so add it. We
        // also need to remove it from the list so it does not get added twice.
        AvatarSPI defaultAvatar = registry.getDefaultAvatar();
        if (defaultAvatar != null) {
            listModel.addElement(defaultAvatar);
            avatarSet.remove(defaultAvatar);
        }
       
View Full Code Here


        useButton.setEnabled(selected);

        // Next, ask the selected avatar whether Customize and Delete is
        // supported
        if (selected == true) {
            AvatarSPI avatar = (AvatarSPI) avatarList.getSelectedValue();
            customizeButton.setEnabled(avatar.canConfigure());
            deleteButton.setEnabled(avatar.canDelete());
        }

        // Finally, we see if the select avatar is the one currently in use.
        // If so, do not enable the Use button
        if (selected == true) {
            AvatarSPI avatar = (AvatarSPI) avatarList.getSelectedValue();
            AvatarRegistry registry = AvatarRegistry.getAvatarRegistry();
            AvatarSPI avatarInUse = registry.getAvatarInUse();
            if ((avatarInUse != null) && avatarInUse.equals(avatar)) {
                useButton.setEnabled(false);
            }
        }
    }
View Full Code Here

    private void useButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useButtonActionPerformed

        // Find the selected avatar. If the avatar does not require high-res
        // graphics, then simply set the avatar in use and return.
        AvatarRegistry registry = AvatarRegistry.getAvatarRegistry();
        AvatarSPI avatar = (AvatarSPI) avatarList.getSelectedValue();
        if (avatar.isHighResolution() == false) {
            registry.setAvatarInUse(avatar, false);
            return;
        }

        if (!AvatarImiJME.supportsHighQualityAvatars()) {
View Full Code Here

    private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
        // Fetch the currently selected avatar and remove it from the list
        // of configurations. Since the Delete button is only enabled when an
        // item is selected, we assume something is selected in the list.
        AvatarSPI avatar = (AvatarSPI) avatarList.getSelectedValue();
        String avatarName = avatar.getName();
        avatar.delete();

        // If the deleted avatar is currently the avatar in use, then reset to
        // the default avatar.
        AvatarRegistry registry = AvatarRegistry.getAvatarRegistry();
        if (registry.isAvatarInUse(avatarName) == true) {
            AvatarSPI defaultAvatar = registry.getDefaultAvatar();
            if (defaultAvatar == null) {
                LOGGER.warning("Unable to reset avatar to default, none exists.");
                return;
            }
            registry.setAvatarInUse(defaultAvatar, false);
View Full Code Here

    private void customizeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customizeButtonActionPerformed

        // Find the selected avatar. If the avatar does not require high-res
        // graphics, then go ahead and configure the avatar.
        AvatarSPI avatar = (AvatarSPI) avatarList.getSelectedValue();
        if (avatar.isHighResolution() == false) {
            avatar.configure();
            return;
        }

        if (!AvatarImiJME.supportsHighQualityAvatars()) {
            String msg = "Unfortunately your system graphics does not" +
                    " support the shaders which are required to configure" +
                    " this avatar";
            String title = "Advanced Shaders Required";
            JFrame frame = JmeClientMain.getFrame().getFrame();
            JOptionPane.showMessageDialog(frame, msg, title, JOptionPane.ERROR_MESSAGE);
            return;
        }

        // Fetch the currently selected avatar and display a dialog box to
        // edit its configuration. Since the Customize button is only enabled
        // when an item is selected, we assume something is selected in the
        // list. At this point, we also know the graphics system supports the
        // avatar, if high-res.
        avatar.configure();
    }//GEN-LAST:event_customizeButtonActionPerformed
View Full Code Here

                boolean isSelected, // is the cell selected
                boolean cellHasFocus) // does the cell have focus
        {
            // Fetch the avatar object from the list and fetch its name to use
            // as the label.
            AvatarSPI avatar = (AvatarSPI) value;
            String s = avatar.getName();
            setText(s);

            // From the avatar configuration manager, fetch the current avatar
            // in use.
            AvatarRegistry registry = AvatarRegistry.getAvatarRegistry();
            AvatarSPI avatarInUse = registry.getAvatarInUse();

            // If the avatar configuration is currently selected, then we
            // want to place a checkbox next to the name.
            if (avatar.equals(avatarInUse) == true) {
                setIcon(checkBoxIcon);
View Full Code Here

            return;
        }

        // Check to see that the avatar name is not already taken. We only check
        // if the name has actually changed.
        AvatarSPI oldAvatar = registry.getAvatarByName(newAvatarName);
        if (newAvatarName.equals(originalAvatarName) == false && oldAvatar != null) {
            String msg = BUNDLE.getString("THE_AVATAR_NAME_TAKEN");
            msg = MessageFormat.format(msg, newAvatarName);
            String title = BUNDLE.getString("AVATAR_NAME");
            JOptionPane.showMessageDialog(this, msg, title, JOptionPane.ERROR_MESSAGE);
View Full Code Here

        // Once the avatar loader is ready and the primary view has been set,
        // we tell the avatar cell component to set it's avatar in use.
        AvatarConfigComponent configComponent = viewCell.getComponent(AvatarConfigComponent.class);
        AvatarRegistry registry = AvatarRegistry.getAvatarRegistry();
        AvatarSPI avatar = registry.getAvatarInUse();
        if (avatar != null) {
            ServerSessionManager session = viewCell.getCellCache().getSession().getSessionManager();
            AvatarConfigInfo configInfo = avatar.getAvatarConfigInfo(session);
            configComponent.requestAvatarConfigInfo(configInfo, isLocal);
        }
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.avatarbase.client.registry.spi.AvatarSPI

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.