Merge branch 'master_14.4.1' into asm_14.4.1

Former-commit-id: 8aa0a2a200 [formerly 8c72e62260026a2d1d2fb41839f1e79535b09b7f]
Former-commit-id: e8b40ad087
This commit is contained in:
Fay.Liang 2015-01-28 14:31:02 -05:00
commit c211279c0a
5208 changed files with 97964 additions and 499117 deletions

11
build/build.core/.project Normal file
View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>build.core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View file

@ -0,0 +1,108 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* POJO-based representation of the contents of an Eclipse feature file.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
class Feature
{
private String feature
private String featureDirectory
/*
* The first iteration of the build will assume that when includes
* are present, there will not be any plugins or dependencies
* because we will be working with the product feature
*/
private List includesList
private List dependenciesList
private List pluginsList
public Feature(String feature, String featureDirectory)
{
this.feature = feature
this.featureDirectory = featureDirectory
this.includesList = []
this.dependenciesList = []
this.pluginsList = []
}
public String getFeature()
{
return this.feature
}
public String getFeatureDirectory()
{
return this.featureDirectory
}
public void addInclude(String includedFeature)
{
this.includesList.add(includedFeature)
}
public List getIncludes()
{
return this.includesList
}
public boolean hasIncludes()
{
return this.includesList.size() > 0
}
public void addDependency(String dependency)
{
this.dependenciesList.add(dependency)
}
public List getDependencies()
{
return this.dependenciesList
}
public boolean hasDependencies()
{
return this.dependenciesList.size() > 0
}
public void addPlugin(String plugin)
{
this.pluginsList.add(plugin)
}
public List getPlugins()
{
return this.pluginsList
}
}

View file

@ -0,0 +1,52 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* Parses an Eclipse feature file (feature.xml) and returns a POJO representation
* of the contents of the feature file.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
class FeatureParser
{
public static Feature parseFeature(String featureFile, String featureDirectory)
{
Feature feature = new Feature(featureFile, featureDirectory)
def featureXML = new XmlSlurper().parse(new File(featureFile))
featureXML.includes.each {feature.addInclude(it.attributes().id)}
featureXML.requires.import.each {feature.addDependency(it.attributes().feature)}
featureXML.plugin.each {feature.addPlugin(it.attributes().id)}
return feature
}
}

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>deploy.edex</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View file

@ -0,0 +1,51 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* Abstraction of a customized plugin deployer that provides access
* to a pre-configured groovy Ant Builder.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
abstract class AbstractAntBasedPluginCustomDeployer
implements IPluginCustomDeployer
{
protected AntBuilder ant
protected AbstractAntBasedPluginCustomDeployer()
{
this.ant = new AntBuilder()
// disable ant logging - based on:
// http://stackoverflow.com/questions/15143221/enable-verbose-output-from-groovys-antbuilder
this.ant.project.getBuildListeners().firstElement().setMessageOutputLevel(0)
}
}

View file

@ -0,0 +1,72 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* Abstraction of a customized plugin deployer that deploys
* plugin-specific files and directories that exist outside
* of the Java src directory. Files are deployed from
* the specified externalDirectory in the plugin (if it exists) to the
* specified destinationDirectoryTree located beneath the root edex directory.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
abstract class AbstractExternalPluginFilesDeployer
extends AbstractAntBasedPluginCustomDeployer {
private String externalDirectory
private String destinationDirectoryTree
protected AbstractExternalPluginFilesDeployer(String externalDirectory, String destinationDirectoryTree) {
super()
this.externalDirectory = externalDirectory
this.destinationDirectoryTree = destinationDirectoryTree
}
// Add plugin name if we want to add logging to this capability
protected void deployExternalFilesystem(String edexRootDirectory, String pluginFullPath)
{
String fullPluginExternalPath = pluginFullPath + File.separator + this.externalDirectory
// ensure that this plugin has an external directory
if (new File(fullPluginExternalPath).exists() == false)
{
return
}
String fullDestinationPath = edexRootDirectory + File.separator +
this.destinationDirectoryTree + File.separator + this.externalDirectory
// ensure that the destination directory exists
new File(fullDestinationPath).mkdirs()
// copy the files
ant.copy( todir : fullDestinationPath, overwrite : true )
{ fileset( dir : fullPluginExternalPath ) }
}
}

View file

@ -0,0 +1,61 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* Searches for and runs custom plugin-specific groovy scripts named plugin-deploy.groovy
* located directly within the plugin directory. The requirement is that the custom
* plugin deployments must only deploy files to a location relative to the EDEX root directory.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
class CustomDeploymentRunner
implements IPluginCustomDeployer {
private static final String PLUGIN_GROOVY_SCRIPT = "plugin-deploy.groovy"
private static final String BINDING_EDEX_ROOT = "__EDEX_ROOT__"
private static final String BINDING_PLUGIN = "__PLUGIN__"
private static final String BINDING_PLUGIN_PATH = "__PLUGIN_PATH__"
public void deploy(String edexRootDirectory, String plugin, String pluginFullPath) {
File groovyScript = new File(pluginFullPath + File.separator + PLUGIN_GROOVY_SCRIPT)
if (groovyScript.exists() == false) {
return
}
Binding binding = new Binding()
binding.setVariable(BINDING_EDEX_ROOT, edexRootDirectory)
binding.setVariable(BINDING_PLUGIN, plugin)
binding.setVariable(BINDING_PLUGIN_PATH, pluginFullPath)
def groovyShell = new GroovyShell(binding)
groovyShell.run(groovyScript)
}
}

View file

@ -0,0 +1,120 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
import groovy.util.logging.*
/**
* Deploys the EDEX esb scripts, libraries, and other files.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
@Log
class DeployESB
{
private static final String SETUP_ENV = "setup.env"
private DeployESB()
{
}
public static void deploy(String edexRootDirectory, String esbDirectory, String overrideArchitecture)
{
if (new File(esbDirectory).exists() == false)
{
log.log(java.util.logging.Level.SEVERE,
"The specified esb directory does not exist - " + esbDirectory)
System.exit(-1)
}
new File(edexRootDirectory).mkdirs()
// deploy the ESB directory structure.
AntBuilder ant = new AntBuilder()
ant.project.getBuildListeners().firstElement().setMessageOutputLevel(0)
log.info "Deploying ESB ..."
ant.copy( todir : edexRootDirectory,
overwrite : true )
{
fileset( dir : esbDirectory )
}
// remove setup.env
new File(edexRootDirectory + File.separator + "bin" + File.separator + SETUP_ENV).delete()
// remove lib_illusion
new File(edexRootDirectory + File.separator + "lib" + File.separator + "lib_illusion").deleteDir()
// copy the correct lib_illusion based on architecture
// determine architecture?
// since this is only a temporary consideration since we will eventually be switching to a 64-bit
// EDEX, we will just look at the OS architecture since the JDK does not provide a simple way
// to retrieve the required information about the JVM process, itself. The -Darchitecture argument
// can be used to override the dynamically determined architecture
String architecture = overrideArchitecture
if (architecture == "")
{
architecture =
(System.getProperty("os.arch") == "amd64") ? "x86_64" : "x86"
}
String esbLibIllusionPath = esbDirectory + File.separator + "lib" + File.separator +
"lib_illusion" + File.separator + architecture
if (new File(esbLibIllusionPath).exists() == false)
{
log.log(java.util.logging.Level.SEVERE,
"Unable to find the illusion lib associated with architecture - " + architecture)
System.exit(-1)
}
String libIllusionDestination = edexRootDirectory + File.separator +
"lib" + File.separator + "lib_illusion"
new File(libIllusionDestination).mkdirs()
ant.copy( todir : libIllusionDestination, overwrite : true )
{
fileset( dir : esbLibIllusionPath )
}
}
public static void deployEdexConfiguration(String edexRootDirectory, String esbDirectory)
{
final String setupEnvSrc = esbDirectory + File.separator + "bin" + File.separator + SETUP_ENV
final String destinationDirectory = edexRootDirectory + File.separator + "bin"
AntBuilder ant = new AntBuilder()
ant.project.getBuildListeners().firstElement().setMessageOutputLevel(0)
ant.copy( todir : destinationDirectory,
overwrite : true )
{
fileset( file : setupEnvSrc )
}
}
}

View file

@ -0,0 +1,53 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* Deploys plugin-provided localization files.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
class DeployEdexLocalization
extends AbstractExternalPluginFilesDeployer
{
private static final String destinationDirectory = "utility"
private static final String destinationDirectoryTree = "data"
public DeployEdexLocalization()
{
super(destinationDirectory, destinationDirectoryTree)
}
public void deploy(String edexRootDirectory, String plugin, String pluginFullPath)
{
super.deployExternalFilesystem(edexRootDirectory, pluginFullPath)
}
}

View file

@ -0,0 +1,53 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* Deploys plugin-provided resource (properties) files.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
class DeployEdexResources
extends AbstractExternalPluginFilesDeployer
{
private static final String destinationDirectory = "resources"
private static final String destinationDirectoryTree = "conf"
public DeployEdexResources()
{
super(destinationDirectory, destinationDirectoryTree)
}
public void deploy(String edexRootDirectory, String plugin, String pluginFullPath)
{
super.deployExternalFilesystem(edexRootDirectory, pluginFullPath)
}
}

View file

@ -0,0 +1,73 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
import groovy.util.logging.*
import ProjectInformation
/**
* Deploys the sample EDEX localization files when requested.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
@Log
class DeployEdexSiteLocalization
{
private static final String EDEX_LOCALIZATION_DIRECTORY = "data" + File.separator +
"utility"
private DeployEdexSiteLocalization()
{
}
public static void deploy(String edexRootDirectory, ProjectInformation projectInformation, String site)
{
if (projectInformation == null)
{
log.log(java.util.logging.Level.WARNING,
"Unable to find the localization project associated with site " + site +
"; skipping localization deployment")
return
}
String localizationDestination = edexRootDirectory + File.separator + EDEX_LOCALIZATION_DIRECTORY
new File(localizationDestination).mkdirs()
AntBuilder ant = new AntBuilder()
ant.project.getBuildListeners().firstElement().setMessageOutputLevel(0)
log.info "Deploying localization for site ... " + site
ant.copy( todir : localizationDestination, overwrite : true )
{
fileset( dir : projectInformation.projectFullLocation + File.separator + "utility" )
}
}
}

View file

@ -0,0 +1,55 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
import java.io.File
/**
* Deploys plugin-provided EDEX mode files.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
class DeployModes
extends AbstractExternalPluginFilesDeployer
{
private static final String destinationDirectory = 'modes'
private static final String destinationDirectoryTree = 'conf'
public DeployModes()
{
super(destinationDirectory, destinationDirectoryTree)
}
public void deploy(String edexRootDirectory, String plugin, String pluginFullPath)
{
super.deployExternalFilesystem(edexRootDirectory, pluginFullPath)
}
}

View file

@ -0,0 +1,118 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
import groovy.util.logging.*
import java.util.regex.Pattern
import java.util.regex.Matcher
import ProjectInformation
/**
* Deploys the Raytheon-maintained Python Packages when requested.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
@Log
class DeployPythonPackages {
private static final String PYTHON_VERSION_PATTERN_STRING = "python([0-9].+)"
private static final Pattern pythonVersionPattern =
Pattern.compile(PYTHON_VERSION_PATTERN_STRING)
private DeployPythonPackages() {
}
public static deploy(String pythonRootDirectory, ProjectInformation projectInformation,
String[] pythonPackagesToDeploy) {
if (projectInformation == null) {
log.log(java.util.logging.Level.WARNING,
"Unable to find pythonPackages in the workspace; skipping python deployment")
return
}
if (pythonPackagesToDeploy.length == 0) {
log.info "No python packages have been specified for deployment; skipping python deployment."
return
}
// determine what the python version directory is
// loop through all directories in the python lib directory; attempt to find
// the one that matches our pattern
final String pythonLibDirectory = pythonRootDirectory + File.separator + "lib"
String pythonVersion = null
for (String libFile : new File(pythonLibDirectory).list())
{
Matcher matcher = pythonVersionPattern.matcher(libFile)
if (matcher.matches())
{
pythonVersion = matcher.group(1)
}
}
if (pythonVersion == null)
{
log.log(java.util.logging.Level.SEVERE,
"Unable to find the python version directory in " + pythonLibDirectory)
System.exit(-1)
}
AntBuilder ant = new AntBuilder()
ant.project.getBuildListeners().firstElement().setMessageOutputLevel(0)
log.info "Deploying pythonPackages ..."
final String pythonSitePackagesDirectory = pythonLibDirectory + File.separator +
"python" + pythonVersion + File.separator + "site-packages"
for (String pythonPackage : pythonPackagesToDeploy)
{
String pythonPackageDirectory = projectInformation.projectFullLocation + File.separator + pythonPackage
if (pythonPackage == "pypies")
{
// special case for pypies
pythonPackageDirectory += File.separator + "pypies"
}
if (new File(pythonPackageDirectory).exists() == false)
{
log.log(java.util.logging.Level.WARNING,
"Unable to find the " + pythonPackage + " python package in the workspace")
continue
}
String pythonPackageDestination = pythonSitePackagesDirectory + File.separator +
pythonPackage
log.info "Deploying pythonPackage ... " + pythonPackage
// Remove the existing deployment
new File(pythonPackageDestination).deleteDir()
// Create an empty destination directory
new File(pythonPackageDestination).mkdirs()
ant.copy( todir : pythonPackageDestination )
{ fileset( dir : pythonPackageDirectory ) }
}
}
}

View file

@ -0,0 +1,119 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
import groovy.util.logging.*
import IPluginCustomDeployer
/**
* Deploys plugin-provided web applications as war files.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
@Log
class DeployWeb
extends AbstractAntBasedPluginCustomDeployer
{
private final String WEB_XML_PATH = "web" + File.separator + "WEB-INF" + File.separator + "web.xml"
public DeployWeb()
{
super()
}
public void deploy(String edexRootDirectory, String plugin, String pluginFullPath)
{
final String edexWebappsDirectory = edexRootDirectory + File.separator + "webapps"
// determine if the plugin encapsulates a web application
final String expectedWebXMLPath = pluginFullPath + File.separator + WEB_XML_PATH
if (new File(expectedWebXMLPath).exists() == false)
{
// no web application
return
}
String webAppRootKey = this.getWebAppRootKey(expectedWebXMLPath)
if (webAppRootKey == null)
{
log.log(java.util.logging.Level.WARNING,
"webAppRootKey not specified in web.xml for plugin - " + plugin + "; skipping web app deployment")
return
}
log.info "Deploying Web Application associated with plugin ... " + plugin
final String warFile = edexWebappsDirectory + File.separator + webAppRootKey + ".war"
final String unwarDirectory = edexWebappsDirectory + File.separator + webAppRootKey
this.cleanup(edexWebappsDirectory, warFile, unwarDirectory)
// produce the war file
this.ant.war( destfile : warFile,
webxml : expectedWebXMLPath )
{
fileset( dir : pluginFullPath + File.separator + "web",
excludes : "WEB-INF" + File.separator )
classes( dir : pluginFullPath + File.separator + "web" + File.separator +
"WEB-INF" + File.separator + "classes" )
webinf ( file : pluginFullPath + File.separator + "web" + File.separator +
"WEB-INF" + File.separator + "dwr.xml" )
}
// finally, unwar the war file
this.ant.unzip( src : warFile,
dest : unwarDirectory )
new File(warFile).delete()
}
private String getWebAppRootKey(String webXMLFile)
{
String webAppRootKey = null
def webXML = new XmlSlurper().parse(new File(webXMLFile))
webXML.'context-param'.each
{
String paramName = it.'param-name'.toString()
if (paramName == "webAppRootKey")
{
webAppRootKey = it.'param-value'.toString()
}
}
return webAppRootKey
}
private void cleanup(String edexWebappsDirectory, String warFile, String webAppDirectory)
{
// cleanup any previous deployments
new File(warFile).delete()
new File(webAppDirectory).deleteDir()
}
}

View file

@ -0,0 +1,42 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* Defines a customized plugin deployer. Customized Plugin deployers are
* used to deploy additional plugin-specific files that exist outside
* of a standard Java build.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
interface IPluginCustomDeployer {
void deploy(String edexRootDirectory, String plugin, String pluginFullPath)
}

View file

@ -0,0 +1,54 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* POJO representation of projects discovered in the Eclipse workspace.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
class ProjectInformation
{
// the name of the project as it is known to Eclipse
public String project
// the name of the project directory
// in most cases (not all) this will be the same as the project name
public String projectDirectory
// the full path to the plugin
public String projectFullLocation
public ProjectInformation()
{
this.project = null
this.projectDirectory = null
this.projectFullLocation = null
}
}

View file

@ -0,0 +1,15 @@
Run deploy-install.xml to execute the new groovy-based deployment mechanism.
The mechanism will need to remain ant-wrapped until the Groovy plugins are added
to the uframe Eclipse distribution.
One argument is required to run the script: -Dworkspace_loc=${workspace_loc}
Note: ENTER THE ARGUMENT EXACTLY AS IT IS WRITTEN ABOVE. ${workspace_loc} is
an Eclipse variable that references the actual location of the workspace.
deploy-install will deploy any EDEX features it finds in the workspace excluding:
com.raytheon.edex.wa.feature and com.raytheon.edex.feature.uframe
Currently, an EDEX feature is defined as a feature project that includes edex in
the name. Feature deployment options will most likely be more customizable when
the pure groovy version of this deployment can be used.

View file

@ -0,0 +1,563 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
import groovy.util.logging.*
import ProjectInformation
import Feature
import FeatureParser
import java.util.Properties
import java.util.List
import java.util.ArrayList
import java.util.regex.Matcher
import java.util.regex.Pattern
import DeployESB
import DeployPythonPackages
import DeployEdexSiteLocalization
import IPluginCustomDeployer
/**
* Initial version of the deploy-install driver. Temporarily
* wrapped by and executed by an ant script until the Groovy
* plugins become a standard part of the uframe Eclipse distribution.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
*
* </pre>
*
* @author bkowal
* @version 1.0
*/
@Log
class DeployInstall
{
private static final String edexFeatureRegex = '^.*\\.edex\\..*\\.feature$'
private static final Pattern EDEX_FEATURE_PATTERN =
Pattern.compile(edexFeatureRegex)
// temporarily have to declare and add this feature to the list of deployed features
// manually. there are improvements that can be made in 15.1.
private static final String COMMON_BASE_FEATURE = "com.raytheon.uf.common.base.feature"
// temporary. maintain backwards compatibility until baseline cleanup
private final List<String> blacklistedEdexFeatures
private projectInformationMap = [:]
private List<String> edexFeaturesToDeploy
private String edexRootDirectory
private String[] localizationSitesToDeploy = []
private boolean deployPythonPackages
private String pythonRootDirectory
private String[] pythonPackagesToDeploy = []
private String architecture
private List<IPluginCustomDeployer> customPluginDeployers
// a list of features that have been deployed to ensure that a feature is not deployed
// more than once.
private List featuresDeployed = []
// a list of the plugins that we will be deploying.
private List pluginsToDeploy = []
// used to track which feature a plugin was discovered in; will be used to
// verify that a plugin is not listed in more than one feature.
private pluginToFeatureMap = [:]
public DeployInstall(final String workspaceDirectory,
final String localizationSites, final boolean deployPythonPackages,
final String edexRootDirectory, final String pythonRootDirectory, final String pythonPackages,
final String architecture)
{
blacklistedEdexFeatures = new ArrayList<String>()
// never deploy these features
blacklistedEdexFeatures.add("com.raytheon.edex.wa.feature")
blacklistedEdexFeatures.add("com.raytheon.edex.feature.uframe")
this.init(workspaceDirectory.trim())
if (localizationSites.trim() != "")
{
this.localizationSitesToDeploy = localizationSites.trim().split(":")
}
this.deployPythonPackages = deployPythonPackages
this.edexRootDirectory = edexRootDirectory.trim()
this.pythonRootDirectory = pythonRootDirectory.trim()
if (pythonPackages.trim() != "")
{
this.pythonPackagesToDeploy = pythonPackages.trim().split(":")
}
this.architecture = architecture.trim()
}
public void deploy()
{
// recursively build the list of plugins that will be deployed.
for (String featureToDeploy : edexFeaturesToDeploy)
{
this.buildPluginList(featureToDeploy)
}
log.info "Found " + this.pluginsToDeploy.size() + " Plugins To Deploy."
this.cleanup()
this.deployPlugins()
// complete the esb deployment
// we need to determine the location of the build.edex project
ProjectInformation projectInformation = this.projectInformationMap["build.edex"]
if (projectInformation == null)
{
log.log(java.util.logging.Level.SEVERE,
"Unable to find project - build.edex")
System.exit(-1)
}
final String esbDirectory = projectInformation.projectFullLocation + File.separator + "esb"
DeployESB.deploy(this.edexRootDirectory, esbDirectory, this.architecture)
DeployESB.deployEdexConfiguration(this.edexRootDirectory, esbDirectory)
if (this.deployPythonPackages)
{
DeployPythonPackages.deploy(this.pythonRootDirectory,
this.projectInformationMap["pythonPackages"], this.pythonPackagesToDeploy)
}
if (this.localizationSitesToDeploy.length > 0)
{
for (String localizationSite : this.localizationSitesToDeploy)
{
String localizationProject = "localization." + localizationSite
DeployEdexSiteLocalization.deploy(this.edexRootDirectory,
this.projectInformationMap[localizationProject], localizationSite)
}
}
}
// remove the existing deployment
private void cleanup()
{
// remove the contents of the edex lib directory (execluding native)
log.info "Cleaning EDEX lib directory ..."
final String EDEX_LIB_DIRECTORY = this.edexRootDirectory + File.separator + "lib"
for (File file : new File(EDEX_LIB_DIRECTORY).listFiles())
{
if (file.getName() == "native")
{
continue
}
file.deleteDir()
}
// remove the shell scripts and the yajsw sub-directory from the edex bin directory
log.info "Cleaning EDEX bin directory ..."
final String EDEX_BIN_DIRECTORY = this.edexRootDirectory + File.separator + "bin"
for (File file : new File(EDEX_BIN_DIRECTORY).listFiles())
{
if (file.getName() == "yajsw")
{
file.deleteDir()
}
// we really should be checking the file extension here instead of just doing a
// basic String comparison
if (file.getName().endsWith(".sh") || file.getName() == "setup.env")
{
file.delete()
}
}
// remove the contents of the edex conf directory
log.info "Cleaning EDEX conf directory ..."
final String EDEX_CONF_DIRECTORY = this.edexRootDirectory + File.separator + "conf"
for (File file : new File(EDEX_CONF_DIRECTORY).listFiles())
{
if (file.isDirectory())
{
file.deleteDir()
}
else
{
file.delete()
}
}
}
private void deployPlugins()
{
// we will need ant to complete this
AntBuilder ant = new AntBuilder()
ant.project.getBuildListeners().firstElement().setMessageOutputLevel(0)
log.info "Deploying plugins ..."
for (String plugin : this.pluginsToDeploy)
{
this.deployPlugin(plugin, ant)
}
}
// FOSS plugins are plugins that include jar files.
private boolean isFOSSPlugin(ProjectInformation projectInformation)
{
final String jarSuffix = ".jar"
// loop through the files in the plugin directory; true if a single
// jar file is found.
for (String pluginFile : new File(projectInformation.projectFullLocation).listFiles())
{
if (pluginFile.endsWith(".jar"))
{
return true
}
}
return false
}
private void deployPlugin(String plugin, AntBuilder ant)
{
// first, attempt to find the plugin in the plugin map
ProjectInformation projectInformation = this.projectInformationMap[plugin]
if (projectInformation == null)
{
log.log(java.util.logging.Level.SEVERE,
"Unable to find plugin - " + plugin)
System.exit(-1)
}
// next, attempt to access the build.properties file for the plugin
final String PLUGIN_BUILD_PROPERTIES = projectInformation.projectFullLocation + File.separator +
"build.properties"
if (new File(PLUGIN_BUILD_PROPERTIES).exists() == false)
{
log.log(java.util.logging.Level.SEVERE,
"Unable to find the build.properties file for plugin - " + plugin)
System.exit(-1)
}
log.info "Deploying plugin ... " + plugin
// read the plugin build.properties file
BufferedReader br =
new BufferedReader(new FileReader(PLUGIN_BUILD_PROPERTIES))
Properties properties = new Properties()
properties.load(br)
final String output = properties.getProperty("output..")
final String binIncludes = properties.getProperty("bin.includes")
if (output == null)
{
// we will not be producing a jar file and are most likely deploying a FOSS plugin
this.deployFOSSPlugin(projectInformation, binIncludes, ant)
return
}
// jar the plugin
final String pluginJarName = plugin + ".jar"
final String edexLibPlugins = this.edexRootDirectory + File.separator + "lib" + File.separator +
"plugins"
new File(edexLibPlugins).mkdirs()
final String fullJarPath = edexLibPlugins + File.separator + pluginJarName
ant.jar( destfile : fullJarPath,
manifest : projectInformation.projectFullLocation + File.separator + "META-INF" +
File.separator + "MANIFEST.MF" )
{
fileset( dir : projectInformation.projectFullLocation + File.separator + output )
}
// is the plugin FOSS?
if (this.isFOSSPlugin(projectInformation))
{
this.deployFOSSPlugin(projectInformation, binIncludes, ant)
return
}
// finish the plugin based on build.properties
for (String binInclude : binIncludes.split(","))
{
binInclude = binInclude.trim()
if (binInclude == ".")
{
continue
}
// ensure that the artifact exists
final String artifact = projectInformation.projectFullLocation + File.separator + binInclude
if (new File(artifact).exists() == false)
{
log.log(java.util.logging.Level.SEVERE,
artifact + " specified in build.properties for plugin " + projectInformation.project + " was not found")
System.exit(-1)
}
// add the artifact to the jar
if (new File(artifact).isDirectory())
{
ant.jar( destfile : fullJarPath,
update : true )
{
fileset( dir : projectInformation.projectFullLocation,
includes : binInclude )
}
}
else
{
ant.jar( destfile : fullJarPath,
update : true )
{
fileset( file : artifact )
}
}
}
// run "custom" deployment steps
for (IPluginCustomDeployer pluginCustomDeployer : this.customPluginDeployers)
{
pluginCustomDeployer.deploy(this.edexRootDirectory, projectInformation.project,
projectInformation.projectFullLocation)
}
}
private void deployFOSSPlugin(ProjectInformation projectInformation, String binIncludes, AntBuilder ant)
{
final String edexLibDependencies = this.edexRootDirectory + File.separator + "lib" + File.separator +
"dependencies" + File.separator + projectInformation.project
// create the destination directory
new File(edexLibDependencies).mkdirs()
for (String binInclude : binIncludes.split(","))
{
binInclude = binInclude.trim()
if (binInclude == ".")
{
continue
}
// ensure that the artifact exists
final String artifact = projectInformation.projectFullLocation + File.separator + binInclude
if (new File(artifact).exists() == false)
{
log.log(java.util.logging.Level.SEVERE,
artifact + " specified in build.properties for plugin " + projectInformation.project + " was not found")
System.exit(-1)
}
if (new File(artifact).isDirectory())
{
ant.copy( todir : edexLibDependencies )
{
fileset( dir : artifact )
}
}
else
{
ant.copy( todir : edexLibDependencies, file : artifact )
}
}
}
private void buildPluginList(String featureName)
{
if (this.featuresDeployed.contains(featureName))
{
log.log(java.util.logging.Level.WARNING,
"Feature " + featureName + " has been included more than once; skipping the duplicate.")
return
}
log.info "Analyzing feature ... " + featureName
// first, attempt to find the feature in the project map
ProjectInformation projectInformation = this.projectInformationMap[featureName]
// verify that the feature exists
if (projectInformation == null)
{
log.log(java.util.logging.Level.SEVERE,
"Unable to find the specified feature - " + featureName)
System.exit(-1)
}
final String featureFullPath = projectInformation.projectFullLocation + File.separator + "feature.xml"
// verify that the feature exists
if (new File(featureFullPath).exists() == false)
{
log.log(java.util.logging.Level.SEVERE,
"Unable to find the specified feature - " + featureName + "; '" + featureFullPath + "' does not exist")
System.exit(-1)
}
Feature feature = FeatureParser.parseFeature(featureFullPath, featureName)
// first, process any features that the feature includes
for (String featureInclude : feature.getIncludes())
{
this.buildPluginList(featureInclude)
}
// should we also check dependencies?
// complete an initial analysis of the plugins that we will be deploying
for (String plugin : feature.getPlugins())
{
final String featureWithPlugin = this.pluginToFeatureMap[plugin]
if (featureWithPlugin == null)
{
// we have not seen this plugin yet
this.pluginToFeatureMap[plugin] = featureName
}
else
{
// we have seen this plugin before, verify that the plugin
// is not in more than one feature
if (featureWithPlugin != featureName)
{
log.log(java.util.logging.Level.SEVERE,
"Plugin is listed in more than one feature - " + featureWithPlugin + " AND " + featureName)
}
}
if (this.pluginsToDeploy.contains(plugin) == false)
{
this.pluginsToDeploy.add(plugin)
}
}
}
private void init(final String workspaceDirectory)
{
this.edexFeaturesToDeploy = new ArrayList<String>()
final String metadataProjectsDirectory = workspaceDirectory + File.separator +
".metadata" + File.separator + ".plugins" + File.separator + "org.eclipse.core.resources" +
File.separator + ".projects"
for (String project : new File(metadataProjectsDirectory).list())
{
// determine if the project is an EDEX feature.
Matcher matcher = EDEX_FEATURE_PATTERN.matcher(project)
if (matcher.matches() || project == COMMON_BASE_FEATURE)
{
// this is an EDEX feature.
if (blacklistedEdexFeatures.contains(project) == false)
{
this.edexFeaturesToDeploy.add(project)
log.log(java.util.logging.Level.INFO, 'Found EDEX Feature: ' + project)
}
}
final String expectedLocationFile = metadataProjectsDirectory +
File.separator + project + File.separator + ".location"
if (new File(expectedLocationFile).exists())
{
this.catalogProject(expectedLocationFile)
}
}
/*
* previously this was dynamically loaded via spring. However, spring
* was removed from groovy.
*/
this.customPluginDeployers = new ArrayList<IPluginCustomDeployer>()
this.customPluginDeployers.add(new DeployWeb())
this.customPluginDeployers.add(new DeployEdexLocalization())
this.customPluginDeployers.add(new DeployEdexResources())
this.customPluginDeployers.add(new CustomDeploymentRunner())
this.customPluginDeployers.add(new DeployModes())
}
private void catalogProject(String locationFile)
{
byte[] contents = new File(locationFile).getBytes()
final String FILE_ = "file:"
StringBuilder stringBuilder = new StringBuilder()
boolean buildLocationString = false
for (int i = 0; i < contents.length; i++)
{
if (contents[i] < 0 || contents[i] > 127)
{
continue
}
if (buildLocationString)
{
if (contents[i] == 0)
{
// the end of the file path (ideally).
break
}
char c = (char) contents[i]
stringBuilder.append(c)
}
else
{
// first: we want to find the letter 'f'
char c = (char) contents[i]
if ( c == 'f')
{
stringBuilder.append(c)
// we have found 'f'; determine if we have found "file:"
int counter = 0
while (counter < 4)
{
++i
c = (char) contents[i]
stringBuilder.append(c)
++counter
}
if (FILE_ == stringBuilder.toString())
{
buildLocationString = true
}
stringBuilder = new StringBuilder()
}
}
}
String projectLocationString = stringBuilder.toString()
// get the .project file
File projectMetadataFile =
new File(projectLocationString + File.separator + ".project")
// ensure that the project metadata file actually exists
if (projectMetadataFile.exists() == false)
{
return
}
// read the file
def projectMetadataXML = new XmlSlurper().parse(projectMetadataFile)
// extract the plugin name (as Eclipse sees it)
final String projectName = projectMetadataXML.name
ProjectInformation projectInformation = new ProjectInformation()
projectInformation.project = projectName
projectInformation.projectDirectory = new File(projectLocationString).getName()
projectInformation.projectFullLocation = projectLocationString
this.projectInformationMap[projectName] = projectInformation
}
}
DeployInstall deployInstall =
new DeployInstall(args[0], args[1], Boolean.parseBoolean(args[2]),
args[3], args[4], args[5], args[6])
deployInstall.deploy()

View file

@ -0,0 +1,79 @@
<project default="main" basedir=".">
<property name="localization.sites" value="" />
<property name="deploy.python" value="true" />
<!--
The python packages to deploy - provided that
deploy.python is true
-->
<property name="python.packages"
value="pypies:ufpy:dynamicserialize" />
<!-- EDEX root directory - defaults to /awips2/edex -->
<property name="edex.root" value="/awips2/edex" />
<!-- Python root directory - defaults to /awips2/python -->
<property name="python.root" value="/awips2/python" />
<!--
if groovy.path is not manually set, groovy must be
on the PATH.
-->
<property name="groovy.path" value="" />
<property name="architecture" value="x86_64" />
<condition property="requiredPropertiesSet">
<and>
<isset property="workspace_loc" />
</and>
</condition>
<available property="groovyPathSet"
file="${groovy.path}/groovy" type="file" />
<target name="main">
<antcall target="usage" />
<antcall target="deploy-using-specific-groovy" />
<antcall target="deploy-using-environment-groovy" />
</target>
<target name="usage" unless="${requiredPropertiesSet}">
<echo message="Usage: the following parameters are available when running deploy-install.xml." />
<echo message="REQUIRED PARAMETERS:" />
<echo message=" -Dworkspace_loc the location of the Eclipse workspace; use the 'workspace_loc' variable provided by Eclipse" />
<echo message="OPTIONAL PARAMETERS:" />
<echo message=" -Dlocalization.sites a colon delimited list of sites to deploy localization for" />
<echo message=" -Dedex.root the root of the EDEX installation; defaults to /awips2/edex" />
<echo message=" -Ddeploy.python a boolean value {true, false} indicating if python should be deployed" />
<echo message=" -Dpython.root the root of the python installation; defaults to /awips2/python" />
<echo message=" -Dpython.packages a colon delimited list of python packages to deploy; defaults to pypies:ufpy:dynamicserialize" />
<echo message=" -Darchitecture used to override the deployment architecture; use one of: {x86_64, x86}." />
<fail message="All required parameters have not been specified. Refer to the usage message above." />
</target>
<target name="deploy-using-specific-groovy" if="${groovyPathSet}">
<deploy
groovy.executable="${groovy.path}/groovy" />
</target>
<target name="deploy-using-environment-groovy" unless="${groovyPathSet}">
<deploy
groovy.executable="groovy" />
</target>
<macrodef name="deploy">
<attribute name="groovy.executable" />
<sequential>
<exec executable="@{groovy.executable}">
<arg value="-cp" />
<arg value="${basedir}${path.separator}${basedir}/../build.core" />
<arg value="${basedir}/RunDeployInstall.groovy" />
<arg value="${workspace_loc}" />
<arg value="${localization.sites}" />
<arg value="${deploy.python}" />
<arg value="${edex.root}" />
<arg value="${python.root}" />
<arg value="${python.packages}" />
<arg value="${architecture}" />
</exec>
</sequential>
</macrodef>
</project>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="customPluginDeployersList" class="java.util.ArrayList">
<constructor-arg>
<list>
<ref bean="customLocalizationDeploy" />
<ref bean="customResourcesDeploy" />
<ref bean="customWebDeploy" />
<ref bean="customDeploymentRunner" />
</list>
</constructor-arg>
</bean>
<bean id="customWebDeploy" class="DeployWeb" />
<bean id="customLocalizationDeploy" class="DeployEdexLocalization" />
<bean id="customResourcesDeploy" class="DeployEdexResources" />
<bean id="customDeploymentRunner" class="CustomDeploymentRunner" />
</beans>

View file

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: App Launcher Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.app.launcher;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.app.launcher.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
@ -11,8 +10,7 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.localization;bundle-version="1.11.1",
com.raytheon.uf.viz.core;bundle-version="1.11.5"
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.app.launcher,
com.raytheon.uf.viz.app.launcher.bundle,
Export-Package: com.raytheon.uf.viz.app.launcher.bundle,
com.raytheon.uf.viz.app.launcher.exception,
com.raytheon.uf.viz.app.launcher.handlers,
com.raytheon.uf.viz.app.launcher.runner,

View file

@ -1,69 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.app.launcher;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.app.launcher";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -1,23 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* Contains the basic classes used by the Application Launcher facility.
*/
package com.raytheon.uf.viz.app.launcher;

View file

@ -1,8 +0,0 @@
#Wed May 01 15:01:03 CDT 2013
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -2,8 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Archive
Bundle-SymbolicName: com.raytheon.uf.viz.archive;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.archive.Activator
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.ui;bundle-version="3.8.2",
org.eclipse.core.runtime,
@ -18,7 +17,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.8.2",
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
com.raytheon.uf.common.units;bundle-version="1.0.0",
com.raytheon.uf.common.auth;bundle-version="1.12.1174"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Import-Package: org.apache.commons.compress.archivers,
org.apache.commons.compress.archivers.tar

View file

@ -41,29 +41,25 @@
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="menu:CAVE?after=group1">
<command
commandId="com.raytheon.uf.viz.archive.retentionui"
id="archivetest"
label="Archive Retention..."
style="push">
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="menu:CAVE?after=group1">
<command
commandId="com.raytheon.uf.viz.archive.casecreationui"
id="archivetest"
label="Archive Case Creation..."
style="push">
</command>
</menuContribution>
<menuContribution
locationURI="menu:CAVE?after=group1">
<menu
label="Archive"
id="archive">
<command
commandId="com.raytheon.uf.viz.archive.casecreationui"
id="archivetest"
label="Archive Case Creation..."
style="push">
</command>
<command
commandId="com.raytheon.uf.viz.archive.retentionui"
id="archivetest"
label="Archive Retention..."
style="push">
</command>
</menu>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">

View file

@ -1,70 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.archive;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
/**
* Activator class for Archive.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 13, 2013 1966 rferrel Initial creation
*
* </pre>
*
* @author rferrel
* @version 1.0
*/
public class Activator implements BundleActivator {
private static BundleContext context;
static BundleContext getContext() {
return context;
}
/*
* (non-Javadoc)
*
* @see
* org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
* )
*/
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
}
/*
* (non-Javadoc)
*
* @see
* org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}
}

View file

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: Aviation Advisory Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.aviation.advisory;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.aviation.advisory.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: com.raytheon.uf.viz.core
Import-Package: com.raytheon.uf.common.dataplugin,

View file

@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
.,\
localization/

View file

@ -20,15 +20,15 @@
-->
<menuContributionFile>
<include installTo="menu:Aviation?after=ConvectionProductsStart"
fileName="menus/aviationadvisory/baseAviationConvectionProducts.xml" />
fileName="menus/upperair/baseAviationConvectionProducts.xml" />
<include installTo="menu:Aviation?before=IcingProductsEnd"
fileName="menus/aviationadvisory/baseAviationIcingProducts.xml" />
fileName="menus/upperair/baseAviationIcingProducts.xml" />
<include installTo="menu:Aviation?before=TurbulenceProductsEnd"
fileName="menus/aviationadvisory/baseAviationTurbulenceProducts.xml" />
fileName="menus/upperair/baseAviationTurbulenceProducts.xml" />
<include installTo="menu:Aviation?before=VisibilityProductsEnd"
fileName="menus/aviationadvisory/baseAviationVisibilityProducts.xml" />
fileName="menus/upperair/baseAviationVisibilityProducts.xml" />
<include installTo="menu:Aviation?before=TropicalCycloneEnd"
fileName="menus/aviationadvisory/baseAviationTropicalCyclone.xml" />
fileName="menus/upperair/baseAviationTropicalCyclone.xml" />
<include installTo="menu:Aviation?after=VolcanicAshStart"
fileName="menus/aviationadvisory/baseAviationVolcanicAsh.xml" />
fileName="menus/upperair/baseAviationVolcanicAsh.xml" />
</menuContributionFile>

View file

@ -1,69 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.aviation.advisory;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.aviation.advisory";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: Bufrsigwx Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.bufrsigwx;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.bufrsigwx.Activator
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
@ -30,8 +29,7 @@ Import-Package: com.raytheon.uf.common.dataplugin,
org.eclipse.ui.plugin,
org.opengis.referencing.crs,
org.osgi.framework
Export-Package: com.raytheon.uf.viz.bufrsigwx,
com.raytheon.uf.viz.bufrsigwx.common,
Export-Package: com.raytheon.uf.viz.bufrsigwx.common,
com.raytheon.uf.viz.bufrsigwx.rsc,
com.raytheon.uf.viz.bufrsigwx.util
Require-Bundle: com.raytheon.uf.viz.core,

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<menuContributionFile>
<include installTo="menu:Aviation?before=SignificantWeatherEnd"
fileName="menus/upperair/baseAviationBufrSigWx.xml" />
</menuContributionFile>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml"
menuText="Medium Level" id="SigWxMedium">
<substitute key="wxLayer" value="SWM" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml"
menuText="High Level" id="SigWxHigh">
<substitute key="wxLayer" value="SWH" />
</contribute>
</menuTemplate>

View file

@ -1,69 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.bufrsigwx;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.bufrsigwx";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -28,12 +28,10 @@ import com.raytheon.uf.common.dataplugin.bufrsigwx.common.SigWxType;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.bufrsigwx.Activator;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.status.StatusConstants;
/**
* Generic resourceData for SigWx data
@ -52,8 +50,9 @@ import com.raytheon.uf.viz.core.status.StatusConstants;
*/
@XmlAccessorType(XmlAccessType.NONE)
public class SigWxResourceData extends AbstractRequestableResourceData {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(SigWxResourceData.class);
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(SigWxResourceData.class);
@Override
public boolean equals(Object obj) {
if (!super.equals(obj)) {
@ -63,9 +62,9 @@ public class SigWxResourceData extends AbstractRequestableResourceData {
if (obj instanceof SigWxResourceData == false) {
return false;
}
// SigWxCloudsResourceData other = (SigWxCloudsResourceData) obj;
return true;
}
@ -87,8 +86,7 @@ public class SigWxResourceData extends AbstractRequestableResourceData {
} else if (SigWxType.JETS == type) {
nr = new SigWxJetStreamResource(this, loadProperties);
} else {
throw new VizException("No Resource for SigWx Type: "
+ typeString);
throw new VizException("No Resource for SigWx Type: " + typeString);
}
for (PluginDataObject o : objects) {
if (o instanceof SigWxData) {
@ -101,6 +99,6 @@ public class SigWxResourceData extends AbstractRequestableResourceData {
}
}
return nr;
}
}
}

View file

@ -1,7 +0,0 @@
#Thu Sep 17 10:41:36 CDT 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.uf.viz.climo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,7 +0,0 @@
#Tue Jun 01 09:57:08 CDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,10 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Climo Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.climo
Bundle-Version: 1.12.1174.qualifier
Bundle-Activator: com.raytheon.uf.viz.climo.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy

View file

@ -1,4 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -1,50 +0,0 @@
package com.raytheon.uf.viz.climo;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.climo";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: Cloudheight Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.cloudheight;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.cloudheight.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.ui;bundle-version="3.8.2",
org.eclipse.core.runtime,
@ -20,7 +19,6 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.8.2",
javax.measure;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.cloudheight,
com.raytheon.uf.viz.cloudheight.data,
Export-Package: com.raytheon.uf.viz.cloudheight.data,
com.raytheon.uf.viz.cloudheight.rsc
Import-Package: com.raytheon.viz.core.map

View file

@ -1,69 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.cloudheight;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.cloudheight";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -40,6 +40,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* Jan 28, 2014 2698 bclement removed getInfo, added methods to replace
* Jan 30, 2014 2698 bclement changed UserId to VenueParticipant
* Mar 06, 2014 2751 bclement added getParticipantUserid()
* Jan 09, 2015 3709 bclement added isPersistent()
*
* </pre>
*
@ -91,4 +92,10 @@ public interface IVenue {
*/
public UserId getParticipantUserid(VenueParticipant participant);
/**
* @return true if this is a room that exists on the server even when there
* are no participants
*/
public boolean isPersistent();
}

View file

@ -34,10 +34,12 @@ import org.jivesoftware.smack.packet.Presence.Type;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.muc.Affiliate;
import org.jivesoftware.smackx.muc.MultiUserChat;
import org.jivesoftware.smackx.muc.RoomInfo;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
@ -59,6 +61,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* Mar 05, 2014 2798 mpduff Get Presence from MUC.
* Mar 06, 2014 2751 bclement added getParticipantUserid()
* Mar 07, 2014 2848 bclement added hasOtherParticipants()
* Jan 09, 2015 3709 bclement added isPersistent()
*
* </pre>
*
@ -195,4 +198,21 @@ public class Venue implements IVenue {
return getParticipantCount() > 1;
}
@Override
public boolean isPersistent() {
boolean rval = false;
CollaborationConnection connection = CollaborationConnection
.getConnection();
XMPPConnection xmppConn = connection.getXmppConnection();
try {
RoomInfo roomInfo = MultiUserChat.getRoomInfo(xmppConn,
muc.getRoom());
rval = roomInfo.isPersistent();
} catch (XMPPException e) {
log.error("Unable to determine if room " + this.getId()
+ " is persistent", e);
}
return rval;
}
}

View file

@ -113,7 +113,8 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* Apr 29, 2014 3061 bclement moved invite payload to shared display session
* May 09, 2014 3107 bclement removed catch from isRoomOwner() so callers know about errors
* Jun 16, 2014 3288 bclement changed String venueName to VenueId venueId, added createVenueId()
* Oct 08, 2014 3705 bclement aded getVenueId()
* Oct 08, 2014 3705 bclement added getVenueId()
* Jan 12, 2015 3709 bclement fixed rare invite bug
*
*
* </pre>
@ -247,7 +248,11 @@ public class VenueSession extends BaseSession implements IVenueSession {
protected Message createInviteMessage(UserId id, VenueInvite invite) {
Message msg = new Message();
msg.setType(Type.normal);
msg.setBody(invite.getMessage());
/*
* don't set a body on the message. smack will add a packet extension on
* it that will have the actual invite. openfire gets confused if there
* is both a body and an extension and drops the invite on the floor.
*/
return msg;
}

View file

@ -38,6 +38,7 @@ import org.jivesoftware.smackx.muc.Occupant;
* Jan 30, 2014 2698 bclement reworked convertFromRoom for venue participants
* Feb 3, 2014 2699 bclement fixed room id parsing when handle has special characters
* Feb 13, 2014 2751 bclement VenueParticipant refactor
* Jan 13, 2015 3709 bclement added convertFromRoom that doesn't reference MUC
*
* </pre>
*
@ -72,6 +73,24 @@ public class IDConverter {
* @return
*/
public static VenueParticipant convertFromRoom(MultiUserChat room, String id) {
VenueParticipant rval = convertFromRoom(id);
Occupant occupant;
if (room != null && (occupant = room.getOccupant(id)) != null) {
if (occupant.getJid() != null) {
// get actual user name
rval.setUserid(convertFrom(occupant.getJid()));
}
}
return rval;
}
/**
* Parse userId from room id string "room@host/handle".
*
* @param id
* @return
*/
public static VenueParticipant convertFromRoom(String id) {
String handle = StringUtils.parseResource(id);
if (handle == null || handle.trim().isEmpty()) {
throw new IllegalArgumentException(
@ -81,13 +100,6 @@ public class IDConverter {
String host = StringUtils.parseServer(cleanId);
String roomName = StringUtils.parseName(id);
VenueParticipant rval = new VenueParticipant(roomName, host, handle);
Occupant occupant;
if (room != null && (occupant = room.getOccupant(id)) != null) {
if (occupant.getJid() != null) {
// get actual user name
rval.setUserid(convertFrom(occupant.getJid()));
}
}
return rval;
}

View file

@ -0,0 +1,85 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.display.data;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* Contains foreground and background chat colors for a list of users or sites
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 13, 2014 3709 mapeters Initial creation.
* Nov 26, 2014 3709 mapeters Renamed from UserColorInformation, added fgSet getter.
* Dec 08, 2014 3709 mapeters Removed fgSet and individual colors' getters/setters,
* set foreground and background together.
* Jan 13, 2015 3709 bclement moved from collaboration.ui to collaboration.display
* moved ColorInfo class to UserColorInfo
*
* </pre>
*
* @author mapeters
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class ColorInfoMap {
@XmlElement
private Map<String, UserColorInfo> colors;
/**
*
*/
public ColorInfoMap() {
}
/**
* @param colors
*/
public ColorInfoMap(Map<String, UserColorInfo> colors) {
this.colors = colors;
}
/**
* @return the colors
*/
public Map<String, UserColorInfo> getColors() {
return colors;
}
/**
* @param colors
* the colors to set
*/
public void setColors(Map<String, UserColorInfo> colors) {
this.colors = colors;
}
}

View file

@ -0,0 +1,69 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.display.data;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IUser;
/**
* Interface for color managers that keep track of color settings for users in a
* session or chat.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 13, 2015 3709 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public interface IColorManager<T extends IUser> {
/**
* Get assigned color for user
*
* @param user
* @return
*/
public UserColorInfo getColorForUser(T user);
/**
* Assign color to user
*
* @param user
* @param color
*/
public void setColorForUser(T user, UserColorInfo color);
/**
* Clear color assignments
*/
public void clearColors();
/**
* @return human readable description of color management
*/
public String getDescription(T user);
}

View file

@ -21,6 +21,7 @@ package com.raytheon.uf.viz.collaboration.display.data;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.swt.graphics.RGB;
@ -46,6 +47,7 @@ import com.raytheon.viz.core.ColorUtil;
* Mar 06, 2014 2848 bclement synchronized color access
* Jul 02, 2014 1255 bclement collaboration specific RGB presets
* falls back to ColorUtil resource color presets
* Jan 13, 2015 3709 bclement implements IColorManager, uses UserColorInfo
*
* </pre>
*
@ -53,94 +55,129 @@ import com.raytheon.viz.core.ColorUtil;
* @version 1.0
*/
public class SessionColorManager {
public class SessionColorManager implements IColorManager<VenueParticipant> {
public static final String SESSION_COLOR_PREFERENCE_KEY = "collaborationParticipantColor";
private final Map<VenueParticipant, RGB> colors = new HashMap<VenueParticipant, RGB>();
protected final Map<VenueParticipant, UserColorInfo> colors = new HashMap<>();
private static final RGB[] rgbPresets;
private static final RGB[] foregroundPresets;
static {
HierarchicalPreferenceStore prefs = (HierarchicalPreferenceStore) Activator
.getDefault().getPreferenceStore();
String[] names = prefs.getStringArray(SESSION_COLOR_PREFERENCE_KEY);
if (names.length > 0) {
rgbPresets = new RGB[names.length];
foregroundPresets = new RGB[names.length];
int i = 0;
for (String name : names) {
rgbPresets[i++] = RGBColors.getRGBColor(name);
foregroundPresets[i++] = RGBColors.getRGBColor(name);
}
} else {
rgbPresets = ColorUtil.getResourceColorPresets();
foregroundPresets = ColorUtil.getResourceColorPresets();
}
}
/**
* Get a map of venue participants to their assigned colors used for
* Get a map of venue participants to their assigned foreground colors
*
* @return
*/
public Map<VenueParticipant, RGB> getColors() {
public Map<VenueParticipant, RGB> getForegroundColors() {
/*
* TODO the foreground specific methods are required since the shared
* display protocol doesn't support changing the background color as
* this would cause compatibility issues.
*/
Map<VenueParticipant, RGB> rval;
synchronized (colors) {
rval = new HashMap<VenueParticipant, RGB>(colors);
rval = new HashMap<VenueParticipant, RGB>(colors.size());
for (Entry<VenueParticipant, UserColorInfo> entry : colors
.entrySet()) {
rval.put(entry.getKey(), entry.getValue().getForeground());
}
}
return rval;
}
/**
* Clear color assignments and repopulate with supplied map
* Reassign foreground colors specified by map
*
* @param map
*/
public void setColors(Map<VenueParticipant, RGB> map) {
public void setForegroundColors(Map<VenueParticipant, RGB> map) {
synchronized (colors) {
colors.clear();
colors.putAll(map);
for (Entry<VenueParticipant, RGB> entry : map.entrySet()) {
VenueParticipant participant = entry.getKey();
UserColorInfo colorInfo = getColorInternal(participant);
RGB foreground = entry.getValue();
if (colorInfo != null) {
colorInfo.setForeground(foreground);
} else {
setColorInternal(participant, new UserColorInfo(foreground));
}
}
}
}
/**
* Get participant's assigned color
*
* @param user
* @return
*/
public RGB getColorForUser(VenueParticipant user) {
RGB rval;
synchronized (colors) {
rval = colors.get(user);
if (rval == null) {
@Override
public UserColorInfo getColorForUser(VenueParticipant user) {
UserColorInfo rval;
rval = getColorInternal(user);
if (rval == null) {
synchronized (colors) {
int count = colors.size();
if (rgbPresets.length <= count) {
count = count % rgbPresets.length;
if (foregroundPresets.length <= count) {
count = count % foregroundPresets.length;
}
rval = rgbPresets[count];
colors.put(user, rval);
rval = new UserColorInfo(foregroundPresets[count]);
setColorInternal(user, rval);
}
}
return rval;
}
/**
* Assign color to participant
*
* @param id
* @param rgb
* @param user
* @return null if user isn't found
*/
public void setColorForUser(VenueParticipant id, RGB rgb) {
synchronized (colors) {
colors.put(id, rgb);
protected UserColorInfo getColorInternal(VenueParticipant user) {
UserColorInfo rval = null;
if (user != null) {
synchronized (colors) {
rval = colors.get(user);
}
}
return rval;
}
/**
* Clear color assignments
* @param user
* @param color
*/
protected void setColorInternal(VenueParticipant user, UserColorInfo color) {
synchronized (colors) {
colors.put(user, color);
}
}
@Override
public void setColorForUser(VenueParticipant user, UserColorInfo color) {
setColorInternal(user, color);
}
@Override
public void clearColors() {
synchronized (colors) {
colors.clear();
}
}
@Override
public String getDescription(VenueParticipant user) {
return "Color changes will apply to the user " + user.getName()
+ " only in the " + user.getRoom() + " room. "
+ "\nColor changes will be discarded when you leave the room.";
}
}

View file

@ -54,6 +54,7 @@ import com.raytheon.uf.viz.core.VizApp;
* Feb 11, 2014 2751 njensen Added leaderChanged() and listeners
* Mar 07, 2014 2848 bclement made colorManager final, added modifyColors() listeners
* Mar 18, 2014 2895 njensen Improved javadoc
* Jan 13, 2015 3709 bclement SessionColorManager API changes
*
* </pre>
*
@ -72,7 +73,13 @@ public class SessionContainer {
/** subscribes to events related to the session based on role **/
private IRoleEventController roleEventController;
private final SessionColorManager colorManager = new SessionColorManager();
private final SessionColorManager colorManager = new SessionColorManager() {
@Override
public String getDescription(VenueParticipant user) {
return super.getDescription(user)
+ "\nColor changes will be seen by all participants in the session.";
}
};
private IRemoteDisplayContainer displayContainer;
@ -178,12 +185,13 @@ public class SessionContainer {
@Subscribe
public void modifyColors(ColorPopulator populator) {
colorManager.setColors(populator.getColors());
colorManager.setForegroundColors(populator.getColors());
}
@Subscribe
public void modifyColors(ColorChangeEvent event) {
colorManager.setColorForUser(event.getUserName(), event.getColor());
UserColorInfo color = new UserColorInfo(event.getColor());
colorManager.setColorForUser(event.getUserName(), color);
}
/**

View file

@ -0,0 +1,126 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.display.data;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import org.eclipse.swt.graphics.RGB;
/**
* Color information for a collaboration user which is used when styling text
* and telestration
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 12, 2015 3709 bclement Initial creation, moved from ColorInfoMap
*
* </pre>
*
* @author bclement
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class UserColorInfo {
@XmlAttribute
private int fgRed;
@XmlAttribute
private int fgGreen;
@XmlAttribute
private int fgBlue;
@XmlAttribute
private int bgRed;
@XmlAttribute
private int bgGreen;
@XmlAttribute
private int bgBlue;
/**
*
*/
public UserColorInfo() {
}
/**
* @param foreground
*/
public UserColorInfo(RGB foreground) {
this(foreground, new RGB(255, 255, 255));
}
/**
* @param foreground
* @param background
*/
public UserColorInfo(RGB foreground, RGB background) {
setForeground(foreground);
setBackground(background);
}
/**
* @return the background
*/
public RGB getBackground() {
return new RGB(bgRed, bgGreen, bgBlue);
}
/**
* @param background
* the background to set
*/
public void setBackground(RGB background) {
if (background != null) {
this.bgRed = background.red;
this.bgGreen = background.green;
this.bgBlue = background.blue;
}
}
/**
* @return the foreground
*/
public RGB getForeground() {
return new RGB(fgRed, fgGreen, fgBlue);
}
/**
* @param foreground
* the foreground to set
*/
public void setForeground(RGB foreground) {
if (foreground != null) {
this.fgRed = foreground.red;
this.fgGreen = foreground.green;
this.fgBlue = foreground.blue;
}
}
}

View file

@ -19,8 +19,6 @@
**/
package com.raytheon.uf.viz.collaboration.display.roles;
import org.eclipse.swt.graphics.RGB;
import com.google.common.eventbus.Subscribe;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -33,6 +31,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.invite.ColorPopulator;
import com.raytheon.uf.viz.collaboration.display.data.ColorChangeEvent;
import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.uf.viz.collaboration.display.editor.ActivateRemoteDisplay;
import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditorsManager;
import com.raytheon.uf.viz.core.IDisplayPane;
@ -56,6 +55,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
* Feb 13, 2014 2751 bclement VenueParticipant refactor
* Feb 13, 2014 2751 njensen Renamed container to displayContainer
* Mar 06, 2014 2848 bclement removed check for self from participantChanged
* Jan 13, 2015 3709 bclement SessionColorManager API changes
*
* </pre>
*
@ -98,12 +98,13 @@ public class DataProviderEventController extends
SessionColorManager scm = SharedDisplaySessionMgr
.getSessionContainer(session.getSessionId())
.getColorManager();
RGB color = scm.getColorForUser(event.getParticipant());
UserColorInfo color = scm.getColorForUser(event
.getParticipant());
ColorChangeEvent cce = new ColorChangeEvent(
event.getParticipant(), color);
event.getParticipant(), color.getForeground());
session.sendObjectToPeer(event.getParticipant(),
new ColorPopulator(scm.getColors()));
new ColorPopulator(scm.getForegroundColors()));
session.sendObjectToVenue(cce);
} catch (CollaborationException e) {
statusHandler.handle(Priority.PROBLEM,

View file

@ -29,6 +29,7 @@ import com.raytheon.uf.viz.collaboration.display.Activator;
import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
import com.raytheon.uf.viz.collaboration.display.data.SessionContainer;
import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.uf.viz.collaboration.display.editor.ReprojectRemoteDisplay;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IExtent;
@ -60,6 +61,7 @@ import com.raytheon.uf.viz.remote.graphics.DispatchGraphicsTarget;
* Mar 06, 2014 2848 bclement get subject dynamically from session
* May 16, 2014 3163 bsteffen Remove references to deprecated
* {@link DrawableString} field.
* Jan 13, 2015 3709 bclement SessionColorManager API changes
*
* </pre>
*
@ -103,10 +105,12 @@ public class DataProviderRsc extends
}
target.clearClippingPlane();
IExtent extent = paintProps.getView().getExtent();
RGB color = colorManager.getColorForUser(session.getUserID());
target.drawRect(extent, color, 3.0f, 1.0f);
UserColorInfo colors = colorManager
.getColorForUser(session.getUserID());
RGB foreground = colors.getForeground();
target.drawRect(extent, foreground, 3.0f, 1.0f);
DrawableString string = new DrawableString(getName(), color);
DrawableString string = new DrawableString(getName(), foreground);
string.horizontalAlignment = HorizontalAlignment.CENTER;
string.verticallAlignment = VerticalAlignment.BOTTOM;
string.setCoordinates(extent.getMinX() + extent.getWidth() / 2,

View file

@ -36,6 +36,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
import com.raytheon.uf.viz.collaboration.display.Activator;
import com.raytheon.uf.viz.collaboration.display.data.SessionContainer;
import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingEvent.CollaborationEventType;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
@ -70,6 +71,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* May 05, 2014 3076 bclement old CLEAR_ALL is now DISPOSE_ALL,
* added clearLayers() and getAllDrawingLayers()
* Jun 30, 2014 1798 bclement added getManager()
* Jan 13, 2015 3709 bclement SessionColorManager API changes
*
* </pre>
*
@ -180,8 +182,9 @@ public class CollaborationDrawingResource extends
layer.setEraserWidth(16); // Configure?
layer.setLineStyle(outline.getLineStyle());
layer.setLineWidth(outline.getOutlineWidth());
layer.setColor(container.getColorManager().getColorForUser(
user));
UserColorInfo colorInfo = container.getColorManager()
.getColorForUser(user);
layer.setColor(colorInfo.getForeground());
layer.paint(target, paintProps);
}
}

View file

@ -22,7 +22,9 @@ package com.raytheon.uf.viz.collaboration.ui;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.jface.action.Action;
@ -86,6 +88,7 @@ import com.google.common.eventbus.Subscribe;
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
import com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterChangeEvent;
import com.raytheon.uf.viz.collaboration.comm.identity.event.RosterChangeType;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IUser;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.event.BookmarkEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.event.UserPresenceChangedEvent;
@ -98,14 +101,13 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.actions.AddNotifierAction;
import com.raytheon.uf.viz.collaboration.ui.actions.AddToGroupAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ArchiveViewerAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeBackgroundColorAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeFontAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeForegroundColorAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangePasswordAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeRoleAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeSiteAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeStatusAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeStatusMessageAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeTextColorAction;
import com.raytheon.uf.viz.collaboration.ui.actions.CreateSessionAction;
import com.raytheon.uf.viz.collaboration.ui.actions.DeleteGroupAction;
import com.raytheon.uf.viz.collaboration.ui.actions.DisplayFeedAction;
@ -121,6 +123,7 @@ import com.raytheon.uf.viz.collaboration.ui.actions.RemoveFromRosterAction;
import com.raytheon.uf.viz.collaboration.ui.actions.SendSubReqAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ShowVenueAction;
import com.raytheon.uf.viz.collaboration.ui.actions.UserSearchAction;
import com.raytheon.uf.viz.collaboration.ui.colors.UserColorConfigManager;
import com.raytheon.uf.viz.collaboration.ui.data.AlertWordWrapper;
import com.raytheon.uf.viz.collaboration.ui.data.CollaborationGroupContainer;
import com.raytheon.uf.viz.collaboration.ui.data.PublicRoomContainer;
@ -163,6 +166,11 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
* May 19, 2014 3180 bclement fixed inviting multiple users to session
* Oct 08, 2014 3705 bclement added room search and bookmarking
* Oct 14, 2014 3709 mapeters Added change background/foreground color actions to menu.
* Nov 14, 2014 3709 mapeters Removed change background/foreground color actions from menu.
* Dec 08, 2014 3709 mapeters Added MB3 change user text color actions to contacts list.
* Dec 12, 2014 3709 mapeters Store {@link ChangeTextColorAction}s in map, dispose them.
* Jan 09, 2015 3709 bclement color config manager API changes
* Jan 13, 2015 3709 bclement ChangeTextColorAction API changes
*
* </pre>
*
@ -203,6 +211,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
private Action roomSearchAction;
private Map<String, ChangeTextColorAction<?>> userColorActions;
/**
* @param parent
*/
@ -277,6 +287,11 @@ public class CollaborationGroupView extends CaveFloatingView implements
inactiveImage.dispose();
activeImage.dispose();
pressedImage.dispose();
for (ChangeTextColorAction<?> userColorAction : userColorActions
.values()) {
userColorAction.dispose();
}
}
/**
@ -286,6 +301,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
Bundle bundle = Activator.getDefault().getBundle();
final IUserSelector userSelector = this;
userColorActions = new HashMap<>();
createSessionAction = new CreateSessionAction(userSelector);
aliasAction = new Action("Alias", IconUtil.getImageDescriptor(Activator
@ -364,9 +381,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
mgr.add(roomSearchAction);
mgr.add(new Separator());
mgr.add(new ChangeFontAction());
mgr.add(new ChangeForegroundColorAction());
mgr.add(new ChangeBackgroundColorAction());
mgr.add(new Separator());
mgr.add(new Separator("afterFont"));
mgr.add(new ChangeStatusAction());
mgr.add(new ChangeStatusMessageAction());
mgr.add(new ChangePasswordAction());
@ -437,7 +452,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
if (o instanceof SessionGroupContainer) {
manager.add(createSessionAction);
return;
} else if (o instanceof PublicRoomContainer){
} else if (o instanceof PublicRoomContainer) {
manager.add(roomSearchAction);
return;
} else if (o instanceof IVenueSession) {
@ -464,6 +479,16 @@ public class CollaborationGroupView extends CaveFloatingView implements
manager.add(new SendSubReqAction(entry));
}
manager.add(new AddNotifierAction(this));
manager.add(new Separator());
String colorActionKey = user.getFQName();
ChangeTextColorAction<?> userColorAction = userColorActions
.get(colorActionKey);
if (userColorAction == null) {
userColorAction = new ChangeTextColorAction<IUser>(user, false,
false, false, UserColorConfigManager.getInstance());
userColorActions.put(colorActionKey, userColorAction);
}
manager.add(userColorAction);
} else if (o instanceof UserId) {
// the user
UserId user = (UserId) o;
@ -472,6 +497,16 @@ public class CollaborationGroupView extends CaveFloatingView implements
UserId me = connection.getUser();
if (me.isSameUser(user)) {
createMenu(manager);
String colorActionKey = user.getFQName();
ChangeTextColorAction<?> userColorAction = userColorActions
.get(colorActionKey);
if (userColorAction == null) {
userColorAction = new ChangeTextColorAction<IUser>(user,
true, true, false,
UserColorConfigManager.getInstance());
userColorActions.put(colorActionKey, userColorAction);
}
manager.insertBefore("afterFont", userColorAction);
}
} else if (o instanceof RosterGroup || o instanceof SharedGroup) {
Action inviteAction = new InviteAction(getSelectedUsers());

View file

@ -1,159 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManager;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
/**
* Site coloring configuration manager
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 10, 2014 3708 bclement Moved color methods from SiteConfigurationManager
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class SiteColorConfigManager {
private static SiteColorInformation colorInfo;
/**
*
*/
private SiteColorConfigManager() {
}
/**
* Write the colorInfo.xml file out to user localization so that the user
* can retrieve it on CAVE restart
*
* @param information
*/
public static void writeSiteColorInformation(
SiteColorInformation information) {
colorInfo = information;
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext lContext = pathMgr.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
LocalizationFile file = pathMgr.getLocalizationFile(lContext,
"collaboration" + File.separator + "colorInfo.xml");
try {
JAXBContext context = JAXBContext
.newInstance(SiteColorInformation.class);
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
new Boolean(true));
marshaller.marshal(information, file.getFile());
file.save();
} catch (Exception e) {
Activator.statusHandler.error(
"Unable to write color information to file: "
+ file.getName() + " in context " + lContext, e);
}
}
/**
* Instantiate the colorInfo object so that the colors can be read in from
* the colorInfo.xml file and retrieved from localization
*
* @return
*/
public static SiteColorInformation getSiteColorInformation() {
if (colorInfo == null) {
PathManager pm = (PathManager) PathManagerFactory.getPathManager();
Map<LocalizationLevel, LocalizationFile> files = pm
.getTieredLocalizationFile(LocalizationType.CAVE_STATIC,
"collaboration" + File.separator + "colorInfo.xml");
LocalizationLevel[] levels = LocalizationLevel.values();
for (int i = levels.length - 1; i >= 0 && colorInfo == null; --i) {
LocalizationLevel level = levels[i];
if (level == LocalizationLevel.SITE
|| level == LocalizationLevel.USER) {
LocalizationFile file = files.get(level);
if (file != null) {
InputStream in = null;
try {
in = file.openInputStream();
JAXBContext context = JAXBContext
.newInstance(SiteColorInformation.class);
Unmarshaller unmarshaller = context
.createUnmarshaller();
colorInfo = (SiteColorInformation) unmarshaller
.unmarshal(in);
} catch (Exception e) {
Activator.statusHandler.error(
"Unable to read color information from file: "
+ file.getName() + " in level "
+ level, e);
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
Activator.statusHandler.error(
"Problem closing color information file: "
+ file.getName(), e);
}
}
}
}
}
}
return colorInfo;
}
/**
* @return list of colors from site information config
*/
public static List<SiteColor> getSiteColors() {
SiteColorInformation colorInfo = getSiteColorInformation();
if (colorInfo != null) {
return getSiteColorInformation().getColors();
} else {
return null;
}
}
}

View file

@ -1,173 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.eclipse.swt.graphics.RGB;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 16, 2012 mnash Initial creation
*
* </pre>
*
* @author mnash
* @version 1.0
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class SiteColorInformation {
@XmlElement
List<SiteColor> colors;
/**
* @return the colors
*/
public List<SiteColor> getColors() {
return colors;
}
/**
* @param colors
* the colors to set
*/
public void setColors(List<SiteColor> colors) {
this.colors = colors;
}
@XmlAccessorType(XmlAccessType.NONE)
public static class SiteColor {
@XmlAttribute
private String site;
@XmlAttribute
private int red;
@XmlAttribute
private int green;
@XmlAttribute
private int blue;
public SiteColor() {
}
/**
* @return the site
*/
public String getSite() {
return site;
}
/**
* @param site
* the site to set
*/
public void setSite(String site) {
this.site = site;
}
/**
* @return the red
*/
public int getRed() {
return red;
}
/**
* @param red
* the red to set
*/
public void setRed(int red) {
this.red = red;
}
/**
* @return the green
*/
public int getGreen() {
return green;
}
/**
* @param green
* the green to set
*/
public void setGreen(int green) {
this.green = green;
}
/**
* @return the blue
*/
public int getBlue() {
return blue;
}
/**
* @param blue
* the blue to set
*/
public void setBlue(int blue) {
this.blue = blue;
}
public RGB getColor() {
return new RGB(red, green, blue);
}
public void setColor(RGB rgb) {
red = rgb.red;
green = rgb.green;
blue = rgb.blue;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof SiteColor == false) {
return false;
} else {
return this.getSite().equals(((SiteColor) obj).getSite());
}
}
}
}

View file

@ -1,73 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.ColorDialog;
import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.ui.Activator;
import com.raytheon.uf.viz.collaboration.ui.actions.ChatDisplayChangeEvent.ChangeType;
import com.raytheon.uf.viz.core.preferences.PreferenceConverter;
/**
* Open change background color dialog
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 14, 2014 3709 mapeters Initial creation.
*
*
* </pre>
*
* @author mapeters
* @version 1.0
*/
public class ChangeBackgroundColorAction extends Action {
public ChangeBackgroundColorAction() {
super("Change Background Color...");
}
@Override
public void run() {
ColorDialog dialog = new ColorDialog(Display.getCurrent()
.getActiveShell());
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
RGB data = PreferenceConverter.getRGB(store, "bg", "white");
dialog.setRGB(data);
RGB postData = dialog.open();
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (postData != null && connection != null) {
PreferenceConverter.setValue(store, "bg", postData);
connection.postEvent(ChatDisplayChangeEvent.createColorEvent(
ChangeType.BACKGROUND, postData));
}
};
}

View file

@ -40,7 +40,8 @@ import com.raytheon.uf.viz.core.icon.IconUtil;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 6, 2012 bsteffen Initial creation
* Oct 14, 2014 3709 mapeters Post event using {@link ChatDisplayChangeEvent}.
* Oct 14, 2014 3709 mapeters Post event using ChatDisplayChangeEvent.
* Nov 14, 2014 3709 mapeters Changed back to posting event using FontData.
*
* </pre>
*
@ -67,8 +68,7 @@ public class ChangeFontAction extends Action {
.getConnection();
if (postData != null && connection != null) {
PreferenceConverter.setValue(store, "font", postData);
connection.postEvent(ChatDisplayChangeEvent
.createFontEvent(postData));
connection.postEvent(postData);
}
};
}

View file

@ -1,73 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.ColorDialog;
import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.ui.Activator;
import com.raytheon.uf.viz.collaboration.ui.actions.ChatDisplayChangeEvent.ChangeType;
import com.raytheon.uf.viz.core.preferences.PreferenceConverter;
/**
* Open change foreground color dialog
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 14, 2014 3709 mapeters Initial creation.
*
*
* </pre>
*
* @author mapeters
* @version 1.0
*/
public class ChangeForegroundColorAction extends Action {
public ChangeForegroundColorAction() {
super("Change Foreground Color...");
}
@Override
public void run() {
ColorDialog dialog = new ColorDialog(Display.getCurrent()
.getActiveShell());
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
RGB data = PreferenceConverter.getRGB(store, "fg", "black");
dialog.setRGB(data);
RGB postData = dialog.open();
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (postData != null && connection != null) {
PreferenceConverter.setValue(store, "fg", postData);
connection.postEvent(ChatDisplayChangeEvent.createColorEvent(
ChangeType.FOREGROUND, postData));
}
};
}

View file

@ -0,0 +1,220 @@
package com.raytheon.uf.viz.collaboration.ui.actions;
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IUser;
import com.raytheon.uf.viz.collaboration.display.data.IColorManager;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.uf.viz.collaboration.ui.colors.ForegroundBackgroundColorDlg;
import com.raytheon.uf.viz.collaboration.ui.colors.ForegroundColorDlg;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
/**
* Action to change the foreground and background chat colors of a selected
* user/site.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 02, 2014 3709 mapeters Initial creation.
* Dec 09, 2014 3709 mapeters Uses {@link ForegroundBackgroundColorDlg}, renamed from
* ChangeUserColorAction, support both user and site colors.
* Dec 12, 2014 3709 mapeters Use static methods to call constructor, icon displays
* current foreground and background colors.
* Jan 05, 2015 3709 mapeters Added getTextColors(), added me param to createChangeUserTextColorAction().
* Jan 09, 2015 3709 bclement color change manager API changes
* Jan 12, 2015 3709 bclement removed event handler for icon changes, added ChangeTextColorCallback
* Jan 13, 2015 3709 bclement unified color management, simplified construction, added foregroundOnly mode
*
* </pre>
*
* @author mapeters
* @version 1.0
*/
public class ChangeTextColorAction<T extends IUser> extends Action {
private final T user;
private IColorManager<T> colorManager;
private boolean foregroundOnly;
private Image icon;
/**
* Callback that receives new color information when the action results in a
* new color selection for a user
*/
public static interface ChangeTextColorCallback {
public void newColor(IUser user, UserColorInfo colors);
}
private ChangeTextColorCallback actionCallback = null;
/**
* Generate display text string according to provided options
*
* @param user
* @param me
* true if user represents the currently logged in user
* @param displayName
* true if the user's name should be used or false if a generic
* display text should be used
* @return
*/
public static String getDisplayText(IUser user, boolean me,
boolean displayName) {
String name = user.getName();
String text = "Change ";
if (displayName) {
text += me ? "Your" : (name + "'s");
} else {
text += "User";
}
text += " Text Colors...";
return text;
}
/**
* @param user
* @param me
* true if user represents the currently logged in user
* @param displayName
* true if the user's name should be used or false if a generic
* display text should be used
* @param foregroundOnly
* true if only the option to change the foreground should be
* provided
* @param colorConfigManager
*/
public ChangeTextColorAction(T user, boolean me, boolean displayName,
boolean foregroundOnly, IColorManager<T> colorConfigManager) {
super(getDisplayText(user, me, displayName));
this.user = user;
this.colorManager = colorConfigManager;
this.foregroundOnly = foregroundOnly;
UserColorInfo colors = getTextColors();
setIconColors(colors);
}
@Override
public void run() {
UserColorInfo colors = getTextColors();
ForegroundColorDlg dialog;
Shell shell = Display.getCurrent().getActiveShell();
String desc = colorManager.getDescription(user);
if (foregroundOnly) {
dialog = new ForegroundColorDlg(shell, desc, colors.getForeground());
} else {
dialog = new ForegroundBackgroundColorDlg(shell, desc,
colors.getForeground(), colors.getBackground());
}
dialog.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
if (returnValue == null) {
return;
}
if (returnValue instanceof UserColorInfo) {
UserColorInfo colors = (UserColorInfo) returnValue;
colorManager.setColorForUser(user, colors);
setIconColors(colors);
if (actionCallback != null) {
actionCallback.newColor(user, colors);
}
}
}
});
dialog.open();
}
/**
* Get the stored colors (or default colors) of this action's user
*
* @return color selected by color manager or default color if none found
*/
private UserColorInfo getTextColors() {
return colorManager.getColorForUser(user);
}
/**
* Change colors in menu icon which represents the user's text color
* settings
*
* @param colors
*/
private void setIconColors(UserColorInfo colors) {
Device device = Display.getCurrent();
Color fg = new Color(device, colors.getForeground());
Color bg = new Color(device, colors.getBackground());
Image oldIcon = icon;
icon = new Image(device, 15, 15);
Rectangle bounds = icon.getBounds();
GC gc = new GC(icon);
gc.setForeground(fg);
gc.setBackground(bg);
gc.fillRectangle(bounds);
gc.drawText("A", 4, 0);
setImageDescriptor(ImageDescriptor.createFromImage(icon));
gc.dispose();
fg.dispose();
bg.dispose();
if (oldIcon != null) {
oldIcon.dispose();
}
}
public void dispose() {
if (icon != null) {
icon.dispose();
}
}
/**
* @param actionCallback
* the actionCallback to set
*/
public void setActionCallback(ChangeTextColorCallback actionCallback) {
this.actionCallback = actionCallback;
}
}

View file

@ -1,84 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui.actions;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
/**
* Store font/color change information
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 14, 2014 3709 mapeters Initial creation.
*
* </pre>
*
* @author mapeters
* @version 1.0
*/
public class ChatDisplayChangeEvent {
private ChangeType type;
private RGB color;
private FontData font;
public enum ChangeType {
BACKGROUND, FOREGROUND, FONT;
}
private ChatDisplayChangeEvent(ChangeType type, RGB color) {
this.type = type;
this.color = color;
}
private ChatDisplayChangeEvent(ChangeType type, FontData font) {
this.type = type;
this.font = font;
}
public static ChatDisplayChangeEvent createColorEvent(ChangeType type,
RGB color) {
return new ChatDisplayChangeEvent(type, color);
}
public static ChatDisplayChangeEvent createFontEvent(FontData font) {
return new ChatDisplayChangeEvent(ChangeType.FONT, font);
}
public RGB getColor() {
return this.color;
}
public ChangeType getChangeType() {
return this.type;
}
public FontData getFont() {
return this.font;
}
}

View file

@ -48,7 +48,8 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
* Oct 8, 2014 3705 bclement Initial creation
* Nov 12, 2014 3705 bclement fixed empty participant list problem
*
* </pre>
*
@ -106,11 +107,15 @@ public class JoinRoomAction extends Action {
try {
VenueSession session = connection.joinTextOnlyVenue(room,
handle);
/*
* connect to room before UI initializes so it gets the
* participant list
*/
session.connectToRoom();
CaveWorkbenchPageManager page = CaveWorkbenchPageManager
.getActiveInstance();
page.showView(SessionView.ID, session.getSessionId(),
IWorkbenchPage.VIEW_ACTIVATE);
session.connectToRoom();
} catch (CollaborationException | PartInitException e) {
log.error("Unable to join room " + room.getFQName(), e);
}

View file

@ -52,6 +52,7 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
* Jul 3, 2012 bsteffen Initial creation
* Jun 17, 2014 3078 bclement changed user type to IUser, added isAvailable()
* Jun 20, 2014 3281 bclement fixed secondary id bug by using user.getClientIndependentId()
* Nov 14, 2014 3709 mapeters upon creation of p2p chat, add color change menu actions
*
* </pre>
*
@ -140,6 +141,10 @@ public class PeerToPeerChatAction extends Action {
viewMode);
if (p2pView.getPeer() == null) {
p2pView.setPeer(user);
/*
* once peer is set, add action to change peer text colors
*/
p2pView.addChangePeerColorAction();
}
return p2pView;
} catch (PartInitException e) {

View file

@ -0,0 +1,180 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui.colors;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
/**
* A dialog that displays a label with settable foreground and background colors
* using a color control.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 04, 2014 3709 lvenable Initial creation
* Jan 09, 2015 3709 bclement moved primary logic to new super class
* Jan 13, 2015 3709 bclement return UserColorInfo instead of RGB[]
*
* </pre>
*
* @author lvenable
* @version 1.0
*/
public class ForegroundBackgroundColorDlg extends ForegroundColorDlg {
/** Background color. */
private Color backgroundClr = null;
private Button foregroundRdo;
/**
* Constructor.
*
* @param parentShell
* Parent shell.
*/
public ForegroundBackgroundColorDlg(Shell parentShell, String description) {
this(parentShell, description, null, null);
}
/**
* Constructor.
*
* @param parentShell
* Parent shell.
* @param fgRGB
* Foreground RGB.
* @param bgRGB
* Background RGB.
*/
public ForegroundBackgroundColorDlg(Shell parentShell, String description,
RGB fgRGB, RGB bgRGB) {
super(parentShell, description, fgRGB);
setText("Foreground/Background Color Chooser");
/*
* If the background RGB is null then set it to a white color.
*/
if (bgRGB == null) {
backgroundClr = new Color(parentShell.getDisplay(), new RGB(255,
255, 255));
} else {
backgroundClr = new Color(parentShell.getDisplay(), bgRGB);
}
}
@Override
protected void disposed() {
super.disposed();
if (backgroundClr != null) {
backgroundClr.dispose();
}
}
@Override
protected void createColorControls() {
Composite colorControlComp = new Composite(shell, SWT.NONE);
colorControlComp.setLayout(new GridLayout(3, false));
colorControlComp.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT,
true, false));
/*
* Foreground/background radio buttons.
*/
foregroundRdo = new Button(colorControlComp, SWT.RADIO);
foregroundRdo.setText("Foreground Color");
foregroundRdo.setSelection(true);
foregroundRdo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
colorWheelComp.setColor(foregroundClr.getRGB());
}
});
GridData gd = new GridData();
gd.horizontalIndent = 13;
Button backgroundRdo = new Button(colorControlComp, SWT.RADIO);
backgroundRdo.setText("Background Color");
backgroundRdo.setLayoutData(gd);
backgroundRdo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
colorWheelComp.setColor(backgroundClr.getRGB());
}
});
/*
* Label displaying the foreground/background colors.
*/
gd = new GridData();
gd.horizontalIndent = 13;
previewLabel = new Label(colorControlComp, SWT.BORDER);
FontData fd = previewLabel.getFont().getFontData()[0];
fd.setHeight(16);
fd.setStyle(SWT.BOLD);
labelFont = new Font(getDisplay(), fd);
previewLabel.setFont(labelFont);
previewLabel.setText(" Sample Text ");
previewLabel.setLayoutData(gd);
previewLabel.setForeground(foregroundClr);
previewLabel.setBackground(backgroundClr);
}
@Override
protected void collectReturnValue() {
UserColorInfo colors = new UserColorInfo(foregroundClr.getRGB(),
backgroundClr.getRGB());
setReturnValue(colors);
}
@Override
public void colorChange(RGB rgb, String colorWheelTitle) {
if (foregroundRdo.getSelection()) {
foregroundClr.dispose();
foregroundClr = new Color(getDisplay(), rgb);
previewLabel.setForeground(foregroundClr);
} else {
backgroundClr.dispose();
backgroundClr = new Color(getDisplay(), rgb);
previewLabel.setBackground(backgroundClr);
}
}
}

View file

@ -0,0 +1,256 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui.colors;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.dialogs.colordialog.ColorWheelComp;
import com.raytheon.viz.ui.dialogs.colordialog.IColorWheelChange;
/**
* A dialog that displays a label with settable foreground color using a color
* control.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 09, 2015 3709 bclement Initial creation, logic from ForegroundBackgroundColorDlg
* Jan 13, 2015 3709 bclement return UserColorInfo instead of RGB
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class ForegroundColorDlg extends CaveSWTDialog implements
IColorWheelChange {
/** Color wheel composite. */
protected ColorWheelComp colorWheelComp;
/** Foreground color. */
protected Color foregroundClr = null;
/** preview label control. */
protected Label previewLabel = null;
/** Font for the preview label. */
protected Font labelFont = null;
protected final String description;
protected Label descriptionLabel = null;
/**
* Constructor.
*
* @param parentShell
* Parent shell.
*/
public ForegroundColorDlg(Shell parentShell, String description) {
this(parentShell, description, null);
}
/**
* Constructor.
*
* @param parentShell
* Parent shell.
* @param fgRGB
* Foreground RGB.
*/
public ForegroundColorDlg(Shell parentShell, String description, RGB fgRGB) {
super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.DO_NOT_BLOCK
| CAVE.PERSPECTIVE_INDEPENDENT);
setText("Foreground Color Chooser");
this.description = description;
/*
* If the foreground RGB is null then set it to a blue color.
*/
if (fgRGB == null) {
foregroundClr = new Color(parentShell.getDisplay(), new RGB(0, 0,
255));
} else {
foregroundClr = new Color(parentShell.getDisplay(), fgRGB);
}
}
@Override
protected Layout constructShellLayout() {
GridLayout mainLayout = new GridLayout(1, false);
mainLayout.verticalSpacing = 3;
return mainLayout;
}
@Override
protected Object constructShellLayoutData() {
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
return gd;
}
@Override
protected void disposed() {
if (foregroundClr != null) {
foregroundClr.dispose();
}
if (labelFont != null) {
labelFont.dispose();
}
if (descriptionLabel != null) {
descriptionLabel.dispose();
}
}
@Override
protected void initializeComponents(Shell shell) {
createColorWheelControl();
createColorControls();
if (description != null && !description.isEmpty()) {
createDescriptionLabel();
}
addSeparator();
createBottomButtons();
colorWheelComp.setColor(foregroundClr.getRGB());
}
/**
* Create the color wheel controls.
*/
protected void createColorWheelControl() {
colorWheelComp = new ColorWheelComp(shell, this, " Color Chooser: ",
true);
}
/**
* Create the color controls.
*/
protected void createColorControls() {
previewLabel = new Label(shell, SWT.BORDER);
FontData fd = previewLabel.getFont().getFontData()[0];
fd.setHeight(16);
fd.setStyle(SWT.BOLD);
labelFont = new Font(getDisplay(), fd);
previewLabel.setFont(labelFont);
previewLabel.setText(" Sample Text ");
previewLabel.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true,
true));
previewLabel.setForeground(foregroundClr);
}
/**
* Create a label that describes the scope of the color change.
*/
protected void createDescriptionLabel() {
descriptionLabel = new Label(shell, SWT.CENTER);
descriptionLabel.setText(description);
descriptionLabel.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true,
true));
}
/**
* Create the bottom OK/Cancel buttons.
*/
protected void createBottomButtons() {
Composite buttonComp = new Composite(shell, SWT.NONE);
buttonComp.setLayout(new GridLayout(2, false));
buttonComp.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true,
false));
int buttonWidth = 70;
GridData gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);
gd.widthHint = buttonWidth;
Button okBtn = new Button(buttonComp, SWT.PUSH);
okBtn.setText(" OK ");
okBtn.setLayoutData(gd);
okBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
collectReturnValue();
close();
}
});
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
gd.widthHint = buttonWidth;
Button cancelBtn = new Button(buttonComp, SWT.PUSH);
cancelBtn.setText(" Cancel ");
cancelBtn.setLayoutData(gd);
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
setReturnValue(null);
close();
}
});
}
/**
* Collect the return value from fields. Called when user clicks the ok
* button.
*/
protected void collectReturnValue() {
setReturnValue(new UserColorInfo(foregroundClr.getRGB()));
}
/**
* Add a separator line to the dialog.
*/
protected void addSeparator() {
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
Label sepLbl = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
sepLbl.setLayoutData(gd);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.colordialog.IColorWheelChange#colorChange
* (org.eclipse.swt.graphics.RGB, java.lang.String)
*/
@Override
public void colorChange(RGB rgb, String colorWheelTitle) {
foregroundClr.dispose();
foregroundClr = new Color(getDisplay(), rgb);
previewLabel.setForeground(foregroundClr);
}
}

View file

@ -0,0 +1,148 @@
package com.raytheon.uf.viz.collaboration.ui.colors;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManager;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IUser;
import com.raytheon.uf.viz.collaboration.display.data.ColorInfoMap;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.uf.viz.collaboration.ui.Activator;
/**
* Abstract class for persisting user color configuration to localization
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 13, 2014 3709 mapeters Initial creation.
* Dec 09, 2014 3709 mapeters setColors() sets foreground and background together.
* Jan 09, 2015 3709 bclement renamed from AbstractColorConfigManager
* moved colorInfoMap from subclasses to here
* Jan 13, 2015 3709 bclement renamed to PersistentColorConfigStorage, now a utility
*
* </pre>
*
* @author mapeters
* @version 1.0
*/
public abstract class PersistentColorConfigStorage<T extends IUser> {
protected static final String CONFIG_DIR_NAME = "collaboration";
private static final SingleTypeJAXBManager<ColorInfoMap> jaxb = SingleTypeJAXBManager
.createWithoutException(ColorInfoMap.class);
/**
* Persist color mapping configuration to localization file
*
* @param colorInfoMap
* @param filePath
*/
public void persistColors(Map<T, UserColorInfo> map, String filePath) {
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext lContext = pathMgr.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
LocalizationFile file = pathMgr.getLocalizationFile(lContext, filePath);
try {
jaxb.marshalToXmlFile(createStorageMap(map), file.getFile()
.getPath());
file.save();
} catch (Exception e) {
Activator.statusHandler.error(
"Unable to write color information to file: "
+ file.getName() + " in context " + lContext, e);
}
}
/**
* Convert runtime map to a map that can be serialized to storage
*
* @param colorInfoMap
* @return
*/
protected ColorInfoMap createStorageMap(Map<T, UserColorInfo> colorInfoMap) {
Map<String, UserColorInfo> rval = new HashMap<>(colorInfoMap.size());
for (Entry<T, UserColorInfo> entry : colorInfoMap.entrySet()) {
rval.put(convert(entry.getKey()), entry.getValue());
}
return new ColorInfoMap(rval);
}
/**
* Convert map from storage to runtime map
*
* @param persisted
* @return
*/
public Map<T, UserColorInfo> unpackStorageMap(
Map<String, UserColorInfo> persisted) {
Map<T, UserColorInfo> rval = new HashMap<>(persisted.size());
for (Entry<String, UserColorInfo> entry : persisted.entrySet()) {
rval.put(convert(entry.getKey()), entry.getValue());
}
return rval;
}
/**
* Convert user object to string key for storage
*
* @param user
* @return
*/
protected String convert(T user) {
return user.getClientIndependentId();
}
/**
* Convert persisted key to user object
*
* @param persisted
* @return
*/
protected abstract T convert(String persisted);
/**
* Get the color mapping configuration from localization
*
* @param filePath
* @return empty map if file does not exists in localization
*/
public Map<T, UserColorInfo> getColors(String filePath) {
IPathManager pm = (PathManager) PathManagerFactory.getPathManager();
LocalizationContext locContext = pm.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
LocalizationFile file = pm.getLocalizationFile(locContext, filePath);
Map<String, UserColorInfo> rval = null;
if (file != null && file.exists()) {
try {
ColorInfoMap map = jaxb.unmarshalFromXmlFile(file.getFile());
if (map != null) {
rval = map.getColors();
}
} catch (SerializationException e) {
Activator.statusHandler.error(
"Unable to read color information from file: "
+ file.getName() + " in level "
+ LocalizationLevel.USER, e);
}
}
if (rval == null) {
rval = new HashMap<>();
}
return unpackStorageMap(rval);
}
}

View file

@ -0,0 +1,106 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui.colors;
import java.util.Map;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
/**
* Session color manager that persists colors to localization
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 13, 2015 3709 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class PersistentSessionColorManager extends SessionColorManager {
private static final String ROOM_CONFIG_DIR = PersistentColorConfigStorage.CONFIG_DIR_NAME
+ IPathManager.SEPARATOR + "roomColors";
private final PersistentColorConfigStorage<VenueParticipant> storage = new PersistentColorConfigStorage<VenueParticipant>() {
@Override
protected VenueParticipant convert(String persisted) {
return IDConverter.convertFromRoom(persisted);
}
};
private final String configFilePath;
/**
* @param roomId
* @return
*/
public static PersistentSessionColorManager getManagerForRoom(String roomId) {
/*
* if multiple managers are created for the same room, it could cause
* concurrency issues with writing to localization. This could be solved
* with a soft reference cache here. However, since there *should* only
* be one of these per room id, it might be overkill
*/
return new PersistentSessionColorManager(roomId);
}
/**
* @param roomId
*/
protected PersistentSessionColorManager(String roomId) {
this.configFilePath = ROOM_CONFIG_DIR + IPathManager.SEPARATOR + roomId;
Map<VenueParticipant, UserColorInfo> persistedColors = storage
.getColors(configFilePath);
colors.putAll(persistedColors);
}
@Override
public String getDescription(VenueParticipant participant) {
return "Color changes will apply to the user " + participant.getName()
+ " only in the " + participant.getRoom() + " room.";
}
@Override
protected void setColorInternal(VenueParticipant user, UserColorInfo color) {
synchronized (storage) {
super.setColorInternal(user, color);
storage.persistColors(colors, configFilePath);
}
}
@Override
public void clearColors() {
synchronized (storage) {
super.clearColors();
storage.persistColors(colors, configFilePath);
}
}
}

View file

@ -0,0 +1,142 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.collaboration.ui.colors;
import java.util.Map;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IUser;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
import com.raytheon.uf.viz.collaboration.display.data.IColorManager;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
/**
* Custom user coloring configuration manager for use where the user's true
* identity is known (eg one-to-one chat)
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 13, 2014 3709 mapeters Initial creation.
* Nov 26, 2014 3709 mapeters Abstracted out code to {@link PersistentColorConfigStorage}.
* Dec 08, 2014 3709 mapeters Set foreground and background colors together.
* Jan 09, 2015 3709 bclement made into a true singleton, moved colorInfoMap to super
* Jan 13, 2015 3709 bclement refactored to use PersistentColorConfigStorage utility
*
* </pre>
*
* @author mapeters
* @version 1.0
*/
public class UserColorConfigManager implements IColorManager<IUser> {
private static final String FILE_PATH = PersistentColorConfigStorage.CONFIG_DIR_NAME
+ IPathManager.SEPARATOR + "userColorInfo.xml";
/* dark blue */
private static final UserColorInfo DEFAULT_USER_COLORS = new UserColorInfo(
new RGB(0, 0, 191));
/* red */
private static final UserColorInfo DEFAULT_PEER_COLORS = new UserColorInfo(
new RGB(255, 0, 0));
private static UserColorConfigManager instance;
public static synchronized UserColorConfigManager getInstance() {
if (instance == null) {
instance = new UserColorConfigManager();
}
return instance;
}
private final PersistentColorConfigStorage<IUser> storage = new PersistentColorConfigStorage<IUser>() {
@Override
protected IUser convert(String persisted) {
return IDConverter.convertFrom(persisted);
}
};
private Map<IUser, UserColorInfo> _colors;
protected UserColorConfigManager() {
}
@Override
public String getDescription(IUser user) {
return "Color changes will apply to one-on-one chat sessions with user "
+ user.getName() + ".";
}
@Override
public UserColorInfo getColorForUser(IUser user) {
Map<IUser, UserColorInfo> colorMap = getColorMap();
UserColorInfo rval = colorMap.get(user);
if (rval == null) {
CollaborationConnection conn = CollaborationConnection
.getConnection();
if (conn.getUser().isSameUser(user)) {
rval = DEFAULT_USER_COLORS;
} else {
rval = DEFAULT_PEER_COLORS;
}
}
return rval;
}
/**
* Get color mappings, goes to storage if not initialized
*
* @return
*/
private Map<IUser, UserColorInfo> getColorMap() {
synchronized (storage) {
if (_colors == null) {
_colors = storage.getColors(FILE_PATH);
}
}
return _colors;
}
@Override
public void setColorForUser(IUser user, UserColorInfo color) {
synchronized (storage) {
Map<IUser, UserColorInfo> colorMap = getColorMap();
colorMap.put(user, color);
storage.persistColors(colorMap, FILE_PATH);
}
}
@Override
public void clearColors() {
synchronized (storage) {
Map<IUser, UserColorInfo> colorMap = getColorMap();
colorMap.clear();
storage.persistColors(colorMap, FILE_PATH);
}
}
}

View file

@ -61,8 +61,6 @@ import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationC
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.ui.Activator;
import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
import com.raytheon.uf.viz.collaboration.ui.actions.ChatDisplayChangeEvent;
import com.raytheon.uf.viz.collaboration.ui.actions.ChatDisplayChangeEvent.ChangeType;
import com.raytheon.uf.viz.collaboration.ui.actions.CopyTextAction;
import com.raytheon.uf.viz.collaboration.ui.actions.CutTextAction;
import com.raytheon.uf.viz.collaboration.ui.actions.PasteTextAction;
@ -97,6 +95,11 @@ import com.raytheon.viz.ui.views.CaveFloatingView;
* Jun 27, 2014 3323 bclement fixed disposed font issue
* Oct 09, 2014 3711 mapeters Display chat text in accordance with preferences.
* Oct 14, 2014 3709 mapeters Support changing foreground/background color.
* Nov 14, 2014 3709 mapeters Changing foreground/background colors no longer
* implemented here, added messagesTextMenuMgr.
* Nov 26, 2014 3709 mapeters Added {@link #getColorFromRGB()}.
* Dec 08, 2014 3709 mapeters Removed messagesTextMenuMgr.
* Jan 13, 2015 3709 bclement styleAndAppendText() takes foreground and background
* </pre>
*
* @author rferrel
@ -149,9 +152,9 @@ public abstract class AbstractSessionView<T extends IUser> extends
protected abstract void setMessageLabel(Composite comp);
public AbstractSessionView() {
imageMap = new HashMap<String, Image>();
fonts = new HashMap<String, Font>();
colors = new HashMap<RGB, Color>();
imageMap = new HashMap<>();
fonts = new HashMap<>();
colors = new HashMap<>();
}
protected void initComponents(Composite parent) {
@ -223,16 +226,6 @@ public abstract class AbstractSessionView<T extends IUser> extends
store, "font"));
messagesText.setFont(messagesTextFont);
// grab the background color from preferences (default to white)
RGB bgColor = com.raytheon.uf.viz.core.preferences.PreferenceConverter
.getRGB(store, "bg", "white");
messagesText.setBackground(new Color(Display.getCurrent(), bgColor));
// grab the foreground color from preferences (default to black)
RGB fgColor = com.raytheon.uf.viz.core.preferences.PreferenceConverter
.getRGB(store, "fg", "black");
messagesText.setForeground(new Color(Display.getCurrent(), fgColor));
searchComp.setSearchText(messagesText);
// adding a menu item so that Paste can be found when clicking on the
@ -374,8 +367,8 @@ public abstract class AbstractSessionView<T extends IUser> extends
sb.append("(").append(time).append(") ");
int offset = sb.length();
boolean newLine = Activator.getDefault()
.getPreferenceStore().getBoolean("chatLines");
boolean newLine = Activator.getDefault().getPreferenceStore()
.getBoolean("chatLines");
String displayPreference = newLine ? ("\n ") : (": ");
sb.append(name).append(displayPreference).append(body);
@ -410,15 +403,10 @@ public abstract class AbstractSessionView<T extends IUser> extends
RGB rgb = new RGB(keyword.getRed(), keyword
.getGreen(), keyword.getBlue());
Color color = null;
// using the stored colors so we don't leak
if (colors.containsKey(rgb)) {
color = colors.get(rgb);
} else {
color = new Color(Display.getCurrent(),
rgb);
colors.put(rgb, color);
}
Color color = getColorFromRGB(rgb);
TextStyle style = new TextStyle(font,
color, null);
StyleRange keywordRange = new StyleRange(
@ -483,7 +471,8 @@ public abstract class AbstractSessionView<T extends IUser> extends
String name, T userId, String subject, List<StyleRange> ranges);
protected abstract void styleAndAppendText(StringBuilder sb, int offset,
String name, T userId, List<StyleRange> ranges, Color color);
String name, T userId, List<StyleRange> ranges, Color foreground,
Color background);
/**
* Find keys words in body of message starting at offset.
@ -591,23 +580,15 @@ public abstract class AbstractSessionView<T extends IUser> extends
}
@Subscribe
public void changeChatDisplay(ChatDisplayChangeEvent event) {
ChangeType type = event.getChangeType();
if (type == ChangeType.FOREGROUND) {
messagesText.setForeground(new Color(Display.getCurrent(), event.getColor()));
} else if (type == ChangeType.BACKGROUND) {
messagesText.setBackground(new Color(Display.getCurrent(), event
.getColor()));
} else if (type == ChangeType.FONT) {
Font oldFont = messagesTextFont;
messagesTextFont = new Font(Display.getCurrent(), event.getFont());
messagesText.setFont(messagesTextFont);
if (oldFont != null) {
oldFont.dispose();
}
public void changeFont(FontData data) {
Font oldFont = messagesTextFont;
messagesTextFont = new Font(Display.getCurrent(), data);
messagesText.setFont(messagesTextFont);
if (oldFont != null) {
oldFont.dispose();
}
}
public void setAlertWords(List<AlertWord> words) {
alertWords = words;
}
@ -657,14 +638,17 @@ public abstract class AbstractSessionView<T extends IUser> extends
builder.insert(0, "\n");
}
Color color = Display.getCurrent().getSystemColor(swtColor);
Color foreground = Display.getCurrent().getSystemColor(
swtColor);
Color background = Display.getCurrent().getSystemColor(
SWT.COLOR_WHITE);
StyleRange range = new StyleRange(messagesText
.getCharCount(), builder.length(), color, null,
SWT.BOLD);
.getCharCount(), builder.length(), foreground,
null, SWT.BOLD);
List<StyleRange> ranges = new ArrayList<StyleRange>();
ranges.add(range);
styleAndAppendText(builder, 0, builder.toString(), null,
ranges, color);
ranges, foreground, background);
}
// Archive the message
@ -680,4 +664,18 @@ public abstract class AbstractSessionView<T extends IUser> extends
});
}
/**
* Get corresponding Color from map using RGB
*
* @param rgb
* @return
*/
protected Color getColorFromRGB(RGB rgb) {
Color color = colors.get(rgb);
if (color == null) {
color = new Color(Display.getCurrent(), rgb);
colors.put(rgb, color);
}
return color;
}
}

View file

@ -33,11 +33,8 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.ColorDialog;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.IPartListener;
@ -54,6 +51,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
import com.raytheon.uf.viz.collaboration.comm.identity.invite.ColorPopulator;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IUser;
import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
import com.raytheon.uf.viz.collaboration.comm.provider.event.LeaderChangeEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
@ -65,6 +63,7 @@ import com.raytheon.uf.viz.collaboration.display.data.ColorChangeEvent;
import com.raytheon.uf.viz.collaboration.display.data.SessionContainer;
import com.raytheon.uf.viz.collaboration.display.data.SessionContainer.IDisplayContainerChangedListener;
import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.uf.viz.collaboration.display.rsc.SelfAddingSystemResourceListener;
import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingEvent;
import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingEvent.CollaborationEventType;
@ -73,6 +72,8 @@ import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDr
import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingToolLayer;
import com.raytheon.uf.viz.collaboration.display.rsc.telestrator.CollaborationDrawingUIManager;
import com.raytheon.uf.viz.collaboration.ui.Activator;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeTextColorAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeTextColorAction.ChangeTextColorCallback;
import com.raytheon.uf.viz.core.ContextManager;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
@ -106,6 +107,9 @@ import com.raytheon.viz.ui.input.EditableManager;
* Apr 15, 2014 2822 bclement only allow transfer leader if participant is using shared display
* May 05, 2014 3076 bclement added clear all action
* Jun 30, 2014 1798 bclement added disableCurrentLayer()
* Dev 02, 2014 3709 mapeters added {@link #initComponents()} override
* Jan 09, 2015 3709 bclement now uses ForegroundColorDlg for consistency
* Jan 13, 2015 3709 bclement now uses ChangeTextColorAction for consistency
*
* </pre>
*
@ -129,8 +133,6 @@ public class CollaborationSessionView extends SessionView implements
}
};
private Action colorChangeAction;
private Action leaderChangeAction;
private ActionContributionItem drawAction;
@ -238,28 +240,6 @@ public class CollaborationSessionView extends SessionView implements
protected void createActions() {
super.createActions();
Bundle bundle = Activator.getDefault().getBundle();
colorChangeAction = new Action("Change Color...",
IconUtil.getImageDescriptor(bundle, "change_color.gif")) {
@Override
public void run() {
ColorDialog dlg = new ColorDialog(Display.getCurrent()
.getActiveShell());
RGB rgb = dlg.open();
if (rgb != null) {
IStructuredSelection selection = (IStructuredSelection) usersTable
.getSelection();
VenueParticipant entry = (VenueParticipant) selection
.getFirstElement();
ColorChangeEvent event = new ColorChangeEvent(entry, rgb);
try {
session.sendObjectToVenue(event);
} catch (CollaborationException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to send color change to venue", e);
}
}
}
};
leaderChangeAction = new Action("Transfer Leadership",
IconUtil.getImageDescriptor(bundle, "leader_transfer.gif")) {
@ -594,7 +574,7 @@ public class CollaborationSessionView extends SessionView implements
|| session.hasRole(SharedDisplayRole.SESSION_LEADER)) {
if (session.hasRole(SharedDisplayRole.SESSION_LEADER)) {
manager.add(new Separator());
manager.add(colorChangeAction);
IStructuredSelection selection = (IStructuredSelection) usersTable
.getSelection();
VenueParticipant entry = (VenueParticipant) selection
@ -607,6 +587,55 @@ public class CollaborationSessionView extends SessionView implements
}
}
/**
* Callback used in the change color action. Gets the new color from the
* dialog and sends a color change event to the session
*/
private final ChangeTextColorCallback sendColorEventCallback = new ChangeTextColorCallback() {
@Override
public void newColor(IUser user, UserColorInfo colors) {
IStructuredSelection selection = (IStructuredSelection) usersTable
.getSelection();
VenueParticipant entry = (VenueParticipant) selection
.getFirstElement();
ColorChangeEvent event = new ColorChangeEvent(entry,
colors.getForeground());
try {
session.sendObjectToVenue(event);
} catch (CollaborationException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to send color change to venue", e);
}
}
};
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.collaboration.ui.session.SessionView#addColorAction
* (org.eclipse.jface.action.IMenuManager,
* com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant,
* boolean)
*/
@Override
protected void addColorAction(IMenuManager manager, VenueParticipant user,
boolean me) {
if (session.hasRole(SharedDisplayRole.SESSION_LEADER)) {
String colorActionKey = user.getFQName();
ChangeTextColorAction<VenueParticipant> userColorAction = userColorActions
.get(colorActionKey);
if (userColorAction == null) {
userColorAction = new ChangeTextColorAction<VenueParticipant>(
user, me, me, true, colorManager);
userColorAction.setActionCallback(sendColorEventCallback);
userColorActions.put(colorActionKey, userColorAction);
}
manager.add(userColorAction);
}
}
@Subscribe
public void modifyColors(ColorPopulator populator) {
VizApp.runAsync(new Runnable() {

View file

@ -38,6 +38,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.session.SharedDisplaySess
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.uf.viz.collaboration.ui.AbstractUserLabelProvider;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
@ -58,6 +59,7 @@ import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
* Feb 13, 2014 2751 njensen Added leader icons
* Feb 18, 2014 2751 bclement changed tooltip from JID to UserId
* Oct 10, 2014 3708 bclement SiteConfigurationManager changes, added actingSite
* Jan 13, 2015 3709 bclement added support for foreground and background colors
*
* </pre>
*
@ -71,10 +73,13 @@ public class ParticipantsLabelProvider extends
protected String sessionId = null;
private String actingSite;
private static final RGB DEFAULT_FOREGROUND = new RGB(0,0,0);
private static final RGB DEFAULT_BACKGROUND = new RGB(255,255,255);
protected Map<RGB, Color> colors = new HashMap<RGB, Color>();
private SessionColorManager manager;
private SessionColorManager sessionColorManager;
private Font boldFont;
@ -160,9 +165,34 @@ public class ParticipantsLabelProvider extends
return null;
}
VenueParticipant user = ((VenueParticipant) element);
RGB rgb = manager.getColorForUser(user);
UserColorInfo colors = sessionColorManager.getColorForUser(user);
RGB rgb = colors.getForeground();
return getTextColor(rgb, DEFAULT_FOREGROUND);
}
@Override
public Color getBackground(Object element) {
if (!(element instanceof VenueParticipant)) {
return null;
}
VenueParticipant user = ((VenueParticipant) element);
UserColorInfo colors = sessionColorManager.getColorForUser(user);
RGB rgb = colors.getBackground();
return getTextColor(rgb, DEFAULT_BACKGROUND);
}
/**
* Gets text coloring for participant.
*
* @param rgb
* @param defaultColor
* @return default if rgb is null
*/
private Color getTextColor(RGB rgb, RGB defaultColor) {
if (rgb == null) {
rgb = new RGB(0, 0, 0);
rgb = defaultColor;
}
Color color = colors.get(rgb);
if (color == null) {
@ -252,8 +282,8 @@ public class ParticipantsLabelProvider extends
* @param manager
* the manager to set
*/
public void setManager(SessionColorManager manager) {
this.manager = manager;
public void setSessionColorManager(SessionColorManager manager) {
this.sessionColorManager = manager;
}
@Override

View file

@ -25,6 +25,7 @@ import java.text.SimpleDateFormat;
import java.util.List;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
@ -47,7 +48,10 @@ import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationC
import com.raytheon.uf.viz.collaboration.comm.provider.user.RosterItem;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeTextColorAction;
import com.raytheon.uf.viz.collaboration.ui.actions.PrintLogActionContributionItem;
import com.raytheon.uf.viz.collaboration.ui.colors.UserColorConfigManager;
import com.raytheon.uf.viz.collaboration.ui.notifier.NotifierTask;
import com.raytheon.uf.viz.collaboration.ui.notifier.NotifierTools;
import com.raytheon.uf.viz.core.sounds.SoundUtil;
@ -66,6 +70,14 @@ import com.raytheon.uf.viz.core.sounds.SoundUtil;
* Feb 13, 2014 2751 bclement made parent generic
* Feb 28, 2014 2632 mpduff Override appendMessage for notifiers
* Jun 17, 2014 3078 bclement changed peer type to IUser
* Nov 14, 2014 3709 mapeters support foregound/background color
* settings for each user
* Nov 26, 2014 3709 mapeters add colorConfigManager, use parent's colors map
* Dec 08, 2014 3709 mapeters move color change actions to menu bar.
* Dec 12, 2014 3709 mapeters Store {@link ChangeTextColorAction}s as fields,
* dispose them.
* Jan 09, 2015 3709 bclement color config manager API changes
* Jan 13, 2015 3709 bclement ChangeTextColorAction API changes
*
* </pre>
*
@ -81,21 +93,24 @@ public class PeerToPeerView extends AbstractSessionView<IUser> implements
public static final String ID = "com.raytheon.uf.viz.collaboration.PeerToPeerView";
private static Color userColor = null;
private static final Color BLACK = Display.getCurrent().getSystemColor(
SWT.COLOR_BLACK);
private static Color chatterColor = null;
private static Color black = null;
private static final Color WHITE = Display.getCurrent().getSystemColor(
SWT.COLOR_WHITE);
private IUser peer;
private boolean online = true;
private static UserColorConfigManager colorManager;
private ChangeTextColorAction<IUser> userColorAction;
private ChangeTextColorAction<IUser> peerColorAction;
public PeerToPeerView() {
super();
userColor = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE);
chatterColor = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
black = Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
CollaborationConnection.getConnection().registerEventHandler(this);
}
@ -112,6 +127,10 @@ public class PeerToPeerView extends AbstractSessionView<IUser> implements
if (conn != null) {
conn.unregisterEventHandler(this);
}
userColorAction.dispose();
peerColorAction.dispose();
super.dispose();
}
@ -200,36 +219,41 @@ public class PeerToPeerView extends AbstractSessionView<IUser> implements
if (connection == null) {
return;
}
Color color = null;
Color foreground;
Color background;
if (userId == null) {
color = black;
} else if (!userId.equals(connection.getUser())) {
color = chatterColor;
foreground = BLACK;
background = WHITE;
} else {
color = userColor;
UserColorInfo colors = colorManager.getColorForUser(userId);
foreground = getColorFromRGB(colors.getForeground());
background = getColorFromRGB(colors.getBackground());
}
styleAndAppendText(sb, offset, name, userId, ranges, color);
styleAndAppendText(sb, offset, name, userId, ranges, foreground,
background);
};
@Override
public void styleAndAppendText(StringBuilder sb, int offset, String name,
IUser userId, List<StyleRange> ranges, Color color) {
StyleRange range = new StyleRange(messagesText.getCharCount(), offset,
color, null, SWT.NORMAL);
IUser userId, List<StyleRange> ranges, Color foreground,
Color background) {
StyleRange range = new StyleRange(messagesText.getCharCount(),
sb.length(), foreground, null, SWT.NORMAL);
ranges.add(range);
if (userId != null) {
range = new StyleRange(messagesText.getCharCount() + offset,
name.length() + 1, color, null, SWT.BOLD);
} else {
range = new StyleRange(messagesText.getCharCount() + offset,
sb.length() - offset, color, null, SWT.BOLD);
}
range = new StyleRange(messagesText.getCharCount() + offset,
(userId != null ? name.length() + 1 : sb.length() - offset),
foreground, null, SWT.BOLD);
ranges.add(range);
messagesText.append(sb.toString());
for (StyleRange newRange : ranges) {
messagesText.setStyleRange(newRange);
}
messagesText.setTopIndex(messagesText.getLineCount() - 1);
int lineNumber = messagesText.getLineCount() - 1;
messagesText.setLineBackground(lineNumber, 1, background);
messagesText.setTopIndex(lineNumber);
}
@Override
@ -295,6 +319,7 @@ public class PeerToPeerView extends AbstractSessionView<IUser> implements
@Override
protected void initComponents(Composite parent) {
super.initComponents(parent);
colorManager = UserColorConfigManager.getInstance();
// unfortunately this code cannot be a part of createToolbarButton
// because I cannot instantiate the ACI until after the messagesText
@ -351,4 +376,31 @@ public class PeerToPeerView extends AbstractSessionView<IUser> implements
return peer.getFQName();
}
}
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
createDropDownMenu();
}
/**
* Initialize drop-down menu with action to change user text colors.
*/
private void createDropDownMenu() {
IMenuManager mgr = getViewSite().getActionBars().getMenuManager();
UserId myUser = CollaborationConnection.getConnection().getUser();
userColorAction = new ChangeTextColorAction<IUser>(myUser, true, true,
false, colorManager);
mgr.add(userColorAction);
}
/**
* Add action to change peer text colors to drop-down menu once peer is set.
*/
public void addChangePeerColorAction() {
IMenuManager mgr = getViewSite().getActionBars().getMenuManager();
peerColorAction = new ChangeTextColorAction<IUser>(peer, false, true,
false, colorManager);
mgr.add(peerColorAction);
}
}

View file

@ -19,8 +19,6 @@
**/
package com.raytheon.uf.viz.collaboration.ui.session;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.jface.action.Action;
@ -30,13 +28,8 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.ColorDialog;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.jivesoftware.smack.packet.Presence;
import org.osgi.framework.Bundle;
import com.google.common.eventbus.Subscribe;
import com.raytheon.uf.viz.collaboration.comm.identity.IMessage;
@ -44,12 +37,9 @@ import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformatio
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
import com.raytheon.uf.viz.collaboration.ui.Activator;
import com.raytheon.uf.viz.collaboration.ui.SiteColorConfigManager;
import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation;
import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeTextColorAction;
import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
import com.raytheon.uf.viz.core.icon.IconUtil;
/**
* Built for the session in which everyone joins
@ -77,6 +67,12 @@ import com.raytheon.uf.viz.core.icon.IconUtil;
* Apr 01, 2014 2938 mpduff Update logic for site and role changes.
* Apr 22, 2014 3038 bclement added initialized flag to differentiate between roster population and new joins
* Oct 10, 2014 3708 bclement SiteConfigurationManager refactor
* Nov 26, 2014 3709 mapeters support foreground/background color preferences for each site
* Dec 08, 2014 3709 mapeters Removed ChangeSiteColorAction, uses {@link ChangeTextColorAction}.
* Dec 12, 2014 3709 mapeters Store {@link ChangeTextColorAction}s in map, dispose them.
* Jan 05, 2015 3709 mapeters Use both site and user name as key in siteColorActions map.
* Jan 09, 2015 3709 bclement color config manager API changes
* Jan 12, 2015 3709 bclement use parent object's session color manager, colors now based on user, not site
*
* </pre>
*
@ -88,16 +84,12 @@ public class SessionFeedView extends SessionView {
public static final String ID = "com.raytheon.uf.viz.collaboration.SessionFeedView";
private Action colorChangeAction;
private Action autoJoinAction;
private Action userAddSiteAction;
private Action userRemoveSiteAction;
private List<SiteColor> colors;
private String actingSite;
/**
@ -112,9 +104,8 @@ public class SessionFeedView extends SessionView {
*/
public SessionFeedView() {
super();
actingSite = CollaborationConnection.getConnection()
.getPresence().getProperty(SiteConfigInformation.SITE_NAME)
.toString();
actingSite = CollaborationConnection.getConnection().getPresence()
.getProperty(SiteConfigInformation.SITE_NAME).toString();
}
/*
@ -127,14 +118,6 @@ public class SessionFeedView extends SessionView {
@Override
protected void initComponents(Composite parent) {
super.initComponents(parent);
colors = SiteColorConfigManager.getSiteColors();
if (colors != null) {
for (VenueParticipant user : session.getVenue().getParticipants()) {
setColorForSite(user);
}
} else {
colors = new ArrayList<SiteColor>();
}
usersTable.refresh();
}
@ -152,37 +135,6 @@ public class SessionFeedView extends SessionView {
@Override
protected void createActions() {
super.createActions();
Bundle bundle = Activator.getDefault().getBundle();
colorChangeAction = new Action("Change Site Color...",
IconUtil.getImageDescriptor(bundle, "change_color.gif")) {
@Override
public void run() {
ColorDialog dlg = new ColorDialog(Display.getCurrent()
.getActiveShell());
RGB rgb = dlg.open();
if (rgb != null) {
/*
* get the selected entry so we know what site to change the
* color for
*/
String site = getSelectedSite();
replaceSiteColor(site.toString(), rgb);
/*
* loop through all the entries in the list so we can set
* the color for all sites corresponding to "selectedSite"
*/
if (site != null) {
for (VenueParticipant user : session.getVenue()
.getParticipants()) {
setColorForSite(user);
}
}
usersTable.refresh();
}
}
};
autoJoinAction = new Action(CollabPrefConstants.AUTO_JOIN, SWT.TOGGLE) {
@Override
@ -238,7 +190,6 @@ public class SessionFeedView extends SessionView {
@Override
protected void fillContextMenu(IMenuManager manager) {
super.fillContextMenu(manager);
manager.add(colorChangeAction);
String site = getSelectedSite();
if (!SiteConfigurationManager.isVisible(actingSite, site)) {
userAddSiteAction
@ -293,20 +244,21 @@ public class SessionFeedView extends SessionView {
// should we append?
if (site == null
|| SiteConfigurationManager
.isVisible(actingSite, site.toString())) {
|| SiteConfigurationManager.isVisible(actingSite,
site.toString())) {
appendMessage(msg);
}
}
@Override
protected void styleAndAppendText(StringBuilder sb, int offset,
String name, VenueParticipant userId, String subject,
List<StyleRange> ranges) {
if (subject != null) {
setColorForSite(userId, subject);
}
super.styleAndAppendText(sb, offset, name, userId, subject, ranges);
/**
* Get the selected user
*
* @return
*/
private VenueParticipant getSelectedParticipant() {
IStructuredSelection selection = (IStructuredSelection) usersTable
.getSelection();
return (VenueParticipant) selection.getFirstElement();
}
/**
@ -316,77 +268,12 @@ public class SessionFeedView extends SessionView {
* @return
*/
private String getSelectedSite() {
IStructuredSelection selection = (IStructuredSelection) usersTable
.getSelection();
VenueParticipant selectedEntry = (VenueParticipant) selection
.getFirstElement();
VenueParticipant selectedEntry = getSelectedParticipant();
Presence pres = session.getVenue().getPresence(selectedEntry);
Object selectedSite = pres.getProperty(SiteConfigInformation.SITE_NAME);
return selectedSite == null ? "" : selectedSite.toString();
}
/**
* Takes an IRosterEntry and sets their color in the SessionColorManager for
* the site that they belong to, calls into
* setColorForSite(UserId,IPresence)
*
* @param user
*/
private void setColorForSite(VenueParticipant user) {
Presence presence = session.getVenue().getPresence(user);
setColorForSite(user, presence);
}
/**
* Does the work for setting the color for each user that belongs to a site
*
* @param id
* @param presence
*/
private void setColorForSite(VenueParticipant id, Presence presence) {
if (presence == null) {
return;
}
Object site = presence.getProperty(SiteConfigInformation.SITE_NAME);
if (site != null) {
setColorForSite(id, site.toString());
}
}
private void setColorForSite(VenueParticipant id, String site) {
SiteColor siteColor = new SiteColor();
siteColor.setSite(site.toString());
int index = colors.indexOf(siteColor);
if (index >= 0) {
SiteColor actualColor = colors.get(index);
colorManager.setColorForUser(id, actualColor.getColor());
}
}
/**
* Removes the color from the map if the site exists in the list
*
* @param site
* @param rgb
*/
private void replaceSiteColor(String site, RGB rgb) {
// now that the users have their color set, we need to add
// to the list that has the site color information
SiteColor color = new SiteColor();
color.setSite(site);
color.setColor(rgb);
boolean exists = false;
for (SiteColor col : SessionFeedView.this.colors) {
if (col.getSite().equals(site)) {
exists = true;
}
}
if (exists) {
SessionFeedView.this.colors.remove(color);
}
SessionFeedView.this.colors.add(color);
}
/*
* (non-Javadoc)
*
@ -450,11 +337,6 @@ public class SessionFeedView extends SessionView {
}
}
/*
* Presence changed is triggered for participant's site being changed.
* Need to set the color to handle this situation.
*/
setColorForSite(participant, presence);
refreshParticipantList();
}
@ -540,17 +422,4 @@ public class SessionFeedView extends SessionView {
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.collaboration.ui.session.SessionView#dispose()
*/
@Override
public void dispose() {
super.dispose();
SiteColorInformation information = new SiteColorInformation();
information.setColors(this.colors);
// TODO should color config be written more often?
SiteColorConfigManager.writeSiteColorInformation(information);
}
}

View file

@ -53,7 +53,6 @@ import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@ -82,9 +81,13 @@ import com.raytheon.uf.viz.collaboration.comm.provider.session.VenueSession;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
import com.raytheon.uf.viz.collaboration.display.data.UserColorInfo;
import com.raytheon.uf.viz.collaboration.ui.Activator;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeTextColorAction;
import com.raytheon.uf.viz.collaboration.ui.actions.ChangeTextColorAction.ChangeTextColorCallback;
import com.raytheon.uf.viz.collaboration.ui.actions.PeerToPeerChatAction;
import com.raytheon.uf.viz.collaboration.ui.actions.PrintLogActionContributionItem;
import com.raytheon.uf.viz.collaboration.ui.colors.PersistentSessionColorManager;
import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.sounds.SoundUtil;
@ -115,6 +118,12 @@ import com.raytheon.uf.viz.core.sounds.SoundUtil;
* negative weights - set to zero if negative.
* Jun 17, 2014 3078 bclement added private chat to menu and double click
* Jul 03, 2014 3342 bclement added count to participants label
* Nov 26, 2014 3709 mapeters added styleAndAppendText() taking fg and bg colors,
* use parent's colors map.
* Dec 02, 2014 3709 mapeters added color actions for group chats without shared display.
* Dec 12, 2014 3709 mapeters Store {@link ChangeTextColorAction}s in map, dispose them.
* Jan 09, 2015 3709 bclement color config manager API changes
* Jan 12, 2015 3709 bclement unified color management into SessionColorManager
*
* </pre>
*
@ -148,7 +157,17 @@ public class SessionView extends AbstractSessionView<VenueParticipant>
protected SessionColorManager colorManager;
protected Map<RGB, Color> mappedColors;
protected Map<String, ChangeTextColorAction<VenueParticipant>> userColorActions = new HashMap<>();
/*
* callback used to refresh participant list when the user adds/changes a
* custom color configuration for a participant
*/
protected final ChangeTextColorCallback refreshCallback = new ChangeTextColorCallback() {
public void newColor(IUser user, UserColorInfo colors) {
refreshParticipantList();
}
};
public SessionView() {
super();
@ -159,7 +178,6 @@ public class SessionView extends AbstractSessionView<VenueParticipant>
super.createPartControl(parent);
createActions();
createContextMenu();
mappedColors = new HashMap<RGB, Color>();
}
/*
@ -221,9 +239,26 @@ public class SessionView extends AbstractSessionView<VenueParticipant>
IStructuredSelection selection = (IStructuredSelection) usersTable
.getSelection();
VenueParticipant entry = (VenueParticipant) selection.getFirstElement();
if (!entry.isSameUser(session.getUserID())) {
boolean me = entry.isSameUser(session.getUserID());
if (!me) {
manager.add(new PeerToPeerChatAction(entry));
}
addColorAction(manager, entry, me);
}
protected void addColorAction(IMenuManager manager, VenueParticipant user,
boolean me) {
String colorActionKey = user.getFQName();
ChangeTextColorAction<VenueParticipant> userColorAction = userColorActions
.get(colorActionKey);
if (userColorAction == null) {
userColorAction = new ChangeTextColorAction<VenueParticipant>(user,
me, me, false, colorManager);
userColorAction.setActionCallback(refreshCallback);
userColorActions.put(colorActionKey, userColorAction);
}
manager.add(userColorAction);
}
@Subscribe
@ -242,7 +277,13 @@ public class SessionView extends AbstractSessionView<VenueParticipant>
}
protected void initColorManager() {
colorManager = new SessionColorManager();
IVenue venue = session.getVenue();
if (venue.isPersistent()) {
colorManager = PersistentSessionColorManager
.getManagerForRoom(venue.getId());
} else {
colorManager = new SessionColorManager();
}
}
protected void createUsersComp(final Composite parent) {
@ -344,7 +385,7 @@ public class SessionView extends AbstractSessionView<VenueParticipant>
usersTable.getTable().setLayout(layout);
usersTable.getTable().setLayoutData(data);
ParticipantsLabelProvider labelProvider = new ParticipantsLabelProvider();
ParticipantsLabelProvider labelProvider = createParticipantsLabelProvider();
setParticipantValues(labelProvider);
usersTable.setContentProvider(ArrayContentProvider.getInstance());
@ -395,9 +436,13 @@ public class SessionView extends AbstractSessionView<VenueParticipant>
((GridData) usersComp.getLayoutData()).exclude = true;
}
protected ParticipantsLabelProvider createParticipantsLabelProvider() {
return new ParticipantsLabelProvider();
}
protected void setParticipantValues(ParticipantsLabelProvider labelProvider) {
labelProvider.setSessionId(sessionId);
labelProvider.setManager(colorManager);
labelProvider.setSessionColorManager(colorManager);
}
@Override
@ -408,14 +453,11 @@ public class SessionView extends AbstractSessionView<VenueParticipant>
disposeArrow(downArrow);
disposeArrow(rightArrow);
if (mappedColors != null) {
for (Color col : mappedColors.values()) {
col.dispose();
if (userColorActions != null) {
for (ChangeTextColorAction<?> userColorAction : userColorActions
.values()) {
userColorAction.dispose();
}
mappedColors.clear();
}
if (colorManager != null) {
colorManager.clearColors();
}
// clean up event handlers
@ -470,13 +512,10 @@ public class SessionView extends AbstractSessionView<VenueParticipant>
protected void styleAndAppendText(StringBuilder sb, int offset,
String name, VenueParticipant userId, String subject,
List<StyleRange> ranges) {
RGB rgb = colorManager.getColorForUser(userId);
if (mappedColors.get(rgb) == null) {
Color col = new Color(Display.getCurrent(), rgb);
mappedColors.put(rgb, col);
}
UserColorInfo colors = colorManager.getColorForUser(userId);
styleAndAppendText(sb, offset, name, userId, ranges,
mappedColors.get(rgb));
getColorFromRGB(colors.getForeground()),
getColorFromRGB(colors.getBackground()), subject);
}
/*
@ -490,23 +529,28 @@ public class SessionView extends AbstractSessionView<VenueParticipant>
@Override
protected void styleAndAppendText(StringBuilder sb, int offset,
String name, VenueParticipant userId, List<StyleRange> ranges,
Color color) {
StyleRange range = new StyleRange(messagesText.getCharCount(), offset,
color, null, SWT.NORMAL);
Color foreground, Color background) {
styleAndAppendText(sb, offset, name, userId, ranges, foreground,
background, null);
}
protected void styleAndAppendText(StringBuilder sb, int offset,
String name, VenueParticipant userId, List<StyleRange> ranges,
Color fgColor, Color bgColor, String subject) {
StyleRange range = new StyleRange(messagesText.getCharCount(),
sb.length(), fgColor, null, SWT.NORMAL);
ranges.add(range);
if (userId != null) {
range = new StyleRange(messagesText.getCharCount() + offset,
name.length() + 1, color, null, SWT.BOLD);
} else {
range = new StyleRange(messagesText.getCharCount() + offset,
sb.length() - offset, color, null, SWT.BOLD);
}
range = new StyleRange(messagesText.getCharCount() + offset,
(userId != null ? name.length() + 1 : sb.length() - offset),
fgColor, null, SWT.BOLD);
ranges.add(range);
messagesText.append(sb.toString());
for (StyleRange newRange : ranges) {
messagesText.setStyleRange(newRange);
}
messagesText.setTopIndex(messagesText.getLineCount() - 1);
int lineNumber = messagesText.getLineCount() - 1;
messagesText.setLineBackground(lineNumber, 1, bgColor);
messagesText.setTopIndex(lineNumber);
}
public String getRoom() {

View file

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: Coopprecip
Bundle-SymbolicName: com.raytheon.uf.viz.coopprecip
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.coopprecip.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.core.runtime,
com.raytheon.uf.viz.datacube

View file

@ -1,30 +0,0 @@
package com.raytheon.uf.viz.coopprecip;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
private static BundleContext context;
static BundleContext getContext() {
return context;
}
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
}
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}
}

View file

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: Cwa Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.cwa
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.cwa.Activator
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
@ -29,8 +28,7 @@ Import-Package: com.raytheon.uf.common.dataplugin,
org.eclipse.ui.plugin,
org.opengis.referencing.crs,
org.osgi.framework
Export-Package: com.raytheon.uf.viz.cwa,
com.raytheon.uf.viz.cwa.rsc
Export-Package: com.raytheon.uf.viz.cwa.rsc
Require-Bundle: com.raytheon.uf.viz.core,
org.apache.batik,
com.raytheon.uf.viz.core,

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<menuContributionFile>
<include installTo="menu:Aviation?before=CenterWeatherEnd"
fileName="menus/upperair/baseAviationCWA.xml" />
</menuContributionFile>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/CWA.xml"
menuText="Center Weather Advisories" id="cwa">
</contribute>
</menuTemplate>

View file

@ -1,69 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.cwa;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.cwa";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.cwat;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.cwat.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
@ -15,4 +14,3 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.cwat

View file

@ -1,69 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.cwat;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.cwat";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: Core Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.core;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.d2d.core.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,

View file

@ -1,69 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.d2d.core;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.d2d.core";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -1,8 +0,0 @@
#Thu Feb 17 14:26:57 CST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,8 +0,0 @@
#Sat Apr 09 08:47:34 CDT 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -2,9 +2,9 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: D2D Nsharp
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.nsharp;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Version: 1.14.1.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Require-Bundle: com.raytheon.uf.viz.core;bundle-version="1.14.0",
com.raytheon.viz.ui;bundle-version="1.14.0",

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<menuContributionFile>
<include subMenu="US Western" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseUSWestern.xml" />
<include subMenu="US Central" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseUSCentral.xml" />
<include subMenu="US Eastern" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseUSEastern.xml" />
<include subMenu="Canada North" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseCanadaNorth.xml" />
<include subMenu="Canada Western" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseCanadaWestern.xml" />
<include subMenu="Canada Central" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseCanadaCentral.xml" />
<include subMenu="Canada Eastern" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseCanadaEastern.xml" />
<include subMenu="Mexico" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseMexico.xml" />
<include subMenu="Atlantic" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseAtlantic.xml" />
<include subMenu="Japan/South Asia" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseJapan.xml" />
<include subMenu="Australia" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseAustralia.xml" />
<include subMenu="China" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseChina.xml" />
<include subMenu="Russia" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseRussia.xml" />
<include subMenu="Pacific East" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/basePacificEast.xml" />
<include subMenu="Pacific West" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/basePacificWest.xml" />
<include subMenu="Alaska" installTo="menu:upperAir?before=RAOBMenuEnd"
fileName="menus/upperair/baseAlaska.xml" />
</menuContributionFile>

Some files were not shown because too many files have changed in this diff Show more