Issue #1229 Changes to make WindRoseConfigDlg non-blocking.
Change-Id: I647c4f2c425d841fc76c9fefe7e0c4cc71e49975 Former-commit-id:9e39bbd917
[formerlybea38635ca
] [formerly3cf44f7b31
] [formerlyaf6159c5dd
[formerly3cf44f7b31
[formerly 840e45f4a39c423cb6d92a2848c01fb5f4ef3be8]]] Former-commit-id:af6159c5dd
Former-commit-id: 904e335d39fac8fa339f8191ab25a3d0e82935e9 [formerly0ba409ed6f
] Former-commit-id:c7df74b5b2
This commit is contained in:
parent
3721d18b43
commit
d8b054eb0d
2 changed files with 30 additions and 21 deletions
|
@ -61,6 +61,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 28 FEB 2008 938 lvenable Initial creation
|
* 28 FEB 2008 938 lvenable Initial creation
|
||||||
* 18 JUN 2008 1119 lvenable Updated dialog to reflect user changes.
|
* 18 JUN 2008 1119 lvenable Updated dialog to reflect user changes.
|
||||||
|
* 04 OCT 2012 1229 rferrel Made non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -162,7 +163,8 @@ public class WindRoseConfigDlg extends CaveSWTDialog {
|
||||||
* Parent shell.
|
* Parent shell.
|
||||||
*/
|
*/
|
||||||
public WindRoseConfigDlg(Shell parent, WindRoseConfigData windRoseConfigData) {
|
public WindRoseConfigDlg(Shell parent, WindRoseConfigData windRoseConfigData) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||||
|
| CAVE.DO_NOT_BLOCK);
|
||||||
setText("Config");
|
setText("Config");
|
||||||
|
|
||||||
this.windRoseConfigData = windRoseConfigData;
|
this.windRoseConfigData = windRoseConfigData;
|
||||||
|
|
|
@ -55,6 +55,7 @@ import org.eclipse.swt.widgets.MenuItem;
|
||||||
import org.eclipse.swt.widgets.MessageBox;
|
import org.eclipse.swt.widgets.MessageBox;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Spinner;
|
import org.eclipse.swt.widgets.Spinner;
|
||||||
|
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
import com.raytheon.viz.avnconfig.HelpUsageDlg;
|
||||||
import com.raytheon.viz.avnconfig.ITafSiteConfig;
|
import com.raytheon.viz.avnconfig.ITafSiteConfig;
|
||||||
|
@ -81,6 +82,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 4/14/2011 8861 rferrel Use SaveImageDlg class
|
* 4/14/2011 8861 rferrel Use SaveImageDlg class
|
||||||
* 23JUL2012 15169 zhao Use Combo for 'Month' and 'Number of Months'
|
* 23JUL2012 15169 zhao Use Combo for 'Month' and 'Number of Months'
|
||||||
* & disabled site controls while drawing
|
* & disabled site controls while drawing
|
||||||
|
* 04OCT2012 1229 rferrel Changes for non-blocking WindRoseConfigDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -183,6 +185,8 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
private RGB statusCompRGB;
|
private RGB statusCompRGB;
|
||||||
|
|
||||||
|
private WindRoseConfigDlg configDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -321,9 +325,13 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
configureMI.addSelectionListener(new SelectionAdapter() {
|
configureMI.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
WindRoseConfigDlg configDlg = new WindRoseConfigDlg(shell,
|
if (configDlg == null || configDlg.getShell() == null
|
||||||
windRoseConfigData);
|
|| configDlg.isDisposed()) {
|
||||||
configDlg.open();
|
configDlg = new WindRoseConfigDlg(shell, windRoseConfigData);
|
||||||
|
configDlg.open();
|
||||||
|
} else {
|
||||||
|
configDlg.bringToTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -431,16 +439,15 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
gd = new GridData(66, SWT.DEFAULT);
|
gd = new GridData(66, SWT.DEFAULT);
|
||||||
monthCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
monthCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||||
monthCbo.setLayoutData(gd);
|
monthCbo.setLayoutData(gd);
|
||||||
for ( int i = 1; i <= 12; i++ ) {
|
for (int i = 1; i <= 12; i++) {
|
||||||
monthCbo.add(""+i, i-1);
|
monthCbo.add("" + i, i - 1);
|
||||||
}
|
}
|
||||||
monthCbo.select(cal.get(Calendar.MONTH));
|
monthCbo.select(cal.get(Calendar.MONTH));
|
||||||
monthCbo.addSelectionListener(new SelectionAdapter() {
|
monthCbo.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
//System.out.println(" *************** monthsCbo.getText() = " + monthCbo.getText() );
|
|
||||||
if (autoRedrawChk.getSelection()) {
|
if (autoRedrawChk.getSelection()) {
|
||||||
redrawWindRose();
|
redrawWindRose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -451,16 +458,15 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
gd = new GridData(66, SWT.DEFAULT);
|
gd = new GridData(66, SWT.DEFAULT);
|
||||||
numMonthsCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
numMonthsCbo = new Combo(monthHourComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||||
numMonthsCbo.setLayoutData(gd);
|
numMonthsCbo.setLayoutData(gd);
|
||||||
for ( int i = 1; i <= 12; i++ ) {
|
for (int i = 1; i <= 12; i++) {
|
||||||
numMonthsCbo.add(""+i, i-1);
|
numMonthsCbo.add("" + i, i - 1);
|
||||||
}
|
}
|
||||||
numMonthsCbo.select(0);
|
numMonthsCbo.select(0);
|
||||||
numMonthsCbo.addSelectionListener(new SelectionAdapter() {
|
numMonthsCbo.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
//System.out.println(" *************** numMonthsCbo.getText() = " + numMonthsCbo.getText() );
|
|
||||||
if (autoRedrawChk.getSelection()) {
|
if (autoRedrawChk.getSelection()) {
|
||||||
redrawWindRose();
|
redrawWindRose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -585,11 +591,9 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
generateWindRoseHeader();
|
generateWindRoseHeader();
|
||||||
|
|
||||||
windRoseCanvasComp.updateAndRedraw(windRoseConfigData.cloneData(),
|
windRoseCanvasComp.updateAndRedraw(windRoseConfigData.cloneData(),
|
||||||
windRoseHeader,
|
windRoseHeader, monthCbo.getText(), numMonthsCbo.getText(),
|
||||||
monthCbo.getText(),
|
hourSpnr.getText(), numHoursSpnr.getText(),
|
||||||
numMonthsCbo.getText(),
|
flightCatCbo.getSelectionIndex(),
|
||||||
hourSpnr.getText(),
|
|
||||||
numHoursSpnr.getText(), flightCatCbo.getSelectionIndex(),
|
|
||||||
siteList.getItem(siteList.getSelectionIndex()), this);
|
siteList.getItem(siteList.getSelectionIndex()), this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -647,18 +651,21 @@ public class WindRosePlotDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
header.append(MONTHS[monthCbo.getSelectionIndex()]);
|
header.append(MONTHS[monthCbo.getSelectionIndex()]);
|
||||||
|
|
||||||
if ( numMonthsCbo.getSelectionIndex() == 0 ) {
|
if (numMonthsCbo.getSelectionIndex() == 0) {
|
||||||
header.append(" ");
|
header.append(" ");
|
||||||
} else {
|
} else {
|
||||||
header.append("-");
|
header.append("-");
|
||||||
|
|
||||||
int endMonth = 0;
|
int endMonth = 0;
|
||||||
|
|
||||||
if ( ( numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() ) > 11 ) {
|
if ((numMonthsCbo.getSelectionIndex() + monthCbo
|
||||||
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex() - 12;
|
.getSelectionIndex()) > 11) {
|
||||||
|
endMonth = numMonthsCbo.getSelectionIndex()
|
||||||
|
+ monthCbo.getSelectionIndex() - 12;
|
||||||
header.append(MONTHS[endMonth]);
|
header.append(MONTHS[endMonth]);
|
||||||
} else {
|
} else {
|
||||||
endMonth = numMonthsCbo.getSelectionIndex() + monthCbo.getSelectionIndex();
|
endMonth = numMonthsCbo.getSelectionIndex()
|
||||||
|
+ monthCbo.getSelectionIndex();
|
||||||
header.append(MONTHS[endMonth]);
|
header.append(MONTHS[endMonth]);
|
||||||
}
|
}
|
||||||
header.append(" ");
|
header.append(" ");
|
||||||
|
|
Loading…
Add table
Reference in a new issue