VLab Issue #4611
Fixes O&M Redmine DR 14448 - which concerns displaying changes to a color set just after the changes are saved, instead of after the ColorScaleManager is closed. Change-Id: I0156612302853141392c263eab8b54a16c3be7a3 Former-commit-id:a465c9964c
[formerly69450976c8
] [formerly8c6e70ccab
] [formerly25e4ed8d51
[formerly8c6e70ccab
[formerly 44f6bf08a72b5450d6d0db40ff49dd5123cf811c]]] Former-commit-id:25e4ed8d51
Former-commit-id: bd626ff8f5b059de21f2fe336840954273fa7517 [formerly215f1dfaa1
] Former-commit-id:689ccd9fcf
This commit is contained in:
parent
09a6d218ec
commit
13eebb6672
3 changed files with 91 additions and 4 deletions
|
@ -49,7 +49,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* 6/27/06 lvenable Initial Creation.
|
||||
* 04/07/2010 4671 mpduff Have the map update upon closure of the dialog.
|
||||
* 07/02/2013 2088 rferrel Changes for non-blocking ColorScaleMgrDlg.
|
||||
*
|
||||
* 9/4/2014 14448 cgobs Make HydroView redisplay after save of color settings in ColorScaleMgr
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -97,6 +97,25 @@ public class ColorScaleMgrAction extends AbstractHandler {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
colorScaleDlg.setSaveCallback(new ColorScaleMgrDlg.ISaveCallback() {
|
||||
|
||||
public void execute() {
|
||||
|
||||
HydroDisplayManager displayManager = HydroDisplayManager
|
||||
.getInstance();
|
||||
|
||||
boolean dataChanged = true;
|
||||
displayManager.setColorChanged(dataChanged);
|
||||
|
||||
// redraw the main display
|
||||
displayManager.setDataChanged(dataChanged);
|
||||
StationDisplay sd = StationDisplay.getInstance();
|
||||
sd.redraw();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
colorScaleDlg.open();
|
||||
} else {
|
||||
colorScaleDlg.bringToTop();
|
||||
|
|
|
@ -73,7 +73,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* disappearing after save
|
||||
* 01 Jul 2013 2088 rferrel Changes for non-blocking dialogs.
|
||||
* 06 Sep 2013 #2342 lvenable Fixed color memory leaks and a null point exception.
|
||||
* </pre>
|
||||
* 04 Sep 2014 14448 cgobs Make MPE redisplay after save of color settings in ColorScaleMgr
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
* @version 1.0
|
||||
|
@ -96,6 +97,19 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private ColorChooserDlg colorDlg;
|
||||
|
||||
/**
|
||||
* callback to be execute upon saving of a color set
|
||||
* generally used to update the display with the newly-saved color set
|
||||
*/
|
||||
private ISaveCallback saveCallback;
|
||||
|
||||
public interface ISaveCallback {
|
||||
|
||||
public void execute();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User's name.
|
||||
*/
|
||||
|
@ -915,6 +929,7 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Update the color label on the display
|
||||
*
|
||||
|
@ -2016,9 +2031,17 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
|||
|
||||
updateDurationCombo();
|
||||
updateColorValueLabelBar();
|
||||
|
||||
|
||||
if (this.saveCallback != null) {
|
||||
this.saveCallback.execute();
|
||||
}
|
||||
setReturnValue(true);
|
||||
}
|
||||
|
||||
public void setSaveCallback(ISaveCallback iSaveCallback)
|
||||
{
|
||||
this.saveCallback = iSaveCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* dataType has changed, update dialog
|
||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Jan 16, 2014 #2691 lvenable Fixed null pointer exception that occurs when closing
|
||||
* the MPE perspective while the ColorScaleMgrDlg is
|
||||
* visible.
|
||||
* 04 Sep 2014 14448 cgobs Make MPE redisplay after save of color settings in ColorScaleMgr
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
|
@ -103,10 +104,54 @@ public class MPEColorScaleMgrAction extends AbstractHandler {
|
|||
DisplayFieldData dt = MPEDisplayManager.getCurrent()
|
||||
.getDisplayFieldType();
|
||||
|
||||
MPEDisplayManager.getCurrent().displayFieldData(dt);
|
||||
int displayedAccumHrs = mdm.getDisplayedAccumHrs();
|
||||
mdm.displayFieldData(dt,displayedAccumHrs );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//anonymous class declaration for the purposes of a callback execute upon save to database
|
||||
colorScaleDlg.setSaveCallback(new ColorScaleMgrDlg.ISaveCallback() {
|
||||
|
||||
public void execute() {
|
||||
|
||||
MPEDisplayManager mdm = MPEDisplayManager.getCurrent();
|
||||
|
||||
// If the MPE Display Manager is null then return as no
|
||||
// action is needed.
|
||||
if (mdm == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MPEFieldResource displayedFieldResource = mdm
|
||||
.getDisplayedFieldResource();
|
||||
|
||||
if (displayedFieldResource != null) {
|
||||
MPEFieldResourceData resourceData = displayedFieldResource
|
||||
.getResourceData();
|
||||
displayedFieldResource
|
||||
.getCapability(ColorMapCapability.class)
|
||||
.setColorMapParameters(
|
||||
MPEDisplayManager.createColorMap(
|
||||
resourceData.getCvUseString(),
|
||||
resourceData
|
||||
.getDurationInHours(),
|
||||
resourceData.getDataUnits(),
|
||||
resourceData.getDisplayUnits()));
|
||||
DisplayFieldData dt = MPEDisplayManager.getCurrent()
|
||||
.getDisplayFieldType();
|
||||
|
||||
int displayedAccumHrs = mdm.getDisplayedAccumHrs();
|
||||
|
||||
|
||||
mdm.displayFieldData(dt, displayedAccumHrs);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
colorScaleDlg.open();
|
||||
} else {
|
||||
colorScaleDlg.bringToTop();
|
||||
|
|
Loading…
Add table
Reference in a new issue