Merge "Issue #1298 Changes for non-blocking FuzzValueDialog." into development

Former-commit-id: fae33021a4 [formerly c4526c5ba0] [formerly ff5083715b] [formerly fae33021a4 [formerly c4526c5ba0] [formerly ff5083715b] [formerly c44f90f675 [formerly ff5083715b [formerly e8ed91fc876a3f7e6dd67e058c3117cb616c96d2]]]]
Former-commit-id: c44f90f675
Former-commit-id: b1b2512819 [formerly 9523ad6085] [formerly 0f61b7daa2e57b5bf03170e39269f6b4fa2377a4 [formerly 4a22ded443]]
Former-commit-id: be37ba43b25491e7af4571b70fb7f2031ae1ad99 [formerly 3bdfe02fe3]
Former-commit-id: 4329af5cea
This commit is contained in:
Lee Venable 2012-11-08 10:57:45 -06:00 committed by Gerrit Code Review
commit 8e85bbad3e
2 changed files with 30 additions and 20 deletions

View file

@ -32,6 +32,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Scale;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.msgs.IActivatedParmChangedListener;
@ -60,6 +61,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 10, 2008 Eric Babin Initial Creation
* Nov 10, 2012 1298 rferrel Changes for non-blocking dialog.
*
* </pre>
*
@ -94,9 +96,25 @@ public class FuzzValueDialog extends CaveJFACEDialog implements
private DataManager dataManager;
public FuzzValueDialog(Shell parent, DataManager dataManager) {
private static FuzzValueDialog dialog;
public static void openDialog(DataManager dataManager) {
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
dialog = new FuzzValueDialog(shell, dataManager);
dialog.setBlockOnOpen(false);
dialog.open();
} else {
dialog.bringToTop();
}
}
private FuzzValueDialog(Shell parent, DataManager dataManager) {
super(parent);
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE);
this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
this.dataManager = dataManager;
this.parm = dataManager.getSpatialDisplayManager().getActivatedParm();
this.minimum = parm.getGridInfo().getMinValue();

View file

@ -44,8 +44,6 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.geotools.coverage.grid.GridGeometry2D;
import org.opengis.metadata.spatial.PixelOrientation;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@ -160,6 +158,7 @@ import com.vividsolutions.jts.geom.Envelope;
* Aug 20, 2008 dglazesk Update for the ColorMap interface change
* Nov 23, 2011 mli set vector lineStyle
* May 11, 2012 njensen Allow rsc to be recycled
* Nov 08, 2012 1298 rferrel Changes for non-blocking FuzzValueDialog.
*
* </pre>
*
@ -171,28 +170,28 @@ import com.vividsolutions.jts.geom.Envelope;
public class GFEResource extends
AbstractVizResource<GFEResourceData, MapDescriptor> implements
IResourceDataChanged, IContextMenuContributor, IMessageClient {
private static final transient IUFStatusHandler statusHandler = UFStatus
private final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GFEResource.class);
/** maximum label size in pixels */
private static final int maxLabelLength = 100;
private final int maxLabelLength = 100;
/** maximum label height in pixels */
@SuppressWarnings("unused")
private static final int maxLabelHeight = 40;
private final int maxLabelHeight = 40;
/** distance between labels */
private static final int pixelDistance = 125;
private final int pixelDistance = 125;
private static final Set<VisualizationType> OUTLINE_TYPES = EnumSet.of(
private final Set<VisualizationType> OUTLINE_TYPES = EnumSet.of(
VisualizationType.CONTOUR, VisualizationType.WIND_ARROW,
VisualizationType.WIND_BARB, VisualizationType.BOUNDED_AREA);
private static final Set<VisualizationType> DENSITY_TYPES = EnumSet.of(
private final Set<VisualizationType> DENSITY_TYPES = EnumSet.of(
VisualizationType.CONTOUR, VisualizationType.WIND_ARROW,
VisualizationType.WIND_BARB);
private static final Set<VisualizationType> MAG_TYPES = EnumSet.of(
private final Set<VisualizationType> MAG_TYPES = EnumSet.of(
VisualizationType.CONTOUR, VisualizationType.WIND_ARROW,
VisualizationType.WIND_BARB, VisualizationType.BOUNDED_AREA);
@ -274,7 +273,7 @@ public class GFEResource extends
}
};
/**
* Construct a resource that is capable of displaying a particular parm
*
@ -1202,7 +1201,6 @@ public class GFEResource extends
}
private class FuzzValueAction extends AbstractRightClickAction {
public FuzzValueAction() {
super("Set Fuzz Value...");
@ -1210,13 +1208,7 @@ public class GFEResource extends
@Override
public void run() {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
FuzzValueDialog fuzz = new FuzzValueDialog(shell, dataManager);
fuzz.setBlockOnOpen(true);
fuzz.open();
FuzzValueDialog.openDialog(dataManager);
}
}