Issue #2301: Fix GHG Monitor for 13.6, prevent map mouse handler events from firing until map is loaded.

Change-Id: Ifc758cb4d3ab0f06269e1176ce692664b81e5580

Former-commit-id: 48032cc87c [formerly 1c79f69a18] [formerly d867e0ca2f] [formerly 48032cc87c [formerly 1c79f69a18] [formerly d867e0ca2f] [formerly 58b64ff3a3 [formerly d867e0ca2f [formerly bfb01b8ab25c7287f6c71155a6808f8596403742]]]]
Former-commit-id: 58b64ff3a3
Former-commit-id: 9bee326f11 [formerly 985380afd4] [formerly da2d0f9a99d7ad38a94a6804a0b531691b3375c5 [formerly a481c69387]]
Former-commit-id: 99a7aa19e809d80f12c052d56b6871ce7a244749 [formerly edd683b897]
Former-commit-id: 7587c3a01b
This commit is contained in:
David Gillingham 2013-08-27 11:28:55 -05:00
parent 171660f4ac
commit e3e8e6931a
5 changed files with 45 additions and 23 deletions

View file

@ -26,6 +26,8 @@ import org.eclipse.core.internal.registry.osgi.OSGIUtils;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.Image;
import org.osgi.framework.Bundle;
/**
@ -83,4 +85,16 @@ public class IconUtil {
return ImageDescriptor.createFromURL(url);
}
/**
* Creates an Image for an icon
*
* @param bundleName
* the name of the bundle to find the icon in
* @param name
* the name of the icon
* @return the Image corresponding to the icon
*/
public static Image getImage(Bundle bundle, String name, Device device) {
return getImageDescriptor(bundle, name).createImage(device);
}
}

View file

Before

Width:  |  Height:  |  Size: 93 B

After

Width:  |  Height:  |  Size: 93 B

View file

Before

Width:  |  Height:  |  Size: 92 B

After

Width:  |  Height:  |  Size: 92 B

View file

@ -46,6 +46,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 11, 2010 mpduff Initial creation
* Aug 27, 2013 #2301 dgilling Fix mouse handler registration so they
* can't trigger events until map is loaded.
*
* </pre>
*
@ -127,10 +129,6 @@ public class GhgMapManager extends PaneManager implements
*/
public void createComponent(Composite parent) {
initializeComponents(this, parent);
registerMouseHandler(new GhgMapInputAdapter());
registerMouseHandler(new PanHandler(this));
dragDetector = new GhgDragDetector();
registerMouseHandler(dragDetector);
}
/**
@ -239,4 +237,19 @@ public class GhgMapManager extends PaneManager implements
}
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.panes.PaneManager#registerHandlers(com.raytheon.uf
* .viz.core.IDisplayPane)
*/
@Override
protected void registerHandlers(IDisplayPane pane) {
super.registerHandlers(pane);
registerMouseHandler(new GhgMapInputAdapter());
registerMouseHandler(new PanHandler(this));
dragDetector = new GhgDragDetector();
registerMouseHandler(dragDetector);
}
}

View file

@ -19,7 +19,6 @@
**/
package com.raytheon.viz.ghg.monitor;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@ -45,8 +44,10 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.osgi.framework.Bundle;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.icon.IconUtil;
import com.raytheon.viz.ghg.Activator;
import com.raytheon.viz.ghg.monitor.data.GhgConfigData;
import com.raytheon.viz.ghg.monitor.data.GhgConfigData.DataEnum;
import com.raytheon.viz.ghg.monitor.data.GhgConfigData.SelectionEnum;
@ -66,6 +67,7 @@ import com.raytheon.viz.ghg.monitor.listener.GhgMonitorZoneSelectionListener;
* 25 MAR 2008 N/A lvenable Initial creation
* 19Jun2008 1157 MW Fegan Added banner popup for alerts.
* 27Mar2009 1881 wldougher Enhance performance
* 27Aug2013 2301 dgilling Fix Image loading for icons.
*
* </pre>
*
@ -99,17 +101,17 @@ public class GhgTableComp extends Composite implements IGhgSelectedTableColumn,
/**
* ArrayList of table columns.
*/
private ArrayList<TableColumn> tableColumns;
private List<TableColumn> tableColumns;
/**
* ArrayList of the rows of data in the table.
*/
private ArrayList<GhgTableRowData> ghgTableRowArray;
private List<GhgTableRowData> ghgTableRowArray;
/**
* Previous ArrayList of the rows of data in the table.
*/
private ArrayList<GhgTableRowData> lastGhgTableRowArray = new ArrayList<GhgTableRowData>();
private List<GhgTableRowData> lastGhgTableRowArray = new ArrayList<GhgTableRowData>();
/**
* The current selected column.
@ -154,8 +156,10 @@ public class GhgTableComp extends Composite implements IGhgSelectedTableColumn,
*/
private void init() {
Display display = getParent().getDisplay();
upImage = new Image(display, loadUpGif());
downImage = new Image(display, loadDownGif());
Bundle bundle = Activator.getDefault().getBundle();
upImage = IconUtil.getImage(bundle, "sortUp.gif", display);
downImage = IconUtil.getImage(bundle, "sortDown.gif", display);
// Get the Font Data for the Table
originalTableFont = new Font(display, "Monospace", 10, SWT.NORMAL);
@ -177,6 +181,7 @@ public class GhgTableComp extends Composite implements IGhgSelectedTableColumn,
initializeComponents();
addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent arg0) {
disposeItems();
}
@ -459,6 +464,7 @@ public class GhgTableComp extends Composite implements IGhgSelectedTableColumn,
*
* @return Table column index.
*/
@Override
public int getSelectedColumn() {
return selectedColumn;
}
@ -468,6 +474,7 @@ public class GhgTableComp extends Composite implements IGhgSelectedTableColumn,
*
* @return Indexes of the visible columns.
*/
@Override
public List<Integer> getVisibleColumnIndexes() {
ArrayList<Integer> intArray = new ArrayList<Integer>();
TableColumn tc;
@ -507,18 +514,6 @@ public class GhgTableComp extends Composite implements IGhgSelectedTableColumn,
packColumns();
}
public static String loadUpGif() {
String config = VizApp.getBaseDir() + "etc" + File.separatorChar
+ "ghg" + File.separatorChar + "sortUp.gif";
return config;
}
public static String loadDownGif() {
String config = VizApp.getBaseDir() + "etc" + File.separatorChar
+ "ghg" + File.separatorChar + "sortDown.gif";
return config;
}
public Table getGhgTable() {
return ghgTable;
}