Merge branch 'ss_builds' into Unified_Grid

Conflicts:
	edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java
	edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/parameterInfo/hpcGuideNDFD.xml

Former-commit-id: a67ce9586c [formerly de3769129c] [formerly 8b7256b1ae] [formerly 266a2f317f [formerly 8b7256b1ae [formerly f5ae7bbd116ddc19b4fd6c8518089fa11b78ec90]]]
Former-commit-id: 266a2f317f
Former-commit-id: aad7acdf220a9ba94d6a280496d0b78f3466b6be [formerly fed5a35af3]
Former-commit-id: fde1e73d58
This commit is contained in:
Ben Steffensmeier 2012-10-12 12:45:50 -05:00
commit 97c23508d7
313 changed files with 46796 additions and 36643 deletions

View file

@ -224,8 +224,14 @@ class Procedure (SmartScript.SmartScript):
hazardKey = selectedHazard
defaultHazKey = ""
if len(defaultSegment) > 0 and defaultHazard is not None:
defaultHazKey = defaultHazard + ":" + defaultSegment
if defaultHazard is not None:
index = string.find(defaultHazard, " ")
if index != -1:
defaultHazard = defaultHazard[0:index]
defaultHazKey = defaultHazard
if len(defaultSegment) > 0:
defaultHazKey += ":" + defaultSegment
weName = self._hazUtils._makeTempWEName(hazardKey)

View file

@ -796,7 +796,7 @@ class SmartScript(BaseTool.BaseTool):
if "A" == status:
importance = Priority.PROBLEM
elif "R" == status:
importance = Priority.EVENTB
importance = Priority.EVENTA
elif "U" == status:
importance = Priority.CRITICAL
else:

View file

@ -43,8 +43,9 @@ xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255,255,255);">
]]>
</style>
<symbol overflow="visible" id="plotData" class="info">
<text id="turbInensity" plotMode="table" class="weather" plotLookupTable="airep_turb_intens_trans.txt" plotParam="FLT_HZD" x="0" y="0">0</text>
<text id="fltLvlText" plotMode="text" plotParam="FLT_LVL" plotFormat="%3.0f" plotUnit="hft" style="text-anchor: end;" x="-15px" y="0px">75</text>
<text id="airepturbIntensity" plotMode="table" class="weather" plotLookupTable="turb_intens_trans.txt" plotParam="TBI" x="0" y="0">0</text>
<text id="airepturbFreq" plotMode="table" class="weather" plotLookupTable="turb_freq_trans.txt" plotParam="TBF" style="text-anchor: end" x="0" y="-10">0</text>
<text id="airepfltLvlText" plotMode="text" plotParam="FLT_LVL" plotFormat="%3.0f" plotUnit="hft" style="text-anchor: end;" x="-15px" y="0px">75</text>
</symbol>
</defs>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -46,6 +46,7 @@ from java.util import HashSet
# ------------ ---------- ----------- --------------------------
# 04/01/09 njensen Initial Creation.
# 08/20/2012 #1077 randerso Fixed backgroundColor setting
# 09/13/2012 #1147 dgilling Allow map labels to be disabled.
#
#
#
@ -160,8 +161,7 @@ class GFEPainter(VizPainter.VizPainter):
rsc.getCapability(LabelableCapability).setxOffset(xOffset)
if yOffset is not None:
rsc.getCapability(LabelableCapability).setyOffset(yOffset)
if labelAttribute is not None:
rsc.getCapability(LabelableCapability).setLabelField(labelAttribute)
rsc.getCapability(LabelableCapability).setLabelField(labelAttribute)
if fontOffset is not None:
mag = Double(1.26 ** fontOffset)
rsc.getCapability(MagnificationCapability).setMagnification(mag)

View file

@ -88,7 +88,8 @@ fi
while [ $exitVal -ne 0 ]
do
curTime=`date +%Y%m%d_%H%M%S`
LOGFILE=${LOGDIR}/alertviz_${curTime}.log
LOGFILE=${LOGDIR}/alertviz_${curTime}_console.log
export LOGFILE_ALERTVIZ=${LOGDIR}/alertviz_${curTime}_admin.log
#first check if we can write to the directory
if [ -w ${LOGDIR} ]; then

View file

@ -116,7 +116,8 @@ fi
export pid=$$
curTime=`date +%Y%m%d_%H%M%S`
LOGFILE=${LOGDIR}/cave_${curTime}_pid_${pid}.log
LOGFILE=${LOGDIR}/cave_${curTime}_pid_${pid}_console.log
export LOGFILE_CAVE=${LOGDIR}/cave_${curTime}_pid_${pid}_alertviz.log
redirect="TRUE"
for flag in $@; do

View file

@ -632,7 +632,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
|| statMsg.getSourceKey().equals("GDN_ADMIN");
if (isGdnAdminMessage) {
Container.logInternal(statMsg);
// Container.logInternal(statMsg);
if ((statMsg.getDetails() != null)
&& (statMsg.getDetails().contains("Error")
|| statMsg.getDetails().contains("Exception")

View file

@ -29,3 +29,5 @@ Import-Package: com.raytheon.uf.common.python,
com.raytheon.uf.viz.python.swt,
com.raytheon.uf.viz.python.swt.widgets
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: ext, registered, global
Eclipse-RegisterBuddy: org.apache.log4j

View file

@ -6,4 +6,5 @@ bin.includes = META-INF/,\
lib/derbyrun.jar,\
lib/derby.jar,\
statusMessage.xsd,\
config.xml
config.xml,\
log4j-alertviz.xml

View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!-- general application log -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="levelMin" value="DEBUG" />
<param name="levelMax" value="INFO" />
</filter>
</appender>
<appender name="errConsole" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.err"/>
<param name="Threshold" value="WARN" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
</layout>
</appender>
<appender name="AlertVizAdminLogAppender" class="com.raytheon.uf.viz.alertviz.EnvConfigurableRollingFileAppender">
<param name="envLogVar" value="LOGFILE_ALERTVIZ" />
<param name="maxFileSize" value="2GB"/>
<param name="maxBackupIndex" value="5"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] : %m%n"/>
</layout>
</appender>
<logger name="AlertVizAdminLogger" additivity="false">
<level value="ALL"/>
<appender-ref ref="AlertVizAdminLogAppender"/>
</logger>
<logger name="com.raytheon">
<level value="INFO"/>
</logger>
<logger name="com.tc">
<level value="WARN"/>
</logger>
<logger name="mx4j">
<level value="ERROR"/>
</logger>
<logger name="org.apache">
<level value="INFO"/>
</logger>
<logger name="org.apache.activemq.spring">
<level value="WARN"/>
</logger>
<logger name="org.apache.commons.beanutils">
<level value="WARN"/>
</logger>
<logger name="org.apache.qpid">
<level value="WARN"/>
</logger>
<logger name="org.geotools">
<level value="WARN"/>
</logger>
<logger name="org.apache.xbean.spring">
<level value="WARN"/>
</logger>
<logger name="org.springframework">
<level value="ERROR"/>
</logger>
<logger name="uk.ltd.getahead">
<level value="WARN"/>
</logger>
<!-- default logging -->
<root>
<level value="INFO"/>
<appender-ref ref="console"/>
<appender-ref ref="errConsole"/>
</root>
</log4j:configuration>

View file

@ -230,7 +230,7 @@ public class AlertvizJob extends Job {
e);
StatusMessage sm = new StatusMessage();
sm.setPriority(Priority.CRITICAL);
sm.setMachine("LOCAL");
sm.setMachineToCurrent();
sm.setCategory("GDN_ADMIN");
sm.setSourceKey("GDN_ADMIN");
sm.setMessage(e.getMessage());

View file

@ -36,7 +36,7 @@ import com.raytheon.uf.viz.alertviz.config.Category;
import com.raytheon.uf.viz.alertviz.config.Configuration;
import com.raytheon.uf.viz.alertviz.config.ForcedConfiguration;
import com.raytheon.uf.viz.alertviz.config.Source;
import com.raytheon.uf.viz.alertviz.internal.ArchiveLogJob;
import com.raytheon.uf.viz.alertviz.internal.PurgeLogJob;
import com.raytheon.uf.viz.alertviz.internal.LogMessageDAO;
import com.raytheon.uf.viz.core.VizApp;
@ -63,8 +63,8 @@ public class Container implements IConfigurationChangedListener {
public static final String SOURCE_MISSING = "Source was not found";
private transient static final org.apache.log4j.Logger internalLogger = Logger
.getLogger("AlertVizLogger");
private transient static final org.apache.log4j.Logger adminLogger = Logger
.getLogger("AlertVizAdminLogger");
private Configuration configuration;
@ -96,7 +96,7 @@ public class Container implements IConfigurationChangedListener {
.getForcedConfiguration();
ConfigurationManager.getInstance().addListener(this);
this.callbacks = callbacks;
ArchiveLogJob archive = new ArchiveLogJob();
PurgeLogJob archive = new PurgeLogJob();
archive.schedule();
}
@ -171,7 +171,7 @@ public class Container implements IConfigurationChangedListener {
// for now, just send to the regular log
StatusMessage sm = new StatusMessage();
sm.setPriority(priority);
sm.setMachine("LOCAL");
sm.setMachineToCurrent();
sm.setSourceKey("GDN_ADMIN");
sm.setCategory("GDN)ADMIN");
sm.setMessage(msg);
@ -319,24 +319,25 @@ public class Container implements IConfigurationChangedListener {
String cat = message.getCategory();
String source = message.getSourceKey();
if ((cat != null && cat.equalsIgnoreCase("GDN_ADMIN"))
|| (source != null && source.equalsIgnoreCase("GDN_ADMIN"))) {
boolean isInternal = (cat != null && cat.equalsIgnoreCase("GDN_ADMIN"))
|| (source != null && source.equalsIgnoreCase("GDN_ADMIN"));
if (isInternal) {
switch (message.getPriority()) {
case CRITICAL:
internalLogger.fatal(message);
adminLogger.fatal(message);
break;
case SIGNIFICANT:
internalLogger.error(message);
adminLogger.error(message);
break;
case PROBLEM:
internalLogger.warn(message);
adminLogger.warn(message);
break;
case EVENTA: // fall through
case EVENTB:
internalLogger.info(message);
adminLogger.info(message);
break;
case VERBOSE:
internalLogger.debug(message);
adminLogger.debug(message);
break;
}
}

View file

@ -0,0 +1,80 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.alertviz;
import org.apache.log4j.RollingFileAppender;
import org.apache.log4j.helpers.LogLog;
/**
* RollingFileAppender retrieves the value set for property EnvLogVar from the
* system environment to define the log file.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 10, 2012 bgonzale Initial creation
*
* </pre>
*
* @author bgonzale
* @version 1.0
*/
public class EnvConfigurableRollingFileAppender extends RollingFileAppender {
private String envLogVar;
/**
* @param envLogVar
* the envLogVar to set
*/
public void setEnvLogVar(String envLogVar) {
this.envLogVar = envLogVar;
setFileFromEnv();
}
/**
* @return the envLogVar
*/
public String getEnvLogVar() {
return envLogVar;
}
private void setFileFromEnv() {
if (envLogVar == null || envLogVar.isEmpty()) {
LogLog.error("Appender [" + name
+ "] requires EnvLogVar to be set.");
} else {
String file = System.getenv(envLogVar);
if (file == null || file.isEmpty()) {
LogLog.error("Appender [" + name
+ "] needs environment variable, " + envLogVar
+ ", to be set.");
} else {
setFile(file);
}
}
}
}

View file

@ -19,6 +19,7 @@
**/
package com.raytheon.uf.viz.alertviz;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
@ -50,6 +51,9 @@ import com.raytheon.uf.viz.core.status.VizStatusInternal;
public class SystemStatusHandler extends AbstractStatusHandler {
private transient static final org.apache.log4j.Logger logger = Logger
.getLogger("CaveLogger");
private static final String WORKSTATION = "WORKSTATION";
/*
@ -66,14 +70,13 @@ public class SystemStatusHandler extends AbstractStatusHandler {
if (status instanceof VizStatusInternal) {
VizStatusInternal vs = (VizStatusInternal) status;
sm = new StatusMessage(vs.getSource(), vs.getCategory(),
vs.getPriority(), vs.getPluginName(), vs.getMessage(),
vs.getException());
sm = vs.toStatusMessage();
} else {
sm = from(status);
}
try {
logStatus(sm);
AlertVizClient.sendMessage(sm);
} catch (final AlertvizException e) {
// not a good situation, since we can't communicate with the log
@ -111,7 +114,7 @@ public class SystemStatusHandler extends AbstractStatusHandler {
StatusMessage sm = new StatusMessage();
sm.setCategory(WORKSTATION);
sm.setMachine("LOCAL");
sm.setMachineToCurrent();
switch (status.getSeverity()) {
case Status.ERROR:
sm.setPriority(Priority.SIGNIFICANT);
@ -184,4 +187,26 @@ public class SystemStatusHandler extends AbstractStatusHandler {
int count) throws AlertvizException {
return LogMessageDAO.getInstance().load(count, category);
}
private void logStatus(StatusMessage status) {
switch (status.getPriority()) {
case CRITICAL:
logger.fatal(status);
break;
case SIGNIFICANT:
logger.error(status);
break;
case PROBLEM:
logger.warn(status);
break;
case EVENTA: // fall through
case EVENTB:
logger.info(status);
break;
case VERBOSE:
logger.debug(status);
break;
}
}
}

View file

@ -250,7 +250,7 @@ public class LogMessageDAO {
}
public void save(StatusMessage sm) throws AlertvizException {
// Container.logInternal(sm);
Container.logInternal(sm);
synchronized (this) {
boolean errorOccurred = false;
ResultSet rs = null;

View file

@ -19,7 +19,6 @@
**/
package com.raytheon.uf.viz.alertviz.internal;
import java.io.File;
import java.sql.Timestamp;
import org.eclipse.core.runtime.IProgressMonitor;
@ -32,13 +31,9 @@ import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.viz.alertviz.Activator;
import com.raytheon.uf.viz.alertviz.AlertvizException;
import com.raytheon.uf.viz.alertviz.Constants;
import com.raytheon.uf.viz.alertviz.LogUtil;
import com.raytheon.uf.viz.alertviz.LogUtil.Order;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
/**
* Purges the database, and archives the old log entries to a text file
* Purges old database entries.
*
* <pre>
* SOFTWARE HISTORY
@ -50,26 +45,16 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
* @author chammack
* @version 1.0
*/
public class ArchiveLogJob extends Job {
private int numberOfLogsToKeep;
public class PurgeLogJob extends Job {
private int ageOfLogInHours;
private static final int DEFAULT_NUMBER_OF_LOGS = 10;
private static final int DEFAULT_AGE_OF_LOG_IN_HRS = 12;
private static final int MILLISECONDS_IN_HOUR = 60 * 60 * 1000;
public ArchiveLogJob() {
super("Archive Log");
this.setSystem(true);
numberOfLogsToKeep = Activator.getDefault().getPreferenceStore()
.getInt(Constants.P_NUMBER_OF_LOGS);
if (numberOfLogsToKeep == 0) {
this.numberOfLogsToKeep = DEFAULT_NUMBER_OF_LOGS;
}
public PurgeLogJob() {
super("Archive Log Purge");
ageOfLogInHours = Activator.getDefault().getPreferenceStore()
.getInt(Constants.P_MAX_AGE_OF_LOGS);
@ -90,14 +75,8 @@ public class ArchiveLogJob extends Job {
long now = System.currentTimeMillis();
if ((now - lastPurgeInMs) > (ageOfLogInHours * MILLISECONDS_IN_HOUR)) {
String s = LocalizationManager.getUserDir() + "textLogs"
+ File.separator + VizApp.getHostName()
+ File.separator + "log";
LogUtil.rollLogs(s, numberOfLogsToKeep);
Timestamp ts = new Timestamp(now
- (ageOfLogInHours * MILLISECONDS_IN_HOUR));
LogUtil.saveLogToFile(new File(s + ".0"), ts, Order.BEFORE);
LogMessageDAO.getInstance().purge(ts);
}
} catch (AlertvizException e) {
@ -111,7 +90,7 @@ public class ArchiveLogJob extends Job {
.openError(
Display.getDefault().getActiveShell(),
"Error",
"Error rotating saving and rotating logs. Archived logs may not be stored",
"Error purging logs.",
s);
}

View file

@ -24,7 +24,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@ -533,7 +533,7 @@ public class CcfpResource extends
synchronized (unprocessedRecords) {
records = unprocessedRecords.get(dataTime);
if (records == null) {
records = new HashSet<CcfpRecord>();
records = new LinkedHashSet<CcfpRecord>();
unprocessedRecords.put(dataTime, records);
brandNew = true;
}

View file

@ -34,7 +34,7 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174"
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: ext, registered, global
Eclipse-RegisterBuddy: org.apache.velocity, com.raytheon.edex.common, com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization.comm, com.raytheon.uf.common.status, com.raytheon.uf.common.dataplugin.level
Eclipse-RegisterBuddy: org.apache.velocity, org.apache.log4j, com.raytheon.edex.common, com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization.comm, com.raytheon.uf.common.status, com.raytheon.uf.common.dataplugin.level
Export-Package: com.raytheon.uf.viz.core,
com.raytheon.uf.viz.core.alerts,
com.raytheon.uf.viz.core.auth,

View file

@ -5,4 +5,5 @@ bin.includes = META-INF/,\
plugin.xml,\
config.xml,\
scriptTemplates/,\
schema/
schema/,\
log4j-viz-core.xml

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="levelMin" value="DEBUG" />
<param name="levelMax" value="INFO" />
</filter>
</appender>
<appender name="errConsole" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.err"/>
<param name="Threshold" value="WARN" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %c{1}: %m%n"/>
</layout>
</appender>
<appender name="CaveLogAppender" class="com.raytheon.uf.viz.alertviz.EnvConfigurableRollingFileAppender">
<param name="envLogVar" value="LOGFILE_CAVE" />
<param name="maxFileSize" value="2GB"/>
<param name="maxBackupIndex" value="5"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %d [%t] %m%n"/>
</layout>
</appender>
<appender name="AsyncCaveLogAppender" class="org.apache.log4j.AsyncAppender">
<param name="BufferSize" value="500"/>
<appender-ref ref="CaveLogAppender"/>
</appender>
<logger name="CaveLogger" additivity="false">
<level value="ALL"/>
<appender-ref ref="AsyncCaveLogAppender"/>
</logger>
<logger name="com.raytheon">
<level value="INFO"/>
</logger>
<logger name="com.tc">
<level value="WARN"/>
</logger>
<logger name="mx4j">
<level value="ERROR"/>
</logger>
<logger name="org.apache">
<level value="INFO"/>
</logger>
<logger name="org.apache.activemq.spring">
<level value="WARN"/>
</logger>
<logger name="org.apache.commons.beanutils">
<level value="WARN"/>
</logger>
<logger name="org.apache.qpid">
<level value="WARN"/>
</logger>
<logger name="org.geotools">
<level value="WARN"/>
</logger>
<logger name="org.apache.xbean.spring">
<level value="WARN"/>
</logger>
<logger name="org.springframework">
<level value="ERROR"/>
</logger>
<logger name="uk.ltd.getahead">
<level value="WARN"/>
</logger>
<root>
<level value="INFO"/>
<appender-ref ref="console"/>
<appender-ref ref="errConsole"/>
</root>
</log4j:configuration>

View file

@ -105,18 +105,6 @@ public abstract class AbstractTimeMatcher {
DataTime[] availableTimes, IDescriptor descriptor)
throws VizException;
/**
* Set the matched list of times to a particular resource
*
* @param dataTimes
* @param rsc
* @param descriptor
* @throws VizException
*/
public abstract void setTimeList(DataTime[] dataTimes,
AbstractVizResource<?, ?> rsc, IDescriptor descriptor)
throws VizException;
/**
* Given a list of RenderableDisplays, determine the order to instantiate
* them in to get the correct time match settings, should only be called

View file

@ -64,6 +64,7 @@ import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
import com.raytheon.uf.viz.core.rsc.ResourceGroup;
import com.raytheon.uf.viz.core.rsc.ResourceList;
import com.raytheon.uf.viz.core.time.TimeMatchingJob;
/**
* AbstractDescriptor
@ -192,33 +193,37 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
}
if (basis != newBasis) {
redoTimeMatching();
TimeMatchingJob.scheduleTimeMatch(AbstractDescriptor.this);
if (renderableDisplay != null
&& renderableDisplay.getContainer() != null) {
IDisplayPaneContainer container = renderableDisplay.getContainer();
for (IDisplayPane pane : container.getDisplayPanes()) {
if (pane.getDescriptor() != AbstractDescriptor.this) {
TimeMatchingJob.scheduleTimeMatch(pane.getDescriptor());
}
}
}
}
}
});
}
private void redoTimeMatching() throws VizException {
if (getTimeMatcher() != null) {
getTimeMatcher().redoTimeMatching(this);
}
if (renderableDisplay != null
&& renderableDisplay.getContainer() != null) {
IDisplayPaneContainer container = renderableDisplay.getContainer();
for (IDisplayPane pane : container.getDisplayPanes()) {
if (pane.getDescriptor() != this) {
if (pane.getDescriptor().getTimeMatcher() != null) {
pane.getDescriptor().getTimeMatcher()
.redoTimeMatching(pane.getDescriptor());
}
}
}
}
}
protected void postAddListener(ResourcePair rp) {
if (rp.getResource() != null && getTimeMatcher() != null) {
// We need to run time matching immediately beacuse order
// constructed is important for time matching so we must do it now
// instead of scheduling since another resource could be added by
// the time it runs
AbstractTimeMatcher tm = getTimeMatcher();
tm.redoTimeMatching(rp.getResource());
try {
tm.redoTimeMatching(this);
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e);
}
}
}
@SuppressWarnings("unchecked")

View file

@ -35,7 +35,6 @@ 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.LocalizationInternalFile;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.localization.msgs.AbstractUtilityCommand;
import com.raytheon.uf.common.localization.msgs.AbstractUtilityResponse;
@ -43,9 +42,6 @@ import com.raytheon.uf.common.localization.msgs.ListResponseEntry;
import com.raytheon.uf.common.localization.msgs.ProtectedFileCommand;
import com.raytheon.uf.common.localization.msgs.ProtectedFileResponse;
import com.raytheon.uf.common.localization.msgs.UtilityRequestMessage;
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;
/**
@ -66,9 +62,6 @@ import com.raytheon.uf.common.util.FileUtil;
*/
public class CAVELocalizationAdapter implements ILocalizationAdapter {
private static transient IUFStatusHandler statusHandler = UFStatus
.getHandler(CAVELocalizationAdapter.class.getPackage().getName(),
"WORKSTATION", "CAVE");
private static final LocalizationManager manager = LocalizationManager
.getInstance();
@ -198,7 +191,7 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
response.date = null;
response.existsOnServer = false;
response.fileName = fileName;
response.isProtected = false;
response.protectedLevel = null;
File file = getPath(caveConfigBase, fileName);
response.isDirectory = file != null && file.isDirectory();
responses.add(response);
@ -229,17 +222,6 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
}
manager.retrieve(file);
if (file.isProtected()) {
File f;
try {
f = file.getFile(false);
f.setReadOnly();
} catch (LocalizationException e) {
// shouldn't happen since file was just retrieved
statusHandler.handle(Priority.PROBLEM, "Error retrieving file",
e);
}
}
}
/*
@ -253,7 +235,6 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
@Override
public boolean save(File localFile, LocalizationContext context,
String fileName) throws LocalizationOpFailedException {
if (context.getLocalizationLevel().isSystemLevel()) {
throw new UnsupportedOperationException(
"Saving to the System Level, "
@ -416,7 +397,7 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
ListResponse response = new ListResponse();
response.context = context;
response.isDirectory = configFile.isDirectory();
response.isProtected = false;
response.protectedLevel = null;
response.existsOnServer = false;
response.fileName = p;
response.date = new Date(configFile.lastModified());
@ -442,10 +423,13 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
response.existsOnServer = false;
response.fileName = pfr.getPathName();
response.isDirectory = locFile.isDirectory();
response.isProtected = pfr.isProtectedFile();
response.protectedLevel = pfr.getProtectedLevel();
if (!response.isProtected
|| (response.context.getLocalizationLevel() == LocalizationLevel.BASE)) {
if (response.protectedLevel == null
|| response.context.getLocalizationLevel().compareTo(
response.protectedLevel) <= 0) {
// if not protected or protected level is less than/equal to
// our level, add response
responses.add(response);
}
}
@ -486,7 +470,7 @@ public class CAVELocalizationAdapter implements ILocalizationAdapter {
lr.isDirectory = entry.isDirectory();
}
lr.context = context;
lr.isProtected = entry.isProtectedFile();
lr.protectedLevel = entry.getProtectedLevel();
lr.existsOnServer = entry.isExistsOnServer();
return lr;
}

View file

@ -129,6 +129,8 @@ public class LocalizationManager implements IPropertyChangeListener {
/** The current localization site */
private String currentSite;
private boolean nationalCenter;
private boolean overrideSite;
@ -392,6 +394,12 @@ public class LocalizationManager implements IPropertyChangeListener {
.getString("-site").toUpperCase();
this.overrideSite = true;
}
this.nationalCenter = false;
if (ProgramArguments.getInstance().getString("-nc") != null) {
this.nationalCenter = true;
}
}
private void checkForServerOverride() {
@ -946,4 +954,8 @@ public class LocalizationManager implements IPropertyChangeListener {
public boolean isOverrideSite() {
return overrideSite;
}
public boolean isNationalCenter() {
return nationalCenter;
}
}

View file

@ -169,8 +169,7 @@ public abstract class AbstractRequestableResourceData extends
// 3. Throw an exception of no data available and user has not specified
// to suppress load errors
// 4. Retrieve the PluginDataObjects for all DataTimes
// 5. Notify the time matcher that load has completed with the set of
// datatimes
// 5. Construct resource with loaded pdos
DataTime[] availableTimes = this.getAvailableTimes();
DataTime[] dataTimes = descriptor.getTimeMatcher().initialLoad(
loadProperties, availableTimes, descriptor);
@ -205,9 +204,8 @@ public abstract class AbstractRequestableResourceData extends
}
resource = constructResource(loadProperties, data);
descriptor.getTimeMatcher().setTimeList(dataTimes, resource,
descriptor);
}
return resource;
}

View file

@ -88,8 +88,9 @@ public class VizStatusHandler implements IUFStatusHandler {
this.source = factory.getSource(source, pluginId);
}
}
StatusManager.getManager().handle(
new VizStatusInternal(status, category, source, pluginId));
VizStatusInternal vizStatus = new VizStatusInternal(status, category,
source, pluginId);
StatusManager.getManager().handle(vizStatus);
}
@Override

View file

@ -22,6 +22,7 @@ package com.raytheon.uf.viz.core.status;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import com.raytheon.uf.common.message.StatusMessage;
import com.raytheon.uf.common.status.UFStatus;
/**
@ -170,4 +171,9 @@ public class VizStatusInternal extends UFStatus implements IStatus {
return pluginName;
}
public StatusMessage toStatusMessage() {
return new StatusMessage(this.source, this.category, this.priority,
this.pluginName, this.message, this.exception);
}
}

View file

@ -138,18 +138,33 @@ public class TileLevel {
DefaultGeographicCRS.WGS84));
corrector = new WorldWrapCorrector(targetGeometry);
// Calculate pixel density
// Grab the center x, 3/4 y of the map
double mapXCenter = targetGeometry.getGridRange().getSpan(0) * 0.5;
double mapYCenter = targetGeometry.getGridRange().getSpan(1) * 0.75;
Envelope levelEnv = levelGeometry.getEnvelope();
double[] in = new double[] {
levelEnv.getMinimum(0) + (levelEnv.getSpan(0) / 2),
levelEnv.getMinimum(1) + (levelEnv.getSpan(1) / 2) };
double[] out = new double[in.length];
tileCRSToTargetGrid.transform(in, 0, out, 0, 1);
double[] input = new double[] { mapXCenter, mapYCenter,
mapXCenter + 1, mapYCenter + 1 };
double mapPointX = out[0];
double mapPointY = out[1];
GridEnvelope targetEnv = targetGeometry.getGridRange();
if (targetEnv.getLow(0) > mapPointX
|| targetEnv.getHigh(0) < mapPointX
|| targetEnv.getLow(1) > mapPointY
|| targetEnv.getHigh(1) < mapPointY) {
// Center of tile level outside target grid, use something on
// target grid for calculations
mapPointX = targetEnv.getLow(0) + targetEnv.getSpan(0) * 0.5;
mapPointY = targetEnv.getLow(1)
+ targetGeometry.getGridRange().getSpan(1) * 0.75;
}
double[] input = new double[] { mapPointX, mapPointY,
mapPointX + 1, mapPointY + 1 };
double[] output = new double[input.length];
tileCRSToTargetGrid.inverse().transform(input, 0, output, 0, 2);
levelGeometry.getGridToCRS(PixelInCell.CELL_CORNER).inverse()
.transform(output, 0, input, 0, 2);
crsToGrid.transform(output, 0, input, 0, 2);
pixelDensity = 1.0 / Math.abs(new Coordinate(input[0], input[1],
0.0).distance(new Coordinate(input[2], input[3], 0.0)));
} catch (Exception e) {

View file

@ -114,7 +114,7 @@ public class TileSetRenderable implements IRenderable {
.getHandler(TileSetRenderable.class);
/** Screen pixel to image pixel threshold at which we change levels */
protected static final double LEVEL_CHANGE_THRESHOLD = 2.0;
protected static final double LEVEL_CHANGE_THRESHOLD = 1.75;
/** Job pool for tile creation */
protected static final JobPool tileCreationPool = new JobPool(

View file

@ -50,6 +50,7 @@ import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.FrameCoordinator;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IDescriptor.FramesInfo;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
@ -61,7 +62,6 @@ import com.raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType;
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceList;
import com.raytheon.uf.viz.core.time.TimeMatchingJob;
import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
/**
@ -73,8 +73,6 @@ import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 10, 2009 chammack Initial creation
* 2012-04-20 DR 14699 D. Friedman Work around race conditions
* 2012-08-14 DR 15160 D. Friedman Reduce chance of UI blocking
*
* </pre>
*
@ -95,7 +93,9 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
@Override
public void disposed(AbstractVizResource<?, ?> resource) {
if ((resource == timeMatchBasis)) {
internalSetTimeMatchBasis(null);
synchronized (D2DTimeMatcher.this) {
timeMatchBasis = null;
}
}
}
@ -123,15 +123,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
private AbstractTimeMatchingConfigurationFactory configFactory;
// DR 14699 work arounds
private boolean needRetry;
private int nRetries;
// DR 15160 state
private transient boolean pendingTmbChange = false;
private transient boolean inTimeMatch = false;
private transient AbstractVizResource<?, ?> pendingTimeMatchBasis;
/**
* Default Constructor.
*/
@ -162,15 +153,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
public void redoTimeMatching(IDescriptor descriptor) throws VizException {
synchronized (this) {
if (inTimeMatch) {
needRetry = true;
return;
}
pendingTmbChange = false;
inTimeMatch = true;
needRetry = false;
}
try {
if (timeMatchBasis != null) {
IDescriptor tmDescriptor = timeMatchBasis.getDescriptor();
if (tmDescriptor != null && tmDescriptor != descriptor) {
@ -194,11 +176,8 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
Iterator<ResourcePair> pairIterator = descriptor.getResourceList()
.listIterator();
while (pairIterator.hasNext()) {
ResourcePair rp = pairIterator.next();
AbstractVizResource<?, ?> rsc = rp
AbstractVizResource<?, ?> rsc = pairIterator.next()
.getResource();
if (rsc == null && rp.getResourceData() instanceof AbstractRequestableResourceData)
needRetry = true;
recursiveOverlay(descriptor, new FramesInfo(timeSteps, -1,
resourceTimeMap), rsc);
}
@ -215,38 +194,18 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
timeMatchUpdate(entry.getKey(), entry.getValue());
}
}
} finally {
boolean scheduleRetry = false;
synchronized (this) {
inTimeMatch = false;
if (pendingTmbChange) {
pendingTmbChange = false;
changeTimeMatchBasis(pendingTimeMatchBasis);
pendingTimeMatchBasis = null;
scheduleRetry = true;
}
if (needRetry) {
if (nRetries < 200) {
++nRetries;
scheduleRetry = true;
}
} else
nRetries = 0;
}
if (scheduleRetry)
TimeMatchingJob.scheduleTimeMatch(descriptor);
}
}
private int indexToUpdateTo(IDescriptor descriptor, DataTime[] oldTimes,
int oldIndex, DataTime[] frames, int startFrame) {
int frameToUse = startFrame;
IDisplayPaneContainer container = descriptor.getRenderableDisplay()
.getContainer();
if (container != null && container.getLoopProperties().isLooping()) {
return frameToUse;
IRenderableDisplay display = descriptor.getRenderableDisplay();
if (display != null && display.getContainer() != null) {
IDisplayPaneContainer container = display.getContainer();
if (container.getLoopProperties().isLooping()) {
return frameToUse;
}
}
switch (descriptor.getFrameCoordinator().getAnimationMode()) {
case Latest: {
@ -347,8 +306,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
if (rsc instanceof IResourceGroup) {
for (ResourcePair rp : ((IResourceGroup) rsc).getResourceList()) {
AbstractVizResource<?, ?> rsc1 = rp.getResource();
if (rsc1 == null && rp.getResourceData() instanceof AbstractRequestableResourceData)
needRetry = true;
recursiveOverlay(descriptor, framesInfo, rsc1);
}
}
@ -357,9 +314,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
TimeMatchingConfiguration config = getConfiguration(rsc
.getLoadProperties());
DataTime[] timeSteps = getFrameTimes(descriptor, framesInfo);
if (Arrays.equals(timeSteps, config.getLastBaseTimes()) &&
config.getLastFrameTimes() != null &&
config.getLastFrameTimes().length > 0) {
if (Arrays.equals(timeSteps, config.getLastBaseTimes())) {
framesInfo.getTimeMap().put(rsc, config.getLastFrameTimes());
} else {
config = config.clone();
@ -733,7 +688,9 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
IDescriptor descriptor) {
if ((resource == timeMatchBasis)
&& (descriptor instanceof AbstractDescriptor)) {
internalSetTimeMatchBasis(null);
synchronized (this) {
timeMatchBasis = null;
}
}
}
@ -862,41 +819,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
return timeMatchBasis;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.AbstractTimeMatcher#setTimeList(com.raytheon
* .uf.common.time.DataTime[],
* com.raytheon.uf.viz.core.rsc.AbstractVizResource,
* com.raytheon.uf.viz.core.drawables.IDescriptor)
*/
@Override
public void setTimeList(DataTime[] dataTimes,
AbstractVizResource<?, ?> rsc, IDescriptor descriptor)
throws VizException {
((AbstractDescriptor) descriptor).getTimeMatchingMap().put(rsc,
dataTimes);
// if the resource is the basis , set the time to the last
// time
if (dataTimes.length > 0
&& (rsc == timeMatchBasis || timeMatchBasis == null)) {
boolean setFrameTimes = true;
// If there are any null times we do not want to set this as the
// frame times, that means we were matched against a time match
// basis that has since been removed.
for (DataTime time : dataTimes) {
setFrameTimes = setFrameTimes && time != null;
}
if (setFrameTimes) {
descriptor.setFramesInfo(new FramesInfo(dataTimes,
dataTimes.length - 1));
changeTimeMatchBasis(rsc);
}
}
}
public boolean hasTimeMatchBasis() {
return (timeMatchBasis != null);
}
@ -1027,17 +949,4 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
configFactory.resetMultiload();
}
// For DR 15160
protected void internalSetTimeMatchBasis(AbstractVizResource<?, ?> timeMatchBasis) {
synchronized (this) {
if (inTimeMatch) {
pendingTmbChange = true;
pendingTimeMatchBasis = timeMatchBasis;
} else {
pendingTmbChange = false;
pendingTimeMatchBasis = null;
changeTimeMatchBasis(timeMatchBasis);
}
}
}
}

View file

@ -1400,6 +1400,11 @@
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.TimeOptionsAction"
commandId="com.raytheon.uf.viz.d2d.ui.actions.timeOptionsAction">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.LocateCursorAction"
@ -1485,6 +1490,11 @@
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.CopyOutAWIPSProcedure"
commandId="com.raytheon.viz.ui.copyOutAWIPSProcedure">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.SetPerspectiveHandler"
@ -1497,6 +1507,11 @@
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.ShowPrintDialog"
commandId="com.raytheon.uf.viz.d2d.ui.actions.showPrintDialog">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.IncreaseBlendAmount"
@ -1509,6 +1524,11 @@
<handler
class="com.raytheon.uf.viz.d2d.ui.actions.ToggleTool"
commandId="com.raytheon.uf.viz.d2d.ui.actions.toggleTool">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
</extension>
<extension

View file

@ -68,6 +68,9 @@ public class TimeOptionsAction extends AbstractTool {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
super.execute(event);
if (this.editor == null) {
return null;
}
IRenderableDisplay iDisplay = this.editor.getActiveDisplayPane()
.getRenderableDisplay();
D2DTimeMatcher matcher = ((D2DTimeMatcher) iDisplay.getDescriptor()

View file

@ -91,12 +91,16 @@ public class LocalizationSaveAsPopulator extends CompoundContributionItem {
protected IContributionItem[] getContributionItems() {
MenuManager menuMgr = new MenuManager("SaveAs", "FileSaveAs");
final boolean enabled;
final LocalizationLevel protectedLevel;
final IEditorPart active = EditorUtil.getActiveEditor();
if (active != null
&& active.getEditorInput() instanceof LocalizationEditorInput) {
enabled = active.isDirty();
protectedLevel = ((LocalizationEditorInput) active.getEditorInput())
.getLocalizationFile().getProtectedLevel();
} else {
enabled = false;
protectedLevel = null;
}
LocalizationLevel[] levels = PathManagerFactory.getPathManager()
@ -119,7 +123,9 @@ public class LocalizationSaveAsPopulator extends CompoundContributionItem {
@Override
public boolean isEnabled() {
return enabled;
return enabled
&& (protectedLevel == null || level
.compareTo(protectedLevel) <= 0);
}
});

View file

@ -0,0 +1,156 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.localization.perspective.view;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
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.adapter.LocalizationPerspectiveAdapter;
import com.raytheon.uf.viz.localization.filetreeview.PathData;
/**
* Manager class for creating {@link PathData} objects for the localization path
* extension point entries
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 7, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class PathDataExtManager {
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(PathDataExtManager.class);
/** Localization path extension point id */
private static final String PATH_DEFINITION_ID = "com.raytheon.uf.viz.localization.localizationpath";
private static final String APPLICATION_ATTR = "application";
private static final String NAME_ATTR = "name";
private static final String PATH_ATTR = "value";
private static final String TYPE_ATTR = "localizationType";
private static final String FILTER_ATTR = "extensionFilter";
private static final String ADAPTER_ATTR = "localizationAdapter";
private static final String RECURSIVE_ATTR = "recursive";
/** Default application name */
private static final String DEFAULT_APPLICATION = "Uncategorized";
/** Default localization perspective adapter */
private static final LocalizationPerspectiveAdapter DEFAULT_ADAPTER = new LocalizationPerspectiveAdapter();
public static Collection<PathData> getPathData() {
List<PathData> pathData = new ArrayList<PathData>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint(PATH_DEFINITION_ID);
if (point != null) {
for (IExtension ext : point.getExtensions()) {
for (IConfigurationElement element : ext
.getConfigurationElements()) {
PathData pd = new PathData();
pd.setApplication(element.getAttribute(APPLICATION_ATTR));
if (pd.getApplication() == null
|| pd.getApplication().trim().isEmpty()) {
pd.setApplication(DEFAULT_APPLICATION);
}
pd.setName(element.getAttribute(NAME_ATTR));
if (pd.getName() == null || pd.getName().trim().isEmpty()) {
statusHandler
.handle(Priority.PROBLEM,
"Skipping path extension entry with no name set");
continue;
}
pd.setPath(element.getAttribute(PATH_ATTR));
if (pd.getPath() == null) {
statusHandler
.handle(Priority.PROBLEM,
"Skipping path extension entry with no path set");
}
pd.setFilter(element.getAttribute(FILTER_ATTR));
String recurse = element.getAttribute(RECURSIVE_ATTR);
pd.setRecursive(Boolean.parseBoolean(recurse));
pd.setType(LocalizationType.valueOf(element
.getAttribute(TYPE_ATTR)));
if (pd.getType() == null) {
// Skip if bad localization type specified
statusHandler.handle(
Priority.PROBLEM,
"Skipping path extension entry with name: "
+ pd.getName() + " and path: "
+ pd.getPath()
+ " with invalid localiation type: "
+ element.getAttribute(TYPE_ATTR));
continue;
}
LocalizationPerspectiveAdapter adapter = DEFAULT_ADAPTER;
try {
if (element.getAttribute(ADAPTER_ATTR) != null) {
adapter = (LocalizationPerspectiveAdapter) element
.createExecutableExtension(ADAPTER_ATTR);
}
} catch (Throwable t) {
statusHandler
.handle(Priority.PROBLEM,
"Skipping path with name: "
+ pd.getName()
+ " and path: "
+ pd.getPath()
+ " due to error constructing adapter: "
+ t.getLocalizedMessage(), t);
}
pd.setAdapter(adapter);
pathData.add(pd);
}
}
} else {
throw new RuntimeException("Could not find extension point ("
+ PATH_DEFINITION_ID
+ ") from the extension point registry");
}
return pathData;
}
}

View file

@ -19,8 +19,6 @@
**/
package com.raytheon.uf.viz.localization.perspective.view.actions;
import java.util.Arrays;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
@ -127,8 +125,7 @@ public abstract class AbstractToAction extends Action implements IMenuCreator {
protected void fillMenu(Menu menu) {
LocalizationLevel[] levels = PathManagerFactory.getPathManager()
.getAvailableLevels();
Arrays.sort(levels, LocalizationLevel.REVERSE_COMPARATOR);
for (int i = levels.length - 1; i >= 0; --i) {
for (int i = 0; i < levels.length; ++i) {
LocalizationLevel level = levels[i];
if (level.isSystemLevel() == false) {
new ActionContributionItem(new AbstractToInternalAction(level))
@ -137,6 +134,26 @@ public abstract class AbstractToAction extends Action implements IMenuCreator {
}
}
/**
* Determines if the action for this level is enabled. By default, checks if
* the level is the same as the file level
*
* @param level
* @return
*/
protected boolean isLevelEnabled(LocalizationLevel level) {
if (level == file.getContext().getLocalizationLevel()) {
String fileCtxName = file.getContext().getContextName();
String levelCtxName = LocalizationManager.getContextName(level);
if ((fileCtxName == null && levelCtxName == null)
|| (fileCtxName != null && fileCtxName.equals(levelCtxName))) {
// same context name
return false;
}
}
return true;
}
protected abstract void run(LocalizationLevel level);
private class AbstractToInternalAction extends Action {
@ -145,16 +162,7 @@ public abstract class AbstractToAction extends Action implements IMenuCreator {
public AbstractToInternalAction(LocalizationLevel level) {
this.level = level;
if (level == file.getContext().getLocalizationLevel()) {
String fileCtxName = file.getContext().getContextName();
String levelCtxName = LocalizationManager.getContextName(level);
if ((fileCtxName == null && levelCtxName == null)
|| (fileCtxName != null && fileCtxName
.equals(levelCtxName))) {
// same context name
this.setEnabled(false);
}
}
this.setEnabled(isLevelEnabled(level));
}
@Override

View file

@ -63,11 +63,28 @@ public class CopyToAction extends AbstractToAction {
protected ILocalizationService service;
public CopyToAction(LocalizationFile file, ILocalizationService service) {
super(file.isProtected() ? "Copy To (Protected)" : "Copy To", file);
setEnabled(file.isProtected() == false);
super("Copy To", file);
this.service = 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);
if (enabled && file.isProtected()) {
// Ensure protected level is greater than copy to level
enabled = file.getProtectedLevel().compareTo(level) >= 0;
}
return enabled;
}
/*
* (non-Javadoc)
*

View file

@ -70,14 +70,35 @@ 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);
if (enabled && file.isProtected()) {
// Ensure protected level is greater than copy to level
enabled = file.getProtectedLevel().compareTo(level) >= 0;
}
return enabled;
}
@Override
protected void run(LocalizationLevel level) {
boolean choice = MessageDialog.openQuestion(
page.getWorkbenchWindow().getShell(),
"Move Confirmation",
"Are you sure you want to move "
+ LocalizationUtil.extractName(file.getName()) + " to "
+ level + " replacing any existing file?");
boolean choice = MessageDialog
.openQuestion(
page.getWorkbenchWindow().getShell(),
"Move Confirmation",
"Are you sure you want to move "
+ LocalizationUtil.extractName(file.getName())
+ " to "
+ level
+ " replacing any existing file and deleting this file?");
if (choice) {
IPathManager pm = PathManagerFactory.getPathManager();
final LocalizationFile newFile = pm.getLocalizationFile(

View file

@ -25,6 +25,7 @@ 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.viz.localization.filetreeview.LocalizationFileEntryData;
import com.raytheon.uf.viz.localization.filetreeview.LocalizationFileGroupData;
import com.raytheon.uf.viz.localization.service.ILocalizationService;
@ -47,15 +48,35 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
public class PasteFileAction extends CopyToAction {
LocalizationFileGroupData dataToCopyTo;
private LocalizationFileGroupData dataToCopyTo;
private LocalizationLevel pasteToProtectedLevel;
public PasteFileAction(ILocalizationService service, LocalizationFile file,
LocalizationFileGroupData data) {
super(file, service);
setText(file.isProtected() ? "Paste To (Protected)" : "Paste To");
setText("Paste To");
this.dataToCopyTo = data;
// Grab the level this file is protected at (if any)
for (LocalizationFileEntryData entry : dataToCopyTo.getChildrenData()) {
pasteToProtectedLevel = entry.getFile().getProtectedLevel();
break;
}
}
setEnabled(file.isProtected() == false);
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.localization.perspective.view.actions.CopyToAction
* #isLevelEnabled
* (com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
* )
*/
@Override
protected boolean isLevelEnabled(LocalizationLevel level) {
return pasteToProtectedLevel == null
|| level.compareTo(pasteToProtectedLevel) <= 0;
}
/*

View file

@ -0,0 +1,149 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.localization.perspective.view.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuCreator;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.viz.localization.perspective.view.FileTreeView;
/**
* Action for generating menu items for hiding/showing localization levels in
* the {@link FileTreeView}
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 6, 2012 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class ShowLevelsAction extends Action implements IMenuCreator {
private FileTreeView view;
private Menu menu;
public ShowLevelsAction(FileTreeView view) {
super("Show", IAction.AS_DROP_DOWN_MENU);
this.view = view;
}
@Override
public IMenuCreator getMenuCreator() {
return this;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
@Override
public void dispose() {
if (menu != null) {
menu.dispose();
}
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets
* .Control)
*/
@Override
public Menu getMenu(Control parent) {
if (menu != null) {
menu.dispose();
}
menu = new Menu(parent);
fillMenu(menu);
return menu;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets
* .Menu)
*/
@Override
public Menu getMenu(Menu parent) {
if (menu != null) {
menu.dispose();
}
menu = new Menu(parent);
fillMenu(menu);
return menu;
}
/**
*
*/
private void fillMenu(Menu menu) {
// Use of LocalizationLevels.values() in this case should be okay since
// we are setting a property to display all context names for the level,
// doesn't matter if our local context for the level is set
for (LocalizationLevel level : PathManagerFactory.getPathManager()
.getAvailableLevels()) {
ActionContributionItem aci = new ActionContributionItem(
new ShowLevelInternalAction(level));
aci.fill(menu, -1);
}
}
private class ShowLevelInternalAction extends Action {
private LocalizationLevel level;
public ShowLevelInternalAction(LocalizationLevel level) {
super(level.name(), IAction.AS_CHECK_BOX);
this.level = level;
setChecked(view.isShown(level));
}
@Override
public void run() {
view.toggleShowLevel(level);
setChecked(view.isShown(level));
}
}
}

View file

@ -647,6 +647,13 @@ public class FFMPMonitor extends ResourceMonitor {
Date previousQueryTime = ffmpAvailableUriQueryDates.get(siteKey).get(
sourceName);
SourceXML source = getSourceConfig().getSource(sourceName);
if (source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
// Always look back for guidance types because of long expiration times,
// prevents mosaic brittleness from occurring.
retrieveNew = true;
}
if (retrieveNew
|| ((time != null) && ((previousQueryTime == null) || (time
@ -2322,14 +2329,11 @@ public class FFMPMonitor extends ResourceMonitor {
final String fsiteKey;
final boolean fisProductLoad;
public FFMPLoadRecord(boolean isProductLoad, String siteKey,
FFMPRecord ffmpRec, String source, String huc) throws Exception {
this.fffmpRec = ffmpRec;
this.fsource = source;
this.fsiteKey = siteKey;
this.fisProductLoad = isProductLoad;
this.fhuc = huc;
}

View file

@ -3339,13 +3339,15 @@ public class FFMPResource extends
ArrayList<Double> qpeTimes = new ArrayList<Double>();
if (qpeBasin != null) {
for (Date date : qpeBasin.getValues().keySet()) {
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
date);
fgd.setQpe(dtime, (double) qpeBasin.getAccumValue(date,
double currVal = qpeBasin.getAccumValue(date,
mostRecentRefTime, getQpeSourceExpiration(),
isRate()));
isRate());
fgd.setQpe(dtime, currVal);
qpeTimes.add(dtime);
}
}

View file

@ -19,6 +19,8 @@
**/
package com.raytheon.uf.viz.monitor.scan.commondialogs;
import java.util.Set;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
@ -40,8 +42,12 @@ import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.monitor.scan.config.AbsConfigMgr;
import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
import com.raytheon.uf.viz.monitor.scan.tables.AbstractTableDlg;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager;
import com.raytheon.uf.viz.monitor.scan.tables.SCANCellTableDlg;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlertedAlarms;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
public class SCANAlarmThreshDlg extends CaveSWTDialog implements
@ -239,6 +245,16 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
@Override
public void widgetSelected(SelectionEvent e) {
alarmChoiceChanged();
String columnName = attributeCbo.getText();
mgr.clearAlertedAlarms(site, scanTable);
AbstractTableDlg tableDlg = ScanMonitor.getInstance()
.getDialog(scanTable, site);
tableDlg.updateThresh(columnName);
if (mgr.getAlertedAlarmCount(site, scanTable) == 0) {
tableDlg.turnOffAlarm();
} else {
tableDlg.turnOnAlarm();
}
shell.dispose();
}
});

View file

@ -157,7 +157,7 @@ public class ScanResource extends
VizApp.runAsync(new Runnable() {
@Override
public void run() {
if (getScanDrawer().font != null) {
if (gc != null && getScanDrawer().font != null) {
getScanDrawer().font.setMagnification(getCapability(
MagnificationCapability.class).getMagnification()
.floatValue());
@ -560,7 +560,7 @@ public class ScanResource extends
* @return
*/
public ScanDrawer getScanDrawer() {
if (drawer == null) {
if (drawer == null && gc != null) {
if (getTable().equals(ScanTables.CELL)) {
drawer = new ScanDrawer(SCANConfig.getInstance()
.getStormCellConfig(), gc, getScan()

View file

@ -765,4 +765,8 @@ public abstract class AbstractTableDlg extends Dialog implements IMonitor,
protected abstract void handleRankMenuEvent(SelectionEvent event);
public abstract void updateThresh(String attr);
public abstract void turnOffAlarm();
public abstract void turnOnAlarm();
}

View file

@ -21,10 +21,13 @@ package com.raytheon.uf.viz.monitor.scan.tables;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
@ -36,6 +39,7 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
import com.raytheon.uf.viz.monitor.scan.data.ScanDataGenerator;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
/**
* Manager class to hold between scan dialog and alarming capabilities
@ -74,11 +78,11 @@ public class SCANAlarmAlertManager {
private static SCANAlarmAlertManager instance = null;
private HashMap<String, HashMap<ScanTables, List<ScheduledAlarms>>> scheduledAlarmsMap;
private Map<String, Map<ScanTables, List<ScheduledAlarms>>> scheduledAlarmsMap;
private HashMap<String, HashMap<ScanTables, Set<AlertedAlarms>>> alertedAlarmsMap;
private Map<String, Map<ScanTables, Set<AlertedAlarms>>> alertedAlarmsMap;
private HashMap<String, HashMap<ScanTables, List<String>>> idents;
private Map<String, Map<ScanTables, List<String>>> idents;
private boolean ring = false;
@ -98,7 +102,7 @@ public class SCANAlarmAlertManager {
public void addSite(String site) {
if (!scheduledAlarmsMap.containsKey(site)) {
HashMap<ScanTables, List<ScheduledAlarms>> siteScheduledAlarmsMap = new HashMap<ScanTables, List<ScheduledAlarms>>();
Map<ScanTables, List<ScheduledAlarms>> siteScheduledAlarmsMap = Collections.synchronizedMap(new HashMap<ScanTables, List<ScheduledAlarms>>());
siteScheduledAlarmsMap.put(ScanTables.DMD,
new CopyOnWriteArrayList<ScheduledAlarms>());
siteScheduledAlarmsMap.put(ScanTables.CELL,
@ -107,7 +111,7 @@ public class SCANAlarmAlertManager {
}
if (!alertedAlarmsMap.containsKey(site)) {
HashMap<ScanTables, Set<AlertedAlarms>> siteAlertedAlarmsSet = new HashMap<ScanTables, Set<AlertedAlarms>>();
Map<ScanTables, Set<AlertedAlarms>> siteAlertedAlarmsSet = Collections.synchronizedMap(new HashMap<ScanTables, Set<AlertedAlarms>>());
siteAlertedAlarmsSet.put(ScanTables.DMD,
new HashSet<AlertedAlarms>());
siteAlertedAlarmsSet.put(ScanTables.CELL,
@ -116,7 +120,7 @@ public class SCANAlarmAlertManager {
}
if (!idents.containsKey(site)) {
HashMap<ScanTables, List<String>> siteIdents = new HashMap<ScanTables, List<String>>();
Map<ScanTables, List<String>> siteIdents = new HashMap<ScanTables, List<String>>();
siteIdents.put(ScanTables.CELL, new ArrayList<String>());
siteIdents.put(ScanTables.DMD, new ArrayList<String>());
idents.put(site, siteIdents);
@ -126,15 +130,15 @@ public class SCANAlarmAlertManager {
private SCANAlarmAlertManager() {
if (scheduledAlarmsMap == null) {
scheduledAlarmsMap = new HashMap<String, HashMap<ScanTables, List<ScheduledAlarms>>>();
scheduledAlarmsMap = Collections.synchronizedMap(new HashMap<String, Map<ScanTables, List<ScheduledAlarms>>>());
}
if (alertedAlarmsMap == null) {
alertedAlarmsMap = new HashMap<String, HashMap<ScanTables, Set<AlertedAlarms>>>();
alertedAlarmsMap = Collections.synchronizedMap(new HashMap<String, Map<ScanTables, Set<AlertedAlarms>>>());
}
if (idents == null) {
idents = new HashMap<String, HashMap<ScanTables, List<String>>>();
idents = new HashMap<String, Map<ScanTables, List<String>>>();
}
}
@ -438,7 +442,7 @@ public class SCANAlarmAlertManager {
return count;
}
public boolean containsAlarm(String site, ScanTables tableType,
AlarmType type, String colName, String ident) {
for (AlertedAlarms alarm : alertedAlarmsMap.get(site).get(tableType)) {
@ -493,9 +497,10 @@ public class SCANAlarmAlertManager {
alarm.cleared = true;
}
}
public void removeAlertedAlarms(String site, ScanTables tableType) {
alertedAlarmsMap.get(site).get(tableType).clear();
setRing(false);
}
/**
@ -603,4 +608,5 @@ public class SCANAlarmAlertManager {
+ this.row + "\nCol #:" + this.col + "\nCleared: " + cleared + "\n";
}
}
}

View file

@ -475,8 +475,7 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
alarmDlg.open();
if (!alarmBtn.isDisposed()
&& (mgr.getAlertedAlarmCount(site, scanTable) == 0)) {
alarmBtn.setVisible(false);
mgr.setRing(false);
turnOffAlarm();
}
}
});
@ -488,7 +487,23 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
timeLbl.setLayoutData(gd);
}
// private void resetButtonForegroundColor(Button btn)
@Override
public void turnOffAlarm() {
if (alarmBtn != null && !alarmBtn.isDisposed()) {
alarmBtn.setVisible(false);
}
mgr.setRing(false);
}
@Override
public void turnOnAlarm() {
if (alarmBtn != null && !alarmBtn.isDisposed()) {
alarmBtn.setVisible(true);
}
mgr.setRing(true);
}
// private void resetButtonForegroundColor(Button btn)
// {
// btn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
// }

View file

@ -514,8 +514,7 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
alarmsDlg.open();
if (!alarmBtn.isDisposed()
&& mgr.getAlertedAlarms(site, scanTable).isEmpty()) {
alarmBtn.setVisible(false);
mgr.setRing(false);
turnOffAlarm();
}
}
});
@ -1299,4 +1298,19 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
dmdTableComp.alarmSelection(ident);
}
public void turnOffAlarm() {
if (alarmBtn != null && !alarmBtn.isDisposed()) {
alarmBtn.setVisible(false);
}
mgr.setRing(false);
}
public void turnOnAlarm() {
if (alarmBtn != null && !alarmBtn.isDisposed()) {
alarmBtn.setVisible(true);
}
mgr.setRing(true);
}
}

View file

@ -647,4 +647,14 @@ public class SCANMesoTableDlg extends AbstractTableDlg implements
return false;
}
@Override
public void turnOffAlarm() {
mgr.setRing(false);
}
@Override
public void turnOnAlarm() {
mgr.setRing(true);
}
}

View file

@ -609,4 +609,14 @@ public class SCANTvsTableDlg extends AbstractTableDlg implements
// Not currently used for TVS
return false;
}
@Override
public void turnOffAlarm() {
mgr.setRing(false);
}
@Override
public void turnOnAlarm() {
mgr.setRing(true);
}
}

View file

@ -20,12 +20,11 @@ Developed on the Raytheon Visualization Environment (viz)
<launcherArgs>
<programArgs>-data @user.home/caveData -user @user.home/caveData -clean</programArgs>
<programArgsLin>-consoleLog</programArgsLin>
<vmArgs>-Xincgc -Xmx256M -Xss2024k -Dosgi.instance.area.readOnly=true -Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook,org.eclipse.core.runtime.internal.adaptor.EclipseErrorHandler -Dorg.eclipse.update.reconcile=false -Dqpid.dest_syntax=BURL -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false</vmArgs>
<vmArgs>-Xincgc -Xmx256M -Xss2024k -Dosgi.instance.area.readOnly=true -Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook,org.eclipse.core.runtime.internal.adaptor.EclipseErrorHandler -Dorg.eclipse.update.reconcile=false -Dqpid.dest_syntax=BURL -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dlog4j.configuration=log4j-alertviz.xml</vmArgs>
</launcherArgs>
<windowImages/>
<launcher name="alertviz">
<solaris/>
<win useIco="false">
@ -39,7 +38,6 @@ Developed on the Raytheon Visualization Environment (viz)
</win>
</launcher>
<vm>
<linux include="true">jdk1.6.0</linux>
<windows include="true">jdk1.6.0</windows>

View file

@ -27,11 +27,15 @@ import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchWindow;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.DescriptorMap;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
import com.raytheon.uf.viz.core.catalog.DbQuery;
@ -39,6 +43,7 @@ import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.procedures.Bundle;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
@ -46,7 +51,10 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference.PreferenceType;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.MenuLoader;
import com.raytheon.viz.ui.VizWorkbenchManager;
import com.raytheon.viz.ui.editor.AbstractEditor;
import com.raytheon.viz.ui.perspectives.AbstractVizPerspectiveManager;
import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
/**
* Product browser abstract requestable implementation
@ -134,11 +142,11 @@ public abstract class AbstractRequestableProductBrowserDataDefinition<T extends
String[] temp = queryData(param, queryList);
if (temp != null) {
if ((Boolean) getPreference(FORMAT_DATA).getValue()) {
parameters = formatData(param, temp);
} else {
parameters = super.formatData(param, temp);
}
if ((Boolean) getPreference(FORMAT_DATA).getValue()) {
parameters = formatData(param, temp);
} else {
parameters = super.formatData(param, temp);
}
}
if (parameters != null) {
@ -194,7 +202,10 @@ public abstract class AbstractRequestableProductBrowserDataDefinition<T extends
IDescriptor currDesc = null;
// retrieves the correct editor
getEditor();
IDisplayPaneContainer container = EditorUtil.getActiveVizContainer();
IDisplayPaneContainer container = getEditor();
if (container == null) {
return;
}
AbstractRenderableDisplay display = (AbstractRenderableDisplay) container
.getActiveDisplayPane().getRenderableDisplay();
display = (AbstractRenderableDisplay) display.createNewDisplay();
@ -265,8 +276,39 @@ public abstract class AbstractRequestableProductBrowserDataDefinition<T extends
return null;
}
public void getEditor() {
// do nothing, if user wants a certain editor then overwrite this method
protected IDisplayPaneContainer getEditor() {
String id = DescriptorMap.getEditorId(getDescriptorClass().getName());
IEditorPart editorPart = EditorUtil.getActiveEditor();
if (editorPart != null && id.equals(editorPart.getEditorSite().getId())) {
return (AbstractEditor) editorPart;
}
editorPart = EditorUtil.findEditor(id);
if (editorPart != null) {
return (AbstractEditor) editorPart;
}
return openNewEditor(id);
}
protected IDisplayPaneContainer openNewEditor(String editorId) {
IWorkbenchWindow window = VizWorkbenchManager.getInstance()
.getCurrentWindow();
AbstractVizPerspectiveManager mgr = VizPerspectiveListener.getInstance(
window).getActivePerspectiveManager();
if (mgr != null) {
AbstractEditor editor = mgr.openNewEditor();
if (editor == null) {
return null;
} else if (editorId.equals(editor.getEditorSite().getId())) {
return editor;
} else {
window.getActivePage().closeEditor(editor, false);
}
}
return null;
}
protected Class<? extends IDescriptor> getDescriptorClass() {
return MapDescriptor.class;
}
/*

View file

@ -121,7 +121,7 @@ public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
ListResponse response = new ListResponse();
response.context = context;
response.isDirectory = localFile.isDirectory();
response.isProtected = false;
response.protectedLevel = null;
response.existsOnServer = false;
response.fileName = p;
response.date = new Date(localFile.lastModified());
@ -155,7 +155,7 @@ public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
response.context = ctx;
response.existsOnServer = false;
response.fileName = fileName;
response.isProtected = false;
response.protectedLevel = null;
File file = getPath(ctx, fileName);
if (file == null) {
response.isDirectory = false;

View file

@ -197,7 +197,7 @@ public class GLStats {
" * GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = %dMB\n",
nvxDedicatedMem / 1024));
output.append(String.format(
" * GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = %dMB\n",
" * GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = %dMB\n",
nvxTotalAvailableMem / 1024));
output.append(String.format(
" * GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = %dMB\n",

View file

@ -177,7 +177,7 @@ public class GLShadedShapeBase implements IShape {
for (FloatBuffer[] contours : polygons) {
glu.gluTessProperty(tessellator, GLU.GLU_TESS_WINDING_RULE,
GLU.GLU_TESS_WINDING_NONZERO);
GLU.GLU_TESS_WINDING_ODD);
glu.gluTessBeginPolygon(tessellator, (double[]) null);
int polygonStart = vertexBuffer.position() / 2;
for (FloatBuffer contour : contours) {

View file

@ -53,7 +53,8 @@ import com.raytheon.uf.viz.core.rsc.ResourceList;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 28, 2011 mpduff Initial creation
* Jan 28, 2011 mpduff Initial creation.
* Sep 11, 2012 1162 mpduff Made mergeMetaDataMap method public.
*
* </pre>
*
@ -117,7 +118,7 @@ public class VizGroupResourceData extends AbstractRequestableResourceData
return resource;
}
private void mergeMetadataMap() {
public void mergeMetadataMap() {
if ((this.metadataMap == null) || this.metadataMap.isEmpty()) {
this.metadataMap = new HashMap<String, RequestConstraint>();

View file

@ -170,10 +170,8 @@ public class GriddedImageDisplay2 extends AbstractTileSet {
private IImage createShortTile(IGraphicsTarget target, Rectangle rect,
int width, int i, int j) {
// short is 2 bytes
int elemSize = 2;
// buffer to copy into
short[] dest = new short[rect.width * rect.height * elemSize];
short[] dest = new short[rect.width * rect.height];
ShortBuffer srcBuff = (ShortBuffer) data;
short[] tmp = new short[rect.width];

View file

@ -23,7 +23,7 @@ Table of Contents<br>
<p><br>
<tt>cave.sh [-server hostname:port/services] [-mode TEST|PRACTICE|OPERATIONAL] [-site xxx]
[-u user] [-component componentName] [-perspective perspecitiveName] [-noredirect]
[-consoleLog]<br>
[-consoleLog] [-nc TRUE]<br>
<br>
<table nosave="" border="1" width="100%">
<tbody>
@ -77,6 +77,15 @@ Table of Contents<br>
<td>Causes the CAVE log to be output to the console for monitoring/debugging.
</td>
</tr>
<tr>
<td>-nc</td>
<td>YES</td>
<td>This option is only used by Service backup. It is used to indicate that the site is
a national center, consequently a non-primary site gets special permission to export
site configuration to the central server via the Service Backup GUI. This option should
be set to 'true', i.e., -nc true.
</td>
</tr>
</tbody>
</table>
</p>

View file

@ -159,8 +159,9 @@ This item keyboard shortcuts. You are allowed up to 200
shortcuts.&nbsp;
IMPORTANT:&nbsp; You should test your shortcuts on your system as many
keys are already bound by the system.&nbsp; For example, F10 is bound
by
some Tk widgets to bring up menus.
by some Tk widgets to bring up menus. Please note that AWIPS2 replaces
the KP_ syntax with the NUMPAD_ syntax, i.e. KP_Add in AWIPS1 becomes
NUMPAD_ADD in AWIPS2.
<p>Each shortcut is defined by a list with entries: </p>
<blockquote><li>Shortcut key</li>
<li>State of ShortCut key</li>
@ -198,10 +199,10 @@ Examples:
<p><b><tt>ShortCut1 = ["F1", "None",
"SmartTool","Assign_Value"]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# F1</tt></b> <br>
<b><tt>ShortCut2 = ["KP_Subtract", "None",
<b><tt>ShortCut2 = ["NUMPAD_SUBTRACT", "None",
"SmartTool","AdjustValue_Down"]
# Keypad -</tt></b> <br>
<b><tt>ShortCut3 = ["KP_Add", "None",
<b><tt>ShortCut3 = ["NUMPAD_ADD", "None",
"SmartTool","AdjustValue_Up"]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# Keypad +</tt></b> <br>
<b><tt>ShortCut4 = ["F2", "None", "SmartTool","Smooth"]</tt></b> <br>

View file

@ -25,6 +25,9 @@ import java.util.Collection;
import java.util.Date;
import java.util.List;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.uf.common.dataplugin.gfe.slice.DiscreteGridSlice;
@ -37,6 +40,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.util.RWLArrayList;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.griddata.AbstractGridData;
import com.raytheon.viz.gfe.core.griddata.IGridData;
@ -107,8 +111,13 @@ public class VCParm extends VParm implements IParmListChangedListener,
// Need to check that the above call to mod.getGpi() did not fail
if (!mod.isValid()) {
statusHandler.handle(Priority.EVENTB, "Can't get GPI: ",
this.mod.getErrorString());
//statusHandler.handle(Priority.EVENTB, "Can't get GPI: ",
// this.mod.getErrorString());
Activator
.getDefault()
.getLog()
.log(new Status(IStatus.INFO, Activator.PLUGIN_ID,
"Can't get GPI: " + this.mod.getErrorString()));
}
// set the parm type
@ -455,9 +464,14 @@ public class VCParm extends VParm implements IParmListChangedListener,
// get list of dependent parms
List<ParmID> args = new ArrayList<ParmID>(mod.dependentParms());
if (!mod.isValid()) {
statusHandler.handle(Priority.EVENTB,
"Error getting dependent WeatherElements: ",
mod.getErrorString());
//statusHandler.handle(Priority.EVENTB,
// "Error getting dependent WeatherElements: ",
// mod.getErrorString());
Activator
.getDefault()
.getLog()
.log(new Status(IStatus.INFO, Activator.PLUGIN_ID,
"Error getting dependent WeatherElements: " + this.mod.getErrorString()));
}
// get list of currently registered parms

View file

@ -21,7 +21,6 @@ package com.raytheon.viz.gfe.dialogs;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@ -32,8 +31,6 @@ import java.util.TimeZone;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.GFEServerException;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.IParmManager;
/**
@ -48,6 +45,10 @@ import com.raytheon.viz.gfe.core.IParmManager;
* 04/30/2009 2282 rjpeter Refactored interfaces.
* 08/19/2009 2547 rjpeter Implement Test/Prac database display.
* 02/22/2012 14351 mli update with incoming databases
* 09/12/2012 #1117 dgilling Revert previous changes, force
* source list to always rebuild to ensure
* up to date db list.
*
* </pre>
*
* @author ebabin
@ -58,7 +59,7 @@ public class WEBrowserTypeRecord {
private String type;
private java.util.List<String> sources = new ArrayList<String>();
private List<String> sources = new ArrayList<String>();
public static final SimpleDateFormat SOURCE_FORMAT = new SimpleDateFormat(
"dd/HHmm");
@ -77,12 +78,14 @@ public class WEBrowserTypeRecord {
*/
private Map<String, Map<String, List<String>>> miscMap = new HashMap<String, Map<String, List<String>>>();
private ParmID possibleParms[];
private ParmID[] possibleParms;
private ParmID fields[];
private ParmID[] fields;
private final CAVEMode mode;
private final IParmManager parmMgr;
static {
SOURCE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
}
@ -90,9 +93,10 @@ public class WEBrowserTypeRecord {
/**
* @return the type
*/
public WEBrowserTypeRecord(String type, CAVEMode mode) {
public WEBrowserTypeRecord(String type, CAVEMode mode, IParmManager parmMgr) {
this.type = type;
this.mode = mode;
this.parmMgr = parmMgr;
// create and fill these entries on creation of this type.
makeSources();
// go ahead and fill the ParmID[] array.
@ -115,14 +119,7 @@ public class WEBrowserTypeRecord {
* @return the sources
*/
public java.util.List<String> getSources() {
return sources;
}
/**
* @return the sources
*/
public java.util.List<String> getUpdatedSources() {
makeSources();
makeSources();
return sources;
}
@ -136,7 +133,7 @@ public class WEBrowserTypeRecord {
return fields;
}
private ArrayList<DatabaseID> getDbsForType(String typeLabel) {
private List<DatabaseID> getDbsForType(String typeLabel) {
boolean pracFlag = false;
boolean testFlag = false;
@ -145,19 +142,9 @@ public class WEBrowserTypeRecord {
pracFlag = mode.equals(CAVEMode.PRACTICE);
testFlag = mode.equals(CAVEMode.TEST);
}
// List<DatabaseID> dbs = DataManager.getCurrentInstance()
// .getParmManager().getAvailableDbs();
List<DatabaseID> dbs = parmMgr.getAvailableDbs();
// Always retrieve updated databases
List<DatabaseID> dbs = null;
try {
dbs = DataManager.getCurrentInstance().getClient().getAvailableDbs();
} catch (GFEServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ArrayList<DatabaseID> filtDB = new ArrayList<DatabaseID>();
List<DatabaseID> filtDB = new ArrayList<DatabaseID>();
for (DatabaseID db : dbs) {
if (db.getDbType().equalsIgnoreCase(typeLabel)) {
@ -167,88 +154,89 @@ public class WEBrowserTypeRecord {
} else if (db.getDbType().equalsIgnoreCase("Test") && testFlag) {
filtDB.add(db);
}
}
return filtDB;
}
private void makeSources() {
ArrayList<DatabaseID> databases = getDbsForType(type);
IParmManager parmMgr = DataManager.getCurrentInstance()
.getParmManager();
// clear all existing data as we will end up rebuilding it here...
sources.clear();
fieldMap.clear();
miscMap.clear();
pressureMap.clear();
// move mutable to front of list.
DatabaseID mutableDb = parmMgr.getMutableDatabase();
if (databases.indexOf(mutableDb) > 0) {
databases.remove(mutableDb);
databases.add(0, mutableDb);
}
List<DatabaseID> databases = getDbsForType(type);
final DatabaseID mutableDb = parmMgr.getMutableDatabase();
Collections.sort(databases, new Comparator<DatabaseID>() {
@Override
public int compare(DatabaseID left, DatabaseID right) {
String compare1 = null == left.getModelName() ? "" : left
.getModelName();
String compare2 = null == right.getModelName() ? "" : right
.getModelName();
int returnValue = compare1.compareTo(compare2);
if (0 == returnValue) {
compare1 = null == left.getModelTime() ? "" : left
.getModelTime();
compare2 = null == right.getModelTime() ? "" : right
.getModelTime();
returnValue = -1 * compare1.compareTo(compare2);
// sorting rules for WeatherElementBrowser:
// mutable first
// singletons next in alpha order
// rest in order first by name, then time (newest to oldest)
if (left.equals(right)) {
return 0;
}
return returnValue;
if (left.equals(mutableDb)) {
return -1;
} else if (right.equals(mutableDb)) {
return 1;
}
String leftModelTime = (left.getModelTime() != null ? left
.getModelTime() : "");
String rightModelTime = (right.getModelTime() != null ? right
.getModelTime() : "");
if (leftModelTime.equals(DatabaseID.NO_MODEL_TIME)
&& (!rightModelTime.equals(DatabaseID.NO_MODEL_TIME))) {
return -1;
} else if (!leftModelTime.equals(DatabaseID.NO_MODEL_TIME)
&& (rightModelTime.equals(DatabaseID.NO_MODEL_TIME))) {
return 1;
} else if (leftModelTime.equals(DatabaseID.NO_MODEL_TIME)
&& (rightModelTime.equals(DatabaseID.NO_MODEL_TIME))) {
return left.getModelName().compareTo(right.getModelName());
}
int modelNameCompare = left.getModelName().compareTo(
right.getModelName());
if (modelNameCompare != 0) {
return modelNameCompare;
}
return -1 * leftModelTime.compareTo(rightModelTime);
}
});
for (DatabaseID dbase : databases) {
String sourceTime = dbase.getModelName();
if (dbase.getModelDate() != null) {
for (DatabaseID dbId : databases) {
String sourceString = dbId.getModelName();
if (dbId.getModelDate() != null) {
synchronized (SOURCE_FORMAT) {
sourceTime += " "
+ SOURCE_FORMAT.format(dbase.getModelDate());
sourceString += " "
+ SOURCE_FORMAT.format(dbId.getModelDate());
}
}
boolean srcAdded = false;
ParmID[] availParms = parmMgr.getAvailableParms(dbase);
if (availParms != null) {
for (ParmID parm : availParms) {
if (parm.getParmLevel().startsWith("MB")) {
addToMap(pressureMap, sourceTime, parm.getParmName(),
parm.getParmLevel());
} else {
addToMap(miscMap, sourceTime, parm.getParmName(),
parm.getParmLevel());
}
DatabaseID parmDB = parm.getDbId();
if (parmDB.getModelName().equalsIgnoreCase(
dbase.getModelName())
&& parmDB.getModelTime().equalsIgnoreCase(
dbase.getModelTime())
&& parmDB.getDbType().equalsIgnoreCase(
dbase.getDbType())) {
if (!sources.contains(sourceTime)) {
sources.add(sourceTime);
srcAdded = true;
}
}
}
if (srcAdded) {
// create a list...
ArrayList<ParmID> ids = new ArrayList<ParmID>();
for (ParmID parm : availParms) {
ids.add(parm);
}
java.util.Collections.sort(ids);
sources.add(sourceString);
fieldMap.put(sourceTime,
ids.toArray(new ParmID[ids.size()]));
ParmID[] availParms = parmMgr.getAvailableParms(dbId);
List<ParmID> sortedParms = new ArrayList<ParmID>(availParms.length);
for (ParmID parm : availParms) {
if (parm.getParmLevel().startsWith("MB")) {
addToMap(pressureMap, sourceString, parm.getParmName(),
parm.getParmLevel());
} else {
addToMap(miscMap, sourceString, parm.getParmName(),
parm.getParmLevel());
}
sortedParms.add(parm);
}
Collections.sort(sortedParms);
fieldMap.put(sourceString,
sortedParms.toArray(new ParmID[sortedParms.size()]));
}
}
@ -420,11 +408,10 @@ public class WEBrowserTypeRecord {
*/
public ParmID[] getPossibleParmIDs() {
if (possibleParms == null) {
ArrayList<DatabaseID> databases = getDbsForType(type);
List<DatabaseID> databases = getDbsForType(type);
ArrayList<ParmID> parmIds = new ArrayList<ParmID>();
for (DatabaseID db : databases) {
ParmID ids[] = DataManager.getCurrentInstance()
.getParmManager().getAvailableParms(db);
ParmID ids[] = parmMgr.getAvailableParms(db);
for (int i = 0; i < ids.length; i++) {
parmIds.add(ids[i]);
}
@ -437,25 +424,6 @@ public class WEBrowserTypeRecord {
return possibleParms;
}
/**
* Add ParmIDs for new database
*/
public void addNewParmIDs(String newSource) {
ArrayList<ParmID> parmIds = new ArrayList<ParmID>();
possibleParms = getPossibleParmIDs();
parmIds.addAll(Arrays.asList(possibleParms));
ParmID ids[] = getFields(newSource);
for ( int i = 0; i < ids.length; i++) {
if (!parmIds.contains(ids[i])) {
parmIds.add(ids[i]);
}
}
possibleParms = new ParmID[parmIds.size()];
parmIds.toArray(possibleParms);
}
public ArrayList<ParmID> getFilteredParmIDs(String sources[],
String fields[], String planes[]) {
ArrayList<ParmID> listToReturn = new ArrayList<ParmID>();

View file

@ -51,7 +51,6 @@ import org.eclipse.swt.widgets.ToolItem;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.GFEServerException;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.parm.Parm;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
@ -69,7 +68,10 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
* 06/27/2008 ebabin Updated to properly add fields.
* 04/30/2009 2282 rjpeter Refactored.
* 08/19/2009 2547 rjpeter Fix Test/Prac database display.
* 02/22/2012 14351 mli update with incoming new grids.
* 02/22/2012 14351 mli update with incoming new grids.
* 09/12/2012 #1117 dgilling Revert previous changes, retrieve
* database list from ParmManager
* not EDEX.
* </pre>
*
* @author ebabin
@ -107,8 +109,6 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
private ParmID[] currentDisplayedParms;
private List<DatabaseID> databases;
private static final Point size = new Point(603, 778);
private static final String IFP = "IFP";
@ -499,7 +499,6 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
* Automatically checks for dups, and sorts.
*/
private void updateSourceMenu() {
sourceList.removeAll();
resetMenu(sourceMenu);
List<String> sortedSources = selectedType.getSources();
@ -519,48 +518,6 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
}
}
/*
* check for incoming new databases
*/
private void checkForNewSource() {
List<String> sortedSources = selectedType.getUpdatedSources();
if (sortedSources != null) {
List<String> newSources = new ArrayList<String>();
// Check for new new database
for (String source : sortedSources) {
boolean found = false;
for (int i = 0; i < sourceMenu.getItemCount(); i++) {
if (sourceMenu.getItem(i).getText().equals(source)) {
found = true;
break;
}
}
if (!found) {
newSources.add(source);
}
}
// create menuItem for new database
if (newSources != null) {
for (String s : newSources) {
selectedType.addNewParmIDs(s);
final MenuItem item = new MenuItem(sourceMenu, SWT.PUSH);
item.setText(s);
item.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
addToList(item.getText(), sourceList);
processSourceSelection();
}
});
}
}
}
}
private void processSourceSelection() {
java.util.List<String> currentSourceSelection = java.util.Arrays
.asList(sourceList.getSelection());
@ -858,9 +815,7 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
sourceToolItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
// Check for new source
checkForNewSource();
updateSourceMenu();
Rectangle rect = sourceToolItem.getBounds();
Point pt = new Point(rect.x, rect.y + rect.height);
pt = sourceToolBar.toDisplay(pt);
@ -1208,10 +1163,11 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
final CAVEMode mode = CAVEMode.getMode();
if (mutableID.getDbType().equalsIgnoreCase("")) {
typeEntries.add(new WEBrowserTypeRecord(IFP, mode));
typeEntries.add(new WEBrowserTypeRecord(IFP, mode, dataManager
.getParmManager()));
} else {
typeEntries
.add(new WEBrowserTypeRecord(mutableID.getDbType(), mode));
typeEntries.add(new WEBrowserTypeRecord(mutableID.getDbType(),
mode, dataManager.getParmManager()));
}
for (DatabaseID database : getDatabases()) {
@ -1229,7 +1185,8 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
databaseType = IFP;
}
typeEntries.add(new WEBrowserTypeRecord(databaseType, mode));
typeEntries.add(new WEBrowserTypeRecord(databaseType, mode,
dataManager.getParmManager()));
}
if (!siteList.contains(database.getSiteId())) {
siteList.add(database.getSiteId());
@ -1251,19 +1208,7 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
}
private List<DatabaseID> getDatabases() {
if (databases == null) {
// databases = dataManager.getParmManager().getAvailableDbs();
// Always Retrieve updated databases
try {
databases = DataManager.getCurrentInstance().getClient().getAvailableDbs();
} catch (GFEServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return databases;
return dataManager.getParmManager().getAvailableDbs();
}
private ParmID[] getSelectedParmIDS() {
@ -1294,6 +1239,7 @@ public class WeatherElementBrowserDialog extends CaveJFACEDialog {
*
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
@Override
public int compare(String s1, String s2) {
// we expect pressure strings to read MBnnnn (e.g., MB100 or
// MB1000), thus we'll strip the first two letters of the strings

View file

@ -56,7 +56,8 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* 2 SEP 2011 10654 gzhou Delete running/pending task and close tab.
* 23 MAY 2012 14859 ryu Select VTEC formatting in practice mode
* based on VTECMessageType setting.
* 10 AUG 2012 15178 mli Add autoWrite and autoStore capability
* 10 AUG 2012 15178 mli Add autoWrite and autoStore capability
* 26 SEP 2012 15423 ryu Fix product correction in practice mode
*
* </pre>
*
@ -432,8 +433,11 @@ public class ProductAreaComp extends Composite implements
int pracType = 0;
if (practiceMode) {
String pil = (String) textProductMgr.getProductDefinition(productName)
.get("pil");
String pil = null;
if (textProductMgr.getProductDefinition(productName) != null) {
pil = (String) textProductMgr.getProductDefinition(productName)
.get("pil");
}
if (pil != null) {
String vtecMode = textProductMgr.getVtecMessageType(
pil.substring(0, 3));
@ -643,7 +647,7 @@ public class ProductAreaComp extends Composite implements
if (productText != null) {
productEditorComp.retrieveActiveVTEC();
productEditorComp.setProductText(productText);
// handle autoWrite and autoStore...
productEditorComp.doAutoStuff();
}

View file

@ -1,19 +1,19 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
@ -67,7 +67,7 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
/**
* Composite containing the product editor.
*
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
@ -75,12 +75,13 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
* 05 Jan 2008 1784 lvenable Initial creation
* 19 Feb 2010 4132 ryu Product correction.
* 30 Jul 2010 6719 jnjanga Placed cursor at the end of inserted CTA
*
* 26 Sep 2012 15423 ryu Avoid resetting text when possible.
*
* </pre>
*
*
* @author lvenable
* @version 1.0
*
*
*/
public class StyledTextComp extends Composite {
private static final transient IUFStatusHandler statusHandler = UFStatus
@ -179,7 +180,7 @@ public class StyledTextComp extends Composite {
/**
* Constructor.
*
*
* @param parent
* Parent composite.
*/
@ -297,7 +298,7 @@ public class StyledTextComp extends Composite {
/**
* Get the StyledText editor.
*
*
* @return The StyledText editor.
*/
public StyledText getTextEditorST() {
@ -306,7 +307,7 @@ public class StyledTextComp extends Composite {
/**
* Set the product text.
*
*
* @param text
* The product text.
*/
@ -324,7 +325,7 @@ public class StyledTextComp extends Composite {
/**
* computes the logical caret offset within the ProductEditor as a result of
* the CTA insert.
*
*
* @param newProductText
* The new product text
*/
@ -483,7 +484,7 @@ public class StyledTextComp extends Composite {
/**
* Parse the product text string.
*
*
* @param productText
*/
private void parseProductText(String productText) {
@ -669,7 +670,7 @@ public class StyledTextComp extends Composite {
/**
* Handle the verify key event. This event fires after a change has been
* made to the control (after the text has been updated, for example)
*
*
* @param event
* Verify event that was fired.
*/
@ -765,7 +766,7 @@ public class StyledTextComp extends Composite {
/**
* Handle the key event when a key is released.
*
*
* @param ke
* Key event.
*/
@ -787,7 +788,7 @@ public class StyledTextComp extends Composite {
/**
* Check if there is selected text and if there is locked text in the
* selected text.
*
*
* @return True if there is selected text that contains locked text.
*/
private boolean selectionHasLockedText() {
@ -801,12 +802,12 @@ public class StyledTextComp extends Composite {
/**
* Check if there is locked text in the specified range of text.
*
*
* @param offset
* The starting point of the locked text search.
* @param length
* The length of the search.
*
*
* @return Whether or not there is text in the range that contains locked
* text.
*/
@ -824,7 +825,7 @@ public class StyledTextComp extends Composite {
/**
* Select the framing code and the text contained in the framing code.
*
*
* @param sr
* StyleRange.
*/
@ -836,7 +837,7 @@ public class StyledTextComp extends Composite {
/**
* Check if the key being pressed is a "non-edit" key.
*
*
* @param event
* Verify event.
* @return True if the key is an arrow or "non-edit" key.
@ -870,7 +871,7 @@ public class StyledTextComp extends Composite {
/**
* Handle the mouse down event.
*
*
* @param e
* Event fired.
*/
@ -905,7 +906,7 @@ public class StyledTextComp extends Composite {
/**
* Handle the mouse up event
*
*
* @param e
* Event fired.
*/
@ -1012,7 +1013,7 @@ public class StyledTextComp extends Composite {
/**
* Checks if the system is editing, e.g. updating the issue time every
* minute, vs a user typing text in the text area
*
*
* @return
*/
private boolean isSystemTextChange() {
@ -1036,7 +1037,18 @@ public class StyledTextComp extends Composite {
dirty = false;
}
protected boolean isUpperCase(final String word) {
for (int index= word.length() - 1; index >= 0; index--) {
if (Character.isLowerCase(word.charAt(index)))
return false;
}
return true;
}
protected void upper() {
String text = textEditorST.getText();
if (isUpperCase(text))
return;
int topIdx = textEditorST.getTopIndex();
setProductText(textEditorST.getText().toUpperCase());
textEditorST.setTopIndex(topIdx);
@ -1152,7 +1164,7 @@ public class StyledTextComp extends Composite {
/**
* Getter for the column at which wrap and auto-wrap will wrap the text.
*
*
* @return the column number
*/
public int getWrapColumn() {
@ -1161,7 +1173,7 @@ public class StyledTextComp extends Composite {
/**
* Getter for the column at which wrap and auto-wrap will wrap the text.
*
*
* @param wrapColumn
* the column number
*/
@ -1200,7 +1212,7 @@ public class StyledTextComp extends Composite {
/**
* Query the prefs for setting. If it does not exist, use colorDft as its
* value. Create an SWT Color for display from the value and return it.
*
*
* @param prefs
* A preference store which might have config values.
* @param display
@ -1223,7 +1235,7 @@ public class StyledTextComp extends Composite {
/**
* Send a PROBLEM message if color1 is exactly equal to color2.
*
*
* @param color1
* the first color
* @param color2
@ -1250,7 +1262,7 @@ public class StyledTextComp extends Composite {
* <p>
* The getter name is different to avoid confusion with the getFgColor()
* method of Control.
*
*
* @return the foreground Color
*/
public Color getFgndColor() {
@ -1261,7 +1273,7 @@ public class StyledTextComp extends Composite {
* Get the framed text color of the StyledTextComp. This is the actual
* color, not a copy. It will be disposed when the StyledTextComp is, and
* should not be disposed before then.
*
*
* @return the frameColor
*/
public Color getFrameColor() {
@ -1272,7 +1284,7 @@ public class StyledTextComp extends Composite {
* Get the insert color of the StyledTextComp. This is the actual color, not
* a copy. It will be disposed when the StyledTextComp is, and should not be
* disposed before then.
*
*
* @return the insertColor
*/
public Color getInsertColor() {
@ -1283,7 +1295,7 @@ public class StyledTextComp extends Composite {
* Get the locked text color of the StyledTextComp. This is the actual
* color, not a copy. It will be disposed when the StyledTextComp is, and
* should not be disposed before then.
*
*
* @return the lockColor
*/
public Color getLockColor() {
@ -1293,7 +1305,7 @@ public class StyledTextComp extends Composite {
/**
* Word wrap the text in the block around cursorIndex. Adjust the cursor
* position to account for inserted or deleted whitespace.
*
*
* @param st
* The StyledText in which word wrap is to be performed
* @param cursorIndex

View file

@ -1198,7 +1198,7 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
+ UserController.getUserObject().uniqueId());
}
if (!runningAsPrimary) {
if ((!runningAsPrimary) && (!LocalizationManager.getInstance().isNationalCenter())) {
doExCon.setEnabled(false);
}
}

View file

@ -29,6 +29,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TimeZone;
@ -226,6 +227,8 @@ public class MakeHazardDialog extends CaveSWTDialog implements
private boolean running;
private org.eclipse.swt.widgets.List hazardGroupList;
public MakeHazardDialog(Shell parent, DataManager dataManager,
String colorName, int defaultMapWidth, int timeScaleEndTime,
float areaThreshold, String defaultHazardType,
@ -235,7 +238,8 @@ public class MakeHazardDialog extends CaveSWTDialog implements
Map<String, List<String>> localEffectAreas,
Map<String, List<Object>> localAreaData) {
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK
| CAVE.NO_PACK);
this.dataManager = dataManager;
this.defaultMapWidth = defaultMapWidth;
this.timeScaleEndTime = timeScaleEndTime;
@ -279,6 +283,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
protected void initializeComponents(Shell shell) {
// Initialize all of the controls and layouts
initializeComponents();
shell.pack();
this.comboDict = new HashMap<String, Integer>();
setHazardType(this.defaultHazardType);
@ -1012,9 +1017,8 @@ public class MakeHazardDialog extends CaveSWTDialog implements
}
};
org.eclipse.swt.widgets.List hazardGroupList = new org.eclipse.swt.widgets.List(
hazardTypeGroup, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL
| SWT.SINGLE);
hazardGroupList = new org.eclipse.swt.widgets.List(hazardTypeGroup,
SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
gd.heightHint = hazardGroupList.getItemHeight() * 12
+ hazardGroupList.getBorderWidth();
@ -1100,6 +1104,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
// create the start time slider
startTimeSlider = new Scale(startGroup, SWT.HORIZONTAL);
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
gd.minimumWidth = 200;
startTimeSlider.setLayoutData(gd);
startTimeSlider.addSelectionListener(new SelectionListener() {
@ -1130,7 +1135,6 @@ public class MakeHazardDialog extends CaveSWTDialog implements
startTimeSlider.setMaximum(this.timeScaleEndTime);
startTimeSlider.setIncrement(1);
startTimeSlider.setPageIncrement(1);
startTimeSlider.setLayoutData(new GridData(200, SWT.DEFAULT));
// Force start time to an hourly boundary
Calendar cal = Calendar.getInstance();
@ -1158,6 +1162,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
// Create the end time slider
endTimeSlider = new Scale(endGroup, SWT.HORIZONTAL);
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
gd.minimumWidth = 200;
endTimeSlider.setLayoutData(gd);
endTimeSlider.setMinimum(1);
@ -1165,7 +1170,6 @@ public class MakeHazardDialog extends CaveSWTDialog implements
endTimeSlider.setIncrement(1);
endTimeSlider.setPageIncrement(1);
endTimeSlider.setSelection(1);
endTimeSlider.setLayoutData(new GridData(200, SWT.DEFAULT));
endTimeSlider.addSelectionListener(new SelectionListener() {
@Override
@ -1215,6 +1219,21 @@ public class MakeHazardDialog extends CaveSWTDialog implements
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
leCombo.setLayoutData(gd);
leCombo.addSelectionListener(selAdapt);
GC gc = new GC(this.getDisplay());
String longest = "";
int widest = 0;
for (List<String> list : localEffectAreas.values()) {
for (String s : list) {
int width = gc.stringExtent(s).x;
if (width > widest) {
widest = width;
longest = s;
}
}
}
gc.dispose();
leCombo.add(longest);
}
private Map<String, List<String>> getHazardsDictionary() {
@ -1317,6 +1336,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
* the hazard type to select.
*/
public void setHazardType(String hazardType) {
hazardGroupList.setSelection(hazardGroupList.indexOf(hazardType));
updateSelectedHazardList(hazardType);
if (this.localEffectAreas.containsKey(hazardType)) {
@ -1345,9 +1365,15 @@ public class MakeHazardDialog extends CaveSWTDialog implements
leGroup.setVisible(false);
((GridData) leGroup.getLayoutData()).exclude = true;
this.hazLocalEffect = "None";
this.etnSegNumberField.setText("");
String s = etnSegNumberField.getText();
for (Entry<String, List<Object>> entry : localAreaData.entrySet()) {
if (s.equals(entry.getValue().get(0))) {
this.etnSegNumberField.setText("");
this.etnSegNumberField.setSelection(0);
break;
}
}
}
leGroup.getParent().pack();
}
/**
@ -1375,9 +1401,9 @@ public class MakeHazardDialog extends CaveSWTDialog implements
}
}
private void hazardLocalEffectSelected(String s) {
this.hazLocalEffect = s;
List<Object> laData = this.localAreaData.get(s);
private void hazardLocalEffectSelected(String le) {
this.hazLocalEffect = le;
List<Object> laData = this.localAreaData.get(le);
if (laData != null) {
// get the segment number
Integer segment = (Integer) laData.get(0);
@ -1387,8 +1413,15 @@ public class MakeHazardDialog extends CaveSWTDialog implements
this.etnSegNumberField.setSelection(segText.length());
} else {
this.etnSegNumberField.setText("");
this.etnSegNumberField.setSelection(0);
String s = etnSegNumberField.getText();
for (Entry<String, List<Object>> entry : localAreaData
.entrySet()) {
if (s.equals(entry.getValue().get(0))) {
this.etnSegNumberField.setText("");
this.etnSegNumberField.setSelection(0);
break;
}
}
}
@SuppressWarnings("unchecked")

View file

@ -19,6 +19,19 @@
**/
package com.raytheon.viz.grid.rsc;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.viz.core.rsc.VizGroupResourceData;
@ -31,7 +44,8 @@ import com.raytheon.viz.core.rsc.VizGroupResourceData;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 28, 2011 mpduff Initial creation
* Jan 28, 2011 mpduff Initial creation.
* Sep 11, 2012 1162 mpduff Override getAvailableTimes method.
*
* </pre>
*
@ -44,4 +58,31 @@ public class FfgVizGroupResourceData extends VizGroupResourceData {
// Make name generator here
nameGenerator = new FfgGridNameGenerator();
}
@Override
public DataTime[] getAvailableTimes() throws VizException {
Set<DataTime> baseTimes = new HashSet<DataTime>();
Iterator<ResourcePair> rpIter = resourceList.iterator();
super.mergeMetadataMap();
List<DataTime> availableTimes = new ArrayList<DataTime>();
while (rpIter.hasNext()) {
ResourcePair rp = rpIter.next();
if (rp.getResourceData() instanceof AbstractRequestableResourceData) {
AbstractRequestableResourceData arrd = (AbstractRequestableResourceData) rp
.getResourceData();
Collection<DataTime> times = Arrays.asList(arrd
.getAvailableTimes());
baseTimes.addAll(times);
}
}
availableTimes.addAll(baseTimes);
Collections.sort(availableTimes);
return availableTimes.toArray(new DataTime[availableTimes.size()]);
}
}

View file

@ -79,7 +79,7 @@ public class TimeSeriesDataManager extends HydroDataManager {
private static final String TIME_SERIES_DATA_QUERY = "select lid,obstime,lid,product_id from latestobsvalue";
private String INGEST_FILTER_QUERY = "select lid,pe,ts,extremum,dur from ingestfilter where lid=':lid' and ingest = 'T' order by pe asc,dur asc,ts asc,extremum asc";
private String INGEST_FILTER_QUERY = "select lid,pe,ts,extremum,dur from ingestfilter where lid=':lid' and ingest = 'T' order by pe asc,ts_rank asc,dur asc,ts asc,extremum asc";
private String SHEF_PE_QUERY = "select name||' '|| eng_unit from shefpe where pe=':pe'";
@ -1386,4 +1386,4 @@ public class TimeSeriesDataManager extends HydroDataManager {
public Map<String, String> getStationDisplayMap() {
return stnDisplayMap;
}
}
}

View file

@ -1165,7 +1165,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
/* loop through each trace and set the min and max values */
for (int i = 0; i < gd.getTraces().size(); i++) {
td = gd.getTraceData(i);
if (td != null) {
if (td != null && td.isTraceOn()) {
TimeSeriesPoint[] points = null;
if (zoomed) {
points = td.getZoomedTsData();
@ -2572,9 +2572,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
traceData.setName(name);
traceData.setBasistime(basisTime);
traceData.setProductTime(productTime);
if (this.latestFcstFlag) {
traceData.setTraceOn(false);
}
traceData.setTraceOn(!this.latestFcstFlag);
} else {
/* reached max fcst traces, break out of loop */
break;
@ -2802,4 +2800,5 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
public void setZoomed(boolean zoomed) {
this.zoomed = zoomed;
}
}

View file

@ -115,7 +115,9 @@ import com.raytheon.viz.hydrocommon.util.StnClassSyncUtil;
* 23 Jul 2012 15195 mpduff Fix Group graphing to use the date widgets.
* 08 Aug 2012 570 mpduff Fix a Ctrl-F in Station list causing IndexOutOfBounds error.
* 08 Aug 2012 657 mpduff Fix error when selecting a TS while no selection has been made
* in the Station List.
* in the Station List.
* 27 Sep 2012 15302 wkwock TimeSeries start mode should depends on token timeseries_mode
* despite start up in CAVE or standalone.
* </pre>
*
* @author lvenable
@ -173,9 +175,9 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
private static final String COLOR = "color";
private static final String[] TS_LIST = { "RG", "RP", "RZ", "FF", "FX",
"FZ" };
// private static final String[] TS_LIST = { "RG", "RP", "RZ", "FF", "FX",
// "FZ" };
private final String[] TS_ORDER = { "R", "F", "P", "M", "C" };
/**
@ -675,10 +677,6 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
openTimeSeriesDisplays = false;
}
if (this.standaloneMode) {
this.updateInterfaceForStandalone();
}
AbstractVizResource<?,?> rsc = HydroDisplayManager.getInstance().getDisplayedResource();
if (rsc instanceof MultiPointResource) {
((MultiPointResource) rsc).setTs(this);
@ -726,8 +724,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
if (startMode.equals("GROUP") && (displayGraph == false)) {
@ -1143,8 +1140,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
shell.setCursor(arrowCursor);
}
@ -1188,8 +1184,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
shell.setCursor(arrowCursor);
}
@ -1629,8 +1624,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
}
in.close();
} catch (IOException e) {
// TODO add log statement about group_definition.cfg not found
e.printStackTrace();
statusHandler.error("Failed to read group definition configuration.", e);
}
}
@ -1642,8 +1636,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
filteredLidList = new ArrayList<String>();
topDataList.removeAll();
@ -1668,8 +1661,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
return;
} else {
@ -1900,8 +1892,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
} else if (values[0].equalsIgnoreCase(FUTUREHOURS)) {
groupInfo.setFutureHours(Integer.parseInt(values[1]));
} else {
// TODO log a message about invalid key/value pair
System.err.println("Invalid key/value pair: " + s);
statusHandler.warn("Invalid key/value pair: " + s);
}
}
}
@ -1950,8 +1941,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
graphData.setLatestfcstonly(false);
}
} else {
// TODO log a message about invalid key/value pair
System.err.println("Invalid key/value pair: " + s);
statusHandler.warn("Invalid key/value pair: " + s);
}
}
}
@ -1986,8 +1976,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
graphData.setEndDate(endDate);
} else {
// TODO log error here, invalid value
System.err.println("Error in Group Definition Config file: " + line);
statusHandler.warn("Error in Group Definition Config file: " + line);
}
// select the first item in the list
@ -2290,20 +2279,6 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
}
}
/**
* Change the selected mode to group selection mode and display the groups
* in the user-defined group configuration file.
*/
private void updateInterfaceForStandalone() {
this.modeCbo.select(0);
this.prevModeIdx = 0;
stackLayout.topControl = groupGroup;
stackComp.layout();
stnLayoutDisplayed = false;
this.populateGroupListForStandalone();
}
/**
* Validate the user's selections.
*
@ -2518,8 +2493,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
try {
populateStationList();
} catch (VizException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.error("Failed to populate station list", e);
}
setCurrentData();
opened();

View file

@ -50,6 +50,7 @@ import com.raytheon.viz.hydrocommon.HydroConstants;
* Nov 4, 2008 1662 grichard Initial creation.
* 11/19/2008 1662 grichard Updated loadPeRaw.
* 11/24/2008 1662 grichard Added utility methods for raw precip.
* 09/26/2012 15385 lbousaidi fixed duplicate entries in gage table.
* </pre>
*
* @author grichard
@ -188,8 +189,8 @@ public final class PrecipUtil {
*/
public static final String SUM_PC_REPORTS = "sum_pc_reports";
static {
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
static {
sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
}
@ -1553,10 +1554,18 @@ public final class PrecipUtil {
Calendar pTm = null;
pTm = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
pTm.setTime(query_begin_time);
if (pTm.get(Calendar.HOUR_OF_DAY) == 0) {
pTm.add(Calendar.HOUR_OF_DAY, -1);
pTm.add(Calendar.DAY_OF_MONTH, -1);
}
/* Need to convert the query begin and end times into dates. */
String beginstr = sdf.format(pTm.getTime());
pTm.setTime(query_end_time);
if (pTm.get(Calendar.HOUR_OF_DAY) == 0) {
pTm.add(Calendar.DAY_OF_MONTH, -1);
}
String endstr = sdf.format(pTm.getTime());
/* consider according to whether type-source specified. */
/* load data which is not missing value (-9999.0) */
@ -1572,15 +1581,12 @@ public final class PrecipUtil {
where.append(" AND ");
}
/* Need to convert the query begin and end times into dates. */
String beginstr = sdf.format(pTm.getTime());
String endstr = sdf.format(query_end_time);
where.append("id.obsdate between '");
where.append(beginstr);
where.append("' AND '");
where.append(endstr);
where.append("' ORDER BY id.lid ASC, id.ts ASC, id.obsdate ASC");
where.append("' ORDER BY id.lid ASC, id.ts ASC, id.obsdate ASC");
return where.toString();
}

View file

@ -142,7 +142,12 @@ public class LocalizationEditorInput implements IFileEditorInput,
*/
@Override
public String getToolTipText() {
return localizationFile.getName();
String tip = localizationFile.getName();
if (localizationFile.isProtected()) {
tip += " (Protected @ " + localizationFile.getProtectedLevel()
+ ")";
}
return tip;
}
/*

View file

@ -99,4 +99,46 @@ public class FileTreeEntryData {
return resource instanceof IFolder;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((path == null) ? 0 : path.hashCode());
result = prime * result
+ ((pathData == null) ? 0 : pathData.hashCode());
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FileTreeEntryData other = (FileTreeEntryData) obj;
if (path == null) {
if (other.path != null)
return false;
} else if (!path.equals(other.path))
return false;
if (pathData == null) {
if (other.pathData != null)
return false;
} else if (!pathData.equals(other.pathData))
return false;
return true;
}
}

View file

@ -62,4 +62,40 @@ public class LocalizationFileEntryData extends FileTreeEntryData {
return (IFile) super.getResource();
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((file == null) ? 0 : file.getContext().hashCode());
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
LocalizationFileEntryData other = (LocalizationFileEntryData) obj;
if (file == null) {
if (other.file != null)
return false;
} else if (!file.getContext().equals(other.file.getContext()))
return false;
return true;
}
}

View file

@ -198,21 +198,6 @@ public class PathData {
return application;
}
/**
* @param element
* the element to set
*/
public void setElement(IConfigurationElement element) {
this.element = element;
}
/**
* @return the element
*/
public IConfigurationElement getElement() {
return element;
}
/**
* @param recursive
* the recursive to set

View file

@ -145,26 +145,29 @@ public class PlotModelDataRequestJob extends Job {
// TODO need to determine if this type of plot is a combination or
// not
combineData(stationQuery);
if (monitor.isCanceled()) {
break;
}
synchronized (this) {
if (monitor.isCanceled()) {
break;
}
for (PlotInfo[] infos : stationQuery) {
// schedule next work for other jobs
// TODO investigate further, shouldn't be possible to get a null
// here, but somehow we do
if (infos[0].pdv != null) {
switch (task.getRequestType()) {
case PLOT_ONLY:
this.generatorJob.enqueue(infos);
break;
case SAMPLE_ONLY:
this.sampleJob.enqueue(infos);
break;
case PLOT_AND_SAMPLE:
this.generatorJob.enqueue(infos);
this.sampleJob.enqueue(infos);
break;
for (PlotInfo[] infos : stationQuery) {
// schedule next work for other jobs
// TODO investigate further, shouldn't be possible to get a
// null
// here, but somehow we do
if (infos[0].pdv != null) {
switch (task.getRequestType()) {
case PLOT_ONLY:
this.generatorJob.enqueue(infos);
break;
case SAMPLE_ONLY:
this.sampleJob.enqueue(infos);
break;
case PLOT_AND_SAMPLE:
this.generatorJob.enqueue(infos);
this.sampleJob.enqueue(infos);
break;
}
}
}
}
@ -342,13 +345,8 @@ public class PlotModelDataRequestJob extends Job {
&& generatorJob.isDone();
}
public void shutdown() {
public synchronized void shutdown() {
this.cancel();
try {
join();
} catch (InterruptedException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
this.generatorJob.shutdown();
}

View file

@ -32,7 +32,6 @@ import org.eclipse.core.runtime.jobs.Job;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.drawables.IImage;
@ -119,10 +118,15 @@ public class PlotModelGeneratorJob extends Job {
}
}
}
if (monitor.isCanceled()) {
break;
synchronized (this) {
if (monitor.isCanceled()) {
if(image != null){
image.dispose();
}
break;
}
caller.modelGenerated(infos, image);
}
caller.modelGenerated(infos, image);
} catch (Exception e) {
statusHandler.error("Error creating plot", e);
}
@ -153,14 +157,9 @@ public class PlotModelGeneratorJob extends Job {
return getState() != Job.RUNNING && getState() != Job.WAITING;
}
protected void shutdown() {
protected synchronized void shutdown() {
cancel();
taskQueue.clear();
try {
join();
} catch (InterruptedException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
clearImageCache();
}
}

View file

@ -44,7 +44,10 @@ import com.raytheon.uf.viz.core.rsc.ResourceList;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 7, 2009 jsanchez Initial creation
*
* ======================================
* AWIPS2 DR Work
* 20120913 1172 jkorman Added code to call postAddListeners when
* creating sub-resources.
* </pre>
*
* @author jsanchez
@ -78,6 +81,18 @@ public class PlotBlendedResourceData extends AbstractResourceData implements
}
/**
* Constructs a resource(s) from this resource data.
*
* @param loadProperties
* The load properties
* @param descriptor
* The descriptor that the resource will be loaded onto
* @throws VizException
* if construction fails
* @return The renderable capability. Will return null if any of the sub-resources
* fail to construct.
*/
@Override
public PlotBlendedResource construct(LoadProperties loadProperties,
IDescriptor descriptor) throws VizException {
@ -85,13 +100,16 @@ public class PlotBlendedResourceData extends AbstractResourceData implements
for (ResourcePair rp : resourceList) {
if (!rp.instantiateResource(descriptor, false)) {
// failure to create any sub resources is a failure to construct
// failure to create any sub-resource is a failure to construct
// the blended resource.
return null;
}
this.addChangeListener((IResourceDataChanged) rp.getResource());
}
// All sub-resources have been instantiated, add the listeners.
for (ResourcePair rp : resourceList) {
addChangeListener((IResourceDataChanged) rp.getResource());
resourceList.firePostAddListeners(rp);
}
return rsc;
}

View file

@ -402,11 +402,11 @@ public class PlotResource2 extends
@Override
protected void disposeInternal() {
resourceData.getPlotInfoRetriever().cancel();
progressiveDisclosure.shutdown();
if (generator != null) {
generator.shutdown();
}
resourceData.getPlotInfoRetriever().cancel();
progressiveDisclosure.shutdown();
clearImages();
}

View file

@ -18,7 +18,7 @@
<programArgsLin>-consoleLog</programArgsLin>
<vmArgs>-Xincgc -Xmx1280M -Dosgi.instance.area.readOnly=true
-Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook,org.eclipse.core.runtime.internal.adaptor.EclipseErrorHandler
-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -XX:OnOutOfMemoryError=&quot;capture -t no -p $pid &amp;&quot;</vmArgs>
-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -XX:OnOutOfMemoryError=&quot;capture -t no -p $pid &amp;&quot; -Dlog4j.configuration=log4j-viz-core.xml</vmArgs>
<vmArgsWin>-Dfile.encoding=UTF-8</vmArgsWin>
</launcherArgs>

View file

@ -17,7 +17,7 @@
<programArgs>-data @user.home/caveData -user @user.home/caveData -clean -consoleLog -alertviz</programArgs>
<vmArgs>-Xincgc -Xmx1024M -Dosgi.instance.area.readOnly=true
-Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.internal.adaptor.EclipseLogHook,org.eclipse.core.runtime.internal.adaptor.EclipseErrorHandler
-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false</vmArgs>
-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dorg.eclipse.update.reconcile=false -XX:MaxPermSize=128m -Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme -Dawips.mode=pypies -Dqpid.dest_syntax=BURL -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dlog4j.configuration=log4j-viz-core.xml</vmArgs>
<vmArgsWin>-Dfile.encoding=UTF-8</vmArgsWin>
</launcherArgs>
@ -36,7 +36,6 @@
</launcher>
<vm>
<linux include="true">jdk1.6.0</linux>
<windows include="true">jdk1.6.0</windows>
</vm>

View file

@ -27,15 +27,13 @@ import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.dataplugin.radar.util.RadarInfoDict;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.core.DescriptorMap;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
@ -44,9 +42,11 @@ import com.raytheon.uf.viz.productbrowser.AbstractRequestableProductBrowserDataD
import com.raytheon.uf.viz.productbrowser.ProductBrowserLabel;
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference;
import com.raytheon.viz.radar.rsc.RadarResourceData;
import com.raytheon.viz.radar.ui.xy.RadarGraphDescriptor;
import com.raytheon.viz.radar.ui.xy.RadarGraphDisplay;
import com.raytheon.viz.radar.ui.xy.RadarXYDescriptor;
import com.raytheon.viz.radar.ui.xy.RadarXYDisplay;
import com.raytheon.viz.ui.editor.EditorInput;
import com.raytheon.viz.ui.UiUtil;
/**
* Product browser implementation for radar
@ -174,40 +174,30 @@ public class RadarProductBrowserDataDefinition extends
return new RadarResourceData();
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.productbrowser.AbstractProductBrowserDataDefinition
* #getEditor()
*/
@Override
public void getEditor() {
protected IDisplayPaneContainer openNewEditor(String editorId) {
if (editorId.equals(DescriptorMap.getEditorId(RadarXYDescriptor.class
.getName()))) {
return UiUtil.createEditor(editorId, new RadarXYDisplay());
} else if (editorId.equals(DescriptorMap
.getEditorId(RadarGraphDescriptor.class.getName()))) {
return UiUtil.createEditor(editorId, new RadarGraphDisplay());
} else {
return super.openNewEditor(editorId);
}
}
@Override
public Class<? extends IDescriptor> getDescriptorClass() {
int prodCode = Integer.parseInt((resourceData).getMetadataMap()
.get("productCode").getConstraintValue());
String format = infoDict.getInfo(prodCode).getFormat();
if ("XY".equals(format)) {
String editor = "com.raytheon.viz.radar.ui.xy.RadarXYEditor";
EditorInput cont = new EditorInput(
(IRenderableDisplay) new RadarXYDisplay());
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().openEditor(cont, editor, true);
} catch (PartInitException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to open editor : " + editor, e);
}
return RadarXYDescriptor.class;
} else if ("Graph".equals(format)) {
String editor = "com.raytheon.viz.radar.ui.xy.RadarGraphEditor";
EditorInput cont = new EditorInput(
(IRenderableDisplay) new RadarGraphDisplay());
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().openEditor(cont, editor, true);
} catch (PartInitException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to open editor : " + editor, e);
}
return RadarGraphDescriptor.class;
} else {
return super.getDescriptorClass();
}
}

View file

@ -102,9 +102,11 @@ public class RadarGraphDisplay extends AbstractNonMapDisplay {
GraphProperties graphProps) throws VizException {
// Plot the resource data on the graph
for (ResourcePair rp : getDescriptor().getResourceList()) {
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
rp.getResource());
rp.getResource().paint(target, graphProps);
if (rp.getResource() != null) {
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
rp.getResource());
rp.getResource().paint(target, graphProps);
}
}
}

View file

@ -80,9 +80,11 @@ public class RadarXYDisplay extends AbstractNonMapDisplay {
// Plot the resource data on the graph
for (ResourcePair rp : getDescriptor().getResourceList()) {
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
rp.getResource());
rp.getResource().paint(target, graphProps);
if (rp.getResource() != null) {
graphProps = (GraphProperties) calcPaintDataTime(graphProps,
rp.getResource());
rp.getResource().paint(target, graphProps);
}
}
}

View file

@ -42,7 +42,8 @@ import com.raytheon.viz.texteditor.print.PrintDisplay;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/**
* TODO Add Description
* This is a dialog to display the desired products from the current alarm
* queue.
*
* <pre>
*
@ -58,6 +59,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Nov 15, 2011 11616 rferrel Change font to fixed width; and text now
* uses the font.
* Feb 03, 2012 14317 mhuang Make alarm display window wider
* Sep 6, 2012 13365 rferrel Accumulate and Display fix.
*
* </pre>
*
@ -67,6 +69,15 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
public class AlarmDisplayWindow extends CaveSWTDialog {
/**
* State to place the accumulate into after adding products in the preopen.
*/
public static enum ACCUMULATE_STATE {
UNCHANGE, TRUE, FALSE
}
private ACCUMULATE_STATE accum_state;
private Font font;
private StyledText text;
@ -75,6 +86,8 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
private static boolean accumulate;
private Button accumButton;
private Button printWindow;
private Button printBuffer;
@ -85,10 +98,12 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
/**
* @param parentShell
* @param style
* @param prodList
* @param accum_state
*/
protected AlarmDisplayWindow(Shell parentShell,
java.util.List<StdTextProduct> prodList) {
java.util.List<StdTextProduct> prodList,
ACCUMULATE_STATE accum_state) {
super(parentShell, SWT.RESIZE, CAVE.PERSPECTIVE_INDEPENDENT
| CAVE.INDEPENDENT_SHELL);
setText("Alarm Display Window");
@ -96,6 +111,7 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
if (prods == null) {
prods = new ArrayList<StdTextProduct>();
}
this.accum_state = accum_state;
}
@Override
@ -132,7 +148,6 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
private void initializeComponents() {
createMenus();
createTextArea();
populateText();
}
/**
@ -166,16 +181,9 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
final Button clearButton = new Button(buttonMenuComp, SWT.PUSH);
clearButton.setText("Clear");
final Button accumButton = new Button(buttonMenuComp, SWT.CHECK);
accumButton = new Button(buttonMenuComp, SWT.CHECK);
accumButton.setText("Accumulate");
accumButton.setSelection(accumulate);
if (accumulate) {
accumButton.setBackground(Display.getCurrent().getSystemColor(
SWT.COLOR_YELLOW));
} else {
accumButton.setBackground(Display.getCurrent().getSystemColor(
SWT.COLOR_WIDGET_BACKGROUND));
}
setAccumulate(accumulate);
printWindow.addSelectionListener(new SelectionAdapter() {
@Override
@ -215,14 +223,7 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
accumButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
accumulate = !accumulate;
if (accumulate) {
accumButton.setBackground(Display.getCurrent()
.getSystemColor(SWT.COLOR_YELLOW));
} else {
accumButton.setBackground(Display.getCurrent()
.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
}
setAccumulate(!accumulate);
}
});
}
@ -236,22 +237,28 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
}
private void populateText() {
if (prods != null) {
if (!prods.isEmpty()) {
for (int i = 0; i < prods.size(); i++) {
addText(prods.get(i).getProduct());
}
} else {
addText(actualText);
}
if (prods == null || prods.isEmpty()) {
text.setText(actualText);
} else {
addText(actualText);
if (accumulate) {
text.setText(actualText);
} else {
text.setText("");
}
boolean saveAccumulate = accumulate;
// Make sure all products in the list are displayed then restore
// accumulate.
accumulate = true;
for (StdTextProduct prod : prods) {
addText(prod.getProduct());
}
accumulate = saveAccumulate;
}
}
public void setProds(java.util.List<StdTextProduct> prodList) {
prods = prodList;
text.setText(actualText);
populateText();
}
@ -269,20 +276,39 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
}
/**
* Sets the accumulate to the desired state and if active updates the
* display.
*
* @param accumulate
* the accumulate to set
*/
public void setAccumulate(boolean accumulate) {
AlarmDisplayWindow.accumulate = accumulate;
if (accumButton != null && !accumButton.isDisposed()) {
accumButton.setSelection(accumulate);
if (accumulate) {
accumButton.setBackground(Display.getCurrent().getSystemColor(
SWT.COLOR_YELLOW));
} else {
accumButton.setBackground(Display.getCurrent().getSystemColor(
SWT.COLOR_WIDGET_BACKGROUND));
}
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO take this method out
AlarmDisplayWindow curr = new AlarmDisplayWindow(new Shell(), null);
curr.open();
@Override
protected void preOpened() {
super.preOpened();
populateText();
switch (accum_state) {
case TRUE:
setAccumulate(true);
break;
case FALSE:
setAccumulate(false);
break;
}
accum_state = ACCUMULATE_STATE.UNCHANGE;
}
@Override

View file

@ -53,6 +53,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.edex.services.textdbsrv.IQueryTransport;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.texteditor.alarmalert.dialogs.AlarmDisplayWindow.ACCUMULATE_STATE;
import com.raytheon.viz.texteditor.alarmalert.util.AlarmAlertFunctions;
import com.raytheon.viz.texteditor.alarmalert.util.AlarmAlertLists;
import com.raytheon.viz.texteditor.alarmalert.util.CurrentAlarmEvent;
@ -90,8 +91,9 @@ import com.raytheon.viz.ui.dialogs.ModeListener;
* May 23, 2012 14952 rferrel Now use refTime/createtime to display
* selected product
* Aug 28, 2012 14795 mgamazaychikov Fixed problem with "Unhadled event loop"
* exception associated with closing
* "Current Alarm Queue" GUI
* exception associated with closing "Current
* Alarm Queue" GUI
* Sep 6, 2012 13365 rferrel Accumulate and Display fix.
* </pre>
*
* @author mnash
@ -383,7 +385,8 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements
}
if (alarmDisplayDlg == null) {
alarmDisplayDlg = new AlarmDisplayWindow(shell, prods);
alarmDisplayDlg = new AlarmDisplayWindow(shell, prods,
ACCUMULATE_STATE.UNCHANGE);
alarmDisplayDlg.open();
if (list != null && !list.isDisposed() && list.getItemCount() == 0) {
close();
@ -391,7 +394,8 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements
} else {
if (alarmDisplayDlg.getShell() == null
|| alarmDisplayDlg.getShell().isDisposed()) {
alarmDisplayDlg = new AlarmDisplayWindow(shell, prods);
alarmDisplayDlg = new AlarmDisplayWindow(shell, prods,
ACCUMULATE_STATE.UNCHANGE);
alarmDisplayDlg.open();
if (list != null && !list.isDisposed()
&& list.getItemCount() == 0) {
@ -445,36 +449,25 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements
list.removeAll();
AlarmAlertFunctions.getAlarmalertbell().close();
}
if (alarmDisplayDlg == null) {
java.util.List<StdTextProduct> prods = new ArrayList<StdTextProduct>();
if (command.length > 0) {
for (int i = 0; i < command.length; i++) {
prods.addAll(produceTextProduct(command[i]));
}
java.util.List<StdTextProduct> prods = new ArrayList<StdTextProduct>();
if (command.length > 0) {
for (int i = 0; i < command.length; i++) {
prods.addAll(produceTextProduct(command[i]));
}
alarmDisplayDlg = new AlarmDisplayWindow(shell, prods);
alarmDisplayDlg.setAccumulate(true);
}
if (alarmDisplayDlg == null) {
alarmDisplayDlg = new AlarmDisplayWindow(shell, prods,
ACCUMULATE_STATE.TRUE);
alarmDisplayDlg.open();
} else {
if (alarmDisplayDlg.getShell() == null
|| alarmDisplayDlg.getShell().isDisposed()) {
java.util.List<StdTextProduct> prods = new ArrayList<StdTextProduct>();
if (command.length > 0) {
for (int i = 0; i < command.length; i++) {
prods.addAll(produceTextProduct(command[i]));
}
}
alarmDisplayDlg = new AlarmDisplayWindow(shell, prods);
alarmDisplayDlg.setAccumulate(true);
alarmDisplayDlg = new AlarmDisplayWindow(shell, prods,
ACCUMULATE_STATE.TRUE);
alarmDisplayDlg.open();
} else {
alarmDisplayDlg.setAccumulate(true);
java.util.List<StdTextProduct> prods = new ArrayList<StdTextProduct>();
if (command.length > 0) {
for (int i = 0; i < command.length; i++) {
prods.addAll(produceTextProduct(command[i]));
}
}
alarmDisplayDlg.setProds(prods);
alarmDisplayDlg.setAccumulate(true);
alarmDisplayDlg.setDialogFocus();

View file

@ -283,9 +283,10 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 18JUL2012 14457 rferrel Add mouse listener to clear site's update obs when clicked on.
* 25JUL2012 14459 rferrel Strip WMH headers when getting all METARs.
* 13AUG2012 14613 M.Gamazaychikov Ensured the WMO and MND header times are the same.
* 20AUG2012 15340 D.Friedman Use callbacks for stop sign dialog. Prevent NOR in header.
* 20AUG2012 15340 D.Friedman Use callbacks for stop sign dialog. Prevent NOR in header.
* 10SEP2012 15334 rferrel No longer wrap text pasted to an empty text field.
* 10Sep2012 15103 M.Gamazaychikov DR15103 -do not clear AFOS command from the text box
* when obs are updated and refactored executeCommand
* when obs are updated and refactored executeCommand
* 10SEP2012 15401 D.Friedman Fix QC problem caused by DR 15340.
* </pre>
*
@ -4116,6 +4117,13 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
private void pasteText() {
// AWIPS I just does the pasted in both overwrite and insert mode.
try {
// When pasting to empty editor assume text is properly formatted
// and does not need wrapping.
boolean doWrap = true;
if (textEditor.getText().trim().length() == 0) {
doWrap = false;
textEditor.setText("");
}
int start = -1;
if (textEditor.getSelectionCount() == 0) {
start = textEditor.getCaretOffset();
@ -4123,7 +4131,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
start = textEditor.getSelectionRange().x;
}
textEditor.paste();
rewrap(start, textEditor.getCaretOffset());
if (doWrap) {
rewrap(start, textEditor.getCaretOffset());
}
} catch (IllegalArgumentException ex) {
// Ignore
}
@ -4368,7 +4378,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
final CAVEMode mode = CAVEMode.getMode();
StdTextProduct prod = getStdTextProduct();
String afosId = prod.getCccid() + prod.getNnnid() + prod.getXxxid();
final String title = QualityControl.getProductWarningType(prod.getNnnid());
final String title = QualityControl.getProductWarningType(prod
.getNnnid());
final StringBuilder productMessage = new StringBuilder();
final StringBuilder modeMessage = new StringBuilder();
@ -4382,7 +4393,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
} else if (warnGenFlag) {
productMessage.append("You are about to SEND a " + afosId + "\n");
productMessage.append(title).append(".\n");
QualityControl qcCheck = new QualityControl();
if (qcCheck.checkWarningInfo(headerTF.getText().toUpperCase(),
textEditor.getText().toUpperCase(), prod.getNnnid()) == false) {
@ -4393,7 +4404,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
@Override
public void dialogDismissed(Object dialogResult) {
if (Boolean.TRUE.equals(dialogResult))
finishSendProduct1(resend, title, mode, productMessage, modeMessage);
finishSendProduct1(resend, title, mode,
productMessage, modeMessage);
}
});
@ -4403,7 +4415,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
finishSendProduct1(resend, title, mode, productMessage, modeMessage);
}
private void finishSendProduct1(final boolean resend, String title, CAVEMode mode, StringBuilder productMessage, StringBuilder modeMessage) {
private void finishSendProduct1(final boolean resend, String title,
CAVEMode mode, StringBuilder productMessage,
StringBuilder modeMessage) {
Pattern p = Pattern.compile(".\\%[s].");
Matcher m = p.matcher(STORED_SENT_MSG);
@ -4468,7 +4482,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
token);
OUPRequest req = new OUPRequest();
OfficialUserProduct oup = new OfficialUserProduct();
StdTextProduct prod = getStdTextProduct(); // TODO: makes me nervous...
StdTextProduct prod = getStdTextProduct(); // TODO: makes me
// nervous...
String awipsWanPil = prod.getSite() + prod.getNnnid()
+ prod.getXxxid();
String awipsID = prod.getNnnid() + prod.getXxxid();
@ -4623,15 +4638,14 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
boolean successful = false;
/*
* DR14613 - string currectDate is derived from Date now
* ensuring the same time in WMO heading and in the
* MND heading.
* DR14613 - string currectDate is derived from Date now ensuring the
* same time in WMO heading and in the MND heading.
*/
Date now = SimulatedTime.getSystemTime().getTime();
String currentDate = getCurrentDate(now);
TextDisplayModel tdmInst = TextDisplayModel.getInstance();
// Convert the text in the text editor to uppercase
// Convert the text in the text editor to uppercase
if (!isAutoSave) {
if (!verifyRequiredFields()) {
return false;
@ -4667,10 +4681,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
VtecObject vtecObj = VtecUtil.parseMessage(productText);
if (warnGenFlag) {
/*
/*
* DR14613 - string currectDate is derived from Date now
* ensuring the same time in WMO heading and in the
* MND heading.
* ensuring the same time in WMO heading and in the MND
* heading.
*/
productText = updateVtecTimes(productText, vtecObj, now);
productText = updateHeaderTimes(productText, now);
@ -5134,9 +5148,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
}
private String getCurrentDate(Date now) {
/*
* DR14613 - pass the Date now as an argument
*/
/*
* DR14613 - pass the Date now as an argument
*/
SimpleDateFormat formatter = new SimpleDateFormat("ddHHmm");
formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
return (formatter.format(now));
@ -5163,11 +5177,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
product = product.replace(
vtecFormatter.format(vtecObj.getStartTime().getTime()),
vtecFormatter.format(now));
}
}
return product;
}
/**
* Update the MND header time using the Date now.
*
@ -5176,7 +5190,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
* @return
*/
private String updateHeaderTimes(String product, Date now) {
// Update the header time
// Update the header time
Matcher m = datePtrn.matcher(product);
if (m.find()) {
SimpleDateFormat headerFormat = new SimpleDateFormat(
@ -5187,9 +5201,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
product = product.replace(m.group(1), headerFormat.format(now)
.toUpperCase());
}
return product;
return product;
}
public void setCurrentWmoId(String wmoId) {
TextDisplayModel.getInstance().setWmoId(token, wmoId);
@ -7311,7 +7324,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
job.setSystem(true);
job.schedule();
}
private static String fixNOR(String bbb) {
if ("NOR".equals(bbb))
return "";

View file

@ -29,7 +29,8 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.viz.texteditor.TextWarningConstants;
/**
* TODO Add Description
* A grouping of static methods to obtain site id and to query for site
* information in various, seldom changed, tables.
*
* <pre>
*
@ -37,6 +38,7 @@ import com.raytheon.viz.texteditor.TextWarningConstants;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 21, 2009 bwoodle Initial creation
* Sep 09, 2012 14668 rferrel Change default WMO ID to 'blank'.
*
* </pre>
*
@ -103,8 +105,7 @@ public class SiteAbbreviationUtil {
public static String getTtaaii(String afosId) {
String query = "SELECT wmottaaii FROM afos_to_awips WHERE afosid = '"
+ afosId + "';";
// Keep the same default we previously had.
String rval = "SAUS43";
String rval = "-";
try {
List<Object[]> results = DirectDbQuery.executeQuery(query,

View file

@ -208,6 +208,11 @@
<handler
class="com.raytheon.viz.ui.actions.ImagePropertiesAction"
commandId="com.raytheon.viz.ui.imageProperties">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.personalities.awips.ClosePerspectiveHandler"

View file

@ -70,22 +70,47 @@
<handler
class="com.raytheon.viz.ui.tools.looping.CombinedFrameTool"
commandId="com.raytheon.viz.ui.tools.looping.frameTool">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.tools.looping.LoopTool"
commandId="com.raytheon.viz.ui.tools.looping.loop">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.tools.looping.LoopPropertiesTool"
commandId="com.raytheon.viz.ui.tools.looping.loopProperties">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.tools.looping.FasterLoopSpeedTool"
commandId="com.raytheon.viz.ui.tools.looping.fasterLoop">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.ui.tools.looping.SlowerLoopSpeedTool"
commandId="com.raytheon.viz.ui.tools.looping.slowerLoop">
<activeWhen>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</activeWhen>
</handler>
</extension>

View file

@ -50,7 +50,9 @@ public class FasterLoopSpeedTool extends AbstractTool {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
super.execute(arg0);
PageUpDownKey.handlePageUp(editor);
if (editor != null) {
PageUpDownKey.handlePageUp(editor);
}
return null;
}
}

View file

@ -58,9 +58,9 @@ public class LoopPropertiesTool extends AbstractTool {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
LoopPropertiesDialog.openDialog(shell, this.editor);
if (editor != null) {
LoopPropertiesDialog.openDialog(shell, this.editor);
}
return null;
}

View file

@ -50,7 +50,9 @@ public class SlowerLoopSpeedTool extends AbstractTool {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
super.execute(arg0);
PageUpDownKey.handlePageDown(editor);
if (editor != null) {
PageUpDownKey.handlePageDown(editor);
}
return null;
}

View file

@ -242,11 +242,20 @@ public class LoadSerializedXml extends AbstractHandler {
final boolean multiEditor = container instanceof IMultiPaneEditor;
if (multiEditor) {
while (container.getDisplayPanes().length > b.getDisplays().length) {
((IMultiPaneEditor) container)
.removePane(container.getDisplayPanes()[container
.getDisplayPanes().length - 1]);
if (container.getDisplayPanes().length > b.getDisplays().length) {
VizApp.runSync(new Runnable() {
@Override
public void run() {
while (container.getDisplayPanes().length > b
.getDisplays().length) {
((IMultiPaneEditor) container).removePane(container
.getDisplayPanes()[container
.getDisplayPanes().length - 1]);
}
}
});
}
}
List<AbstractRenderableDisplay> orderedDisplays = Arrays.asList(b
.getDisplays());

View file

@ -20,6 +20,8 @@
package com.raytheon.viz.ui.dialogs;
import java.util.concurrent.RejectedExecutionException;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
@ -47,6 +49,9 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
* ---------- ---------- ----------- --------------------------
* 12/20/07 561 Dan Fitch Initial Creation.
* 04/22/08 1088 chammack Added dialog event propagation fix
* 09/13/12 1165 lvenable Update for the initial process
* of removing the dialog blocking capability.
*
* </pre>
*
* @author Dan Fitch
@ -55,10 +60,18 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
public class CaveJFACEDialog extends Dialog implements
IPerspectiveSpecificDialog {
/** Dialog last location on the screen. */
protected Point lastLocation;
/** Flag indicating of the dialog was visible. */
private boolean wasVisible = true;
/** Callback called when the dialog is disposed. */
private ICloseCallback closeCallback = null;
/** Flag indicating if the dialog was blocked when opened. */
private boolean blockedOnOpen = false;
/**
*
* @param parentShell
@ -111,6 +124,8 @@ public class CaveJFACEDialog extends Dialog implements
if (mgr != null) {
mgr.removePespectiveDialog(CaveJFACEDialog.this);
}
callCloseCallback();
}
});
@ -165,4 +180,71 @@ public class CaveJFACEDialog extends Dialog implements
shell.setLocation(lastLocation);
}
}
/**
* Call the callback method as this dialog has been disposed.
*/
private void callCloseCallback() {
if (closeCallback != null) {
closeCallback.dialogClosed(new Integer(getReturnCode()));
}
}
/**
* Returns whether the dialog has been opened yet or not
*
* @return True if the dialog was opened, false otherwise.
*/
public final boolean isOpen() {
return (getShell() != null && !getShell().isDisposed());
}
/**
* Add a callback to the dialog. This callback will be called when the
* dialog is disposed.
*
* @param callback
* Callback to be called when the dialog is disposed.
*/
public void setCloseCallback(ICloseCallback callback) {
/*
* Since JFACE allows you to call setBlockOnOpen() after the
* constructor, if the open() method is called before setBlockOnOpen
* then the block is ignored. Here we are checking if the block was set
* and if the dialog is already open because that makes the callback
* pointless.
*/
if (blockedOnOpen && isOpen()) {
StringBuilder sb = new StringBuilder();
sb.append("The method setBlockOnOpen() was called and set to true. The callback method ");
sb.append("will not run correctly as the dialog has been opened and blocked before this ");
sb.append("method was called.");
throw new RejectedExecutionException(sb.toString());
}
this.closeCallback = callback;
}
/**
* This method overrides the existing setBlockOnOpen() method. This will
* eventually be a catch method that will prevent blocking the dialog on
* open. At this time it serves as a placeholder for upcoming work.
*
* @param blockOnOpen
* Flag indicating if the dialog should block when opened.
*/
public void setBlockOnOpen(boolean blockOnOpen) {
/*
* If the dialog is already opened then just return because setting the
* block won't work. In JFACE the setBlockOnOpen needs to be set before
* the open() call, otherwise it is ignored.
*/
if (isOpen()) {
return;
}
super.setBlockOnOpen(blockOnOpen);
blockedOnOpen = blockOnOpen;
}
}

View file

@ -21,6 +21,7 @@ package com.raytheon.viz.ui.dialogs;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.RejectedExecutionException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
@ -48,7 +49,9 @@ import org.eclipse.swt.widgets.Shell;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 2, 2010 mschenke Initial creation
* Nov 2, 2010 mschenke Initial creation
* Sep 12, 2012 #1165 lvenable Update for the initial process
* of removing the dialog blocking capability.
*
* </pre>
*
@ -113,20 +116,29 @@ public abstract class CaveSWTDialogBase extends Dialog {
}
}
/** Style used to determine how the dialog will function. */
private int caveStyle = CAVE.NONE;
/** Display reference. */
private Display display;
/** Dialog last location on the screen. */
protected Point lastLocation;
/** Flag indicating of the dialog was visible. */
protected boolean wasVisible = true;
/** Return value. */
private Object returnValue;
/** Shell reference. */
protected Shell shell;
private List<ListenerPair> listenersToAdd;
/** Callback called when the dialog is disposed. */
private ICloseCallback closeCallback = null;
/**
* Construct default cave dialog
*
@ -220,6 +232,7 @@ public abstract class CaveSWTDialogBase extends Dialog {
@Override
public void widgetDisposed(DisposeEvent e) {
disposed();
callCloseCallback();
}
});
@ -282,6 +295,16 @@ public abstract class CaveSWTDialogBase extends Dialog {
}
/**
* Call the callback method as this dialog has been disposed. This action is
* in a separate method since the disposed method can be overridden.
*/
private void callCloseCallback() {
if (closeCallback != null) {
closeCallback.dialogClosed(returnValue);
}
}
/**
* Construct the layout for the shell. Defaults to a GridLayout with one
* column and margins set to 3
@ -405,10 +428,25 @@ public abstract class CaveSWTDialogBase extends Dialog {
return true;
}
/**
* Check if the caveStyle contains a specified attribute.
*
* @param attribute
* Attribute to check for.
* @return True if caveStyle contains the attribute. False if it doesn't.
*/
protected boolean hasAttribute(int attribute) {
return (caveStyle & attribute) == attribute;
}
/**
* Check if the caveStyle does not contain a specified attribute.
*
* @param attribute
* Attribute to check for.
* @return True if caveStyle does not contain the attribute. False if it
* does.
*/
protected boolean doesNotHaveAttribute(int attribute) {
return (caveStyle & attribute) != attribute;
}
@ -443,4 +481,29 @@ public abstract class CaveSWTDialogBase extends Dialog {
}
}
}
/**
* Add a callback to the dialog. This callback will be called when the
* dialog is disposed. Also, the caveStyle is updated to include
* DO_NOT_BLOCK.
*
* @param callback
* Callback to be called when the dialog is disposed.
* @throws Throws
* a RejectedExecutionException with a message indicating that
* this method needs to be called before the open method.
*/
public void setCloseCallback(ICloseCallback callback) {
if (isOpen()) {
StringBuilder sb = new StringBuilder();
sb.append("The method addCloseCallback() needs to be called before the open(). ");
sb.append("This is due to addCloseCallback setting the caveStyle to DO_NOT_BLOCK");
throw new RejectedExecutionException(sb.toString());
}
// Set the DO_NOT_BLOCK on the cave style
this.caveStyle = caveStyle | CAVE.DO_NOT_BLOCK;
this.closeCallback = callback;
}
}

View file

@ -0,0 +1,47 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.ui.dialogs;
/**
*
* Callback interface used when a dialog using CaveSWTDialog is disposed.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 11, 2012 #1165 lvenable Initial creation
*
* </pre>
*
* @author lvenable
* @version 1.0
*/
public interface ICloseCallback {
/**
* Method called when a dialog is closed.
*
* @param returnValue
* Return value set in a dialog.
*/
public void dialogClosed(Object returnValue);
}

View file

@ -77,6 +77,8 @@ public abstract class AbstractWorkbenchPartContextActivator implements
private void activate(IWorkbenchPartReference partRef) {
if (isPerspectivePart(partRef)) {
contextManager.activateContexts(this);
} else {
contextManager.deactivateContexts(this);
}
}

View file

@ -747,9 +747,10 @@
<!--S-R Flow & Suggests Tor Supercells Submenu-->
<contribute xsi:type="toolbarSubMenu" menuText="Thom 5, 5a and 6">
<contribute xsi:type="menuItem" menuText="Thom 5" key="Thom5" indentText="false" />
<contribute xsi:type="menuItem" menuText="Thom 5a" key="Thom5a" indentText="false" />
<contribute xsi:type="menuItem" menuText="Thom 6" key="Thom6" indentText="false" />
<contribute xsi:type="menuItem" menuText="Thom 5" key="Thom5" indentText="false" />
<contribute xsi:type="menuItem" menuText="Thom 5a" key="Thom5a" indentText="false" />
<contribute xsi:type="menuItem" menuText="Thom 6" key="Thom6" indentText="false" />
</contribute>
<contribute xsi:type="menuItem" menuText="Vertical Totals" key="vTOT" indentText="false" />
<contribute xsi:type="menuItem" menuText="Cross Totals" key="cTOT" indentText="false" />

View file

@ -15,6 +15,7 @@ import com.raytheon.uf.common.geospatial.SpatialQueryResult;
import com.raytheon.viz.warngen.PreferenceUtil;
import com.raytheon.viz.warngen.gis.ClosestPoint;
import com.raytheon.viz.warngen.gis.GisUtil;
import com.raytheon.viz.warngen.gis.GisUtil.Direction;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
@ -94,9 +95,33 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
partOfArea = GisUtil.asStringList(GisUtil.calculatePortion(geom,
intersection, gc, ""));
String suppressedDirections = String.valueOf(attributes
.get(suppressedDirectionsField));
partOfArea.remove(suppressedDirections);
if (attributes.get(suppressedDirectionsField) != null) {
String suppressedDirections = String.valueOf(
attributes.get(suppressedDirectionsField))
.toLowerCase();
// supdirs can be 'nse', for example
// TODO create an enum constructor for Directions
for (int i = 0; i < suppressedDirections.length(); i++) {
switch (suppressedDirections.charAt(i)) {
case 'n':
partOfArea.remove(Direction.NORTH.toString());
break;
case 's':
partOfArea.remove(Direction.SOUTH.toString());
break;
case 'e':
partOfArea.remove(Direction.EAST.toString());
break;
case 'w':
partOfArea.remove(Direction.WEST.toString());
break;
case 'c':
partOfArea.remove(Direction.CENTRAL.toString());
break;
}
}
}
}
return partOfArea;

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