Issue #1229 Changes for non-blocking ImagingDialog.

Change-Id: Iddcbf248949a082f734f6b5de8d8941089746468

Former-commit-id: 4c906e7d5f [formerly 3d15bf8be1] [formerly c73acb0c30] [formerly 460acb4337 [formerly c73acb0c30 [formerly 185024d06da214041273674716a7efce4b2a98f1]]]
Former-commit-id: 460acb4337
Former-commit-id: 213c6a4d6d36c7d33d3c45f9001f6de42f956f28 [formerly b42cae4034]
Former-commit-id: a9cb110036
This commit is contained in:
Roger Ferrel 2012-10-17 13:53:29 -05:00
parent 810861c25a
commit f470c8fb1d
3 changed files with 21 additions and 10 deletions

View file

@ -37,6 +37,7 @@ import com.raytheon.viz.ui.dialogs.ImagingDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 22, 2006 chammack Initial Creation. * Nov 22, 2006 chammack Initial Creation.
* Oct 17, 2012 1229 rferrel Changes for non-blocking ImagingDialog.
* *
* </pre> * </pre>
* *
@ -56,7 +57,7 @@ public class ImagePropertiesAction extends AbstractHandler {
*/ */
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (dialog == null) { if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
IDisplayPaneContainer container = EditorUtil IDisplayPaneContainer container = EditorUtil
.getActiveVizContainer(); .getActiveVizContainer();
if (container != null) { if (container != null) {
@ -64,11 +65,12 @@ public class ImagePropertiesAction extends AbstractHandler {
.getCurrentWindow().getShell(), container); .getCurrentWindow().getShell(), container);
// initalize // initalize
dialog.open(); dialog.open();
} else {
dialog = null; dialog = null;
} }
} else { } else {
dialog.refreshComponents(); dialog.refreshComponents();
dialog.open(); dialog.bringToTop();
} }
return null; return null;

View file

@ -32,6 +32,7 @@ import com.raytheon.viz.ui.dialogs.ImagingDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 22, 2006 chammack Initial Creation. * Nov 22, 2006 chammack Initial Creation.
* Oct 17, 2012 1229 rferrel Changes for non-blocking ImagingDialog.
* *
* </pre> * </pre>
* *
@ -39,6 +40,7 @@ import com.raytheon.viz.ui.dialogs.ImagingDialog;
* @version 1 * @version 1
*/ */
public class ImagingAction extends AbstractRightClickAction { public class ImagingAction extends AbstractRightClickAction {
private ImagingDialog dialog;
/* /*
* (non-Javadoc) * (non-Javadoc)
@ -47,10 +49,14 @@ public class ImagingAction extends AbstractRightClickAction {
*/ */
@Override @Override
public void run() { public void run() {
AbstractVizResource<?, ?> rsc = getTopMostSelectedResource(); if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
ImagingDialog id = new ImagingDialog(VizWorkbenchManager.getInstance() AbstractVizResource<?, ?> rsc = getTopMostSelectedResource();
.getCurrentWindow().getShell(), rsc); dialog = new ImagingDialog(VizWorkbenchManager.getInstance()
id.open(); .getCurrentWindow().getShell(), rsc);
dialog.open();
} else {
dialog.bringToTop();
}
} }
/* /*

View file

@ -83,6 +83,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
* show full colormap names, and added comments &amp; Javadoc. * show full colormap names, and added comments &amp; Javadoc.
* Aug 20, 2008 dglazesk Updated for the new ColorMap interface * Aug 20, 2008 dglazesk Updated for the new ColorMap interface
* Feb 10, 2011 #7842 bkowal set caveStyle for dialog to INDEPENDENT SHELL * Feb 10, 2011 #7842 bkowal set caveStyle for dialog to INDEPENDENT SHELL
* Oct 17, 2012 #1229 rferrel Make dialog non-blocking.
* *
* </pre> * </pre>
* *
@ -92,7 +93,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
public class ImagingDialog extends CaveSWTDialog implements public class ImagingDialog extends CaveSWTDialog implements
IVizEditorChangedListener, IRenderableDisplayChangedListener, IVizEditorChangedListener, IRenderableDisplayChangedListener,
AddListener, RemoveListener, IResourceDataChanged { AddListener, RemoveListener, IResourceDataChanged {
private static final transient IUFStatusHandler statusHandler = UFStatus private final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ImagingDialog.class); .getHandler(ImagingDialog.class);
private static enum Type { private static enum Type {
@ -149,7 +150,7 @@ public class ImagingDialog extends CaveSWTDialog implements
*/ */
private Button combineNextImage; private Button combineNextImage;
private static final String UNSAVED_CMAP_DISPLAY_NAME = "Untitled Colormap"; private final String UNSAVED_CMAP_DISPLAY_NAME = "Untitled Colormap";
private boolean fromControl = false; private boolean fromControl = false;
@ -196,7 +197,8 @@ public class ImagingDialog extends CaveSWTDialog implements
* @param dialogTitle * @param dialogTitle
*/ */
public ImagingDialog(Shell parentShell, IDisplayPaneContainer initialEditor) { public ImagingDialog(Shell parentShell, IDisplayPaneContainer initialEditor) {
super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.INDEPENDENT_SHELL); super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.INDEPENDENT_SHELL
| CAVE.DO_NOT_BLOCK);
setText("Imaging..."); setText("Imaging...");
this.currentEditor = initialEditor; this.currentEditor = initialEditor;
@ -207,7 +209,8 @@ public class ImagingDialog extends CaveSWTDialog implements
} }
public ImagingDialog(Shell parentShell, AbstractVizResource<?, ?> rscToEdit) { public ImagingDialog(Shell parentShell, AbstractVizResource<?, ?> rscToEdit) {
super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.INDEPENDENT_SHELL); super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.INDEPENDENT_SHELL
| CAVE.DO_NOT_BLOCK);
setText("Imaging..."); setText("Imaging...");
this.rscToEdit = rscToEdit; this.rscToEdit = rscToEdit;
} }