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

Former-commit-id: 06ae8809fa [formerly 08e6cd0a31] [formerly 276ce2ad08] [formerly 06ae8809fa [formerly 08e6cd0a31] [formerly 276ce2ad08] [formerly e47d1beb09 [formerly 276ce2ad08 [formerly 8d14e957dc2152a31c813a9278646904e2a3c777]]]]
Former-commit-id: e47d1beb09
Former-commit-id: c24bec08e8 [formerly f5008c2296] [formerly 27b66859fd05b9181f78df1b75f9d85077739203 [formerly cebd35bb47]]
Former-commit-id: 6ebfdc1fd26cb526db0f12e8bf58a079db851e17 [formerly 2cdc38472f]
Former-commit-id: bb7ec69f5d
This commit is contained in:
Lee Venable 2012-10-30 16:45:35 -05:00 committed by Gerrit Code Review
commit 331b820918
2 changed files with 21 additions and 13 deletions

View file

@ -27,7 +27,7 @@ import com.raytheon.viz.gfe.dialogs.BrightnessDialog;
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
/**
* TODO Add Description
* Action class for dispalying the Change Brightness dialog.
*
* <pre>
*
@ -35,6 +35,7 @@ import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 18, 2010 wldougher Initial creation
* Oct 30, 2012 1298 rferrel Changes for non-blocking BrightnessDialog.
*
* </pre>
*
@ -43,6 +44,7 @@ import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
*/
public class ChangeBrightnessAction extends AbstractRightClickAction {
private BrightnessDialog dialog;
protected Parm parm;
@ -53,10 +55,15 @@ public class ChangeBrightnessAction extends AbstractRightClickAction {
@Override
public void run() {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
BrightnessDialog dialog = new BrightnessDialog(shell, parm);
dialog.open();
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
dialog = new BrightnessDialog(shell, parm);
dialog.setBlockOnOpen(false);
dialog.open();
} else {
dialog.bringToTop();
}
}
}

View file

@ -54,6 +54,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 18, 2010 wldougher Initial creation
* Oct 30, 2012 1298 rferrel Code cleanup for non-blocking dialog.
*
* </pre>
*
@ -64,38 +65,38 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
public class BrightnessDialog extends CaveJFACEDialog {
// A width hint that keeps part of the title from being cut off
private static final int WIDTH_HINT = 235;
private final int WIDTH_HINT = 235;
/**
* A label for displaying the scale's value, that moves with the scale thumb
*/
protected Label driftingLabel;
private Label driftingLabel;
/**
* A scale for adjusting brightness.
*/
protected Scale scale;
private Scale scale;
/**
* A text field; an alternate way of changing the brightness.
*/
protected Text field;
private Text field;
/**
* The brightness for the weather element (0-1).
*/
protected float brightness;
private float brightness;
/**
* The brightness value when the dialog is first opened. Used by field
* validation code.
*/
protected float originalBrightness;
private float originalBrightness;
/**
* The composite for the main dialog area.
*/
protected Composite comp;
private Composite comp;
private Parm parm;
@ -104,7 +105,7 @@ public class BrightnessDialog extends CaveJFACEDialog {
/**
* Multiplier to keep driftingLabel from very ends of the dialog.
*/
protected static final float FUDGE_FACTOR = 0.8f;
private final float FUDGE_FACTOR = 0.8f;
/**
* Constructor.