diff options
Diffstat (limited to 'libjava/classpath/javax/swing/ProgressMonitor.java')
-rw-r--r-- | libjava/classpath/javax/swing/ProgressMonitor.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libjava/classpath/javax/swing/ProgressMonitor.java b/libjava/classpath/javax/swing/ProgressMonitor.java index 28d22e8a63e..b4c3d222349 100644 --- a/libjava/classpath/javax/swing/ProgressMonitor.java +++ b/libjava/classpath/javax/swing/ProgressMonitor.java @@ -142,12 +142,12 @@ public class ProgressMonitor */ public void close() { - if ( progressDialog != null ) + if (progressDialog != null) { progressDialog.setVisible(false); } - if ( timer != null ) + if (timer != null) { timer.stop(); timer = null; @@ -173,7 +173,7 @@ public class ProgressMonitor // Initializes and starts a timer with a task // which measures the duration and displays // a progress dialog if neccessary. - if ( timer == null && progressDialog == null ) + if (timer == null && progressDialog == null) { timer = new Timer(25, null); timer.addActionListener(new TimerListener()); @@ -182,7 +182,7 @@ public class ProgressMonitor // Cancels timer and hides progress dialog if the // maximum value is reached. - if ( progressBar != null && this.progress >= progressBar.getMaximum() ) + if (progressBar != null && this.progress >= progressBar.getMaximum()) { // The reason for using progressBar.getMaximum() instead of max is that // we want to prevent that changes to the value have any effect after the @@ -326,7 +326,7 @@ public class ProgressMonitor */ public void setNote(String note) { - if ( noteLabel != null ) + if (noteLabel != null) { noteLabel.setText(note); } @@ -401,18 +401,18 @@ public class ProgressMonitor { long now = System.currentTimeMillis(); - if ( first ) + if (first) { - if (( now - timestamp ) > millisToDecideToPopup ) + if ((now - timestamp) > millisToDecideToPopup) { first = false; - long expected = ( progress - min == 0 ) ? - ( now - timestamp ) * ( max - min ) : - ( now - timestamp ) * ( max - min ) / ( progress - min ); + long expected = (progress - min == 0) ? + (now - timestamp) * (max - min) : + (now - timestamp) * (max - min) / (progress - min); - if ( expected > millisToPopup ) + if (expected > millisToPopup) { createDialog(); } @@ -424,14 +424,14 @@ public class ProgressMonitor return; } } - else if ( progressDialog != null ) + else if (progressDialog != null) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); - if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) + if ((delta * progressBar.getWidth() / (max - min)) > 0) { // At least one pixel would change. progressBar.setValue(progress); |