Skip to content

Commit 069bb79

Browse files
author
Andrey Turbanov
committedNov 2, 2024
8342082: Remove unused BasicProgressBarUI.Animator.interval
Reviewed-by: prr, honkar
1 parent 00ec105 commit 069bb79

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed
 

‎src/java.desktop/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java

+30-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,17 +25,36 @@
2525

2626
package javax.swing.plaf.basic;
2727

28-
import sun.swing.SwingUtilities2;
29-
import java.awt.*;
28+
import java.awt.BasicStroke;
29+
import java.awt.Color;
30+
import java.awt.Component;
31+
import java.awt.Dimension;
32+
import java.awt.FontMetrics;
33+
import java.awt.Graphics;
34+
import java.awt.Graphics2D;
35+
import java.awt.Insets;
36+
import java.awt.Point;
37+
import java.awt.Rectangle;
38+
import java.awt.event.ActionEvent;
39+
import java.awt.event.ActionListener;
40+
import java.awt.event.HierarchyEvent;
41+
import java.awt.event.HierarchyListener;
3042
import java.awt.geom.AffineTransform;
31-
import java.awt.event.*;
32-
import javax.swing.*;
33-
import javax.swing.event.*;
34-
import javax.swing.plaf.*;
43+
import javax.swing.BoundedRangeModel;
44+
import javax.swing.JComponent;
45+
import javax.swing.JProgressBar;
46+
import javax.swing.LookAndFeel;
47+
import javax.swing.SwingUtilities;
48+
import javax.swing.Timer;
49+
import javax.swing.UIManager;
50+
import javax.swing.event.ChangeEvent;
51+
import javax.swing.event.ChangeListener;
52+
import javax.swing.plaf.ComponentUI;
53+
import javax.swing.plaf.ProgressBarUI;
3554
import java.beans.PropertyChangeListener;
3655
import java.beans.PropertyChangeEvent;
37-
import java.io.Serializable;
3856
import sun.swing.DefaultLookup;
57+
import sun.swing.SwingUtilities2;
3958

4059
/**
4160
* A Basic L&F implementation of ProgressBarUI.
@@ -1224,9 +1243,8 @@ private void initAnimationIndex() {
12241243
private class Animator implements ActionListener {
12251244
private Timer timer;
12261245
private long previousDelay; //used to tune the repaint interval
1227-
private int interval; //the fixed repaint interval
12281246
private long lastCall; //the last time actionPerformed was called
1229-
private int MINIMUM_DELAY = 5;
1247+
private static final int MINIMUM_DELAY = 5;
12301248

12311249
/**
12321250
* Creates a timer if one doesn't already exist,
@@ -1267,9 +1285,9 @@ public void actionPerformed(ActionEvent e) {
12671285
if (lastCall > 0) { //adjust nextDelay
12681286
//XXX maybe should cache this after a while
12691287
//actual = time - lastCall
1270-
//difference = actual - interval
1288+
//difference = actual - repaintInterval
12711289
//nextDelay = previousDelay - difference
1272-
// = previousDelay - (time - lastCall - interval)
1290+
// = previousDelay - (time - lastCall - repaintInterval)
12731291
int nextDelay = (int)(previousDelay
12741292
- time + lastCall
12751293
+ getRepaintInterval());

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Nov 2, 2024

@openjdk-notifier[bot]
Please sign in to comment.