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:
@@ -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,16 +946,24 @@ 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) {
|
||||||
recomputeVisible();
|
allBlocksFinished();
|
||||||
log.info("Restoring repaint... ", "left", _pendingBlocks, "view",
|
|
||||||
StringUtil.toString(_vbounds));
|
|
||||||
_delayRepaint = false;
|
|
||||||
// Need to restore visibility as it may have been turned of as a result of the delay
|
|
||||||
setVisible(true);
|
|
||||||
_remgr.invalidateRegion(_vbounds);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called to handle the proceedings once our last resolving block has been finished.
|
||||||
|
*/
|
||||||
|
protected void allBlocksFinished ()
|
||||||
|
{
|
||||||
|
recomputeVisible();
|
||||||
|
log.info("Restoring repaint... ", "left", _pendingBlocks, "view",
|
||||||
|
StringUtil.toString(_vbounds));
|
||||||
|
_delayRepaint = false;
|
||||||
|
// Need to restore visibility as it may have been turned of as a result of the delay
|
||||||
|
setVisible(true);
|
||||||
|
_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
|
||||||
* resolved. Derived classes may wish to augment or inhibit this warning.
|
* resolved. Derived classes may wish to augment or inhibit this warning.
|
||||||
|
|||||||
Reference in New Issue
Block a user