Omaha #1255 added collaboration specific color presets

Change-Id: I57bb20d0de10fdc256f6177489760e12c297662f

Former-commit-id: 08724fefd7 [formerly 8b5ad1ec33] [formerly 08724fefd7 [formerly 8b5ad1ec33] [formerly eac871eed7 [formerly 87ed36851c390058ab4c92977ecc552cab869d26]]]
Former-commit-id: eac871eed7
Former-commit-id: ea1ac8ee8f [formerly cd282ef018]
Former-commit-id: d066846c3f
This commit is contained in:
Brian Clements 2014-07-02 09:52:48 -05:00
parent 8c99b38625
commit 2cd0d94e5d
3 changed files with 135 additions and 2 deletions

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!--
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.
-->
<configuration>
<collaborationParticipantColor>DeepSkyBlue3</collaborationParticipantColor>
<collaborationParticipantColor>DarkOrange3</collaborationParticipantColor>
<collaborationParticipantColor>ForestGreen</collaborationParticipantColor>
<collaborationParticipantColor>firebrick3</collaborationParticipantColor>
<collaborationParticipantColor>MediumPurple3</collaborationParticipantColor>
<collaborationParticipantColor>DarkGoldenrod3</collaborationParticipantColor>
<collaborationParticipantColor>HotPink3</collaborationParticipantColor>
<collaborationParticipantColor>burlywood4</collaborationParticipantColor>
<collaborationParticipantColor>CornflowerBlue</collaborationParticipantColor>
<collaborationParticipantColor>OrangeRed2</collaborationParticipantColor>
<collaborationParticipantColor>DarkOliveGreen4</collaborationParticipantColor>
<collaborationParticipantColor>BlueViolet</collaborationParticipantColor>
<collaborationParticipantColor>SkyBlue3</collaborationParticipantColor>
<collaborationParticipantColor>orange3</collaborationParticipantColor>
<collaborationParticipantColor>chartreuse4</collaborationParticipantColor>
<collaborationParticipantColor>brown2</collaborationParticipantColor>
<collaborationParticipantColor>gold4</collaborationParticipantColor>
<collaborationParticipantColor>magenta3</collaborationParticipantColor>
<collaborationParticipantColor>CadetBlue4</collaborationParticipantColor>
<collaborationParticipantColor>green3</collaborationParticipantColor>
<collaborationParticipantColor>coral3</collaborationParticipantColor>
<collaborationParticipantColor>khaki4</collaborationParticipantColor>
<collaborationParticipantColor>DarkOrchid3</collaborationParticipantColor>
<collaborationParticipantColor>chocolate3</collaborationParticipantColor>
<collaborationParticipantColor>DodgerBlue2</collaborationParticipantColor>
<collaborationParticipantColor>OliveDrab4</collaborationParticipantColor>
<collaborationParticipantColor>DarkRed</collaborationParticipantColor>
<collaborationParticipantColor>tan3</collaborationParticipantColor>
<collaborationParticipantColor>DeepPink3</collaborationParticipantColor>
<collaborationParticipantColor>SeaGreen</collaborationParticipantColor>
<collaborationParticipantColor>DarkViolet</collaborationParticipantColor>
<collaborationParticipantColor>DarkTurquoise</collaborationParticipantColor>
</configuration>

View file

@ -1,12 +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.
**/
package com.raytheon.uf.viz.collaboration.display;
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.viz.core.jobs.StatsJob;
import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
/**
* Activator for Collaboration Display bundle
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 2012 ? ? Initial creation
* Jul 02, 2014 1255 bclement added prefs store
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class Activator implements BundleActivator {
public static final IUFStatusHandler statusHandler = UFStatus
@ -14,6 +53,11 @@ public class Activator implements BundleActivator {
private static BundleContext context;
// The shared instance
private static Activator plugin;
private IPersistentPreferenceStore prefs;
private StatsJob statsJob = new StatsJob(
"Collaboration Network Statistics",
com.raytheon.uf.viz.collaboration.comm.Activator.getDefault()
@ -33,6 +77,7 @@ public class Activator implements BundleActivator {
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
statsJob.schedule();
plugin = this;
}
/*
@ -46,4 +91,22 @@ public class Activator implements BundleActivator {
statsJob.shutdown();
}
/**
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
/**
* @return the preference store
*/
public IPreferenceStore getPreferenceStore() {
if (prefs == null) {
prefs = new HierarchicalPreferenceStore(context
.getBundle().getSymbolicName());
}
return prefs;
}
}

View file

@ -25,7 +25,9 @@ import java.util.Map;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
import com.raytheon.viz.core.ColorUtil;
import com.raytheon.uf.viz.collaboration.display.Activator;
import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
/**
*
@ -41,6 +43,7 @@ import com.raytheon.viz.core.ColorUtil;
* Apr 03, 2012 mnash Initial creation
* Jan 30, 2014 2698 bclement changed UserId to VenueParticipant
* Mar 06, 2014 2848 bclement synchronized color access
* Jul 02, 2014 1255 bclement collaboration specific RGB presets
*
* </pre>
*
@ -50,9 +53,22 @@ import com.raytheon.viz.core.ColorUtil;
public class SessionColorManager {
public static final String SESSION_COLOR_PREFERENCE_KEY = "collaborationParticipantColor";
private final Map<VenueParticipant, RGB> colors = new HashMap<VenueParticipant, RGB>();
private static final RGB[] rgbPresets = ColorUtil.getResourceColorPresets();
private static final RGB[] rgbPresets;
static {
HierarchicalPreferenceStore prefs = (HierarchicalPreferenceStore) Activator
.getDefault().getPreferenceStore();
String[] names = prefs.getStringArray(SESSION_COLOR_PREFERENCE_KEY);
rgbPresets = new RGB[names.length];
int i = 0;
for (String name : names) {
rgbPresets[i++] = RGBColors.getRGBColor(name);
}
}
/**
* Get a map of venue participants to their assigned colors used for