From 1edc4e2b6f71003903da043097364d0f86be2775 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 6 Oct 2015 13:49:00 -0700 Subject: [PATCH] Some drive-by tidying while reviewing. --- .../getdown/launcher/StatusPanel.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/threerings/getdown/launcher/StatusPanel.java b/src/main/java/com/threerings/getdown/launcher/StatusPanel.java index edbcc07..56e7557 100644 --- a/src/main/java/com/threerings/getdown/launcher/StatusPanel.java +++ b/src/main/java/com/threerings/getdown/launcher/StatusPanel.java @@ -105,24 +105,21 @@ public class StatusPanel extends JComponent // maybe update the progress label if (_progress != percent) { _progress = percent; - if (!_ifc.hideProgressText) { String msg = MessageFormat.format(get("m.complete"), percent); - _newplab = createLabel( msg, _ifc.progressText ); + _newplab = createLabel(msg, _ifc.progressText); } needsRepaint = true; } // maybe update the remaining label if (remaining > 1) { - // skip this estimate if it's been less than a second since - // our last one came in + // skip this estimate if it's been less than a second since our last one came in if (!_rthrottle.throttleOp()) { _remain[_ridx++%_remain.length] = remaining; } - // smooth the remaining time by taking the trailing average of - // the last four values + // smooth the remaining time by taking the trailing average of the last four values remaining = 0; int values = Math.min(_ridx, _remain.length); for (int ii = 0; ii < values; ii++) { @@ -132,12 +129,10 @@ public class StatusPanel extends JComponent if (!_ifc.hideProgressText) { // now compute our display value - int minutes = (int)(remaining / 60); - int seconds = (int)(remaining % 60); - + int minutes = (int)(remaining / 60), seconds = (int)(remaining % 60); String remstr = minutes + ":" + ((seconds < 10) ? "0" : "") + seconds; String msg = MessageFormat.format(get("m.remain"), remstr); - _newrlab = createLabel( msg, _ifc.statusText ); + _newrlab = createLabel(msg, _ifc.statusText); } needsRepaint = true; @@ -243,8 +238,7 @@ public class StatusPanel extends JComponent if (_plabel != null) { int xmarg = (_ifc.progress.width - _plabel.getSize().width)/2; int ymarg = (_ifc.progress.height - _plabel.getSize().height)/2; - _plabel.render(gfx, _ifc.progress.x + xmarg, - _ifc.progress.y + ymarg); + _plabel.render(gfx, _ifc.progress.x + xmarg, _ifc.progress.y + ymarg); } if (_label != null) {