Split out a little logic related to recentering and finishing up block resolution so it can be used reasonably by subclasses.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@753 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Mike Thomas
2009-01-15 00:49:23 +00:00
parent 45c9ca451e
commit 79c5d9c925
2 changed files with 21 additions and 7 deletions
@@ -236,7 +236,11 @@ public class VirtualMediaPanel extends MediaPanel
protected void didTick (long tickStamp) protected void didTick (long tickStamp)
{ {
super.didTick(tickStamp); super.didTick(tickStamp);
adjustBoundsCenter();
}
protected void adjustBoundsCenter ()
{
int width = getWidth(), height = getHeight(); int width = getWidth(), height = getHeight();
// adjusts our view location to track any pathable we might be // adjusts our view location to track any pathable we might be
@@ -162,6 +162,7 @@ public class MisoScenePanel extends VirtualMediaPanel
clearScene(); clearScene();
// Don't repaint immediately if we've gotten new penders from our rethink // Don't repaint immediately if we've gotten new penders from our rethink
_delayRepaint = rethink() > 0; _delayRepaint = rethink() > 0;
System.err.println("MST REF SCENE: " + _delayRepaint);
_remgr.invalidateRegion(_vbounds); _remgr.invalidateRegion(_vbounds);
} }
@@ -730,6 +731,7 @@ public class MisoScenePanel extends VirtualMediaPanel
_ulpos.setLocation(_tcoords); _ulpos.setLocation(_tcoords);
if (rethink() > 0) { if (rethink() > 0) {
_delayRepaint = mightDelayPaint; _delayRepaint = mightDelayPaint;
System.err.println("MST VIEW LOC DID CHANGE: " + _delayRepaint);
// If this is a complete repaint, turn off visibility while we're resolving to // If this is a complete repaint, turn off visibility while we're resolving to
// keep child components or media panels from drawing. // keep child components or media panels from drawing.
if (_delayRepaint) { if (_delayRepaint) {
@@ -944,6 +946,15 @@ public class MisoScenePanel extends VirtualMediaPanel
// once all the visible pending blocks have completed their // once all the visible pending blocks have completed their
// resolution, recompute our visible object set and show ourselves // resolution, recompute our visible object set and show ourselves
if (_visiBlocks.remove(block) && _visiBlocks.size() == 0) { if (_visiBlocks.remove(block) && _visiBlocks.size() == 0) {
allBlocksFinished();
}
}
/**
* Called to handle the proceedings once our last resolving block has been finished.
*/
protected void allBlocksFinished ()
{
recomputeVisible(); recomputeVisible();
log.info("Restoring repaint... ", "left", _pendingBlocks, "view", log.info("Restoring repaint... ", "left", _pendingBlocks, "view",
StringUtil.toString(_vbounds)); StringUtil.toString(_vbounds));
@@ -952,7 +963,6 @@ public class MisoScenePanel extends VirtualMediaPanel
setVisible(true); setVisible(true);
_remgr.invalidateRegion(_vbounds); _remgr.invalidateRegion(_vbounds);
} }
}
/** /**
* Issues a warning to the error log that the specified block became visible prior to being * Issues a warning to the error log that the specified block became visible prior to being