diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/IInputHandler.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/IInputHandler.java index 8119be86a8..7ff0af825e 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/IInputHandler.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/rsc/IInputHandler.java @@ -39,6 +39,10 @@ import org.eclipse.swt.widgets.Event; */ public interface IInputHandler { + /* + * Note that these values are not only used for priority. They are also used + * to determine which event handlers are swapped in SideView.swapPanes. + */ public static enum InputPriority { LOWEST(0), SYSTEM_RESOURCE_LOW(1), RESOURCE(3), SYSTEM_RESOURCE(4), PART(5), PERSPECTIVE(6), WINDOW(7); diff --git a/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/legend/D2DLegendResource.java b/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/legend/D2DLegendResource.java index 0f8e253ddc..e9f47462dd 100644 --- a/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/legend/D2DLegendResource.java +++ b/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/legend/D2DLegendResource.java @@ -501,9 +501,15 @@ public class D2DLegendResource extends legendFont = target.initializeFont(D2DLegendResource.class.getName()); IDisplayPaneContainer rc = getResourceContainer(); if (rc != null) { + /* + * The legendHandler needs to have higher priority that the + * changeModeHandler. The following assumes that the legendHandler, + * by being added later, runs before the changeModelHandler. See + * InputManager.handeMouseXxx. + */ + rc.registerMouseHandler(changeModeHandler, InputPriority.SYSTEM_RESOURCE_LOW); rc.registerMouseHandler(legendHandler, InputPriority.SYSTEM_RESOURCE_LOW); - rc.registerMouseHandler(changeModeHandler, InputPriority.RESOURCE); } } diff --git a/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/D2DTimeMatcher.java b/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/D2DTimeMatcher.java index b92da6d491..1601579195 100644 --- a/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/D2DTimeMatcher.java +++ b/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/D2DTimeMatcher.java @@ -73,6 +73,7 @@ import com.raytheon.uf.viz.d2d.core.D2DLoadProperties; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Feb 10, 2009 chammack Initial creation + * Aug 9, 2013 DR 16448 D. Friedman Validate time match basis in redoTimeMatching * * * @@ -191,6 +192,8 @@ public class D2DTimeMatcher extends AbstractTimeMatcher { @Override public void redoTimeMatching(IDescriptor descriptor) throws VizException { synchronized (this) { + if (timeMatchBasis != null && ! validateTimeMatchBasis(descriptor.getResourceList())) + timeMatchBasis = null; if (timeMatchBasis != null) { IDescriptor tmDescriptor = timeMatchBasis.getDescriptor(); if (tmDescriptor != null && tmDescriptor != descriptor) { @@ -990,4 +993,22 @@ public class D2DTimeMatcher extends AbstractTimeMatcher { configFactory.resetMultiload(); } + private boolean validateTimeMatchBasis(ResourceList list) { + for (ResourcePair rp : list) { + AbstractVizResource rsc = rp.getResource(); + if (rsc == timeMatchBasis) { + return true; + } else if (rp.getProperties().isMapLayer() + || rp.getProperties().isSystemResource()) { + continue; + } else if (rsc.getResourceData() instanceof IResourceGroup) { + if (validateTimeMatchBasis(((IResourceGroup) rsc.getResourceData()) + .getResourceList())) { + return true; + } + } + } + return false; + } + } diff --git a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java index 6cbf67eb29..a5341204fb 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java +++ b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java @@ -21,6 +21,7 @@ package com.raytheon.uf.viz.d2d.ui.map; import java.io.File; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -96,6 +97,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Nov 20, 2012 DR 15524 M.Porricelli Changed so interactive screens still editable when * swapped to side panel * Mar 21, 2013 1638 mschenke Changed map scales not tied to d2d + * Aug 9, 2013 DR 16427 D. Friedman Swap additional input handlers. * * * @@ -347,37 +349,38 @@ public class SideView extends ViewPart implements IMultiPaneEditor, // First thing to do, swap input handlers // Get editor resource handlers and unregister on editor - IInputHandler[] editorResourceHandlers = theEditor - .getMouseManager().getHandlersForPriority( - InputPriority.RESOURCE); - IInputHandler[] editorSystemRscHandlers = theEditor - .getMouseManager().getHandlersForPriority( - InputPriority.SYSTEM_RESOURCE); - for (IInputHandler handler : editorResourceHandlers) { - theEditor.getMouseManager().unregisterMouseHandler(handler); - } - for (IInputHandler handler : editorSystemRscHandlers) { - theEditor.getMouseManager().unregisterMouseHandler(handler); + final InputPriority[] SWAPPABLE_PRIORITIES = { InputPriority.RESOURCE, + InputPriority.SYSTEM_RESOURCE, + InputPriority.SYSTEM_RESOURCE_LOW }; + HashMap editorHandlers = + new HashMap(); + for (InputPriority priority : SWAPPABLE_PRIORITIES) { + IInputHandler[] handlers = theEditor.getMouseManager() + .getHandlersForPriority(priority); + editorHandlers.put(priority, handlers); + for (IInputHandler handler : handlers) { + theEditor.getMouseManager().unregisterMouseHandler(handler); + } } // Store and unregister input handlers on ourself - IInputHandler[] myResourceHandlers = paneManager.getMouseManager() - .getHandlersForPriority(InputPriority.RESOURCE); - IInputHandler[] mySystemRscHandlers = paneManager.getMouseManager() - .getHandlersForPriority(InputPriority.SYSTEM_RESOURCE); - for (IInputHandler handler : myResourceHandlers) { - unregisterMouseHandler(handler); - } - for (IInputHandler handler : mySystemRscHandlers) { - unregisterMouseHandler(handler); + HashMap myHandlers = + new HashMap(); + for (InputPriority priority : SWAPPABLE_PRIORITIES) { + IInputHandler[] handlers = paneManager.getMouseManager() + .getHandlersForPriority(priority); + myHandlers.put(priority, handlers); + for (IInputHandler handler : handlers) { + unregisterMouseHandler(handler); + } } // Register editor handlers on ourself - for (IInputHandler handler : editorResourceHandlers) { - registerMouseHandler(handler, InputPriority.RESOURCE); - } - for (IInputHandler handler : editorSystemRscHandlers) { - registerMouseHandler(handler, InputPriority.SYSTEM_RESOURCE); + for (InputPriority priority : SWAPPABLE_PRIORITIES) { + IInputHandler[] handlers = editorHandlers.get(priority); + for (IInputHandler handler : handlers) { + registerMouseHandler(handler, priority); + } } IDisplayPane[] editorPanes = theEditor.getDisplayPanes(); @@ -587,13 +590,12 @@ public class SideView extends ViewPart implements IMultiPaneEditor, D2DLegendResource.LegendMode.PRODUCT, D2DLegendResource.LegendMode.SHORT_PRODUCT); - for (IInputHandler handler : myResourceHandlers) { - theEditor.registerMouseHandler(handler, - InputPriority.RESOURCE); - } - for (IInputHandler handler : mySystemRscHandlers) { - theEditor.registerMouseHandler(handler, - InputPriority.SYSTEM_RESOURCE); + for (InputPriority priority : SWAPPABLE_PRIORITIES) { + IInputHandler[] handlers = myHandlers.get(priority); + for (IInputHandler handler : handlers) { + theEditor.registerMouseHandler(handler, + priority); + } } // Set up editableness diff --git a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackUIManager.java b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackUIManager.java index e7fbf1d350..60bf54b604 100644 --- a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackUIManager.java +++ b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackUIManager.java @@ -62,6 +62,7 @@ import com.vividsolutions.jts.geom.Point; * the Storm Track Display that it * needs to update the track because * the point has been moved. + * 08-12-2013 DR 16427 D. Friedman Prevent NPE. * * * @@ -260,7 +261,7 @@ public class StormTrackUIManager extends InputAdapter { StormTrackState state = controller.getStormTrackState(); boolean rval = false; if (((mouseButton == 1) || (mouseButton == 2 && pointCreated)) - && moveType != null) { + && moveType != null && state.mouseDownGeom != null) { state.dragMeGeom = state.mouseDownGeom; state.mouseDownGeom = null; if (state.mode == Mode.DRAG_ME) { diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java index 131eecb3d4..2960a686cd 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java @@ -69,7 +69,6 @@ import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.SimulatedTime; -import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.VizApp; @@ -936,10 +935,12 @@ public class WarngenDialog extends CaveSWTDialog implements // Select the previously selected item. invalidFollowUpAction = false; if (currentSelection != null) { + boolean isValid = false; for (int i = 0; i < updateListCbo.getItemCount(); i++) { if (updateListCbo.getItem(i).startsWith( currentSelection.getEquvialentString())) { updateListCbo.select(i); + isValid = true; break; } } diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java index 82b419ab1d..c379b4e857 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java @@ -93,6 +93,8 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * 05/22/13 #2025 dgilling Re-implement functions needed by * GetLatestDbTimeRequest and GetLatestModelDbIdRequest. * 05/20/13 #2127 rjpeter Set session's to read only and switched to stateless where possible. + * 08/08/13 DR16485 ryu Remove call to getDatabaseId() from getMaxInsertTimeByDbId() + * so new GFE databases aren't accidentally created. * * * @author bphillip @@ -1126,7 +1128,13 @@ public class GFEDao extends DefaultPluginDao { public Date getMaxInsertTimeByDbId(final DatabaseID dbId) throws DataAccessLayerException { DatabaseQuery query = new DatabaseQuery(this.daoClass); - query.addQueryParam("parmId.dbId", getDatabaseId(dbId), + query.addQueryParam("parmId.dbId.siteId", dbId.getSiteId(), + QueryOperand.EQUALS); + query.addQueryParam("parmId.dbId.format", dbId.getFormat(), + QueryOperand.EQUALS); + query.addQueryParam("parmId.dbId.modelName", dbId.getModelName(), + QueryOperand.EQUALS); + query.addQueryParam("parmId.dbId.modelTime", dbId.getModelTime(), QueryOperand.EQUALS); query.addReturnedField("insertTime"); query.addOrder("insertTime", false); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPBasinData.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPBasinData.java index cc32ea8dee..837db25cfc 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPBasinData.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPBasinData.java @@ -688,6 +688,7 @@ public class FFMPBasinData implements ISerializableObject { * @param times */ public void populate(List times) { + if (mapFactory == null) { mapFactory = new BasinMapFactory(Collections.reverseOrder(), getBasins().size());