Merge branch 'master_14.4.1' into emc_14.4.1

Change-Id: I4984b06810f3484e919a4a4a5853435ca34167bb

Former-commit-id: c69e94f227cb908a9af2e1cd2db35b25bef28701
This commit is contained in:
Ana Rivera 2014-11-21 14:23:49 +00:00
commit 1645ccd9ca
1214 changed files with 97968 additions and 119833 deletions

1
.gitignore vendored
View file

@ -7,6 +7,7 @@ testBin/
bin-test/
*.class
*.pyo
*.pyc
*.o
*.orig

View file

@ -245,6 +245,10 @@
<param name="feature"
value="com.raytheon.uf.viz.ncep.core.feature" />
</antcall>
<antcall target="p2.build.repo">
<param name="feature"
value="com.raytheon.uf.viz.aviation.advisory.feature" />
</antcall>
<antcall target="p2.build.repo">
<param name="feature"
value="com.raytheon.uf.viz.ncep.dataplugins.feature" />

View file

@ -3,6 +3,31 @@
# Alert VIZ Startup Script
# Note: Alert VIZ will not run as 'root'
# 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.
#
#
# SOFTWARE HISTORY
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# Oct 09, 2014 #3675 bclement added cleanExit signal trap
#
user=`/usr/bin/whoami`
if [ ${user} == 'root' ]; then
echo "WARNING: Alert VIZ cannot be run as user '${user}'!"
@ -78,11 +103,21 @@ if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR
fi
# Special instructions for the 64-bit jvm.
ARCH_ARGS=""
if [ -f /awips2/java/jre/lib/amd64/server/libjvm.so ]; then
ARCH_ARGS="-vm /awips2/java/jre/lib/amd64/server/libjvm.so"
fi
# takes in a process id
# kills spawned subprocesses of pid
# and then kills the process itself and exits
function cleanExit()
{
pid=$1
if [[ -n $pid ]]
then
pkill -P $pid
kill $pid
fi
exit
}
trap 'cleanExit $pid' SIGHUP SIGINT SIGQUIT SIGTERM
#run a loop for alertviz
count=0
@ -105,11 +140,13 @@ do
else
#finally check if we can write to the file
if [ -w ${LOGFILE} ]; then
${dir}/alertviz ${ARCH_ARGS} $* > ${LOGFILE} 2>&1
${dir}/alertviz $* > ${LOGFILE} 2>&1 &
else
${dir}/alertviz ${ARCH_ARGS} $*
${dir}/alertviz $* &
fi
pid=$!
wait $pid
exitVal=$?
fi
exitVal=$?
done

View file

@ -31,6 +31,8 @@
# Jan 24, 2014 #2739 bsteffen Log exit status
# Jan 30, 2014 #2593 bclement warns based on memory usage, fixed for INI files with spaces
# Jul 10, 2014 #3363 bclement logs command used to launch application to console logs
# Oct 10, 2014 #3675 njensen Logback now does console logging to ensure correct pid
# Oct 13, 2014 #3675 bclement startup shutdown log includes both launching pid and placeholder
#
#
@ -210,13 +212,16 @@ curTime=`date +%Y%m%d_%H%M%S`
(
export pid=`/bin/bash -c 'echo $PPID'`
LOGFILE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_console.log"
export LOGFILE_CAVE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_alertviz.log"
export LOGFILE_PERFORMANCE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_perf.log"
# we include the PID of the launching process along with
# a %PID% placeholder to be replaced with the "real" PID
LOGFILE_STARTUP_SHUTDOWN="${LOGDIR}/${PROGRAM_NAME}_${pid}_${curTime}_pid_%PID%_startup-shutdown.log"
export LOGFILE_CAVE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_logs.log"
export LOGFILE_CONSOLE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_console.log"
export LOGFILE_PERFORMANCE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_perf.log"
# can we write to log directory
if [ -w ${LOGDIR} ]; then
touch ${LOGFILE}
touch ${LOGFILE_STARTUP_SHUTDOWN}
fi
# remove "-noredirect" flag from command-line if set so it doesn't confuse any
@ -241,18 +246,20 @@ curTime=`date +%Y%m%d_%H%M%S`
nohup ${CAVE_INSTALL}/monitorThreads.sh $pid >> /dev/null 2>&1 &
fi
echo "Launching cave application using the following command: " >> ${LOGFILE}
echo "${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} ${USER_ARGS[@]}" >> ${LOGFILE}
echo "Launching cave application using the following command: " >> ${LOGFILE_STARTUP_SHUTDOWN}
echo "${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} ${USER_ARGS[@]}" >> ${LOGFILE_STARTUP_SHUTDOWN}
if [[ "${redirect}" == "true" ]] ; then
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" >> ${LOGFILE} 2>&1
if [[ "${redirect}" == "true" ]] ; then
# send output to /dev/null because the logback CaveConsoleAppender will capture that output
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" >> /dev/null 2>&1
else
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" 2>&1 | tee -a ${LOGFILE}
# allow output to print to the console/terminal that launched CAVE
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" 2>&1
fi
) &
pid=$!
LOGFILE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_console.log"
logExitStatus $pid $LOGFILE
LOGFILE_STARTUP_SHUTDOWN="${LOGDIR}/${PROGRAM_NAME}_${pid}_${curTime}_pid_%PID%_startup-shutdown.log"
logExitStatus $pid $LOGFILE_STARTUP_SHUTDOWN

View file

@ -36,6 +36,7 @@
# Jul 02, 2014 #3245 bclement account for memory override in vm arguments
# Jul 10, 2014 #3363 bclement fixed precedence order for ini file lookup
# Jul 11, 2014 #3371 bclement added killSpawn()
# Oct 13, 2014 #3675 bclement logExitStatus() waits for child to start and renames log with child PID
source /awips2/cave/iniLookup.sh
@ -330,6 +331,14 @@ function logExitStatus()
logFile=$2
trap 'killSpawn $pid' SIGHUP SIGINT SIGQUIT SIGTERM
childPid=$(waitForChildToStart $pid)
if [[ -n $childPid ]]
then
newFileName=${logFile/\%PID\%/$childPid}
mv $logFile $newFileName
logFile=$newFileName
fi
wait $pid
exitCode=$?
curTime=`date --rfc-3339=seconds`
@ -348,6 +357,24 @@ function logExitStatus()
fi
}
# takes in a PID
# waits for PID to spawn child
# outputs the PID of the child or nothing if PID exits first
function waitForChildToStart()
{
pid=$1
# check if PID is still running
while ps -p $pid > /dev/null
do
sleep 1s
if child=$(pgrep -P $pid)
then
echo $child
break
fi
done
}
#Delete old CAVE logs DR 15348
function deleteOldCaveLogs()
{

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/ConvSigmet.xml"
menuText="Convective SIGMET" id="ConvSigmet">
</contribute>
</menuTemplate>

View file

@ -0,0 +1,34 @@
<?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/NonConvSigmet.xml"
menuText="SIGMET" id="SIGMETICING">
<substitute key="hazardType" value="ICING" />
<substitute key="color" value="#FFFFFF" />
<substitute key="name" value="Icing SIGMET" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml"
menuText="AIRMET" id="AIRMETICING">
<substitute key="hazardType" value="ICING" />
<substitute key="color" value="#0000FF" />
<substitute key="name" value="Icing AIRMET" />
</contribute>
</menuTemplate>

View file

@ -0,0 +1,28 @@
<?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/NonConvSigmet.xml"
menuText="SIGMET" id="SIGMETTTOPCYCLONE">
<substitute key="hazardType" value="TROPICAL CYCLONE" />
<substitute key="color" value="#00FFFF" />
<substitute key="name" value="Tropical Cyclone SIGMET" />
</contribute>
</menuTemplate>

View file

@ -0,0 +1,34 @@
<?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/NonConvSigmet.xml"
menuText="SIGMET" id="SIGMETTURB">
<substitute key="hazardType" value="TURBULENCE" />
<substitute key="color" value="#FF4444" />
<substitute key="name" value="Turbulence SIGMET" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml"
menuText="AIRMET" id="AIRMETTURB">
<substitute key="hazardType" value="TURBULENCE" />
<substitute key="color" value="#00FF00" />
<substitute key="name" value="Turbulence AIRMET" />
</contribute>
</menuTemplate>

View file

@ -0,0 +1,36 @@
<?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="subMenu" menuText="AIRMET">
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml"
menuText="IFR" id="AIRMETIFR">
<substitute key="hazardType" value="INSTRUMENT FLIGHT RULES" />
<substitute key="color" value="#00FFFF" />
<substitute key="name" value="IFR AIRMET" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml"
menuText="Mtn Obscn" id="AIRMETMTNOBSC">
<substitute key="hazardType" value="MOUNTAIN OBSCURATION" />
<substitute key="color" value="#FF0088" />
<substitute key="name" value="Mtn Obscn AIRMET" />
</contribute>
</contribute>
</menuTemplate>

View file

@ -0,0 +1,28 @@
<?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/NonConvSigmet.xml"
menuText="SIGMET" id="SIGMETVOLCANICASH">
<substitute key="hazardType" value="VOLCANIC ASH CLOUD" />
<substitute key="color" value="#00FF00" />
<substitute key="name" value="Volcanic Ash SIGMET" />
</contribute>
</menuTemplate>

View file

@ -0,0 +1,34 @@
<?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?after=ConvectionProductsStart"
fileName="menus/aviationadvisory/baseAviationConvectionProducts.xml" />
<include installTo="menu:Aviation?before=IcingProductsEnd"
fileName="menus/aviationadvisory/baseAviationIcingProducts.xml" />
<include installTo="menu:Aviation?before=TurbulenceProductsEnd"
fileName="menus/aviationadvisory/baseAviationTurbulenceProducts.xml" />
<include installTo="menu:Aviation?before=VisibilityProductsEnd"
fileName="menus/aviationadvisory/baseAviationVisibilityProducts.xml" />
<include installTo="menu:Aviation?before=TropicalCycloneEnd"
fileName="menus/aviationadvisory/baseAviationTropicalCyclone.xml" />
<include installTo="menu:Aviation?after=VolcanicAshStart"
fileName="menus/aviationadvisory/baseAviationVolcanicAsh.xml" />
</menuContributionFile>

View file

@ -26,6 +26,7 @@ import org.jivesoftware.smack.packet.Presence;
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
/**
@ -55,6 +56,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* Jan 30, 2014 2698 bclement changed UserId to VenueParticipant
* Mar 06, 2014 2751 bclement added isAdmin()
* Mar 07, 2014 2848 bclement added getVenueName() and hasOtherParticipants()
* Oct 08, 2014 3705 bclement added getVenueId()
*
* </pre>
*
@ -76,6 +78,11 @@ public interface IVenueSession extends ISession {
*/
public String getVenueName();
/**
* @return qualified id of venue on server
*/
public VenueId getVenueId();
/**
* Send a chat message.
*

View file

@ -0,0 +1,170 @@
/**
* 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.comm.identity.info;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
/**
* Collaboration host configuration object
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 9, 2014 3708 bclement moved from SiteConfigurationInformation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class HostConfig {
@XmlAttribute
private String hostname;
@XmlAttribute
private String prettyName;
@XmlAttribute
private boolean removed = false;
/**
*
*/
public HostConfig() {
}
public HostConfig(String hostname) {
this.hostname = hostname;
}
/**
* @return the hostname
*/
public String getHostname() {
return hostname;
}
/**
* @param hostname
* the hostname to set
*/
public void setHostname(String hostname) {
this.hostname = hostname;
}
/**
* @return the prettyName
*/
public String getPrettyName() {
return prettyName;
}
/**
* @param prettyName
* the prettyName to set
*/
public void setPrettyName(String prettyName) {
this.prettyName = prettyName;
}
/**
* Format for display to the user
*/
@Override
public String toString() {
if (prettyName == null) {
return "Site Server : " + hostname;
} else {
return prettyName + " : " + hostname;
}
}
/**
* Remove description name from hostname
*
* @param text
* @return
*/
public static String removeDescription(String text) {
int firstColon = text.indexOf(':');
if (firstColon >= 0) {
text = text.substring(firstColon + 1);
}
return text.trim();
}
/**
* @return the removed
*/
public boolean isRemoved() {
return removed;
}
/**
* @param removed
* the removed to set
*/
public void setRemoved(boolean removed) {
this.removed = removed;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((hostname == null) ? 0 : hostname.hashCode());
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
HostConfig other = (HostConfig) obj;
if (hostname == null) {
if (other.hostname != null)
return false;
} else if (!hostname.equals(other.hostname))
return false;
return true;
}
}

View file

@ -0,0 +1,177 @@
/**
* 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.comm.identity.info;
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.XmlValue;
/**
* Collaboration site configuration object. Stores site specific white/black
* lists used for message filtering and forecaster roles. Roles are not
* restricted by an enum, but usually are short term or long term forecaster.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 9, 2014 3708 bclement moved from SiteConfigurationInformation
* added blacklist support
*
* </pre>
*
* @author bclement
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class SiteConfig {
public static enum ListType {
WHITELIST, BLACKLIST
};
@XmlAccessorType(XmlAccessType.NONE)
public static class ListEntry {
@XmlValue
private String value;
@XmlAttribute
private boolean removed = false;
/**
*
*/
public ListEntry() {
}
public ListEntry(String value, boolean removed) {
this.value = value;
this.removed = removed;
}
/**
* @return the value
*/
public String getValue() {
return value;
}
/**
* @param value
* the value to set
*/
public void setValue(String value) {
this.value = value;
}
/**
* @return the removed
*/
public boolean isRemoved() {
return removed;
}
/**
* @param removed
* the removed to set
*/
public void setRemoved(boolean removed) {
this.removed = removed;
}
}
@XmlAttribute
private String site;
@XmlAttribute
private ListType listType;
@XmlElement(name = "listEntry")
private ListEntry[] listEntries;
@XmlElement
private String[] roles;
/**
* @return the site
*/
public String getSite() {
return site;
}
/**
* @param site
* the site to set
*/
public void setSite(String site) {
this.site = site;
}
/**
* @return the role
*/
public String[] getRoles() {
return roles;
}
/**
* @param role
* the role to set
*/
public void setRoles(String[] roles) {
this.roles = roles;
}
/**
* @return the listType
*/
public ListType getListType() {
return listType;
}
/**
* @param listType
* the listType to set
*/
public void setListType(ListType listType) {
this.listType = listType;
}
/**
* @return the listEntries
*/
public ListEntry[] getListEntries() {
return listEntries;
}
/**
* @param listEntries
* the listEntries to set
*/
public void setListEntries(ListEntry[] listEntries) {
this.listEntries = listEntries;
}
}

View file

@ -23,7 +23,6 @@ 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;
@ -36,8 +35,9 @@ import javax.xml.bind.annotation.XmlRootElement;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 12, 2012 mnash Initial creation
* Jun 12, 2012 mnash Initial creation
* Jan 08, 2014 2563 bclement added format/parse methods to HostConfig
* Oct 10, 2014 3708 bclement moved HostConfig and SiteConfig to separate files
*
* </pre>
*
@ -89,127 +89,4 @@ public class SiteConfigInformation {
this.config = config;
}
@XmlAccessorType(XmlAccessType.NONE)
public static class HostConfig {
@XmlAttribute
private String hostname;
@XmlAttribute
private String prettyName;
/**
* @return the hostname
*/
public String getHostname() {
return hostname;
}
/**
* @param hostname
* the hostname to set
*/
public void setHostname(String hostname) {
this.hostname = hostname;
}
/**
* @return the prettyName
*/
public String getPrettyName() {
return prettyName;
}
/**
* @param prettyName
* the prettyName to set
*/
public void setPrettyName(String prettyName) {
this.prettyName = prettyName;
}
/**
* Format for display to the user
*/
@Override
public String toString() {
if (prettyName == null) {
return "Site Server : " + hostname;
} else {
return prettyName + " : " + hostname;
}
}
/**
* Remove description name from hostname
*
* @param text
* @return
*/
public static String removeDescription(String text) {
int firstColon = text.indexOf(':');
if (firstColon >= 0) {
text = text.substring(firstColon + 1);
}
return text.trim();
}
}
@XmlAccessorType(XmlAccessType.NONE)
public static class SiteConfig {
@XmlAttribute
private String site;
@XmlElement
private String[] subscribedSites;
@XmlElement
private String[] roles;
/**
* @return the site
*/
public String getSite() {
return site;
}
/**
* @param site
* the site to set
*/
public void setSite(String site) {
this.site = site;
}
/**
* @return the subscribedSites
*/
public String[] getSubscribedSites() {
return subscribedSites;
}
/**
* @param subscribedSites
* the subscribedSites to set
*/
public void setSubscribedSites(String[] subscribedSites) {
this.subscribedSites = subscribedSites;
}
/**
* @return the role
*/
public String[] getRoles() {
return roles;
}
/**
* @param role
* the role to set
*/
public void setRoles(String[] roles) {
this.roles = roles;
}
}
}

View file

@ -21,8 +21,11 @@ package com.raytheon.uf.viz.collaboration.comm.provider.connection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.lang.StringUtils;
@ -35,6 +38,9 @@ import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smackx.bookmark.BookmarkManager;
import org.jivesoftware.smackx.bookmark.BookmarkedConference;
import org.jivesoftware.smackx.muc.HostedRoom;
import org.jivesoftware.smackx.muc.MultiUserChat;
import org.jivesoftware.smackx.pubsub.PubSubElementType;
import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
@ -62,6 +68,8 @@ import com.raytheon.uf.viz.collaboration.comm.packet.SessionPayload;
import com.raytheon.uf.viz.collaboration.comm.packet.SessionPayloadProvider;
import com.raytheon.uf.viz.collaboration.comm.provider.account.AccountManager;
import com.raytheon.uf.viz.collaboration.comm.provider.account.ClientAuthManager;
import com.raytheon.uf.viz.collaboration.comm.provider.event.BookmarkEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.event.BookmarkEvent.Type;
import com.raytheon.uf.viz.collaboration.comm.provider.event.VenueUserEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.session.CreateSessionData;
import com.raytheon.uf.viz.collaboration.comm.provider.session.FeedVenueConfigManager;
@ -126,6 +134,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueParticipant;
* May 09, 2014 3107 bclement added ability for packet timeout to be set via system properties
* May 19, 2014 3180 bclement added getJoinedVenueSessions()
* Jun 16, 2014 3288 bclement feed venue configuration changes
* Oct 08, 2014 3705 bclement added bookmarks, joinTextOnlyVenue() and getPublicRooms()
*
* </pre>
*
@ -556,6 +565,27 @@ public class CollaborationConnection implements IEventPublisher {
return session;
}
/**
* Join existing chat room with provided handle
*
* @param venueId
* @param handle
* @return
* @throws CollaborationException
*/
public VenueSession joinTextOnlyVenue(VenueId venueId, String handle)
throws CollaborationException {
VenueSession session = createTextOnlyVenue(venueId, handle);
try {
session.configureVenue();
postEvent(session);
return session;
} catch (CollaborationException e) {
removeSession(session);
throw e;
}
}
/**
* Check if venue exists on server
*
@ -625,6 +655,29 @@ public class CollaborationConnection implements IEventPublisher {
return sessions.values();
}
/**
* @return list of public chat rooms on server
*/
public Collection<VenueId> getPublicRooms() {
XMPPConnection conn = getXmppConnection();
String mucService = VenueId.DEFAULT_SUBDOMAIN + "."
+ conn.getServiceName();
Collection<HostedRoom> results;
try {
results = MultiUserChat.getHostedRooms(conn, mucService);
} catch (XMPPException e) {
statusHandler.error("Problem getting public room list from server",
e);
results = Collections.emptyList();
}
Collection<VenueId> rval = new TreeSet<>();
for (HostedRoom room : results) {
rval.add(new VenueId(room.getJid()));
}
return rval;
}
/**
* @return all IVenueSessions that this user is a participant in
*/
@ -682,4 +735,82 @@ public class CollaborationConnection implements IEventPublisher {
return statusHandler;
}
/**
* @return collection of chat rooms bookmarked by user
* @throws CollaborationException
*/
public Collection<VenueId> getBookmarkedRooms()
throws CollaborationException {
Collection<BookmarkedConference> bookmarkedConferences;
try {
BookmarkManager bmkManager = BookmarkManager
.getBookmarkManager(getXmppConnection());
bookmarkedConferences = bmkManager.getBookmarkedConferences();
} catch (XMPPException e) {
throw new CollaborationException(
"Unable to get list of bookmarked rooms from server", e);
}
List<VenueId> rval = new ArrayList<>(bookmarkedConferences.size());
for (BookmarkedConference conf : bookmarkedConferences) {
rval.add(new VenueId(conf.getJid()));
}
return rval;
}
/**
* Bookmark room on server
*
* @param room
* @throws CollaborationException
*/
public void bookmarkRoom(VenueId room) throws CollaborationException {
try {
BookmarkManager bmkManager = BookmarkManager
.getBookmarkManager(getXmppConnection());
bmkManager.addBookmarkedConference(room.getName(),
room.getFQName(), false, null, null);
postEvent(new BookmarkEvent(Type.ADDED, room));
} catch (XMPPException e) {
throw new CollaborationException("Unable to bookmark room: "
+ room.getFQName(), e);
}
}
/**
* Remove bookmark for room from server
*
* @param room
* @throws CollaborationException
*/
public void removeBookmark(VenueId room) throws CollaborationException {
try {
BookmarkManager bmkManager = BookmarkManager
.getBookmarkManager(getXmppConnection());
bmkManager.removeBookmarkedConference(room.getFQName());
postEvent(new BookmarkEvent(Type.REMOVED, room));
} catch (XMPPException e) {
throw new CollaborationException(
"Unable to remove bookmark for room: " + room.getFQName(),
e);
}
}
/**
* Find session this user is joined to by venue id
*
* @param room
* @return null if not joined to room
*/
public IVenueSession getJoinedVenueSession(VenueId room) {
IVenueSession rval = null;
Collection<IVenueSession> joinedRooms = getJoinedVenueSessions();
for (IVenueSession session : joinedRooms) {
VenueId vid = session.getVenueId();
if (room.equals(vid)) {
rval = session;
break;
}
}
return rval;
}
}

View file

@ -17,13 +17,12 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.core.props;
package com.raytheon.uf.viz.collaboration.comm.provider.event;
import org.apache.commons.configuration.Configuration;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
/**
* Inject attribute names, attribute values, and property values into the
* PropertiesFactory environment configuration.
* Event triggered when the user adds or removes a bookmark for a chat room
*
* <pre>
*
@ -31,25 +30,43 @@ import org.apache.commons.configuration.Configuration;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 06, 2013 2344 bgonzale Initial creation
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bgonzale
* @author bclement
* @version 1.0
*/
public class EnvAttributePropertyInjector {
public class BookmarkEvent {
public static void injectAttributeProperty(String attributeName,
String attributeValue, String propertyValue) {
/* TODO HERE FIX PropertiesFactory reference
Configuration attrNamesConfig = PropertiesFactory.getInstance()
.getEnvProperties().theAttrNamesConfiguration;
Configuration envConfig = PropertiesFactory.getInstance()
.getEnvProperties().theEnvConfiguration;
public static enum Type {
ADDED, REMOVED
};
attrNamesConfig.setProperty(attributeName, attributeValue);
envConfig.setProperty(attributeValue, propertyValue);
*/
private final Type type;
private final VenueId room;
/**
*
*/
public BookmarkEvent(Type type, VenueId room) {
this.type = type;
this.room = room;
}
/**
* @return the type
*/
public Type getType() {
return type;
}
/**
* @return the room
*/
public VenueId getRoom() {
return room;
}
}

View file

@ -113,6 +113,7 @@ 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()
*
*
* </pre>
@ -1004,4 +1005,16 @@ public class VenueSession extends BaseSession implements IVenueSession {
venueName);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession#getVenueId
* ()
*/
@Override
public VenueId getVenueId() {
return venueId;
}
}

View file

@ -19,6 +19,8 @@
**/
package com.raytheon.uf.viz.collaboration.comm.provider.user;
import org.jivesoftware.smack.util.StringUtils;
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
@ -35,6 +37,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
* Feb 13, 2014 2751 bclement removed resource, fixed getFQN
* May 19, 2014 3180 bclement added isSameVenue() fromString() and hashcode/equals
* Jun 16, 2014 3288 bclement added constructors, default subdomain
* Oct 08, 2014 3705 bclement added single string constructor, compareTo()
*
* </pre>
*
@ -42,7 +45,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
* @version 1.0
*/
public class VenueId implements IQualifiedID {
public class VenueId implements IQualifiedID, Comparable<VenueId> {
public static final String DEFAULT_SUBDOMAIN = "conference";
@ -56,6 +59,11 @@ public class VenueId implements IQualifiedID {
public VenueId() {
}
public VenueId(String jid) {
this.name = StringUtils.parseName(jid);
this.host = StringUtils.parseServer(jid);
}
/**
* @param host
* @param name
@ -189,4 +197,30 @@ public class VenueId implements IQualifiedID {
rval.setHost(Tools.parseHost(venueId));
return rval;
}
/*
* (non-Javadoc)
*
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
@Override
public int compareTo(VenueId o) {
int rval;
if (o == null) {
rval = 1;
} else if (this.name == null) {
if (o.name == null) {
rval = 0;
} else {
rval = -1;
}
} else {
if (o.name == null) {
rval = 1;
} else {
rval = this.name.compareTo(o.name);
}
}
return rval;
}
}

View file

@ -87,16 +87,20 @@ 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.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.event.BookmarkEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.event.UserPresenceChangedEvent;
import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager;
import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager.GroupListener;
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
import com.raytheon.uf.viz.collaboration.comm.provider.user.SharedGroup;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
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;
@ -106,10 +110,12 @@ 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;
import com.raytheon.uf.viz.collaboration.ui.actions.InviteAction;
import com.raytheon.uf.viz.collaboration.ui.actions.JoinRoomAction;
import com.raytheon.uf.viz.collaboration.ui.actions.LinkToEditorAction;
import com.raytheon.uf.viz.collaboration.ui.actions.LoginAction;
import com.raytheon.uf.viz.collaboration.ui.actions.LogoutAction;
import com.raytheon.uf.viz.collaboration.ui.actions.PeerToPeerChatAction;
import com.raytheon.uf.viz.collaboration.ui.actions.RemoveBookmarkAction;
import com.raytheon.uf.viz.collaboration.ui.actions.RemoveFromGroupAction;
import com.raytheon.uf.viz.collaboration.ui.actions.RemoveFromRosterAction;
import com.raytheon.uf.viz.collaboration.ui.actions.SendSubReqAction;
@ -117,6 +123,7 @@ 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.data.AlertWordWrapper;
import com.raytheon.uf.viz.collaboration.ui.data.CollaborationGroupContainer;
import com.raytheon.uf.viz.collaboration.ui.data.PublicRoomContainer;
import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
import com.raytheon.uf.viz.collaboration.ui.notifier.NotifierTools;
import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
@ -154,6 +161,8 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
* Apr 11, 2014 2903 bclement login action changes, removed server disconnect listener,
* added static utility method to show view
* 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.
*
* </pre>
*
@ -192,6 +201,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
private LogoutAction logOut;
private Action roomSearchAction;
/**
* @param parent
*/
@ -307,6 +318,15 @@ public class CollaborationGroupView extends CaveFloatingView implements
// this is either on or off, so it is a toggle
displayFeedAction = new DisplayFeedAction();
roomSearchAction = new Action("Public Room Search...",
IconUtil.getImageDescriptor(Activator.getDefault().getBundle(),
"spyglass.gif")) {
public void run() {
new RoomSearchDialog(Display.getCurrent().getActiveShell())
.open();
};
};
this.disableOrEnableToolbarActions();
}
@ -341,8 +361,12 @@ public class CollaborationGroupView extends CaveFloatingView implements
private void createMenu(IMenuManager mgr) {
mgr.add(new UserSearchAction());
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 ChangeStatusAction());
mgr.add(new ChangeStatusMessageAction());
mgr.add(new ChangePasswordAction());
@ -413,6 +437,9 @@ public class CollaborationGroupView extends CaveFloatingView implements
if (o instanceof SessionGroupContainer) {
manager.add(createSessionAction);
return;
} else if (o instanceof PublicRoomContainer){
manager.add(roomSearchAction);
return;
} else if (o instanceof IVenueSession) {
manager.add(new ShowVenueAction((IVenueSession) o));
manager.add(new ArchiveViewerAction((IVenueSession) o));
@ -458,6 +485,11 @@ public class CollaborationGroupView extends CaveFloatingView implements
renameAction.setId(group.getName());
manager.add(renameAction);
}
} else if (o instanceof VenueId) {
VenueId venue = (VenueId) o;
manager.add(new JoinRoomAction(venue, false));
manager.add(new JoinRoomAction(venue, true));
manager.add(new RemoveBookmarkAction(venue));
}
}
@ -515,6 +547,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
new PeerToPeerChatAction(user).run();
} else if (o instanceof IVenueSession) {
new ShowVenueAction((IVenueSession) o).run();
} else if (o instanceof VenueId) {
new JoinRoomAction((VenueId) o, false).run();
}
}
});
@ -913,6 +947,11 @@ public class CollaborationGroupView extends CaveFloatingView implements
refreshUsersTreeViewerAsync(topLevel.getSessionGroup());
}
@Subscribe
public void handleBookmarkEvent(BookmarkEvent event) {
refreshUsersTreeViewerAsync(topLevel.getPublicRoomGroup());
}
/**
* Enables or disables the toolbar buttons based on whether or not the user
* is connected to the xmpp server.

View file

@ -0,0 +1,183 @@
/**
* 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.Collection;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.actions.AddBookmarkAction;
import com.raytheon.uf.viz.collaboration.ui.actions.JoinRoomAction;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/**
* Dialog for finding public chat rooms on server
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class RoomSearchDialog extends CaveSWTDialog {
private Table resultTable;
/**
* @param parentShell
*/
public RoomSearchDialog(Shell parentShell) {
super(parentShell);
setText("Room Search");
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
* .eclipse.swt.widgets.Shell)
*/
@Override
protected void initializeComponents(Shell shell) {
initializeResultsTable(shell);
initializeButtonBar(shell);
}
private void initializeResultsTable(Shell shell) {
Composite tableComp = new Composite(shell, SWT.NONE);
GridData gridData = new GridData(500, 200);
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
tableComp.setLayoutData(gridData);
resultTable = new Table(tableComp, SWT.BORDER | SWT.V_SCROLL
| SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
resultTable.setHeaderVisible(true);
resultTable.setLinesVisible(true);
TableColumn nameColumn = new TableColumn(resultTable, SWT.LEFT);
nameColumn.setText("Room Name");
TableColumn idColumn = new TableColumn(resultTable, SWT.LEFT);
idColumn.setText("Service");
TableColumnLayout tcl = new TableColumnLayout();
tableComp.setLayout(tcl);
tcl.setColumnData(nameColumn, new ColumnWeightData(40));
tcl.setColumnData(idColumn, new ColumnWeightData(60));
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
fillContextMenu(manager);
}
});
Menu menu = menuMgr.createContextMenu(resultTable);
resultTable.setMenu(menu);
search();
}
private void initializeButtonBar(Shell shell) {
Composite buttonComp = new Composite(shell, SWT.NONE);
buttonComp.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false,
false, 1, 1));
RowLayout layout = new RowLayout(SWT.HORIZONTAL);
layout.pack = false;
buttonComp.setLayout(layout);
Button closeButton = new Button(buttonComp, SWT.PUSH);
closeButton.setText("Close");
closeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
close();
}
});
closeButton.setLayoutData(new RowData(90, SWT.DEFAULT));
}
private void fillContextMenu(IMenuManager manager) {
TableItem[] selection = resultTable.getSelection();
if (selection == null || selection.length == 0) {
return;
}
VenueId[] rooms = new VenueId[selection.length];
for (int i = 0; i < rooms.length; i += 1) {
rooms[i] = (VenueId) selection[i].getData();
}
if (rooms.length == 1) {
manager.add(new JoinRoomAction(rooms[0], false));
manager.add(new JoinRoomAction(rooms[0], true));
}
manager.add(new AddBookmarkAction(rooms));
}
private void search() {
CollaborationConnection conn = CollaborationConnection.getConnection();
Collection<VenueId> results = conn.getPublicRooms();
resultTable.removeAll();
if (results.size() > 0) {
for (VenueId room : results) {
TableItem ti = new TableItem(resultTable, SWT.NONE);
ti.setText(0, room.getName());
ti.setText(1, room.getHost());
ti.setData(room);
}
resultTable.setEnabled(true);
} else {
TableItem ti = new TableItem(resultTable, SWT.NONE);
ti.setText("No rooms found.");
resultTable.setEnabled(false);
}
}
}

View file

@ -0,0 +1,159 @@
/**
* 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

@ -23,19 +23,23 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import javax.xml.bind.DataBindingException;
import javax.xml.bind.JAXB;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import com.raytheon.uf.common.localization.IPathManager;
import org.apache.commons.collections.map.LRUMap;
import com.raytheon.uf.common.localization.FileUpdatedMessage;
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
@ -47,10 +51,11 @@ import com.raytheon.uf.common.localization.exception.LocalizationException;
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.collaboration.comm.identity.info.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig.ListEntry;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig.ListType;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.SiteConfig;
import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
/**
* Parse a file to grab attributes about a user
@ -61,10 +66,14 @@ import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 12, 2012 mnash Initial creation
* Jun 12, 2012 mnash Initial creation
* Jan 08, 2014 2563 bclement duplicate code elimination
* added methods to partially modify user config
* Jan 27, 2014 2700 bclement fixed null list from jaxb object
* Oct 10, 2014 3708 bclement refactored to support blacklisting
* moved color config to SiteColorConfigManager
* site level now combined with site config
* Oct 10, 2014 3708 bclement fixed possible NPE in getSiteConfig() getSiteVisibilityConfig()
*
* </pre>
*
@ -72,25 +81,40 @@ import com.raytheon.uf.viz.collaboration.ui.SiteColorInformation.SiteColor;
* @version 1.0
*/
public class SiteConfigurationManager {
private static final IUFStatusHandler log = UFStatus.getHandler(SiteConfigurationManager.class);
private static SiteConfigInformation instance;
private static final IUFStatusHandler log = UFStatus
.getHandler(SiteConfigurationManager.class);
private static SiteConfigInformation userInstance;
private static final String PRIMARY_CONF_FILE = "config.xml";
private static final ReentrantLock userConfigLock = new ReentrantLock();
private static SiteConfigInformation _siteInstance;
private static SiteColorInformation colorInfo;
private static LocalizationFile siteConfigInfoFile;
private static SiteConfigInformation _userInstance;
private static LocalizationFile userConfigInfoFile;
@SuppressWarnings("unchecked")
private static final Map<String, SiteVisiblityConfig> siteVisibilityMap = new LRUMap(
2);
private static final ILocalizationFileObserver siteConfigObserver = new ILocalizationFileObserver() {
@Override
public void fileUpdated(FileUpdatedMessage message) {
clear();
}
};
// level hierarchy for site config
private static final LocalizationLevel[] siteLevels;
static{
static {
// load site levels with all levels except for USER
PathManager pm = (PathManager) PathManagerFactory.getPathManager();
LocalizationLevel[] available = pm.getAvailableLevels();
List<LocalizationLevel> levels = new ArrayList<LocalizationLevel>(available.length -1);
List<LocalizationLevel> levels = new ArrayList<LocalizationLevel>(
available.length - 1);
for (int i = available.length - 1; i >= 0; --i) {
if (!available[i].equals(LocalizationLevel.USER)) {
levels.add(available[i]);
@ -102,15 +126,17 @@ public class SiteConfigurationManager {
/**
* Get first localization file for SiteConfigInformation found in levels
*
* @param filename
* config file name
* @param levels
* localization levels to search in order
* @return null if none found
*/
private static LocalizationFile findConfigLocalizationFile(
private static LocalizationFile findConfigLocalizationFile(String filename,
LocalizationLevel[] levels) {
LocalizationFile rval = null;
for (LocalizationLevel level : levels) {
rval = getConfigLocalizationFile(level);
rval = getConfigLocalizationFile(filename, level);
if (rval != null && rval.exists()) {
break;
}
@ -121,29 +147,28 @@ public class SiteConfigurationManager {
/**
* Get LocalizationFile for SiteConfigInformation at specified level.
*
* @param filename
* config file name
* @param level
* @return
*/
private static LocalizationFile getConfigLocalizationFile(
private static LocalizationFile getConfigLocalizationFile(String filename,
LocalizationLevel level) {
PathManager pm = (PathManager) PathManagerFactory.getPathManager();
LocalizationContext localContext = pm.getContext(
LocalizationType.CAVE_STATIC, level);
return pm.getLocalizationFile(localContext, "collaboration"
+ File.separator + "config.xml");
+ File.separator + filename);
}
/**
* Read configuration file from file system. Must be externally
* synchronized.
*
* @param levels
* localization levels to search in order
* @return null if configuration file wasn't found or an error occurred
*/
private static SiteConfigInformation readConfigInformation(
LocalizationLevel[] levels) {
LocalizationFile file = findConfigLocalizationFile(levels);
LocalizationFile file) {
SiteConfigInformation rval = null;
if (file != null && file.exists()) {
InputStream in = null;
@ -182,7 +207,8 @@ public class SiteConfigurationManager {
private static void writeConfigInformation(LocalizationLevel level,
SiteConfigInformation config) throws JAXBException,
LocalizationException {
LocalizationFile file = getConfigLocalizationFile(level);
LocalizationFile file = getConfigLocalizationFile(PRIMARY_CONF_FILE,
level);
LocalizationFileOutputStream out = null;
try {
out = file.openOutputStream();
@ -191,7 +217,7 @@ public class SiteConfigurationManager {
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
new Boolean(true));
marshaller.marshal(userInstance, out);
marshaller.marshal(config, out);
} finally {
if (out != null) {
try {
@ -204,16 +230,19 @@ public class SiteConfigurationManager {
}
/**
* Go to the config.xml file and grab the user information, for use in
* determining what kind of user you are in collaboration
* Read site level configuration file
*
* @return
* @return null if no file was found or file is invalid
*/
public static synchronized SiteConfigInformation getSiteConfigInformation() {
if (instance == null) {
SiteConfigInformation info = readConfigInformation(siteLevels);
private static SiteConfigInformation getSiteConfigInformation() {
if (_siteInstance == null) {
LocalizationFile file = findConfigLocalizationFile(
PRIMARY_CONF_FILE, siteLevels);
SiteConfigInformation info = readConfigInformation(file);
if (isValid(info)) {
instance = info;
_siteInstance = info;
file.addFileUpdatedObserver(siteConfigObserver);
siteConfigInfoFile = file;
} else {
log.handle(Priority.PROBLEM,
"Misconfigured config.xml file at site level. "
@ -223,50 +252,28 @@ public class SiteConfigurationManager {
+ " attributes.");
}
}
return instance;
return _siteInstance;
}
/**
* Write the colorInfo.xml file out to user localization so that the user
* can retrieve it on CAVE restart
* Read user level configuration file. Creates new file if not found.
*
* @param information
* @return
*/
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.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
}
/**
* Allows users to have their own extra configured sites, but does not check
* for validity as we don't have to have a role or a site specified. Must be
* externally synchronized.
*/
private static void readUserSiteConfigInformation() {
// we always want to read/write the same localization file, only give
// one level to search
userInstance = readConfigInformation(new LocalizationLevel[] { LocalizationLevel.USER });
if (userInstance == null) {
// user config doesn't exist, create a new one
userInstance = new SiteConfigInformation();
private static SiteConfigInformation getUserConfigInformation() {
if (_userInstance == null) {
LocalizationFile file = getConfigLocalizationFile(
PRIMARY_CONF_FILE, LocalizationLevel.USER);
SiteConfigInformation info = readConfigInformation(file);
if (info == null) {
// user config doesn't exist, create a new one
info = new SiteConfigInformation();
file.addFileUpdatedObserver(siteConfigObserver);
userConfigInfoFile = file;
}
_userInstance = info;
}
return _userInstance;
}
/**
@ -274,31 +281,34 @@ public class SiteConfigurationManager {
*
* @param userEnabledSites
*/
public static void writeUserEnabledSites(String[] userEnabledSites) {
userConfigLock.lock();
private static void writeUserConfiguredVisibility(
SiteVisiblityConfig visibility) {
try {
if (userInstance == null) {
readUserSiteConfigInformation();
}
// update object
List<SiteConfig> configs = userInstance.getConfig();
SiteConfig config;
if (configs == null || configs.isEmpty()) {
configs = new ArrayList<SiteConfigInformation.SiteConfig>(1);
config = new SiteConfig();
configs.add(config);
userInstance.setConfig(configs);
} else {
config = configs.get(0);
}
config.setSubscribedSites(userEnabledSites);
SiteConfigInformation userInstance = getUserConfigInformation();
Map<String, ListEntry> userSpecificConfigs = visibility
.getUserSpecificConfigs();
if (!userSpecificConfigs.isEmpty()) {
String site = visibility.getActingSite();
SiteConfig siteConfig = getSiteConfig(userInstance, site);
if (siteConfig == null) {
siteConfig = new SiteConfig();
siteConfig.setSite(site);
List<SiteConfig> configs = userInstance.getConfig();
if (configs == null) {
configs = new ArrayList<>(1);
userInstance.setConfig(configs);
}
configs.add(siteConfig);
}
ListEntry[] entries = userSpecificConfigs.values().toArray(
new ListEntry[0]);
siteConfig.setListEntries(entries);
// update on file system
writeConfigInformation(LocalizationLevel.USER, userInstance);
// update on file system
writeConfigInformation(LocalizationLevel.USER, userInstance);
}
} catch (Exception e) {
log.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
} finally {
userConfigLock.unlock();
}
}
@ -308,40 +318,54 @@ public class SiteConfigurationManager {
*
* @param config
*/
public static void addUserHostConfig(HostConfig config){
userConfigLock.lock();
try{
if(userInstance == null){
readUserSiteConfigInformation();
}
synchronized public static void addUserHostConfig(HostConfig config) {
updateUserHostConfig(config, false);
}
/**
* Update user level host overrides
*
* @param config
* @param remove
* true if the host entry specifies that the user doesn't want to
* see the host in the UI
*/
private static void updateUserHostConfig(HostConfig config, boolean remove) {
try {
SiteConfigInformation userInstance = getUserConfigInformation();
List<HostConfig> servers = userInstance.getServer();
if (servers == null){
servers = new ArrayList<SiteConfigInformation.HostConfig>(1);
if (servers == null) {
servers = new ArrayList<HostConfig>(1);
userInstance.setServer(servers);
}
if (!hasHost(servers, config)) {
HostConfig existing = findHost(servers, config);
if (existing == null) {
config.setRemoved(remove);
servers.add(config);
writeConfigInformation(LocalizationLevel.USER, userInstance);
} else if (existing.isRemoved() != remove) {
existing.setRemoved(remove);
existing.setPrettyName(config.getPrettyName());
writeConfigInformation(LocalizationLevel.USER, userInstance);
}
} catch (Exception e) {
log.error(e.getLocalizedMessage(), e);
} finally {
userConfigLock.unlock();
}
}
/**
* @param servers
* @param config
* @return true if the hostname in config matches any in servers
* @return null if matching host config not found
*/
private static boolean hasHost(List<HostConfig> servers, HostConfig config) {
private static HostConfig findHost(List<HostConfig> servers,
HostConfig config) {
for (HostConfig hc : servers) {
if (hc.getHostname().equalsIgnoreCase(config.getHostname())) {
return true;
return hc;
}
}
return false;
return null;
}
/**
@ -351,100 +375,58 @@ public class SiteConfigurationManager {
* @param serverAddress
*/
public static void removeUserHostConfig(String serverAddress) {
userConfigLock.lock();
try {
if (userInstance == null) {
readUserSiteConfigInformation();
}
List<HostConfig> servers = userInstance.getServer();
if (servers != null) {
List<HostConfig> newServers = new ArrayList<HostConfig>();
for (HostConfig hc : servers) {
if (!hc.getHostname().equalsIgnoreCase(serverAddress)) {
newServers.add(hc);
}
}
userInstance.setServer(newServers);
writeConfigInformation(LocalizationLevel.USER, userInstance);
}
} catch (Exception e) {
log.error(e.getLocalizedMessage(), e);
} finally {
userConfigLock.unlock();
}
updateUserHostConfig(new HostConfig(serverAddress), true);
}
/**
* Get host configuration added by this user.
* Constructs a list of host configs from the site level configs and the
* user level overrides
*
* @return empty list if none are found
* @return empty list if none found
*/
public static List<HostConfig> getUserHostConfig() {
List<HostConfig> rval;
userConfigLock.lock();
try {
if (userInstance == null) {
readUserSiteConfigInformation();
synchronized public static Collection<HostConfig> getHostConfigs() {
List<HostConfig> userConfigured = getUserHostConfigs();
SiteConfigInformation siteConfigInformation = getSiteConfigInformation();
if (siteConfigInformation == null) {
return Collections.emptyList();
}
List<HostConfig> siteConfigured = siteConfigInformation.getServer();
if (siteConfigured == null) {
siteConfigured = new ArrayList<>(0);
}
Collection<HostConfig> rval;
if (userConfigured.isEmpty()) {
rval = siteConfigured;
} else {
rval = new HashSet<HostConfig>(siteConfigured);
for (HostConfig user : userConfigured) {
if (user.isRemoved()) {
rval.remove(user);
} else {
rval.add(user);
}
}
List<HostConfig> servers = userInstance.getServer();
if (servers == null) {
rval = new ArrayList<HostConfig>(0);
} else {
rval = new ArrayList<HostConfig>(servers);
}
} finally {
userConfigLock.unlock();
}
return rval;
}
/**
* Instantiate the colorInfo object so that the colors can be read in from
* the colorInfo.xml file and retrieved from localization
* Get host configuration added by this user. Must be externally read
* locked.
*
* @return
* @return empty list if none are found
*/
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.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
Activator.statusHandler.handle(
Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
}
}
}
}
private static List<HostConfig> getUserHostConfigs() {
List<HostConfig> rval;
SiteConfigInformation userInstance = getUserConfigInformation();
List<HostConfig> servers = userInstance.getServer();
if (servers == null) {
rval = new ArrayList<HostConfig>(0);
} else {
rval = new ArrayList<HostConfig>(servers);
}
return colorInfo;
return rval;
}
/**
@ -464,70 +446,159 @@ public class SiteConfigurationManager {
}
/**
* Get list of subscribed sites from site configuration
* Gets configuration objects for sites. Does not include user level
* overrides.
*
* @return
*/
synchronized public static Collection<SiteConfig> getSiteConfigs() {
Collection<SiteConfig> rval;
SiteConfigInformation info = getSiteConfigInformation();
if (info == null) {
rval = Collections.emptyList();
} else {
List<SiteConfig> configs = info.getConfig();
if (configs == null) {
rval = Collections.emptyList();
} else {
rval = configs;
}
}
return rval;
}
/**
* @param actingSite
* @param otherSite
* @return true if the configuration for the acting site shows the other
* site as visible (takes into account user level overrides)
*/
synchronized public static boolean isVisible(String actingSite,
String otherSite) {
SiteVisiblityConfig config = getSiteVisibilityConfig(actingSite);
return config.isVisible(otherSite);
}
/**
* Add a user level override for the acting site config to set the other
* site as visible
*
* @param actingSite
* @param otherSite
*/
synchronized public static void showSite(String actingSite, String otherSite) {
SiteVisiblityConfig config = getSiteVisibilityConfig(actingSite);
config.show(otherSite);
writeUserConfiguredVisibility(config);
}
/**
* Add a user level override for the acting site config to set the other
* site as not visible
*
* @param actingSite
* @param otherSite
*/
synchronized public static void hideSite(String actingSite, String otherSite) {
SiteVisiblityConfig config = getSiteVisibilityConfig(actingSite);
config.hide(otherSite);
writeUserConfiguredVisibility(config);
}
/**
* Get site visibility configuration for acting site
*
* @param site
* @return
*/
public static List<String> getSubscribeList(String site) {
List<String> subscribed = new ArrayList<String>();
if (instance.getConfig() != null) {
for (SiteConfig config : instance.getConfig()) {
if (config.getSite().equals(site)) {
subscribed = Arrays.asList(config.getSubscribedSites());
break;
}
}
}
return subscribed;
}
/**
* Reads the user subscribe list
*
* @return
*/
public static List<String> getUserSubscribeList() {
List<String> subscribed = new ArrayList<String>();
userConfigLock.lock();
try {
if (userInstance == null) {
readUserSiteConfigInformation();
}
if (userInstance != null && userInstance.getConfig() != null) {
for (SiteConfig config : userInstance.getConfig()) {
if (config.getSubscribedSites() != null) {
subscribed = new ArrayList<String>();
for (String item : config.getSubscribedSites()) {
subscribed.add(item);
}
private static SiteVisiblityConfig getSiteVisibilityConfig(String site) {
SiteVisiblityConfig rval = null;
rval = siteVisibilityMap.get(site);
if (rval == null) {
Map<String, ListEntry> userSpecificConfigs = getUserSpecificConfigs(site);
SiteConfigInformation siteInstance = getSiteConfigInformation();
if (siteInstance != null && siteInstance.getConfig() != null) {
for (SiteConfig config : siteInstance.getConfig()) {
String configSite = config.getSite();
if (configSite != null && configSite.equals(site)) {
rval = new SiteVisiblityConfig(config,
userSpecificConfigs);
break;
}
}
}
} finally {
userConfigLock.unlock();
if (rval == null) {
/*
* this shouldn't happen since you have to have an entry in the
* site configuration file to log in
*/
log.warn("No configuration found for site '" + site
+ "'. Defaulting to showing all sites.");
rval = new SiteVisiblityConfig(site, new HashSet<String>(0),
ListType.BLACKLIST, userSpecificConfigs);
} else {
siteVisibilityMap.put(site, rval);
}
}
return subscribed;
return rval;
}
/**
* @return list of colors from site information config
* Get user level overrides for site visibility
*
* @param site
* @return site configs indexed by name
*/
public static List<SiteColor> getSiteColors() {
SiteColorInformation colorInfo = getSiteColorInformation();
if (colorInfo != null) {
return getSiteColorInformation().getColors();
} else {
return null;
private static Map<String, ListEntry> getUserSpecificConfigs(String site) {
Map<String, ListEntry> rval = new HashMap<>();
SiteConfigInformation userInstance = getUserConfigInformation();
SiteConfig siteConfig = getSiteConfig(userInstance, site);
if (siteConfig != null) {
ListEntry[] entries = siteConfig.getListEntries();
if (entries != null) {
for (ListEntry entry : entries) {
rval.put(entry.getValue(), entry);
}
}
}
return rval;
}
/**
* @param info
* @param site
* @return null if no config exists for privided site in info
*/
private static SiteConfig getSiteConfig(SiteConfigInformation info,
String site) {
SiteConfig rval = null;
if (info.getConfig() != null) {
for (SiteConfig config : info.getConfig()) {
String configSite = config.getSite();
if (configSite != null && configSite.equals(site)) {
rval = config;
break;
}
}
}
return rval;
}
/**
* reset in-memory configuration
*/
public static void nullifySiteConfigInstance() {
instance = null;
userInstance = null;
synchronized private static void clear() {
if (siteConfigInfoFile != null) {
siteConfigInfoFile.removeFileUpdatedObserver(siteConfigObserver);
siteConfigInfoFile = null;
}
_siteInstance = null;
if (userConfigInfoFile != null) {
userConfigInfoFile.removeFileUpdatedObserver(siteConfigObserver);
userConfigInfoFile = null;
}
_userInstance = null;
siteVisibilityMap.clear();
}
}

View file

@ -0,0 +1,159 @@
/**
* 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.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig.ListEntry;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig.ListType;
/**
* Configuration that determines if the user should see messages from other
* sites
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 9, 2014 3708 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class SiteVisiblityConfig {
private final String actingSite;
private final Set<String> sites;
private final Map<String, ListEntry> userSpecificConfigs;
private final ListType listType;
/**
* @param config
* @param userSpecificConfigs
*/
public SiteVisiblityConfig(SiteConfig config,
Map<String, ListEntry> userSpecificConfigs) {
ListType lt = config.getListType();
if (lt == null) {
lt = ListType.WHITELIST;
}
this.listType = lt;
this.actingSite = config.getSite();
this.userSpecificConfigs = userSpecificConfigs;
ListEntry[] listEntries = config.getListEntries();
if (listEntries != null) {
this.sites = new HashSet<String>(listEntries.length);
for (ListEntry entry : listEntries) {
this.sites.add(entry.getValue());
}
} else {
this.sites = Collections.emptySet();
}
}
/**
* @param actingSite
* @param sites
* @param listType
* @param userSpecificConfigs
*/
public SiteVisiblityConfig(String actingSite, Set<String> sites,
ListType listType, Map<String, ListEntry> userSpecificConfigs) {
this.sites = sites;
this.listType = listType;
this.actingSite = actingSite;
this.userSpecificConfigs = userSpecificConfigs;
}
/**
* @param site
* @return true if messages from site should be shown to user
*/
public boolean isVisible(String site) {
ListEntry userSettings = userSpecificConfigs.get(site);
if (userSettings != null) {
return !userSettings.isRemoved();
} else {
if (isWhitelist()) {
return sites.contains(site);
} else {
return !sites.contains(site);
}
}
}
/**
* Allow messages from site to be seen
*
* @param site
*/
public void show(String site) {
userSpecificConfigs.put(site, new ListEntry(site, false));
}
/**
* Don't show messages from site
*
* @param site
*/
public void hide(String site) {
userSpecificConfigs.put(site, new ListEntry(site, true));
}
/**
* @return filter list for sites. see {@link #isWhitelist()}
*/
public String[] getSites() {
return sites.toArray(new String[0]);
}
/**
* @return true if filter list is a whitelist, false if it is a blacklist
*/
public boolean isWhitelist() {
return listType.equals(ListType.WHITELIST);
}
/**
* @return the actingSite
*/
public String getActingSite() {
return actingSite;
}
/**
* @return the userSpecificConfigs
*/
public Map<String, ListEntry> getUserSpecificConfigs() {
return userSpecificConfigs;
}
}

View file

@ -35,7 +35,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationC
import com.raytheon.uf.viz.collaboration.comm.provider.user.SharedGroup;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.ui.data.CollaborationGroupContainer;
import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
import com.raytheon.uf.viz.collaboration.ui.data.TreeObjectContainer;
/**
* Provides access to contacts list tree
@ -51,6 +51,7 @@ import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
* Jan 24, 2014 2701 bclement removed local groups, added shared groups
* Jan 27, 2014 2700 bclement added support roster entries
* Apr 24, 2014 3070 bclement removed check for hasInteraction() from group entries
* Oct 08, 2014 3705 bclement replaced checks for SessionGroupContainer with TreeObjectContainer
*
* </pre>
*
@ -93,9 +94,9 @@ public class UsersTreeContentProvider implements ITreeContentProvider {
*/
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof SessionGroupContainer) {
SessionGroupContainer group = (SessionGroupContainer) inputElement;
return group.getObjects().toArray();
if (inputElement instanceof TreeObjectContainer) {
TreeObjectContainer cont = (TreeObjectContainer) inputElement;
return cont.getObjects();
} else if (inputElement instanceof CollaborationGroupContainer) {
CollaborationGroupContainer cont = (CollaborationGroupContainer) inputElement;
return cont.getObjects().toArray();
@ -115,9 +116,9 @@ public class UsersTreeContentProvider implements ITreeContentProvider {
public Object[] getChildren(Object parentElement) {
// the only things that can have children are the sessions item or the
// groups items
if (parentElement instanceof SessionGroupContainer) {
SessionGroupContainer cont = (SessionGroupContainer) parentElement;
return cont.getObjects().toArray();
if (parentElement instanceof TreeObjectContainer) {
TreeObjectContainer cont = (TreeObjectContainer) parentElement;
return cont.getObjects();
} else if (parentElement instanceof RosterGroup) {
RosterGroup group = (RosterGroup) parentElement;
return getRosterChildren(group.getEntries());
@ -177,9 +178,9 @@ public class UsersTreeContentProvider implements ITreeContentProvider {
} else if (element instanceof SharedGroup) {
SharedGroup group = (SharedGroup) element;
hasChildren = rosterHasChildren(group.getEntries());
} else if (element instanceof SessionGroupContainer) {
SessionGroupContainer cont = (SessionGroupContainer) element;
if (cont.getObjects() != null && cont.getObjects().size() > 0) {
} else if (element instanceof TreeObjectContainer) {
TreeObjectContainer cont = (TreeObjectContainer) element;
if (cont.getObjects() != null && cont.getObjects().length > 0) {
hasChildren = true;
} else {
hasChildren = false;

View file

@ -43,7 +43,8 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager;
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
import com.raytheon.uf.viz.collaboration.comm.provider.user.SharedGroup;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.data.TreeObjectContainer;
/**
* Provides contacts list UI elements with icons, text, tooltips, etc
@ -64,6 +65,7 @@ import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
* Feb 17, 2014 2751 bclement added block image logic to userLabelProvider
* Mar 06, 2014 2848 bclement get venueName directly from session
* Jun 12, 2014 3267 bclement fixed missing null-check for outdated UI info
* Oct 08, 2014 3705 bclement replaced checks for SessionGroupContainer with TreeObjectContainer
*
* </pre>
*
@ -164,9 +166,9 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
key = "shared_group";
} else if (element instanceof IVenueSession) {
// key = "session_group";
} else if (element instanceof SessionGroupContainer) {
key = "session_group";
}
} else if (element instanceof TreeObjectContainer) {
key = ((TreeObjectContainer) element).getIcon();
}
if (imageMap.get(key) == null && !key.equals("")) {
imageMap.put(key, CollaborationUtils.getNodeImage(key));
@ -182,8 +184,8 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
return ((SharedGroup) element).getName();
} else if (element instanceof RosterEntry) {
return userLabelProvider.getText((RosterEntry) element);
} else if (element instanceof SessionGroupContainer) {
return "Active Sessions";
} else if (element instanceof TreeObjectContainer) {
return ((TreeObjectContainer) element).getLabel();
} else if (element instanceof UserId) {
UserId user = (UserId) element;
String fullname = userLabelProvider.getText(element);
@ -201,6 +203,8 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
return null;
}
return venue.getVenueName();
} else if (element instanceof VenueId) {
return ((VenueId) element).getName();
}
return null;
}
@ -208,7 +212,7 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
@Override
public Font getFont(Object element) {
if (element instanceof RosterGroup || element instanceof SharedGroup
|| element instanceof SessionGroupContainer) {
|| element instanceof TreeObjectContainer) {
// for this case do nothing, as it is not the top level of
// session groups
if (boldFont == null) {

View file

@ -28,6 +28,8 @@ import org.jivesoftware.smack.RosterGroup;
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
import com.raytheon.uf.viz.collaboration.comm.provider.user.SharedGroup;
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.data.PublicRoomContainer;
import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
/**
@ -42,6 +44,7 @@ import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
* Mar 1, 2012 rferrel Initial creation
* Dec 6, 2013 2561 bclement removed ECF
* Jan 24, 2014 2701 bclement removed local groups, added shared groups
* Oct 08, 2014 3705 bclement added public rooms (venue ids)
*
* </pre>
*
@ -74,6 +77,15 @@ public class UsersTreeViewerSorter extends ViewerSorter {
return 1;
}
/* bookmarked rooms next */
if (e1 instanceof PublicRoomContainer) {
if ((e2 instanceof PublicRoomContainer) == false) {
return -1;
}
} else if (e2 instanceof PublicRoomContainer) {
return 1;
}
// Groups before users.
if (e1 instanceof SharedGroup) {
if (!(e2 instanceof SharedGroup)) {
@ -129,6 +141,10 @@ public class UsersTreeViewerSorter extends ViewerSorter {
((RosterGroup) e2).getName());
}
if (e1 instanceof VenueId && e2 instanceof VenueId) {
return ((VenueId) e1).compareTo((VenueId) e2);
}
return 0;
}
}

View file

@ -0,0 +1,78 @@
/**
* 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 com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.Activator;
/**
* Adds bookmarks for public chatrooms
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class AddBookmarkAction extends Action {
private final VenueId[] rooms;
/**
*
*/
public AddBookmarkAction(VenueId... rooms) {
super("Add Bookmark");
this.rooms = rooms;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (connection != null) {
for (VenueId room : rooms) {
try {
connection.bookmarkRoom(room);
} catch (CollaborationException e) {
Activator.statusHandler.error("Unable to bookmark room: "
+ room.getFQName(), e);
}
}
}
}
}

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.
**/
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,6 +40,7 @@ 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}.
*
* </pre>
*
@ -66,7 +67,8 @@ public class ChangeFontAction extends Action {
.getConnection();
if (postData != null && connection != null) {
PreferenceConverter.setValue(store, "font", postData);
connection.postEvent(postData);
connection.postEvent(ChatDisplayChangeEvent
.createFontEvent(postData));
}
};
}

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.
**/
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

@ -31,8 +31,8 @@ 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.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
@ -46,6 +46,7 @@ import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 5, 2012 bsteffen Initial creation
* Oct 10, 2014 3708 bclement SiteConfigurationManager changes
*
* </pre>
*
@ -122,13 +123,11 @@ public class ChangeRoleAction extends Action {
}
private void fill() {
SiteConfigInformation siteInfo = SiteConfigurationManager
.getSiteConfigInformation();
Presence presence = CollaborationConnection.getConnection()
.getPresence();
String currentSite = (String) presence
.getProperty(SiteConfigInformation.SITE_NAME);
for (SiteConfig config : siteInfo.getConfig()) {
for (SiteConfig config : SiteConfigurationManager.getSiteConfigs()) {
if (config.getSite().equals(currentSite)) {
for (String role : config.getRoles()) {
Action action = new ChangeRoleAction(role);

View file

@ -31,11 +31,11 @@ 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.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
import com.raytheon.uf.viz.collaboration.ui.session.SubscribeList;
import com.raytheon.uf.viz.collaboration.ui.session.SiteChangeEvent;
/**
* Change the site for the logged in user
@ -47,6 +47,7 @@ import com.raytheon.uf.viz.collaboration.ui.session.SubscribeList;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 5, 2012 bsteffen Initial creation
* Oct 10, 2014 3708 bclement added SiteChangeEvent
*
* </pre>
*
@ -91,11 +92,8 @@ public class ChangeSiteAction extends Action {
Presence presence = connection.getPresence();
presence.setProperty(SiteConfigInformation.SITE_NAME, site);
// now need to send the new subscribe list out to those who are
// listening for it
SubscribeList list = new SubscribeList();
list.setEnabledSites(SiteConfigurationManager.getSubscribeList(site));
connection.postEvent(list);
/* now need to send the new site out to those who are listening for it */
connection.postEvent(new SiteChangeEvent(site));
try {
connection.getAccountManager().sendPresence(presence);
@ -129,9 +127,7 @@ public class ChangeSiteAction extends Action {
}
private void fill() {
SiteConfigInformation siteInfo = SiteConfigurationManager
.getSiteConfigInformation();
for (SiteConfig config : siteInfo.getConfig()) {
for (SiteConfig config : SiteConfigurationManager.getSiteConfigs()) {
Action action = new ChangeSiteAction(config.getSite());
IContributionItem contrib = new ActionContributionItem(action);
contrib.fill(menu, -1);

View file

@ -0,0 +1,84 @@
/**
* 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

@ -71,6 +71,7 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
* Apr 10, 2014 2937 bgonzale Connect to the venue after the feed view is available
* to display messages.
* Jun 16, 2014 3288 bclement feed venue configuration changes
* Oct 08, 2014 3705 bclement moved venue joining code to CollaborationConnection
*
* </pre>
*
@ -133,14 +134,11 @@ public class DisplayFeedAction extends Action {
String defaultHandle = HandleUtil.getDefaultHandle();
FeedVenueConfig config = FeedVenueConfigManager.getConfig();
VenueId venueId = createVenueId(config);
VenueSession session = connection.createTextOnlyVenue(venueId,
defaultHandle);
try {
session.configureVenue();
connection.postEvent(session);
VenueSession session = connection.joinTextOnlyVenue(venueId,
defaultHandle);
return session;
} catch (CollaborationException e) {
connection.removeSession(session);
final String msg = e.getLocalizedMessage()
+ "\n\nDefault handle options can be set in the Collaboration Preferences page.";
VizApp.runAsync(new Runnable() {

View file

@ -0,0 +1,136 @@
/**
* 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.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.session.VenueSession;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.prefs.HandleUtil;
import com.raytheon.uf.viz.collaboration.ui.session.SessionView;
import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
/**
* Action for joining a public chat room on server
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class JoinRoomAction extends Action {
private static final IUFStatusHandler log = UFStatus
.getHandler(JoinRoomAction.class);
private final boolean promptForHandle;
private final VenueId room;
/**
*
*/
public JoinRoomAction(VenueId room, boolean promptForHandle) {
super(promptForHandle ? "Join with Custom Handle"
: "Join with Default Handle");
this.promptForHandle = promptForHandle;
this.room = room;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
IVenueSession joinedVenueSession = connection
.getJoinedVenueSession(room);
if (joinedVenueSession != null) {
openExistingSession(joinedVenueSession);
return;
}
String handle = HandleUtil.getDefaultHandle();
if (promptForHandle) {
Shell shell = new Shell(Display.getCurrent());
InputDialog dlg = new InputDialog(shell, "Join Room",
"Enter handle for room: " + room.getName(), handle, null);
if (dlg.open() == Window.OK) {
handle = dlg.getValue();
} else {
/* user cancelled the dialog, abort joining the room */
return;
}
}
if (connection != null) {
try {
VenueSession session = connection.joinTextOnlyVenue(room,
handle);
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);
}
}
}
private void openExistingSession(IVenueSession session) {
if (promptForHandle) {
Shell shell = new Shell(Display.getCurrent());
/* we are already in the room, prompt user before continuing */
if (!MessageDialog.openQuestion(shell, "Already In Room",
"Already joined to room '" + room.getName()
+ "' with handle '"
+ session.getUserID().getHandle()
+ "'. Open Session?")) {
/* user aborted */
return;
}
}
new ShowVenueAction(session).run();
}
}

View file

@ -0,0 +1,79 @@
/**
* 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 com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.Activator;
/**
* Remove bookmark for public chat room on server
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class RemoveBookmarkAction extends Action {
private final VenueId[] rooms;
/**
*
*/
public RemoveBookmarkAction(VenueId... rooms) {
super("Remove Bookmark");
this.rooms = rooms;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (connection != null) {
for (VenueId room : rooms) {
try {
connection.removeBookmark(room);
} catch (CollaborationException e) {
Activator.statusHandler.error(
"Unable to remove bookmark for room: "
+ room.getFQName(), e);
}
}
}
}
}

View file

@ -39,6 +39,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager;
* Apr 23, 2012 mnash Initial creation
* Dec 20, 2013 2563 bclement added items from server roster not in groups
* Jan 24, 2014 2701 bclement removed local groups, added shared groups
* Oct 08, 2014 3705 bclement added public room group
*
* </pre>
*
@ -48,7 +49,9 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager;
public class CollaborationGroupContainer {
private SessionGroupContainer sessionGroup = new SessionGroupContainer();
private final SessionGroupContainer sessionGroup = new SessionGroupContainer();
private final PublicRoomContainer publicRoomGroup = new PublicRoomContainer();
public CollaborationGroupContainer() {
}
@ -67,6 +70,7 @@ public class CollaborationGroupContainer {
List<Object> result = new ArrayList<Object>();
result.add(connection.getUser());
result.add(sessionGroup);
result.add(publicRoomGroup);
ContactsManager contactsManager = connection.getContactsManager();
result.addAll(contactsManager.getSharedGroups());
result.addAll(contactsManager.getGroups());
@ -83,4 +87,11 @@ public class CollaborationGroupContainer {
return sessionGroup;
}
/**
* @return the publicRoomGroup
*/
public PublicRoomContainer getPublicRoomGroup() {
return publicRoomGroup;
}
}

View file

@ -0,0 +1,68 @@
/**
* 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.data;
import java.util.Collection;
import java.util.Collections;
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
import com.raytheon.uf.viz.collaboration.ui.Activator;
/**
* Contributes bookmarked public rooms to the group view
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class PublicRoomContainer extends TreeObjectContainer {
public PublicRoomContainer() {
super("Bookmarked Rooms", "session_group");
}
public Object[] getObjects() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (connection == null) {
return new Object[0];
}
Collection<VenueId> bookmarkedRooms;
try {
bookmarkedRooms = connection.getBookmarkedRooms();
} catch (CollaborationException e) {
Activator.statusHandler.error(
"Unable to get bookmarked rooms from server", e);
bookmarkedRooms = Collections.emptyList();
}
return bookmarkedRooms.toArray(new Object[0]);
}
}

View file

@ -21,7 +21,6 @@ package com.raytheon.uf.viz.collaboration.ui.data;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import com.raytheon.uf.viz.collaboration.comm.identity.ISession;
@ -39,19 +38,24 @@ import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationC
* ------------ ---------- ----------- --------------------------
* Mar 6, 2012 rferrel Initial creation
* Jan 28, 2014 2698 bclement removed venue info
* Oct 08, 2014 3705 bclement extends TreeObjectContainer
*
* </pre>
*
* @author rferrel
* @version 1.0
*/
public class SessionGroupContainer {
public class SessionGroupContainer extends TreeObjectContainer {
public List<Object> getObjects() {
public SessionGroupContainer() {
super("Active Sessions", "session_group");
}
public Object[] getObjects() {
CollaborationConnection connection = CollaborationConnection
.getConnection();
if (connection == null) {
return Collections.emptyList();
return new Object[0];
}
Collection<ISession> sessions = connection.getSessions();
List<Object> result = new ArrayList<Object>();
@ -60,7 +64,7 @@ public class SessionGroupContainer {
result.add(session);
}
}
return result;
return result.toArray();
}
}

View file

@ -0,0 +1,66 @@
/**
* 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.data;
/**
* Base class for containers that contribute groups to the collaboration group
* view
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2014 3705 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public abstract class TreeObjectContainer {
private final String label;
private final String icon;
public TreeObjectContainer(String label, String icon) {
this.label = label;
this.icon = icon;
}
public abstract Object[] getObjects();
/**
* @return the label
*/
public String getLabel() {
return label;
}
/**
* @return the icon
*/
public String getIcon() {
return icon;
}
}

View file

@ -20,6 +20,7 @@
package com.raytheon.uf.viz.collaboration.ui.login;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@ -45,12 +46,11 @@ import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Presence.Mode;
import org.jivesoftware.smack.packet.Presence.Type;
import com.google.common.collect.Iterators;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
import com.raytheon.uf.viz.collaboration.comm.identity.info.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.SiteConfig;
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnection;
import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationConnectionData;
@ -79,6 +79,7 @@ import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
* Apr 11, 2014 2903 bclement added success flag, moved login logic to static method
* fixed populating server with previous, removed password from heap
* Apr 23, 2014 2822 bclement added version to initial presence
* Oct 10, 2014 3708 bclement SiteConfigurationManager changes
*
* </pre>
*
@ -171,19 +172,13 @@ public class LoginDialog extends Dialog {
serverText.setLayoutData(gd);
// retrieve the servers
SiteConfigInformation information = SiteConfigurationManager
.getSiteConfigInformation();
List<HostConfig> siteServers = information.getServer();
if (siteServers == null) {
siteServers = new ArrayList<SiteConfigInformation.HostConfig>(0);
}
List<HostConfig> userServers = SiteConfigurationManager
.getUserHostConfig();
Collection<HostConfig> servers = SiteConfigurationManager
.getHostConfigs();
// put configured as true so we don't disable the login button
serverText.setData("configured", true);
String[] names = new String[siteServers.size() + userServers.size()];
Iterator<HostConfig> iter = Iterators.concat(siteServers.iterator(),
userServers.iterator());
String[] names = new String[servers.size()];
Iterator<HostConfig> iter = servers.iterator();
int index = 0;
String prevServer = loginData.getServer();
for (int i = 0; iter.hasNext() && i < names.length; i++) {
@ -264,11 +259,11 @@ public class LoginDialog extends Dialog {
comp.setLayoutData(gd);
// TODO: Default to previous settings
SiteConfigInformation information = SiteConfigurationManager
.getSiteConfigInformation();
Collection<SiteConfig> configs = SiteConfigurationManager
.getSiteConfigs();
List<String> sites = new ArrayList<String>();
final Map<String, String[]> roles = new HashMap<String, String[]>();
for (SiteConfig conf : information.getConfig()) {
for (SiteConfig conf : configs) {
sites.add(conf.getSite());
roles.put(conf.getSite(), conf.getRoles());
}
@ -387,7 +382,6 @@ public class LoginDialog extends Dialog {
cancelButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
SiteConfigurationManager.nullifySiteConfigInstance();
shell.dispose();
}
});

View file

@ -20,8 +20,8 @@
package com.raytheon.uf.viz.collaboration.ui.login;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Button;
@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.viz.collaboration.comm.identity.info.SiteConfigInformation.HostConfig;
import com.raytheon.uf.viz.collaboration.comm.identity.info.HostConfig;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
/**
@ -49,6 +49,7 @@ import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
* Jan 07, 2014 2563 bclement updated default xmpp port
* Jan 08, 2014 2563 bclement renamed from ServerInput to ServerListListener
* moved input responsibility to ServerInputDialog
* Oct 10, 2014 3708 bclement SiteConfigurationManager changes
*
* </pre>
*
@ -115,11 +116,10 @@ public class ServerListListener implements Listener {
*/
private void remove() {
Shell shell = Display.getCurrent().getActiveShell();
List<HostConfig> userHosts = SiteConfigurationManager
.getUserHostConfig();
if (!userHosts.isEmpty()) {
String[] options = new String[userHosts.size()];
Iterator<HostConfig> iter = userHosts.iterator();
Collection<HostConfig> hosts = SiteConfigurationManager.getHostConfigs();
if (!hosts.isEmpty()) {
String[] options = new String[hosts.size()];
Iterator<HostConfig> iter = hosts.iterator();
for (int i = 0; iter.hasNext() && i < options.length; ++i) {
options[i] = iter.next().toString();
}

View file

@ -45,6 +45,7 @@ import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants.HandleOpti
* Jan 14, 2014 2630 bclement added away on idle
* Jan 27, 2014 2700 bclement added auto accept subscribe
* Feb 3, 2014 2699 bclement added handle preferences
* Oct 9, 2014 3711 mapeters added chat lines preferences
*
* </pre>
*
@ -83,9 +84,15 @@ public class CollaborationPreferencePage extends FieldEditorPreferencePage
*/
@Override
protected void createFieldEditors() {
FieldEditor chatLines = new BooleanFieldEditor("chatLines",
"Display Chat Messages On Separate Line From Time And Name",
getFieldEditorParent());
this.addField(chatLines);
FieldEditor notifications = new BooleanFieldEditor("notifications",
"Show Notifications", getFieldEditorParent());
"Show Chat Notification Popups", getFieldEditorParent());
this.addField(notifications);
FieldEditor autojoinColl = new BooleanFieldEditor(
CollabPrefConstants.AUTO_JOIN, "Join Discussion On Login",
getFieldEditorParent());

View file

@ -30,7 +30,7 @@ import java.util.TimeZone;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.StringConverter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
@ -61,6 +61,8 @@ 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;
@ -93,6 +95,8 @@ import com.raytheon.viz.ui.views.CaveFloatingView;
* Mar 11, 2014 #2865 lvenable Added null checks for msgArchive.
* Jun 20, 2014 3281 bclement made sendErrorMessage() public
* 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.
* </pre>
*
* @author rferrel
@ -211,12 +215,24 @@ public abstract class AbstractSessionView<T extends IUser> extends
}
}
});
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
// here need to grab the font from preferences and use that font
messagesTextFont = new Font(Display.getCurrent(),
PreferenceConverter.getFontData(Activator.getDefault()
.getPreferenceStore(), "font"));
org.eclipse.jface.preference.PreferenceConverter.getFontData(
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
@ -358,8 +374,11 @@ public abstract class AbstractSessionView<T extends IUser> extends
sb.append("(").append(time).append(") ");
int offset = sb.length();
sb.append(name).append(": ").append(body);
boolean newLine = Activator.getDefault()
.getPreferenceStore().getBoolean("chatLines");
String displayPreference = newLine ? ("\n ") : (": ");
sb.append(name).append(displayPreference).append(body);
// here is the place to put the font and color changes for
// keywords
// read in localization file once and then don't read in again,
@ -572,15 +591,23 @@ public abstract class AbstractSessionView<T extends IUser> extends
}
@Subscribe
public void changeFont(FontData data) {
Font oldFont = messagesTextFont;
messagesTextFont = new Font(Display.getCurrent(), data);
messagesText.setFont(messagesTextFont);
if (oldFont != null) {
oldFont.dispose();
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 setAlertWords(List<AlertWord> words) {
alertWords = words;
}

View file

@ -20,7 +20,6 @@
package com.raytheon.uf.viz.collaboration.ui.session;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.swt.SWT;
@ -40,6 +39,7 @@ 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.ui.AbstractUserLabelProvider;
import com.raytheon.uf.viz.collaboration.ui.SiteConfigurationManager;
/**
* Generate the Participant's label and icon image.
@ -57,6 +57,7 @@ import com.raytheon.uf.viz.collaboration.ui.AbstractUserLabelProvider;
* Feb 13, 2014 2751 bclement VenueParticipant refactor
* 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
*
* </pre>
*
@ -69,7 +70,7 @@ public class ParticipantsLabelProvider extends
protected String sessionId = null;
private List<String> enabledSites;
private String actingSite;
protected Map<RGB, Color> colors = new HashMap<RGB, Color>();
@ -220,8 +221,13 @@ public class ParticipantsLabelProvider extends
if (presence != null) {
String site = String.valueOf(presence
.getProperty(SiteConfigInformation.SITE_NAME));
if (enabledSites != null && enabledSites.contains(site)) {
builder.append("\n").append("Subscribed");
if (actingSite != null
&& SiteConfigurationManager.isVisible(actingSite, site)) {
builder.append("\n").append(
"Messages from " + site + " are shown");
} else {
builder.append("\n").append(
"Messages from " + site + " are hidden");
}
}
if (isSomeKindOfLeader(user)) {
@ -235,8 +241,11 @@ public class ParticipantsLabelProvider extends
return builder.toString();
}
protected void setEnabledSites(List<String> enabledSites) {
this.enabledSites = enabledSites;
/**
* @param actingSite
*/
public void setActingSite(String actingSite) {
this.actingSite = actingSite;
}
/**

View file

@ -44,6 +44,7 @@ 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;
@ -75,6 +76,7 @@ import com.raytheon.uf.viz.core.icon.IconUtil;
* Mar 25, 2014 2938 mpduff Show status message for site and role changes.
* 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
*
* </pre>
*
@ -94,16 +96,14 @@ public class SessionFeedView extends SessionView {
private Action userRemoveSiteAction;
private List<String> enabledSites;
private final List<String> userEnabledSites;
private List<SiteColor> colors;
private String actingSite;
/**
* Set of users logged in.
*/
private final ConcurrentHashMap<String, Presence> enabledUsers = new ConcurrentHashMap<String, Presence>();
private final ConcurrentHashMap<String, Presence> otherParticipants = new ConcurrentHashMap<String, Presence>();
private volatile boolean initialized = false;
@ -112,11 +112,9 @@ public class SessionFeedView extends SessionView {
*/
public SessionFeedView() {
super();
String actingSite = CollaborationConnection.getConnection()
actingSite = CollaborationConnection.getConnection()
.getPresence().getProperty(SiteConfigInformation.SITE_NAME)
.toString();
enabledSites = SiteConfigurationManager.getSubscribeList(actingSite);
userEnabledSites = SiteConfigurationManager.getUserSubscribeList();
}
/*
@ -129,7 +127,7 @@ public class SessionFeedView extends SessionView {
@Override
protected void initComponents(Composite parent) {
super.initComponents(parent);
colors = SiteConfigurationManager.getSiteColors();
colors = SiteColorConfigManager.getSiteColors();
if (colors != null) {
for (VenueParticipant user : session.getVenue().getParticipants()) {
setColorForSite(user);
@ -141,8 +139,8 @@ public class SessionFeedView extends SessionView {
}
@Subscribe
public void refreshBlockList(SubscribeList list) {
enabledSites = list.getEnabledSites();
public void refreshBlockList(SiteChangeEvent event) {
this.actingSite = event.getNewSite();
}
/*
@ -209,17 +207,19 @@ public class SessionFeedView extends SessionView {
}
});
userAddSiteAction = new Action("Subscribe") {
userAddSiteAction = new Action("Show Messages from Site") {
@Override
public void run() {
userEnabledSites.add(getSelectedSite());
SiteConfigurationManager
.showSite(actingSite, getSelectedSite());
};
};
userRemoveSiteAction = new Action("Unsubscribe") {
userRemoveSiteAction = new Action("Hide Messages from Site") {
@Override
public void run() {
userEnabledSites.remove(getSelectedSite());
SiteConfigurationManager
.hideSite(actingSite, getSelectedSite());
}
};
@ -240,13 +240,12 @@ public class SessionFeedView extends SessionView {
super.fillContextMenu(manager);
manager.add(colorChangeAction);
String site = getSelectedSite();
if (userEnabledSites.contains(site) == false
&& enabledSites.contains(site) == false) {
userAddSiteAction.setText("Subscribe to " + getSelectedSite());
if (!SiteConfigurationManager.isVisible(actingSite, site)) {
userAddSiteAction
.setText("Show Messages from " + getSelectedSite());
manager.add(userAddSiteAction);
} else if (enabledSites.contains(site) == false
&& userEnabledSites.contains(site)) {
userRemoveSiteAction.setText("Unsubscribe from "
} else {
userRemoveSiteAction.setText("Hide Messages from "
+ getSelectedSite());
manager.add(userRemoveSiteAction);
}
@ -262,7 +261,7 @@ public class SessionFeedView extends SessionView {
@Override
protected void setParticipantValues(ParticipantsLabelProvider labelProvider) {
super.setParticipantValues(labelProvider);
labelProvider.setEnabledSites(enabledSites);
labelProvider.setActingSite(actingSite);
}
/*
@ -293,8 +292,9 @@ public class SessionFeedView extends SessionView {
}
// should we append?
if (site == null || enabledSites.contains(site)
|| userEnabledSites.contains(site)) {
if (site == null
|| SiteConfigurationManager
.isVisible(actingSite, site.toString())) {
appendMessage(msg);
}
}
@ -433,10 +433,9 @@ public class SessionFeedView extends SessionView {
String siteName = getSiteName(presence);
// only show sites you care about
if (enabledSites.contains(siteName)
|| userEnabledSites.contains(siteName)) {
if (SiteConfigurationManager.isVisible(actingSite, siteName)) {
String user = participant.getName();
Presence prev = enabledUsers.get(user);
Presence prev = otherParticipants.get(user);
String roleName = getRoleName(presence);
if (presence.isAvailable()) {
@ -447,7 +446,7 @@ public class SessionFeedView extends SessionView {
sendSystemMessage(message);
}
enabledUsers.put(user, presence);
otherParticipants.put(user, presence);
}
}
@ -536,7 +535,7 @@ public class SessionFeedView extends SessionView {
@Override
protected void participantDeparted(VenueParticipant participant,
String description) {
if (enabledUsers.remove(participant.getName()) != null) {
if (otherParticipants.remove(participant.getName()) != null) {
super.participantDeparted(participant, description);
}
}
@ -551,11 +550,7 @@ public class SessionFeedView extends SessionView {
super.dispose();
SiteColorInformation information = new SiteColorInformation();
information.setColors(this.colors);
SiteConfigurationManager.writeSiteColorInformation(information);
// write out the user enabled sites information to a file
String[] sites = userEnabledSites.toArray(new String[userEnabledSites
.size()]);
SiteConfigurationManager.writeUserEnabledSites(sites);
// TODO should color config be written more often?
SiteColorConfigManager.writeSiteColorInformation(information);
}
}

View file

@ -19,13 +19,8 @@
**/
package com.raytheon.uf.viz.collaboration.ui.session;
import java.util.List;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* TODO Add Description
* Event fired when the user changes the acting site
*
* <pre>
*
@ -33,30 +28,29 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 7, 2012 mnash Initial creation
* Oct 9, 2014 3708 bclement Initial creation
*
* </pre>
*
* @author mnash
* @author bclement
* @version 1.0
*/
@DynamicSerialize
public class SubscribeList {
@DynamicSerializeElement
private List<String> enabledSites;
public class SiteChangeEvent {
private final String newSite;
/**
* @return the enabledUsers
*
*/
public List<String> getEnabledSites() {
return enabledSites;
public SiteChangeEvent(String newSite) {
this.newSite = newSite;
}
/**
* @param enabledUsers
* the enabledUsers to set
* @return the newSite
*/
public void setEnabledSites(List<String> enabledSites) {
this.enabledSites = enabledSites;
public String getNewSite() {
return newSite;
}
}

View file

@ -2,6 +2,5 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -2,15 +2,13 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: D2D Upper Air
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.ui.upperair;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.d2d.ui.upperair.Activator
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.core.runtime,
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
com.raytheon.uf.viz.profiler;bundle-version="1.12.1174",
com.raytheon.viz.pointdata;bundle-version="1.12.1174",
com.raytheon.uf.viz.aviation.advisory;bundle-version="1.12.1174",
com.raytheon.uf.viz.vaa;bundle-version="1.12.1174",
com.raytheon.uf.viz.cwa;bundle-version="1.12.1174",
com.raytheon.uf.viz.bufrsigwx;bundle-version="1.12.1174",
@ -20,5 +18,5 @@ Require-Bundle: org.eclipse.core.runtime,
com.raytheon.uf.viz.ncwf;bundle-version="1.12.1174",
com.raytheon.viz.lpi;bundle-version="1.12.1174",
com.raytheon.viz.spi;bundle-version="1.12.1174"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy

View file

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

View file

@ -19,86 +19,54 @@
further_licensing_information.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="subMenu" menuText="Aviation">
<contribute xsi:type="titleItem" titleText="------ Convection Products ------" />
<contribute xsi:type="bundleItem" file="bundles/ConvSigmet.xml"
menuText="Convective SIGMET" id="ConvSigmet">
</contribute>
<contribute xsi:type="bundleItem" file="bundles/BufrNcwf.xml" menuText="NCWF" id="NCWF">
</contribute>
<contribute xsi:type="separator" id="separator1"/>
<contribute xsi:type="titleItem" titleText="------ Icing Products ------" />
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml" menuText="SIGMET" id="SIGMETICING">
<substitute key="hazardType" value="ICING"/>
<substitute key="color" value="#FFFFFF"/>
<substitute key="name" value="Icing SIGMET"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml" menuText="AIRMET" id="AIRMETICING">
<substitute key="hazardType" value="ICING"/>
<substitute key="color" value="#0000FF"/>
<substitute key="name" value="Icing AIRMET"/>
</contribute>
<contribute xsi:type="separator" id="separator2"/>
<contribute xsi:type="titleItem" titleText="------ Turbulence Products ------" />
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml" menuText="SIGMET" id="SIGMETTURB">
<substitute key="hazardType" value="TURBULENCE"/>
<substitute key="color" value="#FF4444"/>
<substitute key="name" value="Turbulence SIGMET"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml" menuText="AIRMET" id="AIRMETTURB">
<substitute key="hazardType" value="TURBULENCE"/>
<substitute key="color" value="#00FF00"/>
<substitute key="name" value="Turbulence AIRMET"/>
</contribute>
<contribute xsi:type="separator" id="separator3"/>
<contribute xsi:type="titleItem" titleText="------ Visibility Products ------" />
<contribute xsi:type="subMenu" menuText="AIRMET">
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml" menuText="IFR" id="AIRMETIFR">
<substitute key="hazardType" value="INSTRUMENT FLIGHT RULES"/>
<substitute key="color" value="#00FFFF"/>
<substitute key="name" value="IFR AIRMET"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Airmet.xml" menuText="Mtn Obscn" id="AIRMETMTNOBSC">
<substitute key="hazardType" value="MOUNTAIN OBSCURATION"/>
<substitute key="color" value="#FF0088"/>
<substitute key="name" value="Mtn Obscn AIRMET"/>
</contribute>
</contribute>
<contribute xsi:type="separator" id="separator4"/>
<contribute xsi:type="titleItem" titleText="------ Tropical Cyclone ------" />
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml" menuText="SIGMET" id="SIGMETTTOPCYCLONE">
<substitute key="hazardType" value="TROPICAL CYCLONE"/>
<substitute key="color" value="#00FFFF"/>
<substitute key="name" value="Tropical Cyclone SIGMET"/>
</contribute>
<contribute xsi:type="separator" id="separator5"/>
<contribute xsi:type="titleItem" titleText="------ Volcanic Ash ------" />
<contribute xsi:type="bundleItem" file="bundles/NonConvSigmet.xml" menuText="SIGMET" id="SIGMETVOLCANICASH">
<substitute key="hazardType" value="VOLCANIC ASH CLOUD"/>
<substitute key="color" value="#00FF00"/>
<substitute key="name" value="Volcanic Ash SIGMET"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/VAA.xml" menuText="Volcanic Ash Advisories" id="VAA">
</contribute>
<contribute xsi:type="separator" id="separator6"/>
<contribute xsi:type="titleItem" titleText="------Center Weather ------" />
<contribute xsi:type="bundleItem" file="bundles/CWA.xml" menuText="Center Weather Advisories" id="cwa">
</contribute>
<contribute xsi:type="separator" id="separator7"/>
<contribute xsi:type="subMenu" id="Aviation" menuText="Aviation">
<contribute xsi:type="titleItem"
titleText="------ Convection Products ------" />
<contribute xsi:type="separator" id="ConvectionProductsStart"
visible="false" />
<contribute xsi:type="bundleItem" file="bundles/BufrNcwf.xml"
menuText="NCWF" id="NCWF">
</contribute>
<contribute xsi:type="separator" id="ConvectionProductsEnd" />
<contribute xsi:type="titleItem" titleText="------Significant Weather------" />
<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>
</contribute>
<contribute xsi:type="separator" id="separator8"/>
<contribute xsi:type="titleItem" titleText="------ Icing Products ------" />
<contribute xsi:type="separator" id="IcingProductsEnd" />
<contribute xsi:type="titleItem"
titleText="------ Turbulence Products ------" />
<contribute xsi:type="separator" id="TurbulenceProductsEnd" />
<contribute xsi:type="titleItem"
titleText="------ Visibility Products ------" />
<contribute xsi:type="separator" id="VisibilityProductsEnd" />
<contribute xsi:type="titleItem" titleText="------ Tropical Cyclone ------" />
<contribute xsi:type="separator" id="TropicalCycloneEnd" />
<contribute xsi:type="titleItem" titleText="------ Volcanic Ash ------" />
<contribute xsi:type="separator" id="VolcanicAshStart"
visible="false" />
<contribute xsi:type="bundleItem" file="bundles/VAA.xml"
menuText="Volcanic Ash Advisories" id="VAA">
</contribute>
<contribute xsi:type="separator" id="VolcanicAshEnd" />
<contribute xsi:type="titleItem" titleText="------Center Weather ------" />
<contribute xsi:type="bundleItem" file="bundles/CWA.xml"
menuText="Center Weather Advisories" id="cwa">
</contribute>
<contribute xsi:type="separator" id="CenterWeatherEnd" />
<contribute xsi:type="titleItem"
titleText="------Significant Weather------" />
<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>
</contribute>
<contribute xsi:type="separator" id="AviationMenuEnd" />
</menuTemplate>

View file

@ -1,30 +0,0 @@
package com.raytheon.uf.viz.d2d.ui.upperair;
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

@ -29,12 +29,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="gov.noaa.nws.ncep.common.dataplugin.airep"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="com.raytheon.uf.common.dataplugin.binlightning"
download-size="0"
@ -131,12 +125,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="gov.noaa.nws.ncep.common.dataplugin.pirep"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="com.raytheon.uf.common.dataplugin.poessounding"
download-size="0"

View file

@ -0,0 +1,22 @@
<?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.
-->
<DerivedParameter abbreviation="GVV1hr" name="Mean 1hr Geometric Vertical Velocity" unit="m/s" />

View file

@ -18,5 +18,8 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<DerivedParameter unit="" name="Max Lightning Threat (flashes/km^2)" abbreviation="LTNG">
<DerivedParameter unit="" name="Max 1hr Lightning Threat (flashes/km^2)" abbreviation="LTNG">
<Method name="Alias">
<Field abbreviation="LTNG1hr"/>
</Method>
</DerivedParameter>

View file

@ -0,0 +1,26 @@
<?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.
-->
<DerivedParameter abbreviation="MAXUPHL" name="Max 1hr Updraft Helicity" unit="m^2/s^2" >
<Method name="Alias" >
<Field abbreviation="MXUPHL1hr" />
</Method>
</DerivedParameter>

View file

@ -18,7 +18,7 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<DerivedParameter abbreviation="MAXDVV" name="Max Downdraft Vertical Velocity" unit="m/s" >
<DerivedParameter abbreviation="MXDVV" name="Max 1hr Downdraft Vertical Velocity" unit="m/s" >
<Method name="Alias">
<Field abbreviation="MAXDVV1hr"/>
</Method>

View file

@ -18,7 +18,7 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<DerivedParameter abbreviation="MAXUVV" name="Max Updraft Vertical Velocity" unit="m/s" >
<DerivedParameter abbreviation="MXUVV" name="Max 1hr Updraft Vertical Velocity" unit="m/s" >
<Method name="Alias">
<Field abbreviation="MAXUVV1hr"/>
</Method>

View file

@ -84,6 +84,7 @@ import com.raytheon.uf.viz.core.maps.jobs.AbstractMapQueryJob;
import com.raytheon.uf.viz.core.maps.jobs.AbstractMapRequest;
import com.raytheon.uf.viz.core.maps.jobs.AbstractMapResult;
import com.raytheon.uf.viz.core.maps.rsc.AbstractMapResource;
import com.raytheon.uf.viz.core.preferences.PreferenceConverter;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory;
import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory.ResourceOrder;
@ -94,7 +95,6 @@ import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.ShadeableCapability;
import com.raytheon.uf.viz.gisdatastore.Activator;
import com.raytheon.uf.viz.gisdatastore.ui.PreferenceConverter;
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
import com.raytheon.viz.core.rsc.jts.JTSCompiler.JTSGeometryData;
import com.raytheon.viz.core.rsc.jts.JTSCompiler.PointStyle;

View file

@ -27,6 +27,7 @@ import org.eclipse.swt.widgets.ColorDialog;
import org.eclipse.swt.widgets.Composite;
import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.uf.viz.core.preferences.StringConverter;
/**
* Preference field editor for selecting a color for the DataStoreResource

View file

@ -26,6 +26,7 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.preferences.StringConverter;
/**
* Preference field editor for selecting a color for the DataStoreResource

View file

@ -24,6 +24,8 @@ import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import com.raytheon.uf.viz.core.preferences.StringConverter;
/**
* Preference field editor for selecting a line width for DataStoreResource
* highlight

View file

@ -29,6 +29,7 @@ import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import com.raytheon.uf.viz.core.preferences.StringConverter;
import com.raytheon.viz.ui.dialogs.SetOpacityDialog;
/**

View file

@ -1,201 +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.gisdatastore.ui;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.RGBColors;
/**
* Utility for loading and saving GIS Viewer preferences
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 27, 2012 randerso Initial creation
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class PreferenceConverter {
private PreferenceConverter() {
// unused, all methods are static
}
/**
* Get an RGB color preference value. If no preference is stored,
* defaultValue will be returned
*
* @param prefs
* the preference store
* @param key
* the preference key
* @param defaultValue
* the default value
* @return the RGB color
*/
public static RGB getRGB(IPreferenceStore prefs, String key,
String defaultValue) {
String value = prefs.getString(key);
RGB newColor = StringConverter.asRGB(value);
if (newColor == null) {
newColor = StringConverter.asRGB(defaultValue);
}
return newColor;
}
/**
* Store an RGB color preference value.
*
* @param prefs
* the preference store
* @param key
* the preference key
* @param color
* the RGB color to be stored
*/
public static void setValue(IPreferenceStore prefs, String key, RGB color) {
String value = RGBColors.getColorName(color);
prefs.setValue(key, value);
}
/**
* Get a LineStyle value. If no preference is stored, defaultValue will be
* returned
*
* @param prefs
* the preference store
* @param key
* the preference key
* @param defaultValue
* the default value
* @return the LineStyle
*/
public static LineStyle getLineStyle(IPreferenceStore prefs, String key,
String defaultValue) {
String value = prefs.getString(key);
LineStyle style = StringConverter.asLineStyle(value);
if (style == null) {
style = StringConverter.asLineStyle(defaultValue);
}
return style;
}
/**
* Store a LineStyle preference value.
*
* @param prefs
* the preference store
* @param key
* the preference key
* @param opacity
* the LineStyle to be stored
*/
public static void setValue(IPreferenceStore prefs, String key,
LineStyle style) {
String value = style.name();
prefs.setValue(key, value);
}
/**
* Get an integer preference value. If no preference is stored, defaultValue
* will be returned
*
* @param prefs
* the preference store
* @param key
* the preference key
* @param defaultValue
* the default value
* @return the integer value
*/
public static int getInt(IPreferenceStore prefs, String key,
String defaultValue) {
String stringValue = prefs.getString(key);
Integer value = StringConverter.asInteger(stringValue);
if (value == null) {
value = StringConverter.asInteger(defaultValue);
}
return value;
}
/**
* Store an integer preference value.
*
* @param prefs
* the preference store
* @param key
* the preference key
* @param value
* the integer value to be stored
*/
public static void setValue(IPreferenceStore prefs, String key, int value) {
String stringValue = StringConverter.asString(value);
prefs.setValue(key, stringValue);
}
/**
* Get an float preference value. If no preference is stored, defaultValue
* will be returned
*
* @param prefs
* the preference store
* @param key
* the preference key
* @param defaultValue
* the default value
* @return the float value
*/
public static float getFloat(IPreferenceStore prefs, String key,
String defaultValue) {
String stringValue = prefs.getString(key);
Float value = StringConverter.asFloat(stringValue);
if (value == null) {
value = StringConverter.asFloat(defaultValue);
}
return value;
}
/**
* Store an float preference value.
*
* @param prefs
* the preference store
* @param key
* the preference key
* @param value
* the float value to be stored
*/
public static void setValue(IPreferenceStore prefs, String key, float value) {
String stringValue = StringConverter.asString(value);
prefs.setValue(key, stringValue);
}
}

View file

@ -1,163 +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.gisdatastore.ui;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.RGBColors;
/**
* Convert GIS Viewer preference types to/from strings
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 27, 2012 randerso Initial creation
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class StringConverter {
private StringConverter() {
// unused, all methods are static
}
/**
* Convert RGB color value to string
*
* @param color
* RGB color value
* @return string String value
*/
public static String asString(RGB color) {
return RGBColors.getColorName(color);
}
/**
* Convert string to RGB color value
*
* @param string
* String value
* @return RGB color value or null if string is not a valid RGB color name
* or hex value of the form "#rrggbb"
*/
public static RGB asRGB(String string) {
RGB rgb = RGBColors.getRGBColor(string);
return rgb;
}
/**
* Convert LineStyle value to string
*
* @param opacity
* LineStyle value
* @return string String value
*/
public static String asString(LineStyle style) {
return style.name();
}
/**
* Convert string to LineStyle value
*
* @param string
* String value
* @return LineStyle value or null if string is not a valid LineStyle name
*/
public static LineStyle asLineStyle(String string) {
LineStyle style = null;
try {
style = LineStyle.valueOf(string);
} catch (Exception e) {
style = null;
}
return style;
}
/**
* Convert integer value to string
*
* @param value
* integer value
* @return string String value
*/
public static String asString(int value) {
return Integer.toString(value);
}
/**
* Convert string to Integer value
*
* @param string
* String Value
* @return Integer value or null if string is not a valid integer
* representation
*/
public static Integer asInteger(String string) {
Integer value = null;
try {
value = Integer.parseInt(string);
} catch (Exception e) {
value = null;
}
return value;
}
/**
* Convert float value to string
*
* @param value
* float value
* @return string String value
*/
public static String asString(float value) {
return Float.toString(value);
}
/**
* Convert string to Float value
*
* @param string
* String Value
* @return Float value or null if string is not a valid float representation
*/
public static Float asFloat(String string) {
Float value = null;
try {
value = Float.parseFloat(string);
} catch (Exception e) {
value = null;
}
return value;
}
}

View file

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

View file

@ -102,7 +102,7 @@ import de.micromata.opengis.kml.v_2_2_0.Vec2;
* ------------- -------- ----------- --------------------------
* Jun0 6, 2012 bsteffen Initial creation
* Jan 23, 2014 2703 bsteffen Use framesInfo for frame count.
*
* Oct 06, 2014 3686 njensen Ensure lastIndex is at least 1
*
* </pre>
*
@ -305,6 +305,8 @@ public class KmlExportJob extends Job {
int lastIndex = options.getLastFrameIndex();
lastIndex = Math.min(lastIndex, descriptor.getFramesInfo()
.getFrameCount());
// in case there's zero frames (i.e. all time agnostic)
lastIndex = Math.max(lastIndex, 1);
rscmonitor.beginTask("Saving " + rsc.getName(), lastIndex
- startIndex);
DataTime[] times = descriptor.getFramesInfo().getTimeMap()
@ -321,6 +323,7 @@ public class KmlExportJob extends Job {
}
}
}
List<DataTime> pastFrames = new ArrayList<DataTime>();
for (int i = startIndex; i < lastIndex; i += 1) {
descriptor.setFramesInfo(new FramesInfo(i));

View file

@ -20,61 +20,84 @@
-->
<bundle>
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<displays xsi:type="d2DMapRenderableDisplay"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<loadProperties loadWithoutData="false">
<capabilities>
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1"/>
<capability xsi:type="colorableCapability" colorAsString="#9b9b9b"/>
<capability xsi:type="outlineCapability"
lineStyle="SOLID" outlineOn="true"
outlineWidth="1" />
<capability xsi:type="colorableCapability"
colorAsString="#9b9b9b" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="true" isHoverOn="false"
isVisible="true">
<pdProps maxDisplayWidth="100000000"
minDisplayWidth="0" />
</properties>
<resourceData xsi:type="spiResourceData" pixelSizeHint="45">
<resourceData xsi:type="spiResourceData"
pixelSizeHint="45">
<filename>basemaps/MTR.spi</filename>
<mapName>METAR Station Locations</mapName>
</resourceData>
</resource>
<resource>
<loadProperties>
<capabilities>
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1" />
<capability xsi:type="colorableCapability" colorAsString="#9b9b9b" />
<capability xsi:type="labelableCapability" labelField="id" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false"
isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0" />
</properties>
<resourceData xsi:type="dbMapResourceData">
<table>mapdata.marinezones</table>
<mapName>Coastal Marine Zones</mapName>
</resourceData>
</resource>
<resource>
<loadProperties loadWithoutData="false">
<resourceType>PLAN_VIEW</resourceType>
<capabilities>
<capability xsi:type="colorableCapability" colorAsString="#9b9b9b"/>
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1"/>
<capability xsi:type="magnificationCapability" magnification="1.0"/>
<capability xsi:type="densityCapability" density="1.0"/>
<capability xsi:type="pointCapability" pointStyle="CROSS"/>
</capabilities>
</loadProperties>
<properties renderingOrderId="PLOT" isSystemResource="false" isBlinking="false" isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
</properties>
<resourceData xsi:type="spiResourceData">
<filename>basemaps/BUOY.spi</filename>
<mapName>Fixed Buoy Locations</mapName>
</resourceData>
</resource>
<resource>
<loadProperties>
<capabilities>
<capability xsi:type="outlineCapability"
lineStyle="SOLID" outlineOn="true"
outlineWidth="1" />
<capability xsi:type="colorableCapability"
colorAsString="#9b9b9b" />
<capability xsi:type="labelableCapability"
labelField="id" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="true" isHoverOn="false"
isVisible="true">
<pdProps maxDisplayWidth="100000000"
minDisplayWidth="0" />
</properties>
<resourceData xsi:type="dbMapResourceData">
<table>mapdata.marinezones</table>
<mapName>Coastal Marine Zones</mapName>
</resourceData>
</resource>
<resource>
<loadProperties loadWithoutData="false">
<resourceType>PLAN_VIEW</resourceType>
<capabilities>
<capability xsi:type="colorableCapability"
colorAsString="#9b9b9b" />
<capability xsi:type="outlineCapability"
lineStyle="SOLID" outlineOn="true"
outlineWidth="1" />
<capability xsi:type="magnificationCapability"
magnification="1.0" />
<capability xsi:type="densityCapability"
density="1.0" />
<capability xsi:type="pointCapability"
pointStyle="CROSS" />
</capabilities>
</loadProperties>
<properties renderingOrderId="PLOT"
isSystemResource="false" isBlinking="false"
isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000"
minDisplayWidth="0" />
</properties>
<resourceData xsi:type="spiResourceData">
<filename>basemaps/BUOY.spi</filename>
<mapName>Fixed Buoy Locations</mapName>
</resourceData>
</resource>
<!-- *****************METARS*********************** -->
<resource>
<loadProperties loadWithoutData="true">
@ -82,26 +105,32 @@
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotSource="METARS in FOG Monitor Area "
plotModelFile="fssMetar.svg" spiFile="basemaps/MTR.spi" retrieveData="false" isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotSource="METARS in FOG Monitor Area "
plotModelFile="fssMetar.svg" spiFile="basemaps/MTR.spi"
retrieveData="false" isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
</mapping>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="reportType">
<constraint constraintValue="METAR, SPECI" constraintType="IN"/>
<constraint constraintValue="METAR, SPECI"
constraintType="IN" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="fog" constraintType="EQUALS"/>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
<binOffset virtualOffset="0" posOffset="1800" negOffset="1800"/>
<alertParser xsi:type="plotAlertParser"/>
<binOffset virtualOffset="0"
posOffset="1800" negOffset="1800" />
<alertParser xsi:type="plotAlertParser" />
</resourceData>
</resource>
<!-- ******************Fixed Buoys********************** -->
@ -111,78 +140,95 @@
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotSource="Fixed Buoys in FOG Monitor Area"
plotModelFile="fssMaritime.svg" retrieveData="false" isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotSource="Fixed Buoys in FOG Monitor Area"
plotModelFile="fssMaritime.svg" retrieveData="false"
isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="reportType">
<constraint constraintValue="1004,1005" constraintType="IN" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="fog" constraintType="EQUALS"/>
<mapping key="reportType">
<constraint constraintValue="1004,1005"
constraintType="IN" />
</mapping>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
<binOffset virtualOffset="0" posOffset="1800" negOffset="1800"/>
<alertParser xsi:type="plotAlertParser"/>
<binOffset virtualOffset="0"
posOffset="1800" negOffset="1800" />
<alertParser xsi:type="plotAlertParser" />
</resourceData>
</resource>
<!-- ***************Moving Buoys/Ships**************** -->
<resource>
<loadProperties loadWithoutData="true">
<capabilities>
<loadProperties loadWithoutData="true">
<capabilities>
</capabilities>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true" />
<resourceData xsi:type="plotResourceData" plotSource="Moving Buoys/Ships in FOG Monitor Area"
plotModelFile="fssMaritime.svg" isUpdatingOnMetadataOnly="false" retrieveData="false"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<binOffset posOffset="1800" negOffset="1800" virtualOffset="0"/>
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS" />
</mapping>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="reportType">
<constraint constraintValue="1006,1003" constraintType="IN" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="fog" constraintType="EQUALS"/>
</loadProperties>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotSource="Moving Buoys/Ships in FOG Monitor Area"
plotModelFile="fssMaritime.svg"
isUpdatingOnMetadataOnly="false" retrieveData="false"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<binOffset posOffset="1800" negOffset="1800"
virtualOffset="0" />
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
</metadataMap>
<alertParser xsi:type="plotAlertParser"/>
</resourceData>
</resource>
<mapping key="reportType">
<constraint constraintValue="1006,1003"
constraintType="IN" />
</mapping>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
<alertParser xsi:type="plotAlertParser" />
</resourceData>
</resource>
<!-- **************************Ldadmesonet************************************ -->
<resource>
<loadProperties loadWithoutData="false">
<capabilities/>
<capabilities />
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotSource="LDAD MESONET in Fog Monitor Area"
plotModelFile="fssMetar.svg" retrieveData="false" isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotSource="LDAD MESONET in Fog Monitor Area"
plotModelFile="fssMetar.svg" retrieveData="false"
isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="reportType">
<constraint constraintValue="mesonet" constraintType="EQUALS" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="fog" constraintType="EQUALS"/>
<constraint constraintValue="mesonet"
constraintType="EQUALS" />
</mapping>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
</resourceData>
@ -191,30 +237,38 @@
<resource>
<loadProperties loadWithoutData="true">
<capabilities>
<capability xsi:type="colorableCapability" colorAsString="#ffff00"/>
<capability xsi:type="colorableCapability"
colorAsString="#ffff00" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotSource="MAROBs in FOG Monitor Area"
plotModelFile="fssMaritime.svg" retrieveData="false" isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotSource="MAROBs in FOG Monitor Area"
plotModelFile="fssMaritime.svg" retrieveData="false"
isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="reportType">
<constraint constraintValue="1007" constraintType="EQUALS"/>
<constraint constraintValue="1007"
constraintType="EQUALS" />
</mapping>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="fog" constraintType="EQUALS"/>
</mapping>
</metadataMap>
<binOffset virtualOffset="0" posOffset="1800" negOffset="1800"/>
<alertParser xsi:type="plotAlertParser"/>
<binOffset virtualOffset="0"
posOffset="1800" negOffset="1800" />
<alertParser xsi:type="plotAlertParser" />
</resourceData>
</resource>
<!-- *********************** FOG ***************** -->
@ -222,29 +276,40 @@
<loadProperties loadWithoutData="true">
<capabilities>
<capability xsi:type="colorMapCapability">
<colorMapParameters colorMapName="fog/fog"/>
<colorMapParameters
colorMapName="fog/fog" />
</capability>
<capability xsi:type="colorableCapability" colorAsString="#ff00ff"/>
<capability xsi:type="imagingCapability" alpha="0.5" interpolationState="false" brightness="1.0" contrast="1.0"/>
<capability xsi:type="colorableCapability"
colorAsString="#ff00ff" />
<capability xsi:type="imagingCapability"
alpha="0.5" interpolationState="false"
brightness="1.0" contrast="1.0" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
<perspectiveProperty xsi:type="d2dLoadProperties" overlayMatchDelta="0" overlayMatchTolerance="1.0"/>
<perspectiveProperty
xsi:type="d2dLoadProperties"
overlayMatchDelta="0" overlayMatchTolerance="1.0" />
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true">
<pdProps maxDisplayWidth="100000000"
minDisplayWidth="0" />
</properties>
<resourceData xsi:type="fogResourceData" plotSource="Fog Threat Level" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
<resourceData xsi:type="fogResourceData"
plotSource="Fog Threat Level"
isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true">
<metadataMap>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="pluginName">
<constraint constraintValue="fog" constraintType="EQUALS"/>
<constraint constraintValue="fog"
constraintType="EQUALS" />
</mapping>
</metadataMap>
</resourceData>
</resource>
<timeMatcher xsi:type="d2DTimeMatcher" deltaFilter="0" forecastFilter="0"/>
<timeMatcher xsi:type="d2DTimeMatcher"
deltaFilter="0" forecastFilter="0" />
<numberOfFrames>12</numberOfFrames>
</descriptor>
</displays>

View file

@ -20,18 +20,22 @@
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/fog/fogImageTable.xml"
menuText="Fog Monitor Table/Display" id="FOGMONITOR" commandId="com.raytheon.uf.viz.monitor.fog.ui.actions.fogMonitor">
<substitute key="cwa" value="${cwa}" />
<substitute key="colormap" value="fog/fog" />
</contribute>
<contribute xsi:type="separator" id="FogMonitorControls" />
<contribute xsi:type="command" id="ConfigureMonitorArea" commandId="com.raytheon.uf.viz.monitor.fog.ui.actions.fogAreaConfig"
menuText="Configure Fog Monitor Area">
menuText="Fog Monitor Table/Display" id="FOGMONITOR"
commandId="com.raytheon.uf.viz.monitor.fog.ui.actions.fogMonitor">
<substitute key="colormap" value="fog/fog" />
<substitute key="stations" value="${stations}" />
</contribute>
<contribute xsi:type="command" id="ConfigureMonitorAlgoThresh" commandId="com.raytheon.uf.viz.monitor.fog.ui.actions.fogAlgoConfig"
menuText="Configure Algorithim Thresholds">
<contribute xsi:type="separator" id="FogMonitorControls" />
<contribute xsi:type="command" id="ConfigureMonitorArea"
commandId="com.raytheon.uf.viz.monitor.fog.ui.actions.fogAreaConfig"
menuText="Configure Fog Monitor Area">
</contribute>
<contribute xsi:type="command" id="FogAlertVisThresholds" commandId="com.raytheon.uf.viz.monitor.fog.ui.actions.fogThresholdAlertVisConfig"
menuText="Configure Visibility Thresholds for AlertViz Monitoring">
<contribute xsi:type="command" id="ConfigureMonitorAlgoThresh"
commandId="com.raytheon.uf.viz.monitor.fog.ui.actions.fogAlgoConfig"
menuText="Configure Algorithim Thresholds">
</contribute>
<contribute xsi:type="command" id="FogAlertVisThresholds"
commandId="com.raytheon.uf.viz.monitor.fog.ui.actions.fogThresholdAlertVisConfig"
menuText="Configure Visibility Thresholds for AlertViz Monitoring">
</contribute>
</menuTemplate>

View file

@ -87,7 +87,10 @@ import com.vividsolutions.jts.geom.Geometry;
* Oct.31 2012 1297 skorolev Clean code
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Sep 23, 2014 3356 njensen Remove unnecessary import
* Oct 16, 2014 3220 skorolev Corrected fogConfig assignment.
*
*
* </pre>
*
@ -112,7 +115,7 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
private ObMultiHrsReports obData;
/** data holder for FOG **/
private ObsData obsData = null;
private ObsData obsData;
/** data holder for FOG ALG data **/
private SortedMap<Date, Map<String, FOG_THREAT>> algorithmData = null;
@ -126,10 +129,10 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
private FogZoneTableDlg zoneDialog;
/** zone table dialog **/
private MonitoringAreaConfigDlg areaDialog;
private MonitoringAreaConfigDlg areaDialog = null;
/** area config manager **/
private FSSObsMonitorConfigurationManager fogConfig;
private FSSObsMonitorConfigurationManager fogConfig = null;
/** table data for the station table **/
private final TableData stationTableData = new TableData(
@ -150,19 +153,21 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
/** Data URI pattern for fog **/
private final Pattern fogPattern = Pattern.compile(DataURI.SEPARATOR + OBS
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + cwa + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + "fog");
+ DataURI.SEPARATOR + wildCard);
/**
* Private constructor, singleton
*/
private FogMonitor() {
pluginPatterns.add(fogPattern);
fogConfig = new FSSObsMonitorConfigurationManager(currentSite,
MonName.fog.name());
readTableConfig(MonitorThresholdConfiguration.FOG_THRESHOLD_CONFIG);
fogConfig = FSSObsMonitorConfigurationManager.getFogObsManager();
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.FOG);
obData.setThresholdMgr(FogThresholdMgr.getInstance());
obData.getZoneTableData();
readTableConfig(MonitorThresholdConfiguration.FOG_THRESHOLD_CONFIG);
}
/**
@ -183,17 +188,15 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
return monitor;
}
// TODO: Provide the changes in EDEX URIFilters when area configuration file
// has been changed.
/**
* Re-initialization of monitor.
*
* DR#11279: When monitor area configuration is changed, this module is
* called to re-initialize monitor using new monitor area configuration
*/
public static void reInitialize() {
public void reInitialize() {
if (monitor != null) {
monitor = null;
monitor.nullifyMonitor();
monitor = new FogMonitor();
}
}
@ -312,7 +315,12 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
*/
@Override
public void configUpdate(IMonitorConfigurationEvent me) {
fireMonitorEvent(zoneDialog.getClass().getName());
fogConfig = (FSSObsMonitorConfigurationManager) me.getSource();
updateMonitoringArea();
if (zoneDialog != null && !zoneDialog.isDisposed()) {
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
}
/**
@ -320,6 +328,7 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
*/
@Override
public void nullifyMonitor() {
monitor.removeMonitorListener(zoneDialog);
ProductAlertObserver.removeObserver(OBS, this);
monitor = null;
}
@ -626,4 +635,20 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
return zoneDialog;
}
/**
* Reads Table Configuration.
*
* Method that reads the table configuration and updates the zone monitor
* threshold map
*
*/
private void updateMonitoringArea() {
Map<String, List<String>> zones = new HashMap<String, List<String>>();
// create zones and station list
for (String zone : fogConfig.getAreaList()) {
List<String> stations = fogConfig.getAreaStations(zone);
zones.put(zone, stations);
}
MonitoringArea.setPlatformMap(zones);
}
}

View file

@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.fog.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -41,6 +40,8 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.FogMonitor;
* Dec 15, 2009 #3963 lvenable Initial creation
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
* May 20, 2014 3086 skorolev Cleaned code.
* Sep 04, 2014 3220 skorolev Removed "site".
* Oct 16, 2014 3220 skorolev Corrected areaConfigMgr assignment.
*
* </pre>
*
@ -60,13 +61,12 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
super("DefaultFogDisplayThresholds.xml",
"DefaultFogMonitorThresholds.xml", AppName.FOG.name()
.toLowerCase());
areaConfigMgr = new FSSObsMonitorConfigurationManager(site,
MonName.fog.name());
areaConfigMgr = FSSObsMonitorConfigurationManager.getFogObsManager();
init();
}
/**
* Get an instance of the manager class.
* Gets an instance of the manager class.
*
* @return Class instance.
*/
@ -74,7 +74,6 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
if (classInstance == null) {
classInstance = new FogThresholdMgr();
}
return classInstance;
}
@ -117,20 +116,4 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
}
return threshKeys;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (areaConfigMgr == null) {
areaConfigMgr = new FSSObsMonitorConfigurationManager(site,
MonName.fog.name());
}
return areaConfigMgr;
}
}

View file

@ -40,6 +40,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Jul 14 2010 6567 zhao Launch AreaConfigDlg w/o monitor
* Nov.27, 2012 1297 skorolev Cleanup code for non-blocking dialog.
* May 08, 2014 3086 skorolev Added CloseCallback to dialog.
* Sep 16, 2014 2757 skorolev Added test of dialog on dispose.
* Sep 19, 2014 3220 skorolev Added check on dispose.
*
* </pre>
*
@ -63,18 +65,16 @@ public class FogAreaConfigAction extends AbstractHandler {
*/
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (areaDialog == null) {
if (areaDialog == null || areaDialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
areaDialog = new FogMonitoringAreaConfigDlg(shell,
"Fog Monitor Area Configuration");
areaDialog.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
areaDialog = null;
}
});
}
areaDialog.open();

View file

@ -39,6 +39,7 @@ import com.raytheon.uf.viz.monitor.fog.ui.dialogs.FogMonDispThreshDlg;
* ------------ ---------- ----------- --------------------------
* Dec 19 2009 3963 dhladky Initial creation.
* Dec 6 2012 #1351 skorolev Changes for non-blocking dialogs.
* Sep 19, 2014 3220 skorolev Added check on dispose.
*
* </pre>
*
@ -52,7 +53,7 @@ public class FogThresholdAlertVisConfigAction extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (fogMonitorDlg == null) {
if (fogMonitorDlg == null || fogMonitorDlg.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
fogMonitorDlg = new FogMonDispThreshDlg(shell,

View file

@ -48,6 +48,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------
* May 21, 2014 3086 skorolev Cleaned code.
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
*
* </pre>
*
@ -178,22 +179,23 @@ public class FogMonitorMeteoTab extends TabItemComp implements
ThresholdsXML threshXML = ftm.getThresholdsXmlData(duKey);
List<AreaXML> areasArray = threshXML.getAreas();
if (areasArray != null) {
for (AreaXML area : areasArray) {
String areaID = area.getAreaId();
FogMonitorMeteoData fmmd = new FogMonitorMeteoData();
fmmd.setAreaID(areaID);
for (AreaXML area : areasArray) {
String areaID = area.getAreaId();
FogMonitorMeteoData fmmd = new FogMonitorMeteoData();
fmmd.setAreaID(areaID);
/*
* Visibility
*/
String xmlKey = FogMonitor.FOG_MONITOR_METEO_VIS.getXmlKey();
fmmd.setMeteoVisR(ftm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
fmmd.setMeteoVisY(ftm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Visibility
*/
String xmlKey = FogMonitor.FOG_MONITOR_METEO_VIS.getXmlKey();
fmmd.setMeteoVisR(ftm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
fmmd.setMeteoVisY(ftm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
fogDataArray.add(fmmd);
fogDataArray.add(fmmd);
}
}
}

View file

@ -20,16 +20,18 @@
package com.raytheon.uf.viz.monitor.fog.ui.dialogs;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
import com.raytheon.uf.viz.monitor.fog.FogMonitor;
import com.raytheon.uf.viz.monitor.fog.threshold.FogThresholdMgr;
import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
/**
* Fog Monitor area configuration dialog.
@ -44,7 +46,10 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
* Jan 29, 2014 2757 skorolev Changed OK button handler.
* Apr 23, 2014 3054 skorolev Fixed issue with removing a new station from list.
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
* Sep 15, 2014 2757 skorolev Removed extra dialog.
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
*
*
* </pre>
*
@ -54,17 +59,17 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
/** Configuration manager for Fog monitor. */
private static FSSObsMonitorConfigurationManager fogConfigMgr;
private FogMonDispThreshDlg fogMonitorDlg;
/**
* Constructor
* Constructor.
*
* @param parent
* @param title
*/
public FogMonitoringAreaConfigDlg(Shell parent, String title) {
super(parent, title, AppName.FOG);
FogMonitor.getInstance();
}
/*
@ -75,7 +80,6 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
@Override
protected void handleOkBtnSelection() {
// Check for changes in the data
if (dataIsChanged()) {
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
"Fog Monitor Confirm Changes",
@ -84,27 +88,57 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
// Save the configuration xml file
getValues();
resetStatus();
fogConfigMgr.saveConfigXml();
configMgr.saveConfigXml();
configMgr.saveAdjacentAreaConfigXml();
/**
* DR#11279: re-initialize threshold manager and the monitor
* using new monitor area configuration
*/
FogThresholdMgr.reInitialize();
FogMonitor.reInitialize();
if ((!fogConfigMgr.getAddedZones().isEmpty())
|| (!fogConfigMgr.getAddedStations().isEmpty())) {
fireConfigUpdateEvent();
if ((!configMgr.getAddedZones().isEmpty())
|| (!configMgr.getAddedStations().isEmpty())) {
if (editDialog() == SWT.YES) {
FogMonDispThreshDlg fogMonitorDlg = new FogMonDispThreshDlg(
shell, CommonConfig.AppName.FOG,
DataUsageKey.MONITOR);
fogMonitorDlg = new FogMonDispThreshDlg(shell,
CommonConfig.AppName.FOG, DataUsageKey.MONITOR);
fogMonitorDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
// Clean added zones and stations. Close dialog.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
setReturnValue(true);
close();
}
});
fogMonitorDlg.open();
}
fogConfigMgr.getAddedZones().clear();
fogConfigMgr.getAddedStations().clear();
// Clean added zones and stations.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
}
}
}
}
if ((fogMonitorDlg == null) || fogMonitorDlg.isDisposed()) {
setReturnValue(true);
close();
}
}
/**
* Fire Table reload event.
*/
private void fireConfigUpdateEvent() {
final IMonitorConfigurationEvent me = new IMonitorConfigurationEvent(
configMgr);
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
FogMonitor.getInstance().configUpdate(me);
}
});
}
/*
@ -114,12 +148,9 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
* com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#getInstance
* ()
*/
@Override
protected FSSObsMonitorConfigurationManager getInstance() {
if (fogConfigMgr == null) {
fogConfigMgr = new FSSObsMonitorConfigurationManager(currentSite,
MonName.fog.name());
}
return (FSSObsMonitorConfigurationManager) fogConfigMgr;
return FSSObsMonitorConfigurationManager.getFogObsManager();
}
/*
@ -130,6 +161,7 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
@Override
protected void disposed() {
fogConfigMgr = null;
configMgr = null;
}
}

View file

@ -28,7 +28,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.monitor.data.ObConst.DisplayVarName;
@ -59,6 +58,8 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
* Dec 03, 2012 15216/15639 zhao fixed a bug related to Link-to-Frame
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs.
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
*
* </pre>
*
@ -78,6 +79,7 @@ public class FogZoneTableDlg extends ZoneTableDlg {
*/
public FogZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
super(parent, obData, CommonConfig.AppName.FOG);
configMgr = FSSObsMonitorConfigurationManager.getFogObsManager();
}
/**
@ -114,7 +116,7 @@ public class FogZoneTableDlg extends ZoneTableDlg {
*/
@Override
protected void configThreshAction() {
if (fogThreshDlg == null) {
if (fogThreshDlg == null || fogThreshDlg.isDisposed()) {
fogThreshDlg = new FogMonDispThreshDlg(getParent().getShell(),
CommonConfig.AppName.FOG, DataUsageKey.DISPLAY);
}
@ -293,13 +295,4 @@ public class FogZoneTableDlg extends ZoneTableDlg {
protected void shellDisposeAction() {
// Not used
}
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(site,
MonName.fog.name());
}
return configMgr;
}
}

View file

@ -20,61 +20,84 @@
-->
<bundle>
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<displays xsi:type="d2DMapRenderableDisplay"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<loadProperties loadWithoutData="false">
<capabilities>
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1"/>
<capability xsi:type="colorableCapability" colorAsString="#9b9b9b"/>
<capability xsi:type="outlineCapability"
lineStyle="SOLID" outlineOn="true"
outlineWidth="1" />
<capability xsi:type="colorableCapability"
colorAsString="#9b9b9b" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="true" isHoverOn="false"
isVisible="true">
<pdProps maxDisplayWidth="100000000"
minDisplayWidth="0" />
</properties>
<resourceData xsi:type="spiResourceData" pixelSizeHint="45">
<resourceData xsi:type="spiResourceData"
pixelSizeHint="45">
<filename>basemaps/MTR.spi</filename>
<mapName>METAR Station Locations</mapName>
</resourceData>
</resource>
<resource>
<loadProperties>
<capabilities>
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1" />
<capability xsi:type="colorableCapability" colorAsString="#9b9b9b" />
<capability xsi:type="labelableCapability" labelField="id" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false"
isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0" />
</properties>
<resourceData xsi:type="dbMapResourceData">
<table>mapdata.marinezones</table>
<mapName>Coastal Marine Zones</mapName>
</resourceData>
</resource>
<resource>
<loadProperties loadWithoutData="false">
<resourceType>PLAN_VIEW</resourceType>
<capabilities>
<capability xsi:type="colorableCapability" colorAsString="#9b9b9b"/>
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1"/>
<capability xsi:type="magnificationCapability" magnification="1.0"/>
<capability xsi:type="densityCapability" density="1.0"/>
<capability xsi:type="pointCapability" pointStyle="CROSS"/>
</capabilities>
</loadProperties>
<properties renderingOrderId="PLOT" isSystemResource="false" isBlinking="false" isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
</properties>
<resourceData xsi:type="spiResourceData">
<filename>basemaps/BUOY.spi</filename>
<mapName>Fixed Buoy Locations</mapName>
</resourceData>
</resource>
<resource>
<loadProperties>
<capabilities>
<capability xsi:type="outlineCapability"
lineStyle="SOLID" outlineOn="true"
outlineWidth="1" />
<capability xsi:type="colorableCapability"
colorAsString="#9b9b9b" />
<capability xsi:type="labelableCapability"
labelField="id" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="true" isHoverOn="false"
isVisible="true">
<pdProps maxDisplayWidth="100000000"
minDisplayWidth="0" />
</properties>
<resourceData xsi:type="dbMapResourceData">
<table>mapdata.marinezones</table>
<mapName>Coastal Marine Zones</mapName>
</resourceData>
</resource>
<resource>
<loadProperties loadWithoutData="false">
<resourceType>PLAN_VIEW</resourceType>
<capabilities>
<capability xsi:type="colorableCapability"
colorAsString="#9b9b9b" />
<capability xsi:type="outlineCapability"
lineStyle="SOLID" outlineOn="true"
outlineWidth="1" />
<capability xsi:type="magnificationCapability"
magnification="1.0" />
<capability xsi:type="densityCapability"
density="1.0" />
<capability xsi:type="pointCapability"
pointStyle="CROSS" />
</capabilities>
</loadProperties>
<properties renderingOrderId="PLOT"
isSystemResource="false" isBlinking="false"
isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000"
minDisplayWidth="0" />
</properties>
<resourceData xsi:type="spiResourceData">
<filename>basemaps/BUOY.spi</filename>
<mapName>Fixed Buoy Locations</mapName>
</resourceData>
</resource>
<!-- ********************METARS******************** -->
<resource>
<loadProperties loadWithoutData="true">
@ -82,27 +105,34 @@
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotMissingData="false" plotSource="METARS in SAFESEAS Mon.Area "
plotModelFile="fssMetar.svg" spiFile="basemaps/MTR.spi"
retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotMissingData="false" plotSource="METARS in SAFESEAS Mon.Area "
plotModelFile="fssMetar.svg" spiFile="basemaps/MTR.spi"
retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="reportType">
<constraint constraintValue="METAR, SPECI" constraintType="IN"/>
<constraint constraintValue="METAR, SPECI"
constraintType="IN" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="ss" constraintType="EQUALS"/>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
<binOffset virtualOffset="0" posOffset="1800" negOffset="1800"/>
<alertParser xsi:type="plotAlertParser"/>
<binOffset virtualOffset="0"
posOffset="1800" negOffset="1800" />
<alertParser xsi:type="plotAlertParser" />
</resourceData>
</resource>
<!-- *********************Fixed Buoys******************* -->
@ -112,79 +142,105 @@
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotMissingData="false" plotSource="Fixed Buoys in SAFESEAS Mon.Area"
plotModelFile="fssMaritime.svg" retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotMissingData="false"
plotSource="Fixed Buoys in SAFESEAS Mon.Area"
plotModelFile="fssMaritime.svg" retrieveData="false"
isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="reportType">
<constraint constraintValue="1004,1005" constraintType="IN" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="ss" constraintType="EQUALS"/>
<mapping key="reportType">
<constraint constraintValue="1004,1005"
constraintType="IN" />
</mapping>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
<binOffset virtualOffset="0" posOffset="1800" negOffset="1800"/>
<alertParser xsi:type="plotAlertParser"/>
<binOffset virtualOffset="0"
posOffset="1800" negOffset="1800" />
<alertParser xsi:type="plotAlertParser" />
</resourceData>
</resource>
<!-- *****************Moving Buoys/Ships************** -->
<resource>
<loadProperties loadWithoutData="true">
<capabilities>
<loadProperties loadWithoutData="true">
<capabilities>
</capabilities>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true" />
<resourceData xsi:type="plotResourceData" plotMissingData="false" plotSource="Moving Buoys/Ships in SAFESEAS Mon.Area"
plotModelFile="fssMaritime.svg" isUpdatingOnMetadataOnly="true" retrieveData="false"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<binOffset posOffset="1800" negOffset="1800" virtualOffset="0"/>
<metadataMap>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS" />
</mapping>
<mapping key="reportType">
<constraint constraintValue="1006,1003" constraintType="IN" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="ss" constraintType="EQUALS"/>
</loadProperties>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotMissingData="false"
plotSource="Moving Buoys/Ships in SAFESEAS Mon.Area"
plotModelFile="fssMaritime.svg"
isUpdatingOnMetadataOnly="true" retrieveData="false"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<binOffset posOffset="1800" negOffset="1800"
virtualOffset="0" />
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
</metadataMap>
<alertParser xsi:type="plotAlertParser"/>
</resourceData>
</resource>
<mapping key="reportType">
<constraint constraintValue="1006,1003"
constraintType="IN" />
</mapping>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
<alertParser xsi:type="plotAlertParser" />
</resourceData>
</resource>
<!-- **************************Mesowest************************************ -->
<resource>
<loadProperties loadWithoutData="false">
<capabilities/>
<capabilities />
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotMissingData="false" plotSource="LDAD MESONET in SAFESEAS Mon.Area"
plotModelFile="fssMetar.svg" retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotMissingData="false"
plotSource="LDAD MESONET in SAFESEAS Mon.Area"
plotModelFile="fssMetar.svg" retrieveData="false"
isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="reportType">
<constraint constraintValue="mesonet" constraintType="EQUALS" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="ss" constraintType="EQUALS"/>
<constraint constraintValue="mesonet"
constraintType="EQUALS" />
</mapping>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
</resourceData>
</resource>
@ -192,30 +248,39 @@
<resource>
<loadProperties loadWithoutData="true">
<capabilities>
<capability xsi:type="colorableCapability" colorAsString="#ffff00"/>
<capability xsi:type="colorableCapability"
colorAsString="#ffff00" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotMissingData="false" plotSource="MAROBs in SAFESEAS Mon.Area"
plotModelFile="fssMaritime.svg" retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotMissingData="false" plotSource="MAROBs in SAFESEAS Mon.Area"
plotModelFile="fssMaritime.svg" retrieveData="false"
isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
</mapping>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="reportType">
<constraint constraintValue="1007" constraintType="EQUALS"/>
<constraint constraintValue="1007"
constraintType="EQUALS" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="ss" constraintType="EQUALS"/>
</mapping>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
<binOffset virtualOffset="0" posOffset="1800" negOffset="1800"/>
<alertParser xsi:type="plotAlertParser"/>
<binOffset virtualOffset="0"
posOffset="1800" negOffset="1800" />
<alertParser xsi:type="plotAlertParser" />
</resourceData>
</resource>
<!-- **************************************** -->
@ -225,21 +290,24 @@
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="safeSeasResourceData" plotSource="Safe Seas Table Display"
retrieveData="true" isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true">
<metadataMap>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS" />
</mapping>
<mapping key="pluginName">
<constraint constraintValue="fog" constraintType="EQUALS" />
</mapping>
</metadataMap>
</resourceData>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="safeSeasResourceData"
plotSource="Safe Seas Table Display"
retrieveData="true" isUpdatingOnMetadataOnly="false"
isRequeryNecessaryOnTimeMatch="true">
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="fog"
constraintType="EQUALS" />
</mapping>
</metadataMap>
</resourceData>
</resource>
<timeMatcher xsi:type="d2DTimeMatcher" deltaFilter="0" forecastFilter="0"/>
<timeMatcher xsi:type="d2DTimeMatcher"
deltaFilter="0" forecastFilter="0" />
<numberOfFrames>12</numberOfFrames>
</descriptor>
</displays>

View file

@ -19,16 +19,20 @@
further_licensing_information.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/safeseas/safeseasImageTable.xml" id="SAFESEASMONITOR" commandId="com.raytheon.uf.viz.monitor.safeseas.ui.actions.safeseas"
menuText="SAFESEAS Table/Display">
<substitute key="cwa" value="${cwa}" />
<contribute xsi:type="bundleItem"
file="bundles/safeseas/safeseasImageTable.xml" id="SAFESEASMONITOR"
commandId="com.raytheon.uf.viz.monitor.safeseas.ui.actions.safeseas"
menuText="SAFESEAS Table/Display">
<substitute key="stations" value="${stations}" />
</contribute>
<contribute xsi:type="separator" id="SAFESeasMonitorControls" />
<contribute xsi:type="command" id="ConfigureMonitorArea" commandId="com.raytheon.uf.viz.monitor.safeseas.ui.actions.safeseasAreaConfig"
menuText="Configure SAFESEAS Monitor Area">
<contribute xsi:type="command" id="ConfigureMonitorArea"
commandId="com.raytheon.uf.viz.monitor.safeseas.ui.actions.safeseasAreaConfig"
menuText="Configure SAFESEAS Monitor Area">
</contribute>
<contribute xsi:type="command" id="SafeSeasAlertVisThresholds" commandId="com.raytheon.uf.viz.monitor.safeseas.ui.actions.safeseasThresholdAlertVisConfig"
menuText="Configure SAFESEAS Thresholds for AlertViz Monitoring">
<contribute xsi:type="command" id="SafeSeasAlertVisThresholds"
commandId="com.raytheon.uf.viz.monitor.safeseas.ui.actions.safeseasThresholdAlertVisConfig"
menuText="Configure SAFESEAS Thresholds for AlertViz Monitoring">
</contribute>
</menuTemplate>

View file

@ -37,7 +37,6 @@ import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
import com.raytheon.uf.common.geospatial.SpatialException;
import com.raytheon.uf.common.monitor.MonitorAreaUtils;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.AdjacentWfoMgr;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -86,6 +85,8 @@ import com.vividsolutions.jts.geom.Geometry;
* Oct 30, 2012 1297 skorolev Changed HashMap to Map
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Oct 16, 2014 3220 skorolev Corrected ssAreaConfig assignment.
*
* </pre>
*
@ -109,7 +110,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
private SSMonitoringAreaConfigDlg areaDialog = null;
/** configuration manager **/
private FSSObsMonitorConfigurationManager safeseasConfig;
private FSSObsMonitorConfigurationManager ssAreaConfig = null;
/**
* This object contains all observation data necessary for the table dialogs
@ -152,19 +153,22 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
/** Pattern for SAFESEAS **/
private final Pattern ssPattern = Pattern.compile(DataURI.SEPARATOR + OBS
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + cwa + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + "ss");
+ DataURI.SEPARATOR + wildCard);
/**
* Private constructor, singleton
*/
private SafeSeasMonitor() {
pluginPatterns.add(ssPattern);
safeseasConfig = new FSSObsMonitorConfigurationManager(currentSite,
MonName.ss.name());
readTableConfig(MonitorThresholdConfiguration.SAFESEAS_THRESHOLD_CONFIG);
ssAreaConfig = FSSObsMonitorConfigurationManager.getSsObsManager();
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SAFESEAS);
obData.setThresholdMgr(SSThresholdMgr.getInstance());
obData.getZoneTableData();
readTableConfig(MonitorThresholdConfiguration.SAFESEAS_THRESHOLD_CONFIG);
}
/**
@ -182,17 +186,15 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
return monitor;
}
// TODO: Provide the changes in EDEX URIFilters when area configuration file
// has been changed.
/**
* Re-initialization of monitor.
*
* DR#11279: When monitor area configuration is changed, this module is
* called to re-initialize monitor using new monitor area configuration
*/
public static void reInitialize() {
public void reInitialize() {
if (monitor != null) {
monitor = null;
monitor.nullifyMonitor();
monitor = new SafeSeasMonitor();
}
}
@ -308,8 +310,8 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
Map<String, List<String>> zones = new HashMap<String, List<String>>();
// create zones and station list
try {
for (String zone : safeseasConfig.getAreaList()) {
List<String> stations = safeseasConfig.getAreaStations(zone);
for (String zone : ssAreaConfig.getAreaList()) {
List<String> stations = ssAreaConfig.getAreaStations(zone);
zones.put(zone, stations);
}
} catch (Exception e) {
@ -352,7 +354,12 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
*/
@Override
public void configUpdate(IMonitorConfigurationEvent me) {
// Not used
ssAreaConfig = (FSSObsMonitorConfigurationManager) me.getSource();
updateMonitoringArea();
if (zoneDialog != null && !zoneDialog.isDisposed()) {
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
}
/**
@ -494,7 +501,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
*/
public Map<String, Geometry> getMonitoringAreaGeometries() {
if (zoneGeometries == null) {
List<String> zones = safeseasConfig.getAreaList();
List<String> zones = ssAreaConfig.getAreaList();
zoneGeometries = new HashMap<String, Geometry>();
for (String zone : zones) {
try {
@ -662,4 +669,20 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
return zoneDialog;
}
/**
* Reads Table Configuration.
*
* Method that reads the table configuration and updates the zone monitor
* threshold map
*
*/
public void updateMonitoringArea() {
Map<String, List<String>> zones = new HashMap<String, List<String>>();
// create zones and station list
for (String zone : ssAreaConfig.getAreaList()) {
List<String> stations = ssAreaConfig.getAreaStations(zone);
zones.put(zone, stations);
}
MonitoringArea.setPlatformMap(zones);
}
}

View file

@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.safeseas.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -40,7 +39,9 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
* ------------ ---------- ----------- --------------------------
* Dec 27, 2009 #3963 lvenable Initial creation
* Feb 03, 2014 #2757 skorolev Fixed reInitialize().
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Removed "site".
* Oct 16, 2014 3220 skorolev Corrected areaConfigMgr assignment.
*
* </pre>
*
@ -58,8 +59,7 @@ public class SSThresholdMgr extends AbstractThresholdMgr {
super("DefaultSSDisplayThresholds.xml",
"DefaultSSMonitorThresholds.xml", AppName.SAFESEAS.name()
.toLowerCase());
areaConfigMgr = new FSSObsMonitorConfigurationManager(site,
MonName.ss.name());
areaConfigMgr = FSSObsMonitorConfigurationManager.getSsObsManager();
init();
}
@ -113,19 +113,4 @@ public class SSThresholdMgr extends AbstractThresholdMgr {
}
return threshKeys;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (areaConfigMgr == null) {
areaConfigMgr = new FSSObsMonitorConfigurationManager(site,
MonName.ss.name());
}
return areaConfigMgr;
}
}

View file

@ -40,6 +40,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* March 5, 2012 14413 zhao Launch AreaConfigDlg w/o monitor
* Nov.27, 2012 1297 skorolev Cleanup code for non-blocking dialog.
* May 08, 2014 3086 skorolev Added CloseCallback to dialog.
* Sep 16, 2014 2757 skorolev Added test of dialog on dispose.
* Sep 19, 2014 3220 skorolev Added check on dispose.
*
* </pre>
*
@ -63,18 +65,16 @@ public class SafeseasAreaConfigAction extends AbstractHandler {
*/
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (configDlg == null) {
if (configDlg == null || configDlg.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
configDlg = new SSMonitoringAreaConfigDlg(shell,
"SAFESEAS Monitor Area Configuration");
configDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
configDlg = null;
}
});
}
configDlg.open();

View file

@ -39,6 +39,7 @@ import com.raytheon.uf.viz.monitor.safeseas.ui.dialogs.SSDispMonThreshDlg;
* ------------ ---------- ----------- --------------------------
* Dec 19 2009 3963 dhladky Initial creation.
* Dec 6 2012 #1351 skorolev Changes for non-blocking dialogs.
* Sep 19, 2014 3220 skorolev Added check on dispose.
*
* </pre>
*
@ -52,7 +53,7 @@ public class SafeseasThresholdAlertVisConfigAction extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (ssMonitorDlg == null) {
if (ssMonitorDlg == null || ssMonitorDlg.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
ssMonitorDlg = new SSDispMonThreshDlg(shell,

View file

@ -37,296 +37,313 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
import com.raytheon.uf.viz.monitor.xml.AreaXML;
import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMeteo
{
/**
* SAFESEAS Monitor Meteo Table.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 17, 2014 2757 skorolev Removed unnecessary printouts.
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
*
* </pre>
*
* @author skorolev
* @version 1.0
*/
public class SSMonitorMeteoTab extends TabItemComp implements
IUpdateMonitorMeteo {
private SSMonitorMeteoEditDlg monitorMeteoEditDlg;
private ArrayList<String> areaIDArray;
private ArrayList<SSMonitorMeteoData> ssDataArray;
public SSMonitorMeteoTab(TabFolder parent, DataUsageKey duKey)
{
public SSMonitorMeteoTab(TabFolder parent, DataUsageKey duKey) {
super(parent, duKey);
}
@Override
protected void createListHeader(Composite parentComp)
{
@Override
protected void createListHeader(Composite parentComp) {
Composite lblComp = new Composite(parentComp, SWT.NONE);
GridLayout gl = new GridLayout(5, false);
gl.horizontalSpacing = 0;
gl.horizontalSpacing = 0;
gl.marginHeight = 0;
gl.marginWidth = 0;
lblComp.setLayout(gl);
/*
* Create filler label.
*/
GridData gd = new GridData(75, SWT.DEFAULT);
Label fillerLbl = new Label(lblComp, SWT.CENTER);
fillerLbl.setLayoutData(gd);
/*
* Meteo
*/
Composite meteoComp = createGroupComposite(lblComp, 5, null);
createLabelComp(meteoComp, "Wind", "Speed(kt)", false);
createLabelComp(meteoComp, "Peak", "Wind(kt)", false);
Composite meteoComp = createGroupComposite(lblComp, 5, null);
createLabelComp(meteoComp, "Wind", "Speed(kt)", false);
createLabelComp(meteoComp, "Peak", "Wind(kt)", false);
createLabelComp(meteoComp, "Gust", "Speed(kt)", false);
createLabelComp(meteoComp, "Wave", "Height(ft)", false);
createLabelComp(meteoComp, "Vis(mi)", "", true);
}
}
@Override
protected void populateList()
{
if (ssDataArray == null)
{
protected void populateList() {
if (ssDataArray == null) {
createDataArray();
}
boolean update = false;
if (dataList.getItemCount() > 0)
{
if (dataList.getItemCount() > 0) {
update = true;
}
RangesUtil rangeUtil = RangesUtil.getInstance();
areaIDArray = new ArrayList<String>();
String tmpVisStr;
String currentAreaID;
double visVal = 0.0;
StringBuilder sb = null;
StringBuilder sb = null;
SSMonitorMeteoData ssmmd = null;
for (int i = 0; i < ssDataArray.size(); i++)
{
for (int i = 0; i < ssDataArray.size(); i++) {
sb = new StringBuilder();
ssmmd = ssDataArray.get(i);
currentAreaID = ssmmd.getAreaID();
areaIDArray.add(currentAreaID);
sb.append(String.format(areaIdFmt, currentAreaID));
/*
* Wind Speed
*/
appendIntData(sb, ssmmd.getWindSpeedR(), ssmmd.getWindSpeedY());
/*
* Peak Wind
*/
appendIntData(sb, ssmmd.getPeakWindR(), ssmmd.getPeakWindY());
/*
* Gust Wind
*/
appendIntData(sb, ssmmd.getGustSpeedR(), ssmmd.getGustSpeedY());
/*
* Wave Height
*/
appendIntData(sb, ssmmd.getWaveHgtR(), ssmmd.getWaveHgtY());
/*
* Visibility
*/
visVal = ssmmd.getVisR();
tmpVisStr = rangeUtil.getVisString((int)visVal);
*/
visVal = ssmmd.getVisR();
tmpVisStr = rangeUtil.getVisString((int) visVal);
sb.append(String.format(dataFmt, tmpVisStr));
visVal = ssmmd.getVisY();
tmpVisStr = rangeUtil.getVisString((int)visVal);
sb.append(String.format(dataFmt, tmpVisStr));
visVal = ssmmd.getVisY();
tmpVisStr = rangeUtil.getVisString((int) visVal);
sb.append(String.format(dataFmt, tmpVisStr));
/*
* Append a space and add the data line to the list.
*/
sb.append(" ");
if (update == true)
{
if (update == true) {
dataList.setItem(i, sb.toString());
}
else
{
} else {
dataList.add(sb.toString());
}
}
}
packListControls();
}
private void createDataArray()
{
ssDataArray = new ArrayList<SSMonitorMeteoData>();
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
ArrayList<AreaXML> areasArray = threshXML.getAreas();
for (AreaXML area : areasArray)
{
areaID = area.getAreaId();
SSMonitorMeteoData ssmmd = new SSMonitorMeteoData();
ssmmd.setAreaID(areaID);
/*
* Wind Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey();
ssmmd.setWindSpeedR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setWindSpeedY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
System.out.println("=== " + sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
System.out.println("=== " + sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Peak Wind
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey();
ssmmd.setPeakWindR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setPeakWindY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Gust Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey();
ssmmd.setGustSpeedR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setGustSpeedY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Wave Height
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey();
ssmmd.setWaveHgtR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setWaveHgtY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Visibility
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey();
ssmmd.setVisR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setVisY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Add data to array.
*/
ssDataArray.add(ssmmd);
}
}
private SSMonitorMeteoData getDataAtFirstSelection()
{
int index = dataList.getSelectionIndex();
return ssDataArray.get(index);
}
private void updateDataArray(SSMonitorMeteoData ssmmd)
{
int[] dataListIndexes = dataList.getSelectionIndices();
int currentIndex = 0;
for (int i = 0; i < dataListIndexes.length; i++)
{
currentIndex = dataListIndexes[i];
ssDataArray.get(currentIndex).updateData(ssmmd);
}
}
@Override
public void commitDataToXML()
{
private void createDataArray() {
ssDataArray = new ArrayList<SSMonitorMeteoData>();
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
for (SSMonitorMeteoData ssmmd : ssDataArray)
{
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
ArrayList<AreaXML> areasArray = threshXML.getAreas();
if (areasArray != null) {
for (AreaXML area : areasArray) {
areaID = area.getAreaId();
SSMonitorMeteoData ssmmd = new SSMonitorMeteoData();
ssmmd.setAreaID(areaID);
/*
* Wind Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey();
ssmmd.setWindSpeedR(sstm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
ssmmd.setWindSpeedY(sstm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Peak Wind
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey();
ssmmd.setPeakWindR(sstm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
ssmmd.setPeakWindY(sstm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Gust Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey();
ssmmd.setGustSpeedR(sstm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
ssmmd.setGustSpeedY(sstm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Wave Height
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey();
ssmmd.setWaveHgtR(sstm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
ssmmd.setWaveHgtY(sstm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Visibility
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey();
ssmmd.setVisR(sstm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
ssmmd.setVisY(sstm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/*
* Add data to array.
*/
ssDataArray.add(ssmmd);
}
} else {
}
}
private SSMonitorMeteoData getDataAtFirstSelection() {
int index = dataList.getSelectionIndex();
return ssDataArray.get(index);
}
private void updateDataArray(SSMonitorMeteoData ssmmd) {
int[] dataListIndexes = dataList.getSelectionIndices();
int currentIndex = 0;
for (int i = 0; i < dataListIndexes.length; i++) {
currentIndex = dataListIndexes[i];
ssDataArray.get(currentIndex).updateData(ssmmd);
}
}
@Override
public void commitDataToXML() {
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
for (SSMonitorMeteoData ssmmd : ssDataArray) {
areaID = ssmmd.getAreaID();
/*
* Wind Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getWindSpeedR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getWindSpeedY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getWindSpeedR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getWindSpeedY());
/*
* Peak Wind
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getPeakWindR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getPeakWindY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getPeakWindR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getPeakWindY());
/*
* Gust Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getGustSpeedR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getGustSpeedY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getGustSpeedR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getGustSpeedY());
/*
* Wave Height
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getWaveHgtR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getWaveHgtY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getWaveHgtR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getWaveHgtY());
/*
* Visibility
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getVisR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getVisY());
}
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getVisR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getVisY());
}
}
@Override
public void reloadData()
{
public void reloadData() {
dataList.removeAll();
ssDataArray.clear();
ssDataArray = null;
populateList();
populateList();
}
@Override
protected void editDataAction()
{
protected void editDataAction() {
SSMonitorMeteoData ssmmd = getDataAtFirstSelection();
if (monitorMeteoEditDlg == null)
{
monitorMeteoEditDlg = new SSMonitorMeteoEditDlg(getParent().getShell(), ssmmd, this);
if (monitorMeteoEditDlg == null) {
monitorMeteoEditDlg = new SSMonitorMeteoEditDlg(getParent()
.getShell(), ssmmd, this);
monitorMeteoEditDlg.open();
monitorMeteoEditDlg = null;
}
}
@Override
public void updateThresholdData(SSMonitorMeteoData ssmmd)
{
public void updateThresholdData(SSMonitorMeteoData ssmmd) {
updateDataArray(ssmmd);
populateList();
populateList();
}
}

View file

@ -36,312 +36,404 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
import com.raytheon.uf.viz.monitor.xml.AreaXML;
import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMonitorSwell
{
/**
* SAFESEAS Monitor Swell Table.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
*
* </pre>
*
* @author
* @version 1.0
*/
public class SSMonitorSwellTab extends TabItemComp implements
IUpdateDisplayMonitorSwell {
private SSDispMonSwellEditDlg monitorSwellEditDlg;
private ArrayList<String> areaIDArray;
private ArrayList<SSDispMonSwellData> ssDataArray;
public SSMonitorSwellTab(TabFolder parent, DataUsageKey duKey)
{
public SSMonitorSwellTab(TabFolder parent, DataUsageKey duKey) {
super(parent, duKey, true);
}
@Override
protected void createListHeader(Composite parentComp)
{
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#createListHeader(org
* .eclipse.swt.widgets.Composite)
*/
@Override
protected void createListHeader(Composite parentComp) {
Composite lblComp = new Composite(parentComp, SWT.NONE);
GridLayout gl = new GridLayout(5, false);
gl.horizontalSpacing = 0;
gl.horizontalSpacing = 0;
gl.marginHeight = 0;
gl.marginWidth = 0;
lblComp.setLayout(gl);
/*
* Create filler label.
*/
GridData gd = new GridData(75, SWT.DEFAULT);
Label fillerLbl = new Label(lblComp, SWT.CENTER);
fillerLbl.setLayoutData(gd);
/*
* Primary Swell
*/
Composite priSwellComp = createGroupComposite(lblComp, 4, "Primary Swell");
Composite priSwellComp = createGroupComposite(lblComp, 4,
"Primary Swell");
createLabelComp(priSwellComp, "Height(ft)", "", false);
createLabelComp(priSwellComp, "Periods(s)", "", false);
createLabelComp(priSwellComp, "Dir(deg)", "(from)", false);
createLabelComp(priSwellComp, "Dir(deg)", "(to)", false);
createLabelComp(priSwellComp, "Dir(deg)", "(to)", false);
/*
* Secondary Swell
*/
Composite secSwellComp = createGroupComposite(lblComp, 4, "Secondary Swell");
Composite secSwellComp = createGroupComposite(lblComp, 4,
"Secondary Swell");
createLabelComp(secSwellComp, "Height(ft)", "", false);
createLabelComp(secSwellComp, "Periods(s)", "", false);
createLabelComp(secSwellComp, "Dir(deg)", "(from)", false);
createLabelComp(secSwellComp, "Dir(deg)", "(to)", false);
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#populateList()
*/
@Override
protected void populateList()
{
if (ssDataArray == null)
{
protected void populateList() {
if (ssDataArray == null) {
createDataArray();
}
boolean update = false;
if (dataList.getItemCount() > 0)
{
if (dataList.getItemCount() > 0) {
update = true;
}
areaIDArray = new ArrayList<String>();
String currentAreaID;
StringBuilder sb = null;
StringBuilder sb = null;
SSDispMonSwellData sssd = null;
for (int i = 0; i < ssDataArray.size(); i++)
{
for (int i = 0; i < ssDataArray.size(); i++) {
sb = new StringBuilder();
sssd = ssDataArray.get(i);
currentAreaID = sssd.getAreaID();
areaIDArray.add(currentAreaID);
sb.append(String.format(areaIdFmt, currentAreaID));
sb.append(String.format(areaIdFmt, currentAreaID));
/*
* Primary Swell
*/
appendIntData(sb, sssd.getPriSwellHeightR(), sssd.getPriSwellHeightY());
double higherThreshold = Math.max(sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
double lowerThreshold = Math.min(sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
if ( rankSwellPeriodHigh ) {
sssd.setRankSwellPeriodHigh(true);
sssd.setPriSwellPeriodR(higherThreshold);
sssd.setPriSwellPeriodY(lowerThreshold);
appendIntData(sb, sssd.getPriSwellHeightR(),
sssd.getPriSwellHeightY());
double higherThreshold = Math.max(sssd.getPriSwellPeriodR(),
sssd.getPriSwellPeriodY());
double lowerThreshold = Math.min(sssd.getPriSwellPeriodR(),
sssd.getPriSwellPeriodY());
if (rankSwellPeriodHigh) {
sssd.setRankSwellPeriodHigh(true);
sssd.setPriSwellPeriodR(higherThreshold);
sssd.setPriSwellPeriodY(lowerThreshold);
} else {
sssd.setRankSwellPeriodHigh(false);
sssd.setPriSwellPeriodR(lowerThreshold);
sssd.setPriSwellPeriodY(higherThreshold);
sssd.setRankSwellPeriodHigh(false);
sssd.setPriSwellPeriodR(lowerThreshold);
sssd.setPriSwellPeriodY(higherThreshold);
}
appendIntData(sb, sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
appendIntData(sb, sssd.getPriSwellDirFromR(), sssd.getPriSwellDirFromY());
appendIntData(sb, sssd.getPriSwellDirToR(), sssd.getPriSwellDirToY());
appendIntData(sb, sssd.getPriSwellPeriodR(),
sssd.getPriSwellPeriodY());
appendIntData(sb, sssd.getPriSwellDirFromR(),
sssd.getPriSwellDirFromY());
appendIntData(sb, sssd.getPriSwellDirToR(),
sssd.getPriSwellDirToY());
/*
* Secondary Swell
*/
appendIntData(sb, sssd.getSecSwellHeightR(), sssd.getSecSwellHeightY());
higherThreshold = Math.max(sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
lowerThreshold = Math.min(sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
if ( rankSwellPeriodHigh ) {
//sssd.setRankSwellPeriodHigh(true);
sssd.setSecSwellPeriodR(higherThreshold);
sssd.setSecSwellPeriodY(lowerThreshold);
appendIntData(sb, sssd.getSecSwellHeightR(),
sssd.getSecSwellHeightY());
higherThreshold = Math.max(sssd.getSecSwellPeriodR(),
sssd.getSecSwellPeriodY());
lowerThreshold = Math.min(sssd.getSecSwellPeriodR(),
sssd.getSecSwellPeriodY());
if (rankSwellPeriodHigh) {
// sssd.setRankSwellPeriodHigh(true);
sssd.setSecSwellPeriodR(higherThreshold);
sssd.setSecSwellPeriodY(lowerThreshold);
} else {
//sssd.setRankSwellPeriodHigh(false);
sssd.setSecSwellPeriodR(lowerThreshold);
sssd.setSecSwellPeriodY(higherThreshold);
// sssd.setRankSwellPeriodHigh(false);
sssd.setSecSwellPeriodR(lowerThreshold);
sssd.setSecSwellPeriodY(higherThreshold);
}
appendIntData(sb, sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
appendIntData(sb, sssd.getSecSwellDirFromR(), sssd.getSecSwellDirFromY());
appendIntData(sb, sssd.getSecSwellDirToR(), sssd.getSecSwellDirToY());
appendIntData(sb, sssd.getSecSwellPeriodR(),
sssd.getSecSwellPeriodY());
appendIntData(sb, sssd.getSecSwellDirFromR(),
sssd.getSecSwellDirFromY());
appendIntData(sb, sssd.getSecSwellDirToR(),
sssd.getSecSwellDirToY());
/*
* Append a space and add the data line to the list.
*/
sb.append(" ");
if (update == true)
{
if (update == true) {
dataList.setItem(i, sb.toString());
}
else
{
} else {
dataList.add(sb.toString());
}
}
}
packListControls();
}
private void createDataArray()
{
ssDataArray = new ArrayList<SSDispMonSwellData>();
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
ArrayList<AreaXML> areasArray = threshXML.getAreas();
for (AreaXML area : areasArray)
{
areaID = area.getAreaId();
SSDispMonSwellData sssd = new SSDispMonSwellData();
sssd.setAreaID(areaID);
/*
* Primary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey();
sssd.setPriSwellHeightR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setPriSwellHeightY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey();
sssd.setPriSwellPeriodR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setPriSwellPeriodY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey();
sssd.setPriSwellDirFromR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setPriSwellDirFromY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey();
sssd.setPriSwellDirToR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setPriSwellDirToY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Secondary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey();
sssd.setSecSwellHeightR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setSecSwellHeightY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey();
sssd.setSecSwellPeriodR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setSecSwellPeriodY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey();
sssd.setSecSwellDirFromR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setSecSwellDirFromY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey();
sssd.setSecSwellDirToR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setSecSwellDirToY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Add data to array.
*/
ssDataArray.add(sssd);
}
}
private SSDispMonSwellData getDataAtFirstSelection()
{
int index = dataList.getSelectionIndex();
return ssDataArray.get(index);
}
private void updateDataArray(SSDispMonSwellData sssd)
{
int[] dataListIndexes = dataList.getSelectionIndices();
int currentIndex = 0;
for (int i = 0; i < dataListIndexes.length; i++)
{
currentIndex = dataListIndexes[i];
ssDataArray.get(currentIndex).updateData(sssd);
}
}
@Override
public void commitDataToXML()
{
/**
* Create Data Array.
*/
private void createDataArray() {
ssDataArray = new ArrayList<SSDispMonSwellData>();
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
for (SSDispMonSwellData sssd : ssDataArray)
{
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
ArrayList<AreaXML> areasArray = threshXML.getAreas();
if (areasArray != null) {
for (AreaXML area : areasArray) {
areaID = area.getAreaId();
SSDispMonSwellData sssd = new SSDispMonSwellData();
sssd.setAreaID(areaID);
/*
* Primary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey();
sssd.setPriSwellHeightR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setPriSwellHeightY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey();
sssd.setPriSwellPeriodR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setPriSwellPeriodY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey();
sssd.setPriSwellDirFromR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setPriSwellDirFromY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey();
sssd.setPriSwellDirToR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setPriSwellDirToY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
/*
* Secondary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey();
sssd.setSecSwellHeightR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setSecSwellHeightY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey();
sssd.setSecSwellPeriodR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setSecSwellPeriodY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey();
sssd.setSecSwellDirFromR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setSecSwellDirFromY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey();
sssd.setSecSwellDirToR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setSecSwellDirToY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
/*
* Add data to array.
*/
ssDataArray.add(sssd);
}
}
}
/**
* Gets Data at first selection.
*
* @return
*/
private SSDispMonSwellData getDataAtFirstSelection() {
int index = dataList.getSelectionIndex();
return ssDataArray.get(index);
}
/**
* Update Data Array.
*
* @param sssd
*/
private void updateDataArray(SSDispMonSwellData sssd) {
int[] dataListIndexes = dataList.getSelectionIndices();
int currentIndex = 0;
for (int i = 0; i < dataListIndexes.length; i++) {
currentIndex = dataListIndexes[i];
ssDataArray.get(currentIndex).updateData(sssd);
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#commitDataToXML()
*/
@Override
public void commitDataToXML() {
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
for (SSDispMonSwellData sssd : ssDataArray) {
areaID = sssd.getAreaID();
/*
* Primary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellHeightR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellHeightY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getPriSwellHeightR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getPriSwellHeightY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellPeriodR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellPeriodY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getPriSwellPeriodR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getPriSwellPeriodY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellDirFromR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellDirFromY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getPriSwellDirFromR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getPriSwellDirFromY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellDirToR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellDirToY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getPriSwellDirToR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getPriSwellDirToY());
/*
* Secondary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellHeightR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellHeightY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getSecSwellHeightR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getSecSwellHeightY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellPeriodR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellPeriodY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getSecSwellPeriodR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getSecSwellPeriodY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellDirFromR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellDirFromY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getSecSwellDirFromR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getSecSwellDirFromY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellDirToR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellDirToY());
}
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getSecSwellDirToR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getSecSwellDirToY());
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#reloadData()
*/
@Override
public void reloadData()
{
public void reloadData() {
dataList.removeAll();
ssDataArray.clear();
ssDataArray = null;
populateList();
populateList();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#editDataAction()
*/
@Override
protected void editDataAction()
{
protected void editDataAction() {
SSDispMonSwellData sssd = getDataAtFirstSelection();
if (monitorSwellEditDlg == null)
{
monitorSwellEditDlg = new SSDispMonSwellEditDlg(getParent().getShell(), sssd, this, false);
if (monitorSwellEditDlg == null) {
monitorSwellEditDlg = new SSDispMonSwellEditDlg(getParent()
.getShell(), sssd, this, false);
monitorSwellEditDlg.open();
monitorSwellEditDlg = null;
}
}
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.monitor.safeseas.ui.dialogs.IUpdateDisplayMonitorSwell
* #updateThresholdData(com.raytheon.uf.viz.monitor.safeseas.threshold.
* SSDispMonSwellData)
*/
@Override
public void updateThresholdData(SSDispMonSwellData sssd)
{
public void updateThresholdData(SSDispMonSwellData sssd) {
updateDataArray(sssd);
populateList();
populateList();
}
}

View file

@ -20,16 +20,18 @@
package com.raytheon.uf.viz.monitor.safeseas.ui.dialogs;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
import com.raytheon.uf.viz.monitor.safeseas.SafeSeasMonitor;
import com.raytheon.uf.viz.monitor.safeseas.threshold.SSThresholdMgr;
import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
/**
* SAFESEAS area configuration dialog.
@ -44,7 +46,10 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
* Jan 29, 2014 2757 skorolev Changed OK button handler.
* Apr 23, 2014 3054 skorolev Fixed issue with removing a new station from list.
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
* Sep 15, 2014 2757 skorolev Removed extra dialog.
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
*
*
* </pre>
*
@ -54,8 +59,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
/** Configuration manager for SAFESEAS monitor. */
private FSSObsMonitorConfigurationManager ssConfigMgr;
private SSDispMonThreshDlg ssMonitorDlg;
/**
* Constructor
@ -65,17 +69,11 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
public SSMonitoringAreaConfigDlg(Shell parent, String title) {
super(parent, title, AppName.SAFESEAS);
SafeSeasMonitor.getInstance();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#
* handleOkBtnSelection()
*/
@Override
protected void handleOkBtnSelection() {
// Check for changes in the data
if (dataIsChanged()) {
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
"SAFESEAS Monitor Confirm Changes",
@ -84,26 +82,55 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
// Save the config xml file
getValues();
resetStatus();
ssConfigMgr.saveConfigXml();
/**
* DR#11279: re-initialize threshold manager and the monitor
* using new monitor area configuration
*/
configMgr.saveConfigXml();
configMgr.saveAdjacentAreaConfigXml();
SSThresholdMgr.reInitialize();
SafeSeasMonitor.reInitialize();
if ((!ssConfigMgr.getAddedZones().isEmpty())
|| (!ssConfigMgr.getAddedStations().isEmpty())) {
fireConfigUpdateEvent();
if ((!configMgr.getAddedZones().isEmpty())
|| (!configMgr.getAddedStations().isEmpty())) {
if (editDialog() == SWT.YES) {
SSDispMonThreshDlg ssMonitorDlg = new SSDispMonThreshDlg(
shell, CommonConfig.AppName.SAFESEAS,
ssMonitorDlg = new SSDispMonThreshDlg(shell,
CommonConfig.AppName.SAFESEAS,
DataUsageKey.MONITOR);
ssMonitorDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
// Clean added zones and stations. Close dialog.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
setReturnValue(true);
close();
}
});
ssMonitorDlg.open();
}
ssConfigMgr.getAddedZones().clear();
ssConfigMgr.getAddedStations().clear();
// Clean added zones and stations.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
}
}
}
}
if ((ssMonitorDlg == null) || ssMonitorDlg.isDisposed()) {
setReturnValue(true);
close();
}
}
/**
* Fire Table reload event
*/
private void fireConfigUpdateEvent() {
final IMonitorConfigurationEvent me = new IMonitorConfigurationEvent(
configMgr);
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
SafeSeasMonitor.getInstance().configUpdate(me);
}
});
}
/*
@ -113,12 +140,9 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
* com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#getInstance
* ()
*/
@Override
public FSSObsMonitorConfigurationManager getInstance() {
if (ssConfigMgr == null) {
ssConfigMgr = new FSSObsMonitorConfigurationManager(currentSite,
MonName.ss.name());
}
return (FSSObsMonitorConfigurationManager) ssConfigMgr;
return FSSObsMonitorConfigurationManager.getSsObsManager();
}
/*
@ -129,6 +153,7 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
@Override
protected void disposed() {
ssConfigMgr = null;
configMgr = null;
}
}

View file

@ -29,7 +29,6 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.monitor.data.ObConst.DisplayVarName;
@ -57,6 +56,8 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
* Nov 10, 2012 1297 skorolev Added initiateProdArray
* Dec 7, 2012 #1351 skorolev Changes for non-blocking dialogs.
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
*
* </pre>
*
@ -79,6 +80,7 @@ public class SSZoneTableDlg extends ZoneTableDlg {
*/
public SSZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
super(parent, obData, CommonConfig.AppName.SAFESEAS);
configMgr = FSSObsMonitorConfigurationManager.getSsObsManager();
}
/**
@ -127,7 +129,7 @@ public class SSZoneTableDlg extends ZoneTableDlg {
*/
@Override
protected void configThreshAction() {
if (ssThreshDlg == null) {
if (ssThreshDlg == null || ssThreshDlg.isDisposed()) {
ssThreshDlg = new SSDispMonThreshDlg(getParent().getShell(),
CommonConfig.AppName.SAFESEAS, DataUsageKey.DISPLAY);
}
@ -318,19 +320,4 @@ public class SSZoneTableDlg extends ZoneTableDlg {
}
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(site,
MonName.ss.name());
}
return configMgr;
}
}

View file

@ -20,20 +20,29 @@
-->
<bundle>
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor" currentAnimationMode="Temporal">
<displays xsi:type="d2DMapRenderableDisplay"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor"
currentAnimationMode="Temporal">
<resource>
<loadProperties loadWithoutData="false">
<capabilities>
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1"/>
<capability xsi:type="colorableCapability" colorAsString="#9b9b9b"/>
<capability xsi:type="outlineCapability"
lineStyle="SOLID" outlineOn="true"
outlineWidth="1" />
<capability xsi:type="colorableCapability"
colorAsString="#9b9b9b" />
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="true" isHoverOn="false" isVisible="true">
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="true" isHoverOn="false"
isVisible="true">
<pdProps maxDisplayWidth="100000000"
minDisplayWidth="0" />
</properties>
<resourceData xsi:type="spiResourceData" pixelSizeHint="45">
<resourceData xsi:type="spiResourceData"
pixelSizeHint="45">
<filename>basemaps/MTR.spi</filename>
<mapName>METAR Station Locations</mapName>
</resourceData>
@ -45,27 +54,32 @@
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotMissingData="false" plotSource="METARS in SNOW Monitor Area "
plotModelFile="fssMetar.svg" spiFile="basemaps/MTR.spi"
retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotMissingData="false" plotSource="METARS in SNOW Monitor Area "
plotModelFile="fssMetar.svg" spiFile="basemaps/MTR.spi"
retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
</mapping>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="reportType">
<constraint constraintValue="METAR, SPECI" constraintType="IN"/>
<constraint constraintValue="METAR, SPECI"
constraintType="IN" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="snow" constraintType="EQUALS"/>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
<binOffset virtualOffset="0" posOffset="1800" negOffset="1800"/>
<alertParser xsi:type="plotAlertParser"/>
<binOffset virtualOffset="0"
posOffset="1800" negOffset="1800" />
<alertParser xsi:type="plotAlertParser" />
</resourceData>
</resource>
<!-- **************************Mesowest************************************ -->
@ -75,22 +89,28 @@
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="plotResourceData" plotMissingData="false" plotSource="LDAD MESONET in SNOW Monitor Area"
plotModelFile="fssMetar.svg" retrieveData="false" isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true" isTopOfTheHour="false">
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="plotResourceData"
plotMissingData="false"
plotSource="LDAD MESONET in SNOW Monitor Area"
plotModelFile="fssMetar.svg" retrieveData="false"
isUpdatingOnMetadataOnly="true"
isRequeryNecessaryOnTimeMatch="true"
isTopOfTheHour="false">
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="fssobs" constraintType="EQUALS"/>
</mapping>
<mapping key="cwa">
<constraint constraintValue="${cwa}" constraintType="EQUALS"/>
<constraint constraintValue="fssobs"
constraintType="EQUALS" />
</mapping>
<mapping key="reportType">
<constraint constraintValue="mesonet" constraintType="EQUALS"/>
<constraint constraintValue="mesonet"
constraintType="EQUALS" />
</mapping>
<mapping key="monitorUse">
<constraint constraintValue="snow" constraintType="EQUALS"/>
<mapping key="location.stationId">
<constraint constraintValue="${stations}"
constraintType="IN" />
</mapping>
</metadataMap>
</resourceData>
@ -102,10 +122,14 @@
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true"/>
<resourceData xsi:type="snowResourceData" plotSource="SNOW Table Display"/>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="snowResourceData"
plotSource="SNOW Table Display" />
</resource>
<timeMatcher xsi:type="d2DTimeMatcher" deltaFilter="0" forecastFilter="0"/>
<timeMatcher xsi:type="d2DTimeMatcher"
deltaFilter="0" forecastFilter="0" />
<numberOfFrames>12</numberOfFrames>
</descriptor>
</displays>

View file

@ -19,15 +19,18 @@
further_licensing_information.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/snow/snowImageTable.xml" id="SNOWMONITOR" commandId="com.raytheon.uf.viz.monitor.snow.ui.actions.snow"
menuText="SNOW Table/Display">
<substitute key="cwa" value="${cwa}" />
<contribute xsi:type="bundleItem" file="bundles/snow/snowImageTable.xml"
id="SNOWMONITOR" commandId="com.raytheon.uf.viz.monitor.snow.ui.actions.snow"
menuText="SNOW Table/Display">
<substitute key="stations" value="${stations}" />
</contribute>
<contribute xsi:type="separator" id="Snow monitor Controls" />
<contribute xsi:type="command" id="ConfigureMonitorArea" commandId="com.raytheon.uf.viz.monitor.snow.ui.actions.snowAreaConfig"
menuText="Configure SNOW Monitor Area">
<contribute xsi:type="command" id="ConfigureMonitorArea"
commandId="com.raytheon.uf.viz.monitor.snow.ui.actions.snowAreaConfig"
menuText="Configure SNOW Monitor Area">
</contribute>
<contribute xsi:type="command" id="SNOWAlertVisThresholds" commandId="com.raytheon.uf.viz.monitor.snow.ui.actions.snowThresholdAlertVisConfig"
menuText="Configure SNOW Thresholds for AlertViz Monitoring">
<contribute xsi:type="command" id="SNOWAlertVisThresholds"
commandId="com.raytheon.uf.viz.monitor.snow.ui.actions.snowThresholdAlertVisConfig"
menuText="Configure SNOW Thresholds for AlertViz Monitoring">
</contribute>
</menuTemplate>

View file

@ -31,11 +31,9 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
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.core.alerts.AlertMessage;
import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.monitor.IMonitor;
@ -50,7 +48,6 @@ import com.raytheon.uf.viz.monitor.snow.listeners.ISnowResourceListener;
import com.raytheon.uf.viz.monitor.snow.threshold.SnowThresholdMgr;
import com.raytheon.uf.viz.monitor.snow.ui.dialogs.SnowMonitoringAreaConfigDlg;
import com.raytheon.uf.viz.monitor.snow.ui.dialogs.SnowZoneTableDlg;
import com.raytheon.uf.viz.monitor.util.MonitorThresholdConfiguration;
import com.raytheon.viz.alerts.observers.ProductAlertObserver;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
@ -75,6 +72,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Nov. 1, 2012 1297 skorolev Changed HashMap to Map and clean code
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Oct 16, 2014 3220 skorolev Corrected snowConfig assignment.
*
* </pre>
*
@ -83,7 +82,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
*
*/
public class SnowMonitor extends ObsMonitor {
public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(SnowMonitor.class);
@ -98,13 +97,13 @@ public class SnowMonitor extends ObsMonitor {
private SnowMonitoringAreaConfigDlg areaDialog = null;
/** SNOW configuration manager **/
private FSSObsMonitorConfigurationManager snowConfig;
private FSSObsMonitorConfigurationManager snowConfig = null;
/**
* This object contains all observation data necessary for the table dialogs
* and trending plots
*/
private final ObMultiHrsReports obData;
private ObMultiHrsReports obData;
/** All SNOW datauri start with this */
private final String OBS = "fssobs";
@ -121,22 +120,20 @@ public class SnowMonitor extends ObsMonitor {
/** Pattern for SNOW **/
private final Pattern snowPattern = Pattern.compile(DataURI.SEPARATOR + OBS
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + cwa + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + "snow");
+ DataURI.SEPARATOR + wildCard);
/**
* Private constructor, singleton
*/
private SnowMonitor() {
pluginPatterns.add(snowPattern);
snowConfig = new FSSObsMonitorConfigurationManager(currentSite,
MonName.snow.name());
readTableConfig(MonitorThresholdConfiguration.SNOW_THRESHOLD_CONFIG);
snowConfig = FSSObsMonitorConfigurationManager.getSnowObsManager();
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SNOW);
obData.setThresholdMgr(SnowThresholdMgr.getInstance());
// Pre-populate dialog with an observation (METAR) for KOMA
obData.getZoneTableData();
}
/**
@ -153,19 +150,16 @@ public class SnowMonitor extends ObsMonitor {
return monitor;
}
// TODO: Provide the changes in EDEX URIFilters when area configuration file
// has been changed.
/**
* Re-initialization of monitor.
*
* DR#11279: When monitor area configuration is changed, this module is
* called to re-initialize monitor using new monitor area configuration
*/
public static void reInitialize() {
if (monitor != null) {
monitor = null;
monitor = new SnowMonitor();
}
public void reInitialize() {
if (monitor != null)
monitor.nullifyMonitor();
SnowMonitor.getInstance();
}
/**
@ -261,24 +255,18 @@ public class SnowMonitor extends ObsMonitor {
}
/**
* Reads Table Configuration.
*
* Method that reads the table configuration and updates the zone monitor
* threshold map
*
* @param file
* -- the xml configuration filename
*/
public void readTableConfig(String file) {
public void updateMonitoringArea() {
Map<String, List<String>> zones = new HashMap<String, List<String>>();
// create zones and station list
try {
for (String zone : snowConfig.getAreaList()) {
List<String> stations = snowConfig.getAreaStations(zone);
zones.put(zone, stations);
}
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"Snow failed to load configuration..."
+ this.getClass().getName());
for (String zone : snowConfig.getAreaList()) {
List<String> stations = snowConfig.getAreaStations(zone);
zones.put(zone, stations);
}
MonitoringArea.setPlatformMap(zones);
}
@ -315,7 +303,12 @@ public class SnowMonitor extends ObsMonitor {
*/
@Override
public void configUpdate(IMonitorConfigurationEvent me) {
fireMonitorEvent(zoneDialog.getClass().getName());
snowConfig = (FSSObsMonitorConfigurationManager) me.getSource();
updateMonitoringArea();
if (zoneDialog != null && !zoneDialog.isDisposed()) {
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
}
/**

View file

@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.snow.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -40,7 +39,9 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SnowMonitor;
* ------------ ---------- ----------- --------------------------
* Dec 27, 2009 #3963 lvenable Initial creation
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
* May 21, 2014 3086 skorolev Cleaned code
* May 21, 2014 3086 skorolev Cleaned code.
* Sep 04, 2014 3220 skorolev Removed "site".
* Oct 16, 2014 3220 skorolev Corrected areaConfigMgr assignment.
*
* </pre>
*
@ -57,9 +58,7 @@ public class SnowThresholdMgr extends AbstractThresholdMgr {
super("DefaultSnowDisplayThresholds.xml",
"DefaultSnowMonitorThresholds.xml", AppName.SNOW.name()
.toLowerCase());
areaConfigMgr = new FSSObsMonitorConfigurationManager(site,
MonName.snow.name());
areaConfigMgr = FSSObsMonitorConfigurationManager.getSnowObsManager();
init();
}
@ -113,19 +112,4 @@ public class SnowThresholdMgr extends AbstractThresholdMgr {
}
return threshKeys;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (areaConfigMgr == null) {
areaConfigMgr = new FSSObsMonitorConfigurationManager(site,
MonName.snow.name());
}
return areaConfigMgr;
}
}

View file

@ -39,6 +39,7 @@ import com.raytheon.uf.viz.monitor.snow.ui.dialogs.SnowMonDispThreshDlg;
* ------------ ---------- ----------- --------------------------
* Dec 19 2009 3963 dhladky Initial creation.
* Dec 6 2012 #1351 skorolev Changes for non-blocking dialogs.
* Sep 19, 2014 3220 skorolev Added check on dispose.
*
* </pre>
*
@ -52,7 +53,7 @@ public class SnowAlertVisThresholdConfigAction extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (snowMonDispThreshDlg == null) {
if (snowMonDispThreshDlg == null || snowMonDispThreshDlg.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
snowMonDispThreshDlg = new SnowMonDispThreshDlg(shell,

View file

@ -40,6 +40,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* March 5, 2012 14413 zhao Launch AreaConfigDlg w/o monitor
* Nov.27, 2012 1297 skorolev Cleanup code for non-blocking dialog.
* May 08, 2014 3086 skorolev Added CloseCallback to dialog.
* Sep 16, 2014 2757 skorolev Added test of dialog on dispose.
* Sep 19, 2014 3220 skorolev Added check on dispose.
*
* </pre>
*
@ -63,18 +65,16 @@ public class SnowAreaConfigAction extends AbstractHandler {
*/
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (configDlg == null) {
if (configDlg == null || configDlg.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
configDlg = new SnowMonitoringAreaConfigDlg(shell,
"SNOW Monitor Area Configuration");
configDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
configDlg = null;
}
});
}
configDlg.open();

View file

@ -48,6 +48,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 21, 2014 3086 skorolev Cleaned code.
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
*
* </pre>
*
@ -213,84 +214,86 @@ public class SnowDisplayMeteoTab extends TabItemComp implements
List<AreaXML> areasArray = threshXML.getAreas();
for (AreaXML area : areasArray) {
areaID = area.getAreaId();
SnowDisplayMeteoData sdmd = new SnowDisplayMeteoData();
if (areasArray != null) {
for (AreaXML area : areasArray) {
areaID = area.getAreaId();
SnowDisplayMeteoData sdmd = new SnowDisplayMeteoData();
sdmd.setAreaID(areaID);
sdmd.setAreaID(areaID);
/* Tempature */
xmlKey = SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey();
sdmd.setTempR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setTempY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Tempature */
xmlKey = SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey();
sdmd.setTempR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setTempY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Dew point */
xmlKey = SnowDisplay.SNOW_DISP_METEO_DEWPT.getXmlKey();
sdmd.setDewpointR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setDewpointY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Dew point */
xmlKey = SnowDisplay.SNOW_DISP_METEO_DEWPT.getXmlKey();
sdmd.setDewpointR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setDewpointY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Visibility */
xmlKey = SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey();
sdmd.setVisR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setVisY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Visibility */
xmlKey = SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey();
sdmd.setVisR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setVisY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* SLP */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SLP.getXmlKey();
sdmd.setSlpR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setSlpY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* SLP */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SLP.getXmlKey();
sdmd.setSlpR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setSlpY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Hourly Precipitation */
xmlKey = SnowDisplay.SNOW_DISP_METEO_HOURLY_PRECIP.getXmlKey();
sdmd.setHrPrecipR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setHrPrecipY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Hourly Precipitation */
xmlKey = SnowDisplay.SNOW_DISP_METEO_HOURLY_PRECIP.getXmlKey();
sdmd.setHrPrecipR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setHrPrecipY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Wind Chill */
xmlKey = SnowDisplay.SNOW_DISP_METEO_WIND_CHILL.getXmlKey();
sdmd.setWindChillR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setWindChillY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Wind Chill */
xmlKey = SnowDisplay.SNOW_DISP_METEO_WIND_CHILL.getXmlKey();
sdmd.setWindChillR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setWindChillY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Frost Bite */
xmlKey = SnowDisplay.SNOW_DISP_METEO_FROSTBITE.getXmlKey();
sdmd.setFrostBiteR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setFrostBiteY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Frost Bite */
xmlKey = SnowDisplay.SNOW_DISP_METEO_FROSTBITE.getXmlKey();
sdmd.setFrostBiteR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setFrostBiteY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Snow Depth */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNOW_DEPTH.getXmlKey();
sdmd.setSnowDepthR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setSnowDepthY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Snow Depth */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNOW_DEPTH.getXmlKey();
sdmd.setSnowDepthR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setSnowDepthY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* SNINCR Hourly */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_HOURLY.getXmlKey();
sdmd.setSnincrHrlyR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setSnincrHrlyY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* SNINCR Hourly */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_HOURLY.getXmlKey();
sdmd.setSnincrHrlyR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setSnincrHrlyY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* SNINCR Total */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_TOTAL.getXmlKey();
sdmd.setSnincrTotR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setSnincrTotY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* SNINCR Total */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_TOTAL.getXmlKey();
sdmd.setSnincrTotR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setSnincrTotY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Add data to array. */
snowDataArray.add(sdmd);
/* Add data to array. */
snowDataArray.add(sdmd);
}
}
}

View file

@ -20,16 +20,18 @@
package com.raytheon.uf.viz.monitor.snow.ui.dialogs;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
import com.raytheon.uf.viz.monitor.snow.SnowMonitor;
import com.raytheon.uf.viz.monitor.snow.threshold.SnowThresholdMgr;
import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
/**
* SNOW Monitor area configuration dialog.
@ -44,7 +46,9 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
* Jan 29, 2014 2757 skorolev Changed OK button handler.
* Apr 23, 2014 3054 skorolev Fixed issue with removing a new station from list.
* Apr 28, 2014 3086 skorolev Updated snowConfigManager.
* Sep 15, 2014 2757 skorolev Removed extra dialog.
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
*
* </pre>
*
@ -54,8 +58,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
/** Configuration manager for SNOW monitor. */
private FSSObsMonitorConfigurationManager snowConfigMgr;
private SnowMonDispThreshDlg snowMonitorDlg;
/**
* Constructor
@ -65,18 +68,17 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
public SnowMonitoringAreaConfigDlg(Shell parent, String title) {
super(parent, title, AppName.SNOW);
SnowMonitor.getInstance();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#
* handleOkBtnSelection()
* handleApplyBtnSelection()
*/
@Override
protected void handleOkBtnSelection() {
snowConfigMgr = getInstance();
// Check for changes in the data\
if (dataIsChanged()) {
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
"SNOW Monitor Confirm Changes",
@ -85,28 +87,43 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
// Save the config xml file
getValues();
resetStatus();
snowConfigMgr.saveConfigXml();
/**
* DR#11279: re-initialize threshold manager and the monitor
* using new monitor area configuration
*/
SnowThresholdMgr.reInitialize();
SnowMonitor.reInitialize();
configMgr.saveConfigXml();
configMgr.saveAdjacentAreaConfigXml();
if ((!snowConfigMgr.getAddedZones().isEmpty())
|| (!snowConfigMgr.getAddedStations().isEmpty())) {
SnowThresholdMgr.reInitialize();
fireConfigUpdateEvent();
if ((!configMgr.getAddedZones().isEmpty())
|| (!configMgr.getAddedStations().isEmpty())) {
if (editDialog() == SWT.YES) {
SnowMonDispThreshDlg snowMonitorDlg = new SnowMonDispThreshDlg(
shell, CommonConfig.AppName.SNOW,
DataUsageKey.MONITOR);
if ((snowMonitorDlg == null)
|| snowMonitorDlg.isDisposed()) {
snowMonitorDlg = new SnowMonDispThreshDlg(shell,
CommonConfig.AppName.SNOW,
DataUsageKey.MONITOR);
}
snowMonitorDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
// Clean added zones and stations. Close dialog.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
setReturnValue(true);
close();
}
});
snowMonitorDlg.open();
}
snowConfigMgr.getAddedZones().clear();
snowConfigMgr.getAddedStations().clear();
// Clean added zones and stations.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
}
}
snowConfigMgr = null;
}
}
if ((snowMonitorDlg == null) || snowMonitorDlg.isDisposed()) {
setReturnValue(true);
close();
}
}
/*
@ -118,11 +135,7 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
@Override
protected FSSObsMonitorConfigurationManager getInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(currentSite,
MonName.snow.name());
}
return (FSSObsMonitorConfigurationManager) configMgr;
return FSSObsMonitorConfigurationManager.getSnowObsManager();
}
/*
@ -135,4 +148,19 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
protected void disposed() {
configMgr = null;
}
/**
* Fire Table reload event
*/
private void fireConfigUpdateEvent() {
final IMonitorConfigurationEvent me = new IMonitorConfigurationEvent(
configMgr);
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
SnowMonitor.getInstance().configUpdate(me);
}
});
}
}

View file

@ -26,7 +26,6 @@ import java.util.List;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.monitor.data.ObConst.DisplayVarName;
@ -54,6 +53,8 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
* Nov. 8, 2012 1297 skorolev Added initiateProdArray method
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
*
* </pre>
*
@ -74,6 +75,7 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
*/
public SnowZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
super(parent, obData, CommonConfig.AppName.SNOW);
configMgr = FSSObsMonitorConfigurationManager.getSnowObsManager();
}
/**
@ -120,7 +122,7 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
*/
@Override
protected void configThreshAction() {
if (snowThreshDlg == null) {
if (snowThreshDlg == null || snowThreshDlg.isDisposed()) {
snowThreshDlg = new SnowMonDispThreshDlg(getParent().getShell(),
CommonConfig.AppName.SNOW, DataUsageKey.DISPLAY);
}
@ -172,7 +174,7 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
*/
@Override
public void fireConfigUpdate(IMonitorConfigurationEvent imce) {
// Not used
}
/*
@ -255,19 +257,4 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
protected void shellDisposeAction() {
// Not used
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg#getInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(site,
MonName.snow.name());
}
return configMgr;
}
}

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