Change-Id: Ib8d12e9be787c9b5b41a776eb22bb4c4a8c2fc7d

Former-commit-id: c12f51881a565e2ec812e83e79b4bc59fbb5af1e
This commit is contained in:
Rici.Yu 2014-01-15 11:48:36 -05:00
parent 2b011e9ead
commit ac72d56ae0

View file

@ -70,6 +70,9 @@ import com.raytheon.viz.gfe.temporaleditor.TemporalEditor;
* Apr 7, 2009 randerso Redesigned
* May 18, 2009 2159 rjpeter Added temporal editor.
* Jan 14, 2013 1442 rferrel Add SimulatedTimeChangeListener.
* Jan 15, 2014 16072 ryu Modify syncSelectTR() to skip the original code when
* called back from setSelectedTime().
*
* </pre>
*
* @author randerso
@ -79,6 +82,8 @@ import com.raytheon.viz.gfe.temporaleditor.TemporalEditor;
public class GridManager implements IGridManager,
ISpatialEditorTimeChangedListener {
private Date selectedTime = null;
private class RedrawRunnable implements Runnable {
@Override
public void run() {
@ -753,6 +758,8 @@ public class GridManager implements IGridManager,
@Override
public void setSelectedTime(Date selectedTime) {
// set attribute to check if we are calling back to syncSelectTR()
this.selectedTime = selectedTime;
dataManager.getSpatialDisplayManager().setSpatialEditorTime(
selectedTime);
redraw();
@ -766,6 +773,9 @@ public class GridManager implements IGridManager,
}
protected void syncSelectTR(Date t) {
// setSelectedTime() will eventually call back to this method, in which case
// skip the original code (within the if block immediately below).
if (t.equals(selectedTime) == false) {
// Use a selection tr of 1 hour duration if no active parm,
// if active parm and no grid, use the parm's time constraint,
// if active parm and grid, use the grid time.
@ -794,6 +804,11 @@ public class GridManager implements IGridManager,
dataManager.getParmOp().setSelectionTimeRange(tr);
}
}
else {
// reset
selectedTime = null;
}
}
/**
* @return the lockSelectionTRtoTimeStep