Issue #1353 Changes for non-blocking FFFGDlg, AboutDlg, AcknowledgmentsDlg and HelpDlg dialogs.
Change-Id: Id72c6a0c0329f485fe7a9ca115c3f029019145e6 Former-commit-id:64a78503b2
[formerly64a78503b2
[formerly 372417c1d355e3c5eef327f14be9b72dfe1e0f08]] Former-commit-id:f3b83e02b4
Former-commit-id:391f07ea69
This commit is contained in:
parent
98c067a76c
commit
49bdfb071c
5 changed files with 225 additions and 155 deletions
|
@ -30,15 +30,33 @@ import org.eclipse.swt.widgets.Composite;
|
|||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
|
||||
public class AboutDlg extends CaveSWTDialog{
|
||||
/**
|
||||
* Displays the FFFG About information
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Nov 29, 2012 1353 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rferrel
|
||||
* @version 1.0
|
||||
*/
|
||||
public class AboutDlg extends CaveSWTDialog {
|
||||
|
||||
/**
|
||||
* The label object.
|
||||
*/
|
||||
|
||||
private Label aboutLbl;
|
||||
private Label aboutLbl;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -46,12 +64,13 @@ public class AboutDlg extends CaveSWTDialog{
|
|||
* Parent shell.
|
||||
*/
|
||||
public AboutDlg(Shell parent) {
|
||||
super(parent);
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||
setText("About ForcedFFG");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
|
||||
* .eclipse.swt.widgets.Shell)
|
||||
|
@ -60,14 +79,13 @@ public class AboutDlg extends CaveSWTDialog{
|
|||
protected void initializeComponents(final Shell shell) {
|
||||
setReturnValue(false);
|
||||
|
||||
|
||||
// Initialize layout
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.widthHint = 400;
|
||||
gd.heightHint = 100;
|
||||
|
||||
aboutLbl=new Label(shell,SWT.None);
|
||||
aboutLbl.setLayoutData(gd);
|
||||
aboutLbl = new Label(shell, SWT.None);
|
||||
aboutLbl.setLayoutData(gd);
|
||||
|
||||
// Add a close button
|
||||
Composite centeredComp = new Composite(shell, SWT.NONE);
|
||||
|
@ -88,21 +106,22 @@ public class AboutDlg extends CaveSWTDialog{
|
|||
|
||||
populateDlg();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void populateDlg() {
|
||||
String aboutText = " The ForceFFG GUI was closely followed FFMP, LSR,\n"+
|
||||
" ForcedFFG applications and was based on input from\n"+
|
||||
" the AWIPS User Interface Working Group. Visit \n"+
|
||||
" http://www.nws.noaa.gov/mdl/ffmp/ for more details\n"+
|
||||
" regarding this ForcedFFG GUI.";
|
||||
String aboutText = " The ForceFFG GUI was closely followed FFMP, LSR,\n"
|
||||
+ " ForcedFFG applications and was based on input from\n"
|
||||
+ " the AWIPS User Interface Working Group. Visit \n"
|
||||
+ " http://www.nws.noaa.gov/mdl/ffmp/ for more details\n"
|
||||
+ " regarding this ForcedFFG GUI.";
|
||||
|
||||
this.aboutLbl.setText(aboutText);
|
||||
this.shell.pack();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#disposed()
|
||||
*/
|
||||
@Override
|
||||
|
@ -111,4 +130,3 @@ public class AboutDlg extends CaveSWTDialog{
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,12 +32,29 @@ import org.eclipse.swt.widgets.Shell;
|
|||
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
|
||||
public class AcknowledgmentsDlg extends CaveSWTDialog{
|
||||
/**
|
||||
* Dialog to dispaly FFFG Acknowledgments.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Nov 29, 2012 1353 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rferrel
|
||||
* @version 1.0
|
||||
*/
|
||||
public class AcknowledgmentsDlg extends CaveSWTDialog {
|
||||
|
||||
/**
|
||||
* Create the label object.
|
||||
*/
|
||||
private Label acknowledgmentsLbl;
|
||||
private Label acknowledgmentsLbl;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -46,12 +63,13 @@ public class AcknowledgmentsDlg extends CaveSWTDialog{
|
|||
* Parent shell.
|
||||
*/
|
||||
public AcknowledgmentsDlg(Shell parent) {
|
||||
super(parent);
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||
setText("Acknowledgments");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
|
||||
* .eclipse.swt.widgets.Shell)
|
||||
|
@ -59,14 +77,14 @@ public class AcknowledgmentsDlg extends CaveSWTDialog{
|
|||
@Override
|
||||
protected void initializeComponents(final Shell shell) {
|
||||
setReturnValue(false);
|
||||
|
||||
|
||||
// Initialize layout
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.widthHint = 390;
|
||||
gd.heightHint = 80;
|
||||
acknowledgmentsLbl=new Label(shell,SWT.None);
|
||||
acknowledgmentsLbl = new Label(shell, SWT.None);
|
||||
acknowledgmentsLbl.setLayoutData(gd);
|
||||
|
||||
|
||||
// Add a close button
|
||||
Composite centeredComp = new Composite(shell, SWT.NONE);
|
||||
GridLayout gl = new GridLayout(1, false);
|
||||
|
@ -88,20 +106,21 @@ public class AcknowledgmentsDlg extends CaveSWTDialog{
|
|||
|
||||
populateDlg();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void populateDlg() {
|
||||
String acknowledgementsText = " Special thanks to Lingyan Xin, Tom Filiaggi, Qinglu Lin,\n" +
|
||||
" Mike Churma, Arthur Taylor, Xuning Tan, Bei Wang and\n" +
|
||||
" others in MDL for their many valuable help for their\n"+
|
||||
" many valuable help and suggestions!";
|
||||
String acknowledgementsText = " Special thanks to Lingyan Xin, Tom Filiaggi, Qinglu Lin,\n"
|
||||
+ " Mike Churma, Arthur Taylor, Xuning Tan, Bei Wang and\n"
|
||||
+ " others in MDL for their many valuable help for their\n"
|
||||
+ " many valuable help and suggestions!";
|
||||
|
||||
this.acknowledgmentsLbl.setText(acknowledgementsText);
|
||||
this.shell.pack();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#disposed()
|
||||
*/
|
||||
@Override
|
||||
|
@ -109,4 +128,3 @@ public class AcknowledgmentsDlg extends CaveSWTDialog{
|
|||
super.disposed();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -78,14 +78,19 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 10, 2010 #4517 lvenable Initial creation
|
||||
* Dec 12, 2011 #11225 gzhang Large font for FFG value,expiration time
|
||||
* Dec 12, 2011 #11225 gzhang Large font for FFG value,expiration time
|
||||
* Nov 29, 2012 #1353 rferrel Make dialog non-blocking.
|
||||
* Changes for non-blocking AboutDlg.
|
||||
* Changes for non-blocking AcknowledgmentsDlg.
|
||||
* Changes for non-blocking HelpDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
* @version 1.0
|
||||
*/
|
||||
public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGData {
|
||||
public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction,
|
||||
IFFFGData {
|
||||
private final String MODIFIED = "Modified";
|
||||
|
||||
/**
|
||||
|
@ -196,7 +201,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
/**
|
||||
* Array of source composites on the display.
|
||||
*/
|
||||
private ArrayList<SourceComp> sourceCompArray;
|
||||
private java.util.List<SourceComp> sourceCompArray;
|
||||
|
||||
/**
|
||||
* Maximum number of source columns that can be displayed.
|
||||
|
@ -255,21 +260,21 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
private Composite statusComp;
|
||||
|
||||
private SimpleDateFormat statusFormat;
|
||||
|
||||
|
||||
private Thread dataRetrieveThread = null;
|
||||
|
||||
|
||||
private LinkedHashMap<String, SrcDisplayDurationData> guidances;
|
||||
|
||||
|
||||
/**
|
||||
* large Text Font
|
||||
*/
|
||||
private Font largeTextFont;
|
||||
|
||||
|
||||
/**
|
||||
* large Spinner Font
|
||||
*/
|
||||
private Font largeSipnnerFont;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -277,11 +282,12 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
* Parent shell.
|
||||
*/
|
||||
public FFFGDlg(Shell parentShell) {
|
||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.INDEPENDENT_SHELL);
|
||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.INDEPENDENT_SHELL
|
||||
| CAVE.DO_NOT_BLOCK);
|
||||
this.getParent().setCursor(
|
||||
this.getParent().getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
|
||||
setText("Forced Flash Flood Guidance");
|
||||
|
||||
|
||||
sourceCompArray = new ArrayList<SourceComp>();
|
||||
labelFont = new Font(getDisplay(), "Sans", 9, SWT.BOLD);
|
||||
listFont = new Font(getDisplay(), "Monospace", 9, SWT.NORMAL);
|
||||
|
@ -301,12 +307,12 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
labelFont.dispose();
|
||||
listFont.dispose();
|
||||
statusFont.dispose();
|
||||
|
||||
if(largeSipnnerFont != null)
|
||||
largeSipnnerFont.dispose();
|
||||
|
||||
if(largeTextFont != null)
|
||||
largeTextFont.dispose();
|
||||
|
||||
if (largeSipnnerFont != null)
|
||||
largeSipnnerFont.dispose();
|
||||
|
||||
if (largeTextFont != null)
|
||||
largeTextFont.dispose();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -332,7 +338,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
dlgData.setCallback(this);
|
||||
dataRetrieveThread = new Thread(dlgData);
|
||||
dataRetrieveThread.start();
|
||||
|
||||
|
||||
createMenus();
|
||||
createCurrentFileLabel();
|
||||
createMainFFFGComposite();
|
||||
|
@ -545,7 +551,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
ffgValueTF.setText("1.0");
|
||||
largeTextFont = getLargeFont(ffgValueTF);
|
||||
ffgValueTF.setFont(largeTextFont);
|
||||
|
||||
|
||||
Label expireLbl = new Label(ffgExpireComp, SWT.NONE);
|
||||
expireLbl.setText("Enter expiration time (hour): ");
|
||||
|
||||
|
@ -557,7 +563,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
expireTimeSpnr.setSelection(12);
|
||||
largeSipnnerFont = getLargeFont(expireTimeSpnr);
|
||||
expireTimeSpnr.setFont(largeSipnnerFont);
|
||||
|
||||
|
||||
/*
|
||||
* CWA-Wide header
|
||||
*/
|
||||
|
@ -777,14 +783,14 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
getParent().setCursor(
|
||||
getParent().getDisplay()
|
||||
.getSystemCursor(SWT.CURSOR_WAIT));
|
||||
getParent().getDisplay().getSystemCursor(
|
||||
SWT.CURSOR_WAIT));
|
||||
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
|
||||
applyDataAction();
|
||||
updateFileStatusLabel(false);
|
||||
getParent().setCursor(
|
||||
getParent().getDisplay()
|
||||
.getSystemCursor(SWT.CURSOR_ARROW));
|
||||
getParent().getDisplay().getSystemCursor(
|
||||
SWT.CURSOR_ARROW));
|
||||
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_ARROW));
|
||||
|
||||
saveFileAs();
|
||||
|
@ -1088,14 +1094,14 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
FFFGDataMgr fdm = FFFGDataMgr.getInstance();
|
||||
ArrayList<SourceCompData> srcCompData = getSourceCompData();
|
||||
ArrayList<ArrayList<FFFGBasinIdXML>> basinList = new ArrayList<ArrayList<FFFGBasinIdXML>>();
|
||||
for (SourceCompData scd: srcCompData) {
|
||||
for (SourceCompData scd : srcCompData) {
|
||||
ArrayList<FFFGBasinIdXML> list = new ArrayList<FFFGBasinIdXML>();
|
||||
ArrayList<ValueNameIdData> dataList = scd.getCountyBasinData();
|
||||
for (ValueNameIdData vni: dataList) {
|
||||
for (ValueNameIdData vni : dataList) {
|
||||
// Get the basins for each county
|
||||
ArrayList<Long> pfafs = templates.getAllAggregatePfafs(
|
||||
vni.getId(), "COUNTY");
|
||||
for (long pfaf: pfafs) {
|
||||
for (long pfaf : pfafs) {
|
||||
list.add(new FFFGBasinIdXML(pfaf, vni.getValue()));
|
||||
}
|
||||
}
|
||||
|
@ -1121,7 +1127,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
if (expHoursInMillis == 0) {
|
||||
return expHoursInMillis;
|
||||
}
|
||||
|
||||
|
||||
long expTimeInMillis = SimulatedTime.getSystemTime().getTime()
|
||||
.getTime()
|
||||
+ expHoursInMillis;
|
||||
|
@ -1139,7 +1145,6 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
|
||||
for (SourceComp sc : sourceCompArray) {
|
||||
if (sc.hasData() == true) {
|
||||
// sc.getSourceData().printData(); // TODO - remove print statement
|
||||
srcCompData.add(sc.getSourceData());
|
||||
}
|
||||
}
|
||||
|
@ -1473,8 +1478,8 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
FFMPBasinMetaData basinMetaData;
|
||||
|
||||
for (FFMPCounty county : countyArray) {
|
||||
pfafArray = templates.getAllAggregatePfafs(
|
||||
county.getGid(), "COUNTY");
|
||||
pfafArray = templates.getAllAggregatePfafs(county.getGid(),
|
||||
"COUNTY");
|
||||
|
||||
for (Long pfaf : pfafArray) {
|
||||
basinMetaData = templates.getBasin(pfaf);
|
||||
|
@ -1552,7 +1557,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
|
||||
updateBasinCountLabel();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the basin sort by type that determines how the basin is sorted.
|
||||
*
|
||||
|
@ -1704,16 +1709,19 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
* Help menu popup.
|
||||
*/
|
||||
private void callHelpDlg() {
|
||||
helpDlg = new HelpDlg(shell);
|
||||
if (helpDlg == null) {
|
||||
helpDlg = new HelpDlg(shell);
|
||||
}
|
||||
helpDlg.open();
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* About menu popup
|
||||
*/
|
||||
private void callAboutDlg() {
|
||||
aboutDlg = new AboutDlg(shell);
|
||||
if (aboutDlg == null) {
|
||||
aboutDlg = new AboutDlg(shell);
|
||||
}
|
||||
aboutDlg.open();
|
||||
}
|
||||
|
||||
|
@ -1721,7 +1729,9 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
* Acknowledgments menu popup
|
||||
*/
|
||||
private void callAcknowledgmentsDlg() {
|
||||
acknowledgmentsDlg = new AcknowledgmentsDlg(shell);
|
||||
if (acknowledgmentsDlg == null) {
|
||||
acknowledgmentsDlg = new AcknowledgmentsDlg(shell);
|
||||
}
|
||||
acknowledgmentsDlg.open();
|
||||
}
|
||||
|
||||
|
@ -1738,7 +1748,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
/*
|
||||
* Start the array at one since we never delete the first source
|
||||
* component. Add the correct number of sources.
|
||||
*/
|
||||
*/
|
||||
for (int i = 1; i < scdArray.size(); i++) {
|
||||
addNewSource(scdArray.get(i));
|
||||
}
|
||||
|
@ -1772,22 +1782,23 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
displayMessageBox("No Data", sb.toString(), SWT.ICON_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ArrayList<ArrayList<FFFGBasinIdXML>> basinList = new ArrayList<ArrayList<FFFGBasinIdXML>>();
|
||||
for (SourceCompData scd: srcCompData) {
|
||||
for (SourceCompData scd : srcCompData) {
|
||||
ArrayList<FFFGBasinIdXML> list = new ArrayList<FFFGBasinIdXML>();
|
||||
ArrayList<ValueNameIdData> dataList = scd.getCountyBasinData();
|
||||
for (ValueNameIdData vni: dataList) {
|
||||
for (ValueNameIdData vni : dataList) {
|
||||
// Get the basins for each county
|
||||
ArrayList<Long> pfafs = templates.getAllAggregatePfafs(
|
||||
vni.getId(), "COUNTY");
|
||||
for (long pfaf: pfafs) {
|
||||
for (long pfaf : pfafs) {
|
||||
list.add(new FFFGBasinIdXML(pfaf, vni.getValue()));
|
||||
}
|
||||
}
|
||||
basinList.add(list);
|
||||
}
|
||||
fdm.saveUpdateUserXML(calculateExpTimeInMillis(), srcCompData, basinList);
|
||||
fdm.saveUpdateUserXML(calculateExpTimeInMillis(), srcCompData,
|
||||
basinList);
|
||||
|
||||
// Update the File name label
|
||||
fileNameLbl.setText(fdm.getUserFileName());
|
||||
|
@ -1824,14 +1835,14 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
}
|
||||
|
||||
ArrayList<ArrayList<FFFGBasinIdXML>> basinList = new ArrayList<ArrayList<FFFGBasinIdXML>>();
|
||||
for (SourceCompData scd: srcCompData) {
|
||||
for (SourceCompData scd : srcCompData) {
|
||||
ArrayList<FFFGBasinIdXML> list = new ArrayList<FFFGBasinIdXML>();
|
||||
ArrayList<ValueNameIdData> dataList = scd.getCountyBasinData();
|
||||
for (ValueNameIdData vni: dataList) {
|
||||
for (ValueNameIdData vni : dataList) {
|
||||
// Get the basins for each county
|
||||
ArrayList<Long> pfafs = templates.getAllAggregatePfafs(
|
||||
vni.getId(), "COUNTY");
|
||||
for (long pfaf: pfafs) {
|
||||
for (long pfaf : pfafs) {
|
||||
list.add(new FFFGBasinIdXML(pfaf, vni.getValue()));
|
||||
}
|
||||
}
|
||||
|
@ -2101,8 +2112,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
}
|
||||
|
||||
/**
|
||||
* populate the dialog with the data retrieved
|
||||
* via FFFGData.
|
||||
* populate the dialog with the data retrieved via FFFGData.
|
||||
*/
|
||||
private void populateDialog() {
|
||||
populateCountyLists();
|
||||
|
@ -2113,9 +2123,10 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
sc.populateSourceComp();
|
||||
|
||||
statusLbl.setText("");
|
||||
this.getParent().setCursor(
|
||||
this.getParent().getDisplay()
|
||||
.getSystemCursor(SWT.CURSOR_ARROW));
|
||||
this.getParent()
|
||||
.setCursor(
|
||||
this.getParent().getDisplay()
|
||||
.getSystemCursor(SWT.CURSOR_ARROW));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2142,7 +2153,9 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.ffmp.fffg.IFFFGData#setCounties()
|
||||
*/
|
||||
@Override
|
||||
|
@ -2150,7 +2163,9 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
this.counties = counties;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.monitor.ffmp.fffg.IFFFGData#setTemplates()
|
||||
*/
|
||||
@Override
|
||||
|
@ -2158,20 +2173,28 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
this.templates = templates;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.viz.monitor.ffmp.fffg.IFFFGData#setGuidances(java.util.LinkedHashMap)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.monitor.ffmp.fffg.IFFFGData#setGuidances(java.util
|
||||
* .LinkedHashMap)
|
||||
*/
|
||||
@Override
|
||||
public void setGuidances(
|
||||
LinkedHashMap<String, SrcDisplayDurationData> guidances) {
|
||||
this.guidances = guidances;
|
||||
this.guidances = guidances;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.viz.monitor.ffmp.fffg.IFFFGData#setDataLoadComplete(boolean)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.monitor.ffmp.fffg.IFFFGData#setDataLoadComplete(boolean
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
public void dataLoadComplete() {
|
||||
public void dataLoadComplete() {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -2179,30 +2202,30 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction, IFFFGDa
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* FFFG GUI large font for:
|
||||
* Text ffgValueTF and Spinner expireTimeSpnr.
|
||||
* FFFG GUI large font for: Text ffgValueTF and Spinner expireTimeSpnr.
|
||||
*
|
||||
* @param ctrl: Control to change Font
|
||||
* @return: large Font
|
||||
* @param ctrl
|
||||
* : Control to change Font
|
||||
* @return: large Font
|
||||
*/
|
||||
private Font getLargeFont(org.eclipse.swt.widgets.Control ctrl){
|
||||
|
||||
if(ctrl == null)
|
||||
return new Font(getDisplay(), new org.eclipse.swt.graphics.FontData());
|
||||
|
||||
Font font = ctrl.getFont();
|
||||
org.eclipse.swt.graphics.FontData[] fontData = font.getFontData();
|
||||
|
||||
for(int i=0; i<fontData.length; i++){
|
||||
fontData[i].setStyle(SWT.BOLD);
|
||||
fontData[i].setHeight(16);
|
||||
}
|
||||
|
||||
return new Font(getDisplay(), fontData);
|
||||
|
||||
}
|
||||
|
||||
private Font getLargeFont(org.eclipse.swt.widgets.Control ctrl) {
|
||||
|
||||
if (ctrl == null)
|
||||
return new Font(getDisplay(),
|
||||
new org.eclipse.swt.graphics.FontData());
|
||||
|
||||
Font font = ctrl.getFont();
|
||||
org.eclipse.swt.graphics.FontData[] fontData = font.getFontData();
|
||||
|
||||
for (int i = 0; i < fontData.length; i++) {
|
||||
fontData[i].setStyle(SWT.BOLD);
|
||||
fontData[i].setHeight(16);
|
||||
}
|
||||
|
||||
return new Font(getDisplay(), fontData);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -32,7 +32,24 @@ import org.eclipse.swt.widgets.Shell;
|
|||
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
|
||||
public class HelpDlg extends CaveSWTDialog{
|
||||
/**
|
||||
* Dialog to dispaly FFFG help.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Nov 29, 2012 1353 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rferrel
|
||||
* @version 1.0
|
||||
*/
|
||||
public class HelpDlg extends CaveSWTDialog {
|
||||
/**
|
||||
* Create the label object.
|
||||
*/
|
||||
|
@ -46,12 +63,13 @@ public class HelpDlg extends CaveSWTDialog{
|
|||
*/
|
||||
|
||||
public HelpDlg(Shell parent) {
|
||||
super(parent);
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||
setText("Help for ForcedFFG");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
|
||||
* .eclipse.swt.widgets.Shell)
|
||||
|
@ -59,12 +77,12 @@ public class HelpDlg extends CaveSWTDialog{
|
|||
@Override
|
||||
protected void initializeComponents(final Shell shell) {
|
||||
setReturnValue(false);
|
||||
|
||||
|
||||
// Initialize layout
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.widthHint = 400;
|
||||
gd.heightHint = 270;
|
||||
helpLbl=new Label(shell,SWT.None);
|
||||
helpLbl = new Label(shell, SWT.None);
|
||||
helpLbl.setLayoutData(gd);
|
||||
|
||||
// Add a close button
|
||||
|
@ -85,32 +103,33 @@ public class HelpDlg extends CaveSWTDialog{
|
|||
});
|
||||
|
||||
populateDlg();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void populateDlg() {
|
||||
String helpText = " - To add FFG to counties: Left click on the county name \n"+
|
||||
" in the leftmost column and click on the button \n"+
|
||||
" 'Add/Update selected County(ies)' \n"+
|
||||
" - To add FFG to basins: Left click on the basin name \n"+
|
||||
" in the leftmost column and click on the button \n"+
|
||||
" 'Add/Update selected Basin(s)' \n"+
|
||||
" - To remove FFG from counties: Left click on the county name \n"+
|
||||
" in the rightmost column and click on the button \n"+
|
||||
" 'Remove County(ies)' \n"+
|
||||
" - To remove FFG from basins: Left click on the basin name \n"+
|
||||
" in the rightmost column and click on the button \n"+
|
||||
" 'Remove Basin(s)' \n"+
|
||||
" - Basin value override county value.\n"+
|
||||
" - County value override CWA value.\n"+
|
||||
" - Visit http://www.nws.noaa.gov/mdl/ffmp/ \n"+
|
||||
" for more details.";
|
||||
String helpText = " - To add FFG to counties: Left click on the county name \n"
|
||||
+ " in the leftmost column and click on the button \n"
|
||||
+ " 'Add/Update selected County(ies)' \n"
|
||||
+ " - To add FFG to basins: Left click on the basin name \n"
|
||||
+ " in the leftmost column and click on the button \n"
|
||||
+ " 'Add/Update selected Basin(s)' \n"
|
||||
+ " - To remove FFG from counties: Left click on the county name \n"
|
||||
+ " in the rightmost column and click on the button \n"
|
||||
+ " 'Remove County(ies)' \n"
|
||||
+ " - To remove FFG from basins: Left click on the basin name \n"
|
||||
+ " in the rightmost column and click on the button \n"
|
||||
+ " 'Remove Basin(s)' \n"
|
||||
+ " - Basin value override county value.\n"
|
||||
+ " - County value override CWA value.\n"
|
||||
+ " - Visit http://www.nws.noaa.gov/mdl/ffmp/ \n"
|
||||
+ " for more details.";
|
||||
|
||||
this.helpLbl.setText(helpText);
|
||||
this.shell.pack();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#disposed()
|
||||
*/
|
||||
@Override
|
||||
|
@ -118,4 +137,3 @@ public class HelpDlg extends CaveSWTDialog{
|
|||
super.disposed();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.eclipse.core.commands.ExecutionException;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.monitor.ffmp.fffg.FFFGDlg;
|
||||
|
||||
/**
|
||||
|
@ -38,6 +37,7 @@ import com.raytheon.uf.viz.monitor.ffmp.fffg.FFFGDlg;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 1/27/09 dhladky Initial Creation.
|
||||
* 1/29/2012 1353 rferrel Changes for non-blocking FFFGDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -50,21 +50,14 @@ public class FFFGAction extends AbstractHandler {
|
|||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
|
||||
if (fffgDlg == null) {
|
||||
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
Shell fshell = PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow().getShell();
|
||||
fffgDlg = new FFFGDlg(fshell);
|
||||
fffgDlg.open();
|
||||
fffgDlg = null;
|
||||
}
|
||||
});
|
||||
// Independent dialog is disposed on close and cannot be reopened.
|
||||
if (fffgDlg == null || fffgDlg.getShell() == null
|
||||
|| fffgDlg.isDisposed()) {
|
||||
Shell fshell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
fffgDlg = new FFFGDlg(fshell);
|
||||
}
|
||||
fffgDlg.open();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue