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 redisplaying after the ColorScaleManager is closed. Change-Id: I0156612302853141392c263eab8b54a16c3be7a3 Former-commit-id:3c350e52d2
[formerly5573a077bf
] [formerly3c350e52d2
[formerly5573a077bf
] [formerly31d32a2e82
[formerly 6fe0cf5e013896af2e3380a9f93168e8fa66068b]]] Former-commit-id:31d32a2e82
Former-commit-id:a06dee5dd3
[formerlyd6ede1b6a6
] Former-commit-id:b4fab70dc1
This commit is contained in:
parent
589a94588d
commit
59d8ddc6c4
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.
|
* 6/27/06 lvenable Initial Creation.
|
||||||
* 04/07/2010 4671 mpduff Have the map update upon closure of the dialog.
|
* 04/07/2010 4671 mpduff Have the map update upon closure of the dialog.
|
||||||
* 07/02/2013 2088 rferrel Changes for non-blocking ColorScaleMgrDlg.
|
* 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>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @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();
|
colorScaleDlg.open();
|
||||||
} else {
|
} else {
|
||||||
colorScaleDlg.bringToTop();
|
colorScaleDlg.bringToTop();
|
||||||
|
|
|
@ -73,7 +73,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* disappearing after save
|
* disappearing after save
|
||||||
* 01 Jul 2013 2088 rferrel Changes for non-blocking dialogs.
|
* 01 Jul 2013 2088 rferrel Changes for non-blocking dialogs.
|
||||||
* 06 Sep 2013 #2342 lvenable Fixed color memory leaks and a null point exception.
|
* 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
|
* @author lvenable
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
@ -96,6 +97,19 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
private ColorChooserDlg colorDlg;
|
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.
|
* User's name.
|
||||||
*/
|
*/
|
||||||
|
@ -915,6 +929,7 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the color label on the display
|
* Update the color label on the display
|
||||||
*
|
*
|
||||||
|
@ -2017,9 +2032,17 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
||||||
updateDurationCombo();
|
updateDurationCombo();
|
||||||
updateColorValueLabelBar();
|
updateColorValueLabelBar();
|
||||||
|
|
||||||
|
if (this.saveCallback != null) {
|
||||||
|
this.saveCallback.execute();
|
||||||
|
}
|
||||||
setReturnValue(true);
|
setReturnValue(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSaveCallback(ISaveCallback iSaveCallback)
|
||||||
|
{
|
||||||
|
this.saveCallback = iSaveCallback;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dataType has changed, update dialog
|
* 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
|
* Jan 16, 2014 #2691 lvenable Fixed null pointer exception that occurs when closing
|
||||||
* the MPE perspective while the ColorScaleMgrDlg is
|
* the MPE perspective while the ColorScaleMgrDlg is
|
||||||
* visible.
|
* visible.
|
||||||
|
* 04 Sep 2014 14448 cgobs Make MPE redisplay after save of color settings in ColorScaleMgr
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mschenke
|
* @author mschenke
|
||||||
|
@ -103,10 +104,54 @@ public class MPEColorScaleMgrAction extends AbstractHandler {
|
||||||
DisplayFieldData dt = MPEDisplayManager.getCurrent()
|
DisplayFieldData dt = MPEDisplayManager.getCurrent()
|
||||||
.getDisplayFieldType();
|
.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();
|
colorScaleDlg.open();
|
||||||
} else {
|
} else {
|
||||||
colorScaleDlg.bringToTop();
|
colorScaleDlg.bringToTop();
|
||||||
|
|
Loading…
Add table
Reference in a new issue