Merge "Issue #2961 Code clean up. Issue was fixed under #2703 Added listener to redo time matching when ISC mode changes" into development
Former-commit-id:7cf63b357c
[formerly 6b9f91c8c0dfede3bf94f27f8d06c5a99c0b575b] Former-commit-id:ce783f85d0
This commit is contained in:
commit
91c191045f
2 changed files with 58 additions and 29 deletions
|
@ -64,7 +64,7 @@ import com.raytheon.viz.gfe.rsc.GFEResource;
|
|||
* Nov 14, 2012 mschenke Initial creation
|
||||
* Feb 26, 2013 1708 randerso Fixed double notification for time change
|
||||
* Jan 23, 2014 2703 bsteffen Add JAXB Annotations, fix iscMode.
|
||||
*
|
||||
* Apr 02, 2014 2961 randerso Code cleanup (Ben already fixed issue under #2703)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -151,10 +151,6 @@ public class GFETimeMatcher extends AbstractTimeMatcher {
|
|||
parms.add(iscParm);
|
||||
}
|
||||
tmbResources.add(rsc);
|
||||
DataManager dataManager = parm.getDataManager();
|
||||
if (dataManager.getParmManager().iscMode()) {
|
||||
parms.add(dataManager.getIscDataAccess().getISCParm(parm));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,8 +160,8 @@ public class GFETimeMatcher extends AbstractTimeMatcher {
|
|||
dateSet.add(new DataTime(stepTime));
|
||||
}
|
||||
|
||||
if (currTime != null && selectedDate == null
|
||||
&& dateSet.contains(currTime) == false) {
|
||||
if ((currTime != null) && (selectedDate == null)
|
||||
&& (dateSet.contains(currTime) == false)) {
|
||||
selectedDate = currTime.getRefTime();
|
||||
}
|
||||
|
||||
|
@ -285,7 +281,7 @@ public class GFETimeMatcher extends AbstractTimeMatcher {
|
|||
* @param parms
|
||||
* @return
|
||||
*/
|
||||
public static List<Date> calcTimeSteps(List<Parm> parms) {
|
||||
private static List<Date> calcTimeSteps(List<Parm> parms) {
|
||||
SortedSet<Date> dateSet = new TreeSet<Date>();
|
||||
for (Parm pi : parms) {
|
||||
IGridData[] inv = pi.getGridInventory();
|
||||
|
@ -294,9 +290,9 @@ public class GFETimeMatcher extends AbstractTimeMatcher {
|
|||
|
||||
if (!dateSet.contains(grid.getGridTime().getEnd())) {
|
||||
for (Parm pk : parms) {
|
||||
if (pi != pk
|
||||
&& pk.overlappingGrid(grid.getGridTime()
|
||||
.getEnd()) != null) {
|
||||
if ((pi != pk)
|
||||
&& (pk.overlappingGrid(grid.getGridTime()
|
||||
.getEnd()) != null)) {
|
||||
dateSet.add(grid.getGridTime().getEnd());
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,8 @@ import org.opengis.geometry.Envelope;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
|
@ -52,6 +54,9 @@ import com.raytheon.viz.gfe.core.ISampleSetManager;
|
|||
import com.raytheon.viz.gfe.core.msgs.IDisplayedParmListChangedListener;
|
||||
import com.raytheon.viz.gfe.core.msgs.ISampleSetChangedListener;
|
||||
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.ShowISCGridsMsg;
|
||||
import com.raytheon.viz.gfe.core.parm.Parm;
|
||||
import com.raytheon.viz.gfe.rsc.GFEReferenceSetResource;
|
||||
import com.raytheon.viz.gfe.rsc.GFEResource;
|
||||
|
@ -72,7 +77,9 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* 10/06/2008 1433 chammack Removed log listener
|
||||
* 12/02/2008 1450 randerso Moved getEditors method into UiUtil for general use
|
||||
* 04/09/2009 1288 rjpeter Add sample set listener,ensure remove called for listeners
|
||||
* 08/20/2009 2310 njensen Separated most logic out into AbstractSpatialDisplayManager
|
||||
* 08/20/2009 2310 njensen Separated most logic out into AbstractSpatialDisplayManager
|
||||
* 04/02/2014 2961 randerso Added a listener to redo time matching when ISC mode changes
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -80,14 +87,8 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
*/
|
||||
|
||||
public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
|
||||
implements IDisplayedParmListChangedListener, IFrameChangedListener {
|
||||
|
||||
private final ISampleSetChangedListener sampleSetListener = new ISampleSetChangedListener() {
|
||||
@Override
|
||||
public void sampleSetChanged(ISampleSetManager sampleSetMgr) {
|
||||
GFESpatialDisplayManager.this.refresh();
|
||||
}
|
||||
};
|
||||
implements IDisplayedParmListChangedListener, IFrameChangedListener,
|
||||
ISampleSetChangedListener, IMessageClient {
|
||||
|
||||
private boolean isRegistered;
|
||||
|
||||
|
@ -120,6 +121,9 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Message.registerInterest(this, ShowISCGridsMsg.class);
|
||||
|
||||
setShowDescription(wxd_val);
|
||||
}
|
||||
|
||||
|
@ -148,7 +152,7 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
|
|||
this.dataManager.getParmManager()
|
||||
.addDisplayedParmListChangedListener(this);
|
||||
this.dataManager.getSampleSetManager()
|
||||
.addSampleSetChangedListener(sampleSetListener);
|
||||
.addSampleSetChangedListener(this);
|
||||
isRegistered = true;
|
||||
}
|
||||
|
||||
|
@ -168,8 +172,8 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
|
|||
GridLocation gloc = parmManager.compositeGridLocation();
|
||||
GridGeometry2D gridGeometry = MapUtil.getGridGeometry(gloc);
|
||||
Envelope envelope = gridGeometry.getEnvelope();
|
||||
double colorBarHeight = GFEColorbarResource.HEIGHT
|
||||
* envelope.getSpan(1) / pane.getBounds().height;
|
||||
double colorBarHeight = (GFEColorbarResource.HEIGHT * envelope
|
||||
.getSpan(1)) / pane.getBounds().height;
|
||||
|
||||
PythonPreferenceStore prefs = Activator.getDefault()
|
||||
.getPreferenceStore();
|
||||
|
@ -191,10 +195,10 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
|
|||
expandBottom = prefs.getDouble("OfficeDomain_expandBottom");
|
||||
}
|
||||
|
||||
double dxLeft = (envelope.getSpan(0) * expandLeft / 100.0);
|
||||
double dxRight = (envelope.getSpan(0) * expandRight / 100.0);
|
||||
double dyTop = (envelope.getSpan(1) * expandTop / 100.0);
|
||||
double dyBottom = (envelope.getSpan(1) * expandBottom / 100.0);
|
||||
double dxLeft = ((envelope.getSpan(0) * expandLeft) / 100.0);
|
||||
double dxRight = ((envelope.getSpan(0) * expandRight) / 100.0);
|
||||
double dyTop = ((envelope.getSpan(1) * expandTop) / 100.0);
|
||||
double dyBottom = ((envelope.getSpan(1) * expandBottom) / 100.0);
|
||||
|
||||
GeneralEnvelope newEnvelope = new GeneralEnvelope(
|
||||
envelope.getCoordinateReferenceSystem());
|
||||
|
@ -318,15 +322,17 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
|
|||
*
|
||||
* @throws VizException
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void dispose() throws VizException {
|
||||
synchronized (this) {
|
||||
if (isRegistered) {
|
||||
this.dataManager.getSampleSetManager()
|
||||
.removeSampleSetChangedListener(sampleSetListener);
|
||||
.removeSampleSetChangedListener(this);
|
||||
this.dataManager.getParmManager()
|
||||
.removeDisplayedParmListChangedListener(this);
|
||||
isRegistered = false;
|
||||
}
|
||||
Message.unregisterInterest(this, ShowISCGridsMsg.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -363,6 +369,33 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sampleSetChanged(ISampleSetManager sampleSetMgr) {
|
||||
refresh();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.gfe.core.msgs.Message.IMessageClient#receiveMessage(
|
||||
* com.raytheon.viz.gfe.core.msgs.Message)
|
||||
*/
|
||||
@Override
|
||||
public void receiveMessage(Message message) {
|
||||
if (message instanceof ShowISCGridsMsg) {
|
||||
for (IDescriptor descriptor : getDescriptors()) {
|
||||
try {
|
||||
// ISC mode affects GFE time matching
|
||||
descriptor.redoTimeMatching();
|
||||
} catch (VizException e) {
|
||||
UFStatus.getHandler().handle(Priority.PROBLEM,
|
||||
e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -375,7 +408,7 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager
|
|||
@Override
|
||||
public void frameChanged(IDescriptor descriptor, DataTime oldTime,
|
||||
DataTime newTime) {
|
||||
if (newTime != null && oldTime != null && seTime != null
|
||||
if ((newTime != null) && (oldTime != null) && (seTime != null)
|
||||
&& oldTime.getRefTime().equals(seTime)) {
|
||||
// time was set to seTime, frame changed, set seTime to null
|
||||
setSpatialEditorTime(null);
|
||||
|
|
Loading…
Add table
Reference in a new issue