Merge "Issue #2301: Fix GHG Monitor for 13.6, prevent map mouse handler events from firing until map is loaded." into development
Former-commit-id:032f26fb85
[formerly5d1f488492
] [formerlye869334813
] [formerly032f26fb85
[formerly5d1f488492
] [formerlye869334813
] [formerlyd58763e365
[formerlye869334813
[formerly 7b1a9b3581e9c2fd56d89f904cb2811e8a4df73a]]]] Former-commit-id:d58763e365
Former-commit-id:af47ac663b
[formerlyefdd0fd13b
] [formerly cd7cbf53cd198bf12618fb9a0f8c8c04390c7716 [formerly545a1d4ea7
]] Former-commit-id: 2c84b2a91b4eed79cfd2fdc7e0f7f8ab749c30b7 [formerlyd46fca916f
] Former-commit-id:dc7bcbad36
This commit is contained in:
commit
4a514410d9
5 changed files with 45 additions and 23 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 93 B After Width: | Height: | Size: 93 B |
Before Width: | Height: | Size: 92 B After Width: | Height: | Size: 92 B |
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue