Merge branch 'omaha_16.2.2' into field_16.2.2

Change-Id: Iaa9a1a801ee2059f5ffa5473a407ac8a7c1a4200

Former-commit-id: eb7beb890676babbbd203fc1721d48ceb067aba1
This commit is contained in:
Ana Rivera 2016-02-22 20:35:27 +00:00
commit 9b97d8e4c3
1574 changed files with 38512 additions and 100820 deletions

View file

@ -28,93 +28,106 @@ import com.raytheon.rcm.products.ProductInfo.Selector;
import com.raytheon.rcm.products.RadarProduct;
import com.raytheon.rcm.products.RadarProduct.Param;
/**
* Used to format a {@link RpsList} before it is written.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* ? ? ? Initial creation.
* Jan 20, 2016 5271 bkowal Include time span / end hour for products
* that use minutes for the time span.
* </pre>
*
*/
public class RpsListFormatter {
/* See AWIPS-1 ProductRequestList::writeList()
*
*/
public static void formatAwips1RpsList(RpsList list, String fileName, PrintWriter s) {
RadarType radarType = list.getVcp() == 80 || list.getVcp() == 90 ?
RadarType.TDWR : RadarType.WSR;
Calendar cal = Calendar.getInstance();
s.format("RPS List %s %s... %d products\n",
fileName != null ? fileName : "",
String.format("%1$tY:%1$tm:%1$td:%1$tH:%1$tM:%1$tS", cal),
list.getRequests().length);
s.print(" An RPS list contains the fields: Prod-Name, Mnemonic, Prod-Code\n" +
" Number of Data Levels, Resolution, Layer Code, Elevation, Contour Interval,\n" +
" Priority, Req Interval, Map, Lower Layer, Upper Layer, multCut, endHour, timeSpan\n" +
" The record format is: '%-39s %-3s%4d%4d%6d %c%6d%7d%2d%2d%c%3d%3d %c%7d%7d'\n");
/*
* See AWIPS-1 ProductRequestList::writeList()
*/
public static void formatAwips1RpsList(RpsList list, String fileName,
PrintWriter s) {
RadarType radarType = list.getVcp() == 80 || list.getVcp() == 90 ? RadarType.TDWR
: RadarType.WSR;
Calendar cal = Calendar.getInstance();
s.format("RPS List %s %s... %d products\n", fileName != null ? fileName
: "",
String.format("%1$tY:%1$tm:%1$td:%1$tH:%1$tM:%1$tS", cal), list
.getRequests().length);
s.print(" An RPS list contains the fields: Prod-Name, Mnemonic, Prod-Code\n"
+ " Number of Data Levels, Resolution, Layer Code, Elevation, Contour Interval,\n"
+ " Priority, Req Interval, Map, Lower Layer, Upper Layer, multCut, endHour, timeSpan\n"
+ " The record format is: '%-39s %-3s%4d%4d%6d %c%6d%7d%2d%2d%c%3d%3d %c%7d%7d'\n");
for (Request r : list.getRequests()) {
s.println(formatAwips1Request(r, radarType));
}
}
private static final char[] layerCodes = {'L', 'M', 'H'};
public static String formatAwips1Request(Request r, RadarType radarType) {
RadarProduct rp = ProductInfo.getInstance().selectOne(
new Selector(radarType, null, (int) r.productCode, null));
/* Could probably guess how to format the important parts, but this
* is what AWIPS-1 does anyway...
*/
if (rp == null)
throw new IllegalArgumentException("Cannot format unknown product type " +
r.productCode + ".");
/* Note there is no check for rp.contains(ELEVATION) This
* is fine for the current set of products that are available in
* the RPS list editor...
*/
/* // Mimic:
if (_multCuts == 'Y' && _elev > 16384)
{
_elev -= 16384;
for (Request r : list.getRequests()) {
s.println(formatAwips1Request(r, radarType));
}
*/
boolean multiCuts = false;
int elev = r.pdw22;
if (r.getElevationSelection() == Request.ALL_ELEVATIONS &&
r.getElevationAngle() != 0) {
elev = r.getElevationAngle();
multiCuts = true;
}
}
char layerCode = '-';
if (rp.layer != null) {
try {
layerCode = layerCodes[rp.layer - 1];
} catch (ArrayIndexOutOfBoundsException e) {
// nothing
}
}
int lowerLayer = -1;
int upperLayer = -1;
if (rp.params.contains(Param.LAYER)) {
lowerLayer = r.getBottomAltitude();
upperLayer = r.getTopAltitude();
} else if (rp.params.contains(Param.MINI_VOLUME)) {
lowerLayer = r.getMiniVolume();
}
int endHour = -1;
int timeSpan = -1;
if (rp.params.contains(Param.TIME_SPAN)) {
endHour = r.getEndHour();
timeSpan = r.getTimeSpan();
}
private static final char[] layerCodes = { 'L', 'M', 'H' };
return String.format("%-39.39s %-3.3s%4d%4d%6d %c%6d%7d%2d%2d%c%3d%3d %c%7d%7d",
rp.name, rp.mnemonic,
r.productCode,
rp.levels != null ? rp.levels : 0,
rp.resolution != null ? (int)(rp.resolution * 100) : 0,
layerCode, elev, -1 /*contour interval*/,
r.highPriority ? 1 : 0, r.interval,
r.mapRequested ? 'Y' : 'N',
lowerLayer, upperLayer,
multiCuts ? 'Y' : 'N',
endHour, timeSpan);
}
public static String formatAwips1Request(Request r, RadarType radarType) {
RadarProduct rp = ProductInfo.getInstance().selectOne(
new Selector(radarType, null, (int) r.productCode, null));
/*
* Could probably guess how to format the important parts, but this is
* what AWIPS-1 does anyway...
*/
if (rp == null) {
throw new IllegalArgumentException(
"Cannot format unknown product type " + r.productCode + ".");
}
/*
* Note there is no check for rp.contains(ELEVATION) This is fine for
* the current set of products that are available in the RPS list
* editor...
*/
/*
* // Mimic: if (_multCuts == 'Y' && _elev > 16384) { _elev -= 16384; }
*/
boolean multiCuts = false;
int elev = r.pdw22;
if (r.getElevationSelection() == Request.ALL_ELEVATIONS
&& r.getElevationAngle() != 0) {
elev = r.getElevationAngle();
multiCuts = true;
}
char layerCode = '-';
if (rp.layer != null) {
try {
layerCode = layerCodes[rp.layer - 1];
} catch (ArrayIndexOutOfBoundsException e) {
// nothing
}
}
int lowerLayer = -1;
int upperLayer = -1;
if (rp.params.contains(Param.LAYER)) {
lowerLayer = r.getBottomAltitude();
upperLayer = r.getTopAltitude();
} else if (rp.params.contains(Param.MINI_VOLUME)) {
lowerLayer = r.getMiniVolume();
}
int endHour = -1;
int timeSpan = -1;
if (rp.params.contains(Param.TIME_SPAN)
|| rp.params.contains(Param.TIME_SPAN_MINUTES)) {
endHour = r.getEndHour();
timeSpan = r.getTimeSpan();
}
return String.format(
"%-39.39s %-3.3s%4d%4d%6d %c%6d%7d%2d%2d%c%3d%3d %c%7d%7d",
rp.name, rp.mnemonic, r.productCode,
rp.levels != null ? rp.levels : 0,
rp.resolution != null ? (int) (rp.resolution * 100) : 0,
layerCode, elev, -1 /* contour interval */, r.highPriority ? 1
: 0, r.interval, r.mapRequested ? 'Y' : 'N',
lowerLayer, upperLayer, multiCuts ? 'Y' : 'N', endHour,
timeSpan);
}
}

View file

@ -73,6 +73,7 @@ import com.raytheon.rcm.server.StatusManager.RadarStatus;
* 2014-02-03 DR 14762 D. Friedman Handle updated national RPS lists.
* 2015-06-10 4498 nabowle Rename Util->RcmUtil
* 2015-09-08 DR 17944 D. Friedman Handle elevation list file updates.
* 2016-01-20 5271 bkowal Fix resource leak.
* </pre>
*
*/
@ -181,11 +182,13 @@ public class RPSListManager extends RadarEventAdapter {
return "Error getting radar status";
}
int[] cuts = ElevationInfo.getInstance().getScanElevations(radarID, currentVCP);
int[] cuts = ElevationInfo.getInstance().getScanElevations(radarID,
currentVCP);
if (cuts == null && RcmUtil.getRadarType(rc) == RadarType.WSR)
cuts = gsmCuts;
if (list.getVcp() != RpsList.UNSPECIFIED_VCP && list.getVcp() != currentVCP) {
if (list.getVcp() != RpsList.UNSPECIFIED_VCP
&& list.getVcp() != currentVCP) {
if (store)
return null; // TODO: Should warn instead.
else
@ -240,13 +243,13 @@ public class RPSListManager extends RadarEventAdapter {
rpsList = null;
if (rpsList == null) {
int[] cuts = ElevationInfo.getInstance().
getScanElevations(rc.getRadarID(), gsm.vcp);
int[] cuts = ElevationInfo.getInstance().getScanElevations(
rc.getRadarID(), gsm.vcp);
if (cuts == null && RcmUtil.getRadarType(rc) == RadarType.WSR)
cuts = gsm.cuts;
rpsList = getMergedRpsListForRadar(rc, gsm.opMode, gsm.vcp,
cuts, null);
rpsList = getMergedRpsListForRadar(rc, gsm.opMode, gsm.vcp, cuts,
null);
// TODO: Should persist this (wouldn't need clone code)
if (rpsList != null)
@ -279,8 +282,8 @@ public class RPSListManager extends RadarEventAdapter {
return;
/*
* We want to put these products at the end of the list so that they
* do not have priority over existing products.
* We want to put these products at the end of the list so that they do
* not have priority over existing products.
*/
Selector sel = new Selector();
sel.radarType = RadarType.TDWR;
@ -290,8 +293,8 @@ public class RPSListManager extends RadarEventAdapter {
Request r = reqs.get(i);
sel.code = (int) r.productCode;
RadarProduct prod = ProductInfo.getInstance().selectOne(sel);
if (prod != null && prod.params.contains(Param.MINI_VOLUME) &&
r.getMiniVolume() != 1) {
if (prod != null && prod.params.contains(Param.MINI_VOLUME)
&& r.getMiniVolume() != 1) {
Request r2 = r.clone();
r2.setMiniVolume(1);
reqs.add(r2);
@ -321,14 +324,14 @@ public class RPSListManager extends RadarEventAdapter {
Log.warnf("Cannot determine maximum RPS list size for %s",
rc.getRadarID());
if (requestCount < 0)
Log.warnf("Cannot number of requests in RPS list for %s", rc
.getRadarID());
Log.warnf("Cannot number of requests in RPS list for %s",
rc.getRadarID());
if (maxSize >= 0 && requestCount >= 0 && requestCount > maxSize) {
int truncCount = 0;
int i;
for (i = reqs.length - 1; i >= 0; --i) {
truncCount += RpsList.getRequestCount(reqs[i], rc.getRadarID(), rpsList.getVcp(),
RcmUtil.getRadarType(rc));
truncCount += RpsList.getRequestCount(reqs[i], rc.getRadarID(),
rpsList.getVcp(), RcmUtil.getRadarType(rc));
if (requestCount - truncCount <= maxSize)
break;
}
@ -337,8 +340,10 @@ public class RPSListManager extends RadarEventAdapter {
int originalCount = requestCount;
requestCount = requestCount - truncCount;
Log.warnf("Truncated list for %s from %d entries (%d requests) to %d entries (%d requests)",
rc.getRadarID(), reqs.length, originalCount, i, requestCount);
Log.warnf(
"Truncated list for %s from %d entries (%d requests) to %d entries (%d requests)",
rc.getRadarID(), reqs.length, originalCount, i,
requestCount);
// TODO: Also need to send a message to Guardian
reqs = Arrays.copyOf(reqs, i);
rpsList = new RpsList(rpsList.getOpMode(), rpsList.getVcp(), reqs);
@ -346,8 +351,8 @@ public class RPSListManager extends RadarEventAdapter {
Log.warnf("Sending empty RPS list to %s", rc.getRadarID());
}
Log.eventf("%s: Sending RPS list with %d entries (%d requests)", rc.getRadarID(),
rpsList.getRequests().length, requestCount);
Log.eventf("%s: Sending RPS list with %d entries (%d requests)",
rc.getRadarID(), rpsList.getRequests().length, requestCount);
byte[] msg = ProductRequest.encode(rpsList.getRequests());
radarServer.getConnectionManager().sendMessageToRadar(rc.getRadarID(),
msg);
@ -396,8 +401,7 @@ public class RPSListManager extends RadarEventAdapter {
path = new File(dir, rc.getRadarID().toUpperCase()
+ ".currentVCP");
fo = new FileOutputStream(path);
try {
PrintWriter p = new PrintWriter(fo);
try (PrintWriter p = new PrintWriter(fo)) {
p.printf("VCP%d\n", rpsList.getVcp());
p.flush();
} finally {
@ -487,14 +491,12 @@ public class RPSListManager extends RadarEventAdapter {
maybeAddSPGMiniVolumeProducts(rc, reqs, vcp);
/*
* AWIPS 1 disabled duplicate merging for TDWRs because some requests
* in the national RPS list would disappear. This was due to incorrect
* handling of multi-elevation requests. AWIPS 2 handles
* multi-elevation request correctly. (See DCS 3472, DRs 19386, 20239,
* and 20244.)
* AWIPS 1 disabled duplicate merging for TDWRs because some requests in
* the national RPS list would disappear. This was due to incorrect
* handling of multi-elevation requests. AWIPS 2 handles multi-elevation
* request correctly. (See DCS 3472, DRs 19386, 20239, and 20244.)
*
* if (vcp == 80 || vcp == 90)
* elevList = null;
* if (vcp == 80 || vcp == 90) elevList = null;
*/
RadarType radarType = RcmUtil.getRadarType(rc);
@ -599,8 +601,8 @@ public class RPSListManager extends RadarEventAdapter {
private void resetRpsListForRadar(RadarConfig rc) {
String radarID = rc.getRadarID();
RadarStatus status = radarServer.getStatusManager()
.getRadarStatus(radarID);
RadarStatus status = radarServer.getStatusManager().getRadarStatus(
radarID);
byte[] gsmData = null;
if (status != null)
gsmData = status.getCurrentGSM();
@ -609,10 +611,8 @@ public class RPSListManager extends RadarEventAdapter {
if (gsmData != null) {
handleGSM(rc, gsmData);
} else {
Log.debugf(
"RPS-relevant configuration changed for %s, but "
+ "it is not connected. Cannot send a list now.",
radarID);
Log.debugf("RPS-relevant configuration changed for %s, but "
+ "it is not connected. Cannot send a list now.", radarID);
}
}
}

View file

@ -1,63 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<tx:annotation-driven transaction-manager="metadataTxManager"
proxy-target-class="true" />
<tx:annotation-driven transaction-manager="metadataTxManager"
proxy-target-class="true" />
<!-- The db class finder will search the plugin dir for classes with @Entity or @Embeddable -->
<bean id="dbClassFinder" class="com.raytheon.uf.edex.database.DatabaseClassAnnotationFinder" />
<!-- The db class finder will search the plugin dir for classes with @Entity or @Embeddable -->
<bean id="dbClassFinder" class="com.raytheon.uf.edex.database.DatabaseClassAnnotationFinder" />
<bean id="metadataDbSessionConfig"
class="com.raytheon.uf.edex.database.DatabaseSessionConfiguration">
<property name="classFinder" ref="dbClassFinder" />
<property name="excludes">
<list>
<value>com.raytheon.uf.common.dataplugin.text</value>
<value>com.raytheon.uf.common.dataplugin.shef</value>
<value>com.raytheon.edex.plugin.shef</value>
<value>com.raytheon.uf.common.bmh</value>
</list>
</property>
</bean>
<bean id="metadataSessionFactory"
class="com.raytheon.uf.edex.database.DatabaseSessionFactoryBean">
<property name="configLocation">
<value>file:///${edex.home}/conf/db/hibernateConfig/metadata/hibernate.cfg.xml
</value>
</property>
<!-- >property name="dataSource"><ref bean="datasourceMetadata"/></property -->
<property name="databaseSessionConfiguration" ref="metadataDbSessionConfig" />
</bean>
<bean id="metadataDbSessionConfig"
class="com.raytheon.uf.edex.database.DatabaseSessionConfiguration">
<property name="classFinder" ref="dbClassFinder" />
<property name="excludes">
<list>
<value>com.raytheon.uf.common.dataplugin.text</value>
<value>com.raytheon.uf.common.dataplugin.text.subscription</value>
<value>com.raytheon.uf.common.dataplugin.shef</value>
<value>com.raytheon.edex.plugin.shef</value>
<value>com.raytheon.uf.common.bmh</value>
</list>
</property>
</bean>
<bean id="metadataSessionFactory"
class="com.raytheon.uf.edex.database.DatabaseSessionFactoryBean">
<property name="configLocation">
<value>file:///${edex.home}/conf/db/hibernateConfig/metadata/hibernate.cfg.xml
</value>
</property>
<!-- >property name="dataSource"><ref bean="datasourceMetadata"/></property -->
<property name="databaseSessionConfiguration" ref="metadataDbSessionConfig" />
</bean>
<bean id="metadataTxManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="metadataSessionFactory" />
</bean>
<bean id="metadataTxManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="metadataSessionFactory" />
</bean>
<bean id="metadataTxTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager" ref="metadataTxManager"/>
</bean>
<bean id="metadataTxTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager" ref="metadataTxManager"/>
</bean>
<bean id="mapsSessionFactory"
class="com.raytheon.uf.edex.database.DatabaseSessionFactoryBean">
<!-- no annotations to load, so no databaseSessionConfig -->
<property name="configLocation">
<value>file:///${edex.home}/conf/db/hibernateConfig/maps/hibernate.cfg.xml
</value>
</property>
</bean>
<bean id="mapsSessionFactory"
class="com.raytheon.uf.edex.database.DatabaseSessionFactoryBean">
<!-- no annotations to load, so no databaseSessionConfig -->
<property name="configLocation">
<value>file:///${edex.home}/conf/db/hibernateConfig/maps/hibernate.cfg.xml
</value>
</property>
</bean>
<bean id="mapsTxManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="mapsSessionFactory" />
</bean>
<bean id="mapsTxManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="mapsSessionFactory" />
</bean>
</beans>

View file

@ -30,6 +30,7 @@ export EDEX_DEBUG_PORT=5012
export EDEX_JMX_PORT=1620
export LOG_CONF=logback-registry.xml
export MGMT_PORT=9605
export HTTP_PORT=9588
export METADATA_POOL_MAX=20
export METADATA_POOL_TIMEOUT=60

View file

@ -33,3 +33,4 @@ export EDEX_DEBUG_PORT=5005
export EDEX_JMX_PORT=1616
export LOG_CONF=logback-request.xml
export MGMT_PORT=9601
export HTTP_PORT=9581

View file

@ -22,14 +22,13 @@
export MAX_MEM=1536 # in Meg
if [ $HIGH_MEM == "on" ]; then
export MAX_MEM=2048
export MAX_MEM=2560
fi
export MAX_PERM_SIZE=192m
export EDEX_DEBUG_PORT=5012
export EDEX_JMX_PORT=1620
export LOG_CONF=logback-ebxmlRegistry.xml
export MGMT_PORT=9605
export EDEX_DEBUG_PORT=5013
export LOG_CONF=logback-registry.xml
export MGMT_PORT=9606
export METADATA_POOL_MAX=20
export METADATA_POOL_TIMEOUT=60

View file

@ -30,6 +30,7 @@ import groovy.util.logging.*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
* Dec 9, 2015 4216 dhladky Fix multi WA deploys
*
* </pre>
*
@ -85,22 +86,7 @@ class DeployESB
architecture =
(System.getProperty("os.arch") == "amd64") ? "x86_64" : "x86"
}
String esbLibIllusionPath = esbDirectory + File.separator + "lib" + File.separator +
"lib_illusion" + File.separator + architecture
if (new File(esbLibIllusionPath).exists() == false)
{
log.log(java.util.logging.Level.SEVERE,
"Unable to find the illusion lib associated with architecture - " + architecture)
System.exit(-1)
}
String libIllusionDestination = edexRootDirectory + File.separator +
"lib" + File.separator + "lib_illusion"
new File(libIllusionDestination).mkdirs()
ant.copy( todir : libIllusionDestination, overwrite : true )
{
fileset( dir : esbLibIllusionPath )
}
}
public static void deployEdexConfiguration(String edexRootDirectory, String esbDirectory)

View file

@ -44,6 +44,7 @@ import IPluginCustomDeployer
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 4, 2014 3836 bkowal Initial Commit
* Dec 9, 2015 4216 dhladky Fix multi WA deploy
*
* </pre>
*
@ -124,7 +125,7 @@ class DeployInstall
// complete the esb deployment
// we need to determine the location of the build.edex project
ProjectInformation projectInformation = this.projectInformationMap["build.edex"]
ProjectInformation projectInformation = this.projectInformationMap["deploy.edex.awips2"]
if (projectInformation == null)
{
log.log(java.util.logging.Level.SEVERE,

View file

@ -5,7 +5,7 @@
<property name="build.version" value="1.0.0" />
<property name="build.os" value="linux" />
<property name="build.ws" value="gtk" />
<property name="build.arch" value="x86" />
<property name="build.arch" value="x86_64" />
<property name="workspace.dir" value="${basedir}/../" />
<property name="pde.build.script" value="org.eclipse.pde.build_3.8.2.v20121114-140810/scripts/build.xml" />

View file

@ -0,0 +1,129 @@
@echo OFF
REM This is a MSFT Windows version of the CAVE capture script.
REM This script will identify any running CAVE processes (cave.exe)
REM and use Java to generate jstacks and (optionally) heap dumps
REM for the process(es). All of the files generated by this capture
REM script and any associated CAVE logs will be placed in a directory
REM in the user's 'My Documents' directory.
REM Usage: capture.bat [-d][-h]
REM Verify that the location of the Java JDK is known.
IF "%JAVA_JDK%" == "" (
echo ERROR: Unable to determine the location of the Java JDK. Use the JAVA_JDK Env Variable to set the location.
GOTO EOF
)
SET heap_dump=0
REM Process and validate any command line parameters, displaying usage
REM information if necessary.
IF "%1" == "" GOTO run
REM Verify that there is only one argument.
IF NOT "%2" == "" GOTO usage
REM Check for the -d argument.
IF "%1" == "-d" (
SET heap_dump=1
GOTO run
)
REM Either an invalid argument or the -h argument.
GOTO usage
:usage
echo Usage: %0 [-d][-h]
echo -d: Enables the heap dump capture
echo -h: Displays the usage message
GOTO EOF
:run
SET jstack_iterations=15
SET PROCESS=cave.exe
REM Prepare Environment
SET Path=%JAVA_JDK%\bin;%Path%
REM Build a date/time string to use in the name for the capture directory.
SET RND=%random%
SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp
REM Python is used to retrieve the current date and time because the order
REM of the Windows date/time fields is not necessarily guaranteed and the
REM Windows date/time fields can only be extracted using substring operations
REM instead of -formatter- strings like Linux allows.
python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE%
SET /p CAPTURE_DATETIME= < %RND_DATETIME_FILE%
DEL %RND_DATETIME_FILE%
SET CAPTURE_DIRECTORY=%userprofile%\capture_%CAPTURE_DATETIME%
SET CAVEDATA_LOGS_DIRECTORY=%userprofile%\%logdir%
SET CAPTURE_LOG=%CAPTURE_DIRECTORY%\capture_info.log
REM Get the PID of any currently running CAVE process.
for /f "tokens=2 delims=," %%F in ('tasklist /nh /fi "imagename eq %PROCESS%" /fo csv') do call :process_pid %%~F
GOTO prepare_exit
:process_pid
IF NOT EXIST "%CAPTURE_DIRECTORY%" (MKDIR "%CAPTURE_DIRECTORY%")
SET process_pid=%1
SET jstack_counter=0
echo Found %PROCESS% with pid %process_pid% ...
echo Found %PROCESS% with pid %process_pid% ... >> %CAPTURE_LOG%
:while_jstack
if %jstack_counter% lss %jstack_iterations% (
set /a jstack_counter+=1
echo Completing jstack iteration %jstack_counter% ...
echo Completing jstack iteration %jstack_counter% ... >> %CAPTURE_LOG%
SET jstack_log=%CAPTURE_DIRECTORY%\pid_%process_pid%_jstack_%jstack_counter%.log
jstack -l %process_pid% >> "%jstack_log%"
echo Running command: jstack -l %process_pid% >> %CAPTURE_LOG%
IF ERRORLEVEL 1 (
echo jstack for pid %process_pid% failed to connect, rerunning with -F >> %CAPTURE_LOG%
echo jstack for pid %process_pid% failed to connect, rerunning with -F
echo Running command: jstack -l -F %process_pid% >> %CAPTURE_LOG%
jstack -l -F %process_pid% >> "%jstack_log%"
)
goto :while_jstack
)
REM Copy the CAVE logs for the pid to the capture directory.
echo Running command: xcopy "%CAVEDATA_LOGS_DIRECTORY%\*pid_%process_pid%*.log" "%CAPTURE_DIRECTORY%" >> %CAPTURE_LOG%
xcopy "%CAVEDATA_LOGS_DIRECTORY%\*pid_%process_pid%*.log" "%CAPTURE_DIRECTORY%" >> %CAPTURE_LOG%
IF ERRORLEVEL 0 GOTO check_heap
echo Failed to copy the CAVE logs files.
echo Failed to copy the CAVE logs files. >> %CAPTURE_LOG%
:check_heap
REM Create a heap dump if the option has been enabled.
IF %heap_dump% NEQ 1 (
echo Heap dumps have been disabled. >> %CAPTURE_LOG%
exit /b
)
SET heap_path=%CAPTURE_DIRECTORY%\pid_%process_pid%_heap.hprof
SET dump_path=%CAPTURE_DIRECTORY%\pid_%process_pid%_dump.txt
echo Running command: jmap -heap %process_pid% >> %CAPTURE_LOG%
jmap -heap %process_pid% > %heap_path%
echo Running command: jmap -dump:live,format=b,file=%dump_path% %process_pid% >> %CAPTURE_LOG%
jmap -dump:live,format=b,file=%dump_path% %process_pid%
IF ERRORLEVEL 1 (
echo jmap for pid %process_pid% failed to connect, rerunning with -F >> %CAPTURE_LOG%
echo jmap for pid %process_pid% failed to connect, rerunning with -F
echo Running command: jmap -dump:live,format=b,file=%dump_path% -F %process_pid% >> %CAPTURE_LOG%
jmap -dump:live,format=b,file=%dump_path% -F %process_pid%
)
REM end of process_pid sub-routine
exit /b
:prepare_exit
IF NOT EXIST %CAPTURE_DIRECTORY% (GOTO EOF)
echo Capture data is available in %CAPTURE_DIRECTORY% ...
start "" "%CAPTURE_DIRECTORY%"
PAUSE
:EOF

View file

@ -63,6 +63,7 @@ import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData;
* ------------ ---------- ----------- --------------------------
* Aug 15, 2013 bsteffen Initial creation
* Jul 23, 2014 3410 bclement preparePointInfo() calls unpackResultLocation()
* Dec 17, 2015 5215 dgilling Set point name to stationId.
*
* </pre>
*
@ -78,21 +79,27 @@ public class AcarsSndNSharpResourceData extends D2DNSharpResourceData {
private static final String LATITUDE = "location.latitude";
private static final String STATION_ID = "location.stationId";
public AcarsSndNSharpResourceData() {
super("MDCRS");
}
@Override
protected void preparePointInfo() throws VizException {
if (coordinate == null) {
if ((coordinate == null) || (pointName == null)) {
DbQueryRequest request = new DbQueryRequest();
request.setConstraints(getMetadataMap());
request.addFields(new String[] { LONGITUDE, LATITUDE });
request.addFields(new String[] { STATION_ID, LONGITUDE, LATITUDE });
request.setDistinct(true);
DbQueryResponse response = (DbQueryResponse) ThriftClient
.sendRequest(request);
for (Map<String, Object> result : response.getResults()) {
if (pointName == null) {
pointName = (String) result.get(STATION_ID);
}
if (coordinate == null) {
coordinate = unpackResultLocation(result, LONGITUDE,
LATITUDE);
@ -111,7 +118,8 @@ public class AcarsSndNSharpResourceData extends D2DNSharpResourceData {
request.addConstraint("dataTime", new RequestConstraint(new DataTime(
stnInfo.getReftime()).toString()));
try {
DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request);
DbQueryResponse response = (DbQueryResponse) ThriftClient
.sendRequest(request);
ACARSSoundingRecord[] records = response
.getEntityObjects(ACARSSoundingRecord.class);
if (records.length > 0) {
@ -127,7 +135,8 @@ public class AcarsSndNSharpResourceData extends D2DNSharpResourceData {
builder.addTemperature(layer.getTemp(), SI.KELVIN);
}
if (layer.getWindDirection() != null) {
builder.addWindDirection(layer.getWindDirection(), NonSI.DEGREE_ANGLE);
builder.addWindDirection(layer.getWindDirection(),
NonSI.DEGREE_ANGLE);
}
if (layer.getWindSpeed() != null) {
builder.addWindSpeed(layer.getWindSpeed(),

View file

@ -42,7 +42,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@ -101,6 +100,10 @@ import com.raytheon.uf.viz.alertviz.ui.audio.IAudioAction;
* 31 May 2011 8058 cjeanbap Kill sound based on TextMsgBox id.
* 26 Aug 2013 #2293 lvenable Fixed color memory leaks.
* 02 Jun 2015 4473 mschenke Remember dialog position
* 28 Oct 2015 5054 randerso Fix lots of multimonitor display issues.
* 14 Jan 2016 5054 randerso Fix the Tips window to display on the correct monitor
* Removed duplicate parent shell
* 25 Jan 2016 5054 randerso Converted to stand alone window
*
* </pre>
*
@ -119,11 +122,6 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
private static final ScopedPreferenceStore dialogPrefs = new ScopedPreferenceStore(
InstanceScope.INSTANCE, Activator.PLUGIN_ID);
/**
* Parent shell.
*/
private final Shell parentShell;
/**
* Local shell.
*/
@ -150,9 +148,9 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
private Label resizeLabel;
/**
* Location of the dialog on the screen.
* Mouse down location
*/
private Point origin;
private Point mouseDownPt;
/**
* Show dialog flag.
@ -169,26 +167,11 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
*/
private boolean resizeDialog = false;
/**
* Dialog location.
*/
private Point dialogLoc;
/**
* ArrayList of TextMsgControlComp objects.
*/
private ArrayList<TextMsgControlComp> txtMsgCompArray;
/**
* Starting X position.
*/
private int startXpos = -1;
/**
* Screen width.
*/
private int screenWidth = 0;
/**
* Text composite.
*/
@ -247,20 +230,21 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
/**
* Constructor.
*
* @param parentShell
* Parent shell.
* @param display
* Parent display.
* @param audioCB
* Audio callback.
* @param showDialog
* Show dialog flag.
* @param configData
* Configuration data.
* @param alertAudioMgr
*/
public AlertMessageDlg(Shell parentShell, IAudioAction audioCB,
public AlertMessageDlg(Display display, IAudioAction audioCB,
boolean showDialog, Configuration configData,
AlertAudioMgr alertAudioMgr) {
this.display = display;
this.showDialog = showDialog;
this.parentShell = parentShell;
this.alertAudioMgr = alertAudioMgr;
this.audioCB = audioCB;
@ -273,17 +257,21 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
}
}
/**
* @return the shell
*/
public Shell getShell() {
return shell;
}
/**
* Open method used to display the dialog.
*
* @return True/False.
*/
public Object open() {
display = parentShell.getDisplay();
Shell shell1 = new Shell(parentShell, SWT.NO_TRIM);
shell = new Shell(shell1, SWT.ON_TOP);
shell.setLocation(getDialogPosition());
shell = new Shell(display, SWT.ON_TOP | SWT.NO_TRIM);
shell.setBounds(restoreDialogPosition());
shell.addDisposeListener(new DisposeListener() {
@Override
@ -306,6 +294,7 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
shell.pack();
shell.open();
// force bar location to be within the display.
Point shellLoc = shell.getLocation();
Point shellSize = shell.getSize();
Display d = shell.getDisplay();
@ -333,11 +322,18 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
return returnValue;
}
/**
* @return true if dialog is disposed
*/
public boolean isDisposed() {
return (shell == null) || shell.isDisposed();
}
/**
* Dispose of all the message timers.
*/
public void dispose() {
setDialogPosition(dialogLoc);
saveDialogPosition(shell.getBounds());
// Stop all of the message timers.
for (int i = 0; i < txtMsgCompArray.size(); i++) {
@ -356,6 +352,10 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
monitor.dispose();
}
if (shell != null) {
shell.dispose();
}
ConfigurationManager.getInstance().getCustomLocalization()
.removeFileUpdatedObserver(this);
@ -374,8 +374,6 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
* Initialize the components on the display.
*/
private void initializeComponents() {
screenWidth = display.getPrimaryMonitor().getBounds().width;
TrayConfiguration.TrayMode tm = configData.getGlobalConfiguration()
.getMode();
boolean monitorOnly = (TrayConfiguration.TrayMode.MO.equals(tm) ? true
@ -402,9 +400,6 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
mainComp.setLayout(gl);
mainComp.setLayoutData(gd);
dialogLoc = shell.getLocation();
origin = dialogLoc;
moveLabel = new Label(mainComp, SWT.NONE);
moveLabel.setImage(new Image(display, loadHandleImage()));
moveLabel.setToolTipText("Move");
@ -531,8 +526,8 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
}
public void setMaxLogSize(final int maxLogSize) {
if (txtMsgCompArray != null && txtMsgCompArray.size() > 0
&& maxLogSize != txtMsgCompArray.get(0).getMaxLogSize()) {
if ((txtMsgCompArray != null) && (txtMsgCompArray.size() > 0)
&& (maxLogSize != txtMsgCompArray.get(0).getMaxLogSize())) {
for (TextMsgControlComp comp : txtMsgCompArray) {
comp.setMaxLogSize(maxLogSize);
}
@ -547,31 +542,24 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
*/
@Override
public void mouseMove(MouseEvent e) {
if ((Label) e.getSource() == moveLabel) {
if (origin != null && moveDialog == true) {
dialogLoc = display.map(shell, null, e.x, e.y);
shell.setLocation(dialogLoc.x - origin.x, dialogLoc.y
- origin.y);
}
} else if ((Label) e.getSource() == resizeLabel) {
if (resizeDialog == true) {
int newWidth = e.x - startXpos + shell.getSize().x;
if (newWidth < 300) {
return;
if (mouseDownPt != null) {
if ((Label) e.getSource() == moveLabel) {
if (moveDialog == true) {
Point dialogLoc = shell.getLocation();
dialogLoc.x = dialogLoc.x + (e.x - mouseDownPt.x);
dialogLoc.y = dialogLoc.y + (e.y - mouseDownPt.y);
shell.setLocation(dialogLoc);
}
} else if ((Label) e.getSource() == resizeLabel) {
if (resizeDialog == true) {
int newWidth = shell.getSize().x + (e.x - mouseDownPt.x);
int shellLocationXCoord = shell.getLocation().x;
if (newWidth < 300) {
return;
}
if (shellLocationXCoord > screenWidth) {
shellLocationXCoord = shellLocationXCoord - screenWidth;
shell.setSize(newWidth, shell.getSize().y);
}
if (newWidth >= (screenWidth - shellLocationXCoord)) {
return;
}
shell.setSize(newWidth, shell.getSize().y);
}
}
}
@ -585,13 +573,12 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
@Override
public void mouseDown(MouseEvent e) {
if (e.button != SWT.BUTTON3) {
origin = new Point(e.x, e.y);
mouseDownPt = new Point(e.x, e.y);
if ((Label) e.getSource() == moveLabel) {
moveDialog = true;
} else if ((Label) e.getSource() == resizeLabel) {
resizeDialog = true;
startXpos = e.x;
}
}
}
@ -605,14 +592,12 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
@Override
public void mouseUp(MouseEvent e) {
if (e.button != SWT.BUTTON3) {
mouseDownPt = null;
if ((Label) e.getSource() == moveLabel) {
moveDialog = false;
configData.getGlobalConfiguration().setPosition(
shell.getBounds());
} else if ((Label) e.getSource() == resizeLabel) {
resizeDialog = false;
startXpos = -1;
}
}
}
@ -637,10 +622,6 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
public void showDialog(boolean showDialogFlag) {
showDialog = showDialogFlag;
// if (showDialog == true) {
// shell.setLocation(dialogLoc.x - origin.x, dialogLoc.y - origin.y);
// }
shell.setVisible(showDialog);
}
@ -661,7 +642,7 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
}
public void resetTabControl() {
boolean isOpen = tabControlDlg != null && !tabControlDlg.isDisposed()
boolean isOpen = (tabControlDlg != null) && !tabControlDlg.isDisposed()
&& tabControlDlg.isOpened();
reLayout();
// TODO: Need to determine which tabs to open and populate them.
@ -689,7 +670,7 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
RGB[] prevForeground = new RGB[size];
dispose();
for (int i = 0; i < txtMsgCompArray.size(); i++) {
if (txtMsgCompArray.get(i) != null
if ((txtMsgCompArray.get(i) != null)
&& !txtMsgCompArray.get(i).isDisposed()) {
prevMessageText[i] = txtMsgCompArray.get(i)
.getMessageText();
@ -707,15 +688,16 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
open();
result = true;
for (int i = 0; i < txtMsgCompArray.size(); i++) {
if (i < prevMessageText.length && prevMessageText[i] != null) {
if ((i < prevMessageText.length)
&& (prevMessageText[i] != null)) {
txtMsgCompArray.get(i).setMessageText(prevMessageText[i]);
if (prevBackground[i] != null && prevForeground[i] != null) {
if ((prevBackground[i] != null)
&& (prevForeground[i] != null)) {
txtMsgCompArray.get(i).setMessageTextBackAndForeground(
prevBackground[i], prevForeground[i]);
}
}
}
setDialogLocation();
shell.update();
alertAudioMgr = null;
alertAudioMgr = new AlertAudioMgr(display,
@ -982,13 +964,6 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
this.configData = configData;
}
/**
* Save the dialog location information.
*/
public void saveDialogBounds() {
configData.getGlobalConfiguration().setPosition(shell.getBounds());
}
/**
* Is the message dlg enabled
*
@ -1012,24 +987,23 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
return;
}
Shell shell = new Shell();
shell.addDisposeListener(new DisposeListener() {
infoTextShell = new Shell(this.shell.getDisplay());
infoTextShell.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
infoTextShell = null;
}
});
infoTextShell = shell;
shell.setLayout(new FillLayout());
shell.setSize(800, 900);
shell.setText(" AlertViz Tips! ");
infoTextShell.setMinimumSize(300, 200);
infoTextShell.setLayout(new GridLayout());
infoTextShell.setText(" AlertViz Tips! ");
// create the styled text widget
StyledText widget = new StyledText(shell, SWT.MULTI | SWT.WRAP
StyledText widget = new StyledText(infoTextShell, SWT.MULTI
| SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
widget.setLayoutData(layoutData);
widget.setText("----------------------------------------------\n"
+ " Here are some basic tips on how to use the AlertViz Main GUI: \n\n"
@ -1069,7 +1043,26 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
+ "5 - Perhaps not even important enough for a notice of any kind. Informational. \n\n"
+ "------------------------------------------------------------\n\n");
shell.open();
infoTextShell.layout();
infoTextShell.pack();
Rectangle b = this.shell.getBounds();
Monitor m = this.shell.getMonitor();
// attempt to position tips window above or below alertviz bar
// if tips window would be partially off screen it will be forced on
// screen by eclipse/window manager
if (b.y < (m.getBounds().height - (b.y + b.height))) {
// space below alertviz bar > than space above so position below
infoTextShell.setLocation(b.x, b.y + b.height);
} else {
// space above alertviz bar > than space below so position above
infoTextShell.setLocation(b.x, b.y
- infoTextShell.getBounds().height);
}
infoTextShell.open();
}
/**
@ -1114,13 +1107,13 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
errorBtnBgColor = new Color(display, 237, 233, 227);
errorBtn.setBackground(errorBtnBgColor);
if (tabControlDlg == null || tabControlDlg.isDisposed()) {
if ((tabControlDlg == null) || tabControlDlg.isDisposed()) {
tabControlDlg = TabControlDlg.getInstance(shell);
}
if (textMsgLog == null) {
String[] categories = new String[] { "Causes", "Catch", "Error",
"Exception" };
textMsgLog = new TextMsgLog(parentShell, categories, 0, messageVec);
textMsgLog = new TextMsgLog(shell, categories, 0, messageVec);
textMsgLog.setIndex(0);
}
if (opened) {
@ -1146,7 +1139,7 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
if (textMsgLog == null) {
String[] categories = new String[] { "Causes", "Catch", "Error",
"Exception" };
textMsgLog = new TextMsgLog(parentShell, categories, 0, messageVec);
textMsgLog = new TextMsgLog(shell, categories, 0, messageVec);
textMsgLog.setIndex(0);
}
textMsgLog.addMessage(statMsg);
@ -1173,14 +1166,14 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
for (Source source : sourceMap.values()) {
String name = source.getName();
if (source.isMonitor() && name != null) {
if (source.isMonitor() && (name != null)) {
String imageFile = source.getConfigurationMonitor()
.getMonitorMetadata().getImageFile();
boolean omitMonitor = source.getConfigurationMonitor()
.getMonitorMetadata().getOmit();
AlertMonitor monitor = alertMonitors.get(name);
if (imageFile != null
if ((imageFile != null)
&& (!imageFile.equals("null") && !imageFile.equals(""))) {
if (monitor != null) {
monitor.setImageName(imageFile);
@ -1227,42 +1220,23 @@ public class AlertMessageDlg implements MouseMoveListener, MouseListener,
return map;
}
public Rectangle getCurrentLocation() {
Rectangle position = new Rectangle(dialogLoc.x, dialogLoc.y,
parentShell.getBounds().width, parentShell.getBounds().height);
return position;
}
private void setDialogLocation() {
// get any monitors height; should be in an utility class also used in
// TabControlDlg.
Monitor any = (display.getMonitors())[0];
Rectangle monSize = any.getBounds();
int monY = monSize.height;
Rectangle rect = shell.getBounds();
if (shell.getBounds().y < 0) {
shell.setLocation(rect.x, rect.y + 100);
}
if (shell.getBounds().y > (monY - 100)) {
shell.setLocation(rect.x, rect.y - 100);
}
}
public AlertAudioMgr getAlertAudioManager() {
return alertAudioMgr;
}
public static Point getDialogPosition() {
return new Point(dialogPrefs.getInt(P_ALERT_MSG_DLG_POSITION + ".x"),
dialogPrefs.getInt(P_ALERT_MSG_DLG_POSITION + ".y"));
public static Rectangle restoreDialogPosition() {
return new Rectangle(
dialogPrefs.getInt(P_ALERT_MSG_DLG_POSITION + ".x"),
dialogPrefs.getInt(P_ALERT_MSG_DLG_POSITION + ".y"),
dialogPrefs.getInt(P_ALERT_MSG_DLG_POSITION + ".width"),
dialogPrefs.getInt(P_ALERT_MSG_DLG_POSITION + ".height"));
}
public static void setDialogPosition(Point p) {
dialogPrefs.setValue(P_ALERT_MSG_DLG_POSITION + ".x", p.x);
dialogPrefs.setValue(P_ALERT_MSG_DLG_POSITION + ".y", p.y);
public static void saveDialogPosition(Rectangle r) {
dialogPrefs.setValue(P_ALERT_MSG_DLG_POSITION + ".x", r.x);
dialogPrefs.setValue(P_ALERT_MSG_DLG_POSITION + ".y", r.y);
dialogPrefs.setValue(P_ALERT_MSG_DLG_POSITION + ".width", r.width);
dialogPrefs.setValue(P_ALERT_MSG_DLG_POSITION + ".height", r.height);
try {
dialogPrefs.save();
} catch (IOException e) {

View file

@ -42,7 +42,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
@ -71,6 +70,8 @@ import com.raytheon.uf.viz.alertviz.config.AlertMetadata;
* acknowledgeLastMessage().
* 20 Apr 2015 4311 lvenable Fixed text field to accept really long text strings.
* 29 Jun 2015 4311 randerso Reworking AlertViz dialogs to be resizable.
* 25 Jan 2016 5054 randerso Converted to stand alone window
* 08 Feb 2016 5312 randerso Deleted isDisposed() added isOpen()
*
* </pre>
*
@ -78,8 +79,8 @@ import com.raytheon.uf.viz.alertviz.config.AlertMetadata;
* @version 1.0
*
*/
public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
MouseListener, DisposeListener {
public class AlertPopupMessageDlg implements MouseMoveListener, MouseListener,
DisposeListener {
private static final int MAX_INITIAL_LINES = 5;
private static final int WIDTH_IN_CHARS = 135;
@ -282,8 +283,7 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
/**
* Constructor.
*
* @param parent
* Parent shell.
* @param display
* @param statMsg
* Status message.
* @param expanded
@ -293,9 +293,9 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
* @param startUpRGB
* Color to be displayed at startup.
*/
public AlertPopupMessageDlg(Shell parent, StatusMessage statMsg,
public AlertPopupMessageDlg(Display display, StatusMessage statMsg,
boolean expanded, Listener listener, RGB startUpRGB) {
super(parent, 0);
this.display = display;
eventListener = listener;
statMsgArray.add(statMsg);
this.expanded = expanded;
@ -308,10 +308,7 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
* Initialize the shell
*/
private void initShell(RGB startUp) {
Shell parent = getParent();
display = parent.getDisplay();
shell = new Shell(parent, SWT.ON_TOP | SWT.RESIZE);
shell = new Shell(display, SWT.ON_TOP | SWT.RESIZE);
shell.setText("Alert Visualization Popup Message Dialog");
shell.addDisposeListener(this);
@ -1066,12 +1063,12 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
}
/**
* Returns if dialog is disposed.
* Returns true if dialog is open
*
* @return True if disposed, false if not.
* @return True if open, false if not.
*/
public boolean isDisposed() {
return shell.isDisposed();
public boolean isOpen() {
return (shell != null) && !shell.isDisposed() && shell.isVisible();
}
}

View file

@ -38,7 +38,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
@ -100,6 +99,8 @@ import com.raytheon.uf.viz.alertviz.ui.dialogs.ConfigurationFileDlg.Function;
* 07 Feb 2013 15490 Xiaochuan Past this object to LayoutControlsComp.
* 26 Aug 2013 #2293 lvenable Fixed color memory leak and cleaned up some code.
* 23 Oct 2013 2303 bgonzale Old patch to fix tool tip layout.
* 28 Oct 2005 5054 randerso Removed bar position as it was written but never read
* 25 Jan 2016 5054 randerso Converted to stand alone window
*
* </pre>
*
@ -107,8 +108,8 @@ import com.raytheon.uf.viz.alertviz.ui.dialogs.ConfigurationFileDlg.Function;
* @version 1.0
*
*/
public class AlertVisConfigDlg extends Dialog implements
IConfigurationChangedListener, INeedsSaveListener {
public class AlertVisConfigDlg implements IConfigurationChangedListener,
INeedsSaveListener {
private final String CONFIG_LABEL = "Current Config: ";
@ -264,16 +265,16 @@ public class AlertVisConfigDlg extends Dialog implements
/**
* Constructor.
*
* @param parent
* Parent shell.
* @param display
* @param configData
* Configuration data.
*/
public AlertVisConfigDlg(Shell parent, final AlertMessageDlg alertMsgDlg,
Configuration configData, ConfigContext configContext,
public AlertVisConfigDlg(Display display,
final AlertMessageDlg alertMsgDlg, Configuration configData,
ConfigContext configContext,
IConfigurationChangedListener configurationChangeListener,
IRestartListener restartListener) {
super(parent, 0);
this.display = display;
this.configData = configData;
this.configContext = configContext;
sourceMap = configData.getSources();
@ -306,8 +307,6 @@ public class AlertVisConfigDlg extends Dialog implements
* @return True/False.
*/
public Object open() {
Shell parent = getParent();
display = parent.getDisplay();
shell = new Shell(display, SWT.DIALOG_TRIM | SWT.MIN | SWT.RESIZE
| SWT.MAX);
shell.setText("Alert Visualization Configuration");
@ -396,6 +395,7 @@ public class AlertVisConfigDlg extends Dialog implements
layoutControls = new LayoutControlsComp(layoutGroup, configData, this,
this);
layoutGroup.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseHover(MouseEvent e) {
mttLayout.open();
}
@ -418,6 +418,7 @@ public class AlertVisConfigDlg extends Dialog implements
mttCommonSetting = new MonitorToolTip(commonSettingsGroup, true);
commonSettingsGroup.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseHover(MouseEvent e) {
mttCommonSetting.open();
}
@ -632,6 +633,7 @@ public class AlertVisConfigDlg extends Dialog implements
mttSource = new MonitorToolTip(sourcesLbl, false);
sourcesLbl.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseHover(MouseEvent e) {
mttSource.open();
}
@ -686,6 +688,7 @@ public class AlertVisConfigDlg extends Dialog implements
sourcesList.setMenu(popupMenuSourceList);
popupMenuSourceList.addListener(SWT.Show, new Listener() {
@Override
public void handleEvent(Event event) {
MenuItem[] menuItems = popupMenuSourceList.getItems();
@ -864,6 +867,7 @@ public class AlertVisConfigDlg extends Dialog implements
mttPriorities = new MonitorToolTip(priorityLbl, false);
priorityLbl.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseHover(MouseEvent e) {
mttPriorities.open();
}
@ -1134,7 +1138,7 @@ public class AlertVisConfigDlg extends Dialog implements
sourceMap.keySet());
Boolean saveInfo = (Boolean) newSrcCatDlg.open();
if (saveInfo != null && saveInfo == true) {
if ((saveInfo != null) && (saveInfo == true)) {
String name = newSrcCatDlg.getTextKey();
String desc = newSrcCatDlg.getDescription();
@ -1251,17 +1255,15 @@ public class AlertVisConfigDlg extends Dialog implements
gConfig.setMode(layoutControls.getSelectedLayoutTrayMode()); // Mandatory
// to be
// HERE!
if (alertMsgDlg != null) {
gConfig.setPosition(alertMsgDlg.getCurrentLocation());
}
}
/**
* Populate the priority controls.
*/
private void populatePriorityControls() {
if (priorityControls == null)
if (priorityControls == null) {
return;
}
int index = sourcesList.getSelectionIndex();

View file

@ -22,12 +22,15 @@ package com.raytheon.uf.viz.alertviz.ui.dialogs;
import java.io.File;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MenuDetectEvent;
import org.eclipse.swt.events.MenuDetectListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
@ -35,7 +38,6 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolTip;
import org.eclipse.swt.widgets.Tray;
@ -96,6 +98,10 @@ import com.raytheon.uf.viz.core.VizApp;
* 18 Mar 2015 4234 njensen Remove reference to non-working python
* 03 Jun 2015 4473 njensen Updated for new AlertvizJob API
* 29 Jun 2015 4311 randerso Reworking AlertViz dialogs to be resizable.
* 28 Oct 2015 5054 randerso Call AlertVisualization.dispose() on restart so all the
* other dispose methods are called.
* 25 Jan 2016 5054 randerso Removed dummy parent shell
* 08 Feb 2016 5312 randerso Changed to build tray menu on demand
*
* </pre>
*
@ -106,11 +112,6 @@ import com.raytheon.uf.viz.core.VizApp;
public class AlertVisualization implements ITimerAction, IAudioAction,
IAlertArrivedCallback, Listener, IConfigurationChangedListener,
IRestartListener {
/**
* Dialog shell.
*/
protected Shell shell;
/**
* The display control.
*/
@ -136,35 +137,10 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
*/
private TrayItem trayItem;
/**
* A pop-up menu for the tray item.
*/
protected Menu trayItemMenu;
/**
* Show alert visualization menu item.
*/
private MenuItem showAlertDialogMI;
/**
* Do not disturb menu item.
*/
private MenuItem doNotDisturbMI;
/**
* Show alert dialog popup menu item
*/
private MenuItem showPopup;
/**
* Acknowledge all alerts menu item
*/
private MenuItem ackAll;
/**
* Alert message dialog.
*/
private AlertMessageDlg alertMessageDlg;
protected AlertMessageDlg alertMessageDlg;
/**
* Text blink count variable.
@ -211,6 +187,10 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
*/
private boolean showAlertDlg = true;
private boolean ackAll = false;
private boolean showPopup = false;
/**
* Tool tip.
*/
@ -221,8 +201,6 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
*/
protected final boolean runningStandalone;
private Rectangle prevLocation = null;
private ConfigContext configContext;
private Configuration prevConfigFile;
@ -245,15 +223,6 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
showAlertDlg = Boolean.getBoolean("ShowAlertVizBar");
doNotDisturb = true;
}
initShell();
}
/**
* Initialize a main shell.
*/
private void initShell() {
shell = new Shell(display);
initializeComponents();
AlertvizJob.getInstance().addAlertArrivedCallback(this);
@ -295,10 +264,6 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
alertMessageDlg.dispose();
}
if (shell != null) {
shell.dispose();
}
if (display != null) {
display.dispose();
}
@ -322,9 +287,9 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
* Initialize the alert message dialog.
*/
private void initAlertMessageDialog() {
alertMessageDlg = new AlertMessageDlg(shell, this, showAlertDlg,
alertMessageDlg = new AlertMessageDlg(display, this, showAlertDlg,
configData, audioMgr);
display.asyncExec(new Runnable() {
display.syncExec(new Runnable() {
@Override
public void run() {
alertMessageDlg.open();
@ -361,14 +326,13 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
trayItem = new TrayItem(tray, SWT.NONE);
updateToolTip();
trayItemMenu = new Menu(shell, SWT.POP_UP);
createTrayMenuItems();
// Right click action
trayItem.addMenuDetectListener(new MenuDetectListener() {
@Override
public void menuDetected(MenuDetectEvent de) {
Menu trayItemMenu = new Menu(alertMessageDlg.getShell(),
SWT.POP_UP);
createTrayMenuItems(trayItemMenu);
trayItemMenu.setVisible(true);
}
});
@ -389,10 +353,12 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
/**
* Create the tray menu items.
*
* @param menu
*/
protected void createTrayMenuItems() {
protected void createTrayMenuItems(Menu menu) {
showAlertDialogMI = new MenuItem(trayItemMenu, SWT.CHECK);
MenuItem showAlertDialogMI = new MenuItem(menu, SWT.CHECK);
showAlertDialogMI.setText("Show Alert Dialog");
showAlertDialogMI.setSelection(showAlertDlg);
showAlertDialogMI.addSelectionListener(new SelectionAdapter() {
@ -411,20 +377,21 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
});
if (Boolean.getBoolean("SystemTray")) {
doNotDisturbMI = new MenuItem(trayItemMenu, SWT.CHECK);
MenuItem doNotDisturbMI = new MenuItem(menu, SWT.CHECK);
doNotDisturbMI.setText("Do Not Disturb");
doNotDisturbMI.setSelection(doNotDisturb);
doNotDisturbMI.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
doNotDisturb = doNotDisturbMI.getSelection();
MenuItem item = (MenuItem) event.widget;
doNotDisturb = item.getSelection();
}
});
}
new MenuItem(trayItemMenu, SWT.SEPARATOR);
new MenuItem(menu, SWT.SEPARATOR);
MenuItem configTrayMI = new MenuItem(trayItemMenu, SWT.NONE);
MenuItem configTrayMI = new MenuItem(menu, SWT.NONE);
configTrayMI.setText("Configuration...");
configTrayMI.addSelectionListener(new SelectionAdapter() {
@Override
@ -433,7 +400,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
}
});
MenuItem viewLogMI = new MenuItem(trayItemMenu, SWT.NONE);
MenuItem viewLogMI = new MenuItem(menu, SWT.NONE);
viewLogMI.setText("System Log...");
viewLogMI.addSelectionListener(new SelectionAdapter() {
SimpleLogViewer slv = null;
@ -441,7 +408,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
@Override
public void widgetSelected(SelectionEvent event) {
if ((slv == null) || slv.isDisposed()) {
slv = new SimpleLogViewer(shell);
slv = new SimpleLogViewer(display);
slv.open();
} else {
slv.bringToTop();
@ -449,22 +416,23 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
}
});
new MenuItem(trayItemMenu, SWT.SEPARATOR);
new MenuItem(menu, SWT.SEPARATOR);
showPopup = new MenuItem(trayItemMenu, SWT.NONE);
showPopup.setText("Show Alert Popup Dialog...");
showPopup.setEnabled(false);
showPopup.addSelectionListener(new SelectionAdapter() {
MenuItem showPopupMI = new MenuItem(menu, SWT.NONE);
showPopupMI.setText("Show Alert Popup Dialog...");
showPopupMI.setEnabled(showPopup && (alertPopupDlg != null)
&& !alertPopupDlg.isOpen());
showPopupMI.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
openAlertPopupDialog();
}
});
ackAll = new MenuItem(trayItemMenu, SWT.NONE);
ackAll.setText("Acknowledge All Messages");
ackAll.setEnabled(false);
ackAll.addSelectionListener(new SelectionAdapter() {
MenuItem ackAllMI = new MenuItem(menu, SWT.NONE);
ackAllMI.setText("Acknowledge All Messages");
ackAllMI.setEnabled(ackAll);
ackAllMI.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
if (alertPopupDlg != null) {
@ -479,16 +447,31 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
});
if (this.runningStandalone) {
new MenuItem(trayItemMenu, SWT.SEPARATOR);
MenuItem restartMI = new MenuItem(trayItemMenu, SWT.NONE);
new MenuItem(menu, SWT.SEPARATOR);
MenuItem restartMI = new MenuItem(menu, SWT.NONE);
restartMI.setText("Restart");
restartMI.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
MessageBox mb = new MessageBox(shell, SWT.ICON_QUESTION
| SWT.YES | SWT.NO);
mb.setMessage("Any unsaved changes will be lost. Restart anyway?");
if (mb.open() == SWT.YES) {
MessageDialog dialog = new MessageDialog(
alertMessageDlg.getShell(),
"Confirm Restart!",
null,
"Any unsaved changes will be lost. Restart anyway?",
MessageDialog.QUESTION, new String[] {
IDialogConstants.YES_LABEL,
IDialogConstants.NO_LABEL }, 0);
dialog.create();
// center dialog on display
Shell shell = dialog.getShell();
Point size = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Rectangle bounds = alertMessageDlg.getShell().getMonitor()
.getBounds();
shell.setLocation(bounds.x + ((bounds.width - size.x) / 2),
bounds.y + ((bounds.height - size.y) / 2));
if (dialog.open() == 0) {
restart();
}
}
@ -586,7 +569,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
if ((configDlg != null) && !configDlg.isDisposed()) {
configDlg.close();
}
configDlg = new AlertVisConfigDlg(shell, alertMessageDlg, configData,
configDlg = new AlertVisConfigDlg(display, alertMessageDlg, configData,
configContext, this, this);
configDlg.open();
}
@ -608,7 +591,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
final AlertMetadata amd, final Category cat,
final TrayConfiguration gConfig) {
if (shell.isDisposed()) {
if ((alertMessageDlg == null) || alertMessageDlg.isDisposed()) {
Container.logInternal(Priority.ERROR, statMsg.getMessage() + "\n"
+ statMsg.getDetails());
return;
@ -690,10 +673,10 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
// Pop-up message
if (amd.isPopup() == true) {
if (alertPopupDlg == null) {
alertPopupDlg = new AlertPopupMessageDlg(shell, statMsg,
alertPopupDlg = new AlertPopupMessageDlg(display, statMsg,
gConfig.isExpandedPopup(), this, amd.getBackground());
showPopup.setEnabled(true);
ackAll.setEnabled(true);
showPopup = true;
ackAll = true;
startBlinkTrayTimer();
} else {
alertPopupDlg.addNewMessage(statMsg, amd);
@ -761,7 +744,8 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
toolTip.dispose();
}
toolTip = new ToolTip(shell, SWT.BALLOON | SWT.ICON_WARNING);
toolTip = new ToolTip(alertMessageDlg.getShell(), SWT.BALLOON
| SWT.ICON_WARNING);
toolTip.setText(cat.getCategoryName());
toolTip.setMessage(statMsg.getMessage());
@ -797,6 +781,9 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
}
}
/**
* @return the exit status
*/
public Integer getExitStatus() {
return exitStatus;
}
@ -809,8 +796,8 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
public void handleEvent(Event event) {
switch (event.type) {
case SWT.Hide:
ackAll.setEnabled(true);
showPopup.setEnabled(true);
ackAll = true;
showPopup = true;
startBlinkTrayTimer();
updateToolTip();
break;
@ -819,8 +806,9 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
alertPopupDlg = null;
cancelTimer();
updateToolTip();
ackAll.setEnabled(false);
showPopup.setEnabled(false);
ackAll = false;
showPopup = false;
break;
default:
Container.logInternal(Priority.WARN, "Unexpected event type: "
@ -838,7 +826,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
// such as Integer(1) the executable attempts to bring
// up an error screen before exiting with the error code.
exitStatus = IApplication.EXIT_RELAUNCH;
display.dispose();
this.dispose();
}
}
@ -848,19 +836,16 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
configData = ConfigurationManager.getInstance()
.getCurrentConfiguration();
configContext = ConfigurationManager.getInstance().getCurrentContext();
if ((alertMessageDlg != null) && (showAlertDialogMI != null)) {
if (alertMessageDlg != null) {
alertMessageDlg.setConfigData(configData);
if (configData.isMonitorLayoutChanged(prevConfigFile)) {
if (alertMessageDlg.reLayout()) {
showAlertDialogMI.setEnabled(true);
showAlertDlg = true;
}
prevConfigFile = configData.clone();
}
audioMgr = alertMessageDlg.getAlertAudioManager();
}
// if (configDlg != null && !configDlg.isDisposed()) {
// configDlg.restart(requestRestart);
// }
}
/**

View file

@ -34,7 +34,6 @@ import java.util.Vector;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@ -55,7 +54,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -73,6 +71,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* 07 Dec 2010 6531 cjeanbap Refactored class to be an Abstract class.
* 02 Mar 2011 5632 cjeanbap Update Listbox title text
* 06 May 2011 9101 cjeanbap Changed Constructor method signature.
* 12 Nov 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
* @author lvenable
@ -268,7 +268,7 @@ public class FileSelectDlg extends Dialog {
fileList.add(locFile.getFile(false).getName());
}
fileList.select(getIndex());
fileList.addSelectionListener(new SelectionListener() {
fileList.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
selectedIndex = fileList.getSelectionIndex();
@ -287,10 +287,6 @@ public class FileSelectDlg extends Dialog {
associatedTextBox.setText(name);
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
}
});
}
@ -313,6 +309,7 @@ public class FileSelectDlg extends Dialog {
okBtn.setText("OK");
okBtn.setLayoutData(gd);
okBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
returnObj = true;
shell.dispose();
@ -324,6 +321,7 @@ public class FileSelectDlg extends Dialog {
cancelBtn.setText("Cancel");
cancelBtn.setLayoutData(gd);
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
if (isSelected()) {
returnObj = false;
@ -339,6 +337,7 @@ public class FileSelectDlg extends Dialog {
importNewBtn1.setText("Import");
importNewBtn1.setLayoutData(gd);
importNewBtn1.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
FileDialog newFileDlg = new FileDialog(shell, SWT.OPEN
| SWT.SINGLE);
@ -368,10 +367,7 @@ public class FileSelectDlg extends Dialog {
}
setSelectedFile(newFile.getName());
}
} catch (LocalizationOpFailedException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
} catch (IOException e) {
} catch (LocalizationException | IOException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
@ -382,7 +378,7 @@ public class FileSelectDlg extends Dialog {
}
private boolean saveToLocalizationFile(File file, LocalizationFile locFile)
throws IOException, LocalizationOpFailedException {
throws IOException, LocalizationException {
File newFile = locFile.getFile();
InputStream in = new FileInputStream(file);
OutputStream out = new FileOutputStream(newFile);

View file

@ -20,9 +20,14 @@
package com.raytheon.uf.viz.alertviz.ui.dialogs;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.SWT;
@ -36,7 +41,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
@ -71,6 +75,8 @@ import com.raytheon.uf.viz.alertviz.config.TrayConfiguration;
* Jun 02, 2015 4473 njensen Cleaned up warnings
* Jul 01, 2015 4473 njensen Fix update of table on alert arrival
* Jun 29, 2015 4311 randerso Reworking AlertViz dialogs to be resizable.
* Jan 25, 2016 5054 randerso Converted to stand alone window
* Feb 11, 2016 5314 dgilling Fix System Log functionality.
*
* </pre>
*
@ -78,7 +84,7 @@ import com.raytheon.uf.viz.alertviz.config.TrayConfiguration;
* @version 1.0
*/
public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
public class SimpleLogViewer implements IAlertArrivedCallback {
private Display display;
@ -88,8 +94,6 @@ public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
private Button showLog;
int[] range;
private Table table;
private Color yellow;
@ -104,13 +108,12 @@ public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
/**
*
* @param parent
* @param display
*/
public SimpleLogViewer(Shell parent) {
super(parent, SWT.NONE);
public SimpleLogViewer(Display display) {
first = true;
display = parent.getDisplay();
this.display = display;
// Create a new shell object and set the text for the dialog.
shell = new Shell(display, SWT.DIALOG_TRIM | SWT.MIN | SWT.TITLE
@ -171,15 +174,10 @@ public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
columns[3].setWidth(100);
columns[4].setText("Message");
columns[4].setWidth(100);
int sz = 0;
try {
range = SystemStatusHandler.getCurrentRange();
if ((range[0] == 0) && (range[1] == 0)) {
// database is empty
sz = 0;
} else {
sz = (range[1] - range[0]) + 1;
}
sz = SystemStatusHandler.getMessageCount();
} catch (AlertvizException e2) {
Container
.logInternal(
@ -199,17 +197,27 @@ public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
table.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Integer pk = (Integer) e.item.getData();
int idx = table.getSelectionIndex();
StatusMessage sm = null;
try {
sm = SystemStatusHandler.retrieveByPk(idx + range[0]);
/*
* This event is triggered during initialization before the
* first TableItem has been assigned a PK in its data field.
* So we fall back to item selection index just in case.
*/
if (pk != null) {
sm = SystemStatusHandler.retrieveByPk(pk.intValue());
} else {
sm = SystemStatusHandler.retrieveByRowOffset(idx);
}
} catch (Exception e1) {
Container
.logInternal(
Priority.ERROR,
"SimpleLogViewer: exception retrieving StatusMessage by key from SystemStatusHandler: "
+ (idx + range[0]), e1);
+ (idx + 1), e1);
}
detailsComp.displayDetails(sm);
}
@ -227,12 +235,13 @@ public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
int index = table.indexOf(item);
try {
StatusMessage sm = SystemStatusHandler
.retrieveByPk(range[0] + index);
.retrieveByRowOffset(index);
item.setText(0, "" + sm.getEventTime().toString());
item.setText(1, "" + sm.getPriority().ordinal());
item.setText(2, sm.getSourceKey());
item.setText(3, sm.getCategory());
item.setText(4, sm.getMessage());
item.setData(Integer.valueOf(sm.getPk()));
if (sm.getPriority() == Priority.CRITICAL) {
item.setForeground(red);
@ -247,14 +256,15 @@ public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
}
} catch (AlertvizException e1) {
Status s = new Status(IStatus.ERROR, Activator.PLUGIN_ID,
"Error fetching the data", e1);
ErrorDialog.openError(
Display.getCurrent().getActiveShell(),
"Error fetching data",
"Error fetching the log data", s);
Container
.logInternal(
Priority.ERROR,
"SimpleLogViewer: exception retrieving StatusMessage by row offset from SystemStatusHandler: "
+ index, e1);
errorDialogWithStackTrace(Display.getCurrent()
.getActiveShell(), "Error fetching data",
"Error fetching the log data", e1);
}
}
});
@ -281,10 +291,12 @@ public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
LogUtil.saveLogToFile(new File(fileName),
new Timestamp(0), Order.AFTER);
} catch (AlertvizException e1) {
final Status s = new Status(IStatus.ERROR,
Activator.PLUGIN_ID, "Error saving log", e1);
ErrorDialog.openError(shell, "Error saving log",
"Error saving log", s);
Container.logInternal(Priority.ERROR,
"SimpleLogViewer: exception saving log file: "
+ fileName, e1);
errorDialogWithStackTrace(Display.getCurrent()
.getActiveShell(), "Error saving log",
"Error saving log", e1);
}
}
}
@ -356,8 +368,11 @@ public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
AlertvizJob.getInstance().addAlertArrivedCallback(this);
shell.open();
table.showItem(table.getItem(table.getItemCount() - 1));
table.select(table.getItemCount() - 1);
if (table.getItemCount() > 0) {
table.showItem(table.getItem(table.getItemCount() - 1));
table.select(table.getItemCount() - 1);
}
// Wait until the shell is disposed.
Display display = shell.getDisplay();
@ -404,4 +419,26 @@ public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
size.y += delta;
shell.setSize(size);
}
private static void errorDialogWithStackTrace(Shell parentShell,
String dialogTitle, String msg, Throwable t) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
String trace = sw.toString();
Collection<Status> childStatuses = new ArrayList<>();
String lineSep = System.getProperty("line.separator");
for (String line : trace.split(lineSep)) {
childStatuses.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
line));
}
MultiStatus ms = new MultiStatus(Activator.PLUGIN_ID, IStatus.ERROR,
childStatuses.toArray(new Status[0]), t.getLocalizedMessage(),
t);
ErrorDialog.openError(parentShell, dialogTitle, msg, ms);
}
}

View file

@ -1,248 +0,0 @@
package com.raytheon.uf.viz.alertviz.ui.dialogs;
import java.io.File;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
public abstract class TmpFileSelectDlg extends Dialog {
/**
* Dialog shell.
*/
private Shell shell;
/**
* The display control.
*/
private Display display;
/**
* Control font.
*/
private Font controlFont;
/**
* Sound file list control.
*/
private List soundFileList;
/**
* Return object when the shell is disposed.
*/
private Boolean returnObj = null;
/**
* Array of localization files.
*/
private LocalizationFile[] locFiles;
/**
* Current sound file.
*/
public File currentFile;
/**
* New sound file.
*/
private File newFile;
private String path;
private String fileExtension;
public TmpFileSelectDlg(Shell parent, int style) {
super(parent, style);
}
/**
* Open method used to display the dialog.
*
* @param audioFile
* The name of the audio file, if null default to index 0.
* @return True/False.
*/
public Object open(String title, String actionFile) {
Shell parent = getParent();
display = parent.getDisplay();
shell = new Shell(parent, SWT.TITLE);
//shell.setText("Action File Selection");
// Create the main layout for the shell.
GridLayout mainLayout = new GridLayout(1, false);
mainLayout.marginHeight = 2;
mainLayout.marginWidth = 2;
mainLayout.verticalSpacing = 2;
shell.setLayout(mainLayout);
// Initialize all of the controls and layouts
initializeComponents();
if (actionFile != null) {
setSelectedAudioFile(actionFile);
}
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
controlFont.dispose();
return returnObj;
}
/**
* Initialize the controls on the display.
*/
private void initializeComponents() {
controlFont = new Font(shell.getDisplay(), "Monospace", 10, SWT.NORMAL);
createListControl();
// Create the buttons at the bottom of the display.
createBottomButtons();
getAvailableFiles();
}
/**
* Set the selected index of file list object based upon the
* audio file.
*
* @param audioFile The name of the audio file.
*/
private void setSelectedAudioFile(String audioFile) {
String[] audioFiles = soundFileList.getItems();
int index = 0;
for (int i = 0; i < audioFiles.length; i++) {
if (audioFile.endsWith(audioFiles[i])) {
index = i;
break;
}
}
soundFileList.select(index);
}
/**
* Create the list control.
*/
private void createListControl() {
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
Composite listComp = new Composite(shell, SWT.NONE);
listComp.setLayout(new GridLayout(1, false));
listComp.setLayoutData(gd);
Label listLbl = new Label(listComp, SWT.NONE);
listLbl.setText("Available Sound Files:");
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.widthHint = 400;
gd.heightHint = 400;
gd.horizontalSpan = 2;
soundFileList = new List(listComp, SWT.BORDER | SWT.SINGLE
| SWT.V_SCROLL | SWT.H_SCROLL);
soundFileList.setLayoutData(gd);
soundFileList.setFont(controlFont);
}
/**
* Create the buttons at the bottom of the dialog.
*/
private void createBottomButtons() {
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
Composite mainButtonComp = new Composite(shell, SWT.NONE);
mainButtonComp.setLayout(new GridLayout(1, false));
mainButtonComp.setLayoutData(gd);
gd = new GridData(SWT.CENTER, SWT.DEFAULT, false, false);
Composite buttonComp = new Composite(shell, SWT.NONE);
buttonComp.setLayout(new GridLayout(2, false));
buttonComp.setLayoutData(gd);
gd = new GridData(100, SWT.DEFAULT);
Button okBtn = new Button(buttonComp, SWT.PUSH);
okBtn.setText("OK");
okBtn.setLayoutData(gd);
okBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
if (soundFileList.getSelectionIndex() != 0) {
newFile = locFiles[soundFileList.getSelectionIndex()].getFile();
} else {
newFile = locFiles[0].getFile();
}
returnObj = true;
shell.dispose();
}
});
gd = new GridData(100, SWT.DEFAULT);
Button cancelBtn = new Button(buttonComp, SWT.PUSH);
cancelBtn.setText("Cancel");
cancelBtn.setLayoutData(gd);
cancelBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
returnObj = false;
shell.dispose();
}
});
}
/**
* Get the list of available sound files.
*/
private void getAvailableFiles() {
String[] extensions = new String[] { fileExtension };
locFiles = PathManagerFactory.getPathManager().listStaticFiles(
path, extensions, true, true);
for (int i = 0; i < locFiles.length; i++) {
soundFileList.add(locFiles[i].getName());
}
if (currentFile != null) {
soundFileList.select(soundFileList.indexOf(currentFile
.getName()));
}
}
/**
* Get the selected sound file.
*
* @return The sound file.
*/
public File getSelectedFile() {
return newFile;
}
public void setFileExtension(String fileExtension) {
this.fileExtension = fileExtension;
}
public void setFile(String file) {
if (file != null) {
this.currentFile = new File(file);
}
}
public void setFilesLocationPath(String path) {
this.path = path;
}
}

View file

@ -19,11 +19,8 @@
**/
package com.raytheon.uf.viz.alertviz;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@ -34,13 +31,15 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import com.raytheon.uf.common.localization.ILocalizationFile;
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.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.SaveableOutputStream;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -58,14 +57,18 @@ import com.raytheon.uf.viz.alertviz.config.Source;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 7, 2010 mschenke Initial creation
* Apr 07, 2010 mschenke Initial creation
* Mar 16, 2011 6531 rferrel Start up loads host dependent
* configuration file.
* Aug 28 2012 13528 Xiaochuan Using setNewConfiguration() to
* Aug 28, 2012 13528 Xiaochuan Using setNewConfiguration() to
* re-set configuration data and
* run notifyListeners().
* Apr 07 2015 4346 rferrel Created {@link #retrieveBaseConfiguration()}.
* Apr 07, 2015 4346 rferrel Created {@link #retrieveBaseConfiguration}.
* May 20, 2015 4346 rjpeter Updated to also load from common_static.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated ILocalizationFile methods
* Feb 12, 2016 4834 bsteffen Fix multiple saves of the customConfiguration.
*
* </pre>
*
* @author mschenke
@ -166,7 +169,7 @@ public class ConfigurationManager {
ConfigContext workstationContext = DEFAULT_WORKSTATION_CONFIG;
try {
LocalizationFile file = getLocalizationFile(workstationContext);
ILocalizationFile file = getLocalizationFile(workstationContext);
if (file == null || !file.exists()) {
ConfigContext sourceContext = DEFAULT_SITE_CONFIG;
@ -262,7 +265,7 @@ public class ConfigurationManager {
/**
* Delete the configuration passed in
*
* @param name
* @param context
*/
public void deleteConfiguration(ConfigContext context) {
if (context.isBaseOrConfiguredLevel() || isDefaultConfig(context)) {
@ -272,7 +275,7 @@ public class ConfigurationManager {
if (current.equals(context)) {
loadAsCurrent(DEFAULT_WORKSTATION_CONFIG);
}
LocalizationFile file = getLocalizationFile(context);
ILocalizationFile file = getLocalizationFile(context);
try {
file.delete();
} catch (Exception e) {
@ -317,10 +320,10 @@ public class ConfigurationManager {
private void loadFromLocalizationType(LocalizationType type) {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext[] contexts = pm.getLocalSearchHierarchy(type);
LocalizationFile[] files = pm.listFiles(contexts, CONFIG_DIR,
ILocalizationFile[] files = pm.listFiles(contexts, CONFIG_DIR,
EXTENSIONS, true, true); // Win32
for (LocalizationFile file : files) {
for (ILocalizationFile file : files) {
LocalizationContext fileContext = file.getContext();
/*
@ -329,8 +332,8 @@ public class ConfigurationManager {
*/
if ((fileContext.getLocalizationLevel() != LocalizationLevel.BASE)
|| ((fileContext.getLocalizationLevel() == LocalizationLevel.BASE) && DEFAULT_BASE_CONFIG
.getLocalizationFileName().equals(file.getName()))) {
String fileName = file.getName();
.getLocalizationFileName().equals(file.getPath()))) {
String fileName = file.getPath();
LocalizationContext locContext = file.getContext();
String name = fileName.substring(
fileName.lastIndexOf(IPathManager.SEPARATOR) + 1, // win32
@ -362,7 +365,7 @@ public class ConfigurationManager {
}
public Configuration retrieveConfiguration(ConfigContext configContext) {
LocalizationFile file = getLocalizationFile(configContext);
ILocalizationFile file = getLocalizationFile(configContext);
if (DEFAULT_BASE_CONFIG.equals(configContext)) {
if (baseConfiguration == null) {
baseConfiguration = retrieveBaseConfiguration();
@ -379,7 +382,7 @@ public class ConfigurationManager {
* @return configuration
*/
private Configuration retrieveBaseConfiguration() {
LocalizationFile file = getLocalizationFile(DEFAULT_BASE_CONFIG);
ILocalizationFile file = getLocalizationFile(DEFAULT_BASE_CONFIG);
Configuration configuration = retrieveConfiguration(file);
configuration = mergeBaseConfigurations(LocalizationType.CAVE_STATIC,
configuration);
@ -393,12 +396,12 @@ public class ConfigurationManager {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext context = pm.getContext(type,
LocalizationLevel.BASE);
LocalizationFile[] files = pm.listFiles(context, CONFIG_DIR,
ILocalizationFile[] files = pm.listFiles(context, CONFIG_DIR,
EXTENSIONS, false, true);
for (LocalizationFile f : files) {
for (ILocalizationFile f : files) {
// Merge other base files with the default.
if (!DEFAULT_BASE_CONFIG.getLocalizationFileName().equals(
f.getName())) {
f.getPath())) {
Configuration fileConfig = retrieveConfiguration(f);
Configuration mergeConfig = configuration.mergeUnder(
fileConfig, true);
@ -409,14 +412,11 @@ public class ConfigurationManager {
return configuration;
}
public Configuration retrieveConfiguration(LocalizationFile file) {
public Configuration retrieveConfiguration(ILocalizationFile file) {
Configuration config = null;
if (file != null) {
if (file != null && file.exists()) {
try {
File actualFile = file.getFile();
if (actualFile != null && actualFile.exists()) {
config = (Configuration) deserializeFromFile(actualFile);
}
config = (Configuration) deserializeFromFile(file);
} catch (SerializationException e) {
statusHandler.handle(Priority.CRITICAL,
"Error deserializing configuration xml", e);
@ -427,18 +427,12 @@ public class ConfigurationManager {
private boolean saveToFile(ConfigContext cContext, Configuration config) {
boolean success = true;
LocalizationFile file = getLocalizationFile(cContext);
ILocalizationFile file = getLocalizationFile(cContext);
try {
// do not attempt to save to base
if (file != null
&& file.getContext().getLocalizationLevel() != LocalizationLevel.BASE) {
serializeToFile(config, file.getFile());
if (!file.save()) {
// failed to save delete the local copy and switch to the
// default config.
file.delete();
success = false;
}
serializeToFile(config, file);
}
} catch (SerializationException e) {
statusHandler.handle(Priority.CRITICAL,
@ -468,62 +462,27 @@ public class ConfigurationManager {
}
}
private void serializeToFile(Object obj, File file)
private void serializeToFile(Object obj, ILocalizationFile file)
throws SerializationException {
FileWriter writer = null;
Marshaller msh = marshaller;
try {
File dir = file.getParentFile();
if (dir.isDirectory() == false) {
dir.delete();
dir.mkdirs();
}
msh.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));
writer = new FileWriter(file);
msh.marshal(obj, writer);
try (SaveableOutputStream os = file.openOutputStream()) {
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
new Boolean(true));
marshaller.marshal(obj, os);
os.save();
} catch (Exception e) {
throw new SerializationException(e);
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
// Log to internal Log4j log
Container
.logInternal(
Priority.ERROR,
"ConfigurationManager: exception closing file writer.",
e);
}
}
}
}
private Object deserializeFromFile(File file) throws SerializationException {
FileReader reader = null;
Unmarshaller msh = unmarshaller;
try {
reader = new FileReader(file);
Object obj = msh.unmarshal(reader);
return obj;
} catch (FileNotFoundException e) {
private Object deserializeFromFile(ILocalizationFile file)
throws SerializationException {
try (InputStream is = file.openInputStream()) {
return unmarshaller.unmarshal(is);
} catch (LocalizationException | IOException | JAXBException e) {
Container.logInternal(Priority.ERROR,
"AlertViz ConfigurationManager unable to find file: "
+ file.getAbsolutePath(), e);
"ConfigurationManager: Exception unmarshalling from file: "
+ file.getPath(), e);
throw new SerializationException(e);
} catch (JAXBException e) {
Container.logInternal(Priority.ERROR,
"ConfigurationManager: JAXB exception unmarshalling from file: "
+ file.getAbsolutePath(), e);
throw new SerializationException(e);
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
// ignore
}
}
}
}
@ -531,15 +490,12 @@ public class ConfigurationManager {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext ctx = pm.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.SITE);
LocalizationFile file = pm.getLocalizationFile(ctx,
ILocalizationFile file = pm.getLocalizationFile(ctx,
ConfigContext.ALERTVIZ_DIR + IPathManager.SEPARATOR
+ "AlertVizForced.xml");
File actualFile = file.getFile();
// Win32: JHB put in check for length
if (actualFile != null && actualFile.exists()
&& actualFile.length() > 0) {
try {
return (ForcedConfiguration) unmarshaller.unmarshal(actualFile);
if (file != null && file.exists()) {
try (InputStream is = file.openInputStream()) {
return (ForcedConfiguration) unmarshaller.unmarshal(is);
} catch (Exception e) {
statusHandler.handle(Priority.SIGNIFICANT,
"Error deserializing forced configuration", e);
@ -569,10 +525,9 @@ public class ConfigurationManager {
}
private void updateCustom(boolean isRemove, Object obj) {
LocalizationFile locFile = getCustomLocalization();
File customFile = locFile.getFile();
ILocalizationFile locFile = getCustomLocalization();
try {
customConfiguration = (Configuration) deserializeFromFile(customFile);
customConfiguration = (Configuration) deserializeFromFile(locFile);
if (obj instanceof Category) {
Map<String, Category> categories = customConfiguration
.getCategories();
@ -594,12 +549,11 @@ public class ConfigurationManager {
}
customConfiguration.setSources(sources);
}
serializeToFile(customConfiguration, customFile);
locFile.save();
serializeToFile(customConfiguration, locFile);
/* Must reload fresh copy next time it is used. */
customLocalization = null;
} catch (SerializationException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
} catch (LocalizationOpFailedException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
}

View file

@ -28,7 +28,6 @@ import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.message.StatusMessage;
@ -58,6 +57,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
* Jun 03, 2013 2026 randerso Fixed typo
* Jul 27, 2015 4654 skorolev Added a localization level filtration
* Sep 21, 2015 4654 njensen Made filter logic strict instead of eager
* Jan 14, 2016 5054 randerso Remove dummy shell
*
* </pre>
*
@ -315,7 +315,7 @@ public class Container implements IConfigurationChangedListener {
}
// Status status = null;
ErrorDialog.openError(new Shell(),
ErrorDialog.openError(null,
"Error saving to internal database",
"Serious internal error occurred", new Status(
IStatus.ERROR, Activator.PLUGIN_ID,

View file

@ -43,6 +43,7 @@ import com.raytheon.uf.viz.alertviz.internal.LogMessageDAO;
* Aug 26, 2013 2142 njensen Changed to use SLF4J
* Jul 02, 2014 3337 njensen Disabled logback packaging data
* May 22, 2015 4473 njensen Refactored
* Feb 11, 2016 5314 dgilling Add retrieveByRowOffset.
* </pre>
*
* @author chammack
@ -122,16 +123,30 @@ public class SystemStatusHandler extends AbstractStatusHandler {
}
/**
* Get the current range of persisted StatusMessages
* Retrieve a status message by row offset
*
* @param index
* The row offset, 0-based index.
* @return the status message
* @throws AlertvizException
* If an error occurred querying the database for the status
* message
*/
public static StatusMessage retrieveByRowOffset(int index)
throws AlertvizException {
return LogMessageDAO.getInstance().loadByRowOffset(index);
}
/**
* Get the current number of persisted StatusMessages.
* <p>
* NOTE: This only works when called from inside the alertviz container
*
*
* @return the range [min, max] of values
* @return
* @throws AlertvizException
*/
public static int[] getCurrentRange() throws AlertvizException {
return LogMessageDAO.getInstance().getLogRange();
public static int getMessageCount() throws AlertvizException {
return LogMessageDAO.getInstance().getMessageCount();
}
/**
@ -148,5 +163,4 @@ public class SystemStatusHandler extends AbstractStatusHandler {
int count) throws AlertvizException {
return LogMessageDAO.getInstance().load(count, category);
}
}

View file

@ -31,7 +31,6 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.viz.alertviz.config.TrayConfiguration.TrayMode;
/**
@ -49,6 +48,7 @@ import com.raytheon.uf.viz.alertviz.config.TrayConfiguration.TrayMode;
* May 3, 2011 9067 cjeanbap Add isMonitorLayoutChanged() method.
* Apr 27 2012 13744 Xiaochuan Update isMonitorLayoutChanged() to compare
* source size in Previous and current.
* Oct 28, 2005 5054 randerso removed bar position as it was written but never read
*
* </pre>
*
@ -57,7 +57,7 @@ import com.raytheon.uf.viz.alertviz.config.TrayConfiguration.TrayMode;
*/
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "alertConfiguration")
public class Configuration implements ISerializableObject {
public class Configuration {
@XmlAttribute
private String name;
@ -127,7 +127,7 @@ public class Configuration implements ISerializableObject {
* Look up a source
*
* @param componentName
* @return
* @return the source
*/
public Source lookupSource(String componentName) {
return this.sourceMap.get(componentName);
@ -137,7 +137,7 @@ public class Configuration implements ISerializableObject {
* Look up a category
*
* @param componentName
* @return
* @return the category
*/
public Category lookupCategory(String componentName) {
return this.categoryMap.get(componentName);
@ -148,7 +148,7 @@ public class Configuration implements ISerializableObject {
*
* This is usually used by serialization, not end users.
*
* @param collection
* @param sources
*/
@XmlElement(name = "source")
public void setSourceCollection(Source[] sources) {
@ -163,7 +163,7 @@ public class Configuration implements ISerializableObject {
*
* This is usually used by serialization, not end users.
*
* @return
* @return the source collection
*/
public Source[] getSourceCollection() {
return sourceMap.values().toArray(new Source[sourceMap.size()]);
@ -174,7 +174,7 @@ public class Configuration implements ISerializableObject {
*
* This is usually used by serialization, not end users.
*
* @param collection
* @param categories
*/
@XmlElement(name = "category")
public void setCategoryCollection(Category[] categories) {
@ -189,20 +189,27 @@ public class Configuration implements ISerializableObject {
*
* This is usually used by serialization, not end users.
*
* @return
* @return the category collection
*/
public Category[] getCategoryCollection() {
return categoryMap.values().toArray(new Category[categoryMap.size()]);
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
@Override
public Configuration clone() {
Configuration newConfig = new Configuration();
newConfig.name = name;
@ -225,6 +232,7 @@ public class Configuration implements ISerializableObject {
return newConfig;
}
@Override
public String toString() {
String rval = getName() + ":\n";
rval += "\tTrayConfig:\n";
@ -232,8 +240,7 @@ public class Configuration implements ISerializableObject {
+ globalConfiguration.getAudioDuration() + " blinkDuration="
+ globalConfiguration.getBlinkDuration() + " logLength="
+ globalConfiguration.getLogLength() + "\n";
rval += "\t\t" + "mode=" + globalConfiguration.getMode() + " position="
+ globalConfiguration.getPosition() + "\n";
rval += "\t\t" + "mode=" + globalConfiguration.getMode() + "\n";
rval += "\t\t" + "categoryShown="
+ globalConfiguration.isCategoryShown() + " expandedPopup="
+ globalConfiguration.isExpandedPopup() + " priorityShown="
@ -406,76 +413,78 @@ public class Configuration implements ISerializableObject {
}
/**
* Determine if a Monitor was added/omitted (enable/disabled) and/or if the Layout of the
* Alert Message Dialog was changed.
* Determine if a Monitor was added/omitted (enable/disabled) and/or if the
* Layout of the Alert Message Dialog was changed.
*
* @param configData the current save Configuration Data.
* @return boolean, true if either Monitor and/or Layout was changed otherwise false.
* @param configData
* the current save Configuration Data.
* @return boolean, true if either Monitor and/or Layout was changed
* otherwise false.
*/
public boolean isMonitorLayoutChanged(Configuration configData) {
boolean modified = false;
public boolean isMonitorLayoutChanged(Configuration configData) {
boolean modified = false;
TrayMode prevLayoutMode = configData.getGlobalConfiguration().getMode();
if (!prevLayoutMode.equals(this.getGlobalConfiguration().getMode())) {
modified = true;
}
TrayMode prevLayoutMode = configData.getGlobalConfiguration().getMode();
if (!prevLayoutMode.equals(this.getGlobalConfiguration().getMode())) {
modified = true;
}
Map<String, Category> prevCategoryMap = configData.getCategories();
for (Iterator<String> categories = this.getCategories().keySet()
.iterator(); categories.hasNext() && !modified;) {
String categoryName = categories.next();
Category prevCategory = prevCategoryMap.get(categoryName);
Category newCategory = this.getCategories().get(categoryName);
if (prevCategory != null && newCategory == null) {
modified = true;
} else if (prevCategory == null && newCategory != null) {
modified = true;
} else if (prevCategory != null && newCategory != null) {
if (prevCategory.getTextBox() != newCategory.getTextBox()) {
modified = true;
}
}
}
Map<String, Category> prevCategoryMap = configData.getCategories();
for (Iterator<String> categories = this.getCategories().keySet()
.iterator(); categories.hasNext() && !modified;) {
String categoryName = categories.next();
Category prevCategory = prevCategoryMap.get(categoryName);
Category newCategory = this.getCategories().get(categoryName);
if (prevCategory != null && newCategory == null) {
modified = true;
} else if (prevCategory == null && newCategory != null) {
modified = true;
} else if (prevCategory != null && newCategory != null) {
if (prevCategory.getTextBox() != newCategory.getTextBox()) {
modified = true;
}
}
}
Map<String, Source> prevSources = configData.getSources();
Map<String, Source> prevSources = configData.getSources();
if (prevSources.size() != this.getSources().size()) {
modified = true;
} else {
for (Iterator<String> sources = this.getSources().keySet()
.iterator(); sources.hasNext() && !modified;) {
String sourceName = sources.next();
Source prevSource = prevSources.get(sourceName);
Source newSource = this.getSources().get(sourceName);
if (prevSource == null) {
modified = true;
} else if (prevSource != null && newSource != null) {
MonitorMetadata newMonitorMetadata = newSource
.getConfigurationMonitor().getMonitorMetadata();
MonitorMetadata prevMonitorMetadata = prevSource
.getConfigurationMonitor().getMonitorMetadata();
if (prevSources.size() != this.getSources().size()) {
modified = true;
} else {
for (Iterator<String> sources = this.getSources().keySet()
.iterator(); sources.hasNext() && !modified;) {
String sourceName = sources.next();
Source prevSource = prevSources.get(sourceName);
Source newSource = this.getSources().get(sourceName);
if (prevSource == null) {
modified = true;
} else if (prevSource != null && newSource != null) {
MonitorMetadata newMonitorMetadata = newSource
.getConfigurationMonitor().getMonitorMetadata();
MonitorMetadata prevMonitorMetadata = prevSource
.getConfigurationMonitor().getMonitorMetadata();
if (newMonitorMetadata != null
&& prevMonitorMetadata == null) {
modified = true;
} else if ((newMonitorMetadata.getOmit())
&& (prevMonitorMetadata.getOmit() == false)) {
modified = true;
}
if ((newMonitorMetadata.getOmit() == false)
&& (prevMonitorMetadata.getOmit() == true)) {
modified = true;
} else if (newMonitorMetadata.getImageFile() != null
&& prevMonitorMetadata.getImageFile() == null) {
modified = true;
} else if (newMonitorMetadata.getImageFile() == null
&& prevMonitorMetadata.getImageFile() != null) {
modified = true;
}
}
}
}
if (newMonitorMetadata != null
&& prevMonitorMetadata == null) {
modified = true;
} else if ((newMonitorMetadata.getOmit())
&& (prevMonitorMetadata.getOmit() == false)) {
modified = true;
}
if ((newMonitorMetadata.getOmit() == false)
&& (prevMonitorMetadata.getOmit() == true)) {
modified = true;
} else if (newMonitorMetadata.getImageFile() != null
&& prevMonitorMetadata.getImageFile() == null) {
modified = true;
} else if (newMonitorMetadata.getImageFile() == null
&& prevMonitorMetadata.getImageFile() != null) {
modified = true;
}
}
}
}
return modified;
}
return modified;
}
}

View file

@ -23,10 +23,6 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import org.eclipse.swt.graphics.Rectangle;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
* Global configuration items for alertviz
*
@ -35,13 +31,14 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 18, 2008 1433 chammack Initial creation
* Oct 28, 2005 5054 randerso removed bar position as it was written but never read
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class TrayConfiguration implements ISerializableObject {
public class TrayConfiguration {
/**
* The mode of the display:
@ -109,21 +106,6 @@ public class TrayConfiguration implements ISerializableObject {
@XmlAttribute
private int logLength;
/**
* The position of the bar
*/
@XmlAttribute
private int xPosition;
@XmlAttribute
private int yPosition;
@XmlAttribute
private int width;
@XmlAttribute
private int height;
/**
* @return the mode
*/
@ -154,28 +136,6 @@ public class TrayConfiguration implements ISerializableObject {
this.priorityShown = priorityShown;
}
/**
* @return the position
*/
public Rectangle getPosition() {
Rectangle position = null;
if (xPosition >= 0 && yPosition >= 0 && width >= 1 && height >= 1) {
position = new Rectangle(xPosition, yPosition, width, height);
}
return position;
}
/**
* @param position
* the position to set
*/
public void setPosition(Rectangle position) {
this.xPosition = position.x;
this.yPosition = position.y;
this.width = position.width;
this.height = position.height;
}
/**
* @return the sourceKeyShown
*/
@ -259,59 +219,24 @@ public class TrayConfiguration implements ISerializableObject {
}
/**
* @param messageLogLength
* @param logLength
* the messageLogLength to set
*/
public void setLogLength(int logLength) {
this.logLength = logLength;
}
public int getXPosition() {
return xPosition;
}
public void setXPosition(int position) {
xPosition = position;
}
public int getYPosition() {
return yPosition;
}
public void setYPosition(int position) {
yPosition = position;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
@Override
public TrayConfiguration clone() {
TrayConfiguration newConfig = new TrayConfiguration();
newConfig.audioDuration = audioDuration;
newConfig.blinkDuration = blinkDuration;
newConfig.categoryShown = categoryShown;
newConfig.expandedPopup = expandedPopup;
newConfig.height = height;
newConfig.logLength = logLength;
newConfig.mode = mode;
newConfig.priorityShown = priorityShown;
newConfig.sourceKeyShown = sourceKeyShown;
newConfig.width = width;
newConfig.xPosition = xPosition;
newConfig.yPosition = yPosition;
return newConfig;
}

View file

@ -50,6 +50,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 11, 2008 1433 chammack Initial creation
* Feb 11, 2016 5314 dgilling Add loadByRowOffset.
* </pre>
*
* @author chammack
@ -64,11 +65,13 @@ public class LogMessageDAO {
private static final String SELECT_ALL_QUERY_BY_PK = "SELECT event_time, category, priority, message, details, source, pk, acknowledgedBy, acknowledgedAt FROM log WHERE pk = ?";
private static final String SELECT_ALL_QUERY_BY_ROW_OFFSET = "SELECT event_time, category, priority, message, details, source, pk, acknowledgedBy, acknowledgedAt FROM log ORDER BY pk OFFSET ? ROWS FETCH NEXT ROW ONLY";
private static final String PURGE_TIME_QUERY = "SELECT purge_time FROM dbMetadata";
private static final String PURGE_TIME_UPDATE = "UPDATE dbMetadata SET purge_time = ?";
private static final String DATA_RANGE_QUERY = "SELECT MIN(pk), MAX(pk) FROM log";
private static final String MESSAGE_COUNT_QUERY = "SELECT COUNT(pk) FROM log";
private static final String SELECT_ALL_BY_DATE_AND_SOURCE_AFTER = "SELECT event_time, category, priority, message, details, source, pk, acknowledgedBy, acknowledgedAt FROM log WHERE event_time > ?";
@ -353,6 +356,45 @@ public class LogMessageDAO {
}
}
/**
* Retrieves the specified status message from the message store using the
* specified index as a row offset.
*
* @param index
* The index of the message to retrieve
* @return The status message
* @throws AlertvizException
* If an error occurred retrieving the message from the message
* store.
*/
public StatusMessage loadByRowOffset(int index) throws AlertvizException {
ResultSet rs = null;
PreparedStatement statement = null;
boolean errorOccurred = false;
try {
Connection conn = getConnection();
statement = conn.prepareStatement(SELECT_ALL_QUERY_BY_ROW_OFFSET);
statement.setInt(1, index);
rs = statement.executeQuery();
conn.commit();
return reconstituteResults(rs)[0];
} catch (SQLException e) {
errorOccurred = true;
throw new AlertvizException("Error loading " + index, e);
} catch (RuntimeException e) {
errorOccurred = true;
throw new AlertvizException("Error loading " + index, e);
} finally {
closeResultSet(rs);
closeStatement(statement);
if (errorOccurred) {
closeConnection();
}
}
}
public StatusMessage[] load(int count) throws AlertvizException {
ResultSet rs = null;
Statement statement = null;
@ -383,15 +425,16 @@ public class LogMessageDAO {
boolean errorOccurred = false;
try {
Connection conn = getConnection();
if (order == Order.BEFORE)
if (order == Order.BEFORE) {
statement = conn
.prepareStatement(SELECT_ALL_BY_DATE_AND_SOURCE_BEFORE);
else if (order == Order.AFTER)
} else if (order == Order.AFTER) {
statement = conn
.prepareStatement(SELECT_ALL_BY_DATE_AND_SOURCE_AFTER);
else
} else {
throw new IllegalArgumentException("Unsupported order : "
+ order);
}
statement.setMaxFieldSize(count);
statement.setTimestamp(1, filter);
@ -477,7 +520,12 @@ public class LogMessageDAO {
}
}
public int[] getLogRange() throws AlertvizException {
/**
* Retrieves the number of status messages in the message store.
*
* @return Total number of messages.
*/
public int getMessageCount() throws AlertvizException {
ResultSet rs = null;
Statement statement = null;
boolean errorOccurred = false;
@ -485,15 +533,12 @@ public class LogMessageDAO {
Connection conn = getConnection();
statement = conn.createStatement();
statement.setMaxFieldSize(1);
rs = statement.executeQuery(DATA_RANGE_QUERY);
rs = statement.executeQuery(MESSAGE_COUNT_QUERY);
if (rs.next()) {
int min = rs.getInt(1);
int max = rs.getInt(2);
return new int[] { min, max };
int count = rs.getInt(1);
return count;
}
conn.commit();
return null;
} catch (SQLException e) {
errorOccurred = true;
throw new AlertvizException("Error getting time range ", e);
@ -504,6 +549,8 @@ public class LogMessageDAO {
closeConnection();
}
}
return 0;
}
public Timestamp getLastPurgeTime() throws AlertvizException {
@ -547,8 +594,9 @@ public class LogMessageDAO {
sm.setAcknowledgedBy(rs.getString(8));
Timestamp ts = rs.getTimestamp(9);
if (ts != null)
if (ts != null) {
sm.setAcknowledgedAt(new Date(ts.getTime()));
}
retVal.add(sm);
}

View file

@ -40,6 +40,6 @@
id="org.apache.commons.compress"
download-size="0"
install-size="0"
version="1.5.0"/>
version="1.10.0"/>
</feature>

View file

@ -2,11 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Archive
Bundle-SymbolicName: com.raytheon.uf.viz.archive;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Version: 1.15.0.qualifier
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.ui;bundle-version="3.8.2",
org.eclipse.core.runtime,
org.apache.commons.lang;bundle-version="2.3.0",
org.apache.commons.lang3;bundle-version="3.4.0",
org.apache.commons.io;bundle-version="2.4.0",
com.raytheon.viz.ui;bundle-version="1.12.1174",
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",

View file

@ -49,7 +49,7 @@ import com.raytheon.uf.common.archive.config.ArchiveConfigManager;
import com.raytheon.uf.common.archive.config.ArchiveConstants;
import com.raytheon.uf.common.archive.config.CategoryConfig;
import com.raytheon.uf.common.archive.config.DisplayData;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.util.SizeUtil;
import com.raytheon.uf.viz.archive.data.ArchiveInfo;
import com.raytheon.uf.viz.archive.data.CategoryInfo;
@ -83,6 +83,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Apr 10, 2014 3023 rferrel Added setTotalSelectedSize method.
* Apr 23, 2014 3045 rferrel Changes to prevent race condition while getting labels.
* Aug 26, 2014 3553 rferrel Force redisplay of table after getting all display labels.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
*
* </pre>
*
@ -473,7 +474,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
String fileName = ArchiveConstants.selectFileName(type, selectName);
try {
manager.deleteSelection(fileName);
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
MessageDialog.openError(shell, "Case Error",
"Unable to delete file: " + fileName);
}
@ -819,6 +820,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
*
* @param startTimeOffset
*/
@Override
public void setRetentionTimes(long startTimeOffset) {
// do nothing override by sub-classes
}
@ -858,6 +860,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
/**
* Perform updates once all the display data is loaded.
*/
@Override
public void loadedAllDisplayData() {
VizApp.runAsync(new Runnable() {

View file

@ -24,7 +24,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;

View file

@ -80,6 +80,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Aug 14, 2014 3523 mapeters Updated deprecated {@link DrawableString#textStyle}
* assignments.
* Jul 7, 2015 10352 byin Added SymbolLoader to plot symbols
* Nov 05, 2015 5070 randerso Adjust font sizes for dpi scaling
* </pre>
*
* @author bsteffen
@ -194,7 +195,7 @@ public class AdvisoryResource extends
if (font != null) {
font.dispose();
}
this.font = target.initializeFont("Monospace", 10, new Style[] {});
this.font = target.initializeFont("Monospace", 8, new Style[] {});
this.symbolLoader = new SymbolLoader();
}

View file

@ -29,8 +29,6 @@ import org.eclipse.swt.graphics.Rectangle;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.bufrsigwx.SigWxData;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataView;
@ -56,6 +54,8 @@ import com.raytheon.viz.pointdata.PointDataRequest;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 28, 2009 3099 bsteffen Initial creation
* Nov 05, 2015 5070 randerso Adjust font sizes for dpi scaling
* Feb 04, 2015 5309 tgurney Remove dependency on dataURI
*
* </pre>
*
@ -155,7 +155,7 @@ public abstract class SigWxResource extends
if (font != null) {
font.dispose();
}
this.font = target.initializeFont("Monospace", 10,
this.font = target.initializeFont("Monospace", 8,
new Style[] { Style.BOLD });
}
@ -167,21 +167,11 @@ public abstract class SigWxResource extends
* @throws VizException
*/
protected void updateRecords(DataTime dataTime) throws VizException {
RequestConstraint constraint = new RequestConstraint();
constraint.setConstraintType(ConstraintType.IN);
for (SigWxData record : recordsToParse.get(dataTime)) {
constraint.addToConstraintValueList(record.getDataURI());
}
Map<String, RequestConstraint> constraints = new HashMap<String, RequestConstraint>();
constraints.put("dataURI", constraint);
// Request the point data
PointDataContainer pdc = PointDataRequest.requestPointDataAllLevels(
dataTime, resourceData.getMetadataMap().get("pluginName")
.getConstraintValue(), getParameters(), null,
constraints);
resourceData.getMetadataMap());
if (recordsToDisplay.containsKey(dataTime)) {
recordsToDisplay.get(dataTime).combine(pdc);
} else {

View file

@ -100,6 +100,13 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.dataplugin.text.subscription"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.ndm"
download-size="0"

View file

@ -27,6 +27,18 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.w3c.xml.ext"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.xmlgraphics"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.batik"
download-size="0"
@ -94,4 +106,10 @@
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.commons.ssl"
download-size="0"
install-size="0"
version="0.0.0"/>
</feature>

View file

@ -81,6 +81,8 @@ import com.vividsolutions.jts.geom.Polygon;
* compabilities.
* May 11, 2015 4379 nabowle Display all current CWAs for each frame.
* Jun 15, 2015 4379 nabowle Make last frame a live frame.
* Nov 05, 2015 5070 randerso Adjust font sizes for dpi scaling
*
* </pre>
*
* @author jsanchez
@ -186,11 +188,11 @@ public class CWAResource extends
constraints.put(END, constraint);
// Request the point data
this.pdc = PointDataRequest
.requestPointDataAllLevels((DataTime) null,
this.pdc = PointDataRequest.requestPointDataAllLevels(
(DataTime) null,
resourceData.getMetadataMap().get("pluginName")
.getConstraintValue(),
getParameters(), null, constraints);
.getConstraintValue(), getParameters(), null,
constraints);
if (wfs != null) {
wfs.dispose();
@ -424,7 +426,7 @@ public class CWAResource extends
@Override
protected void initInternal(IGraphicsTarget target) throws VizException {
this.font = target.initializeFont("Monospace", 11,
this.font = target.initializeFont("Monospace", 9,
new Style[] { Style.ITALIC });
updateLiveFrame(now());
scheduleRefreshTask(this);

View file

@ -66,13 +66,13 @@ import com.vividsolutions.jts.geom.Coordinate;
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 16JUN2009 2037 dhladky Initial Creation.
* Apr 17, 2013 1916 njensen Overrode getDataTimes()
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 16JUN2009 2037 dhladky Initial Creation.
* Apr 17, 2013 1916 njensen Overrode getDataTimes()
* Nov 05, 2015 5070 randerso Adjust font sizes for dpi scaling
*
* </pre>
*
@ -180,7 +180,7 @@ public class CWATResource extends
@Override
protected void initInternal(IGraphicsTarget target) throws VizException {
if (this.font == null) {
this.font = target.initializeFont("Dialog", 11, null);
this.font = target.initializeFont("Dialog", 9, null);
}
init = true;
}

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Core Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.core;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Version: 1.15.0.qualifier
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.core.runtime,
com.raytheon.uf.viz.core.rsc;bundle-version="1.0.0",
com.raytheon.uf.viz.core.maps;bundle-version="1.12.1174",
com.raytheon.viz.ui;bundle-version="1.12.1174",
org.apache.commons.lang;bundle-version="2.3.0"
org.apache.commons.lang3;bundle-version="3.4.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.d2d.core,

View file

@ -35,13 +35,13 @@
categoryId="com.raytheon.uf.viz.core.theme.d2d"
id="com.raytheon.uf.viz.d2d.core.map.D2DColorBarResourceFont"
label="D2D Colorbar Font"
value="Monospace-regular-11">
value="Monospace-regular-9">
<description>
Colorbar font for D2D
</description>
</fontDefinition>
<colorDefinition
categoryId="com.raytheon.uf.viz.core.theme.d2d"
categoryId="com.raytheon.uf.viz.core.theme.d2d"
id="com.raytheon.uf.viz.d2d.core.map.D2DColorBarResourceColor"
label="D2D Colorbar Font Color"
value="255,255,255">
@ -53,7 +53,7 @@
categoryId="com.raytheon.uf.viz.core.theme.d2d"
id="com.raytheon.uf.viz.d2d.core.legend.D2DLegendResource"
label="D2D Legend Font"
value="Monospace-bold-14">
value="Monospace-bold-12">
<description>
Legend font for D2D
</description>
@ -62,7 +62,7 @@
categoryId="com.raytheon.uf.viz.core.theme.d2d"
id="com.raytheon.uf.viz.d2d.core.sampling.D2DSamplingResource"
label="Sampling Font"
value="Monospaced-bold-12">
value="Monospace-bold-10">
<description>
The sampling font for D2D
</description>

View file

@ -74,6 +74,7 @@ import com.raytheon.viz.ui.actions.DummyAction;
* Aug 2, 2013 DR 16427 Qinglu Lin (David's approach) Changing InputPriority.SYSTEM_RESOURCE to
* InputPriority.SYSTEM_RESOURCE_LOW in initInternal().
* Jun 30, 2015 RM14663 kshresth Font size increased for Contour labels.
* Nov 05, 2015 5070 randerso Removed incorrect magnification limits
*
* </pre>
*
@ -508,7 +509,8 @@ public class D2DLegendResource extends
* by being added later, runs before the changeModelHandler. See
* InputManager.handeMouseXxx.
*/
rc.registerMouseHandler(changeModeHandler, InputPriority.SYSTEM_RESOURCE_LOW);
rc.registerMouseHandler(changeModeHandler,
InputPriority.SYSTEM_RESOURCE_LOW);
rc.registerMouseHandler(legendHandler,
InputPriority.SYSTEM_RESOURCE_LOW);
}
@ -572,8 +574,8 @@ public class D2DLegendResource extends
private float getScaledMagnification() {
float magnification = getCapability(MagnificationCapability.class)
.getMagnification().floatValue();
if (magnification < 0.9f) {
magnification = 1.0f;
if (magnification < 0.6f) {
magnification = 0.6f;
} else if (magnification > 1.0f) {
magnification = 1 + (magnification / 4.0f);
}

View file

@ -28,7 +28,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.AbstractTimeMatcher;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.VizConstants;
@ -41,13 +40,10 @@ import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.maps.scales.MapScaleRenderableDisplay;
import com.raytheon.uf.viz.core.maps.scales.MapScalesManager;
import com.raytheon.uf.viz.core.maps.scales.MapScalesManager.ManagedMapScale;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
import com.raytheon.uf.viz.core.rsc.ResourceList;
import com.raytheon.uf.viz.core.rsc.ResourceList.AddListener;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
import com.raytheon.uf.viz.core.rsc.capabilities.DensityCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
import com.raytheon.uf.viz.d2d.core.D2DProperties;
@ -61,18 +57,21 @@ import com.raytheon.viz.core.imagery.ImageCombiner;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 09, 2009 njensen Initial creation
* Mar 21, 2013 1638 mschenke Made map scales not tied to d2d
* Mar 22, 2013 1638 mschenke Moved map scale code to MapScaleRenderableDisplay
* Apr 06, 2015 ASM #17215 D. Friedman Implement clear to avoid removing time match basis
* Sep 03, 2015 4779 njensen Removed DataScale references
*
* Date Ticket# Engineer Description
* ------------- -------- ---------- -------------------------------------------
* Feb 09, 2009 1960 njensen Initial creation
* Mar 21, 2013 1638 mschenke Made map scales not tied to d2d
* Mar 22, 2013 1638 mschenke Moved map scale code to
* MapScaleRenderableDisplay
* Apr 06, 2015 17215 dfriedman Implement clear to avoid removing time
* match basis
* Sep 03, 2015 4779 njensen Removed DataScale references
* Dec 03, 2015 5147 bsteffen Reset TimeMatcher on clear
*
* </pre>
*
* @author njensen
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
@ -313,65 +312,21 @@ public class D2DMapRenderableDisplay extends MapScaleRenderableDisplay
}
/**
* Like MapScaleRenderableDisplayer.clear, but avoids removing the time
* match basis until other resources are removed. This reduces time matching
* churn and reduces the chances of lockups.
*
* @see com.raytheon.uf.viz.core.maps.scales.MapScaleRenderableDisplay#clear()
* Replace the time matcher with a copy before clearing. The existing time
* matcher is carefully tracking information for the resources(especially
* the time match basis), replacing the timeMatcher saves time updating or
* removing the saved information since the resources will all be removed
* anyway.
*/
@Override
public void clear() {
AbstractVizResource<?, ?> timeMatchBasis = null;
AbstractTimeMatcher timeMatcher = descriptor.getTimeMatcher();
if (timeMatcher instanceof D2DTimeMatcher) {
timeMatchBasis = ((D2DTimeMatcher) timeMatcher).getTimeMatchBasis();
}
ManagedMapScale scale = MapScalesManager.getInstance().getScaleByName(
getScaleName());
if (scale != null) {
ResourceList list = descriptor.getResourceList();
for (ResourcePair rp : list) {
if (rp.getProperties().isSystemResource() == false) {
// Keep system resources
if (rp.getResource() != timeMatchBasis) {
list.remove(rp);
}
}
}
if (timeMatchBasis != null) {
list.removeRsc(timeMatchBasis);
}
loadScale(scale);
} else {
// Map scale could not be found, default to remove all
// non-map/system layers and reset display
ResourceList list = descriptor.getResourceList();
for (ResourcePair rp : list) {
ResourceProperties props = rp.getProperties();
if (props.isMapLayer() == false
&& props.isSystemResource() == false) {
if (rp.getResource() != timeMatchBasis) {
list.remove(rp);
}
} else {
try {
props.setVisible(true);
rp.getResource().recycle();
} catch (Throwable e) {
props.setVisible(false);
statusHandler.handle(Priority.PROBLEM, "Clear error: "
+ e.getMessage() + ":: The resource ["
+ rp.getResource().getSafeName()
+ "] has been disabled.", e);
}
}
}
if (timeMatchBasis != null) {
list.removeRsc(timeMatchBasis);
}
scaleToClientArea(getBounds());
D2DTimeMatcher newTimeMatcher = new D2DTimeMatcher();
timeMatcher.copyFrom(newTimeMatcher);
descriptor.setTimeMatcher(newTimeMatcher);
}
super.clear();
}
}

View file

@ -52,6 +52,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
* ------------ ---------- ----------- --------------------------
* Dec 20, 2010 mschenke Initial creation
* Aug 04, 2014 3489 mapeters Updated deprecated getStringBounds() calls.
* Nov 05, 2015 5070 randerso Adjust font sizes for dpi scaling
*
* </pre>
*
@ -131,12 +132,10 @@ public class D2DSelectedPaneResource extends
/ paintProps.getCanvasBounds().height;
stringL.basics.x = stringI.basics.x = plus.basics.x = paintProps
.getView()
.getExtent().getMinX()
.getView().getExtent().getMinX()
+ (LEFT_OFFSET * ratioX);
stringL.basics.y = stringI.basics.y = plus.basics.y = paintProps
.getView()
.getExtent().getMaxY()
.getView().getExtent().getMaxY()
- (BOTTOM_OFFSET * ratioY);
if (editor.getNumberofPanes() > 1
@ -178,7 +177,7 @@ public class D2DSelectedPaneResource extends
*/
@Override
protected void initInternal(IGraphicsTarget target) throws VizException {
font = target.initializeFont(Font.MONOSPACED, 24,
font = target.initializeFont(Font.MONOSPACED, 20,
new Style[] { Style.BOLD });
stringL = new DrawableString("L", L_COLOR);

View file

@ -28,12 +28,15 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicReference;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -47,7 +50,6 @@ import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.VizConstants;
import com.raytheon.uf.viz.core.comm.PerspectiveSpecificLoadProperties;
import com.raytheon.uf.viz.core.drawables.AbstractDescriptor;
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IDescriptor.FramesInfo;
@ -71,28 +73,29 @@ import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Feb 10, 2009 chammack Initial creation
* Jul 03, 2013 2159 bsteffen Synchronize TimeCache access.
* Aug 9, 2013 16448 D. Friedman Validate time match basis in
* redoTimeMatching
* May 5, 2014 17201 D. Friedman Make same-radar time matching work more
* like A1.
* May 5, 2014 3265 bsteffen Better handling of resources returning
* null dataTimes.
* May 13, 2015 4461 bsteffen Move the logic to change frames into the
* FrameCoordinator.
* Jul 14, 2015 DR 13900 D. Friedman Validate descriptor of time match basis
* before time matching it.
* Jul 30, 2015 17761 D. Friedman Allow resources to return data times based
* on base frame times.
* Sep 10, 2015 4856 njensen Removed unnecessary code
*
* Date Ticket# Engineer Description
* ------------- -------- ---------- -------------------------------------------
* Feb 10, 2009 1959 chammack Initial creation
* Jul 03, 2013 2159 bsteffen Synchronize TimeCache access.
* Aug 09, 2013 16448 dfriedman Validate time match basis in
* redoTimeMatching
* May 05, 2014 17201 dfriedman Make same-radar time matching work more
* like A1.
* May 05, 2014 3265 bsteffen Better handling of resources returning null
* dataTimes.
* May 13, 2015 4461 bsteffen Move the logic to change frames into the
* FrameCoordinator.
* Jul 14, 2015 13900 dfriedman Validate descriptor of time match basis
* before time matching it.
* Jul 30, 2015 17761 dfriedman Allow resources to return data times based
* on base frame times.
* Sep 10, 2015 4856 njensen Removed unnecessary code
* Dec 03, 2015 5147 bsteffen Make timeMatchBasis atomic.
*
* </pre>
*
* @author chammack
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class D2DTimeMatcher extends AbstractTimeMatcher {
@ -108,7 +111,8 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
/**
* The last set of times that the resource with these properties was
* matched against. As long as we are matching against these same times
* then lastFrameTimes is valid.
* then lastFrameTimes is valid. This will be null for the
* TimeMatchBasis.
*/
private DataTime[] lastBaseTimes;
@ -144,21 +148,21 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
}
/**
* the rsc that determines the frame times to be displayed, i.e. other
* The resource that determines the frame times to be displayed, i.e. other
* resources on the same descriptor will time match against the
* timeMatchBasis
* timeMatchBasis. This is an atomic reference to allow safe concurrent
* modification. It is never safe to assume that 2 calls to get will return
* the same value so complex operations(such as redoTimeMatching) will need
* to get a reference to the basis once at the beginning of the operation
* and use that reference throughout the operation.
*/
protected transient AbstractVizResource<?, ?> timeMatchBasis;
protected final AtomicReference<AbstractVizResource<?, ?>> timeMatchBasisRef = new AtomicReference<>();
private final IDisposeListener timeMatchBasisDisposeListener = new IDisposeListener() {
@Override
public void disposed(AbstractVizResource<?, ?> resource) {
if ((resource == timeMatchBasis)) {
synchronized (D2DTimeMatcher.this) {
timeMatchBasis = null;
}
}
timeMatchBasisRef.compareAndSet(resource, null);
}
};
@ -187,9 +191,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
private final Map<AbstractVizResource<?, ?>, TimeCache> timeCacheMap = new IdentityHashMap<AbstractVizResource<?, ?>, D2DTimeMatcher.TimeCache>();
/**
* Default Constructor.
*/
public D2DTimeMatcher() {
super();
try {
@ -218,9 +219,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
* Checks if a resource is contained in the {@link IResourceGroup}
* recursively checking for {@link IResourceGroup}s in the group's list
*
* @param group
* @param resource
* @return
*/
private boolean contained(IResourceGroup group,
AbstractVizResource<?, ?> resource) {
@ -241,52 +239,40 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
}
@Override
public void redoTimeMatching(IDescriptor descriptor) throws VizException {
public void redoTimeMatching(IDescriptor descriptor) {
synchronized (this) {
if ((timeMatchBasis != null)
&& (timeMatchBasis.getDescriptor() == descriptor)
&& !validateTimeMatchBasis(descriptor)) {
changeTimeMatchBasis(null);
}
if (timeMatchBasis != null) {
IDescriptor tmDescriptor = timeMatchBasis.getDescriptor();
if (tmDescriptor != null) {
if (tmDescriptor != descriptor
&& tmDescriptor.getTimeMatcher() == this
&& hasContainer(descriptor)) {
if (validateDescriptor(tmDescriptor)) {
redoTimeMatching(tmDescriptor);
} else {
changeTimeMatchBasis(null);
}
} else if (contained(tmDescriptor, timeMatchBasis) == false) {
// Checks to ensure the timeMatchBasis is not "orphaned"
timeMatchBasis = null;
}
}
}
// Find the times for the time match basis.
DataTime[] timeSteps = findBasisTimes(descriptor.getResourceList(),
descriptor.getNumberOfFrames());
if (timeSteps == null) {
/* Find the times for the time match basis. */
Pair<AbstractVizResource<?, ?>, DataTime[]> basisInfo = findBasisTimes(descriptor);
if (basisInfo == null) {
descriptor.setFramesInfo(new FramesInfo(null, -1));
return;
}
AbstractVizResource<?, ?> timeMatchBasis = basisInfo.getLeft();
DataTime[] timeSteps = basisInfo.getRight();
Map<AbstractVizResource<?, ?>, DataTime[]> resourceTimeMap = new HashMap<AbstractVizResource<?, ?>, DataTime[]>();
resourceTimeMap.put(timeMatchBasis, timeSteps);
// Find times for every other resource
/* Find the times for the time match basis. */
Iterator<ResourcePair> pairIterator = descriptor.getResourceList()
.listIterator();
while (pairIterator.hasNext()) {
AbstractVizResource<?, ?> rsc = pairIterator.next()
.getResource();
recursiveOverlay(descriptor, new FramesInfo(timeSteps, -1,
resourceTimeMap), rsc, resourceTimeMap);
recursiveOverlay(descriptor, timeMatchBasis, new FramesInfo(
timeSteps, -1, resourceTimeMap), rsc, resourceTimeMap);
}
// Update the descriptor to the new times.
if (descriptor.getTimeMatcher() != this) {
/*
* The descriptor has switched to a new time matcher so the
* results of this operation are no longer relevant and are
* discarded. This can happen when the display is cleared.
*/
return;
}
/* Update the descriptor to the new times. */
if ((timeMatchBasis.getDescriptor() != null)
&& (timeMatchBasis.getDescriptor() != descriptor)) {
int idx = timeMatchBasis.getDescriptor().getFramesInfo()
@ -303,7 +289,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
resourceTimeMap));
}
// Add Remove data for all the resources.
/* Add Remove data for all the resources. */
for (Entry<AbstractVizResource<?, ?>, DataTime[]> entry : resourceTimeMap
.entrySet()) {
if (entry.getKey().getDescriptor() == descriptor) {
@ -319,17 +305,22 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
*
* @param descriptor
* the descriptor that is being updated
* @param timeMatchBasis
* the current timeMatchBasis, used to ensure that it is not time
* matched again, even if it is located in a IResourceGroup
* @param framesInfo
* the matched times for the rsc passed in will be added to the
* map of this FramesInfo
* @param rsc
* the resource being updated.
* @param frameTimesSoure
* map of all previously time matched resources that may be used
* to determine the frame times
* @throws VizException
*/
private void recursiveOverlay(IDescriptor descriptor,
FramesInfo framesInfo, AbstractVizResource<?, ?> rsc,
Map<AbstractVizResource<?, ?>, DataTime[]> frameTimesSoure)
throws VizException {
AbstractVizResource<?, ?> timeMatchBasis, FramesInfo framesInfo,
AbstractVizResource<?, ?> rsc,
Map<AbstractVizResource<?, ?>, DataTime[]> frameTimesSoure) {
if (rsc == null) {
return;
}
@ -338,7 +329,8 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
frameTimesSoure);
for (ResourcePair rp : ((IResourceGroup) rsc).getResourceList()) {
AbstractVizResource<?, ?> rsc1 = rp.getResource();
recursiveOverlay(descriptor, framesInfo, rsc1, completed);
recursiveOverlay(descriptor, timeMatchBasis, framesInfo, rsc1,
completed);
}
}
@ -347,8 +339,8 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
.getLoadProperties());
TimeCache timeCache = getTimeCache(rsc);
synchronized (timeCache) {
DataTime[] timeSteps = getFrameTimes(descriptor, framesInfo,
frameTimesSoure);
DataTime[] timeSteps = getFrameTimes(descriptor,
timeMatchBasis, framesInfo, frameTimesSoure);
if (Arrays.equals(timeSteps, timeCache.getLastBaseTimes())) {
framesInfo.getTimeMap().put(rsc,
timeCache.getLastFrameTimes());
@ -378,15 +370,10 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
/**
* Determine the times to match this resource against, for single panel this
* is the timeMatchBasisTimes, for four panel it is a bit more complex.
*
* @param descriptor
* @param frameInfo
* @param frameTimesSoure
* @return
* is the timeMatchBasis times, for four panel it is a bit more complex.
*/
private DataTime[] getFrameTimes(IDescriptor descriptor,
FramesInfo frameInfo,
AbstractVizResource<?, ?> timeMatchBasis, FramesInfo frameInfo,
Map<AbstractVizResource<?, ?>, DataTime[]> frameTimesSource) {
DataTime[] descTimes = frameInfo.getFrameTimes();
if ((timeMatchBasis != null)
@ -394,17 +381,19 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
return descTimes;
}
// If the time match basis is not in this descriptor we should instead
// fall back on the first resource in this descriptor which has times
// for this frame. This concept was adopted from Frame::dataTime() in
// the A1 source.
/*
* If the time match basis is not in this descriptor we should instead
* fall back on the first resource in this descriptor which has times
* for this frame. This concept was adopted from Frame::dataTime() in
* the A1 source.
*/
DataTime[] times = new DataTime[frameInfo.getFrameCount()];
for (ResourcePair rp : descriptor.getResourceList()) {
DataTime[] rscTimes = frameTimesSource.get(rp.getResource());
if ((rscTimes == null) || (rscTimes.length != times.length)) {
if (rp.getResource() instanceof IResourceGroup) {
// Descend into resource groups.
/* Descend into resource groups. */
for (ResourcePair rp1 : ((IResourceGroup) rp.getResource())
.getResourceList()) {
rscTimes = frameTimesSource.get(rp1.getResource());
@ -437,32 +426,85 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
/**
* Attempts to find the frame times for a time match basis, if time match
* basis is not defined attempts to find a new time match basis. Returns
* null if no Time Match basis can be found.
*
* @param descriptor
* @param resourceList
* @return
* @throws VizException
* null if no Time Match basis can be found. This method will update the
* {@link #timeMatchBasisRef} if needed.
*/
private DataTime[] findBasisTimes(ResourceList resourceList,
int numberOfFrames) throws VizException {
if (timeMatchBasis != null) {
TimeCache timeCache = getTimeCache(timeMatchBasis);
DataTime[] times = null;
synchronized (timeCache) {
times = timeCache.getLastFrameTimes();
if ((times == null) || (timeCache.getLastBaseTimes() != null)
|| (timeCache.getLastFrameCount() != numberOfFrames)) {
times = makeEmptyLoadList(numberOfFrames, timeMatchBasis);
timeCache.setTimes(null, times, numberOfFrames);
private Pair<AbstractVizResource<?, ?>, DataTime[]> findBasisTimes(
IDescriptor descriptor) {
int numberOfFrames = descriptor.getNumberOfFrames();
AbstractVizResource<?, ?> timeMatchBasis = timeMatchBasisRef.get();
if (timeMatchBasis == null) {
Pair<AbstractVizResource<?, ?>, DataTime[]> pair = findNewBasis(
descriptor.getResourceList(), numberOfFrames);
if (pair != null) {
AbstractVizResource<?, ?> rsc = pair.getLeft();
configureBasis(rsc);
if (!timeMatchBasisRef.compareAndSet(null, rsc)) {
unconfigureBasis(rsc);
}
}
if (times != null) {
return times;
} else {
timeMatchBasis = null;
return pair;
}
IDescriptor tmDescriptor = timeMatchBasis.getDescriptor();
if ((tmDescriptor == descriptor)
&& !validateTimeMatchBasis(descriptor, timeMatchBasis)) {
changeTimeMatchBasis(null);
return findBasisTimes(descriptor);
}
if (tmDescriptor != null) {
if (tmDescriptor != descriptor
&& tmDescriptor.getTimeMatcher() == this
&& hasContainer(descriptor)) {
if (validateDescriptor(tmDescriptor)) {
redoTimeMatching(tmDescriptor);
} else {
changeTimeMatchBasis(null);
return findBasisTimes(descriptor);
}
} else if (contained(tmDescriptor, timeMatchBasis) == false) {
/* Checks to ensure the timeMatchBasis is not "orphaned" */
timeMatchBasisRef.compareAndSet(timeMatchBasis, null);
return findBasisTimes(descriptor);
}
}
TimeCache timeCache = getTimeCache(timeMatchBasis);
DataTime[] times = null;
synchronized (timeCache) {
times = timeCache.getLastFrameTimes();
if ((times == null) || (timeCache.getLastBaseTimes() != null)
|| (timeCache.getLastFrameCount() != numberOfFrames)) {
times = makeEmptyLoadList(numberOfFrames, timeMatchBasis);
timeCache.setTimes(null, times, numberOfFrames);
}
}
if (times != null) {
return new ImmutablePair<AbstractVizResource<?, ?>, DataTime[]>(
timeMatchBasis, times);
} else {
/*
* This might fail if another thread has assigned a basis while this
* method was looking for one. In this case the current operation
* will proceed with the wrong basis. Proceed anyway since the basis
* that was chosen would have been the correct basis when this
* method began. Whatever operation set the basis should have
* initiated redoTimeMatching which will run after this and assign
* times with the new basis.
*/
timeMatchBasisRef.compareAndSet(timeMatchBasis, null);
return findBasisTimes(descriptor);
}
}
/**
* Recursive operation to search for a resource that is able to be the time
* match basis. Returns the resource and the matched times for that
* resource. If no resources is able to be the timeMatchBasis then null is
* returned. This method does not actually change {@link #timeMatchBasisRef}
* .
*/
public Pair<AbstractVizResource<?, ?>, DataTime[]> findNewBasis(
ResourceList resourceList, int numberOfFrames) {
Iterator<ResourcePair> pairIterator = resourceList.iterator();
while (pairIterator.hasNext()) {
ResourcePair pair = pairIterator.next();
@ -476,13 +518,12 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
}
if (rsc.getResourceData() instanceof IResourceGroup) {
DataTime[] times = findBasisTimes(
((IResourceGroup) rsc.getResourceData())
.getResourceList(),
numberOfFrames);
IResourceGroup group = (IResourceGroup) rsc.getResourceData();
Pair<AbstractVizResource<?, ?>, DataTime[]> resultPair = findNewBasis(
group.getResourceList(), numberOfFrames);
if (times != null) {
return times;
if (resultPair != null) {
return resultPair;
}
} else {
DataTime[] times = makeEmptyLoadList(numberOfFrames, rsc);
@ -491,7 +532,8 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
synchronized (cache) {
cache.setTimes(null, times, numberOfFrames);
}
return times;
return new ImmutablePair<AbstractVizResource<?, ?>, DataTime[]>(
rsc, times);
}
}
}
@ -499,21 +541,11 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
}
/**
* Make an empty load list for a resource, if this is successful the
* resource will be defined as the time match basis
*
* @param descriptor
* @param rsc
* @return
* @throws VizException
* Make an empty load list for a resource. Only a time match basis should
* use this method for getting matched times.
*/
private DataTime[] makeEmptyLoadList(int numberOfFrames,
AbstractVizResource<?, ?> rsc) throws VizException {
if ((timeMatchBasis != null) && (rsc != timeMatchBasis)) {
throw new IllegalArgumentException(
"Cannot make Empty Load List for a resource which is not the Time Match Basis.");
}
AbstractVizResource<?, ?> rsc) {
TimeMatchingConfiguration config = getConfiguration(
rsc.getLoadProperties()).clone();
if ((config.getDataTimes() == null)
@ -531,19 +563,14 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
if ((timeSteps == null) || (timeSteps.length == 0)) {
return null;
}
changeTimeMatchBasis(rsc);
return timeSteps;
}
/**
* Remove unused times from a resource and add in any new times.
*
* @param rsc
* @param timeSteps
* @throws VizException
*/
private void timeMatchUpdate(AbstractVizResource<?, ?> rsc,
DataTime[] timeSteps) throws VizException {
DataTime[] timeSteps) {
if (rsc.getResourceData() instanceof IResourceGroup) {
for (ResourcePair tmp : ((IResourceGroup) rsc.getResourceData())
@ -562,9 +589,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
/**
* Find the Time Matching Configuration for this resource. If one can't be
* found, return an empty configuration.
*
* @param properties
* @return
*/
private TimeMatchingConfiguration getConfiguration(LoadProperties properties) {
if (properties == null) {
@ -582,6 +606,11 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
return new TimeMatchingConfiguration();
}
/**
* Thread safe access to {@link #timeCacheMap}. If the map has no entry for
* this resource then a new {@link TimeCache} is created, added to the map,
* and returned.
*/
private TimeCache getTimeCache(AbstractVizResource<?, ?> resource) {
synchronized (timeCacheMap) {
TimeCache cache = timeCacheMap.get(resource);
@ -596,8 +625,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
/**
* Populates all unset fields of the configuration with defaults except
* dataTimes, dataTimes should be set before calling this function.
*
* @param config
*/
private void populateConfiguration(TimeMatchingConfiguration config) {
Arrays.sort(config.getDataTimes());
@ -626,29 +653,33 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
}
/**
* Retrieves the latest times from a time sequence resource
* Retrieves the latest times from a resource
*
* If the resource is also requestable, we check the catalog for the latest
* product times.
* If the resource data is an {@link AbstractRequestableResourceData} then
* this will query for the available times.
*
* @param rsc
* @param timeSteps
* @return
* @throws VizException
*/
protected DataTime[] getLatestTimes(AbstractVizResource<?, ?> rsc,
DataTime[] timeSteps) throws VizException {
DataTime[] timeSteps) {
DataTime[] availableTimes = null;
// If resource is handling requests itself, just return the datatimes
// listed in the resource
/*
* If resource is handling requests itself, just return the datatimes
* listed in the resource
*/
AbstractResourceData resourceData = rsc.getResourceData();
if (resourceData instanceof AbstractRequestableResourceData) {
AbstractRequestableResourceData req = (AbstractRequestableResourceData) resourceData;
if (req.isRequeryNecessaryOnTimeMatch()
|| (rsc.getDataTimes() == null)
|| (rsc.getDataTimes().length == 0)) {
availableTimes = req.getAvailableTimes();
try {
availableTimes = req.getAvailableTimes();
} catch (VizException e) {
statusHandler
.error("Unable to query times for "
+ rsc.getSafeName(), e);
}
}
}
@ -662,7 +693,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
/**
* Prunes data that is no longer used by calling
* AbstractVizResource.remove(DataTime).
* {@link AbstractVizResource#remove(DataTime)}
*
* @param rsc
* the resource to prune
@ -715,10 +746,9 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
* available dataTimes
* @param resource
* the resource to update
* @throws VizException
*/
private void updateResourceWithLatest(DataTime[] dataTimes,
AbstractVizResource<?, ?> resource) throws VizException {
AbstractVizResource<?, ?> resource) {
Validate.notNull(resource, "Resource must not be null");
if (resource.getResourceData() == null) {
return;
@ -735,10 +765,16 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
* place to break things.
*/
Arrays.sort(dt, new DataTimeComparator());
PluginDataObject[] pdo = arrd.getLatestPluginDataObjects(dataTimes,
dt);
if (pdo.length > 0) {
resource.getResourceData().update(pdo);
try {
PluginDataObject[] pdo = arrd.getLatestPluginDataObjects(
dataTimes, dt);
if (pdo.length > 0) {
resource.getResourceData().update(pdo);
}
} catch (VizException e) {
statusHandler.error(
"Unable to update data for " + resource.getSafeName(),
e);
}
}
@ -747,40 +783,40 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
@Override
public void handleRemove(AbstractVizResource<?, ?> resource,
IDescriptor descriptor) {
if ((resource == timeMatchBasis)
&& (descriptor instanceof AbstractDescriptor)) {
synchronized (this) {
timeMatchBasis = null;
}
}
timeMatchBasisRef.compareAndSet(resource, null);
synchronized (timeCacheMap) {
timeCacheMap.remove(resource);
}
}
/**
* @return the loadMode
*/
public LoadMode getLoadMode() {
return loadMode;
}
/**
* @param loadMode
* the loadMode to set
*/
public void setLoadMode(LoadMode loadMode) {
this.loadMode = loadMode;
}
/**
* Attempt to match the provided availableTimes against the current state of
* the time matcher. This can be used while loading a resource to determine
* if any matching times are possible and for preloading any data for those
* times.
*
* This method is also responsible for using the
* AbstractTimeMatchingConfigurationFactory for this matcher to configure
* the time match settings. The final times the resource displays may change
* if other resources are being loaded concurrently. When a resource is done
* loading {@link #redoTimeMatching(IDescriptor)} must be used to properly
* add the resource to the {@link FramesInfo} of the {@link IDescriptor}.
*/
@Override
public DataTime[] initialLoad(LoadProperties loadProps,
DataTime[] availableTimes, IDescriptor descriptor)
throws VizException {
DataTime[] dataTimesToLoad = null;
TimeMatchingConfiguration config = null;
AbstractVizResource<?, ?> timeMatchBasis = timeMatchBasisRef.get();
if (timeMatchBasis == null) {
config = configFactory.getConfiguration(loadProps, this,
availableTimes, descriptor);
@ -810,8 +846,8 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
}
populateConfiguration(config);
DataTime[] existingDataTimes = getFrameTimes(descriptor,
descriptor.getFramesInfo(), descriptor.getFramesInfo()
.getTimeMap());
timeMatchBasis, descriptor.getFramesInfo(), descriptor
.getFramesInfo().getTimeMap());
TimeMatcher tm = new TimeMatcher();
dataTimesToLoad = tm.makeOverlayList(config.getDataTimes(),
@ -821,7 +857,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
if ((timeMatchBasis.getDescriptor() != null)
&& (timeMatchBasis.getDescriptor() != descriptor)) {
// Still use my times, but the index from the time match basis
/* Still use my times, but the index from the time match basis */
FramesInfo myFi = descriptor.getFramesInfo();
FramesInfo tmFi = timeMatchBasis.getDescriptor()
.getFramesInfo();
@ -836,90 +872,77 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
/**
* Changes the time match basis for the time matcher to be the specified
* resource
*
* @param resource
*/
public void changeTimeMatchBasis(AbstractVizResource<?, ?> resource) {
if (timeMatchBasis != resource) {
if (timeMatchBasis != null) {
TimeMatchingConfiguration config = getConfiguration(timeMatchBasis
.getLoadProperties());
config.setTimeMatchBasis(false);
TimeCache timeCache = getTimeCache(timeMatchBasis);
synchronized (timeCache) {
timeCache.setTimes(null, null);
}
timeMatchBasis
.unregisterListener(timeMatchBasisDisposeListener);
}
timeMatchBasis = resource;
if (timeMatchBasis != null) {
TimeMatchingConfiguration config = getConfiguration(timeMatchBasis
.getLoadProperties());
config.setTimeMatchBasis(true);
TimeCache timeCache = getTimeCache(timeMatchBasis);
synchronized (timeCache) {
timeCache.setTimes(null, null);
}
timeMatchBasis.registerListener(timeMatchBasisDisposeListener);
}
if (resource != null) {
configureBasis(resource);
}
AbstractVizResource<?, ?> prev = timeMatchBasisRef.getAndSet(resource);
if (prev != null) {
unconfigureBasis(prev);
}
}
/**
* Returns the time match basis for the D2DTimeMatcher
*
* @return
* Used to setup the {@link TimeMatchingConfiguration} and
* {@link #timeMatchBasisDisposeListener} for a new timeMatchBasis. This
* should be used before modifying the {@link TimeMatchBasisRef}.
*/
public AbstractVizResource<?, ?> getTimeMatchBasis() {
return timeMatchBasis;
}
public boolean hasTimeMatchBasis() {
return (timeMatchBasis != null);
private void configureBasis(AbstractVizResource<?, ?> newBasis) {
TimeMatchingConfiguration config = getConfiguration(newBasis
.getLoadProperties());
config.setTimeMatchBasis(true);
TimeCache timeCache = getTimeCache(newBasis);
synchronized (timeCache) {
timeCache.setTimes(null, null);
}
newBasis.registerListener(timeMatchBasisDisposeListener);
}
/**
* @return the clockFilter
* Used to revert the {@link TimeMatchingConfiguration} and
* {@link #timeMatchBasisDisposeListener} when a timeMatchBasis is removed.
* This should be used after modifying the {@link TimeMatchBasisRef}.
*/
private void unconfigureBasis(AbstractVizResource<?, ?> oldBasis) {
TimeMatchingConfiguration config = getConfiguration(oldBasis
.getLoadProperties());
config.setTimeMatchBasis(false);
TimeCache timeCache = getTimeCache(oldBasis);
synchronized (timeCache) {
timeCache.setTimes(null, null);
}
oldBasis.unregisterListener(timeMatchBasisDisposeListener);
}
public AbstractVizResource<?, ?> getTimeMatchBasis() {
return timeMatchBasisRef.get();
}
public boolean hasTimeMatchBasis() {
return (timeMatchBasisRef.get() != null);
}
public Date getClockFilter() {
return clockFilter;
}
/**
* @return the forecastFilter
*/
public long getForecastFilter() {
return forecastFilter;
}
/**
* @return the deltaFilter
*/
public long getDeltaFilter() {
return deltaFilter;
}
/**
* @return the isTimeOptionsSelected
*/
public boolean isTimeOptionsSelected() {
return isTimeOptionsSelected;
}
/**
* @param isTimeOptionsSelected
* the isTimeOptionsSelected to set
*/
public void setTimeOptionsSelected(boolean isTimeOptionsSelected) {
this.isTimeOptionsSelected = isTimeOptionsSelected;
}
/**
* @return the dataTimeDialogManager
*/
public AbstractTimeMatchingConfigurationFactory getTimeMatchingConfigurationFactory() {
return configFactory;
}
@ -927,7 +950,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
@Override
public List<AbstractRenderableDisplay> getDisplayLoadOrder(
List<AbstractRenderableDisplay> displays) {
// if any of the displays have a set time match basis then load it first
/* if any of the displays have a set time match basis then load it first */
AbstractRenderableDisplay basisDisplay = null;
for (AbstractRenderableDisplay display : displays) {
if (getBasisResourcePair(display.getDescriptor().getResourceList()) != null) {
@ -947,8 +970,10 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
@Override
public List<ResourcePair> getResourceLoadOrder(List<ResourcePair> resources) {
// if any of the resources are set as the time match basis then load it
// first
/*
* if any of the resources are set as the time match basis then load it
* first
*/
ResourcePair basisPair = getBasisResourcePair(resources);
if (basisPair != null) {
List<ResourcePair> results = new ArrayList<ResourcePair>(resources);
@ -979,7 +1004,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
public void copyFrom(AbstractTimeMatcher timeMatcher) {
if (timeMatcher instanceof D2DTimeMatcher) {
D2DTimeMatcher d2d = (D2DTimeMatcher) timeMatcher;
if (timeMatchBasis == null) {
if (timeMatchBasisRef.get() == null) {
this.clockFilter = d2d.clockFilter;
this.forecastFilter = d2d.forecastFilter;
this.deltaFilter = d2d.deltaFilter;
@ -994,7 +1019,8 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
configFactory.resetMultiload();
}
private boolean validateTimeMatchBasis(IDescriptor descriptor) {
private static boolean validateTimeMatchBasis(IDescriptor descriptor,
AbstractVizResource<?, ?> timeMatchBasis) {
/*
* If a resource is shared by multiple panels (this can be the case with
* tools, at least), then it is necessary to search all of them as
@ -1010,18 +1036,21 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
IDescriptor paneDescriptor = paneDisplay != null ? paneDisplay
.getDescriptor() : null;
if ((paneDescriptor != null)
&& validateTimeMatchBasis(paneDescriptor
.getResourceList())) {
&& validateTimeMatchBasis(
paneDescriptor.getResourceList(),
timeMatchBasis)) {
return true;
}
}
} else {
return validateTimeMatchBasis(descriptor.getResourceList());
return validateTimeMatchBasis(descriptor.getResourceList(),
timeMatchBasis);
}
return false;
}
private boolean validateTimeMatchBasis(ResourceList list) {
private static boolean validateTimeMatchBasis(ResourceList list,
AbstractVizResource<?, ?> timeMatchBasis) {
for (ResourcePair rp : list) {
AbstractVizResource<?, ?> rsc = rp.getResource();
if (rsc == timeMatchBasis) {
@ -1031,8 +1060,9 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
continue;
} else if ((rsc != null)
&& (rsc.getResourceData() instanceof IResourceGroup)) {
if (validateTimeMatchBasis(((IResourceGroup) rsc
.getResourceData()).getResourceList())) {
IResourceGroup group = (IResourceGroup) rsc.getResourceData();
if (validateTimeMatchBasis(group.getResourceList(),
timeMatchBasis)) {
return true;
}
}
@ -1045,7 +1075,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
return display.getContainer() != null;
}
private boolean validateDescriptor(IDescriptor descriptor) {
private static boolean validateDescriptor(IDescriptor descriptor) {
IRenderableDisplay display = descriptor.getRenderableDisplay();
IDisplayPaneContainer container = display != null ? display
.getContainer() : null;
@ -1054,8 +1084,9 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
IRenderableDisplay paneDisplay = pane.getRenderableDisplay();
IDescriptor paneDescriptor = paneDisplay != null ? paneDisplay
.getDescriptor() : null;
if (paneDescriptor == descriptor)
if (paneDescriptor == descriptor) {
return true;
}
}
}
return false;

View file

@ -31,7 +31,7 @@
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Bethel, AK (PABE)" id="raobRarotonga"
menuText="Bethel, AK (PABE)" id="raobBethel_AK"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="70219"/>
</contribute>
@ -86,7 +86,7 @@
<substitute key="stationId" value="70133"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="St. Paul Island, AK (PASN)" id="raobSTPaulIsland_AK"
menuText="St. Paul Island, AK (PASN)" id="raobStPaulIsland_AK"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="70308"/>
</contribute>

View file

@ -77,13 +77,13 @@
<substitute key="stationId" value="78970"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Howard AFB, PM (MPHO)" id="raobHowardAFB_PM "
menuText="Howard AFB, PM (MPHO)" id="raobHowardAFB_PM"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="78806"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Guantanamo Bay, CU (MUGM)" id="raobPortland_ME"
menuText="Guantanamo Bay, CU (MUGM)" id="raobGuantanamoBay_CU"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="78367"/>
</contribute>
@ -108,12 +108,12 @@
<substitute key="stationId" value="81405"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Le Ralset, Guadeloupe (TFFR)" id="LeRalset_Guadeloupe"
menuText="Le Ralset, Guadeloupe (TFFR)" id="raobLeRalset_Guadeloupe"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="78897"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="San Juan, PR (TJSJ)" id="raobWashington_DC"
menuText="San Juan, PR (TJSJ)" id="raobSanJuan_PR"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="78526"/>
</contribute>

View file

@ -20,7 +20,7 @@
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Willis Island (94299)" id="raobWillis Island"
menuText="Willis Island (94299)" id="raobWillisIsland"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="94299"/>
</contribute>
@ -155,7 +155,7 @@
<substitute key="stationId" value="94750"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Sydney Arpt (YSSY)" id="raobSydney Arpt"
menuText="Sydney Arpt (YSSY)" id="raobSydneyArpt"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="94767"/>
</contribute>

View file

@ -70,7 +70,7 @@
<substitute key="stationId" value="71907"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Yarmouth, NS (CYQI)" id="raobAtlanta_GA"
menuText="Yarmouth, NS (CYQI)" id="raobYarmouth_NS"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="71603"/>
</contribute>
@ -95,7 +95,7 @@
<substitute key="stationId" value="71801"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Toronto Int'l, ON (CYYZ)" id="raobTorontoIntl_ON "
menuText="Toronto Int'l, ON (CYYZ)" id="raobTorontoIntl_ON"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="71624"/>
</contribute>

View file

@ -158,7 +158,7 @@
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Ishigakijima (ROIG)" id="raobIshigakijima "
menuText="Ishigakijima (ROIG)" id="raobIshigakijima"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="47918"/>
</contribute>
@ -168,7 +168,7 @@
<substitute key="stationId" value="47945"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Clark AFB (RPMK)" id="raobClearkAFB"
menuText="Clark AFB (RPMK)" id="raobClarkAFB"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="98327"/>
</contribute>

View file

@ -30,12 +30,12 @@
<substitute key="stationId" value="76840"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Ciudad Del Carmen, MX (MCME)" id="raobCiudadDelCarmen_MX "
menuText="Ciudad Del Carmen, MX (MCME)" id="raobCiudadDelCarmen_MX"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="76749"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Ciudad Victoria, MX (MCVM)" id="raobCiudadVictoria_MX "
menuText="Ciudad Victoria, MX (MCVM)" id="raobCiudadVictoria_MX"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="76225"/>
</contribute>
@ -45,7 +45,7 @@
<substitute key="stationId" value="76649"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Isle of Guadalupe, MX (MILS)" id="raobIsleofGuadalupe_MX "
menuText="Isle of Guadalupe, MX (MILS)" id="raobIsleofGuadalupe_MX"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="76151"/>
</contribute>
@ -70,12 +70,12 @@
<substitute key="stationId" value="76361"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Chihuahua, MX (MMCU)" id="raobChihuahua_MX "
menuText="Chihuahua, MX (MMCU)" id="raobChihuahua_MX"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="76225"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Mexico/Central, MX (MMDF)" id="raobCentral, MX"
menuText="Mexico/Central, MX (MMDF)" id="raobCentral_MX"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="76679"/>
</contribute>

View file

@ -81,7 +81,7 @@
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Midway Island (Navy) (PMDY)" id="raobPortland_ME"
menuText="Midway Island (Navy) (PMDY)" id="raobMidwayIs"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="91066"/>
</contribute>

View file

@ -25,7 +25,7 @@
<substitute key="stationId" value="99027"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Honiara (AGGH)" id="raobHonlara"
menuText="Honiara (AGGH)" id="raobHoniara"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="91517"/>
</contribute>
@ -72,12 +72,12 @@
<substitute key="stationId" value="91592"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Guam/Taguac, GU (PGAC)" id="raobTaguac_GU "
menuText="Guam/Taguac, GU (PGAC)" id="raobTaguac_GU"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="91217"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Guam/Anderson AFB, GU (PGUA)" id="raobAndersonAFB_GU "
menuText="Guam/Anderson AFB, GU (PGUA)" id="raobAndersonAFB_GU"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="91218"/>
</contribute>
@ -122,7 +122,7 @@
<substitute key="stationId" value="91413"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Wake Island (PWAK)" id="raobWake Island"
menuText="Wake Island (PWAK)" id="raobWakeIsland"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="91245"/>
</contribute>

View file

@ -20,7 +20,7 @@
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Mys Uzlen (25399)" id="raobMys Uzlen"
menuText="Mys Uzlen (25399)" id="raobMysUzlen"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="25399"/>
</contribute>
@ -135,12 +135,12 @@
<substitute key="stationId" value="21824"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Anadyr' (UHMA)" id="raobnadyr'"
menuText="Anadyr (UHMA)" id="raobAnadyr"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="25563"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Bukhta Provideniya (UHMD)" id="raobBukhta Provideniya"
menuText="Bukhta Provideniya (UHMD)" id="raobBukhtaProvideniya"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="25594"/>
</contribute>

View file

@ -65,7 +65,7 @@
<substitute key="stationId" value="72364"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Fort Worth, TX (KFWD)" id="raobFortWorth_TX "
menuText="Fort Worth, TX (KFWD)" id="raobFortWorth_TX"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="72249"/>
</contribute>
@ -100,7 +100,7 @@
<substitute key="stationId" value="72340"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Midland, TX (KMAF)" id="raobSanNicholasIsland_CA"
menuText="Midland, TX (KMAF)" id="raobMidland_TX"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="72265"/>
</contribute>
@ -115,7 +115,7 @@
<substitute key="stationId" value="72558"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Oklahoma City, OK (KOUN)" id="raobOklahomaCity_OK "
menuText="Oklahoma City, OK (KOUN)" id="raobOklahomaCity_OK"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="72357"/>
</contribute>

View file

@ -165,7 +165,7 @@
<substitute key="stationId" value="72221"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Wallops Island, VA (KWAL)" id="raobWallopsIsland_VA "
menuText="Wallops Island, VA (KWAL)" id="raobWallopsIsland_VA"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="72402"/>
</contribute>

View file

@ -35,12 +35,12 @@
<substitute key="stationId" value="74004"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Yuma PG Site 2, AZ (K1Y8)" id="raobYuma_AZ"
menuText="Yuma PG Site 2, AZ (K1Y8)" id="raobYumaPgSite2_AZ"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="74005"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Yuma PG Site 3, AZ (K1Y9)" id="raobYuma_AZ"
menuText="Yuma PG Site 3, AZ (K1Y9)" id="raobYumaPgSite3_AZ"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="74006"/>
</contribute>
@ -65,7 +65,7 @@
<substitute key="stationId" value="72387"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Edwards AFB, CA (KEDW)" id="raobEdwardsAFB_CA "
menuText="Edwards AFB, CA (KEDW)" id="raobEdwardsAFB_CA"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="72381"/>
</contribute>
@ -130,7 +130,7 @@
<substitute key="stationId" value="74626"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Reno, NV (KREV)" id="raobReno_NV "
menuText="Reno, NV (KREV)" id="raobReno_NV"
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
<substitute key="stationId" value="72489"/>
</contribute>

View file

@ -45,6 +45,11 @@
<constraint constraintValue="A" constraintType="EQUALS" />
</mapping>
</metadataMap>
<timeQueryMetadataMap>
<mapping key="pluginName">
<constraint constraintValue="svrwx" constraintType="EQUALS" />
</mapping>
</timeQueryMetadataMap>
</resourceData>
</resource>
<resource>
@ -69,6 +74,11 @@
<constraint constraintValue="W" constraintType="EQUALS" />
</mapping>
</metadataMap>
<timeQueryMetadataMap>
<mapping key="pluginName">
<constraint constraintValue="svrwx" constraintType="EQUALS" />
</mapping>
</timeQueryMetadataMap>
</resourceData>
</resource>
<resource>
@ -93,6 +103,11 @@
<constraint constraintValue="T" constraintType="EQUALS" />
</mapping>
</metadataMap>
<timeQueryMetadataMap>
<mapping key="pluginName">
<constraint constraintValue="svrwx" constraintType="EQUALS" />
</mapping>
</timeQueryMetadataMap>
</resourceData>
</resource>
</descriptor>

View file

@ -28,12 +28,12 @@
</contribute>
<contribute xsi:type="bundleItem" file="bundles/TrackSummaryPlot.xml"
menuText="E Pacific" id="easternPacificTrackSummary">
<substitute key="productType" value="TCMEP1,TCMEP2,TCMEP3,TCMEP4,TCMEP5" />
<substitute key="productType" value="TCMEP1,TCMEP2,TCMEP3,TCMEP4,TCMEP5,TCMCP1,TCMCP2,TCMCP3,TCMCP4,TCMCP5" />
<substitute key="legend" value="E Pacific" />
</contribute>
<contribute xsi:type="bundleItem" file="bundles/TrackSummaryPlot.xml"
menuText="W Pacific" id="westernPacificTrackSummary">
<substitute key="productType" value="TCMWP1,TCMWP2,TCMWP3,TCMWP4,TCMWP5,TCP" />
<substitute key="productType" value="TCMCP1,TCMCP2,TCMCP3,TCMCP4,TCMCP5,TCMWP1,TCMWP2,TCMWP3,TCMWP4,TCMWP5,TCP" />
<substitute key="legend" value="W Pacific" />
</contribute>
<contribute xsi:type="subMenu" menuText="Hourly Forecasts">

View file

@ -19,12 +19,4 @@
further_licensing_information.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="subMenu" menuText="Added Features">
<contribute xsi:type="subMenu" menuText="Archive">
<contribute xsi:type="placeholder" menuText=" "/>
</contribute>
<contribute xsi:type="subMenu" menuText="Composite">
<contribute xsi:type="placeholder" menuText=" "/>
</contribute>
</contribute>
</menuTemplate>

View file

@ -98,7 +98,6 @@
<substitute key="legend" value="Sfc Profiler"/>
</contribute>
</contribute>
<contribute xsi:type="placeholder"
menuText="NPN Perspective" id="npnPerspective"/>
<contribute xsi:type="separator" id="npnPerspective"/>
<contribute xsi:type="separator" id="MySeparatorId1"/>
</menuTemplate>

View file

@ -168,6 +168,5 @@
<substitute key="label" value="925mb"/>
</contribute>
</contribute>
<contribute xsi:type="placeholder" menuText="VWP perspective"/>
<contribute xsi:type="separator" id="MySeparatorId2"/>
</menuTemplate>

View file

@ -268,14 +268,42 @@
definitionId="com.raytheon.uf.viz.d2d.ui.inD2DActionSet">
</reference>
</visibleWhen>
<separator
name="tools.start"
visible="false">
</separator>
<separator
name="D2D.Tools.Additions"
visible="false">
</separator>
<separator name="tools.A" visible="false" />
<separator name="tools.B" visible="false" />
<separator name="tools.C" visible="false" />
<separator name="tools.Da" visible="false" />
<separator name="tools.Di" visible="false" />
<separator name="tools.E" visible="false" />
<separator name="tools.Fa" visible="false" />
<separator name="tools.Fe" visible="false" />
<separator name="tools.Fs" visible="false" />
<separator name="tools.G" visible="false" />
<separator name="tools.H" visible="false" />
<separator name="tools.I" visible="false" />
<separator name="tools.J" visible="false" />
<separator name="tools.K" visible="false" />
<separator name="tools.L" visible="false" />
<separator name="tools.M" visible="false" />
<separator name="tools.N" visible="false" />
<separator name="tools.O" visible="false" />
<separator name="tools.Pa" visible="false" />
<separator name="tools.Pg" visible="false" />
<separator name="tools.Po" visible="false" />
<separator name="tools.Pu" visible="false" />
<separator name="tools.Q" visible="false" />
<separator name="tools.Raa" visible="false" />
<separator name="tools.Rad" visible="false" />
<separator name="tools.Ran" visible="false" />
<separator name="tools.S" visible="false" />
<separator name="tools.Ta" visible="false" />
<separator name="tools.Te" visible="false" />
<separator name="tools.Ti" visible="false" />
<separator name="tools.U" visible="false" />
<separator name="tools.V" visible="false" />
<separator name="tools.W" visible="false" />
<separator name="tools.X" visible="false" />
<separator name="tools.Y" visible="false" />
<separator name="tools.Z" visible="false" />
</menu>
<menu
id="volume"

View file

@ -24,9 +24,9 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.handlers.HandlerUtil;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
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;
@ -36,22 +36,22 @@ import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg;
import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg.Mode;
/**
* DeleteAWIPSProcedure
*
* Delete an AWIPS procedure
*
* <pre>
*
* SOFTWARE HISTORY
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 13, 2007 chammack Initial Creation.
* Jul 8, 2008 #1183 chammack Migrate to new localization
* Oct 16, 2012 #1229 rferrel Changes for non-blocking VizLocalizationFileListDlg.
* Jun 02, 2015 #4401 bkowal Updated to use {@link VizLocalizationFileListDlg}.
* Jun 30, 2015 #4401 bkowal Specify the localization type when constructing a
* {@link VizLocalizationFileListDlg}.
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 13, 2007 chammack Initial Creation.
* Jul 8, 2008 #1183 chammack Migrate to new localization
* Oct 16, 2012 #1229 rferrel Changes for non-blocking VizLocalizationFileListDlg.
* Jun 02, 2015 #4401 bkowal Updated to use {@link VizLocalizationFileListDlg}.
* Jun 30, 2015 #4401 bkowal Specify the localization type when constructing a
* {@link VizLocalizationFileListDlg}.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
* </pre>
*
@ -64,13 +64,6 @@ public class DeleteAWIPSProcedure extends AbstractHandler {
private VizLocalizationFileListDlg listDlg;
/*
* (non-Javadoc)
*
* @see
* org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands
* .ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (listDlg == null || listDlg.getShell() == null
@ -83,15 +76,15 @@ public class DeleteAWIPSProcedure extends AbstractHandler {
@Override
public void dialogClosed(Object returnValue) {
if (returnValue instanceof LocalizationFile) {
LocalizationFile selectedFile = (LocalizationFile) returnValue;
if (returnValue instanceof ILocalizationFile) {
ILocalizationFile selectedFile = (ILocalizationFile) returnValue;
try {
selectedFile.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(
Priority.PROBLEM,
"Error deleting procedure: "
+ selectedFile.getName());
+ selectedFile.getPath());
}
}
}

View file

@ -39,7 +39,9 @@ import com.raytheon.viz.ui.actions.AbstractGlobalsButtonHandler;
* Jul 23, 2007 randerso Initial Creation.
* Sep 4, 2012 15335 kshresth Will now display lightning/wind
* fields when magnification set to 0
* &#064;author randerso
* Nov 05, 2015 5070 randerso Removed override of 0.0 magnification
*
* @author randerso
*
*/
public class MagButtonHandler extends AbstractGlobalsButtonHandler implements
@ -53,7 +55,6 @@ public class MagButtonHandler extends AbstractGlobalsButtonHandler implements
protected void updateGlobalValue(IWorkbenchWindow changedWindow,
UIElement element, Object value) {
Double mag = (Double) value;
if (mag <= 0.1) mag=0.0;
element.setText("Mag: " + mag);
}
}

View file

@ -49,6 +49,7 @@ import com.raytheon.viz.ui.EditorUtil;
* Jul 19, 2007 randerso Initial Creation.
* Sep 4, 2012 15335 kshresth Will now display lightning/wind
* fields when magnification set to 0
* Nov 05, 2015 5070 randerso Removed override of 0.0 magnification
*
* </pre>
*
@ -73,8 +74,6 @@ public class MagHandler extends AbstractHandler implements IElementUpdater {
double magnification = Double.parseDouble((arg0
.getParameter("magnification")));
if (editor != null) {
if (magnification == 0.0f)
magnification = 0.1;
IDisplayPane[] panes = editor.getDisplayPanes();
for (IDisplayPane pane : panes) {
IRenderableDisplay disp = pane.getRenderableDisplay();

View file

@ -36,7 +36,6 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureDlg;
import com.raytheon.viz.ui.VizWorkbenchManager;
import com.raytheon.viz.ui.actions.LoadPerspectiveHandler;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg;
import com.raytheon.viz.ui.dialogs.localization.VizOpenLocalizationFileListDlg;
/**
@ -56,6 +55,7 @@ import com.raytheon.viz.ui.dialogs.localization.VizOpenLocalizationFileListDlg;
* Jun 02, 2015 #4401 bkowal Updated to use {@link VizOpenLocalizationFileListDlg}.
* Jun 30, 2015 #4401 bkowal Specify the localization type when constructing a
* {@link VizOpenLocalizationFileListDlg}.
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
* </pre>
*
* @author chammack
@ -68,13 +68,6 @@ public class OpenAWIPSProcedure extends AbstractHandler {
private static final IUFStatusHandler log = UFStatus
.getHandler(OpenAWIPSProcedure.class);
/*
* (non-Javadoc)
*
* @see
* org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands
* .ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
@ -95,7 +88,7 @@ public class OpenAWIPSProcedure extends AbstractHandler {
log.info("Loading display file: "
+ f.getAbsolutePath());
ProcedureDlg.displayDialog(LocalizationUtil
.extractName(selectedFile.getName()), p,
.extractName(selectedFile.getPath()), p,
VizWorkbenchManager.getInstance()
.getCurrentWindow().getShell());
}

View file

@ -34,9 +34,9 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
@ -59,9 +59,10 @@ import com.raytheon.viz.ui.dialogs.colordialog.IColorBarAction;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 13, 2010 mschenke Initial creation
* Sep 13, 2010 mschenke Initial creation
* Oct 16, 2012 1229 rferrel Updated to use bringToTop to
* activate existing dialog.
* Jan 15, 2015 5054 randerso Remove unnecessary new Shell
*
* </pre>
*
@ -110,8 +111,10 @@ public class ImageBlinkDialog extends CaveSWTDialog implements
D2DMapRenderableDisplay[] displays) {
ImageBlinkDialog dlg = dialogMap.get(resource);
if (dlg == null || dlg.getShell() == null || dlg.isDisposed()) {
dlg = new ImageBlinkDialog(new Shell(Display.getCurrent()), rates,
currRate, resource, rscProps, displays);
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
dlg = new ImageBlinkDialog(shell, rates, currRate, resource,
rscProps, displays);
dialogMap.put(resource, dlg);
dlg.open();
} else {

View file

@ -27,8 +27,7 @@ import java.awt.image.ComponentColorModel;
import java.awt.image.IndexColorModel;
import java.awt.image.WritableRaster;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@ -63,12 +62,13 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.localization.ILocalizationFile;
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.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.viz.core.IDisplayPane;
@ -85,7 +85,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.editor.AbstractEditor;
/**
* TODO Add Description
* Class representing a print dialog with various print settings.
*
* <pre>
*
@ -94,12 +94,12 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 15, 2011 bkowal Initial creation
* ======================================
* AWIPS2 DR Work
* 08/15/2012 1053 jkorman Added capability to save/restore user
* print settings.
* 10/12/2012 1229 rferrel Made dialog non-blocking.
* 12/09/2014 ASM #11982 D. Friedman Fix print-to-file
* 01/11/2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
*
* </pre>
*
@ -651,8 +651,8 @@ public class PrintDialog extends CaveSWTDialog {
} else if (this.fileRadioButton.getSelection()) {
printerSettings.selectedPrinter = this.printToFileData;
printerSettings.selectedPrinter.printToFile = true;
printerSettings.selectedPrinter.fileName =
this.destinationFileText.getText();
printerSettings.selectedPrinter.fileName = this.destinationFileText
.getText();
}
printerSettings.selectedPrinter.copyCount = this.copiesSpinner
.getSelection();
@ -910,25 +910,15 @@ public class PrintDialog extends CaveSWTDialog {
LocalizationContext ctx = initUserLocalization();
// Get a list of localization files!
LocalizationFile f = PathManagerFactory.getPathManager()
ILocalizationFile f = PathManagerFactory.getPathManager()
.getLocalizationFile(ctx, SETTINGS_FILENAME);
OutputStream strm = null;
try {
strm = f.openOutputStream();
try (SaveableOutputStream strm = f.openOutputStream()) {
JAXB.marshal(settings, strm);
// Ensure that the file is saved on the server!
f.save();
strm.save();
} catch (Exception e) {
statusHandler.error("Could not save user print settings", e);
} finally {
if (f != null) {
try {
strm.close();
} catch (IOException ioe) {
statusHandler.error("Could not close user print settings",
ioe);
}
}
}
}
@ -940,15 +930,15 @@ public class PrintDialog extends CaveSWTDialog {
LocalizationContext ctx = initUserLocalization();
// Get a list of localization files!
LocalizationFile f = PathManagerFactory.getPathManager()
ILocalizationFile f = PathManagerFactory.getPathManager()
.getLocalizationFile(ctx, SETTINGS_FILENAME);
// If its not there, no previous settings have been saved. Just exit.
if (f.exists()) {
UserPrintSettings settings = null;
try {
try (InputStream strm = f.openInputStream()) {
settings = (UserPrintSettings) JAXB.unmarshal(
f.openInputStream(), UserPrintSettings.class);
settings = (UserPrintSettings) JAXB.unmarshal(strm,
UserPrintSettings.class);
} catch (Exception e) {
statusHandler.error(

View file

@ -20,7 +20,6 @@
package com.raytheon.uf.viz.d2d.ui.dialogs.procedures;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@ -56,17 +55,17 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.localization.ILocalizationFile;
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.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
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.common.time.DataTime;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.viz.core.DescriptorMap;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.drawables.AbstractDescriptor;
@ -118,6 +117,7 @@ import com.raytheon.viz.ui.views.PartAdapter2;
* Mar 12, 2015 4204 njensen Ensure renamed bundle goes into tab name on next load
* Apr 08, 2015 4185 mapeters Disable Copy In when not applicable for active editor
* Jun 02, 2015 4401 bkowal Updated to use {@link VizLocalizationFileListDlg}.
* Feb 12, 2016 5242 dgilling Remove calls to deprecated Localization APIs.
*
* </pre>
*
@ -358,14 +358,6 @@ public class ProcedureDlg extends CaveSWTDialog {
ProcedureComm.getInstance().addCopyOutStateListener(changeListener);
final ProcedureComm.ICopyOutListener copyOutListener = new ProcedureComm.ICopyOutListener() {
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.procedure.ProcedureComm.ICopyOutListener
* #copyOut(com.raytheon.viz.ui.dialogs.procedure.ProcedureComm.
* BundlePair, java.lang.Object)
*/
@Override
public void copyOut(BundlePair b, Object src) {
if (src != thisDlg) {
@ -438,14 +430,6 @@ public class ProcedureDlg extends CaveSWTDialog {
private void saveProcedure(boolean closeAfterSave) {
try {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext context = pm.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
LocalizationFile localizationFile = pm.getLocalizationFile(context,
PROCEDURES_DIR + File.separator + fileName);
Procedure procedure = new Procedure();
BundlePair[] bp = bundles.toArray(new BundlePair[bundles.size()]);
Bundle[] bundlesToSave = new Bundle[bp.length];
@ -472,17 +456,26 @@ public class ProcedureDlg extends CaveSWTDialog {
}
procedure.setBundles(bundlesToSave);
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext context = pm.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
ILocalizationFile localizationFile = pm
.getLocalizationFile(context, PROCEDURES_DIR
+ IPathManager.SEPARATOR + fileName);
String procedureXML = procedure.toXML();
FileUtil.bytes2File(procedureXML.getBytes(),
localizationFile.getFile());
localizationFile.save();
try (SaveableOutputStream outStream = localizationFile
.openOutputStream()) {
outStream.write(procedureXML.getBytes());
outStream.save();
}
shell.setText("Procedure - " + fileName);
saved = true;
saveBtn.setEnabled(false);
if (closeAfterSave)
if (closeAfterSave) {
close();
}
} catch (Exception e) {
final String errMsg = "Error occurred during procedure save.";
statusHandler.handle(Priority.PROBLEM, errMsg, e);

View file

@ -72,30 +72,31 @@ import com.raytheon.viz.ui.panes.PaneManager;
import com.vividsolutions.jts.geom.Coordinate;
/**
* The side view for "docking" maps
* The side view for "docking" displays.
*
* <pre>
*
* SOFTWARE HISTORY
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/1/06 chammack Initial Creation.
* Dec 19, 2007 njensen Support for different tab types.
* Jul 8, 2009 #830 bgonzale use pane manager instead of managing own panes.
* Oct 22, 2009 #3348 bsteffen limit number of frames in sidepane rather than reseting
* Jul 1, 2010 #6146 bkowal Updates the legend mode so that smaller panes will
* now include a legend
* Nov 20, 2012 DR 15524 M.Porricelli Changed so interactive screens still editable when
* swapped to side panel
* Mar 21, 2013 1638 mschenke Changed map scales not tied to d2d
* Aug 9, 2013 DR 16427 D. Friedman Swap additional input handlers.
* Oct 10, 2013 #2104 mschenke Switched to use MapScalesManager
* Jul 15, 2014 2954 njensen Updated init() for MapScalesManager change
* Aug 25, 2014 3467 mapeters Removed changing of editability from swapPanes().
* Mar 02, 2015 4204 njensen Support for swapping part names
* Apr 02, 2015 4204 njensen Fix 4-panel swap of renamed parts
* Sep 18, 2015 DR 17996 D. Friedman Clear editor pane's IRenderableDisplay before swap
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 01, 2006 chammack Initial Creation.
* Dec 19, 2007 njensen Support for different tab types.
* Jul 08, 2009 830 bgonzale use pane manager instead of managing own panes.
* Oct 22, 2009 334 bsteffen limit number of frames in sidepane rather than reseting
* Jul 01, 2010 6146 bkowal Updates the legend mode so that smaller panes will
* now include a legend
* Nov 20, 2012 DR 15524 M.Porricelli Changed so interactive screens still editable when
* swapped to side panel
* Mar 21, 2013 1638 mschenke Changed map scales not tied to d2d
* Aug 09, 2013 DR 16427 D. Friedman Swap additional input handlers.
* Oct 10, 2013 2104 mschenke Switched to use MapScalesManager
* Jul 15, 2014 2954 njensen Updated init() for MapScalesManager change
* Aug 25, 2014 3467 mapeters Removed changing of editability from swapPanes().
* Mar 02, 2015 4204 njensen Support for swapping part names
* Apr 02, 2015 4204 njensen Fix 4-panel swap of renamed parts
* Sep 18, 2015 DR 17996 D. Friedman Clear editor pane's IRenderableDisplay before swap
* Oct 21, 2015 5023 njensen Removed unnecessary setPartName()
*
* </pre>
*
@ -151,13 +152,6 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
}
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets
* .Composite)
*/
@Override
public void createPartControl(Composite parent) {
try {
@ -202,24 +196,12 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
int buttonDown = 0;
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.input.IInputHandler#handleMouseDown(int,
* int, int)
*/
@Override
public boolean handleMouseDown(int x, int y, int mouseButton) {
buttonDown = mouseButton;
return false;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.input.IInputHandler#handleMouseUp(int, int,
* int)
*/
@Override
public boolean handleMouseUp(int x, int y, int mouseButton) {
if (buttonDown == 3 && buttonDown == mouseButton) { // right click
@ -231,11 +213,6 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
}
};
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.IDisplayPaneContainer#getDisplayPanes()
*/
@Override
public IDisplayPane[] getDisplayPanes() {
if (this.paneManager == null) {
@ -245,43 +222,21 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.IDisplayPaneContainer#getLoopProperties()
*/
@Override
public LoopProperties getLoopProperties() {
return this.loopProperties;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.IDisplayPaneContainer#setLoopProperties(com.raytheon
* .viz.core.datastructure.LoopProperties)
*/
@Override
public void setLoopProperties(LoopProperties loopProperties) {
this.loopProperties = loopProperties;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.core.IDisplayPaneContainer#getActiveDisplayPane()
*/
@Override
public IDisplayPane getActiveDisplayPane() {
return paneManager.getActiveDisplayPane();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.core.IDisplayPaneContainer#refresh()
*/
@Override
public void refresh() {
paneManager.refresh();
@ -425,7 +380,10 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
IRenderableDisplay display = editorPanes[i]
.getRenderableDisplay();
boolean hide = editorHiddenDisplays.contains(display);
// TODO: See note above for the isCompatibleEditor condition.
/*
* TODO: See note above for the isCompatibleEditor
* condition.
*/
if (isCompatibleEditor) {
editorPanes[i].setRenderableDisplay(null);
}
@ -492,11 +450,6 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
}
}
}
/*
* have to set part name again here cause addPane() or
* removePane() may mess it up
*/
theEditor.setPartName(viewName);
} else {
int min = Math.min(viewPaneCount, editorPaneCount);
for (int i = 0; i < min; ++i) {
@ -626,24 +579,11 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.core.IDisplayPaneContainer#translateClick(double,
* double)
*/
@Override
public Coordinate translateClick(double x, double y) {
return paneManager.translateClick(x, y);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.IDisplayPaneContainer#translateInverseClick(
* com.vividsolutions.jts.geom.Coordinate)
*/
@Override
public double[] translateInverseClick(Coordinate c) {
return paneManager.translateInverseClick(c);
@ -703,68 +643,34 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
paneManager.showPane(pane);
}
/*
* (non-Javadoc)
*
* @seecom.raytheon.uf.viz.core.IDisplayPaneContainer#
* addRenderableDisplayChangedListener
* (com.raytheon.uf.viz.core.IRenderableDisplayChangedListener)
*/
@Override
public void addRenderableDisplayChangedListener(
IRenderableDisplayChangedListener displayChangedListener) {
// no op
}
/*
* (non-Javadoc)
*
* @seecom.raytheon.uf.viz.core.IDisplayPaneContainer#
* notifyRenderableDisplayChangedListeners
* (com.raytheon.uf.viz.core.IDisplayPane,
* com.raytheon.uf.viz.core.drawables.IRenderableDisplay)
*/
@Override
public void notifyRenderableDisplayChangedListeners(IDisplayPane pane,
IRenderableDisplay display, DisplayChangeType type) {
// no op
}
/*
* (non-Javadoc)
*
* @seecom.raytheon.uf.viz.core.IDisplayPaneContainer#
* removeRenderableDisplayChangedListener
* (com.raytheon.uf.viz.core.IRenderableDisplayChangedListener)
*/
@Override
public void removeRenderableDisplayChangedListener(
IRenderableDisplayChangedListener displayChangedListener) {
// no op
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.editor.IMultiPaneEditor#addSelectedPaneChangedListener
* (com.raytheon.viz.ui.editor.ISelectedPaneChangedListener)
*/
@Override
public void addSelectedPaneChangedListener(
ISelectedPanesChangedListener listener) {
// no op
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.editor.IMultiPaneEditor#removeSelectedPaneChangedListener
* (com.raytheon.viz.ui.editor.ISelectedPaneChangedListener)
*/
@Override
public void removeSelectedPaneChangedListener(
ISelectedPanesChangedListener listener) {
// no op
}
@Override
@ -783,26 +689,11 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
paneManager.unregisterMouseHandler(handler);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.editor.IMultiPaneEditor#getSelectedPanes(java.lang
* .String)
*/
@Override
public IDisplayPane[] getSelectedPanes(String action) {
return paneManager.getSelectedPanes(action);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.color.IBackgroundColorChangedListener#setColor(com
* .raytheon.viz.ui.color.IBackgroundColorChangedListener.BGColorMode,
* org.eclipse.swt.graphics.RGB)
*/
@Override
public void setColor(BGColorMode mode, RGB newColor) {
for (IDisplayPane pane : getDisplayPanes()) {

View file

@ -21,14 +21,11 @@ package com.raytheon.uf.viz.d2d.ui.map.actions;
import java.util.List;
import org.eclipse.ui.part.EditorPart;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.d2d.core.ID2DRenderableDisplay;
import com.raytheon.uf.viz.d2d.core.legend.D2DLegendResource;
import com.raytheon.uf.viz.d2d.core.legend.D2DLegendResource.LegendMode;
import com.raytheon.viz.ui.IRenameablePart;
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
@ -43,12 +40,13 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
*
* <pre>
*
* SOFTWARE HISTORY
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 19, 2009 bgonzale Initial Creation.
* Apr 07, 2015 4204 njensen Keep part name if renamed
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 19, 2009 bgonzale Initial Creation.
* Apr 07, 2015 4204 njensen Keep part name if renamed
* Oct 21, 2015 5023 njensen Removed unnecessary part name code (undid previous change)
*
* </pre>
*
@ -64,11 +62,6 @@ public class FourPanelLayoutMenuAction extends AbstractRightClickAction {
super("Four Panel Layout");
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
if (getContainer() instanceof IMultiPaneEditor == false
@ -79,14 +72,6 @@ public class FourPanelLayoutMenuAction extends AbstractRightClickAction {
IRenderableDisplay definiteDisplay = getContainer().getDisplayPanes()[0]
.getRenderableDisplay();
String partName = null;
if (editor instanceof EditorPart) {
EditorPart part = (EditorPart) editor;
if (!part.getPartName().equals(part.getEditorInput().getName())) {
partName = part.getPartName();
}
}
if (editor.getNumberofPanes() > 1) {
for (IDisplayPane pane : getContainer().getDisplayPanes()) {
editor.showPane(pane);
@ -97,11 +82,6 @@ public class FourPanelLayoutMenuAction extends AbstractRightClickAction {
}
}
// keep the part name if it was customized
if (partName != null && editor instanceof IRenameablePart) {
((IRenameablePart) editor).setPartName(partName);
}
for (IDisplayPane pane : editor.getDisplayPanes()) {
List<D2DLegendResource> rscs = pane.getDescriptor()
.getResourceList()

View file

@ -18,15 +18,8 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<pluginDataObjectFilter>
<filterElements xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="rectFilterElement">
<!-- Exclude all southern hemisphere data. -->
<filterElementName>Exclude SouthernHemisphere</filterElementName>
<filterType>EXCLUDE</filterType>
<upperLeftLat>-0.1</upperLeftLat>
<upperLeftLon>-180.0</upperLeftLon>
<lowerRightLat>-90.0</lowerRightLat>
<lowerRightLon>180.0</lowerRightLon>
</filterElements>
<filterName>Point.QuikScat</filterName>
</pluginDataObjectFilter>
<menuContributionFile>
<include installTo="menu:tools?after=tools.Da"
fileName="menus/tools/damagepath-menu.xml">
</include>
</menuContributionFile>

View file

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<?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.
@ -18,15 +18,10 @@
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<pointDataDescription>
<!-- Time in seconds. To use in Java - multiply by 1000 -->
<parameter name="validTime" numDims="1" type="LONG" />
<parameter name="latitude" numDims="1" type="FLOAT" unit="degree_N" />
<parameter name="longitude" numDims="1" type="FLOAT" unit="degree_E" />
<parameter name="satelliteID" numDims="1" type="INT" />
<parameter name="orbitNumber" numDims="1" type="INT" />
<parameter name="windDir" numDims="1" type="FLOAT" unit="degree" />
<parameter name="windSpd" numDims="1" type="FLOAT" unit="m/s" />
<parameter name="probRain" numDims="1" type="FLOAT" unit="%" />
<parameter name="rainIndex" numDims="1" type="INT" />
</pointDataDescription>
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/tools/DamagePath.xml"
menuText="Damage Path" id="damagePathTool" timeQuery="false" />
</menuTemplate>

View file

@ -43,6 +43,7 @@ import com.raytheon.uf.common.json.geo.GeoJsonMapUtil;
import com.raytheon.uf.common.json.geo.IGeoJsonService;
import com.raytheon.uf.common.json.geo.SimpleGeoJsonService;
import com.raytheon.uf.common.localization.FileUpdatedMessage;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
@ -89,6 +90,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Aug 05, 2015 4635 dgilling Default save location for damage path
* is now at SITE level.
* Aug 18, 2015 3806 njensen Use SaveableOutputStream to save
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
* </pre>
*
@ -133,7 +135,7 @@ public class DamagePathLayer<T extends DamagePathResourceData> extends
private final Job loadJob = new Job("Loading Damage Path") {
@Override
protected IStatus run(IProgressMonitor monitor) {
LocalizationFile prevFile = getValidDamagePathFile();
ILocalizationFile prevFile = getValidDamagePathFile();
if (prevFile != null) {
loadDamagePath(prevFile);
@ -154,7 +156,7 @@ public class DamagePathLayer<T extends DamagePathResourceData> extends
private final Job saveJob = new Job("Saving Damage Path") {
@Override
protected IStatus run(IProgressMonitor monitor) {
LocalizationFile file = getDamagePathFile();
ILocalizationFile file = getDamagePathFile();
saveDamagePath(file);
return Status.OK_STATUS;
}
@ -231,11 +233,11 @@ public class DamagePathLayer<T extends DamagePathResourceData> extends
* future release, remove this function and replace uses with
* getDamagePathFile.
*/
private LocalizationFile getValidDamagePathFile() {
private ILocalizationFile getValidDamagePathFile() {
LocalizationContext ctx = getContext();
LocalizationFile file = PathManagerFactory.getPathManager()
ILocalizationFile file = PathManagerFactory.getPathManager()
.getLocalizationFile(ctx, PATH);
LocalizationFile oldFile = PathManagerFactory.getPathManager()
ILocalizationFile oldFile = PathManagerFactory.getPathManager()
.getLocalizationFile(ctx, OLD_PATH);
if (file.exists()) {
return file;
@ -249,14 +251,14 @@ public class DamagePathLayer<T extends DamagePathResourceData> extends
@Override
public void fileUpdated(FileUpdatedMessage message) {
if (message.getFileName().equals(PATH)) {
LocalizationFile file = getDamagePathFile();
ILocalizationFile file = getDamagePathFile();
if (file.exists()) {
loadDamagePath(file);
}
}
}
protected void loadDamagePath(LocalizationFile file) {
protected void loadDamagePath(ILocalizationFile file) {
try {
DamagePathLoader loader = new DamagePathLoader(file);
Collection<Pair<Polygon, Map<String, String>>> newData = loader
@ -279,11 +281,11 @@ public class DamagePathLayer<T extends DamagePathResourceData> extends
}
} catch (Exception e) {
statusHandler.error(
"Error loading damage path file " + file.getName(), e);
"Error loading damage path file " + file.getPath(), e);
}
}
protected void saveDamagePath(LocalizationFile file) {
protected void saveDamagePath(ILocalizationFile file) {
try (SaveableOutputStream sos = file.openOutputStream()) {
IGeoJsonService json = new SimpleGeoJsonService();
SimpleFeatureCollection featureCollection = buildFeatureCollection();
@ -291,7 +293,7 @@ public class DamagePathLayer<T extends DamagePathResourceData> extends
sos.save();
} catch (Throwable t) {
statusHandler.error(
"Error saving damage path file " + file.getName(), t);
"Error saving damage path file " + file.getPath(), t);
}
}

View file

@ -40,7 +40,7 @@ import com.raytheon.uf.common.json.JsonException;
import com.raytheon.uf.common.json.geo.GeoJsonMapUtil;
import com.raytheon.uf.common.json.geo.IGeoJsonService;
import com.raytheon.uf.common.json.geo.SimpleGeoJsonService;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.util.Pair;
import com.vividsolutions.jts.geom.Geometry;
@ -63,6 +63,7 @@ import com.vividsolutions.jts.geom.Polygon;
* 15.1 version of damage path tool.
* Jul 01, 2015 #4375 dgilling Remove isValid check to imported
* polygons.
* Jan 11, 2016 #5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
* </pre>
*
@ -76,7 +77,7 @@ public final class DamagePathLoader {
private final Collection<Pair<Polygon, Map<String, String>>> damagePathData;
public DamagePathLoader(LocalizationFile locFile)
public DamagePathLoader(ILocalizationFile locFile)
throws LocalizationException, IOException, JsonException {
this(locFile, null);
}
@ -86,8 +87,9 @@ public final class DamagePathLoader {
this(null, Paths.get(filePath));
}
private DamagePathLoader(LocalizationFile locFileSource, Path realFileSource)
throws LocalizationException, IOException, JsonException {
private DamagePathLoader(ILocalizationFile locFileSource,
Path realFileSource) throws LocalizationException, IOException,
JsonException {
this.damagePathData = new ArrayList<>();
if (locFileSource != null) {
@ -101,7 +103,7 @@ public final class DamagePathLoader {
return damagePathData;
}
private void loadFromLocalizationFile(final LocalizationFile locFile)
private void loadFromLocalizationFile(final ILocalizationFile locFile)
throws LocalizationException, IOException, JsonException {
try (InputStream is = locFile.openInputStream()) {
loadFromInputStream(is);

View file

@ -63,13 +63,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.dataplugin.bufrquikscat"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.dataplugin.bufrsigwx"
download-size="0"

View file

@ -19,8 +19,6 @@
**/
package com.raytheon.uf.viz.derivparam.ui.dialogs;
import java.io.File;
import com.raytheon.uf.common.derivparam.library.DerivedParameterGenerator;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
@ -28,10 +26,10 @@ 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.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
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.common.util.FileUtil;
import com.raytheon.uf.viz.localization.LocalizationPerspectiveUtils;
import com.raytheon.uf.viz.localization.service.ILocalizationService;
import com.raytheon.viz.ui.dialogs.CaveSWTWizard;
@ -47,6 +45,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTWizard;
* ------------ ---------- ----------- --------------------------
* Dec 16, 2010 mschenke Initial creation
* Sep 17, 2013 2285 mschenke Fixed serialization of DerivParamDesc
* Feb 12, 2016 5242 dgilling Remove calls to deprecated Localization APIs.
*
* </pre>
*
@ -74,23 +73,6 @@ public class DerivedParamWizard extends CaveSWTWizard {
addPage(newFunctionPage);
}
/*
* Max, I took this out but itwill go away with the SWT Wizard stuff.
*/
// @Override
// public void createPageControls(Composite pageContainer) {
// pageContainer.setLayout(new GridLayout(1, false));
// pageContainer.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true,
// false));
// super.createPageControls(pageContainer);
// }
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
@Override
public boolean performFinish() {
IPathManager pm = PathManagerFactory.getPathManager();
@ -102,15 +84,11 @@ public class DerivedParamWizard extends CaveSWTWizard {
String fileName = newFunctionPage.getFunctionName() + "."
+ newFunctionPage.getSelectedFunctionType().getExtension();
String path = DerivedParameterGenerator.FUNCTIONS_DIR
+ File.separator + fileName;
+ IPathManager.SEPARATOR + fileName;
LocalizationFile file = pm.getLocalizationFile(userCtx, path);
File f = file.getFile();
if (f.exists()) {
f.delete();
}
try {
FileUtil.bytes2File(functionContents.getBytes(), f);
file.save();
try (SaveableOutputStream outStream = file.openOutputStream()) {
outStream.write(functionContents.getBytes());
outStream.save();
functionFile = file;
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
@ -123,13 +101,9 @@ public class DerivedParamWizard extends CaveSWTWizard {
String path = DerivedParameterGenerator.XML_DIR
+ IPathManager.SEPARATOR + fileName;
LocalizationFile file = pm.getLocalizationFile(userCtx, path);
File f = file.getFile();
if (f.exists()) {
f.delete();
}
try {
FileUtil.bytes2File(definitionContents.getBytes(), f);
file.save();
try (SaveableOutputStream outStream = file.openOutputStream()) {
outStream.write(functionContents.getBytes());
outStream.save();
definitionFile = file;
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),

View file

@ -414,6 +414,13 @@
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.commons.lang3"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.units"
download-size="0"

View file

@ -127,6 +127,7 @@ import com.vividsolutions.jts.geom.Point;
* Aug 14, 2014 #3523 mapeters Updated deprecated DrawableString.textStyle assignments.
* Aug 21, 2014 #3459 randerso Restructured Map resource class hierarchy
* Nov 18, 2014 #3549 njensen Improved performance of processRequest()
* Nov 05, 2015 #5070 randerso Moved label font management up to AbstractMapResource
*
* </pre>
*
@ -427,7 +428,8 @@ public class DataStoreResource extends
DrawableString ds = new DrawableString(label,
null);
ds.font = req.getResource().font;
ds.font = req.getResource().getFont(
req.getTarget());
Rectangle2D rect = req.getTarget()
.getStringsBounds(ds);
@ -1113,8 +1115,9 @@ public class DataStoreResource extends
}
@Override
protected void paintInternal(IGraphicsTarget aTarget,
protected void paintInternal(IGraphicsTarget target,
PaintProperties paintProps) throws VizException {
PixelExtent screenExtent = (PixelExtent) paintProps.getView()
.getExtent();
@ -1148,12 +1151,6 @@ public class DataStoreResource extends
double labelMagnification = getCapability(MagnificationCapability.class)
.getMagnification();
if (font == null) {
font = aTarget.initializeFont(aTarget.getDefaultFont()
.getFontName(), (float) (10 * labelMagnification), null);
font.setSmoothing(false);
}
String shadingField = getCapability(ShadeableCapability.class)
.getShadingField();
boolean isShaded = isPolygonal() && (shadingField != null);
@ -1189,7 +1186,7 @@ public class DataStoreResource extends
boolean highlightsOnly = updateHighlights && !updateLabels
&& !updateShading && !updateExtent;
queryJob.queueRequest(new Request(aTarget, this, boundingGeom,
queryJob.queueRequest(new Request(target, this, boundingGeom,
geomField, labelField, shadingField, colorMap,
isProduct, highlightsOnly));
lastExtent = expandedExtent;
@ -1210,12 +1207,12 @@ public class DataStoreResource extends
&& shadedShape.isDrawable()) {
float opacity = getCapability(ShadeableCapability.class)
.getOpacity();
aTarget.drawShadedShape(shadedShape, alpha * opacity);
target.drawShadedShape(shadedShape, alpha * opacity);
}
if ((outlineShape != null) && outlineShape.isDrawable()
&& getCapability(OutlineCapability.class).isOutlineOn()) {
aTarget.drawWireframeShape(outlineShape,
target.drawWireframeShape(outlineShape,
getCapability(ColorableCapability.class).getColor(),
getCapability(OutlineCapability.class).getOutlineWidth(),
getCapability(OutlineCapability.class).getLineStyle(),
@ -1227,18 +1224,18 @@ public class DataStoreResource extends
if ((highlightShape != null) && highlightShape.isDrawable()
&& getCapability(OutlineCapability.class).isOutlineOn()) {
aTarget.drawWireframeShape(highlightShape, highlightColor,
target.drawWireframeShape(highlightShape, highlightColor,
highlightWidth, highlightStyle);
}
if ((labels != null) && isLabeled && (labelMagnification != 0)) {
drawLabels(aTarget, paintProps, worldToScreenRatio);
drawLabels(target, paintProps, worldToScreenRatio);
}
if (rubberBandExtent != null) {
aTarget.drawShadedRect(rubberBandExtent, RUBBER_BAND_COLOR, 0.5,
target.drawShadedRect(rubberBandExtent, RUBBER_BAND_COLOR, 0.5,
null);
aTarget.drawRect(rubberBandExtent, RUBBER_BAND_COLOR, 2, 1.0);
target.drawRect(rubberBandExtent, RUBBER_BAND_COLOR, 2, 1.0);
}
if (dragPromptCoord != null) {
@ -1249,7 +1246,7 @@ public class DataStoreResource extends
ds.addTextStyle(TextStyle.BOXED, new RGB(255, 255, 255));
ds.horizontalAlignment = HorizontalAlignment.LEFT;
ds.verticallAlignment = VerticalAlignment.BOTTOM;
aTarget.drawStrings(ds);
target.drawStrings(ds);
}
}
@ -1279,9 +1276,8 @@ public class DataStoreResource extends
highlightShape = result.highlightShape;
}
private void drawLabels(IGraphicsTarget aTarget,
PaintProperties paintProps, double worldToScreenRatio)
throws VizException {
private void drawLabels(IGraphicsTarget target, PaintProperties paintProps,
double worldToScreenRatio) throws VizException {
double offsetX = getCapability(LabelableCapability.class).getxOffset()
* worldToScreenRatio;
double offsetY = getCapability(LabelableCapability.class).getyOffset()
@ -1315,7 +1311,7 @@ public class DataStoreResource extends
DrawableString string = new DrawableString(node.label, color);
string.setCoordinates(node.location[0] + offsetX, node.location[1]
- offsetY);
string.font = font;
string.font = getFont(target);
string.horizontalAlignment = HorizontalAlignment.CENTER;
string.verticallAlignment = VerticalAlignment.MIDDLE;
boolean add = true;
@ -1347,7 +1343,7 @@ public class DataStoreResource extends
}
}
aTarget.drawStrings(strings);
target.drawStrings(strings);
}
/**
@ -1969,17 +1965,13 @@ public class DataStoreResource extends
@Override
public void resourceChanged(ChangeType type, Object object) {
super.resourceChanged(type, object);
if (type.equals(ChangeType.CAPABILITY)) {
if (object instanceof ColorableCapability) {
if (this.timeRange != null) {
// force rebuild of shaded shape to pick up color change
lastExtent = null;
}
} else if (object instanceof MagnificationCapability) {
if (font != null) {
font.dispose();
font = null;
}
}
}
issueRefresh();

View file

@ -71,6 +71,7 @@ import com.raytheon.viz.grid.rsc.general.D2DGridResource;
* May 5, 2014 3026 mpduff Initial creation
* Dec 16, 2014 3026 mpduff Change location of text
* Feb 13, 2015 4121 mpduff Change label caching.
* Nov 05, 2015 5070 randerso Adjust font sizes for dpi scaling
*
* </pre>
*
@ -164,7 +165,7 @@ public class HpeLabelResource extends
@Override
protected void initInternal(IGraphicsTarget target) throws VizException {
if (font == null) {
font = target.initializeFont("Dialog", 11, null);
font = target.initializeFont("Dialog", 9, null);
}
font.setMagnification(getCapability(MagnificationCapability.class)
.getMagnification().floatValue());

View file

@ -180,7 +180,7 @@ public class KmlExportDialog extends CaveSWTDialog {
protected void initializeFramesGroup(Group group) {
group.setLayout(new GridLayout(5, false));
group.setText("Export Location");
group.setText("Export Frames");
allFramesButton = new Button(group, SWT.RADIO);
allFramesButton.setText("All Frames");

View file

@ -31,9 +31,11 @@ import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPathEditorInput;
import org.eclipse.ui.IPersistableElement;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.LocalizationUtil;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -49,7 +51,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* ------------ ---------- ----------- --------------------------
* Nov 3, 2010 mschenke Initial creation
* Nov 27, 2013 mschenke Moved into localization.perspective project
* Feb 11, 2015 4108 randerso Implmented hashCode() and equals()
* Feb 11, 2015 4108 randerso Implmented hashCode() and equals()
* Jan 06, 2016 4834 nabowle add refreshLocalizationFile().
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
* </pre>
*
@ -85,10 +89,21 @@ public class LocalizationEditorInput implements IFileEditorInput,
public void setLocalizationFile(LocalizationFile localizationFile) {
this.localizationFile = localizationFile;
name = LocalizationUtil.extractName(localizationFile.getName());
name = LocalizationUtil.extractName(localizationFile.getPath());
file = null;
}
/**
* Refreshes the localizationFile reference.
*/
public void refreshLocalizationFile() {
IPathManager pathManager = PathManagerFactory.getPathManager();
LocalizationFile latestFile = pathManager.getLocalizationFile(
this.localizationFile.getContext(),
this.localizationFile.getPath());
this.localizationFile = latestFile;
}
/**
* @return the localizationFile
*/
@ -96,55 +111,30 @@ public class LocalizationEditorInput implements IFileEditorInput,
return localizationFile;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IEditorInput#exists()
*/
@Override
public boolean exists() {
return localizationFile.exists();
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IEditorInput#getImageDescriptor()
*/
@Override
public ImageDescriptor getImageDescriptor() {
return null;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IEditorInput#getName()
*/
@Override
public String getName() {
return name + " - "
+ localizationFile.getContext().getLocalizationLevel();
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IEditorInput#getPersistable()
*/
@Override
public IPersistableElement getPersistable() {
return this;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IEditorInput#getToolTipText()
*/
@Override
public String getToolTipText() {
String tip = localizationFile.getName();
String tip = localizationFile.getPath();
if (localizationFile.isProtected()) {
tip += " (Protected @ " + localizationFile.getProtectedLevel()
+ ")";
@ -152,32 +142,17 @@ public class LocalizationEditorInput implements IFileEditorInput,
return tip;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
return Platform.getAdapterManager().getAdapter(this, adapter);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IStorageEditorInput#getStorage()
*/
@Override
public IStorage getStorage() throws CoreException {
return getFile();
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IFileEditorInput#getFile()
*/
@Override
public IFile getFile() {
if (file.exists() == false) {
@ -192,25 +167,15 @@ public class LocalizationEditorInput implements IFileEditorInput,
return file;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IPathEditorInput#getPath()
*/
@Override
public IPath getPath() {
return getFile().getRawLocation();
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
*/
@Override
public void saveState(IMemento memento) {
LocalizationContext ctx = localizationFile.getContext();
memento.putString(FILE_NAME_ID, localizationFile.getName());
memento.putString(FILE_NAME_ID, localizationFile.getPath());
memento.putString(CONTEXT_NAME_ID, ctx.getContextName());
memento.putString(CONTEXT_TYPE_ID, ctx.getLocalizationType().name());
memento.putString(CONTEXT_LEVEL_ID, ctx.getLocalizationLevel().name());
@ -218,21 +183,11 @@ public class LocalizationEditorInput implements IFileEditorInput,
.toPortableString());
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IPersistableElement#getFactoryId()
*/
@Override
public String getFactoryId() {
return FACTORY_ID;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
@ -242,11 +197,6 @@ public class LocalizationEditorInput implements IFileEditorInput,
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {

View file

@ -30,7 +30,7 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -46,6 +46,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 27, 2013 mschenke Methods extracted from LocalizationPerspectiveUtils
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
* </pre>
*
@ -72,7 +73,7 @@ public class LocalizationEditorUtils {
if (reg == null) {
return new IEditorDescriptor[0];
}
return reg.getEditors(input.getLocalizationFile().getName());
return reg.getEditors(input.getLocalizationFile().getPath());
}
/**
@ -87,7 +88,7 @@ public class LocalizationEditorUtils {
if (reg == null) {
return null;
}
return reg.getDefaultEditor(input.getLocalizationFile().getName());
return reg.getDefaultEditor(input.getLocalizationFile().getPath());
}
/**
@ -118,7 +119,7 @@ public class LocalizationEditorUtils {
IEditorRegistry reg = getEditorRegistry();
if (reg != null) {
IEditorDescriptor desc = reg.getDefaultEditor(input
.getLocalizationFile().getName());
.getLocalizationFile().getPath());
String id = DEFAULT_TEXT_EDITOR;
if (desc != null) {
id = desc.getId();
@ -177,16 +178,16 @@ public class LocalizationEditorUtils {
* @return the open editor part or null if not being edited
*/
public static IEditorPart getEditorForFile(IWorkbenchPage page,
LocalizationFile file) {
ILocalizationFile file) {
for (IEditorReference ref : page.getEditorReferences()) {
IEditorPart part = ref.getEditor(false);
if (part != null) {
IEditorInput input = part.getEditorInput();
if (input instanceof LocalizationEditorInput) {
LocalizationFile editedFile = ((LocalizationEditorInput) input)
ILocalizationFile editedFile = ((LocalizationEditorInput) input)
.getLocalizationFile();
if (editedFile.getContext().equals(file.getContext())
&& editedFile.getName().equals(file.getName())) {
&& editedFile.getPath().equals(file.getPath())) {
return part;
}
}

View file

@ -43,6 +43,7 @@ import org.eclipse.ui.texteditor.IDocumentProvider;
import com.raytheon.uf.common.localization.FileUpdatedMessage;
import com.raytheon.uf.common.localization.FileUpdatedMessage.FileChangeType;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
@ -69,9 +70,10 @@ import com.raytheon.viz.ui.EditorUtil;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 24, 2011 mschenke Initial creation
* Aug 29, 2014 #3527 mapeters Check for active editor to not
* be null before calling isDirty().
* Mar 24, 2011 mschenke Initial creation
* Aug 29, 2014 #3527 mapeters Check for active editor to not
* be null before calling isDirty().
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
* </pre>
*
@ -166,7 +168,7 @@ public class LocalizationSaveAsPopulator extends CompoundContributionItem {
LocalizationLevel newLevel) {
LocalizationEditorInput input = (LocalizationEditorInput) editor
.getEditorInput();
LocalizationFile fileToSave = input.getLocalizationFile();
ILocalizationFile fileToSave = input.getLocalizationFile();
if (newLevel == fileToSave.getContext().getLocalizationLevel()) {
String myContext = LocalizationManager.getContextName(newLevel);
@ -183,7 +185,7 @@ public class LocalizationSaveAsPopulator extends CompoundContributionItem {
// get new level file
IPathManager pm = PathManagerFactory.getPathManager();
String name = fileToSave.getName();
String name = fileToSave.getPath();
LocalizationContext newCtx = pm.getContext(fileToSave.getContext()
.getLocalizationType(), newLevel);
final LocalizationFile newFile = pm.getLocalizationFile(newCtx, name);
@ -249,9 +251,9 @@ public class LocalizationSaveAsPopulator extends CompoundContributionItem {
private static void saveEditorAs(IEditorPart editor) {
LocalizationEditorInput input = (LocalizationEditorInput) editor
.getEditorInput();
LocalizationFile fileToSave = input.getLocalizationFile();
ILocalizationFile fileToSave = input.getLocalizationFile();
FileDialog fd = new FileDialog(editor.getSite().getShell(), SWT.SAVE);
fd.setFileName(LocalizationUtil.extractName(fileToSave.getName()));
fd.setFileName(LocalizationUtil.extractName(fileToSave.getPath()));
fd.setOverwrite(true);
fd.setFilterPath(System.getProperty("user.home"));

View file

@ -87,14 +87,15 @@ import org.eclipse.ui.part.ViewPart;
import com.raytheon.uf.common.localization.FileUpdatedMessage;
import com.raytheon.uf.common.localization.FileUpdatedMessage.FileChangeType;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.localization.ILocalizationPathObserver;
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.LocalizationNotificationObserver;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
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;
@ -142,7 +143,13 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
* Aug 24, 2015 4393 njensen Updates for observer changes
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
*
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
* Nov 18, 2015 4834 njensen Updated to register file observing on PathManager
* Dec 03, 2015 4834 njensen Updated for ILocalizationFile changes
* Jan 06, 2016 4834 nabowle Fix single-user edit-save-edit-save.
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
* Jan 15, 2016 5242 kbisanz Replaced LocalizationFile with
* ILocalizationFile where possible
*
* </pre>
*
@ -151,21 +158,22 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
*/
public class FileTreeView extends ViewPart implements IPartListener2,
ILocalizationService, IResourceChangeListener {
ILocalizationService, IResourceChangeListener,
ILocalizationPathObserver {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(FileTreeView.class);
private static class FileTreeFileComparator implements
Comparator<LocalizationFile> {
Comparator<ILocalizationFile> {
@Override
public int compare(LocalizationFile o1, LocalizationFile o2) {
public int compare(ILocalizationFile o1, ILocalizationFile o2) {
if (o1.isDirectory() && (o2.isDirectory() == false)) {
return 1;
} else if ((o1.isDirectory() == false) && o2.isDirectory()) {
return -1;
} else {
int nameVal = o1.getName().compareTo(o2.getName());
int nameVal = o1.getPath().compareTo(o2.getPath());
if (nameVal == 0) {
// exact same name, check levels
LocalizationLevel l1 = o1.getContext()
@ -206,11 +214,11 @@ public class FileTreeView extends ViewPart implements IPartListener2,
private class FileUpdateRefresher implements Runnable {
private final LocalizationFile file;
private final ILocalizationFile file;
private final FileChangeType type;
public FileUpdateRefresher(LocalizationFile file, FileChangeType type) {
public FileUpdateRefresher(ILocalizationFile file, FileChangeType type) {
this.file = file;
this.type = type;
}
@ -223,7 +231,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
for (TreeItem appItem : tree.getItems()) {
for (TreeItem rootItem : appItem.getItems()) {
TreeItem found = find(rootItem, file.getContext(),
file.getName(), false);
file.getPath(), false);
if (found != null) {
/*
* File found. If updated, set the time stamp to
@ -313,8 +321,9 @@ public class FileTreeView extends ViewPart implements IPartListener2,
waitCursor = display.getSystemCursor(SWT.CURSOR_WAIT);
site.getPage().addPartListener(this);
((LocalizationNotificationObserver) PathManagerFactory.getPathManager()
.getObserver()).addGlobalFileChangeObserver(this);
PathManagerFactory.getPathManager().addLocalizationPathObserver(
IPathManager.SEPARATOR, this);
ResourcesPlugin.getWorkspace().addResourceChangeListener(this,
IResourceChangeEvent.POST_CHANGE);
@ -341,9 +350,8 @@ public class FileTreeView extends ViewPart implements IPartListener2,
}
getSite().getPage().removePartListener(this);
((LocalizationNotificationObserver) PathManagerFactory.getPathManager()
.getObserver()).removeGlobalFileChangeObserver(this);
PathManagerFactory.getPathManager()
.removeLocalizationPathObserver(this);
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
}
@ -830,8 +838,8 @@ public class FileTreeView extends ViewPart implements IPartListener2,
}
}
final List<LocalizationFile> fileList = new ArrayList<LocalizationFile>();
final List<LocalizationFileEntryData> fileDataList = new ArrayList<LocalizationFileEntryData>();
final List<LocalizationFile> fileList = new ArrayList<>();
final List<LocalizationFileEntryData> fileDataList = new ArrayList<>();
// get list of files selected
if (selected.length > 0) {
// Open File(s) list
@ -871,7 +879,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
mgr.add(new CopyToAction(fileDataList.get(0), this));
mgr.add(new DeleteAction(getSite().getPage(), fileList
.toArray(new LocalizationFile[fileList.size()])));
.toArray(new LocalizationFile[0])));
mgr.add(new Separator());
} else if ((selected.length == 1)
@ -885,7 +893,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
.toArray(new LocalizationFile[fileList.size()])));
mgr.add(new Separator());
} else {
List<LocalizationFile> toDelete = new ArrayList<LocalizationFile>();
List<ILocalizationFile> toDelete = new ArrayList<>();
for (TreeItem item : selected) {
int prevSize = toDelete.size();
if (item.getData() instanceof FileTreeEntryData) {
@ -977,17 +985,18 @@ public class FileTreeView extends ViewPart implements IPartListener2,
}
/**
* Builds a list of {@link LocalizationFile}s starting at the item passed in
* Builds a list of {@link ILocalizationFile}s starting at the item passed
* in
*
* @param item
* @param files
* (option) list to add entries to
* @return list of files
*/
private List<LocalizationFile> buildFileList(TreeItem item,
List<LocalizationFile> files) {
private List<ILocalizationFile> buildFileList(TreeItem item,
List<ILocalizationFile> files) {
if (files == null) {
files = new ArrayList<LocalizationFile>();
files = new ArrayList<>();
}
FileTreeEntryData data = (FileTreeEntryData) item.getData();
@ -1088,7 +1097,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
IPathManager pathManager = PathManagerFactory.getPathManager();
boolean success = false;
List<LocalizationFile> currentList = new ArrayList<LocalizationFile>();
List<LocalizationFile> currentList = new ArrayList<>();
LocalizationFile[] files = pathManager.listFiles(
getTreeSearchContexts(types), path, filter, false, !recursive);
if (files == null) {
@ -1099,8 +1108,8 @@ public class FileTreeView extends ViewPart implements IPartListener2,
for (LocalizationFile file : files) {
if (checkName
&& (file.getName().isEmpty() || data.getPath().equals(
file.getName()))) {
&& (file.getPath().isEmpty() || data.getPath().equals(
file.getPath()))) {
continue;
}
if (file.exists()) {
@ -1176,11 +1185,11 @@ public class FileTreeView extends ViewPart implements IPartListener2,
FileTreeEntryData data = (FileTreeEntryData) parentItem.getData();
data.setRequestedChildren(true);
PathData pd = data.getPathData();
Map<String, List<LocalizationFile>> processedFiles = new HashMap<String, List<LocalizationFile>>();
Set<String> processedPaths = new HashSet<String>();
Map<String, List<LocalizationFile>> processedFiles = new HashMap<>();
Set<String> processedPaths = new HashSet<>();
// we are expanding a folder
for (LocalizationFile file : files) {
String name = file.getName();
String name = file.getPath();
if (processedPaths.contains(name) == false) {
FileTreeEntryData treeData = null;
if (file.isDirectory()) {
@ -1195,7 +1204,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
if (file.isDirectory() == false) {
List<LocalizationFile> entryFiles = processedFiles.get(name);
if (entryFiles == null) {
entryFiles = new ArrayList<LocalizationFile>();
entryFiles = new ArrayList<>();
processedFiles.put(name, entryFiles);
}
entryFiles.add(file);
@ -1226,7 +1235,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
PathData pd = fData.getPathData();
Set<LocalizationLevel> levels = new HashSet<>();
Set<LocalizationLevel> redundantLevels = new HashSet<>();
for (LocalizationFile file : files) {
for (ILocalizationFile file : files) {
LocalizationLevel level = file.getContext().getLocalizationLevel();
if (!levels.add(level)) {
redundantLevels.add(level);
@ -1283,7 +1292,7 @@ public class FileTreeView extends ViewPart implements IPartListener2,
*/
private TreeItem addTreeItem(TreeItem parentItem, FileTreeEntryData treeData) {
String name = treeData.getName();
LocalizationFile file = null;
ILocalizationFile file = null;
int idx = parentItem.getItemCount();
if (treeData instanceof LocalizationFileEntryData) {
LocalizationFileEntryData entryData = (LocalizationFileEntryData) treeData;
@ -1381,16 +1390,16 @@ public class FileTreeView extends ViewPart implements IPartListener2,
}
/**
* Get the image for the provided LocalizationFile.
* Get the image for the provided ILocalizationFile.
*
* @param file
* The LocalizationFile
* The ILocalizationFile
* @return The image
*/
private Image getImage(LocalizationFile file) {
private Image getImage(ILocalizationFile file) {
String name = null;
if (file != null) {
name = file.getName();
name = file.getPath();
}
return getImage(name);
}
@ -1422,9 +1431,9 @@ public class FileTreeView extends ViewPart implements IPartListener2,
}
}
private TreeItem find(LocalizationFile file, boolean populateToFind,
private TreeItem find(ILocalizationFile file, boolean populateToFind,
boolean nearestParent) {
return find(file.getName(), file.getContext(), populateToFind,
return find(file.getPath(), file.getContext(), populateToFind,
nearestParent);
}
@ -1569,12 +1578,19 @@ public class FileTreeView extends ViewPart implements IPartListener2,
&& (docDelta.getKind() == IResourceDelta.CHANGED)
&& ((docDelta.getFlags() & IResourceDelta.CONTENT) == IResourceDelta.CONTENT)) {
try {
LocalizationFile file = input.getLocalizationFile();
if (file.getContext().getLocalizationLevel()
.isSystemLevel() == false) {
input.getLocalizationFile().save();
ILocalizationFile file = input
.getLocalizationFile();
/*
* TODO can't easily replace the deprecated save()
* call because if we use openOutputStream() it will
* overwrite the file contents
*/
if (!file.getContext().getLocalizationLevel()
.isSystemLevel()
&& input.getLocalizationFile().save()) {
input.refreshLocalizationFile();
}
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(
Priority.PROBLEM,
"Error saving file: "
@ -1604,13 +1620,13 @@ public class FileTreeView extends ViewPart implements IPartListener2,
IPathManager pathManager = PathManagerFactory.getPathManager();
FileChangeType type = message.getChangeType();
LocalizationFile file = pathManager.getLocalizationFile(context,
ILocalizationFile file = pathManager.getLocalizationFile(context,
filePath);
if (file != null) {
if (((file.exists() == false) && ((type == FileChangeType.ADDED) || (type == FileChangeType.UPDATED)))
|| (file.exists() && (type == FileChangeType.DELETED))) {
System.out.println("Got weird state in update for " + file
System.err.println("Got weird state in update for " + file
+ ": exists=" + file.exists() + ", changeType="
+ message.getChangeType());
}
@ -1784,4 +1800,30 @@ public class FileTreeView extends ViewPart implements IPartListener2,
public boolean isShown(LocalizationLevel level) {
return showSet.contains(level);
}
@Override
public void fileChanged(ILocalizationFile file) {
/*
* TODO rewrite this whole method to not use fileUpdated() and correctly
* refresh/update nodes as necessary
*/
FileChangeType t = null;
if (ILocalizationFile.NON_EXISTENT_CHECKSUM.equals(file.getCheckSum())) {
t = FileChangeType.DELETED;
} else {
/*
* TODO We don't have the previous checksum available here so we
* can't easily identify this change as an add vs update. We need to
* handle this cleanly somehow.
*
* Temporary fix: Go with ADDED
*/
t = FileChangeType.ADDED;
}
FileUpdatedMessage fum = new FileUpdatedMessage(file.getContext(),
file.getPath(), t, file.getTimeStamp().getTime(),
file.getCheckSum());
fileUpdated(fum);
}
}

View file

@ -20,12 +20,9 @@
package com.raytheon.uf.viz.localization.perspective.view;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerDropAdapter;
import org.eclipse.swt.dnd.DND;
@ -35,23 +32,14 @@ import org.eclipse.swt.dnd.TransferData;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import com.raytheon.uf.common.localization.FileUpdatedMessage;
import com.raytheon.uf.common.localization.FileUpdatedMessage.FileChangeType;
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
import com.raytheon.uf.common.localization.IPathManager;
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.LocalizationUtil;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.msgs.ListResponseEntry;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.localization.filetreeview.FileTreeEntryData;
import com.raytheon.uf.viz.localization.filetreeview.LocalizationFileEntryData;
import com.raytheon.uf.viz.localization.filetreeview.LocalizationFileGroupData;
@ -69,7 +57,8 @@ import com.raytheon.uf.viz.localization.perspective.view.actions.ImportFileActio
* Jul 1, 2011 mschenke Initial creation
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
*
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
* Jan 11, 2016 5242 kbisanz Deleted unused dropLocalizationFile(...)
*
* </pre>
*
@ -120,7 +109,7 @@ public class LocalizationFileDragNDropSource extends ViewerDropAdapter
if (toDelete != null) {
try {
toDelete.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
UFStatus.getHandler().handle(Priority.PROBLEM,
"Error deleting old file", e);
}
@ -191,64 +180,6 @@ public class LocalizationFileDragNDropSource extends ViewerDropAdapter
return false;
}
private boolean dropLocalizationFile(FileTreeEntryData data,
ListResponseEntry toMoveData) {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationFile toMove = pm.getLocalizationFile(
toMoveData.getContext(), toMoveData.getFileName());
String fileName = LocalizationUtil.extractName(toMove.getName());
String newName = data.getPath() + File.separator + fileName;
LocalizationType type = toMove.getContext().getLocalizationType();
if (!data.getPathData().getTypes().contains(type)) {
type = data.getPathData().getTypes().get(0);
}
final LocalizationFile moveTo = pm.getLocalizationFile(pm.getContext(
type, toMoveData.getContext().getLocalizationLevel()), newName);
boolean move = true;
if (moveTo.exists()) {
move = MessageDialog.openQuestion(view.getSite().getShell(),
"Override File", "A file with the name '" + fileName
+ "' already exists in the '" + data.getName()
+ "' folder. Do you want to override it?");
}
if (move) {
final Runnable select = new Runnable() {
@Override
public void run() {
view.selectFile(moveTo);
}
};
// Make sure we select the file after the drop
if (moveTo.exists() == false) {
final ILocalizationFileObserver[] observers = new ILocalizationFileObserver[1];
ILocalizationFileObserver observer = new ILocalizationFileObserver() {
@Override
public void fileUpdated(FileUpdatedMessage message) {
if (message.getChangeType() != FileChangeType.DELETED) {
view.fileUpdated(message);
VizApp.runAsync(select);
}
moveTo.removeFileUpdatedObserver(observers[0]);
}
};
observers[0] = observer;
moveTo.addFileUpdatedObserver(observer);
} else {
VizApp.runAsync(select);
}
try (InputStream is = toMove.openInputStream();
SaveableOutputStream os = moveTo.openOutputStream()) {
FileUtil.copy(is, os);
os.save();
return true;
} catch (IOException | LocalizationException e) {
UFStatus.getHandler().handle(Priority.PROBLEM,
"Error copying file contents", e);
}
}
return false;
}
private boolean dropFile(List<LocalizationType> types, String dirPath,
File[] toCopyFiles) {
boolean oneGood = false;

View file

@ -41,7 +41,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 25, 2011 mschenke Initial creation
* Mar 25, 2011 mschenke Initial creation
*
* </pre>
*
@ -65,21 +65,11 @@ public abstract class AbstractToAction extends Action implements IMenuCreator {
return this;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
@Override
public void dispose() {
if (menu != null) {
@ -87,13 +77,6 @@ public abstract class AbstractToAction extends Action implements IMenuCreator {
}
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets
* .Menu)
*/
@Override
public Menu getMenu(Menu parent) {
if (menu != null) {

View file

@ -35,7 +35,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -57,6 +56,8 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
* Nov 3, 2010 mschenke Initial creation
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
* Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
* </pre>
*
@ -84,14 +85,6 @@ public class CopyToAction extends AbstractToAction {
this(data.getFile(), data.getPathData(), service);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.localization.perspective.view.actions.AbstractToAction
* #isLevelEnabled(com.raytheon.uf.common.localization.LocalizationContext.
* LocalizationLevel)
*/
@Override
protected boolean isLevelEnabled(LocalizationLevel level) {
boolean enabled = super.isLevelEnabled(level);
@ -102,21 +95,12 @@ public class CopyToAction extends AbstractToAction {
return enabled;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.localization.filetreeview.actions.AbstractToAction
* #run
* (com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
* )
*/
@Override
protected void run(LocalizationLevel level) {
IPathManager pm = PathManagerFactory.getPathManager();
ILocalizationFile newFile = pm.getLocalizationFile(
pm.getContext(file.getContext().getLocalizationType(), level),
file.getName());
file.getPath());
removeAlternateTypeFiles(level);
copyFile(newFile);
}
@ -133,12 +117,12 @@ public class CopyToAction extends AbstractToAction {
for (LocalizationType type : pathData.getTypes()) {
if (type != file.getContext().getLocalizationType()) {
LocalizationFile altFile = pm.getLocalizationFile(
pm.getContext(type, level), file.getName());
ILocalizationFile altFile = pm.getLocalizationFile(
pm.getContext(type, level), file.getPath());
if (altFile.exists()) {
try {
altFile.delete();
} catch (LocalizationOpFailedException e) {
} catch (LocalizationException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to delete existing " + type.name()
+ " " + level + " file.", e);

View file

@ -25,13 +25,14 @@ import java.util.List;
import java.util.Map;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@ -42,6 +43,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.localization.perspective.editor.LocalizationEditorInput;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.raytheon.viz.ui.dialogs.SWTMessageBox;
/**
* Deletes the selected localization file
@ -55,6 +58,10 @@ import com.raytheon.uf.viz.localization.perspective.editor.LocalizationEditorInp
* Nov 3, 2010 mschenke Initial creation
* Feb 18, 2015 4132 mapeters Fixed issue with deleting overrides.
* Jun 29, 2015 946 rferrel Do not allow delete of a protected level file.
* Nov 13, 2015 4946 mapeters Use SWTMessageBox instead of MessageDialog.
* Jan 15, 2016 5242 kbisanz Replaced LocalizationFile with
* ILocalizationFile where possible
* Jan 27, 2016 5054 randerso Cleaned up SWTMessageBox
*
* </pre>
*
@ -92,28 +99,50 @@ public class DeleteAction extends Action {
@Override
public void run() {
String listOfFiles = "";
StringBuilder listOfFiles = new StringBuilder();
for (int i = 0; i < toDelete.length; ++i) {
listOfFiles += LocalizationUtil.extractName(toDelete[i].getName())
+ "\n";
listOfFiles.append(LocalizationUtil.extractName(toDelete[i]
.getPath()));
listOfFiles.append("\n");
}
Shell shell = page.getWorkbenchWindow().getShell();
if (prompt) {
boolean choice = MessageDialog.openConfirm(
shell,
"Delete Confirmation",
listOfFiles
+ String.format(
"\n\nAre you sure you want to delete %s?",
toDelete.length > 1 ? "these items"
: "this file"));
if (!choice) {
return;
StringBuilder msg = new StringBuilder();
msg.append("Are you sure you want to delete ");
if (toDelete.length > 1) {
msg.append("these " + toDelete.length + " items");
} else {
msg.append("this file");
}
msg.append("?\n\n").append(listOfFiles);
SWTMessageBox messageDialog = new SWTMessageBox(shell,
"Delete Confirmation", msg.toString(), SWT.OK | SWT.CANCEL
| SWT.ICON_QUESTION);
messageDialog.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
if (returnValue instanceof Integer) {
if ((int) returnValue == SWT.OK) {
deleteFiles();
}
}
}
});
messageDialog.open();
}
List<IEditorReference> toClose = new ArrayList<IEditorReference>();
}
/**
* Delete the selected files and all associated file extension variations.
*/
private void deleteFiles() {
List<IEditorReference> toClose = new ArrayList<>();
// check for open editors and close them
for (IEditorReference ref : page.getEditorReferences()) {
IEditorInput input = null;
@ -125,10 +154,11 @@ public class DeleteAction extends Action {
+ "file was open (in order to close it)", e);
}
if (input instanceof LocalizationEditorInput) {
LocalizationFile editorFile = ((LocalizationEditorInput) input)
ILocalizationFile editorFile = ((LocalizationEditorInput) input)
.getLocalizationFile();
for (LocalizationFile file : toDelete) {
if ((editorFile.compareTo(file) == 0)
String editorFilePath = editorFile.getPath();
for (ILocalizationFile file : toDelete) {
if ((editorFilePath.equals(file.getPath()))
&& editorFile.getContext()
.equals(file.getContext())) {
toClose.add(ref);
@ -144,7 +174,7 @@ public class DeleteAction extends Action {
false);
}
for (LocalizationFile file : toDelete) {
for (ILocalizationFile file : toDelete) {
try {
deleteFile(file);
} catch (Exception e) {
@ -161,10 +191,10 @@ public class DeleteAction extends Action {
* The file to delete
* @throws Exception
*/
private void deleteFile(LocalizationFile file) throws Exception {
private void deleteFile(ILocalizationFile file) throws Exception {
if (file.isDirectory() == false) {
// Check for file extension
String name = LocalizationUtil.extractName(file.getName());
String name = LocalizationUtil.extractName(file.getPath());
String[] parts = name.split("[.]");
if (parts.length > 1) {
@ -174,11 +204,11 @@ public class DeleteAction extends Action {
if (associated != null) {
String[] extensions = associated.split(",");
String path = file.getName().substring(0,
file.getName().lastIndexOf(name));
String path = file.getPath().substring(0,
file.getPath().lastIndexOf(name));
String prefix = "";
for (int i = 0; i < parts.length - 1; ++i) {
for (int i = 0; i < (parts.length - 1); ++i) {
if (i > 0) {
prefix += ".";
}
@ -193,7 +223,7 @@ public class DeleteAction extends Action {
for (String extension : extensions) {
String deletePath = path + "." + extension;
LocalizationFile result = pathManager
ILocalizationFile result = pathManager
.getLocalizationFile(ctx, deletePath);
if (result != null) {
result.delete();

View file

@ -57,6 +57,7 @@ import com.raytheon.viz.ui.VizWorkbenchManager;
* Jun 11, 2015 4541 skorolev Added NULL test for lf.
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
* Dec 03, 2015 4834 njensen Updated for ILocalizationFile changes
*
* </pre>
*
@ -88,8 +89,7 @@ public class ImportFileAction extends Action {
}
public ImportFileAction(List<LocalizationType> contextTypes,
String directoryPath,
String[] filter) {
String directoryPath, String[] filter) {
this(contextTypes, directoryPath);
if (filter != null) {
this.fileExtensionFilterArr = new String[filter.length];
@ -182,7 +182,7 @@ public class ImportFileAction extends Action {
ILocalizationFile file = existing.get(0);
if (MessageDialog.openConfirm(VizWorkbenchManager.getInstance()
.getCurrentWindow().getShell(), "Confirm Overwrite",
String.format(FORMAT_STRING, file.getName(), file
String.format(FORMAT_STRING, file.getPath(), file
.getContext().getLocalizationLevel()))) {
existing.clear();
}
@ -288,7 +288,7 @@ public class ImportFileAction extends Action {
private void updateText() {
ILocalizationFile file = existingFiles.get(curIdx);
messageLabel.setText(String.format(FORMAT_STRING, file.getName(),
messageLabel.setText(String.format(FORMAT_STRING, file.getPath(),
file.getContext().getLocalizationLevel()));
}

View file

@ -50,6 +50,7 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
* Mar 25, 2011 mschenke Initial creation
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
*
* </pre>
@ -80,14 +81,6 @@ public class MoveFileAction extends CopyToAction {
setEnabled(delete.isEnabled());
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.localization.perspective.view.actions.AbstractToAction
* #isLevelEnabled(com.raytheon.uf.common.localization.LocalizationContext.
* LocalizationLevel)
*/
@Override
protected boolean isLevelEnabled(LocalizationLevel level) {
boolean enabled = super.isLevelEnabled(level);
@ -105,7 +98,7 @@ public class MoveFileAction extends CopyToAction {
page.getWorkbenchWindow().getShell(),
"Move Confirmation",
"Are you sure you want to move "
+ LocalizationUtil.extractName(file.getName())
+ LocalizationUtil.extractName(file.getPath())
+ " to "
+ level
+ " replacing any existing file and deleting this file?");
@ -113,7 +106,7 @@ public class MoveFileAction extends CopyToAction {
IPathManager pm = PathManagerFactory.getPathManager();
final LocalizationFile newFile = pm.getLocalizationFile(
pm.getContext(file.getContext().getLocalizationType(),
level), file.getName());
level), file.getPath());
removeAlternateTypeFiles(level);
// Make sure we select the file after the drop
final ILocalizationFileObserver[] observers = new ILocalizationFileObserver[1];
@ -121,7 +114,7 @@ public class MoveFileAction extends CopyToAction {
@Override
public void fileUpdated(FileUpdatedMessage message) {
if (message.getContext().equals(newFile.getContext())
&& message.getFileName().equals(newFile.getName())
&& message.getFileName().equals(newFile.getPath())
&& message.getChangeType() != FileChangeType.DELETED) {
service.fileUpdated(message);
VizApp.runAsync(new Runnable() {

View file

@ -21,6 +21,7 @@ package com.raytheon.uf.viz.localization.perspective.view.actions;
import java.util.List;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@ -43,6 +44,8 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
* Dec 3, 2010 6305 mpduff Initial creation
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
* Jan 15, 2016 5242 kbisanz Replaced LocalizationFile with
* ILocalizationFile where possible
*
*
* </pre>
@ -81,12 +84,12 @@ public class PasteFileAction extends CopyToAction {
List<LocalizationType> types = dataToCopyTo.getPathData().getTypes();
LocalizationType type = file.getContext().getLocalizationType();
if(!types.contains(type)){
if (!types.contains(type)) {
type = types.get(0);
}
LocalizationContext ctx = pm.getContext(type, level);
LocalizationFile newFile = pm.getLocalizationFile(ctx,
ILocalizationFile newFile = pm.getLocalizationFile(ctx,
dataToCopyTo.getPath());
removeAlternateTypeFiles(level);
copyFile(newFile);

View file

@ -31,6 +31,7 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.localization.FileUpdatedMessage;
import com.raytheon.uf.common.localization.FileUpdatedMessage.FileChangeType;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@ -57,6 +58,7 @@ import com.raytheon.viz.ui.VizWorkbenchManager;
* Apr 27, 2011 mschenke Initial creation
* Oct 13, 2015 4410 bsteffen Allow localization perspective to mix
* files for multiple Localization Types.
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
*
* </pre>
@ -107,13 +109,13 @@ public class RenameAction extends Action {
}
}
private LocalizationFile file;
private ILocalizationFile file;
private ILocalizationService service;
private boolean deleteOld;
public RenameAction(LocalizationFile file, ILocalizationService service,
public RenameAction(ILocalizationFile file, ILocalizationService service,
boolean deleteOld) {
super("Rename...", IAction.AS_PUSH_BUTTON);
// Only set not enabled if we are deleting the old file and level is a
@ -125,13 +127,13 @@ public class RenameAction extends Action {
this.deleteOld = deleteOld;
}
public RenameAction(LocalizationFile file, ILocalizationService service) {
public RenameAction(ILocalizationFile file, ILocalizationService service) {
this(file, service, true);
}
@Override
public void run() {
String path = file.getName();
String path = file.getPath();
String[] pathParts = LocalizationUtil.splitUnique(path);
final String name = pathParts[pathParts.length - 1];
Shell parent = VizWorkbenchManager.getInstance().getCurrentWindow()

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ffmp Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.monitor.ffmp;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Version: 1.15.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.monitor.ffmp.Activator
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.ui,
@ -14,7 +14,6 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.viz.ui;bundle-version="1.10.13",
com.raytheon.uf.viz.monitor;bundle-version="1.11.1",
com.raytheon.uf.common.dataplugin.ffmp;bundle-version="1.11.9",
org.apache.commons.lang;bundle-version="2.3.0",
com.raytheon.uf.viz.d2d.core;bundle-version="1.11.15",
com.raytheon.uf.viz.localization,
com.raytheon.uf.common.serialization,

View file

@ -19,15 +19,13 @@
**/
package com.raytheon.uf.viz.monitor.ffmp;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import com.raytheon.uf.common.monitor.data.MonitorConfigConstants.ffmpTable;
import com.raytheon.uf.common.monitor.data.MonitorConfigConstants.tableFields;
import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.ffmpTable;
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.tableFields;
/**
* FFMPMonitorConfiguration object stores configuration data specific to FFMP.
@ -38,6 +36,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.tableFields;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 29 June, 2009 2521 dhladky Initial creation
* Jan 04, 2016 5115 skorolev Corrected imports.
*
* </pre>
*
@ -56,64 +55,17 @@ public class FFMPMonitorConfiguration {
* Constructor
*/
public FFMPMonitorConfiguration() {
// reload(getStore());
}
/**
* Save the configuration object to a file.
*
* @throws IOException
*/
// public void save() throws IOException {
// HierarchicalPreferenceStore store = getStore();
//
// // Save SCAN Stuff here
// store.setValue(MonitorConfigConstants.SCAN_PLUGIN_NAME, pluginName);
//
// // cell table
// String[] tempTableAttributes = new String[ffmpTableAttributes.length];
//
// for (int i = 0; i < tempTableAttributes.length; i++) {
// tempTableAttributes[i] = Boolean.toString(ffmpTableAttributes[i]);
// }
//
// store.setValue(MonitorConfigConstants.SCAN_TVS_TABLE_ATTRIB,
// tempTableAttributes);
//
// store.save();
// }
}
/**
* @return HierarchicalPreferenceStore
*/
private HierarchicalPreferenceStore getStore() {
return (HierarchicalPreferenceStore) Activator.getDefault().getPreferenceStore();
return (HierarchicalPreferenceStore) Activator.getDefault()
.getPreferenceStore();
}
/**
* Load the internal data structures from the HierarchicalPreferenceStore.
*
* @param store
* HierarchicalPreferenceStore
*/
// private void reload(HierarchicalPreferenceStore store) {
// // Load SCAN Stuff here
// // pluginName
// this.pluginName = store
// .getStringArray(MonitorConfigConstants.SCAN_PLUGIN_NAME);
//
// // cell table
// String[] tempTableAttributes = store
// .getStringArray(MonitorConfigConstants.SCAN_CELL_TABLE_ATTRIB);
//
// ffmpTableAttributes = new boolean[tempTableAttributes.length];
// for (int i = 0; i < tempTableAttributes.length; i++) {
// this.ffmpTableAttributes[i] = Boolean
// .valueOf(tempTableAttributes[i]);
// }
//
// }
/**
* Retrieve one set of values for all attributes on a given table.
*
@ -134,7 +86,6 @@ public class FFMPMonitorConfiguration {
map.put(table.toString(), value);
}
return map;
}
@ -151,15 +102,13 @@ public class FFMPMonitorConfiguration {
HashMap<String, String> map = new HashMap<String, String>();
for (tableFields field : tableFields.values()) {
map.put(field.toString(), store
.getString(attribute.toString(field)));
map.put(field.toString(),
store.getString(attribute.toString(field)));
}
return map;
}
/**
* Retrieve the threshold data for one of the SCAN tables. Only returns
* those attributes that have thresholds other than the default "999" value.
@ -203,7 +152,6 @@ public class FFMPMonitorConfiguration {
getStore().setValue(attribute.toString(field), value);
}
/**
* @return String[] pluginName
*/
@ -242,6 +190,6 @@ public class FFMPMonitorConfiguration {
* boolean[]
*/
public void setTableAttributes(ffmpTable table, boolean[] tableAttributes) {
this.ffmpTableAttributes = tableAttributes.clone();
this.ffmpTableAttributes = tableAttributes.clone();
}
}

View file

@ -39,6 +39,22 @@ import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
/**
* FFTI Slider Canvas
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 05, 2015 #5070 randerso Changed to use system font name (not AWT)
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class FFTISliderCanvas {
private Composite parentComp;
@ -160,7 +176,8 @@ public class FFTISliderCanvas {
display = this.parentComp.getDisplay();
this.attribVal = accumAttrib;
setValuesNoRedraw(attribVal.getMin(), attribVal.getMax(), attribVal.getInc(), attribVal.getRedThreshold(),
setValuesNoRedraw(attribVal.getMin(), attribVal.getMax(),
attribVal.getInc(), attribVal.getRedThreshold(),
attribVal.getYellowThreshold());
init();
@ -182,7 +199,7 @@ public class FFTISliderCanvas {
upperLblRect = new Rectangle(0, 0, 0, 0);
lowerLblRect = new Rectangle(0, 0, 0, 0);
labelFont = new Font(display, "Monospaced", 10, SWT.BOLD);
labelFont = new Font(display, "Monospace", 10, SWT.BOLD);
mousePt = new Point(0, 0);
upperRegion = new Region(display);
lowerRegion = new Region(display);
@ -201,6 +218,7 @@ public class FFTISliderCanvas {
canvas.setLayoutData(gd);
canvas.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) {
drawCanvas(e.gc);
}
@ -209,12 +227,14 @@ public class FFTISliderCanvas {
canvas.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent e) {
if (upperRegion.contains(e.x, e.y) == true || upperLblRect.contains(e.x, e.y) == true) {
if (upperRegion.contains(e.x, e.y) == true
|| upperLblRect.contains(e.x, e.y) == true) {
mousePt.x = e.x;
mousePt.y = e.y;
mouseDown = true;
moveUpper = true;
} else if (lowerRegion.contains(e.x, e.y) == true || lowerLblRect.contains(e.x, e.y) == true) {
} else if (lowerRegion.contains(e.x, e.y) == true
|| lowerLblRect.contains(e.x, e.y) == true) {
mousePt.x = e.x;
mousePt.y = e.y;
mouseDown = true;
@ -259,10 +279,12 @@ public class FFTISliderCanvas {
gc.fillRectangle(barXCoord, barYCoord, barWidth, barHeight);
gc.setBackground(yellowColor);
gc.fillRectangle(lowerArrowXCoord, barYCoord, barWidth + 25 - lowerArrowXCoord, barHeight);
gc.fillRectangle(lowerArrowXCoord, barYCoord, barWidth + 25
- lowerArrowXCoord, barHeight);
gc.setBackground(redColor);
gc.fillRectangle(upperArrowXCoord, barYCoord, barWidth + 25 - upperArrowXCoord, barHeight);
gc.fillRectangle(upperArrowXCoord, barYCoord, barWidth + 25
- upperArrowXCoord, barHeight);
gc.setForeground(blackColor);
gc.drawRectangle(barXCoord, barYCoord, barWidth, barHeight);
@ -276,7 +298,8 @@ public class FFTISliderCanvas {
private void updateUpperArrow(GC gc) {
upperRegion.subtract(upperPtArray);
upperPtArray = new int[] { upperArrowXCoord, barBottomYCoord - barHeight - 3, upperArrowXCoord + 4,
upperPtArray = new int[] { upperArrowXCoord,
barBottomYCoord - barHeight - 3, upperArrowXCoord + 4,
barBottomYCoord, upperArrowXCoord - 4, barBottomYCoord };
upperRegion.add(upperPtArray);
@ -301,7 +324,8 @@ public class FFTISliderCanvas {
private void updateLowerArrow(GC gc) {
lowerRegion.subtract(lowerPtArray);
lowerPtArray = new int[] { lowerArrowXCoord, barBottomYCoord - barHeight - 3, lowerArrowXCoord + 4,
lowerPtArray = new int[] { lowerArrowXCoord,
barBottomYCoord - barHeight - 3, lowerArrowXCoord + 4,
barBottomYCoord, lowerArrowXCoord - 4, barBottomYCoord };
lowerRegion.add(lowerPtArray);
@ -314,7 +338,8 @@ public class FFTISliderCanvas {
private void updateLowerLabel(GC gc) {
gc.setForeground(yellowColor);
lowerStr = calcDisplayString(lowerDisplayVal);
int lblXCoord = (int) (lowerArrowXCoord - ((double) textWidth * (double) lowerStr.length() / 2));
int lblXCoord = (int) (lowerArrowXCoord - ((double) textWidth
* (double) lowerStr.length() / 2));
gc.drawString(lowerStr, lblXCoord, lowerLblYCoord, true);
lowerLblRect.x = lblXCoord;
lowerLblRect.y = lowerLblYCoord;
@ -379,17 +404,18 @@ public class FFTISliderCanvas {
double xCoordAsValue = (xCoord - barXCoord) * incPerPixel + minValue;
if (xCoordAsValue >= this.maxValue) //no rounding for max value
if (xCoordAsValue >= this.maxValue) {
return this.maxValue;
}
if (incValue == .25) {
return (Math.round(xCoordAsValue * 4.00)) / 4.00;
} else if (incValue == .05) {
return (double) (Math.round(xCoordAsValue * 20.0) / 20.0);
return Math.round(xCoordAsValue * 20.0) / 20.0;
} else if (incValue == .10) {
return (Math.round(xCoordAsValue * 10.00)) / 10.00;
} else {
return (double) Math.round(xCoordAsValue);
return Math.round(xCoordAsValue);
}
}
@ -402,12 +428,14 @@ public class FFTISliderCanvas {
}
private int calcValueToBarXCoord(double val) {
int result = (int) Math.round((val - minValue) / incPerPixel + barXCoord);
int result = (int) Math.round((val - minValue) / incPerPixel
+ barXCoord);
return result;
}
private void setValuesNoRedraw(double min, double max, double inc, double startingUpperVal, double startingLowerVal) {
private void setValuesNoRedraw(double min, double max, double inc,
double startingUpperVal, double startingLowerVal) {
if (max < min) {
return;
}
@ -417,7 +445,7 @@ public class FFTISliderCanvas {
this.rangeValue = max - min;
this.incValue = inc;
incPerPixel = this.rangeValue / (double) barWidth;
incPerPixel = this.rangeValue / barWidth;
if (inc < 1.00) {
displayAtInt = false;
@ -436,11 +464,12 @@ public class FFTISliderCanvas {
public void setValues(FFTIAttribute attribVal) {
this.attribVal = attribVal;
setValues(attribVal.getMin(), attribVal.getMax(), attribVal.getInc(), attribVal.getRedThreshold(),
attribVal.getYellowThreshold());
setValues(attribVal.getMin(), attribVal.getMax(), attribVal.getInc(),
attribVal.getRedThreshold(), attribVal.getYellowThreshold());
}
public void setValues(double min, double max, double inc, double startingUpperVal, double startingLowerVal) {
public void setValues(double min, double max, double inc,
double startingUpperVal, double startingLowerVal) {
setValuesNoRedraw(min, max, inc, startingUpperVal, startingLowerVal);
canvas.redraw();
}
@ -456,12 +485,15 @@ public class FFTISliderCanvas {
startingUpperVal = maxValue;
startingLowerVal = maxValue;
setValues(this.minValue, this.maxValue, this.incValue, startingUpperVal, startingLowerVal);
setValues(this.minValue, this.maxValue, this.incValue,
startingUpperVal, startingLowerVal);
} else if (upperDisplayVal > maxValue) {
startingUpperVal = maxValue;
setValues(this.minValue, this.maxValue, this.incValue, startingUpperVal, getLowerValue());
setValues(this.minValue, this.maxValue, this.incValue,
startingUpperVal, getLowerValue());
} else {
setValues(this.minValue, this.maxValue, this.incValue, getUpperValue(), getLowerValue());
setValues(this.minValue, this.maxValue, this.incValue,
getUpperValue(), getLowerValue());
}
}

View file

@ -45,6 +45,7 @@ import org.eclipse.swt.widgets.Display;
* ------------ ---------- ----------- --------------------------
* ???????????? lvenable Initial creation
* Oct 10, 2013 #2464 lvenable Fix font memory leak.
* Nov 05, 2015 #5070 randerso Changed to use system font name (not AWT)
*
* </pre>
*
@ -124,7 +125,7 @@ public class ToggleCanvas {
}
private void init() {
labelFont = new Font(display, "Monospaced", 10, SWT.BOLD);
labelFont = new Font(display, "Monospace", 10, SWT.BOLD);
parentComp.addDisposeListener(new DisposeListener() {
@Override
@ -145,6 +146,7 @@ public class ToggleCanvas {
canvas.setLayoutData(gd);
canvas.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) {
drawCanvas(e.gc);
}

View file

@ -20,6 +20,7 @@
package com.raytheon.uf.viz.monitor.ffmp.ui.dialogs;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashMap;
@ -32,9 +33,11 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord.FIELDS;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.SaveableOutputStream;
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
import com.raytheon.uf.common.monitor.xml.FFMPRunXML;
@ -61,6 +64,9 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
* Apr 12, 2013 1902 mpduff Speed up cell coloring.
* Apr 15, 2013 1904 mpduff Don't allow this class to be nulled out
* Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP.
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
* and replace printStackTrace with
* statusHandler.error()
*
* </pre>
*
@ -192,16 +198,16 @@ public class FFMPConfig {
readDefaultFFMPConfigBasin();
}
private void readNewFFMPConfigBasin(LocalizationFile xmlFileName) {
private void readNewFFMPConfigBasin(ILocalizationFile xmlFileName) {
ffmpCfgBasin = null;
try {
ffmpCfgBasin = JAXB.unmarshal(xmlFileName.getFile(),
FFMPConfigBasinXML.class);
try (InputStream strm = xmlFileName.openInputStream()) {
ffmpCfgBasin = JAXB.unmarshal(strm, FFMPConfigBasinXML.class);
createThresholdManager();
} catch (Exception e) {
e.printStackTrace();
statusHandler.error("Error reading FFMP Basin config "
+ xmlFileName.getPath(), e);
}
}
@ -220,26 +226,26 @@ public class FFMPConfig {
return;
}
System.out.println("Path Config FFMP: " + file.getAbsolutePath());
ffmpCfgBasin = JAXB.unmarshal(file,
FFMPConfigBasinXML.class);
ffmpCfgBasin = JAXB.unmarshal(file, FFMPConfigBasinXML.class);
createThresholdManager();
} catch (Exception e) {
e.printStackTrace();
statusHandler.error("Error reading default FFMP Basin config "
+ DEFAULT_CONFIG_XML, e);
}
}
public void saveFFMPBasinConfig(LocalizationFile xmlFileName) {
try {
JAXB.marshal(ffmpCfgBasin, xmlFileName.getFile());
public void saveFFMPBasinConfig(ILocalizationFile xmlFileName) {
try (SaveableOutputStream strm = xmlFileName.openOutputStream()) {
JAXB.marshal(ffmpCfgBasin, strm);
xmlFileName.save();
strm.save();
createThresholdManager();
} catch (Exception e) {
e.printStackTrace();
statusHandler.error(
"Error saving FFMP Basin config " + xmlFileName.getPath(),
e);
}
}

View file

@ -39,11 +39,11 @@ import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.localization.ILocalizationFile;
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.PathManagerFactory;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
@ -57,8 +57,9 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Initial creation
* Dec 6, 2012 1353 rferrel Make dialog non-blocking.
* Apr 01, 2013 1830 mpduff Don't allow base files.
* Dec 06, 2012 1353 rferrel Make dialog non-blocking.
* Apr 01, 2013 1830 mpduff Don't allow base files.
* Jan 11, 2016 5242 kbisanz Replaced calls to deprecated LocalizationFile methods
*
* </pre>
*
@ -87,9 +88,7 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
private List cfgFileList;
private LocalizationFile[] locFiles;
private TreeMap<String, LocalizationFile> locFileMap;
private TreeMap<String, ILocalizationFile> locFileMap;
private Text newFileNameTF;
@ -122,7 +121,7 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
@Override
protected void initializeComponents(Shell shell) {
locFileMap = new TreeMap<String, LocalizationFile>();
locFileMap = new TreeMap<>();
controlFont = new Font(shell.getDisplay(), "Monospace", 10, SWT.NORMAL);
createListControl();
@ -278,7 +277,7 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
LocalizationContext context = pm.getContext(
LocalizationType.CAVE_STATIC, level);
String newFileName = "ffmp/guiConfig/" + fileName;
LocalizationFile selectedFile = pm.getLocalizationFile(context,
ILocalizationFile selectedFile = pm.getLocalizationFile(context,
newFileName);
FFMPConfig.getInstance().saveFFMPBasinConfig(selectedFile);
@ -318,12 +317,12 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
String[] extensions = new String[] { ".xml" };
IPathManager pm = PathManagerFactory.getPathManager();
ArrayList<LocalizationContext> contextList = new ArrayList<LocalizationContext>();
java.util.List<LocalizationContext> contextList = new ArrayList<>();
contextList.add(pm.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.SITE));
contextList.add(pm.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.USER));
locFiles = pm.listFiles(contextList
ILocalizationFile[] locFiles = pm.listFiles(contextList
.toArray(new LocalizationContext[contextList.size()]),
"ffmp/guiConfig", extensions, false, true);
@ -333,7 +332,7 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
for (int i = 0; i < locFiles.length; i++) {
locFileMap.put(locFiles[i].getContext().getLocalizationLevel()
+ ":" + locFiles[i].getName(), locFiles[i]);
+ ":" + locFiles[i].getPath(), locFiles[i]);
}
for (String str : locFileMap.keySet()) {

View file

@ -27,11 +27,13 @@ import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.common.colormap.Color;
import com.raytheon.uf.common.colormap.ColorMap;
import com.raytheon.uf.common.colormap.ColorMapException;
import com.raytheon.uf.common.colormap.ColorMapLoader;
import com.raytheon.uf.common.colormap.IColorMap;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord.FIELDS;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.ILocalizationFile;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
@ -40,7 +42,6 @@ import com.raytheon.uf.common.style.StyleManager;
import com.raytheon.uf.common.style.StyleRule;
import com.raytheon.uf.common.style.StyleRuleset;
import com.raytheon.uf.common.style.image.ImagePreferences;
import com.raytheon.uf.viz.core.drawables.ColorMapLoader;
import com.raytheon.uf.viz.core.exception.VizException;
/**
@ -53,11 +54,13 @@ import com.raytheon.uf.viz.core.exception.VizException;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 08/29/09 2152 D. Hladky Initial release
* 05/21/12 DR 14833 G. Zhang Error handling for invalid cmap
* 05/21/12 DR 14833 G. Zhang Error handling for invalid cmap
* Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP.
* Jun 10, 2013 2075 njensen Improved init time
* Sep 5, 2013 2051 mnash Moved style rule instantiation so that we don't get NPEs
* Sep 05, 2013 2051 mnash Moved style rule instantiation so that we don't get NPEs
* Sep 28, 2015 4756 dhladky Multiple guidance style rules for FFMP.
* Dec 10, 2015 4834 njensen Use non-deprecated ColorMapLoader
*
* </pre>
*
* @author dhladky
@ -130,9 +133,9 @@ public class FFMPColorUtils {
try {
cxml = ColorMapLoader.loadColorMap(colormapfile);
} catch (VizException e) {
statusHandler.error("Error loading ColorMap file: field: " + field
+ " time: " + time + " ffgName: " + ffgName
} catch (ColorMapException e) {
statusHandler.error("Error loading ColorMap file: field: "
+ field + " time: " + time + " ffgName: " + ffgName
+ " TableLoad: " + tableLoad, e);
}
@ -344,9 +347,9 @@ public class FFMPColorUtils {
private List<String> getQpeColorMapFiles() {
List<String> colormaps = new ArrayList<String>();
LocalizationFile[] files = ColorMapLoader.listColorMapFiles("ffmp");
for (LocalizationFile file : files) {
String fn = file.getName();
ILocalizationFile[] files = ColorMapLoader.listColorMapFiles("ffmp");
for (ILocalizationFile file : files) {
String fn = file.getPath();
if (fn.indexOf("qpe") > 0) {
colormaps.add(fn);
}
@ -395,9 +398,6 @@ public class FFMPColorUtils {
if (DEFAULT_PARAMNAME.equalsIgnoreCase(pn)
&& DEFAULT_COLORMAP.equalsIgnoreCase(cm)) {
sr = srl;
System.out
.println("FFMPColorUtils.getDefaultColorMap(): StyleRule pn-cm value: "
+ pn + "-" + cm);
break;
}
@ -410,8 +410,8 @@ public class FFMPColorUtils {
// load the colormap
try {
cxml = ColorMapLoader.loadColorMap(colormapfile);
} catch (VizException e) {
e.printStackTrace();
} catch (ColorMapException e) {
statusHandler.error("Error loading colormap " + colormapfile, e);
}
return cxml;

View file

@ -202,6 +202,8 @@ import com.vividsolutions.jts.geom.Point;
* Feb 13, 2015 4121 mpduff Change label caching.
* Sep 28, 2015 4756 dhladky Multiple guidance sources.
* Oct 26, 2015 5056 dhladky Simplified Guidance Interpolation.
* Nov 05, 2015 5070 randerso Adjust font sizes for dpi scaling
*
* </pre>
*
* @author dhladky
@ -1254,7 +1256,7 @@ public class FFMPResource extends
public void run() {
if (font == null) {
font = target.initializeFont("Dialog", 11, null);
font = target.initializeFont("Dialog", 9, null);
}
font.setMagnification(getCapability(
@ -1263,7 +1265,7 @@ public class FFMPResource extends
if (xfont == null) {
IFont.Style[] styles = new IFont.Style[] { IFont.Style.BOLD };
xfont = target.initializeFont("Monospace", 12, styles);
xfont = target.initializeFont("Monospace", 10, styles);
}
xfont.setMagnification(getCapability(
@ -3190,7 +3192,8 @@ public class FFMPResource extends
ITimer timer = TimeUtil.getTimer();
timer.start();
FfmpTableConfig tableConfig = FfmpTableConfig.getInstance();
String ffgGraphType = tableConfig.getTableConfigData(getSiteKey()).getFfgGraphType();
String ffgGraphType = tableConfig.getTableConfigData(getSiteKey())
.getFfgGraphType();
Long basinPfaf = null;
Long dataId = null;
FFMPVirtualGageBasinMetaData fvgbmd = null;
@ -3246,8 +3249,9 @@ public class FFMPResource extends
for (Date date : rateBasin.getValues().keySet()) {
if (date.before(minUriTime) || date.before(barrierTime)
|| date.after(mostRecentRefTime))
|| date.after(mostRecentRefTime)) {
continue;// DR 16148
}
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
date);
@ -3275,8 +3279,9 @@ public class FFMPResource extends
for (Date date : qpeBasin.getValues().keySet()) {
if (date.before(minUriTime) || date.before(barrierTime)
|| date.after(mostRecentRefTime))
|| date.after(mostRecentRefTime)) {
continue;// DR 16148
}
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
date);
@ -3337,8 +3342,8 @@ public class FFMPResource extends
try {
guidBasin = (FFMPGuidanceBasin) monitor.getGraphGuidanceBasin(
getProduct(), ffgGraphType, getSiteKey(), getDataKey(), null,
oldestRefTime, FFMPRecord.ALL, basinPfaf);
getProduct(), ffgGraphType, getSiteKey(), getDataKey(),
null, oldestRefTime, FFMPRecord.ALL, basinPfaf);
ArrayList<Double> guidTimes = new ArrayList<Double>();
for (SourceXML ffgSource : getProduct().getGuidanceSourcesByType(
ffgGraphType)) {
@ -3359,8 +3364,10 @@ public class FFMPResource extends
fgd.setGuidanceTimes(guidTimes);
guid = true;
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"FFMPMonitor: getGraphData(): missing GUIDANCE dataset.", e);
statusHandler
.handle(Priority.PROBLEM,
"FFMPMonitor: getGraphData(): missing GUIDANCE dataset.",
e);
}
if (fvgbmd != null) {
@ -3388,7 +3395,8 @@ public class FFMPResource extends
} catch (Exception e) {
statusHandler
.handle(Priority.PROBLEM,
"FFMPMonitor: getGraphData(): missing VIRTUAL dataset.", e);
"FFMPMonitor: getGraphData(): missing VIRTUAL dataset.",
e);
}
}

View file

@ -26,6 +26,7 @@ import java.util.Map;
import com.raytheon.uf.common.dataplugin.fog.FogRecord;
import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.MonitorConfigConstants;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.CellType;
@ -35,7 +36,6 @@ import com.raytheon.uf.viz.monitor.data.TableCellData;
import com.raytheon.uf.viz.monitor.data.TableData;
import com.raytheon.uf.viz.monitor.data.TableRowData;
import com.raytheon.uf.viz.monitor.fog.threshold.FogThresholdMgr;
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
/**
* Generate Data for Fog Dialogs
@ -49,6 +49,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
* 12/07/09 dhladky Initial Creation.
* Oct.29, 2012 1297 skorolev Changed HashMap to Map
* Oct.31, 2012 1297 skorolev Clean code
* Dec 26, 2015 5114 skorolev Corrected imports.
*
* </pre>
*
@ -58,9 +59,9 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
public class FogDataGenerator {
private CommonTableConfig ctc;
private final CommonTableConfig ctc;
private FogThresholdMgr ftm;
private final FogThresholdMgr ftm;
/**
* Generates Fog data

View file

@ -38,8 +38,8 @@ import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
import com.raytheon.uf.common.jms.notification.NotificationMessage;
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.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -89,6 +89,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Mar 09, 2014 3888 dhladky Stopped processing when dialogs are null or disposed.
* Sep 18, 2015 3873 skorolev Removed common definitions. Replaced deprecated NotificationMessage.
* Dec 17, 2015 3873 dhladky Abstracted handling of dialogTime and Zone dialog events.
* Jan 04, 2016 5115 skorolev Corrected imports and replaced Mon.Name with App.Name.
*
*
* </pre>
@ -143,7 +144,7 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
*/
private FogMonitor() {
pluginPatterns.add(fssPattern);
fogConfig = FSSObsMonitorConfigurationManager.getInstance(MonName.fog);
fogConfig = FSSObsMonitorConfigurationManager.getInstance(AppName.FOG);
updateMonitoringArea();
initObserver(OBS, this);
createDataStructures();

View file

@ -22,10 +22,10 @@ package com.raytheon.uf.viz.monitor.fog.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.MonitorConfigConstants.FogDisplay;
import com.raytheon.uf.common.monitor.data.MonitorConfigConstants.FogMonitor;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.FogDisplay;
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.FogMonitor;
/**
* This class manages the FOG thresholds for display and monitor.
@ -41,6 +41,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.FogMonitor;
* May 20, 2014 3086 skorolev Cleaned code.
* Sep 04, 2014 3220 skorolev Removed "site".
* Sep 18, 2015 3873 skorolev Adjusted to AppName and removed areaConfigMgr.
* Dec 26, 2015 5114 skorolev Corrected imports.
*
* </pre>
*

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