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