Merge "Issue #2287 Fixed fitToDataColorTable for Single Grids" into omaha_13.5.2

Former-commit-id: 6a42802aba [formerly ef10d1aa13] [formerly 183d3944e4 [formerly 72e14b106419a137075642c77a051fa82ddb91e1]]
Former-commit-id: 183d3944e4
Former-commit-id: e366726d06
This commit is contained in:
Ron Anderson 2013-08-29 14:25:45 -05:00 committed by Gerrit Code Review
commit 8b688aa10f

View file

@ -62,9 +62,11 @@ import com.raytheon.viz.gfe.actions.SetDiscretePickupAction;
import com.raytheon.viz.gfe.actions.SetDiscreteWxPickupAction;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.ISpatialDisplayManager;
import com.raytheon.viz.gfe.core.msgs.GridDataChangedMsg;
import com.raytheon.viz.gfe.core.msgs.IDisplayModeChangedListener;
import com.raytheon.viz.gfe.core.msgs.IDisplayedParmListChangedListener;
import com.raytheon.viz.gfe.core.msgs.IPickupValueChangedListener;
import com.raytheon.viz.gfe.core.msgs.ISpatialEditorTimeChangedListener;
import com.raytheon.viz.gfe.core.msgs.Message;
import com.raytheon.viz.gfe.core.msgs.Message.IMessageClient;
import com.raytheon.viz.gfe.core.msgs.ShowQuickViewDataMsg;
@ -100,6 +102,7 @@ import com.raytheon.viz.ui.input.InputAdapter;
* Changes for non-blocking SetValueDialog.
* 01/23/2013 #1524 randerso Fix error when clicking on discrete color bar when
* no grid exists
* 08/27/2013 #2287 randerso Fixed fitToDataColorTable for Single Grids
*
* </pre>
*
@ -110,7 +113,7 @@ public class GFEColorbarResource extends
AbstractVizResource<GFEResourceData, IMapDescriptor> implements
IContextMenuProvider, IPickupValueChangedListener,
IDisplayModeChangedListener, IMessageClient,
IDisplayedParmListChangedListener {
IDisplayedParmListChangedListener, ISpatialEditorTimeChangedListener {
public static final double HEIGHT = 25.0;
@ -317,6 +320,8 @@ public class GFEColorbarResource extends
dManager.getParmManager().removeDisplayedParmListChangedListener(this);
dManager.getSpatialDisplayManager().removeDisplayModeChangedListener(
this);
dManager.getSpatialDisplayManager()
.removeSpatialEditorTimeChangedListener(this);
IDisplayPaneContainer container = getResourceContainer();
if (container != null) {
@ -324,6 +329,7 @@ public class GFEColorbarResource extends
}
Message.unregisterInterest(this, ShowQuickViewDataMsg.class);
Message.unregisterInterest(this, GridDataChangedMsg.class);
if (colorbarScaleFont != null) {
colorbarScaleFont.dispose();
@ -358,9 +364,12 @@ public class GFEColorbarResource extends
@Override
protected void initInternal(IGraphicsTarget target) throws VizException {
dManager.getSpatialDisplayManager().addDisplayModeChangedListener(this);
dManager.getSpatialDisplayManager()
.addSpatialEditorTimeChangedListener(this);
dManager.getParmManager().addDisplayedParmListChangedListener(this);
Message.registerInterest(this, ShowQuickViewDataMsg.class);
Message.registerInterest(this, GridDataChangedMsg.class);
colorbarScaleFont = GFEFonts.makeGFEIFont(target, "ColorBarScale_font",
1);
@ -680,6 +689,15 @@ public class GFEColorbarResource extends
parm = gridId.getParm();
}
updateColorbar(parm);
} else if (message instanceof GridDataChangedMsg) {
GridDataChangedMsg msg = (GridDataChangedMsg) message;
if (msg.getParmID().equals(currentParm.getParmID())
&& msg.getTimeRange().contains(
currentParm.getDataManager()
.getSpatialDisplayManager()
.getSpatialEditorTime())) {
checkFitToData();
}
}
}
@ -836,4 +854,9 @@ public class GFEColorbarResource extends
updateColorbar(normalParm);
}
}
@Override
public void spatialEditorTimeChanged(Date date) {
checkFitToData();
}
}