Revision: 4899
Author:
abhishek...@wishtreetech.com
Date: Fri Nov 21 10:39:57 2014 UTC
Log: Client startup time improvement, capability-bridge moved to
modules/tools/
https://code.google.com/p/openwonderland/source/detail?r=4899
Added:
/trunk/modules/tools/capability-bridge
/trunk/modules/tools/capability-bridge/build.xml
/trunk/modules/tools/capability-bridge/nbproject
/trunk/modules/tools/capability-bridge/nbproject/nb.properties
/trunk/modules/tools/capability-bridge/nbproject/private
/trunk/modules/tools/capability-bridge/nbproject/private/private.xml
/trunk/modules/tools/capability-bridge/nbproject/project.xml
/trunk/modules/tools/capability-bridge/src
/trunk/modules/tools/capability-bridge/src/classes
/trunk/modules/tools/capability-bridge/src/classes/com
/trunk/modules/tools/capability-bridge/src/classes/com/wonderbuilders
/trunk/modules/tools/capability-bridge/src/classes/com/wonderbuilders/modules
/trunk/modules/tools/capability-bridge/src/classes/com/wonderbuilders/modules/capabilitybridge
/trunk/modules/tools/capability-bridge/src/classes/com/wonderbuilders/modules/capabilitybridge/client
/trunk/modules/tools/capability-bridge/src/classes/com/wonderbuilders/modules/capabilitybridge/client/CapabilityBridge.java
/trunk/web/checksums/src/java/org/jdesktop/wonderland/web/checksums/resources/GetModuleListResource.java
Modified:
/trunk/core/src/classes/org/jdesktop/wonderland/client/modules/CachedModule.java
/trunk/core/src/classes/org/jdesktop/wonderland/client/modules/ModuleUtils.java
/trunk/core/src/classes/org/jdesktop/wonderland/common/modules/ModuleInfo.java
/trunk/core/src/classes/org/jdesktop/wonderland/common/modules/ModuleRepository.java
/trunk/modules/tools/audio-manager/build.xml
/trunk/modules/tools/audio-manager/nbproject/project.xml
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioManagerClient.java
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioMenu.form
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioMenu.java
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioTreatmentComponent.java
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioTreatmentComponentProperties.form
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioTreatmentComponentProperties.java
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/resources/Bundle.properties
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/common/AudioTreatmentComponentServerState.java
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioParticipantComponentMO.java
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioTreatmentComponentMO.java
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioTreatmentProximityListener.java
/trunk/modules/tools/build.xml
/trunk/modules/tools/darkstar/web/WEB-INF/web.xml
/trunk/modules/tools/darkstar/webremote/WEB-INF/web.xml
/trunk/modules/tools/error-report/nbproject/project.xml
/trunk/modules/tools/error-report/web/WEB-INF/web.xml
/trunk/modules/tools/security-group/web/WEB-INF/web.xml
/trunk/modules/tools/security-session-noauth/web/WEB-INF/web.xml
/trunk/modules/tools/server-manager/src/classes/org/jdesktop/wonderland/servermanager/server/ServerManagerConnectionHandler.java
/trunk/modules/tools/server-manager/web/WEB-INF/web.xml
/trunk/modules/tools/snapshot-manager/web/WEB-INF/web.xml
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/UserListClientPlugin.java
/trunk/web/asset/web/WEB-INF/web.xml
/trunk/web/checksums/src/java/org/jdesktop/wonderland/web/checksums/resources/GetModuleChecksumsResource.java
/trunk/web/checksums/web/WEB-INF/web.xml
/trunk/web/front/web/WEB-INF/web.xml
/trunk/web/help/web/WEB-INF/web.xml
/trunk/web/modules/src/java/org/jdesktop/wonderland/modules/service/resources/GetModuleListResource.java
/trunk/web/modules/web/WEB-INF/web.xml
/trunk/web/runner/remote-web/WEB-INF/web.xml
/trunk/web/runner/web/WEB-INF/web.xml
/trunk/web/webstart/build-tools/build-scripts/webstart-package.xml
/trunk/web/webstart/web/Wonderland.jnlp
/trunk/web/wfs/web/WEB-INF/web.xml
=======================================
--- /dev/null
+++ /trunk/modules/tools/capability-bridge/build.xml Fri Nov 21 10:39:57
2014 UTC
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="capability-bridge" default="dist" basedir=".">
+ <!-- current directory needed in all scripts -->
+ <dirname property="current.dir" file="${ant.file.capability-bridge}"/>
+ <property name="modules.dir"
location="${current.dir}/../../../modules" />
+
+ <property name="module.src"
value="com/wonderbuilders/modules/capabilitybridge"/>
+ <property name="module.packagename"
value="com.wonderbuilders.modules.capabilitybridge"/>
+ <property name="module.jarname" value="capability-bridge"/>
+
+ <!-- import common build file -->
+ <import
file="${modules.dir}/build-tools/build-scripts/module-build.xml"/>
+
+ <target name="build" depends="-module-init, -module-compile-common,
+ -module-compile-server,
+ -module-compile-client"/>
+
+ <target name="dist" depends="build">
+ <mkdir dir="${module.dist.dir}"/>
+
+ <module name="capability-bridge" majorVersion="1" minorVersion="0"
+ jarfile="${module.dist.dir}/${module.jarname}.jar"
description="Bridge between two components"
+ builddir="${build.dir}">
+
+ <client>
+ <clientjar name="capability-bridge-client"
basedir="${build.classes.dir}">
+ <include name="${module.src}/client/**"/>
+ <include name="${module.src}/common/**"/>
+ </clientjar>
+ </client>
+
+ </module>
+ </target>
+
+ <target name="deploy" depends="dist, -module-deploy"/>
+ <target name="clean" depends="-module-clean"/>
+</project>
=======================================
--- /dev/null
+++ /trunk/modules/tools/capability-bridge/nbproject/nb.properties Fri Nov
21 10:39:57 2014 UTC
@@ -0,0 +1,5 @@
+
+wonderland.ostype=win64
+wonderland.arch=amd64
+wonderland.system.type=windows-amd64
+
=======================================
--- /dev/null
+++ /trunk/modules/tools/capability-bridge/nbproject/private/private.xml
Fri Nov 21 10:39:57 2014 UTC
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="
http://www.netbeans.org/ns/project-private/1">
+ <editor-bookmarks
xmlns="
http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
+ <open-files xmlns="
http://www.netbeans.org/ns/projectui-open-files/2">
+ <group/>
+ </open-files>
+</project-private>
=======================================
--- /dev/null
+++ /trunk/modules/tools/capability-bridge/nbproject/project.xml Fri Nov 21
10:39:57 2014 UTC
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="
http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ant.freeform</type>
+ <configuration>
+ <general-data
xmlns="
http://www.netbeans.org/ns/freeform-project/1">
+ <name>capability-bridge</name>
+ </general-data>
+ <general-data
xmlns="
http://www.netbeans.org/ns/freeform-project/2">
+ <!-- Do not use Project Properties customizer when editing
this file manually. -->
+ <name>capability-bridge</name>
+ <properties/>
+ <folders>
+ <source-folder>
+ <label>capability-bridge</label>
+ <location>.</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ <source-folder>
+ <label>src/classes</label>
+ <type>java</type>
+ <location>src/classes</location>
+ <encoding>UTF-8</encoding>
+ </source-folder>
+ </folders>
+ <ide-actions>
+ <action name="build">
+ <target>package</target>
+ </action>
+ <action name="clean">
+ <target>clean</target>
+ </action>
+ <action name="rebuild">
+ <target>clean</target>
+ <target>package</target>
+ </action>
+ </ide-actions>
+ <view>
+ <items>
+ <source-folder style="packages">
+ <label>src/classes</label>
+ <location>src/classes</location>
+ </source-folder>
+ <source-file>
+ <location>build.xml</location>
+ </source-file>
+ <source-file>
+ <location>my.module.properties</location>
+ </source-file>
+ </items>
+ <context-menu>
+ <ide-action name="build"/>
+ <ide-action name="rebuild"/>
+ <ide-action name="clean"/>
+ <action>
+ <label>Deploy Module</label>
+ <target>deploy</target>
+ </action>
+ </context-menu>
+ </view>
+ <subprojects/>
+ </general-data>
+ <java-data
xmlns="
http://www.netbeans.org/ns/freeform-project-java/1">
+ <compilation-unit>
+ <package-root>src/classes</package-root>
+ <classpath
mode="compile">../../../core/build/lib/wonderland-client.jar;../../../core/build/lib/wonderland-common.jar</classpath>
+ <source-level>1.5</source-level>
+ </compilation-unit>
+ </java-data>
+ </configuration>
+</project>
=======================================
--- /dev/null
+++
/trunk/modules/tools/capability-bridge/src/classes/com/wonderbuilders/modules/capabilitybridge/client/CapabilityBridge.java
Fri Nov 21 10:39:57 2014 UTC
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package com.wonderbuilders.modules.capabilitybridge.client;
+
+import org.jdesktop.wonderland.client.input.EventClassListener;
+
+/**
+ *
+ * When we need to call a method of a component from different component.
+ * we can use this interface to remove tightly coupled relation between
those
+ * two components
+ *
+ * Here we need to call getMouseEventListener() method from certain
components.
+ * You can also add more methods here.
+ * So we need to implement this interface for the component which
+ * has getMouseEventListener() method.
+ *
+ * This will remove the dependency between modules.
+ *
+ * @author Abhishek Upadhyay
+ */
+public interface CapabilityBridge {
+
+ public EventClassListener getMouseEventListener();
+
+}
=======================================
--- /dev/null
+++
/trunk/web/checksums/src/java/org/jdesktop/wonderland/web/checksums/resources/GetModuleListResource.java
Fri Nov 21 10:39:57 2014 UTC
@@ -0,0 +1,213 @@
+/**
+ * Project Wonderland
+ *
+ * Copyright (c) 2004-2010, Sun Microsystems, Inc., All Rights Reserved
+ *
+ * Redistributions in source code form must reproduce the above
+ * copyright and this condition.
+ *
+ * The contents of this file are subject to the GNU General Public
+ * License, Version 2 (the "License"); you may not use this file
+ * except in compliance with the License. A copy of the License is
+ * available at
http://www.opensource.org/licenses/gpl-license.php.
+ *
+ * Sun designates this particular file as subject to the "Classpath"
+ * exception as provided by Sun in the License file that accompanied
+ * this code.
+ */
+package org.jdesktop.wonderland.web.checksums.resources;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+import org.jdesktop.wonderland.common.checksums.ChecksumList;
+import org.jdesktop.wonderland.common.modules.ModuleInfo;
+import org.jdesktop.wonderland.common.modules.ModuleList;
+import org.jdesktop.wonderland.common.modules.ModuleRepository;
+import org.jdesktop.wonderland.modules.Module;
+import org.jdesktop.wonderland.modules.service.DeployManager;
+import org.jdesktop.wonderland.modules.service.ModuleManager;
+import org.jdesktop.wonderland.utils.Constants;
+import org.jdesktop.wonderland.web.asset.deployer.AssetDeployer;
+import
org.jdesktop.wonderland.web.asset.deployer.AssetDeployer.DeployedAsset;
+import org.jdesktop.wonderland.web.checksums.ChecksumFactory;
+import
org.jdesktop.wonderland.web.checksums.ChecksumFactory.ChecksumAction;
+import org.jdesktop.wonderland.web.checksums.ChecksumManager;
+import org.jdesktop.wonderland.web.checksums.modules.ModuleAssetDescriptor;
+
+/**
+ * The GetModuleListResource class is a Jersey RESTful service that
returns the
+ * ModuleInfo objects (contained within module.xml) of all modules in a
given
+ * state.
+ * <p>
+ * The state can either be installed, pending, or uninstall
+ *
+ * @author Jordan Slott <
jsl...@dev.java.net>
+ */
+@Path("/list/get/{state}")
+public class GetModuleListResource {
+
+ public static ChecksumList getChecksumList(String moduleName, String
modulePart) {
+ // Fetch all of the module parts given the module name. This case
+ // handles if the module part is null (in which case all module
parts)
+ ChecksumManager checksumManager =
ChecksumManager.getChecksumManager();
+ Map<DeployedAsset, File> partMap =
AssetDeployer.getFileMap(moduleName, modulePart);
+
+ // Create a checksum list from all of the individual module parts
and
+ // put them into a single map.
+ ChecksumList checksumList = new ChecksumList();
+ for (DeployedAsset deployedAsset : partMap.keySet()) {
+ // Create an proper AssetDeployer using the module name and
module
+ // part. Add to the master list.
+ ModuleAssetDescriptor mad = new ModuleAssetDescriptor(
+ deployedAsset.moduleName, deployedAsset.assetType,
null);
+ ChecksumFactory factory =
checksumManager.getChecksumFactory(mad);
+ ChecksumList partList = factory.getChecksumList(mad,
ChecksumAction.DO_NOT_GENERATE);
+ if (partList != null) {
+
+ checksumList.putChecksums(partList.getChecksumMap());
+ }
+ }
+ return checksumList;
+ }
+
+ private static ModuleRepository getModuleRepository(Module module) {
+ /* Fetch the error logger for use in this method */
+ Logger logger = ModuleManager.getLogger();
+ String moduleName = module.getName();
+
+ // For the base URL of assets within a module, use the server URL
and
+ // point it to the webdav repository
+ String hostname = System.getProperty(Constants.WEBSERVER_URL_PROP)
+ "webdav/content/modules/installed/" + moduleName;
+
+ /* Fetch the module repository, return an error if it does not
exist */
+ ModuleRepository mr = module.getRepository();
+ if (mr == null || mr.getResources() == null ||
mr.getResources().length == 0) {
+ /*
+ * If the repository doesn't exist (perhaps from a missing
repository.xml
+ * file, then create a fallback response with this server as
the
+ * master.
+ */
+
+ ModuleRepository newRepository = new ModuleRepository();
+ ModuleRepository.Repository rep = new
ModuleRepository.Repository();
+ rep.url = hostname;
+ rep.isServer = true;
+ newRepository.setMaster(rep);
+ return newRepository;
+
+ }
+
+ /* Since we potentially edit fields below, make a copy of the
repository */
+ ModuleRepository newRepository = new ModuleRepository(mr);
+
+ /* Replace the master if its string is the special %WL_SERVER% */
+ if (newRepository.getMaster() != null &&
newRepository.getMaster().url.compareTo(ModuleRepository.WL_SERVER) == 0) {
+ ModuleRepository.Repository rep = new
ModuleRepository.Repository();
+ rep.url = hostname;
+ rep.isServer = true;
+ newRepository.setMaster(rep);
+ }
+
+ /* Replace the mirrors if its string is the special %WL_SERVER% */
+ ModuleRepository.Repository mirrors[] = newRepository.getMirrors();
+ if (mirrors != null) {
+ for (int i = 0; i < mirrors.length; i++) {
+ if (mirrors[i] != null &&
mirrors[i].url.compareTo(ModuleRepository.WL_SERVER) == 0) {
+ ModuleRepository.Repository rep = new
ModuleRepository.Repository();
+ rep.url = hostname;
+ rep.isServer = true;
+ mirrors[i] = rep;
+ }
+ }
+ newRepository.setMirrors(mirrors);
+ }
+
+ return newRepository;
+ }
+ /**
+ * Returns a list of modules in a given state.
+ * <p>
++ *
/module/list/get/
http://localhost:8080/wonderland-web-modules/modules/list/get/installed{state}
+ * <p>
+ * where {state} is the state of the module, either pending,
installed, or
+ * uninstall.
+ * <p>
+ * All spaces in the module name must be encoded to %20. Returns
BAD_REQUEST
+ * to the HTTP connection if the module name is invalid or if there
was an
+ * error encoding the module's information.
+ *
+ * @param state The desired state of the module
+ * @return An XML encoding of the module's basic information
+ */
+ @GET
+ @Produces({"application/xml", "application/json"})
+ public Response getModuleList(@PathParam("state") String state) {
+ ModuleManager manager = ModuleManager.getModuleManager();
+ ModuleList moduleList = new ModuleList();
+
+ /*
+ * Check the state given, and fetch the modules. If the module
state is
+ * invalid, return a BAD_REQUEST error. Otherwise fetch the module
list
+ * according to the state and return a ModuleList object.
+ */
+ if (state == null) {
+ return Response.status(Response.Status.BAD_REQUEST).build();
+ }
+ else if (state.equals("installed") == true) {
+ Map<String, Module> modules = manager.getInstalledModules();
+
+ // sort in dependecy order
+ List<String> ordered =
DeployManager.getDeploymentOrder(modules);
+
+ // create the list of infos in the correct order
+ Collection<ModuleInfo> list = new LinkedList();
+ for (String moduleName : ordered) {
+ Module module = modules.get(moduleName);
+ ModuleInfo info = module.getInfo();
+ info.setChecksumList(
+ getChecksumList(moduleName, null));
+
+ info.setRepository(getModuleRepository(module));
+ list.add(info);
+ }
+
+ moduleList.setModuleInfos(list.toArray(new ModuleInfo[] {}));
+ return Response.ok(moduleList).build();
+ }
+ else if (state.equals("pending") == true) {
+ Map<String, Module> modules = manager.getPendingModules();
+ Collection<ModuleInfo> list = new LinkedList();
+ Iterator<Map.Entry<String, Module>> it =
modules.entrySet().iterator();
+ while (it.hasNext() == true) {
+ Map.Entry<String, Module> entry = it.next();
+ list.add(entry.getValue().getInfo());
+ }
+ moduleList.setModuleInfos(list.toArray(new ModuleInfo[] {}));
+ return Response.ok(moduleList).build();
+ }
+ else if (state.equals("uninstall") == true) {
+ Map<String, ModuleInfo> modules =
manager.getUninstallModuleInfos();
+ Collection<ModuleInfo> list = new LinkedList();
+ Iterator<Map.Entry<String, ModuleInfo>> it =
modules.entrySet().iterator();
+ while (it.hasNext() == true) {
+ Map.Entry<String, ModuleInfo> entry = it.next();
+ list.add(entry.getValue());
+ }
+ moduleList.setModuleInfos(list.toArray(new ModuleInfo[] {}));
+ return Response.ok(moduleList).build();
+ }
+ else {
+ return Response.status(Response.Status.BAD_REQUEST).build();
+ }
+ }
+}
=======================================
---
/trunk/core/src/classes/org/jdesktop/wonderland/client/modules/CachedModule.java
Mon Mar 9 13:44:17 2009 UTC
+++
/trunk/core/src/classes/org/jdesktop/wonderland/client/modules/CachedModule.java
Fri Nov 21 10:39:57 2014 UTC
@@ -18,6 +18,7 @@
package org.jdesktop.wonderland.client.modules;
import java.util.logging.Logger;
+import org.jdesktop.wonderland.common.checksums.Checksum;
import org.jdesktop.wonderland.common.modules.ModuleArtList;
import org.jdesktop.wonderland.common.checksums.ChecksumList;
import org.jdesktop.wonderland.common.modules.ModuleInfo;
@@ -85,7 +86,17 @@
*/
public synchronized ChecksumList getModuleChecksums() {
if (this.moduleChecksums == null) {
- this.moduleChecksums =
ModuleUtils.fetchModuleChecksums(serverURL, moduleName);
+ if (moduleInfo.getChecksumList() != null) {
+
+ this.moduleChecksums = moduleInfo.getChecksumList();
+
+ // Populate the internal map of checksums from the linked
list.
+ for (Checksum checksum :
this.moduleChecksums.checksumList) {
+
this.moduleChecksums.internalChecksums.put(checksum.getPathName(),
checksum);
+ }
+ } else {
+ this.moduleChecksums =
ModuleUtils.fetchModuleChecksums(serverURL, moduleName);
+ }
}
return this.moduleChecksums;
}
@@ -98,8 +109,15 @@
*/
public synchronized ModuleRepository getModuleRepositories() {
if (this.moduleRepository == null) {
- this.moduleRepository =
ModuleUtils.fetchModuleRepositories(serverURL, moduleName);
+ if (this.moduleInfo.getRepository() != null) {
+
+ this.moduleRepository = moduleInfo.getRepository();
+
+ this.moduleRepository.updateRepositoryList();
+ } else {
+ this.moduleRepository =
ModuleUtils.fetchModuleRepositories(serverURL, moduleName);
+ }
}
return this.moduleRepository;
- }
+ }
}
=======================================
---
/trunk/core/src/classes/org/jdesktop/wonderland/client/modules/ModuleUtils.java
Thu Mar 12 15:30:52 2009 UTC
+++
/trunk/core/src/classes/org/jdesktop/wonderland/client/modules/ModuleUtils.java
Fri Nov 21 10:39:57 2014 UTC
@@ -17,17 +17,24 @@
*/
package org.jdesktop.wonderland.client.modules;
-import org.jdesktop.wonderland.common.modules.ModulePluginList;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
+import java.io.StringReader;
+import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.jdesktop.wonderland.common.modules.ModuleArtList;
+import java.util.zip.GZIPInputStream;
+import javax.xml.bind.JAXBException;
import org.jdesktop.wonderland.common.checksums.ChecksumList;
+import org.jdesktop.wonderland.common.modules.ModuleArtList;
import org.jdesktop.wonderland.common.modules.ModuleInfo;
import org.jdesktop.wonderland.common.modules.ModuleList;
+import org.jdesktop.wonderland.common.modules.ModulePluginList;
import org.jdesktop.wonderland.common.modules.ModuleRepository;
/**
@@ -38,7 +45,7 @@
/* Prefixes for the module and asset web services */
private static final String MODULE_PREFIX
= "wonderland-web-modules/modules/";
private static final String ASSET_PREFIX
= "wonderland-web-asset/asset/";
- private static final String CHECKSUM_PREFIX
= "wonderland-web-checksums/checksums/modules/";
+ private static final String CHECKSUM_PREFIX
= "wonderland-web-checksums/checksums/";
/* The error logger for this class */
private static Logger logger =
Logger.getLogger(ModuleUtils.class.getName());
@@ -47,14 +54,30 @@
* Fetches the info for a particular module
*/
public static ModuleInfo fetchModuleInfo(String serverURL, String
moduleName) {
+ Reader reader = null;
try {
- /* Open an HTTP connection to the Jersey RESTful service */
URL url = new URL(new URL(serverURL), MODULE_PREFIX +
moduleName + "/info");
- return ModuleInfo.decode(new
InputStreamReader(url.openStream()));
- } catch (java.lang.Exception excp) {
+ reader = fetchFromURL(url);
+ return ModuleInfo.decode(reader);
+
+ } catch (IOException excp) {
/* Log an error and return null */
logger.log(Level.WARNING, "[MODULES] FETCH MODULE INFO
Failed", excp);
return null;
+ } catch (JAXBException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH MODULE INFO
Failed", excp);
+ return null;
+ } finally {
+ try {
+ if (reader != null) {
+ reader.close();
+ }
+ } catch (IOException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH MODULE INFO
Failed", excp);
+ return null;
+ }
}
}
@@ -66,14 +89,30 @@
* @return A list of modules
*/
public static ModuleList fetchModuleList(String serverURL) {
+ Reader reader = null;
try {
- /* Open an HTTP connection to the Jersey RESTful service */
- URL url = new URL(new URL(serverURL), MODULE_PREFIX
+ "list/get/installed");
- return ModuleList.decode(new
InputStreamReader(url.openStream()));
- } catch (java.lang.Exception excp) {
+ URL url = new URL(new URL(serverURL), CHECKSUM_PREFIX
+ "list/get/installed");
+ reader = fetchFromURL(url);
+ return ModuleList.decode(reader);
+
+ } catch (IOException excp) {
/* Log an error and return null */
logger.log(Level.WARNING, "[MODULES] FETCH MODULE INFO
Failed", excp);
return null;
+ } catch (JAXBException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH MODULE INFO
Failed", excp);
+ return null;
+ } finally {
+ try {
+ if (reader != null) {
+ reader.close();
+ }
+ } catch (IOException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH MODULE INFO
Failed", excp);
+ return null;
+ }
}
}
@@ -85,14 +124,30 @@
* @return A list of module art
*/
public static ModuleArtList fetchModuleArtList(String serverURL,
String moduleName) {
+ Reader reader = null;
try {
- /* Open an HTTP connection to the Jersey RESTful service */
URL url = new URL(new URL(serverURL), ASSET_PREFIX +
moduleName + "/art/get");
- return ModuleArtList.decode(new
InputStreamReader(url.openStream()));
- } catch (java.lang.Exception excp) {
+ reader = fetchFromURL(url);
+ return ModuleArtList.decode(reader);
+
+ } catch (IOException excp) {
/* Log an error and return null */
logger.log(Level.WARNING, "[MODULES] FETCH MODULE ART Failed",
excp);
return null;
+ } catch (JAXBException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH MODULE ART Failed",
excp);
+ return null;
+ } finally {
+ try {
+ if (reader != null) {
+ reader.close();
+ }
+ } catch (IOException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH MODULE ART
Failed", excp);
+ return null;
+ }
}
}
@@ -106,17 +161,93 @@
* @return The repository information for a module
*/
public static ModuleRepository fetchModuleRepositories(String
serverURL, String moduleName) {
+ Reader reader = null;
try {
- /* Open an HTTP connection to the Jersey RESTful service */
URL url = new URL(new URL(serverURL), ASSET_PREFIX +
moduleName + "/repository");
- return ModuleRepository.decode(new
InputStreamReader(url.openStream()));
- } catch (java.lang.Exception excp) {
+ reader = fetchFromURL(url);
+ return ModuleRepository.decode(reader);
+
+ } catch (IOException excp) {
/* Log an error and return null */
logger.log(Level.WARNING, "[MODULES] FETCH REPOSITORY LIST
Failed", excp);
return null;
+ } catch (JAXBException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH REPOSITORY LIST
Failed", excp);
+ return null;
+ } finally {
+ try {
+ if (reader != null) {
+ reader.close();
+ }
+ } catch (IOException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH REPOSITORY LIST
Failed", excp);
+ return null;
+ }
}
+
}
+ /**
+ * Common method to ensure proper keep alive management and GZip
compression
+ * @param url URL to be downloaded
+ * @return
+ */
+ private static Reader fetchFromURL(URL url) throws IOException {
+
+ /* Open an HTTP connection to the Jersey RESTful service */
+
+ HttpURLConnection connection = (HttpURLConnection)
url.openConnection();
+
+ /* Allow receive GZipped content */
+ connection.setRequestProperty("Accept-Encoding", "gzip");
+
+// System.out.println(url);
+// Map<String, List<String>> requestProperties =
connection.getRequestProperties();
+// for (Map.Entry<String, List<String>> entry :
requestProperties.entrySet()) {
+// String string = entry.getKey();
+// List<String> list = entry.getValue();
+//
+// System.out.println("\tRequest propertirs: " + string + " = "
+ list);
+//
+// }
+//
+// Map<String, List<String>> headerFields =
connection.getHeaderFields();
+// for (Map.Entry<String, List<String>> entry :
headerFields.entrySet()) {
+// String string = entry.getKey();
+// List<String> list = entry.getValue();
+//
+// System.out.println("\tHeader: " + string + " = " + list);
+//
+// }
+ final InputStream openStream = connection.getInputStream();
+ final InputStreamReader inputStreamReader;
+
+ if( "gzip".equals(connection.getHeaderField("Content-Encoding"))) {
+ inputStreamReader = new InputStreamReader(new
GZIPInputStream(openStream));
+ } else {
+ inputStreamReader = new InputStreamReader(openStream);
+ }
+
+ StringBuilder buffer = new StringBuilder(1024);
+ try {
+ BufferedReader br = new BufferedReader(inputStreamReader);
+
+ final String lineSeparator =
System.getProperty("line.separator");
+ String line;
+ while ((line = br.readLine()) != null) {
+ buffer.append(line);
+ buffer.append( lineSeparator);
+ }
+
+ } finally {
+
+ inputStreamReader.close();
+ }
+
+ return new StringReader(buffer.toString());
+ }
/**
* Asks the web server for the module's checksum information given the
* unique name of the module, returns null if the module does not
exist or
@@ -127,14 +258,30 @@
* @return The checksum information for a module
*/
public static ChecksumList fetchModuleChecksums(String serverURL,
String moduleName) {
+ Reader reader = null;
try {
/* Open an HTTP connection to the Jersey RESTful service */
- URL url = new URL(new URL(serverURL), CHECKSUM_PREFIX +
moduleName + "/checksums/get");
- return ChecksumList.decode(new
InputStreamReader(url.openStream()));
- } catch (java.lang.Exception excp) {
+ URL url = new URL(new URL(serverURL), CHECKSUM_PREFIX
+ "modules/" + moduleName + "/checksums/get");
+ reader = fetchFromURL(url);
+ return ChecksumList.decode(reader);
+ } catch (IOException excp) {
/* Log an error and return null */
logger.log(Level.WARNING, "[MODULES] FETCH CHECKSUMS Failed",
excp);
return null;
+ } catch (JAXBException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH CHECKSUMS Failed",
excp);
+ return null;
+ } finally {
+ try {
+ if (reader != null) {
+ reader.close();
+ }
+ } catch (IOException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH CHECKSUMS
Failed", excp);
+ return null;
+ }
}
}
@@ -150,19 +297,33 @@
*/
public static ChecksumList fetchAssetChecksums(String serverURL,
String moduleName, String assetType) {
-
+ Reader reader = null;
try {
- /* Open an HTTP connection to the Jersey RESTful service */
String uriPart = moduleName + "/checksums/get/" + assetType;
- URL url = new URL(new URL(serverURL), CHECKSUM_PREFIX +
uriPart);
- return ChecksumList.decode(new
InputStreamReader(url.openStream()));
- } catch (java.lang.Exception excp) {
+ URL url = new URL(new URL(serverURL), CHECKSUM_PREFIX
+ "modules/" + uriPart);
+ reader = fetchFromURL(url);
+ return ChecksumList.decode(reader);
+
+ } catch (IOException excp) {
/* Log an error and return null */
logger.log(Level.WARNING, "[MODULES] FETCH CHECKSUMS Failed",
excp);
return null;
+ } catch (JAXBException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH CHECKSUMS Failed",
excp);
+ return null;
+ } finally {
+ try {
+ if (reader != null) {
+ reader.close();
+ }
+ } catch (IOException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH CHECKSUMS
Failed", excp);
+ return null;
+ }
}
}
-
/**
* Asks the web server for the module's plugin jar information that is
* necessary for the client. This include the "client" and "common" jar
@@ -171,15 +332,30 @@
* @return The list of client and common plugin jars in all modules.
*/
public static ModulePluginList fetchPluginJars(String serverURL) {
+ Reader reader = null;
try {
- /* Open an HTTP connection to the Jersey RESTful service */
URL url = new URL(new URL(serverURL), ASSET_PREFIX
+ "jars/get");
- Reader r = new InputStreamReader(url.openStream());
- return ModulePluginList.decode(r, getServerFromURL(serverURL));
- } catch (java.lang.Exception excp) {
+ reader = fetchFromURL(url);
+ return ModulePluginList.decode(reader,
getServerFromURL(serverURL));
+
+ } catch (IOException excp) {
/* Log an error and return null */
logger.log(Level.WARNING, "[MODULES] FETCH JARS Failed", excp);
return null;
+ } catch (JAXBException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH JARS Failed", excp);
+ return null;
+ } finally {
+ try {
+ if (reader != null) {
+ reader.close();
+ }
+ } catch (IOException excp) {
+ /* Log an error and return null */
+ logger.log(Level.WARNING, "[MODULES] FETCH JARS Failed",
excp);
+ return null;
+ }
}
}
=======================================
---
/trunk/core/src/classes/org/jdesktop/wonderland/common/modules/ModuleInfo.java
Mon Feb 22 10:00:46 2010 UTC
+++
/trunk/core/src/classes/org/jdesktop/wonderland/common/modules/ModuleInfo.java
Fri Nov 21 10:39:57 2014 UTC
@@ -42,6 +42,7 @@
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
+import org.jdesktop.wonderland.common.checksums.ChecksumList;
/**
* The ModuleInfo class represents the basic information about a module:
its
@@ -79,6 +80,12 @@
@XmlTransient
private Map<String, String> attributeMap = new HashMap();
+ @XmlElement
+ private ChecksumList checksumList;
+
+ @XmlElement
+ private ModuleRepository repository;
+
private static JAXBContext jaxbContext = null;
static {
try {
@@ -190,6 +197,10 @@
public void setMini(int mini) { this.version.mini = mini; }
@XmlTransient public String getDescription() { return
this.description; }
public void setDescription(String description) { this.description =
description; }
+ @XmlTransient public ChecksumList getChecksumList() { return
checksumList; }
+ public void setChecksumList(ChecksumList checksumList) {
this.checksumList = checksumList; }
+ @XmlTransient public ModuleRepository getRepository() { return
repository; }
+ public void setRepository(ModuleRepository repository) {
this.repository = repository; }
/**
* Returns a copy of the map of key-value pairs of attributes
=======================================
---
/trunk/core/src/classes/org/jdesktop/wonderland/common/modules/ModuleRepository.java
Mon Sep 21 19:38:07 2009 UTC
+++
/trunk/core/src/classes/org/jdesktop/wonderland/common/modules/ModuleRepository.java
Fri Nov 21 10:39:57 2014 UTC
@@ -163,7 +163,7 @@
* Updates the internal linked list of repository objects. This is
invoked
* whenever the set of master and mirror repositories changes.
*/
- private void updateRepositoryList() {
+ public void updateRepositoryList() {
this.repositoryList = new LinkedList();
/* Add the master if not null */
=======================================
--- /trunk/modules/tools/audio-manager/build.xml Thu Nov 18 20:43:06 2010
UTC
+++ /trunk/modules/tools/audio-manager/build.xml Fri Nov 21 10:39:57 2014
UTC
@@ -2,7 +2,9 @@
<project basedir="." default="dist" name="audio-manager">
<!-- current directory needed in all scripts -->
<dirname property="current.dir" file="${ant.file.audio-manager}"/>
- <property name="modules.dir" location="${current.dir}/../.."/>
+ <property name="wonderland.dir" location="${current.dir}/../../../"/>
+ <property name="modules.dir" location="${current.dir}/../../"/>
+ <property name="modules.stable.dir"
location="${wonderland.dir}/../wonderland-modules/stable"/>
<property name="module.src"
value="org/jdesktop/wonderland/modules/audiomanager"/>
<property name="module.packagename"
value="org.jdesktop.wonderland.modules.audiomanager"/>
@@ -13,24 +15,25 @@
<path location="${current.dir}/lib/voicelib.jar"/>
<path location="${current.dir}/lib/voip.jar"/>
<path location="${current.dir}/lib/bridge_connector.jar"/>
- <path
location="${current.dir}/../presence-manager/build/lib/server/presencemanager-server.jar"/>
- <path
location="${current.dir}/../orb/build/lib/server/orb-server.jar"/>
+ <path
location="${modules.dir}/tools/presence-manager/build/lib/server/presencemanager-server.jar"/>
+ <path
location="${modules.dir}/tools/orb/build/lib/server/orb-server.jar"/>
</pathconvert>
<pathconvert property="module-common.classpath">
- <path
location="${current.dir}/../presence-manager/build/lib/client/presencemanager-client.jar"/>
- <path
location="${current.dir}/../orb/build/lib/client/orb-client.jar"/>
+ <path
location="${modules.dir}/tools/presence-manager/build/lib/client/presencemanager-client.jar"/>
+ <path
location="${modules.dir}/tools/orb/build/lib/client/orb-client.jar"/>
</pathconvert>
<pathconvert property="module-client.classpath">
<path
location="${modules.dir}/foundation/content-repository/build/client/contentrepo-client.jar"/>
- <path location="${current.dir}/lib/stun.jar"/>
- <path
location="${current.dir}/../presence-manager/build/lib/client/presencemanager-client.jar"/>
- <path
location="${current.dir}/../orb/build/lib/client/orb-client.jar"/>
- <path
location="${current.dir}/../../world/avatarbase/build/client/avatarbase-client.jar"/>
- <path
location="${current.dir}/../../world/avatarbase/lib/avatars.jar"/>
- <path
location="${current.dir}/../orb/build/lib/client/orb-client.jar"/>
- <path
location="${current.dir}/../text-chat/build/client/textchat-client.jar"/>
+ <path location="${wonderland.dir}/lib/stun.jar"/>
+ <path
location="${modules.dir}/tools/presence-manager/build/lib/client/presencemanager-client.jar"/>
+ <path
location="${modules.dir}/tools/orb/build/lib/client/orb-client.jar"/>
+ <path
location="${modules.dir}/world/avatarbase/build/client/avatarbase-client.jar"/>
+ <path location="${modules.dir}/world/avatarbase/lib/avatars.jar"/>
+ <path
location="${modules.dir}/tools/orb/build/lib/client/orb-client.jar"/>
+ <path
location="${modules.dir}/tools/text-chat/build/client/textchat-client.jar"/>
+ <path
location="${modules.dir}/tools/capability-bridge/build/client/capability-bridge-client.jar"/>
</pathconvert>
<!-- import common build file -->
@@ -43,7 +46,7 @@
<target name="dist" depends="build">
<mkdir dir="${module.dist.dir}"/>
- <module name="audiomanager" majorVersion="0" minorVersion="5"
miniVersion="3"
+ <module name="audiomanager" majorVersion="1" minorVersion="0"
miniVersion="0"
moduleDescription="Audio foundation API and library"
jarfile="${module.dist.dir}/${module.jarname}.jar"
builddir="${build.lib.dir}">
@@ -51,6 +54,7 @@
<requires name="presencemanager" version="0" minorVersion="5"/>
<requires name="content-repository" version="0"
minorVersion="5"/>
<requires name="avatarbase" version="0" minorVersion="5"
miniVersion="1"/>
+ <requires name="capability-bridge" majorversion="1"
minorversion="0"/>
<client dir="${current.dir}/lib">
<clientjar name="audiomanager-client"
basedir="${build.classes.dir}">
=======================================
--- /trunk/modules/tools/audio-manager/nbproject/project.xml Wed Oct 21
12:11:02 2009 UTC
+++ /trunk/modules/tools/audio-manager/nbproject/project.xml Fri Nov 21
10:39:57 2014 UTC
@@ -48,12 +48,19 @@
<source-file>
<location>build.xml</location>
</source-file>
+ <source-file>
+ <location>my.module.properties</location>
+ </source-file>
</items>
<context-menu>
<ide-action name="build"/>
<ide-action name="clean"/>
<ide-action name="javadoc"/>
<ide-action name="rebuild"/>
+ <action>
+ <label>Deploy Module to Server</label>
+ <target>deploy</target>
+ </action>
</context-menu>
</view>
<subprojects/>
@@ -61,7 +68,7 @@
<java-data
xmlns="
http://www.netbeans.org/ns/freeform-project-java/1">
<compilation-unit>
<package-root>src/classes</package-root>
- <classpath
mode="compile">../../../lib/jaxb/jaxb-api.jar:../../../lib/jaxb/jsr173_1.0_api.jar:../../../core/ext/common/mtgame.jar:../../../core/ext/jme20/target/jme.jar:../../../core/build/lib/wonderland-client.jar:../../../core/build/lib/wonderland-common.jar:../../../core/build/lib/wonderland-server.jar:../../../core/ext/common/swing-layout-1.0.jar:lib/voicelib.jar:lib/bridge_connector.jar:lib/voip.jar:../presence-manager/build/lib/client/presencemanager-client.jar:../../world/avatarbase/build/client/avatarbase-client.jar:../orb/build/lib/client/orb-client.jar:../../world/avatarbase/lib/avatars.jar:build/lib/client/audiomanager-client.jar:../orb/build/lib/server/orb-server.jar:../text-chat/build/client/textchat-client.jar:../../../core/ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-api-0.9.10.jar:../../../core/ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-internal-api-0.9.10.jar:../../foundation/security/build/lib/server/security-server.jar:../../foundation/security/build/lib/client/security-client.jar:../../world/avatarbase/build/classes:../../foundation/content-repository/build/client/contentrepo-client.jar</classpath>
+ <classpath
mode="compile">../../../lib/jaxb/jaxb-api.jar;../../../lib/jaxb/jsr173_1.0_api.jar;../../../core/ext/common/mtgame.jar;../../../core/ext/jme20/target/jme.jar;../../../core/build/lib/wonderland-client.jar;../../../core/build/lib/wonderland-common.jar;../../../core/build/lib/wonderland-server.jar;../../../core/ext/common/swing-layout-1.0.jar;../../../core/ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-api-0.9.10.jar;../../../core/ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-internal-api-0.9.10.jar;../presence-manager/build/lib/client/presencemanager-client.jar;../orb/build/lib/client/orb-client.jar;../orb/build/lib/server/orb-server.jar;../../foundation/content-repository/build/client/contentrepo-client.jar;../text-chat/build/client/textchat-client.jar;lib/bridge_connector.jar;lib/voicelib.jar;lib/voip.jar;../../world/avatarbase/build/client/avatarbase-client.jar;../../world/avatarbase/lib/avatars.jar;../capability-bridge/build/client/capability-bridge-client.jar</classpath>
<source-level>1.5</source-level>
</compilation-unit>
</java-data>
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioManagerClient.java
Fri Jun 27 11:30:49 2014 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioManagerClient.java
Fri Nov 21 10:39:57 2014 UTC
@@ -1,3 +1,6 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
/**
* Open Wonderland
*
@@ -36,7 +39,6 @@
package org.jdesktop.wonderland.modules.audiomanager.client;
import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -57,9 +59,7 @@
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
import javax.swing.KeyStroke;
-import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import org.jdesktop.mtgame.Entity;
import org.jdesktop.wonderland.client.cell.Cell;
@@ -140,6 +140,7 @@
*
* @author jprovino
* @author Ronny Standtke <
ronny.s...@fhnw.ch>
+ * @author Abhishek Upadhyay
*/
public class AudioManagerClient extends BaseConnection implements
AudioMenuListener, SoftphoneListener, ViewCellConfiguredListener
@@ -151,6 +152,8 @@
// will result in the default behavior, unmuted.
public static final String AUDIO_STATE_PROP =
"AudioManagerClient.InitialState";
+ public static final String AUDIO_ISMUTE_PROP =
+ "Audio.disable";
// whether or not to show the audio status HUD by default
public static final String AUDIO_HUD_PROP =
@@ -223,7 +226,7 @@
}
}
};
-
+
audioMeterListener = new HUDEventListener() {
public void HUDObjectChanged(HUDEvent event) {
if (event.getEventType() == HUDEvent.HUDEventType.APPEARED
||
@@ -371,7 +374,7 @@
// if the view is already configured, fake an event
viewConfigured(avatar);
}
-
+
SoftphoneControlImpl.getInstance().addSoftphoneListener(this);
// enable the menus
@@ -399,6 +402,19 @@
if (showHUD) {
miniVUMeter();
}
+
+ //check if audio need to be muted or not
+ String audio = System.getProperty(AUDIO_ISMUTE_PROP);
+ if(audio==null) {
+ audio="false";
+ }
+ if(audio.equalsIgnoreCase("true")) {
+ disconnected();
+ // enable the menus
+ AudioMenu.getAudioMenu(this).setEnabled(false);
+ AudioMenu.getAudioMenu(this).audioVolumeDisable();
+ AudioMenu.getAudioMenu(this).disableAudioMenu();
+ }
}
@Override
@@ -550,7 +566,6 @@
}
}
}).start();
-
}
}
@@ -1163,6 +1178,10 @@
String y = System.getProperty("y");
String z = System.getProperty("z");
+ if(x==null || y==null || z==null) {
+ x=y=z="0";
+ }
+
if (phoneNumber != null && phoneNumber.length() > 0) {
sendMessage(new PlaceCallRequestMessage(presenceInfo,
phoneNumber,
Double.parseDouble(x), Double.parseDouble(y),
Double.parseDouble(z), 90., false));
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioMenu.form
Mon Jan 24 18:03:19 2011 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioMenu.form
Fri Nov 21 10:39:57 2014 UTC
@@ -1,4 +1,4 @@
-<?xml version="1.1" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.5"
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents>
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioMenu.java
Wed Sep 21 05:15:46 2011 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioMenu.java
Fri Nov 21 10:39:57 2014 UTC
@@ -1,3 +1,6 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
/**
* Open Wonderland
*
@@ -52,6 +55,7 @@
*
* @author paulby
* @author Ronny Standtke <
ronny.s...@fhnw.ch>
+ * @author Abhishek Upadhyay
*/
public class AudioMenu extends javax.swing.JPanel {
@@ -63,6 +67,10 @@
private JMenuItem personalPhoneMenuItem;
private JMenuItem voiceChatMenuItem;
private JCheckBoxMenuItem muteCheckBox;
+ //voice chat disabel property
+ public static final String VOICE_CHAT_DISABLE_PROP =
+ "VoiceChat.disable";
+ private boolean isVoiceChatDisable=false;
/** Creates new form AudioMenu */
AudioMenu(final AudioMenuListener audioMenuListener) {
@@ -92,6 +100,17 @@
}
});
+ //check if voice chat is disabled or not
+ String isDisable = System.getProperty(VOICE_CHAT_DISABLE_PROP);
+ if(isDisable==null) {
+ isDisable="false";
+ isVoiceChatDisable=false;
+ }
+ if(isDisable.equalsIgnoreCase("true")) {
+ isVoiceChatDisable=true;
+ }
+
+
voiceChatMenuItem = new
JCheckBoxMenuItem(BUNDLE.getString("Voice_Chat"));
voiceChatMenuItem.addActionListener(new ActionListener() {
@@ -101,7 +120,11 @@
}
}
});
-
+
+ if(isVoiceChatDisable) {
+ voiceChatMenuItem.setEnabled(false);
+ }
+
audioVolumeMenuItem = new
JCheckBoxMenuItem(BUNDLE.getString("Audio_Status"));
audioVolumeMenuItem.addActionListener(new ActionListener() {
@@ -119,13 +142,22 @@
softphoneMenuItem.setEnabled(enabled);
muteCheckBox.setEnabled(enabled);
personalPhoneMenuItem.setEnabled(enabled);
- voiceChatMenuItem.setEnabled(enabled);
+ if(!isVoiceChatDisable) {
+ voiceChatMenuItem.setEnabled(enabled);
+ }
}
+ public void disableAudioMenu() {
+ audioMenu.setEnabled(false);
+ }
+
public void mute(boolean isMuted) {
muteCheckBox.setState(isMuted);
}
+ public void audioVolumeDisable() {
+ audioVolumeMenuItem.setEnabled(false);
+ }
public void audioVolumeVisible(boolean visible) {
audioVolumeMenuItem.setState(visible);
}
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioTreatmentComponent.java
Mon Feb 22 10:03:31 2010 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioTreatmentComponent.java
Fri Nov 21 10:39:57 2014 UTC
@@ -1,25 +1,29 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
/**
* Project Wonderland
*
* Copyright (c) 2004-2010, Sun Microsystems, Inc., All Rights Reserved
*
- * Redistributions in source code form must reproduce the above
- * copyright and this condition.
+ * Redistributions in source code form must reproduce the above copyright
and
+ * this condition.
*
- * The contents of this file are subject to the GNU General Public
- * License, Version 2 (the "License"); you may not use this file
- * except in compliance with the License. A copy of the License is
- * available at
http://www.opensource.org/licenses/gpl-license.php.
+ * The contents of this file are subject to the GNU General Public License,
+ * Version 2 (the "License"); you may not use this file except in
compliance
+ * with the License. A copy of the License is available at
+ *
http://www.opensource.org/licenses/gpl-license.php.
*
- * Sun designates this particular file as subject to the "Classpath"
- * exception as provided by Sun in the License file that accompanied
- * this code.
+ * Sun designates this particular file as subject to the "Classpath"
exception
+ * as provided by Sun in the License file that accompanied this code.
*/
package org.jdesktop.wonderland.modules.audiomanager.client;
+import com.wonderbuilders.modules.capabilitybridge.client.CapabilityBridge;
import java.util.ArrayList;
import java.util.ResourceBundle;
import java.util.logging.Logger;
+import org.jdesktop.mtgame.Entity;
import org.jdesktop.wonderland.client.cell.annotation.UsesCellComponent;
import org.jdesktop.wonderland.client.cell.Cell;
import org.jdesktop.wonderland.client.cell.ChannelComponent;
@@ -29,7 +33,11 @@
import org.jdesktop.wonderland.client.contextmenu.ContextMenuItemEvent;
import org.jdesktop.wonderland.client.contextmenu.SimpleContextMenuItem;
import
org.jdesktop.wonderland.client.contextmenu.spi.ContextMenuFactorySPI;
+import org.jdesktop.wonderland.client.input.EventClassListener;
import org.jdesktop.wonderland.client.jme.JmeClientMain;
+import org.jdesktop.wonderland.client.jme.cellrenderer.BasicRenderer;
+import org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D;
+import org.jdesktop.wonderland.client.jme.input.MouseEvent3D;
import org.jdesktop.wonderland.client.scenemanager.event.ContextEvent;
import org.jdesktop.wonderland.client.softphone.SoftphoneControlImpl;
import org.jdesktop.wonderland.common.cell.CallID;
@@ -49,16 +57,17 @@
/**
* A component that provides audio audio treatments
- *
+ *
* @author jprovino
* @author Ronny Standtke <
ronny.s...@fhnw.ch>
+ * @author Abhishek Upadhyay
*/
@ExperimentalAPI
public class AudioTreatmentComponent
- extends AudioParticipantComponent implements VolumeChangeListener {
+ extends AudioParticipantComponent implements VolumeChangeListener,
CapabilityBridge {
- private static final Logger LOGGER =
- Logger.getLogger(AudioTreatmentComponent.class.getName());
+ private static final Logger LOGGER
+ = Logger.getLogger(AudioTreatmentComponent.class.getName());
private final static ResourceBundle BUNDLE = ResourceBundle.getBundle(
"org/jdesktop/wonderland/modules/audiomanager/client/resources/Bundle");
private static final String PLAY = BUNDLE.getString("Play");
@@ -76,6 +85,8 @@
private ArrayList<AudioTreatmentDoneListener> listeners = new
ArrayList();
private PlayWhen playWhen = PlayWhen.ALWAYS;
private boolean playOnce = false;
+ private static boolean isPlaying = false;
+ private AudioTreatmentMouseListener leftClickListener = null;
public AudioTreatmentComponent(Cell cell) {
super(cell);
@@ -86,50 +97,91 @@
super.setStatus(status, increasing);
switch (status) {
- case DISK:
- case INACTIVE:
- if (msgReceiver == null) {
- return;
- }
-
-
channelComp.removeMessageReceiver(AudioTreatmentDoneMessage.class);
-
channelComp.removeMessageReceiver(AudioTreatmentEndedMessage.class);
-
channelComp.removeMessageReceiver(AudioTreatmentEstablishedMessage.class);
-
channelComp.removeMessageReceiver(AudioTreatmentMenuChangeMessage.class);
-
channelComp.removeMessageReceiver(AudioTreatmentRequestMessage.class);
- channelComp.removeMessageReceiver(AudioVolumeMessage.class);
- break;
-
- case ACTIVE:
- if (increasing) {
+ case DISK:
+ case INACTIVE:
if (msgReceiver == null) {
- msgReceiver = new
ChannelComponent.ComponentMessageReceiver() {
+ return;
+ }
- public void messageReceived(CellMessage message) {
- receive(message);
- }
- };
+
channelComp.removeMessageReceiver(AudioTreatmentDoneMessage.class);
+
channelComp.removeMessageReceiver(AudioTreatmentEndedMessage.class);
+
channelComp.removeMessageReceiver(AudioTreatmentEstablishedMessage.class);
+
channelComp.removeMessageReceiver(AudioTreatmentMenuChangeMessage.class);
+
channelComp.removeMessageReceiver(AudioTreatmentRequestMessage.class);
+
channelComp.removeMessageReceiver(AudioVolumeMessage.class);
+ break;
- channelComp =
cell.getComponent(ChannelComponent.class);
-
channelComp.addMessageReceiver(AudioTreatmentDoneMessage.class,
msgReceiver);
-
channelComp.addMessageReceiver(AudioTreatmentEndedMessage.class,
msgReceiver);
-
channelComp.addMessageReceiver(AudioTreatmentEstablishedMessage.class,
msgReceiver);
-
channelComp.addMessageReceiver(AudioTreatmentMenuChangeMessage.class,
msgReceiver);
-
channelComp.addMessageReceiver(AudioTreatmentRequestMessage.class,
msgReceiver);
-
channelComp.addMessageReceiver(AudioVolumeMessage.class, msgReceiver);
- }
+ case ACTIVE:
+ if (increasing) {
+ if (msgReceiver == null) {
+ msgReceiver = new
ChannelComponent.ComponentMessageReceiver() {
- if (menuItemAdded == false) {
- menuItemAdded = true;
+ public void messageReceived(CellMessage
message) {
+ receive(message);
+ }
+ };
- if (playWhen.equals(PlayWhen.ALWAYS)) {
- addMenuItems(new String[] {STOP,PAUSE,VOLUME});
- } else {
- addMenuItems(new String[] {PLAY,VOLUME});
+ channelComp =
cell.getComponent(ChannelComponent.class);
+
channelComp.addMessageReceiver(AudioTreatmentDoneMessage.class,
msgReceiver);
+
channelComp.addMessageReceiver(AudioTreatmentEndedMessage.class,
msgReceiver);
+
channelComp.addMessageReceiver(AudioTreatmentEstablishedMessage.class,
msgReceiver);
+
channelComp.addMessageReceiver(AudioTreatmentMenuChangeMessage.class,
msgReceiver);
+
channelComp.addMessageReceiver(AudioTreatmentRequestMessage.class,
msgReceiver);
+
channelComp.addMessageReceiver(AudioVolumeMessage.class, msgReceiver);
+ }
+
+ if (menuItemAdded == false) {
+ menuItemAdded = true;
+
+ if (playWhen.equals(PlayWhen.ALWAYS)) {
+ addMenuItems(new String[]{STOP, PAUSE,
VOLUME});
+ } else {
+ addMenuItems(new String[]{PLAY, VOLUME});
+ }
}
}
+ break;
+ case RENDERING:
+ if (increasing) {
+ addMouseListener();
+ }
+ break;
+
+ }
+ }
+
+ public void addMouseListener() {
+ //add mouse listener
+ BasicRenderer crJME = (BasicRenderer)
cell.getCellRenderer(Cell.RendererType.RENDERER_JME);
+ Entity ent = crJME.getEntity();
+ if (leftClickListener == null) {
+ leftClickListener = new AudioTreatmentMouseListener(cell);
+ leftClickListener.addToEntity(ent);
+ }
+ }
+
+ class AudioTreatmentMouseListener extends EventClassListener {
+
+ Cell cell = null;
+
+ AudioTreatmentMouseListener(Cell cell) {
+ this.cell = cell;
+ }
+
+ @Override
+ public Class[] eventClassesToConsume() {
+ return new Class[]{MouseButtonEvent3D.class};
+ }
+
+ @Override
+ public void commitEvent(org.jdesktop.wonderland.client.input.Event
event) {
+ MouseButtonEvent3D mbe = (MouseButtonEvent3D) event;
+ if (playWhen.equals(PlayWhen.ON_LEFT_CLICK)
+ && mbe.isClicked() == true && mbe.getButton() ==
MouseEvent3D.ButtonId.BUTTON1) {
+ LOGGER.warning("restart audio...");
+ addMenuItems(new String[]{STOP, PAUSE, VOLUME});
+ channelComp.send(new
AudioTreatmentRequestMessage(cell.getCellID(), true, false));
}
- break;
}
}
@@ -152,9 +204,9 @@
public ContextMenuItem[] getContextMenuItems(ContextEvent
event) {
SimpleContextMenuItem[] menuItems = new
SimpleContextMenuItem[items.length];
- for (int i = 0; i < menuItems.length; i++) {
- menuItems[i] = new SimpleContextMenuItem(items[i], l);
- }
+ for (int i = 0; i < menuItems.length; i++) {
+ menuItems[i] = new SimpleContextMenuItem(items[i], l);
+ }
return menuItems;
}
@@ -170,115 +222,116 @@
CellID cellID = cell.getCellID();
if (PLAY.equals(label) || RESUME.equals(label)) {
- addMenuItems(new String[] {STOP, PAUSE, VOLUME});
+ addMenuItems(new String[]{STOP, PAUSE, VOLUME});
channelComp.send(new AudioTreatmentRequestMessage(cellID,
false, false));
return;
}
if (PAUSE.equals(label)) {
- addMenuItems(new String[] {STOP, RESUME, VOLUME});
+ addMenuItems(new String[]{STOP, RESUME, VOLUME});
channelComp.send(new AudioTreatmentRequestMessage(cellID,
false, true));
return;
}
if (VOLUME.equals(label)) {
- String softphoneCallID =
SoftphoneControlImpl.getInstance().getCallID();
+ String softphoneCallID =
SoftphoneControlImpl.getInstance().getCallID();
- if (volumeControlJFrame == null) {
- volumeControlJFrame = new VolumeControlJFrame(this, "");
- }
+ if (volumeControlJFrame == null) {
+ volumeControlJFrame = new VolumeControlJFrame(this, "");
+ }
volumeControlJFrame.setLocationRelativeTo(
JmeClientMain.getFrame().getFrame());
- volumeControlJFrame.setVisible(true);
- return;
+ volumeControlJFrame.setVisible(true);
+ return;
}
if (!(STOP.equals(label))) {
return;
}
- addMenuItems(new String[] {PLAY, VOLUME});
+ addMenuItems(new String[]{PLAY, VOLUME});
channelComp.send(new AudioTreatmentRequestMessage(cellID, true,
true));
}
public void volumeChanged(float volume) {
- LOGGER.fine("Volume changed " + volume);
+ LOGGER.fine("Volume changed " + volume);
- String softphoneCallID = SoftphoneControlImpl.getInstance().getCallID();
+ String softphoneCallID =
SoftphoneControlImpl.getInstance().getCallID();
- String otherCallID = CallID.getCallID(cell.getCellID());
+ String otherCallID = CallID.getCallID(cell.getCellID());
- channelComp.send(new AudioVolumeMessage(cell.getCellID(),
softphoneCallID,
- otherCallID, volume, true));
+ channelComp.send(new AudioVolumeMessage(cell.getCellID(),
softphoneCallID,
+ otherCallID, volume, true));
}
private ArrayList<AudioTreatmentStatusListener>
treatmentStatusListeners = new ArrayList();
public void addTreatmentStatusListener(AudioTreatmentStatusListener
listener) {
- synchronized (treatmentStatusListeners) {
- treatmentStatusListeners.remove(listener);
- treatmentStatusListeners.add(listener);
- }
+ synchronized (treatmentStatusListeners) {
+ treatmentStatusListeners.remove(listener);
+ treatmentStatusListeners.add(listener);
+ }
}
-
+
public void removeTreatmentStatusListener(AudioTreatmentStatusListener
listener) {
- synchronized (treatmentStatusListeners) {
- treatmentStatusListeners.remove(listener);
- }
+ synchronized (treatmentStatusListeners) {
+ treatmentStatusListeners.remove(listener);
+ }
}
private void notifyTreatmentEstablished() {
- synchronized (treatmentStatusListeners) {
- for (AudioTreatmentStatusListener listener :
treatmentStatusListeners) {
- listener.treatmentEstablished();
- }
- }
+ synchronized (treatmentStatusListeners) {
+ for (AudioTreatmentStatusListener listener :
treatmentStatusListeners) {
+ listener.treatmentEstablished();
+ }
+ }
}
private void notifyTreatmentEnded(String reason) {
- synchronized (treatmentStatusListeners) {
- for (AudioTreatmentStatusListener listener :
treatmentStatusListeners) {
- listener.treatmentEnded(reason);
- }
- }
+ synchronized (treatmentStatusListeners) {
+ for (AudioTreatmentStatusListener listener :
treatmentStatusListeners) {
+ listener.treatmentEnded(reason);
+ }
+ }
}
private void receive(CellMessage message) {
- if (message instanceof AudioTreatmentDoneMessage) {
- addMenuItems(new String[] {PLAY, VOLUME});
- channelComp.send(new AudioTreatmentRequestMessage(cell.getCellID(),
true, true));
- return;
- }
+ if (message instanceof AudioTreatmentDoneMessage) {
+ addMenuItems(new String[]{PLAY, VOLUME});
+ channelComp.send(new
AudioTreatmentRequestMessage(cell.getCellID(), true, true));
+ return;
+ }
+
+ if (message instanceof AudioTreatmentEndedMessage) {
+ AudioTreatmentEndedMessage msg = (AudioTreatmentEndedMessage)
message;
+ LOGGER.warning("Treatment ended: " + msg.getReason());
+ notifyTreatmentEnded(msg.getReason());
+ return;
+ }
+
+ if (message instanceof AudioTreatmentEstablishedMessage) {
+ LOGGER.warning("Treatment established");
+ notifyTreatmentEstablished();
+ return;
+ }
- if (message instanceof AudioTreatmentEndedMessage) {
- AudioTreatmentEndedMessage msg = (AudioTreatmentEndedMessage) message;
- LOGGER.warning("Treatment ended: " + msg.getReason());
- notifyTreatmentEnded(msg.getReason());
- return;
- }
+ if (message instanceof AudioTreatmentMenuChangeMessage) {
+ addMenuItems(((AudioTreatmentMenuChangeMessage)
message).getMenuItems());
+ return;
+ }
- if (message instanceof AudioTreatmentEstablishedMessage) {
- LOGGER.warning("Treatment established");
- notifyTreatmentEstablished();
- return;
- }
+ if (message instanceof AudioVolumeMessage) {
+ float volume = (float) ((AudioVolumeMessage)
message).getVolume();
- if (message instanceof AudioTreatmentMenuChangeMessage) {
- addMenuItems(((AudioTreatmentMenuChangeMessage)
message).getMenuItems());
- return;
- }
-
- if (message instanceof AudioVolumeMessage) {
- float volume = (float) ((AudioVolumeMessage) message).getVolume();
-
- LOGGER.fine("Got volume message " + volume);
- return;
- }
+ LOGGER.fine("Got volume message " + volume);
+ return;
+ }
}
/**
* Listen for audio treatment done
+ *
* @param listener
*/
public void addTreatmentDoneListener(AudioTreatmentDoneListener
listener) {
@@ -287,6 +340,7 @@
/**
* Remove the audio treatment done listener.
+ *
* @param listener
*/
public void
removeAudioTreatmentDoneListener(AudioTreatmentDoneListener listener) {
@@ -301,22 +355,23 @@
playWhen = state.getPlayWhen();
- playOnce = state.getPlayOnce();
+ playOnce = state.getPlayOnce();
- if (menuItemAdded == false) {
- return;
- }
+ if (menuItemAdded == false) {
+ return;
+ }
if (playWhen.equals(PlayWhen.ALWAYS)) {
- addMenuItems(new String[] {STOP, PAUSE, VOLUME});
+ addMenuItems(new String[]{STOP, PAUSE, VOLUME});
} else {
- addMenuItems(new String[] {PLAY, VOLUME});
+ addMenuItems(new String[]{PLAY, VOLUME});
}
+
}
/**
* Notify any audio treatment done listeners
- *
+ *
* @param transform
*/
private void notifyAudioTreatmentDoneListeners() {
@@ -329,10 +384,15 @@
public interface AudioTreatmentDoneListener {
/**
- * Notification that the cell has moved. Source indicates the
source of
- * the move, local is from this client, remote is from the server.
- * XXX arguments?
+ * Notification that the cell has moved. Source indicates the
source of
+ * the move, local is from this client, remote is from the server.
XXX
+ * arguments?
*/
public void audioTreatmentDone();
}
+
+ public AudioTreatmentMouseListener getMouseEventListener() {
+ return leftClickListener;
+ }
+
}
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioTreatmentComponentProperties.form
Fri Jan 15 11:25:06 2010 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioTreatmentComponentProperties.form
Fri Nov 21 10:39:57 2014 UTC
@@ -61,49 +61,57 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="browseButton" min="-2"
max="-2" attributes="0"/>
</Group>
- <Component id="playOnceCheckBox" alignment="0"
min="-2" max="-2" attributes="0"/>
+ <Component id="leftClickRadioButton"
alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="proximityRadioButton"
alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="manualRadioButton" alignment="0"
min="-2" max="-2" attributes="0"/>
+ <Group type="103" alignment="0"
groupAlignment="1" max="-2" attributes="0">
+ <Component id="manualRadioButton"
alignment="0" max="32767" attributes="0"/>
+ <Component id="playOnceCheckBox"
alignment="0" pref="87" max="32767" attributes="0"/>
+ </Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
- <EmptySpace min="29" pref="29" max="29"
attributes="0"/>
- <Component id="jLabel3" min="-2" max="-2"
attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="jLabel15" min="-2" max="-2"
attributes="0"/>
- <EmptySpace min="-2" pref="5" max="-2"
attributes="0"/>
- <Component id="falloffSlider" min="-2"
pref="174" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="jLabel5" min="-2" max="-2"
attributes="0"/>
- </Group>
- <Component id="audioGroupIdTextField"
alignment="0" min="-2" pref="200" max="-2" attributes="1"/>
- <Component id="statusLabel" alignment="0"
pref="347" max="32767" attributes="1"/>
- <Group type="102" alignment="0" attributes="0">
- <Component id="specifyRadiusRadioButton"
min="-2" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="extentRadiusSpinner" min="-2"
pref="58" max="-2" attributes="0"/>
- </Group>
- <Group type="102" alignment="0" attributes="0">
- <Component id="useCellBoundsRadioButton"
min="-2" max="-2" attributes="1"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="boundsLabel" min="-2"
pref="178" max="-2" attributes="0"/>
- </Group>
- <Group type="102" alignment="0" attributes="0">
- <EmptySpace min="-2" pref="143" max="-2"
attributes="0"/>
- <Component id="cellBoundsLabel" min="-2"
pref="104" max="-2" attributes="1"/>
- </Group>
- <Group type="102" alignment="0" attributes="0">
+ <Component id="statusLabel" alignment="0"
max="32767" attributes="1"/>
+ <Group type="102" attributes="0">
<Group type="103" groupAlignment="0"
attributes="0">
- <Component id="ambientRadioButton"
alignment="0" min="-2" max="-2" attributes="0"/>
- <Component
id="fullVolumeAreaPercentSpinner" alignment="0" min="-2" pref="58" max="-2"
attributes="0"/>
- <Component
id="distanceAttenuatedRadioButton" alignment="0" min="-2" max="-2"
attributes="0"/>
- <Component id="showBoundsCheckBox"
alignment="0" min="-2" max="-2" attributes="0"/>
+ <Group type="102" alignment="0"
attributes="0">
+ <EmptySpace min="29" pref="29"
max="29" attributes="0"/>
+ <Component id="jLabel3" min="-2"
max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jLabel15" min="-2"
max="-2" attributes="0"/>
+ <EmptySpace min="-2" pref="5"
max="-2" attributes="0"/>
+ <Component id="falloffSlider"
min="-2" pref="174" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jLabel5" min="-2"
max="-2" attributes="0"/>
+ </Group>
+ <Component id="audioGroupIdTextField"
alignment="0" min="-2" pref="200" max="-2" attributes="1"/>
+ <Group type="102" alignment="0"
attributes="0">
+ <Component
id="specifyRadiusRadioButton" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="extentRadiusSpinner"
min="-2" pref="58" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0"
attributes="0">
+ <Component
id="useCellBoundsRadioButton" min="-2" max="-2" attributes="1"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="boundsLabel" min="-2"
pref="178" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0"
attributes="0">
+ <EmptySpace min="-2" pref="143"
max="-2" attributes="0"/>
+ <Component id="cellBoundsLabel"
min="-2" pref="104" max="-2" attributes="1"/>
+ </Group>
+ <Group type="102" alignment="0"
attributes="0">
+ <Group type="103" groupAlignment="0"
attributes="0">
+ <Component
id="ambientRadioButton" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component
id="fullVolumeAreaPercentSpinner" alignment="0" min="-2" pref="58" max="-2"
attributes="0"/>
+ <Component
id="distanceAttenuatedRadioButton" alignment="0" min="-2" max="-2"
attributes="0"/>
+ <Component
id="showBoundsCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" pref="3"
max="-2" attributes="0"/>
+ <Component
id="audioCapabilitiesLabel" min="-2" pref="157" max="-2" attributes="0"/>
+ </Group>
</Group>
- <EmptySpace min="-2" pref="3" max="-2"
attributes="0"/>
- <Component id="audioCapabilitiesLabel"
min="-2" pref="157" max="-2" attributes="0"/>
+ <EmptySpace min="0" pref="0" max="32767"
attributes="0"/>
</Group>
</Group>
</Group>
@@ -132,18 +140,20 @@
<Component id="jLabel2" alignment="2" min="-2" pref="27"
max="-2" attributes="0"/>
<Component id="volumeSlider" alignment="2" min="-2"
max="-2" attributes="0"/>
</Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="1" attributes="0">
- <Component id="jLabel10" min="-2" max="-2"
attributes="0"/>
- <Component id="alwaysRadioButton" alignment="1" min="-2"
max="-2" attributes="0"/>
+ <EmptySpace type="unrelated" pref="11" max="32767"
attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="alwaysRadioButton" alignment="3" min="-2"
max="-2" attributes="0"/>
+ <Component id="jLabel10" alignment="3" min="-2" max="-2"
attributes="0"/>
</Group>
- <EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Component id="leftClickRadioButton" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="proximityRadioButton" min="-2" max="-2"
attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
+ <EmptySpace type="unrelated" min="-2" max="-2"
attributes="0"/>
<Component id="manualRadioButton" min="-2" max="-2"
attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="playOnceCheckBox" min="-2" max="-2"
attributes="1"/>
- <EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Component id="playOnceCheckBox" min="-2" pref="20" max="-2"
attributes="1"/>
+ <EmptySpace type="unrelated" min="-2" max="-2"
attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel11" alignment="2" min="-2" max="-2"
attributes="0"/>
<Component id="specifyRadiusRadioButton" alignment="2"
min="-2" max="-2" attributes="0"/>
@@ -501,6 +511,19 @@
<Events>
<EventHandler event="stateChanged"
listener="javax.swing.event.ChangeListener"
parameters="javax.swing.event.ChangeEvent"
handler="volumeSliderStateChanged"/>
</Events>
+ </Component>
+ <Component class="javax.swing.JRadioButton"
name="leftClickRadioButton">
+ <Properties>
+ <Property name="buttonGroup" type="javax.swing.ButtonGroup"
editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
+ <ComponentRef name="buttonGroup1"/>
+ </Property>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString
bundle="org/jdesktop/wonderland/modules/audiomanager/client/resources/Bundle.properties"
key="AudioTreatmentComponentProperties.leftClickRadioButton.text"
replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent"
handler="leftClickRadioButtonActionPerformed"/>
+ </Events>
</Component>
</SubComponents>
</Form>
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioTreatmentComponentProperties.java
Mon Feb 22 10:03:31 2010 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/AudioTreatmentComponentProperties.java
Fri Nov 21 10:39:57 2014 UTC
@@ -1,3 +1,6 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
/**
* Project Wonderland
*
@@ -45,6 +48,7 @@
import org.jdesktop.wonderland.common.cell.state.CellServerState;
import
org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState;
import
org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState.PlayWhen;
+import static
org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState.PlayWhen.FIRST_IN_RANGE;
import
org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState.TreatmentType;
import org.jdesktop.wonderland.modules.audiomanager.common.VolumeConverter;
import
org.jdesktop.wonderland.modules.contentrepo.client.ContentRepository;
@@ -59,6 +63,7 @@
*
* @author jp
* @author Ronny Standtke <
ronny.s...@fhnw.ch>
+ * @author Abhishek Upadhyay
*/
@PropertiesFactory(AudioTreatmentComponentServerState.class)
public class AudioTreatmentComponentProperties extends javax.swing.JPanel
@@ -205,7 +210,7 @@
originalPlayOnce = compState.getPlayOnce();
playOnce = originalPlayOnce;
-
+
originalExtentRadius = (float) compState.getExtent();
extentRadius = originalExtentRadius;
@@ -311,7 +316,12 @@
compState.setDistanceAttenuated(distanceAttenuated);
compState.setFalloff(falloffSlider.getValue());
editor.addToUpdateList(compState);
-
+
+ if(playWhen.equals(PlayWhen.ON_LEFT_CLICK)) {
+ AudioTreatmentComponent atc =
editor.getCell().getComponent(AudioTreatmentComponent.class);
+ atc.addMouseListener();
+ }
+
if (currentCell != null &&
currentCell.getCellID().equals(editor.getCell().getCellID()) == false) {
statusLabel.setText("");
}
@@ -510,12 +520,17 @@
playOnceCheckBox.setSelected(false);
playOnceCheckBox.setEnabled(false);
break;
+
+ case ON_LEFT_CLICK:
+ leftClickRadioButton.setSelected(true);
+ leftClickRadioButton.setEnabled(true);
+ break;
case FIRST_IN_RANGE:
proximityRadioButton.setSelected(true);
playOnceCheckBox.setEnabled(true);
break;
-
+
case MANUAL:
manualRadioButton.setSelected(true);
playOnceCheckBox.setEnabled(true);
@@ -770,6 +785,7 @@
URLRadioButton = new javax.swing.JRadioButton();
boundsLabel = new javax.swing.JLabel();
volumeSlider = new javax.swing.JSlider();
+ leftClickRadioButton = new javax.swing.JRadioButton();
java.util.ResourceBundle bundle =
java.util.ResourceBundle.getBundle("org/jdesktop/wonderland/modules/audiomanager/client/resources/Bundle");
// NOI18N
jLabel5.setText(bundle.getString("AudioTreatmentComponentProperties.jLabel5.text"));
// NOI18N
@@ -931,6 +947,14 @@
}
});
+ buttonGroup1.add(leftClickRadioButton);
+
leftClickRadioButton.setText(bundle.getString("AudioTreatmentComponentProperties.leftClickRadioButton.text"));
// NOI18N
+ leftClickRadioButton.addActionListener(new
java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ leftClickRadioButtonActionPerformed(evt);
+ }
+ });
+
org.jdesktop.layout.GroupLayout layout = new
org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -965,42 +989,47 @@
.add(treatmentTextField,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 241,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(browseButton))
- .add(playOnceCheckBox)
+ .add(leftClickRadioButton)
.add(proximityRadioButton)
- .add(manualRadioButton)))
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING,
false)
+ .add(org.jdesktop.layout.GroupLayout.LEADING,
manualRadioButton,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.LEADING,
playOnceCheckBox,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 87,
Short.MAX_VALUE))))
.add(layout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(layout.createSequentialGroup()
- .add(29, 29, 29)
- .add(jLabel3)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jLabel15)
- .add(5, 5, 5)
- .add(falloffSlider,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 174,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jLabel5))
- .add(audioGroupIdTextField,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(statusLabel,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)
- .add(layout.createSequentialGroup()
- .add(specifyRadiusRadioButton)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(extentRadiusSpinner,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 58,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .add(layout.createSequentialGroup()
- .add(useCellBoundsRadioButton)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(boundsLabel,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 178,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .add(layout.createSequentialGroup()
- .add(143, 143, 143)
- .add(cellBoundsLabel,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 104,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(statusLabel,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(ambientRadioButton)
- .add(fullVolumeAreaPercentSpinner,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 58,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(distanceAttenuatedRadioButton)
- .add(showBoundsCheckBox))
- .add(3, 3, 3)
- .add(audioCapabilitiesLabel,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 157,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
+ .add(layout.createSequentialGroup()
+ .add(29, 29, 29)
+ .add(jLabel3)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jLabel15)
+ .add(5, 5, 5)
+ .add(falloffSlider,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 174,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jLabel5))
+ .add(audioGroupIdTextField,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(layout.createSequentialGroup()
+ .add(specifyRadiusRadioButton)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(extentRadiusSpinner,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 58,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(layout.createSequentialGroup()
+ .add(useCellBoundsRadioButton)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(boundsLabel,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 178,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(layout.createSequentialGroup()
+ .add(143, 143, 143)
+ .add(cellBoundsLabel,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 104,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(layout.createSequentialGroup()
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(ambientRadioButton)
+ .add(fullVolumeAreaPercentSpinner,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
58,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(distanceAttenuatedRadioButton)
+ .add(showBoundsCheckBox))
+ .add(3, 3, 3)
+ .add(audioCapabilitiesLabel,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 157,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
+ .add(0, 0, Short.MAX_VALUE)))))
.addContainerGap())
);
layout.setVerticalGroup(
@@ -1020,17 +1049,19 @@
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER)
.add(jLabel2,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 27,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(volumeSlider,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
- .add(jLabel10)
- .add(alwaysRadioButton))
- .add(7, 7, 7)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED,
11,
Short.MAX_VALUE)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(alwaysRadioButton)
+ .add(jLabel10))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
+ .add(leftClickRadioButton)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(proximityRadioButton)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(manualRadioButton)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(playOnceCheckBox)
- .add(12, 12, 12)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
+ .add(playOnceCheckBox,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER)
.add(jLabel11)
.add(specifyRadiusRadioButton)
@@ -1315,6 +1346,20 @@
// TODO add your handling code here:
}//GEN-LAST:event_volumeSliderStateChanged
+ private void
leftClickRadioButtonActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_leftClickRadioButtonActionPerformed
+ // TODO add your handling code here:
+ if (leftClickRadioButton.isSelected() == false) {
+ return;
+ }
+
+ playWhen = PlayWhen.ON_LEFT_CLICK;
+ playOnceCheckBox.setEnabled(true);
+
+ if (editor != null) {
+ editor.setPanelDirty(AudioTreatmentComponentProperties.class,
isDirty());
+ }
+ }//GEN-LAST:event_leftClickRadioButtonActionPerformed
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JRadioButton URLRadioButton;
private javax.swing.JRadioButton alwaysRadioButton;
@@ -1346,6 +1391,7 @@
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel7;
+ private javax.swing.JRadioButton leftClickRadioButton;
private javax.swing.JRadioButton manualRadioButton;
private javax.swing.JCheckBox playOnceCheckBox;
private javax.swing.JRadioButton proximityRadioButton;
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/resources/Bundle.properties
Mon Jan 31 22:01:03 2011 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/client/resources/Bundle.properties
Fri Nov 21 10:39:57 2014 UTC
@@ -148,3 +148,4 @@
Volume=Volume
Volume...=Volume...
VuMeterPanel.pttButton.text=Push to talk
+AudioTreatmentComponentProperties.leftClickRadioButton.text=On Left Click
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/common/AudioTreatmentComponentServerState.java
Mon Oct 12 21:44:17 2009 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/common/AudioTreatmentComponentServerState.java
Fri Nov 21 10:39:57 2014 UTC
@@ -1,3 +1,6 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
/**
* Project Wonderland
*
@@ -22,11 +25,11 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.jdesktop.wonderland.common.cell.state.annotation.ServerState;
-import org.jdesktop.wonderland.common.cell.state.CellComponentServerState;
/**
* The component server state
* @author jprovino
+ * @author Abhishek Upadhyay
*/
@XmlRootElement(name="audio-treatment-component")
@ServerState
@@ -35,6 +38,7 @@
public enum PlayWhen {
ALWAYS,
+ ON_LEFT_CLICK,
FIRST_IN_RANGE,
MANUAL
}
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioParticipantComponentMO.java
Wed Nov 11 23:41:19 2009 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioParticipantComponentMO.java
Fri Nov 21 10:39:57 2014 UTC
@@ -1,3 +1,6 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
/**
* Project Wonderland
*
@@ -17,55 +20,37 @@
*/
package org.jdesktop.wonderland.modules.audiomanager.server;
-import java.io.IOException;
-
-import java.util.ArrayList;
import java.util.logging.Logger;
import com.sun.sgs.app.AppContext;
import com.sun.sgs.app.ManagedReference;
-
-import org.jdesktop.wonderland.common.cell.CellChannelConnectionType;
import org.jdesktop.wonderland.common.cell.CallID;
import org.jdesktop.wonderland.common.cell.CellID;
import org.jdesktop.wonderland.common.cell.CellTransform;
import org.jdesktop.wonderland.common.cell.ClientCapabilities;
-
-
import org.jdesktop.wonderland.common.cell.messages.CellMessage;
-
import org.jdesktop.wonderland.common.cell.state.CellComponentServerState;
import org.jdesktop.wonderland.common.cell.state.CellComponentClientState;
-
import
org.jdesktop.wonderland.modules.audiomanager.common.AudioParticipantComponentClientState;
import
org.jdesktop.wonderland.modules.audiomanager.common.AudioParticipantComponentServerState;
-
-import org.jdesktop.wonderland.server.WonderlandContext;
-
import
org.jdesktop.wonderland.server.cell.AbstractComponentMessageReceiver;
import org.jdesktop.wonderland.server.cell.CellMO;
import org.jdesktop.wonderland.server.cell.CellComponentMO;
import org.jdesktop.wonderland.server.cell.ChannelComponentMO;
import org.jdesktop.wonderland.server.cell.TransformChangeListenerSrv;
-
import org.jdesktop.wonderland.server.comms.WonderlandClientID;
import org.jdesktop.wonderland.server.comms.WonderlandClientSender;
-
import com.sun.mpk20.voicelib.app.Player;
import com.sun.mpk20.voicelib.app.VoiceManager;
-
import com.jme.math.Vector3f;
-
-import com.sun.voip.client.connector.CallStatus;
-
import org.jdesktop.wonderland.modules.orb.server.cell.OrbCellMO;
-
import com.sun.voip.client.connector.CallStatusListener;
/**
*
* @author jprovino
+ * @author Abhishek Upadhyay
*/
public class AudioParticipantComponentMO extends CellComponentMO {
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioTreatmentComponentMO.java
Fri Jun 22 19:23:02 2012 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioTreatmentComponentMO.java
Fri Nov 21 10:39:57 2014 UTC
@@ -1,3 +1,6 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
/**
* Open Wonderland
*
@@ -40,61 +43,35 @@
import com.jme.bounding.BoundingSphere;
import com.jme.bounding.BoundingVolume;
import com.jme.bounding.OrientedBoundingBox;
-
import com.jme.math.Vector3f;
-
import com.sun.sgs.app.AppContext;
-import com.sun.sgs.app.DataManager;
import com.sun.sgs.app.ManagedReference;
-
-import com.sun.sgs.kernel.KernelRunnable;
-
-import com.sun.sgs.service.NonDurableTransactionParticipant;
-import com.sun.sgs.service.Transaction;
-
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.Serializable;
-
import java.net.MalformedURLException;
import java.net.URL;
-
-import java.util.Iterator;
-import java.util.Map;
import java.util.logging.Logger;
-
import org.jdesktop.wonderland.server.cell.annotation.UsesCellComponentMO;
-
import org.jdesktop.wonderland.common.cell.messages.CellMessage;
-
import org.jdesktop.wonderland.common.cell.state.CellComponentServerState;
-
import
org.jdesktop.wonderland.server.cell.AbstractComponentMessageReceiver;
-import org.jdesktop.wonderland.server.cell.CellComponentMO;
import org.jdesktop.wonderland.server.cell.CellMO;
import org.jdesktop.wonderland.server.cell.CellManagerMO;
import org.jdesktop.wonderland.server.cell.CellParentChangeListenerSrv;
import org.jdesktop.wonderland.server.cell.ChannelComponentMO;
import org.jdesktop.wonderland.server.cell.ProximityComponentMO;
-
-import
org.jdesktop.wonderland.modules.audiomanager.common.AudioManagerConnectionType;
import
org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentClientState;
import
org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState;
import
org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState.PlayWhen;
import
org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState.TreatmentType;
-
import
org.jdesktop.wonderland.modules.audiomanager.common.messages.AudioTreatmentDoneMessage;
import
org.jdesktop.wonderland.modules.audiomanager.common.messages.AudioTreatmentEndedMessage;
import
org.jdesktop.wonderland.modules.audiomanager.common.messages.AudioTreatmentEstablishedMessage;
import
org.jdesktop.wonderland.modules.audiomanager.common.messages.AudioTreatmentMenuChangeMessage;
import
org.jdesktop.wonderland.modules.audiomanager.common.messages.AudioTreatmentRequestMessage;
import
org.jdesktop.wonderland.modules.audiomanager.common.messages.AudioVolumeMessage;
-
-import org.jdesktop.wonderland.modules.presencemanager.common.PresenceInfo;
-
import com.sun.voip.client.connector.CallStatus;
-import com.sun.voip.client.connector.CallStatusListener;
-
import com.sun.mpk20.voicelib.app.Call;
import com.sun.mpk20.voicelib.app.AmbientSpatializer;
import com.sun.mpk20.voicelib.app.DefaultSpatializer;
@@ -110,21 +87,18 @@
import com.sun.mpk20.voicelib.app.VoiceManager;
import com.sun.mpk20.voicelib.app.VoiceManagerParameters;
import com.sun.sgs.app.Task;
-
import org.jdesktop.wonderland.common.cell.CallID;
import org.jdesktop.wonderland.common.cell.CellID;
import org.jdesktop.wonderland.common.cell.ClientCapabilities;
import org.jdesktop.wonderland.common.cell.state.CellComponentClientState;
-
-import org.jdesktop.wonderland.common.checksums.Checksum;
import org.jdesktop.wonderland.common.checksums.ChecksumList;
-import org.jdesktop.wonderland.server.WonderlandContext;
import org.jdesktop.wonderland.server.comms.WonderlandClientID;
import org.jdesktop.wonderland.server.comms.WonderlandClientSender;
/**
*
* @author jprovino
+ * @author Abhishek Upadhyay
*/
public class AudioTreatmentComponentMO extends AudioParticipantComponentMO
implements CellParentChangeListenerSrv, ManagedCallStatusListener {
@@ -150,6 +124,7 @@
private BoundingVolume audioBounds;
private boolean treatmentCreated = false;
+
/** the channel from that cell */
@UsesCellComponentMO(ChannelComponentMO.class)
@@ -229,6 +204,10 @@
public double getVolume() {
return volume;
}
+
+ public PlayWhen getPlayWhen() {
+ return playWhen;
+ }
@Override
public CellComponentServerState
getServerState(CellComponentServerState serverState) {
@@ -428,6 +407,7 @@
setup.treatment = treatment;
vm.addCallStatusListener(this, treatmentId);
+
if (setup.treatment == null || setup.treatment.length() == 0) {
logger.warning("Invalid treatment '" + setup.treatment
+ "'");
@@ -446,7 +426,7 @@
if (playWhen.equals(PlayWhen.ALWAYS) == false) {
setup.startPaused = true;
}
-
+
logger.info("Starting treatment " + setup.treatment + " at ("
+ setup.x
+ ":" + setup.y + ":" + setup.z + ")");
@@ -459,11 +439,10 @@
if (group != null) {
group.addTreatment(t);
}
-
+
if (playWhen.equals(PlayWhen.FIRST_IN_RANGE)) {
addProximityListener(t);
- }
-
+ }
treatmentCreated = true;
} catch (IOException e) {
logger.warning("Unable to create treatment " +
setup.treatment + e.getMessage());
@@ -565,7 +544,7 @@
audioBounds = new BoundingSphere((float) extent, new
Vector3f());
}
- double fullVolumeRadius = fullVolumeAreaPercent / 100. * extent;
+ double fullVolumeRadius = fullVolumeAreaPercent / 100. * (extent*1.5);
double falloff = .92 + ((50 - this.falloff) * ((1 - .92) / 50));
@@ -583,7 +562,7 @@
spatializer.setFullVolumeRadius(fullVolumeRadius);
- spatializer.setZeroVolumeRadius(extent);
+ spatializer.setZeroVolumeRadius(extent*1.5);
spatializer.setAttenuator(volume);
@@ -729,7 +708,7 @@
String callId = callStatus.getCallId();
if (callId == null) {
- logger.warning("No callId in callStatus: " + callStatus);
+ logger.fine("No callId in callStatus: " + callStatus);
return;
}
@@ -739,11 +718,16 @@
break;
case CallStatus.TREATMENTDONE:
-
logger.info("TREATMENT DONE, playOnce " + playOnce);
+ logger.warning("TREATMENT DONE, playOnce " + playOnce);
if (playOnce == true) {
channelRef.get().sendAll(null, new AudioTreatmentDoneMessage(cellID,
callId));
}
+
+ if(playWhen.equals(PlayWhen.FIRST_IN_RANGE)) {
+
((AudioTreatmentProximityListener)proximityListener.get()).setTreatmentDone(true);
+ }
+
break;
case CallStatus.ENDED:
@@ -758,7 +742,6 @@
public ComponentMessageReceiverImpl(CellMO cellMO) {
super(cellMO);
-
cellID = cellMO.getCellID();
}
@@ -785,6 +768,7 @@
if (msg.restartTreatment()) {
treatment.restart(msg.isPaused());
+
} else {
treatment.pause(msg.isPaused());
}
@@ -870,6 +854,7 @@
private void addProximityListener(Treatment treatment) {
// Fetch the proximity component, we will need this below. If it
does
// not exist (it should), then log an error
+ removeProximityListener();
ProximityComponentMO component =
cellRef.get().getComponent(ProximityComponentMO.class);
if (component == null) {
@@ -881,10 +866,12 @@
// We are making this component live, add a listener to the
proximity component.
BoundingVolume[] bounds = new BoundingVolume[1];
- bounds[0] = audioBounds;
+ BoundingVolume bs = new BoundingSphere((float) (extent*1.1) , new
Vector3f());
+
+ bounds[0] = bs;
AudioTreatmentProximityListener proximityListener =
- new AudioTreatmentProximityListener(cellRef.get(), treatment);
+ new AudioTreatmentProximityListener(cellRef, treatment);
this.proximityListener =
AppContext.getDataManager().createReference(proximityListener);
=======================================
---
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioTreatmentProximityListener.java
Mon Feb 22 10:03:31 2010 UTC
+++
/trunk/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioTreatmentProximityListener.java
Fri Nov 21 10:39:57 2014 UTC
@@ -1,3 +1,6 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
/**
* Project Wonderland
*
@@ -17,53 +20,37 @@
*/
package org.jdesktop.wonderland.modules.audiomanager.server;
-import org.jdesktop.wonderland.modules.presencemanager.common.PresenceInfo;
-
-import
org.jdesktop.wonderland.modules.audiomanager.common.messages.AudioTreatmentEnterExitMessage;
-
-import com.sun.mpk20.voicelib.app.AudioGroup;
-import com.sun.mpk20.voicelib.app.AudioGroupListener;
-import com.sun.mpk20.voicelib.app.AudioGroupPlayerInfo;
-import com.sun.mpk20.voicelib.app.AudioGroupSetup;
-import com.sun.mpk20.voicelib.app.DefaultSpatializer;
-import com.sun.mpk20.voicelib.app.FullVolumeSpatializer;
-import com.sun.mpk20.voicelib.app.Player;
import com.sun.mpk20.voicelib.app.Treatment;
import com.sun.mpk20.voicelib.app.VoiceManager;
import com.sun.sgs.app.AppContext;
import com.sun.sgs.app.ManagedObject;
import java.util.logging.Logger;
-import org.jdesktop.wonderland.common.cell.CallID;
-import org.jdesktop.wonderland.common.cell.CellChannelConnectionType;
import org.jdesktop.wonderland.common.cell.CellID;
-import org.jdesktop.wonderland.server.WonderlandContext;
import org.jdesktop.wonderland.server.cell.CellMO;
import org.jdesktop.wonderland.server.cell.ProximityListenerSrv;
-import org.jdesktop.wonderland.server.comms.WonderlandClientSender;
import com.jme.bounding.BoundingVolume;
-
-import
org.jdesktop.wonderland.modules.audiomanager.common.AudioManagerConnectionType;
+import com.sun.sgs.app.ManagedReference;
import java.io.Serializable;
+import
org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState.PlayWhen;
/**
* @author jprovino
+ * @author Abhishek Upadhyay
*/
-public class AudioTreatmentProximityListener implements
ProximityListenerSrv,
+public class AudioTreatmentProximityListener implements
ProximityListenerSrv,
ManagedObject, Serializable {
private static final Logger logger =
Logger.getLogger(AudioTreatmentProximityListener.class.getName());
- private CellID cellID;
- private String name;
private String treatmentId;
-
private int numberInRange;
+ private boolean treatmentDone = true;
+ private ManagedReference<CellMO> cellMO;
- public AudioTreatmentProximityListener(CellMO cellMO, Treatment
treatment) {
- cellID = cellMO.getCellID();
- name = cellMO.getName();
+ public AudioTreatmentProximityListener(ManagedReference<CellMO>
cellMO, Treatment treatment) {
+ this.cellMO = cellMO;
treatmentId = treatment.getId();
}
@@ -71,24 +58,29 @@
CellID viewCellID, BoundingVolume proximityVolume,
int proximityIndex) {
+ AudioTreatmentComponentMO atc =
cellMO.get().getComponent(AudioTreatmentComponentMO.class);
+ PlayWhen playWhen = atc.getPlayWhen();
+
logger.fine("viewEnterExit: " + entered + " cellID " + cellID
+ " viewCellID " + viewCellID);
- if (entered) {
- cellEntered();
- } else {
- cellExited();
- }
+ if(playWhen.equals(PlayWhen.FIRST_IN_RANGE)) {
+ if (entered) {
+ cellEntered();
+ } else {
+ cellExited();
+ }
+ }
}
public void cellEntered() {
numberInRange++;
- if (numberInRange > 1) {
- return;
- }
+// if (numberInRange > 1) {
+// return;
+// }
- logger.fine("Restarting treatment...");
+ logger.warning("Restarting treatment...");
Treatment treatment =
AppContext.getManager(VoiceManager.class).getTreatment(treatmentId);
@@ -97,8 +89,10 @@
return;
}
- //System.out.println("Cell entered, restarting input treatment " +
treatment);
- treatment.restart(false);
+ if(treatmentDone) {
+ treatment.restart(false);
+ treatmentDone = false;
+ }
}
public void cellExited() {
@@ -108,7 +102,7 @@
return;
}
- logger.fine("Pausing treatment...");
+ logger.warning("Pausing treatment...");
Treatment treatment =
AppContext.getManager(VoiceManager.class).getTreatment(treatmentId);
@@ -116,9 +110,19 @@
logger.warning("No treatment for " + treatmentId);
return;
}
+
+ treatmentDone = true;
+ treatment.restart(true);
+ }
- //System.out.println("Cell exited , pausing input treatment " +
treatment);
- treatment.restart(true);
+ public void setTreatmentDone(boolean td) {
+ this.treatmentDone = td;
+ }
+
+ public void stopTreatment() {
+ logger.warning("Pausing treatment...");
+ Treatment treatment =
AppContext.getManager(VoiceManager.class).getTreatment(treatmentId);
+ treatment.restart(true);
}
}
=======================================
--- /trunk/modules/tools/build.xml Mon Apr 30 21:51:31 2012 UTC
+++ /trunk/modules/tools/build.xml Fri Nov 21 10:39:57 2014 UTC
@@ -6,6 +6,7 @@
<!-- all projects -->
<filelist dir="${current.dir}" id="all.projects">
<file name="darkstar/build.xml"/>
+ <file name="capability-bridge/build.xml"/>
<file name="security-group/build.xml"/>
<file name="security-session-common/build.xml"/>
<file name="security-session-noauth/build.xml"/>
=======================================
--- /trunk/modules/tools/darkstar/web/WEB-INF/web.xml Wed Jan 20 22:38:27
2010 UTC
+++ /trunk/modules/tools/darkstar/web/WEB-INF/web.xml Fri Nov 21 10:39:57
2014 UTC
@@ -6,6 +6,14 @@
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
=======================================
--- /trunk/modules/tools/darkstar/webremote/WEB-INF/web.xml Wed Jan 20
22:38:27 2010 UTC
+++ /trunk/modules/tools/darkstar/webremote/WEB-INF/web.xml Fri Nov 21
10:39:57 2014 UTC
@@ -3,6 +3,14 @@
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
=======================================
--- /trunk/modules/tools/error-report/nbproject/project.xml Wed Mar 28
18:04:38 2012 UTC
+++ /trunk/modules/tools/error-report/nbproject/project.xml Fri Nov 21
10:39:57 2014 UTC
@@ -80,7 +80,7 @@
<java-data
xmlns="
http://www.netbeans.org/ns/freeform-project-java/1">
<compilation-unit>
<package-root>src/classes</package-root>
- <classpath
mode="compile">../../../core/build/lib/wonderland-client.jar:../../../core/build/lib/wonderland-common.jar:../../../core/build/lib/wonderland-server.jar:../../../core/ext/common/mtgame.jar:../../../core/ext/jme20/target/jme.jar:../../../web/lib/glassfish/glassfish-embedded-all-3.0-b74b.jar:../../../web/lib/restlib/jsr311-api-1.1.1.jar:../../../web/front/dist/wonderland-webadmin-core.jar:../../foundation/content-repository/build/lib/contentrepo-spi.jar:../../foundation/content-repository/build/client/contentrepo-client.jar</classpath>
+ <classpath
mode="compile">../../../core/build/lib/wonderland-client.jar;../../../core/build/lib/wonderland-common.jar;../../../core/build/lib/wonderland-server.jar;../../../core/ext/common/mtgame.jar;../../../core/ext/jme20/target/jme.jar;../../../web/lib/glassfish/glassfish-embedded-all-3.0-b74b.jar;../../../web/lib/restlib/jsr311-api-1.1.1.jar;../../../web/front/dist/wonderland-webadmin-core.jar;../../foundation/content-repository/build/lib/contentrepo-spi.jar;../../foundation/content-repository/build/client/contentrepo-client.jar</classpath>
<source-level>1.5</source-level>
</compilation-unit>
</java-data>
=======================================
--- /trunk/modules/tools/error-report/web/WEB-INF/web.xml Wed Mar 28
18:04:38 2012 UTC
+++ /trunk/modules/tools/error-report/web/WEB-INF/web.xml Fri Nov 21
10:39:57 2014 UTC
@@ -7,6 +7,14 @@
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
=======================================
--- /trunk/modules/tools/security-group/web/WEB-INF/web.xml Wed Jan 20
22:38:27 2010 UTC
+++ /trunk/modules/tools/security-group/web/WEB-INF/web.xml Fri Nov 21
10:39:57 2014 UTC
@@ -14,6 +14,14 @@
<param-name>unit:WonderlandGroupPU</param-name>
<param-value>persistence/wonderlanddb</param-value>
</init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
=======================================
--- /trunk/modules/tools/security-session-noauth/web/WEB-INF/web.xml Wed
Jan 20 22:38:27 2010 UTC
+++ /trunk/modules/tools/security-session-noauth/web/WEB-INF/web.xml Fri
Nov 21 10:39:57 2014 UTC
@@ -10,6 +10,14 @@
<param-name>unit:WonderlandGroupPU</param-name>
<param-value>persistence/wonderlandgroup</param-value>
</init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
=======================================
---
/trunk/modules/tools/server-manager/src/classes/org/jdesktop/wonderland/servermanager/server/ServerManagerConnectionHandler.java
Mon Mar 30 04:19:18 2009 UTC
+++
/trunk/modules/tools/server-manager/src/classes/org/jdesktop/wonderland/servermanager/server/ServerManagerConnectionHandler.java
Fri Nov 21 10:39:57 2014 UTC
@@ -22,8 +22,6 @@
import org.jdesktop.wonderland.common.comms.ConnectionType;
import org.jdesktop.wonderland.common.messages.Message;
import org.jdesktop.wonderland.common.security.Action;
-import org.jdesktop.wonderland.server.comms.ClientConnectionHandler;
-import com.sun.sgs.app.ClientSession;
import java.io.Serializable;
import java.util.logging.Logger;
import
org.jdesktop.wonderland.modules.security.server.service.GroupMemberResource;
=======================================
--- /trunk/modules/tools/server-manager/web/WEB-INF/web.xml Wed Jan 20
22:38:27 2010 UTC
+++ /trunk/modules/tools/server-manager/web/WEB-INF/web.xml Fri Nov 21
10:39:57 2014 UTC
@@ -6,6 +6,14 @@
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
=======================================
--- /trunk/modules/tools/snapshot-manager/web/WEB-INF/web.xml Tue Feb 28
00:22:24 2012 UTC
+++ /trunk/modules/tools/snapshot-manager/web/WEB-INF/web.xml Fri Nov 21
10:39:57 2014 UTC
@@ -10,6 +10,14 @@
<servlet>
<servlet-name>SnapshotResource</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
</servlet>
<servlet-mapping>
<servlet-name>SnapshotManager</servlet-name>
=======================================
---
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/UserListClientPlugin.java
Tue Sep 23 05:22:54 2014 UTC
+++
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/UserListClientPlugin.java
Fri Nov 21 10:39:57 2014 UTC
@@ -85,6 +85,12 @@
public void run() {
PresenceManager manager =
PresenceManagerFactory.getPresenceManager(session.getPrimarySession());
Cell cell =
ClientContextJME.getViewManager().getPrimaryViewCell();
+ while(manager==null) {
+ manager =
PresenceManagerFactory.getPresenceManager(session.getPrimarySession());
+ }
+ while(cell==null) {
+ cell =
ClientContextJME.getViewManager().getPrimaryViewCell();
+ }
PresenceInfo localPresenceInfo =
manager.getPresenceInfo(cell.getCellID());
while(localPresenceInfo==null) {
manager =
PresenceManagerFactory.getPresenceManager(session.getPrimarySession());
@@ -100,7 +106,6 @@
}
public void sessionCreated(WonderlandSession session) {
-
// LocalAvatar avatar = ((CellClientSession)
session).getLocalAvatar();
//
// avatar.addViewCellConfiguredListener(this);
=======================================
--- /trunk/web/asset/web/WEB-INF/web.xml Wed Jan 20 22:38:27 2010 UTC
+++ /trunk/web/asset/web/WEB-INF/web.xml Fri Nov 21 10:39:57 2014 UTC
@@ -3,6 +3,14 @@
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
=======================================
---
/trunk/web/checksums/src/java/org/jdesktop/wonderland/web/checksums/resources/GetModuleChecksumsResource.java
Mon Feb 22 10:09:50 2010 UTC
+++
/trunk/web/checksums/src/java/org/jdesktop/wonderland/web/checksums/resources/GetModuleChecksumsResource.java
Fri Nov 21 10:39:57 2014 UTC
@@ -62,7 +62,13 @@
@Path("/{assettype}")
public Response getChecksums(@PathParam("modulename") String
moduleName,
@PathParam("modulePart") String modulePart) {
+ ChecksumList checksumList = getChecksumList(moduleName,
modulePart);
+ ResponseBuilder rb = Response.ok(checksumList);
+ return rb.build();
+ }
+
+ private static ChecksumList getChecksumList(String moduleName, String
modulePart) {
// Fetch all of the module parts given the module name. This case
// handles if the module part is null (in which case all module
parts)
ChecksumManager checksumManager =
ChecksumManager.getChecksumManager();
@@ -87,9 +93,7 @@
checksumList.putChecksums(partList.getChecksumMap());
}
}
-
- ResponseBuilder rb = Response.ok(checksumList);
- return rb.build();
+ return checksumList;
}
@GET
=======================================
--- /trunk/web/checksums/web/WEB-INF/web.xml Wed Jan 20 22:38:27 2010 UTC
+++ /trunk/web/checksums/web/WEB-INF/web.xml Fri Nov 21 10:39:57 2014 UTC
@@ -3,6 +3,14 @@
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
=======================================
--- /trunk/web/front/web/WEB-INF/web.xml Tue Feb 28 00:47:45 2012 UTC
+++ /trunk/web/front/web/WEB-INF/web.xml Fri Nov 21 10:39:57 2014 UTC
@@ -19,6 +19,14 @@
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
=======================================
--- /trunk/web/help/web/WEB-INF/web.xml Wed Jan 20 22:38:27 2010 UTC
+++ /trunk/web/help/web/WEB-INF/web.xml Fri Nov 21 10:39:57 2014 UTC
@@ -3,6 +3,14 @@
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
+ <init-param>
+
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
+ </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
=======================================
---
/trunk/web/modules/src/java/org/jdesktop/wonderland/modules/service/resources/GetModuleListResource.java
Mon Feb 22 10:09:50 2010 UTC
+++
/trunk/web/modules/src/java/org/jdesktop/wonderland/modules/service/resources/GetModuleListResource.java
Fri Nov 21 10:39:57 2014 UTC
@@ -1,119 +0,0 @@
-/**
- * Project Wonderland
- *
- * Copyright (c) 2004-2010, Sun Microsystems, Inc., All Rights Reserved
- *
- * Redistributions in source code form must reproduce the above
- * copyright and this condition.
- *
- * The contents of this file are subject to the GNU General Public
- * License, Version 2 (the "License"); you may not use this file
- * except in compliance with the License. A copy of the License is
- * available at
http://www.opensource.org/licenses/gpl-license.php.
- *
- * Sun designates this particular file as subject to the "Classpath"
- * exception as provided by Sun in the License file that accompanied
- * this code.
- */
-package org.jdesktop.wonderland.modules.service.resources;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
-import org.jdesktop.wonderland.common.modules.ModuleInfo;
-import org.jdesktop.wonderland.common.modules.ModuleList;
-import org.jdesktop.wonderland.modules.Module;
-import org.jdesktop.wonderland.modules.service.DeployManager;
-import org.jdesktop.wonderland.modules.service.ModuleManager;
-
-/**
- * The GetModuleListResource class is a Jersey RESTful service that
returns the
- * ModuleInfo objects (contained within module.xml) of all modules in a
given
- * state.
- * <p>
- * The state can either be installed, pending, or uninstall
- *
- * @author Jordan Slott <
jsl...@dev.java.net>
- */
-@Path("/list/get/{state}")
-public class GetModuleListResource {
-
- /**
- * Returns a list of modules in a given state.
- * <p>
- *
/module/list/get/
http://localhost:8080/wonderland-web-modules/modules/list/get/installed{state}
- * <p>
- * where {state} is the state of the module, either pending,
installed, or
- * uninstall.
- * <p>
- * All spaces in the module name must be encoded to %20. Returns
BAD_REQUEST
- * to the HTTP connection if the module name is invalid or if there
was an
- * error encoding the module's information.
- *
- * @param state The desired state of the module
- * @return An XML encoding of the module's basic information
- */
- @GET
- @Produces({"application/xml", "application/json"})
- public Response getModuleList(@PathParam("state") String state) {
- ModuleManager manager = ModuleManager.getModuleManager();
- ModuleList moduleList = new ModuleList();
-
- /*
- * Check the state given, and fetch the modules. If the module
state is
- * invalid, return a BAD_REQUEST error. Otherwise fetch the module
list
- * according to the state and return a ModuleList object.
- */
- if (state == null) {
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
- else if (state.equals("installed") == true) {
- Map<String, Module> modules = manager.getInstalledModules();
-
- // sort in dependecy order
- List<String> ordered =
DeployManager.getDeploymentOrder(modules);
-
- // create the list of infos in the correct order
- Collection<ModuleInfo> list = new LinkedList();
- for (String moduleName : ordered) {
- Module module = modules.get(moduleName);
- list.add(module.getInfo());
- }
-
- moduleList.setModuleInfos(list.toArray(new ModuleInfo[] {}));
- return Response.ok(moduleList).build();
- }
- else if (state.equals("pending") == true) {
- Map<String, Module> modules = manager.getPendingModules();
- Collection<ModuleInfo> list = new LinkedList();
- Iterator<Map.Entry<String, Module>> it =
modules.entrySet().iterator();
- while (it.hasNext() == true) {
- Map.Entry<String, Module> entry = it.next();
- list.add(entry.getValue().getInfo());
- }
- moduleList.setModuleInfos(list.toArray(new ModuleInfo[] {}));
- return Response.ok(moduleList).build();
- }
- else if (state.equals("uninstall") == true) {
- Map<String, ModuleInfo> modules =
manager.getUninstallModuleInfos();
- Collection<ModuleInfo> list = new LinkedList();
- Iterator<Map.Entry<String, ModuleInfo>> it =
modules.entrySet().iterator();
- while (it.hasNext() == true) {
- Map.Entry<String, ModuleInfo> entry = it.next();
- list.add(entry.getValue());
- }
- moduleList.setModuleInfos(list.toArray(new ModuleInfo[] {}));
- return Response.ok(moduleList).build();
- }
- else {
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
- }
-}
=======================================
***Additional files exist in this changeset.***