13.5.1-14 baseline
Former-commit-id: fe7b1a704ee92b34684e4f9059bd61cfa28dd485
This commit is contained in:
parent
5577e686c1
commit
80e5f7fbd4
5 changed files with 68 additions and 34 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -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) {
|
||||
final InputPriority[] SWAPPABLE_PRIORITIES = { InputPriority.RESOURCE,
|
||||
InputPriority.SYSTEM_RESOURCE,
|
||||
InputPriority.SYSTEM_RESOURCE_LOW };
|
||||
HashMap<InputPriority, IInputHandler[]> editorHandlers =
|
||||
new HashMap<IInputHandler.InputPriority, IInputHandler[]>();
|
||||
for (InputPriority priority : SWAPPABLE_PRIORITIES) {
|
||||
IInputHandler[] handlers = theEditor.getMouseManager()
|
||||
.getHandlersForPriority(priority);
|
||||
editorHandlers.put(priority, handlers);
|
||||
for (IInputHandler handler : handlers) {
|
||||
theEditor.getMouseManager().unregisterMouseHandler(handler);
|
||||
}
|
||||
for (IInputHandler handler : editorSystemRscHandlers) {
|
||||
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) {
|
||||
HashMap<InputPriority, IInputHandler[]> myHandlers =
|
||||
new HashMap<IInputHandler.InputPriority, IInputHandler[]>();
|
||||
for (InputPriority priority : SWAPPABLE_PRIORITIES) {
|
||||
IInputHandler[] handlers = paneManager.getMouseManager()
|
||||
.getHandlersForPriority(priority);
|
||||
myHandlers.put(priority, handlers);
|
||||
for (IInputHandler handler : handlers) {
|
||||
unregisterMouseHandler(handler);
|
||||
}
|
||||
for (IInputHandler handler : mySystemRscHandlers) {
|
||||
unregisterMouseHandler(handler);
|
||||
}
|
||||
|
||||
// Register editor handlers on ourself
|
||||
for (IInputHandler handler : editorResourceHandlers) {
|
||||
registerMouseHandler(handler, InputPriority.RESOURCE);
|
||||
for (InputPriority priority : SWAPPABLE_PRIORITIES) {
|
||||
IInputHandler[] handlers = editorHandlers.get(priority);
|
||||
for (IInputHandler handler : handlers) {
|
||||
registerMouseHandler(handler, priority);
|
||||
}
|
||||
for (IInputHandler handler : editorSystemRscHandlers) {
|
||||
registerMouseHandler(handler, InputPriority.SYSTEM_RESOURCE);
|
||||
}
|
||||
|
||||
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) {
|
||||
for (InputPriority priority : SWAPPABLE_PRIORITIES) {
|
||||
IInputHandler[] handlers = myHandlers.get(priority);
|
||||
for (IInputHandler handler : handlers) {
|
||||
theEditor.registerMouseHandler(handler,
|
||||
InputPriority.RESOURCE);
|
||||
priority);
|
||||
}
|
||||
for (IInputHandler handler : mySystemRscHandlers) {
|
||||
theEditor.registerMouseHandler(handler,
|
||||
InputPriority.SYSTEM_RESOURCE);
|
||||
}
|
||||
|
||||
// Set up editableness
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue