13.3.1-20 baseline
Former-commit-id: 91210030e50e7a19c3d8d4c9d377494de2bc83dd
This commit is contained in:
parent
abaf9f12f9
commit
446bec6f49
14 changed files with 413 additions and 201 deletions
|
@ -261,8 +261,7 @@ class Procedure (SmartScript.SmartScript):
|
||||||
|
|
||||||
if checkOnly:
|
if checkOnly:
|
||||||
self.createGrid(MODEL, "MaxLessThanMin", "SCALAR", mask.astype('float32'),
|
self.createGrid(MODEL, "MaxLessThanMin", "SCALAR", mask.astype('float32'),
|
||||||
maxTR, minAllowedValue=0.0, maxAllowedValue= 1.0,
|
maxTR, minAllowedValue=0.0, maxAllowedValue= 1.0)
|
||||||
units="", descriptiveName="")
|
|
||||||
else: # force the change
|
else: # force the change
|
||||||
if maxTR in maxTLocks:
|
if maxTR in maxTLocks:
|
||||||
msg = "Can't modify MaxT grid at " + str(maxTR) + \
|
msg = "Can't modify MaxT grid at " + str(maxTR) + \
|
||||||
|
|
|
@ -21,6 +21,8 @@ package com.raytheon.uf.viz.gisdatastore.ui;
|
||||||
|
|
||||||
import org.eclipse.jface.dialogs.Dialog;
|
import org.eclipse.jface.dialogs.Dialog;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.events.DisposeEvent;
|
||||||
|
import org.eclipse.swt.events.DisposeListener;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.graphics.GC;
|
import org.eclipse.swt.graphics.GC;
|
||||||
|
@ -47,6 +49,7 @@ import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 27, 2012 randerso Initial creation
|
* Nov 27, 2012 randerso Initial creation
|
||||||
|
* Apr 9, 2013 #1860 randerso Fix image disposed issued on Windows
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -87,7 +90,7 @@ public class LineStyleDialog extends Dialog {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
TableItem item = new TableItem(table, SWT.NONE);
|
TableItem item = new TableItem(table, SWT.NONE);
|
||||||
Image image = new Image(d, 128, 10);
|
final Image image = new Image(d, 128, 10);
|
||||||
Rectangle bounds = image.getBounds();
|
Rectangle bounds = image.getBounds();
|
||||||
int[] dashes = ls.getSWTLineStyle();
|
int[] dashes = ls.getSWTLineStyle();
|
||||||
GC gc = new GC(image);
|
GC gc = new GC(image);
|
||||||
|
@ -98,7 +101,14 @@ public class LineStyleDialog extends Dialog {
|
||||||
|
|
||||||
gc.dispose();
|
gc.dispose();
|
||||||
item.setImage(image);
|
item.setImage(image);
|
||||||
|
item.addDisposeListener(new DisposeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void widgetDisposed(DisposeEvent e) {
|
||||||
image.dispose();
|
image.dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
item.setData(ls);
|
item.setData(ls);
|
||||||
|
|
||||||
if (ls.equals(this.style)) {
|
if (ls.equals(this.style)) {
|
||||||
|
|
|
@ -21,6 +21,8 @@ package com.raytheon.uf.viz.gisdatastore.ui;
|
||||||
|
|
||||||
import org.eclipse.jface.dialogs.Dialog;
|
import org.eclipse.jface.dialogs.Dialog;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.events.DisposeEvent;
|
||||||
|
import org.eclipse.swt.events.DisposeListener;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.graphics.GC;
|
import org.eclipse.swt.graphics.GC;
|
||||||
|
@ -45,6 +47,7 @@ import org.eclipse.swt.widgets.TableItem;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 27, 2012 randerso Initial creation
|
* Nov 27, 2012 randerso Initial creation
|
||||||
|
* Apr 9, 2013 #1860 randerso Fix image disposed issued on Windows
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -88,7 +91,7 @@ public class LineWidthDialog extends Dialog {
|
||||||
|
|
||||||
for (int w = min; w <= max; w++) {
|
for (int w = min; w <= max; w++) {
|
||||||
TableItem item = new TableItem(table, SWT.NONE);
|
TableItem item = new TableItem(table, SWT.NONE);
|
||||||
Image image = new Image(d, 128, 10);
|
final Image image = new Image(d, 128, 10);
|
||||||
Rectangle bounds = image.getBounds();
|
Rectangle bounds = image.getBounds();
|
||||||
GC gc = new GC(image);
|
GC gc = new GC(image);
|
||||||
gc.fillRectangle(bounds);
|
gc.fillRectangle(bounds);
|
||||||
|
@ -98,7 +101,13 @@ public class LineWidthDialog extends Dialog {
|
||||||
|
|
||||||
gc.dispose();
|
gc.dispose();
|
||||||
item.setImage(image);
|
item.setImage(image);
|
||||||
|
item.addDisposeListener(new DisposeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void widgetDisposed(DisposeEvent e) {
|
||||||
image.dispose();
|
image.dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
item.setData(w);
|
item.setData(w);
|
||||||
|
|
||||||
if (w == this.width) {
|
if (w == this.width) {
|
||||||
|
|
|
@ -24,8 +24,6 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.MenuEvent;
|
|
||||||
import org.eclipse.swt.events.MenuListener;
|
|
||||||
import org.eclipse.swt.events.MouseAdapter;
|
import org.eclipse.swt.events.MouseAdapter;
|
||||||
import org.eclipse.swt.events.MouseEvent;
|
import org.eclipse.swt.events.MouseEvent;
|
||||||
import org.eclipse.swt.events.MouseTrackAdapter;
|
import org.eclipse.swt.events.MouseTrackAdapter;
|
||||||
|
@ -46,6 +44,8 @@ import org.eclipse.swt.widgets.Listener;
|
||||||
import org.eclipse.swt.widgets.Menu;
|
import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.swt.widgets.MenuItem;
|
import org.eclipse.swt.widgets.MenuItem;
|
||||||
|
|
||||||
|
import com.raytheon.uf.viz.ui.menus.widgets.tearoff.TearOffMenuDialog.MenuPathElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the information for all the menu items in the dialog
|
* Holds the information for all the menu items in the dialog
|
||||||
*
|
*
|
||||||
|
@ -56,6 +56,7 @@ import org.eclipse.swt.widgets.MenuItem;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 15, 2011 mnash Initial creation
|
* Sep 15, 2011 mnash Initial creation
|
||||||
|
* Apr 10, 2013 DR 15185 D. Friedman Preserve tear-offs over perspective switches.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -63,7 +64,7 @@ import org.eclipse.swt.widgets.MenuItem;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MenuItemComposite extends Composite implements MenuListener {
|
public class MenuItemComposite extends Composite {
|
||||||
|
|
||||||
private boolean separator = false;
|
private boolean separator = false;
|
||||||
|
|
||||||
|
@ -74,6 +75,8 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
// backing data for executing listeners
|
// backing data for executing listeners
|
||||||
private MenuItem item;
|
private MenuItem item;
|
||||||
|
|
||||||
|
private MenuPathElement itemPath;
|
||||||
|
|
||||||
private Image arrow = null;
|
private Image arrow = null;
|
||||||
|
|
||||||
private Image highlightedArrow = null;
|
private Image highlightedArrow = null;
|
||||||
|
@ -84,8 +87,6 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
|
|
||||||
private List<String> myPath;
|
private List<String> myPath;
|
||||||
|
|
||||||
private Menu topMostParent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parent
|
* @param parent
|
||||||
* @param style
|
* @param style
|
||||||
|
@ -108,14 +109,13 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
do {
|
do {
|
||||||
myPath.add(toAdd.getText());
|
myPath.add(toAdd.getText());
|
||||||
toAdd = parent.getParentItem();
|
toAdd = parent.getParentItem();
|
||||||
topMostParent = parent;
|
|
||||||
parent = parent.getParentMenu();
|
parent = parent.getParentMenu();
|
||||||
} while (parent.getParentMenu() != null);
|
} while (parent.getParentMenu() != null);
|
||||||
|
|
||||||
Collections.reverse(myPath);
|
Collections.reverse(myPath);
|
||||||
|
|
||||||
topMostParent.addMenuListener(this);
|
|
||||||
item = it;
|
item = it;
|
||||||
|
itemPath = new MenuPathElement(it);
|
||||||
|
|
||||||
String[] labels = item.getText().split("\t");
|
String[] labels = item.getText().split("\t");
|
||||||
// handle for a separator menu item
|
// handle for a separator menu item
|
||||||
|
@ -189,6 +189,8 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private void addItemListeners() {
|
private void addItemListeners() {
|
||||||
|
if (item == null)
|
||||||
|
return;
|
||||||
if (updateListener != null) {
|
if (updateListener != null) {
|
||||||
item.addListener(SWT.Modify, updateListener);
|
item.addListener(SWT.Modify, updateListener);
|
||||||
}
|
}
|
||||||
|
@ -209,11 +211,11 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
for (Control comp : firstItem.getParent().getParent()
|
for (Control comp : firstItem.getParent().getParent()
|
||||||
.getChildren()) {
|
.getChildren()) {
|
||||||
MenuItemComposite composite = (MenuItemComposite) comp;
|
MenuItemComposite composite = (MenuItemComposite) comp;
|
||||||
if (composite.item.getText().equals(
|
if (composite.getItem().getText().equals(
|
||||||
((MenuItem) e.widget).getText())) {
|
((MenuItem) e.widget).getText())) {
|
||||||
if (composite.firstItem instanceof Button) {
|
if (composite.firstItem instanceof Button) {
|
||||||
((Button) composite.firstItem)
|
((Button) composite.firstItem)
|
||||||
.setSelection(composite.item
|
.setSelection(composite.getItem()
|
||||||
.getSelection());
|
.getSelection());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -233,7 +235,7 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(Event event) {
|
public void handleEvent(Event event) {
|
||||||
if (secondItem != null && !secondItem.isDisposed()) {
|
if (secondItem != null && !secondItem.isDisposed()) {
|
||||||
if (item == event.data) {
|
if (getItem() == event.data) {
|
||||||
if (((MenuItem) event.data).getText().split("\t").length > 1) {
|
if (((MenuItem) event.data).getText().split("\t").length > 1) {
|
||||||
((Label) secondItem)
|
((Label) secondItem)
|
||||||
.setText(((MenuItem) event.data).getText()
|
.setText(((MenuItem) event.data).getText()
|
||||||
|
@ -377,6 +379,8 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
MouseAdapter mouseAdapter = new MouseAdapter() {
|
MouseAdapter mouseAdapter = new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseDown(MouseEvent e) {
|
public void mouseDown(MouseEvent e) {
|
||||||
|
MenuItem item = getItem();
|
||||||
|
|
||||||
if (item.getMenu() != null) {
|
if (item.getMenu() != null) {
|
||||||
// This is item opens a submenu, get the y offset based on
|
// This is item opens a submenu, get the y offset based on
|
||||||
// the location of the click
|
// the location of the click
|
||||||
|
@ -420,7 +424,7 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
for (int i = 0; i < siblings.length; i++) {
|
for (int i = 0; i < siblings.length; i++) {
|
||||||
final MenuItemComposite mic = (MenuItemComposite) siblings[i];
|
final MenuItemComposite mic = (MenuItemComposite) siblings[i];
|
||||||
if (mic.separator == false
|
if (mic.separator == false
|
||||||
&& mic.item.getStyle() == SWT.RADIO) {
|
&& mic.getItem().getStyle() == SWT.RADIO) {
|
||||||
try {
|
try {
|
||||||
MenuItemComposite parent = null;
|
MenuItemComposite parent = null;
|
||||||
// check whether a Label is clicked or a
|
// check whether a Label is clicked or a
|
||||||
|
@ -434,16 +438,16 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
// check that the radio groups match
|
// check that the radio groups match
|
||||||
if (mic.getData("radioGroup").equals(
|
if (mic.getData("radioGroup").equals(
|
||||||
parent.getData("radioGroup"))) {
|
parent.getData("radioGroup"))) {
|
||||||
if (!parent.item
|
if (!parent.getItem()
|
||||||
.getText()
|
.getText()
|
||||||
.replaceAll("&", "")
|
.replaceAll("&", "")
|
||||||
.equals(mic.item.getText().replaceAll(
|
.equals(mic.getItem().getText().replaceAll(
|
||||||
"&", ""))) {
|
"&", ""))) {
|
||||||
mic.item.setSelection(false);
|
mic.getItem().setSelection(false);
|
||||||
((Button) mic.firstItem)
|
((Button) mic.firstItem)
|
||||||
.setSelection(false);
|
.setSelection(false);
|
||||||
} else {
|
} else {
|
||||||
mic.item.setSelection(true);
|
mic.getItem().setSelection(true);
|
||||||
((Button) mic.firstItem).setSelection(true);
|
((Button) mic.firstItem).setSelection(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -476,10 +480,6 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (topMostParent != null) {
|
|
||||||
topMostParent.removeMenuListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -489,67 +489,40 @@ public class MenuItemComposite extends Composite implements MenuListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
private MenuItem getItem() {
|
||||||
* (non-Javadoc)
|
MenuItem item = getItemIfAvailable();
|
||||||
*
|
if (item == null)
|
||||||
* @see
|
throw new IllegalStateException(
|
||||||
* org.eclipse.swt.events.MenuListener#menuHidden(org.eclipse.swt.events
|
String.format("Could not find target of tear-off menu item \"%s\"",
|
||||||
* .MenuEvent)
|
itemPath.getName()));
|
||||||
*/
|
return item;
|
||||||
@Override
|
|
||||||
public void menuHidden(MenuEvent e) {
|
|
||||||
if (item.isDisposed() == false) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// At some point we may need to check against the index as well but that
|
private MenuItem getItemIfAvailable() {
|
||||||
// is difficult because we don't know if the tear off menu item will/was
|
if (item == null || item.isDisposed()) {
|
||||||
// in the menu when we were created/now so our index could be off by one
|
item = findItem();
|
||||||
// very easily making it unreliable
|
|
||||||
Menu menu = topMostParent;
|
|
||||||
MenuItem myItem = null;
|
|
||||||
String last = myPath.get(myPath.size() - 1);
|
|
||||||
for (String path : myPath) {
|
|
||||||
if (menu != null) {
|
|
||||||
MenuItem[] items = menu.getItems();
|
|
||||||
for (int i = 0; i < items.length; ++i) {
|
|
||||||
MenuItem item = items[i];
|
|
||||||
if (path.equals(item.getText())) {
|
|
||||||
if (path == last) {
|
|
||||||
myItem = item;
|
|
||||||
} else {
|
|
||||||
menu = item.getMenu();
|
|
||||||
|
|
||||||
if (menu != null && menu.getItemCount() == 0) {
|
|
||||||
// Have to manually fill menu
|
|
||||||
for (Listener listener : menu
|
|
||||||
.getListeners(SWT.Show)) {
|
|
||||||
Event event = new Event();
|
|
||||||
event.type = SWT.Show;
|
|
||||||
event.widget = menu;
|
|
||||||
listener.handleEvent(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (myItem != null && myItem.isDisposed() == false) {
|
|
||||||
item = myItem;
|
|
||||||
addItemListeners();
|
addItemListeners();
|
||||||
}
|
}
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
private MenuItem findItem() {
|
||||||
* (non-Javadoc)
|
Menu menu = getTargetMenu();
|
||||||
*
|
if (menu != null)
|
||||||
* @see
|
return TearOffMenuDialog.findItem(menu, itemPath);
|
||||||
* org.eclipse.swt.events.MenuListener#menuShown(org.eclipse.swt.events.
|
else
|
||||||
* MenuEvent)
|
return null;
|
||||||
*/
|
}
|
||||||
@Override
|
|
||||||
public void menuShown(MenuEvent e) {
|
private Menu getTargetMenu() {
|
||||||
|
return getDialog().getTargetMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
private TearOffMenuDialog getDialog() {
|
||||||
|
return (TearOffMenuDialog) getShell().getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reconnect() {
|
||||||
|
getItemIfAvailable();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -27,6 +27,7 @@ import org.eclipse.swt.widgets.Listener;
|
||||||
import org.eclipse.swt.widgets.Menu;
|
import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.swt.widgets.MenuItem;
|
import org.eclipse.swt.widgets.MenuItem;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
import org.eclipse.ui.IEditorPart;
|
||||||
|
|
||||||
import com.raytheon.viz.ui.EditorUtil;
|
import com.raytheon.viz.ui.EditorUtil;
|
||||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||||
|
@ -41,6 +42,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 5, 2011 mnash Initial creation
|
* Dec 5, 2011 mnash Initial creation
|
||||||
|
* Apr 10, 2013 DR 15185 D. Friedman Do not assume there is an active editor.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -88,7 +90,10 @@ public class PopupMenu {
|
||||||
mItem.addListener(SWT.Selection, new Listener() {
|
mItem.addListener(SWT.Selection, new Listener() {
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(Event event) {
|
public void handleEvent(Event event) {
|
||||||
((AbstractEditor) EditorUtil.getActiveEditor()).refresh();
|
IEditorPart editor = EditorUtil.getActiveEditor();
|
||||||
|
if (editor instanceof AbstractEditor) {
|
||||||
|
((AbstractEditor) editor).refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,12 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.ui.menus.widgets.tearoff;
|
package com.raytheon.uf.viz.ui.menus.widgets.tearoff;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.jface.action.ContributionItem;
|
||||||
|
import org.eclipse.jface.action.MenuManager;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.custom.ScrolledComposite;
|
import org.eclipse.swt.custom.ScrolledComposite;
|
||||||
import org.eclipse.swt.graphics.Point;
|
import org.eclipse.swt.graphics.Point;
|
||||||
|
@ -53,6 +59,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 14, 2011 mnash Initial creation
|
* Sep 14, 2011 mnash Initial creation
|
||||||
* Jan 09, 2013 1442 rferrel Add Simulated Time Change Listener.
|
* Jan 09, 2013 1442 rferrel Add Simulated Time Change Listener.
|
||||||
|
* Apr 10, 2013 DR 15185 D. Friedman Preserve tear-offs over perspective switches.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -62,7 +69,9 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
public class TearOffMenuDialog extends CaveSWTDialog {
|
public class TearOffMenuDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
private MenuItem[] items;
|
private MenuPathElement[] menuPath;
|
||||||
|
|
||||||
|
private Menu menu;
|
||||||
|
|
||||||
private ScrolledComposite scrolledComp;
|
private ScrolledComposite scrolledComp;
|
||||||
|
|
||||||
|
@ -80,8 +89,9 @@ public class TearOffMenuDialog extends CaveSWTDialog {
|
||||||
public TearOffMenuDialog(Menu menu) {
|
public TearOffMenuDialog(Menu menu) {
|
||||||
super(VizWorkbenchManager.getInstance().getCurrentWindow().getShell(),
|
super(VizWorkbenchManager.getInstance().getCurrentWindow().getShell(),
|
||||||
SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
|
SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK);
|
||||||
|
this.menuPath = getMenuPath(menu);
|
||||||
|
this.menu = menu;
|
||||||
String text = menu.getParentItem().getText();
|
String text = menu.getParentItem().getText();
|
||||||
this.items = menu.getItems();
|
|
||||||
|
|
||||||
// handle for the & that makes key bindings
|
// handle for the & that makes key bindings
|
||||||
setText(text.replace("&", ""));
|
setText(text.replace("&", ""));
|
||||||
|
@ -89,6 +99,7 @@ public class TearOffMenuDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initializeComponents(final Shell shell) {
|
protected void initializeComponents(final Shell shell) {
|
||||||
|
shell.setData(this);
|
||||||
// allow for scrolling if necessary
|
// allow for scrolling if necessary
|
||||||
scrolledComp = new ScrolledComposite(shell, SWT.V_SCROLL);
|
scrolledComp = new ScrolledComposite(shell, SWT.V_SCROLL);
|
||||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||||
|
@ -106,6 +117,7 @@ public class TearOffMenuDialog extends CaveSWTDialog {
|
||||||
// go through menu items and build MenuItemComposite for each item,
|
// go through menu items and build MenuItemComposite for each item,
|
||||||
// which handles all the selection and color of the "MenuItem" in the
|
// which handles all the selection and color of the "MenuItem" in the
|
||||||
// dialog
|
// dialog
|
||||||
|
MenuItem[] items = getTargetMenu().getItems();
|
||||||
int radioGroup = 0;
|
int radioGroup = 0;
|
||||||
for (int i = 1; i < items.length; i++) {
|
for (int i = 1; i < items.length; i++) {
|
||||||
MenuItem item = items[i];
|
MenuItem item = items[i];
|
||||||
|
@ -140,11 +152,10 @@ public class TearOffMenuDialog extends CaveSWTDialog {
|
||||||
int y = point.y;
|
int y = point.y;
|
||||||
shell.setLocation(x, y);
|
shell.setLocation(x, y);
|
||||||
|
|
||||||
// close the dialog on perspective change
|
shell.addListener(SWT.Show, new Listener() {
|
||||||
shell.addListener(SWT.Hide, new Listener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(Event event) {
|
public void handleEvent(Event event) {
|
||||||
close();
|
updateItems();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -204,12 +215,156 @@ public class TearOffMenuDialog extends CaveSWTDialog {
|
||||||
* Force update of item's display.
|
* Force update of item's display.
|
||||||
*/
|
*/
|
||||||
private void updateItems() {
|
private void updateItems() {
|
||||||
// items[0] is the tear off object and is not in the dialog's display.
|
Menu menu = getMenuIfAvailable();
|
||||||
for (int index = 1; index < items.length; ++index) {
|
if (menu == null)
|
||||||
MenuItem item = items[index];
|
return;
|
||||||
|
for (MenuItemComposite mic : getMenuItemComposites())
|
||||||
|
mic.reconnect();
|
||||||
|
for (MenuItem item : menu.getItems()) {
|
||||||
if (item.getData() instanceof BundleContributionItem) {
|
if (item.getData() instanceof BundleContributionItem) {
|
||||||
((BundleContributionItem) item.getData()).refreshText();
|
((BundleContributionItem) item.getData()).refreshText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<MenuItemComposite> getMenuItemComposites() {
|
||||||
|
List<MenuItemComposite> result = new ArrayList<MenuItemComposite>();
|
||||||
|
for (Control c : fullComp.getChildren()) {
|
||||||
|
if (c instanceof MenuItemComposite)
|
||||||
|
result.add((MenuItemComposite) c);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the portion of a menu item's title that should not change over
|
||||||
|
* time
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static String getCleanMenuItemText(String text) {
|
||||||
|
int pos = text.indexOf('\t');
|
||||||
|
if (pos >= 0)
|
||||||
|
return text.substring(0, pos);
|
||||||
|
else
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Menu getMenuIfAvailable() {
|
||||||
|
if (menu == null || menu.isDisposed()) {
|
||||||
|
menu = findMenu();
|
||||||
|
}
|
||||||
|
return menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*package*/ Menu getTargetMenu() {
|
||||||
|
Menu menu = getMenuIfAvailable();
|
||||||
|
if (menu == null) {
|
||||||
|
throw new IllegalStateException(
|
||||||
|
String.format("Tear-off menu %s is not available", shell.getText()));
|
||||||
|
}
|
||||||
|
if (menu.getItems().length == 0)
|
||||||
|
tryToFillMenu(menu);
|
||||||
|
return menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tryToFillMenu(Menu menu) {
|
||||||
|
/*
|
||||||
|
* Menu may not have been created so call listeners. This still does
|
||||||
|
* not work if all of the menu items need the workbench window to be
|
||||||
|
* active in order to be enabled.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Shell shell = this.shell.getParent().getShell();
|
||||||
|
shell.setActive();
|
||||||
|
while (shell.getDisplay().readAndDispatch()) {
|
||||||
|
// nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
Event event = new Event();
|
||||||
|
event.type = SWT.Show;
|
||||||
|
menu.notifyListeners(SWT.Show, event);
|
||||||
|
event = new Event();
|
||||||
|
event.type = SWT.Hide;
|
||||||
|
menu.notifyListeners(SWT.Hide, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Menu findMenu() {
|
||||||
|
/* NOTE: Assuming shell.getParent().getShell() is the workbench window. */
|
||||||
|
Menu container = shell.getParent().getShell().getMenuBar();
|
||||||
|
MenuPathElement lastPathElement = null;
|
||||||
|
for (int i = 0; i < menuPath.length; ++i) {
|
||||||
|
MenuItem mi = findItem(container, menuPath[i]);
|
||||||
|
if (mi == null)
|
||||||
|
return null;
|
||||||
|
Menu mim = mi.getMenu();
|
||||||
|
if (mim == null)
|
||||||
|
throw new IllegalStateException(String.format(
|
||||||
|
"Could not get target menu \"%s\" in %s",
|
||||||
|
menuPath[i].getName(), lastPathElement != null ?
|
||||||
|
'"' + lastPathElement.getName() + '"' : "menu bar"));
|
||||||
|
tryToFillMenu(mim);
|
||||||
|
container = mim;
|
||||||
|
lastPathElement = menuPath[i];
|
||||||
|
}
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Identifies a specific item in an SWT menu. It has been observed that
|
||||||
|
* associated data of a menu item maintains the same identity during a CAVE
|
||||||
|
* session even if the MenuItem is recreated. However, the associated
|
||||||
|
* data is not always unique. Menu item text is used to differentiate.
|
||||||
|
*/
|
||||||
|
static class MenuPathElement {
|
||||||
|
Object data;
|
||||||
|
String cleanText;
|
||||||
|
public MenuPathElement(MenuItem item) {
|
||||||
|
data = item.getData();
|
||||||
|
cleanText = getCleanMenuItemText(item.getText());
|
||||||
|
}
|
||||||
|
public int getMatchLevel(MenuItem item) {
|
||||||
|
int level = 0;
|
||||||
|
if (item.getData() == data)
|
||||||
|
++level;
|
||||||
|
if (cleanText.equals(item.getText()))
|
||||||
|
++level;
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
public String getName() {
|
||||||
|
if (cleanText != null && cleanText.length() > 0)
|
||||||
|
return cleanText;
|
||||||
|
Object value = data;
|
||||||
|
if (value instanceof MenuManager)
|
||||||
|
value = ((MenuManager) value).getId();
|
||||||
|
else if (value instanceof ContributionItem)
|
||||||
|
value = ((ContributionItem) value).getId();
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*package*/ static MenuItem findItem(Menu menu, MenuPathElement pe) {
|
||||||
|
MenuItem best = null;
|
||||||
|
int bestLevel = 0;
|
||||||
|
for (MenuItem item : menu.getItems()) {
|
||||||
|
int matchLevel = pe.getMatchLevel(item);
|
||||||
|
if (matchLevel > bestLevel) {
|
||||||
|
bestLevel = matchLevel;
|
||||||
|
best = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return best;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static MenuPathElement[] getMenuPath(Menu menu) {
|
||||||
|
ArrayList<MenuPathElement> data = new ArrayList<MenuPathElement>();
|
||||||
|
while (menu != null) {
|
||||||
|
MenuItem mi = menu.getParentItem();
|
||||||
|
if (mi == null)
|
||||||
|
break;
|
||||||
|
data.add(new MenuPathElement(mi));
|
||||||
|
menu = menu.getParentMenu();
|
||||||
|
}
|
||||||
|
Collections.reverse(data);
|
||||||
|
return data.toArray(new MenuPathElement[data.size()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,11 @@ import org.eclipse.swt.widgets.Listener;
|
||||||
import org.eclipse.swt.widgets.Menu;
|
import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.swt.widgets.MenuItem;
|
import org.eclipse.swt.widgets.MenuItem;
|
||||||
|
|
||||||
|
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.viz.ui.VizWorkbenchManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu listener that adds item to menu which will open dialog which is the menu
|
* Menu listener that adds item to menu which will open dialog which is the menu
|
||||||
*
|
*
|
||||||
|
@ -49,6 +54,7 @@ import org.eclipse.swt.widgets.MenuItem;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Sep 14, 2011 mschenke Initial creation
|
* Sep 14, 2011 mschenke Initial creation
|
||||||
|
* Apr 10, 2013 DR 15185 D. Friedman Preserve tear-offs over perspective switches.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -66,6 +72,9 @@ public class TearOffMenuListener implements IMenuListener2 {
|
||||||
|
|
||||||
public static final String TEAROFF_PREFERENCE_ID = "tearoffmenus";
|
public static final String TEAROFF_PREFERENCE_ID = "tearoffmenus";
|
||||||
|
|
||||||
|
private static final IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(TearOffMenuListener.class);
|
||||||
|
|
||||||
private static boolean enabled;
|
private static boolean enabled;
|
||||||
static {
|
static {
|
||||||
final IPreferenceStore store = com.raytheon.uf.viz.core.Activator
|
final IPreferenceStore store = com.raytheon.uf.viz.core.Activator
|
||||||
|
@ -94,7 +103,7 @@ public class TearOffMenuListener implements IMenuListener2 {
|
||||||
@Override
|
@Override
|
||||||
public void menuAboutToShow(final IMenuManager manager) {
|
public void menuAboutToShow(final IMenuManager manager) {
|
||||||
register(manager.getItems(), this);
|
register(manager.getItems(), this);
|
||||||
if (openDialogs.contains(getKey(manager)) == false) {
|
if (openDialogs.contains(getPerspectiveKey(manager)) == false) {
|
||||||
// We need to add our item to be first so we need to remove others
|
// We need to add our item to be first so we need to remove others
|
||||||
// then add ourself
|
// then add ourself
|
||||||
IContributionItem[] items = manager.getItems();
|
IContributionItem[] items = manager.getItems();
|
||||||
|
@ -112,7 +121,7 @@ public class TearOffMenuListener implements IMenuListener2 {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void menuAboutToHide(IMenuManager manager) {
|
public void menuAboutToHide(IMenuManager manager) {
|
||||||
if (openDialogs.contains(getKey(manager)) == false) {
|
if (openDialogs.contains(getPerspectiveKey(manager)) == false) {
|
||||||
manager.remove(ID);
|
manager.remove(ID);
|
||||||
manager.remove(ACTION_ID);
|
manager.remove(ACTION_ID);
|
||||||
unregister(manager.getItems(), this);
|
unregister(manager.getItems(), this);
|
||||||
|
@ -137,6 +146,16 @@ public class TearOffMenuListener implements IMenuListener2 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Object getPerspectiveKey(IMenuManager manager) {
|
||||||
|
String perspectiveId = "";
|
||||||
|
try {
|
||||||
|
perspectiveId = VizWorkbenchManager.getInstance().getCurrentWindow().getActivePage().getPerspective().getId();
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler.handle(Priority.EVENTA, "Failed to get current perspective ID", e);
|
||||||
|
}
|
||||||
|
return perspectiveId + "::" + getKey(manager);
|
||||||
|
}
|
||||||
|
|
||||||
private static Object getKey(IMenuManager manager) {
|
private static Object getKey(IMenuManager manager) {
|
||||||
Object key = manager;
|
Object key = manager;
|
||||||
if (manager.getId() != null) {
|
if (manager.getId() != null) {
|
||||||
|
@ -215,17 +234,18 @@ public class TearOffMenuListener implements IMenuListener2 {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
final Object key = getPerspectiveKey(manager);
|
||||||
TearOffMenuDialog dialog = new TearOffMenuDialog(menu);
|
TearOffMenuDialog dialog = new TearOffMenuDialog(menu);
|
||||||
dialog.addListener(SWT.Dispose, new Listener() {
|
dialog.addListener(SWT.Dispose, new Listener() {
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(Event event) {
|
public void handleEvent(Event event) {
|
||||||
openDialogs.remove(getKey(manager));
|
openDialogs.remove(key);
|
||||||
manager.remove(ID);
|
manager.remove(ID);
|
||||||
manager.remove(ACTION_ID);
|
manager.remove(ACTION_ID);
|
||||||
unregister(manager.getItems(), TearOffMenuListener.this);
|
unregister(manager.getItems(), TearOffMenuListener.this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
openDialogs.add(getKey(manager));
|
openDialogs.add(key);
|
||||||
register(manager.getItems(), TearOffMenuListener.this);
|
register(manager.getItems(), TearOffMenuListener.this);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,12 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.viz.awipstools.ui.action;
|
package com.raytheon.viz.awipstools.ui.action;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||||
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource.ResourceStatus;
|
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.raytheon.uf.viz.core.rsc.tools.AwipsToolsResourceData;
|
import com.raytheon.uf.viz.core.rsc.tools.AwipsToolsResourceData;
|
||||||
import com.raytheon.uf.viz.core.rsc.tools.action.AbstractMapToolAction;
|
import com.raytheon.uf.viz.core.rsc.tools.action.AbstractMapToolAction;
|
||||||
|
@ -35,6 +38,7 @@ import com.raytheon.viz.awipstools.ui.layer.TimeOfArrivalLayer;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 07DEC2007 #496 Eric Babin Initial Creation.
|
* 07DEC2007 #496 Eric Babin Initial Creation.
|
||||||
|
* Apr 12 2013 DR 16032 D. Friedman Make it work in multiple panes.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -45,10 +49,6 @@ import com.raytheon.viz.awipstools.ui.layer.TimeOfArrivalLayer;
|
||||||
public class TimeOfArrivalAction extends
|
public class TimeOfArrivalAction extends
|
||||||
AbstractMapToolAction<TimeOfArrivalLayer> {
|
AbstractMapToolAction<TimeOfArrivalLayer> {
|
||||||
|
|
||||||
private TimeOfArrivalLayer layer = null;
|
|
||||||
|
|
||||||
private AwipsToolsResourceData<TimeOfArrivalLayer> data = null;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -57,22 +57,40 @@ public class TimeOfArrivalAction extends
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected AwipsToolsResourceData<TimeOfArrivalLayer> getResourceData() {
|
protected AwipsToolsResourceData<TimeOfArrivalLayer> getResourceData() {
|
||||||
if (data == null) {
|
return new AwipsToolsResourceData<TimeOfArrivalLayer>(
|
||||||
data = new AwipsToolsResourceData<TimeOfArrivalLayer>(
|
|
||||||
TimeOfArrivalLayer.NAME, TimeOfArrivalLayer.class);
|
TimeOfArrivalLayer.NAME, TimeOfArrivalLayer.class);
|
||||||
}
|
}
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TimeOfArrivalLayer getResource(LoadProperties loadProperties,
|
protected TimeOfArrivalLayer getResource(LoadProperties loadProperties,
|
||||||
IDescriptor descriptor) throws VizException {
|
IDescriptor descriptor) throws VizException {
|
||||||
if (layer == null || layer.getStatus() == ResourceStatus.DISPOSED) {
|
TimeOfArrivalLayer layer = getExistingResource();
|
||||||
layer = super.getResource(loadProperties, descriptor);
|
if (layer == null)
|
||||||
} else {
|
return super.getResource(loadProperties, descriptor);
|
||||||
layer.reopenDialog();
|
|
||||||
|
VizApp.runAsync( new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
TimeOfArrivalLayer layer = getExistingResource();
|
||||||
|
if (layer != null) {
|
||||||
|
layer.makeEditableAndReopenDialog();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
return layer;
|
return layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TimeOfArrivalLayer getExistingResource() {
|
||||||
|
IDisplayPane[] panes = getSelectedPanes();
|
||||||
|
if (panes != null && panes.length > 0) {
|
||||||
|
List<TimeOfArrivalLayer> layers = null;
|
||||||
|
layers = panes[0].getDescriptor().getResourceList()
|
||||||
|
.getResourcesByTypeAsType(TimeOfArrivalLayer.class);
|
||||||
|
if (layers.size() > 0) {
|
||||||
|
return layers.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@ import com.raytheon.viz.awipstools.common.stormtrack.StormTrackUIManager;
|
||||||
import com.raytheon.viz.awipstools.ui.dialog.TimeOfArrivalDialog;
|
import com.raytheon.viz.awipstools.ui.dialog.TimeOfArrivalDialog;
|
||||||
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
|
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
|
||||||
import com.raytheon.viz.ui.VizWorkbenchManager;
|
import com.raytheon.viz.ui.VizWorkbenchManager;
|
||||||
|
import com.raytheon.viz.ui.input.EditableManager;
|
||||||
import com.raytheon.viz.ui.input.InputAdapter;
|
import com.raytheon.viz.ui.input.InputAdapter;
|
||||||
import com.vividsolutions.jts.geom.Coordinate;
|
import com.vividsolutions.jts.geom.Coordinate;
|
||||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||||
|
@ -98,6 +99,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
||||||
* left-to-right if there is not enough room
|
* left-to-right if there is not enough room
|
||||||
* for the text to the left of the point.
|
* for the text to the left of the point.
|
||||||
* 15Mar2013 15693 mgamazaychikov Added magnification capability.
|
* 15Mar2013 15693 mgamazaychikov Added magnification capability.
|
||||||
|
* Apr 12 2013 DR 16032 D. Friedman Make it work in multiple panes.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mschenke
|
* @author mschenke
|
||||||
|
@ -256,7 +258,6 @@ public class TimeOfArrivalLayer extends AbstractStormTrackResource {
|
||||||
this.pdProps.setMaxDisplayWidth(TimeOfArrivalLayer.PD_MAX_WIDTH);
|
this.pdProps.setMaxDisplayWidth(TimeOfArrivalLayer.PD_MAX_WIDTH);
|
||||||
|
|
||||||
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
|
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
reopenDialog();
|
|
||||||
leadState = new LeadTimeState();
|
leadState = new LeadTimeState();
|
||||||
|
|
||||||
shell = VizWorkbenchManager.getInstance().getCurrentWindow().getShell();
|
shell = VizWorkbenchManager.getInstance().getCurrentWindow().getShell();
|
||||||
|
@ -272,6 +273,7 @@ public class TimeOfArrivalLayer extends AbstractStormTrackResource {
|
||||||
if (container != null) {
|
if (container != null) {
|
||||||
container.registerMouseHandler(adapter);
|
container.registerMouseHandler(adapter);
|
||||||
}
|
}
|
||||||
|
reopenDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -565,20 +567,20 @@ public class TimeOfArrivalLayer extends AbstractStormTrackResource {
|
||||||
*/
|
*/
|
||||||
public void reopenDialog() {
|
public void reopenDialog() {
|
||||||
// Open the dialog
|
// Open the dialog
|
||||||
if (dialog == null || dialog.getShell() == null
|
|
||||||
|| dialog.getShell().isDisposed()) {
|
|
||||||
VizApp.runAsync(new Runnable() {
|
VizApp.runAsync(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (dialog == null || dialog.getShell() == null
|
||||||
|
|| dialog.getShell().isDisposed()) {
|
||||||
dialog = new TimeOfArrivalDialog(VizWorkbenchManager
|
dialog = new TimeOfArrivalDialog(VizWorkbenchManager
|
||||||
.getInstance().getCurrentWindow().getShell(),
|
.getInstance().getCurrentWindow().getShell(),
|
||||||
TimeOfArrivalLayer.this);
|
TimeOfArrivalLayer.this);
|
||||||
dialog.setBlockOnOpen(false);
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateLeadTimeState() {
|
private void updateLeadTimeState() {
|
||||||
|
@ -678,4 +680,9 @@ public class TimeOfArrivalLayer extends AbstractStormTrackResource {
|
||||||
}
|
}
|
||||||
leadState.changed = false;
|
leadState.changed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void makeEditableAndReopenDialog() {
|
||||||
|
EditableManager.makeEditable(this, true);
|
||||||
|
reopenDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,8 @@ import com.raytheon.viz.gfe.core.parm.vcparm.VCModuleJobPool;
|
||||||
* 01/22/2013 #1515 dgilling Increase default size of VCModule thread pool
|
* 01/22/2013 #1515 dgilling Increase default size of VCModule thread pool
|
||||||
* to decrease UI hang-ups waiting for results.
|
* to decrease UI hang-ups waiting for results.
|
||||||
* 03/20/2013 #1774 randerso Code cleanup
|
* 03/20/2013 #1774 randerso Code cleanup
|
||||||
|
* 04/11/2013 16028 ryu Fixed setParmsRemoveISCDeps() to not remove
|
||||||
|
* modified parms.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -822,7 +824,8 @@ public abstract class AbstractParmManager implements IParmManager {
|
||||||
List<ParmID> depParms = dependentParms(removeList.get(i), true);
|
List<ParmID> depParms = dependentParms(removeList.get(i), true);
|
||||||
for (ParmID pid : depParms) {
|
for (ParmID pid : depParms) {
|
||||||
int index = pivdIndex(toBeLoaded, pid);
|
int index = pivdIndex(toBeLoaded, pid);
|
||||||
if ((index != -1) && (!toBeLoaded.get(index).isVisible())) {
|
if ((index != -1) && (!toBeLoaded.get(index).isVisible())
|
||||||
|
&& (!getParm(toBeLoaded.get(index).getParmID()).isModified())) {
|
||||||
removeList.add(toBeLoaded.get(index).getParmID());
|
removeList.add(toBeLoaded.get(index).getParmID());
|
||||||
toBeLoaded.remove(index);
|
toBeLoaded.remove(index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@ import com.raytheon.viz.gfe.smarttool.script.SmartToolController;
|
||||||
* Jan 08, 2013 1486 dgilling Support changes to BaseGfePyController.
|
* Jan 08, 2013 1486 dgilling Support changes to BaseGfePyController.
|
||||||
* 02/14/2013 mnash Change QueryScript to use new Python concurrency
|
* 02/14/2013 mnash Change QueryScript to use new Python concurrency
|
||||||
* 02/20/2013 #1597 randerso Added logging to support GFE Performance metrics
|
* 02/20/2013 #1597 randerso Added logging to support GFE Performance metrics
|
||||||
|
* 04/10/2013 16028 ryu Check for null seTime in execute()
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -490,7 +491,8 @@ public class Tool {
|
||||||
final Date timeInfluence;
|
final Date timeInfluence;
|
||||||
Date seTime = DataManagerUIFactory.getCurrentInstance()
|
Date seTime = DataManagerUIFactory.getCurrentInstance()
|
||||||
.getSpatialDisplayManager().getSpatialEditorTime();
|
.getSpatialDisplayManager().getSpatialEditorTime();
|
||||||
if (grids.length == 1 && grid.getGridTime().contains(seTime)) {
|
if (seTime != null &&
|
||||||
|
grids.length == 1 && grid.getGridTime().contains(seTime)) {
|
||||||
timeInfluence = seTime;
|
timeInfluence = seTime;
|
||||||
} else {
|
} else {
|
||||||
timeInfluence = grid.getGridTime().getStart();
|
timeInfluence = grid.getGridTime().getStart();
|
||||||
|
|
|
@ -78,6 +78,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 03, 2010 mnash Initial creation
|
* Aug 03, 2010 mnash Initial creation
|
||||||
* MAR 05, 2013 15313 kshresth Added sampling for DMD
|
* MAR 05, 2013 15313 kshresth Added sampling for DMD
|
||||||
|
* Apr 11, 2013 DR 16030 D. Friedman Fix NPE.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -414,7 +415,7 @@ public class AbstractRadarResource<D extends IDescriptor> extends
|
||||||
displayedData.append("@" + dataMap.get("Azimuth"));
|
displayedData.append("@" + dataMap.get("Azimuth"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dataMap.get("Mnemonic").equalsIgnoreCase("DMD"))
|
if (!"DMD".equalsIgnoreCase(dataMap.get("Mnemonic")))
|
||||||
{
|
{
|
||||||
if (labels.contains(InspectLabels.ICAO)) {
|
if (labels.contains(InspectLabels.ICAO)) {
|
||||||
displayedData.append(' ').append(dataMap.get("ICAO"));
|
displayedData.append(' ').append(dataMap.get("ICAO"));
|
||||||
|
|
|
@ -27,6 +27,8 @@ import java.util.TimeZone;
|
||||||
import org.eclipse.core.runtime.ListenerList;
|
import org.eclipse.core.runtime.ListenerList;
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.events.DisposeEvent;
|
||||||
|
import org.eclipse.swt.events.DisposeListener;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
import org.eclipse.swt.graphics.Image;
|
import org.eclipse.swt.graphics.Image;
|
||||||
|
@ -51,6 +53,7 @@ import com.raytheon.viz.ui.dialogs.AwipsCalendar;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 6, 2012 randerso Initial creation
|
* Dec 6, 2012 randerso Initial creation
|
||||||
|
* Apr 9, 2013 #1860 randerso Fix image disposed issued on Windows
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -110,9 +113,15 @@ public class DateTimeEntry extends Composite {
|
||||||
Button button = new Button(this, SWT.PUSH);
|
Button button = new Button(this, SWT.PUSH);
|
||||||
ImageDescriptor imageDesc = UiPlugin
|
ImageDescriptor imageDesc = UiPlugin
|
||||||
.getImageDescriptor("icons/calendar.gif");
|
.getImageDescriptor("icons/calendar.gif");
|
||||||
Image image = imageDesc.createImage();
|
final Image image = imageDesc.createImage();
|
||||||
button.setImage(image);
|
button.setImage(image);
|
||||||
|
button.addDisposeListener(new DisposeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void widgetDisposed(DisposeEvent e) {
|
||||||
image.dispose();
|
image.dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
button.addSelectionListener(new SelectionAdapter() {
|
button.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -167,6 +167,7 @@ import com.vividsolutions.jts.io.WKTReader;
|
||||||
* 04/03/2013 1858 jsanchez Handled creating follow up warnings when created before 0z but issued after 0z.
|
* 04/03/2013 1858 jsanchez Handled creating follow up warnings when created before 0z but issued after 0z.
|
||||||
* 03/13/2013 DR 15942 Qinglu Lin Added code to prevent small area from being toggled on that
|
* 03/13/2013 DR 15942 Qinglu Lin Added code to prevent small area from being toggled on that
|
||||||
* does not meet inclusionPercent/inclusionArea criteria.
|
* does not meet inclusionPercent/inclusionArea criteria.
|
||||||
|
* 04/10/2013 DR 16044 D. Friedman Fix NPE in getAllFipsInArea.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mschenke
|
* @author mschenke
|
||||||
|
@ -2600,7 +2601,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
Set<String> fipsIds = new HashSet<String>();
|
Set<String> fipsIds = new HashSet<String>();
|
||||||
for (int n = 0; n < warningArea.getNumGeometries(); ++n) {
|
for (int n = 0; n < warningArea.getNumGeometries(); ++n) {
|
||||||
Geometry area = warningArea.getGeometryN(n);
|
Geometry area = warningArea.getGeometryN(n);
|
||||||
fipsIds.add(getFips(((CountyUserData) area.getUserData()).entry));
|
fipsIds.add(getFips(area));
|
||||||
}
|
}
|
||||||
return fipsIds;
|
return fipsIds;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue