public class AquaSpinningProgressBarUI extends SpinningProgressBarUI
The line segments are painted in the component's foreground color, with varying levels of opacity. (When this UI is installed the component's foreground color is set to Color.black.)
Also the line segments will complete a full revolution in 500 milliseconds. You can change this rate with the client property "period". This is the length (in milliseconds) this UI takes to complete a full cycle.
Modifier and Type | Class and Description |
---|---|
static class |
AquaSpinningProgressBarUI.Icon |
SpinningProgressBarUI.RepaintListener
Modifier and Type | Field and Description |
---|---|
static java.lang.Long |
DEFAULT_PERIOD
The default duration (in ms) it takes to complete a cycle.
|
static AquaSpinningProgressBarUI.Icon |
ICON
An Icon that resembles the spinning progress indicator in Aqua.
|
isMac
Constructor and Description |
---|
AquaSpinningProgressBarUI() |
Modifier and Type | Method and Description |
---|---|
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c) |
void |
installUI(javax.swing.JComponent c)
Sets up the timer and
ChangeListener to make sure this
idler repaints appropriately. |
static void |
paint(java.awt.Graphics2D g,
float fraction,
java.awt.Color foreground,
int centerX,
int centerY,
int r1,
int r2,
float strokeWidth)
Paints the 12 angular lines in a circle often used to indicate
progress in the Aqua interface.
|
protected void |
paintForeground(java.awt.Graphics2D g,
javax.swing.JComponent jc,
java.awt.Dimension size)
Paints the foreground
|
create, getMaximumSize, getMinimumSize, getRepaintDelay, paint, paintBackground, uninstallUI
public static AquaSpinningProgressBarUI.Icon ICON
public static final java.lang.Long DEFAULT_PERIOD
public static void paint(java.awt.Graphics2D g, float fraction, java.awt.Color foreground, int centerX, int centerY, int r1, int r2, float strokeWidth)
It is strongly recommended that you set the KEY_STROKE_CONTROL rendering hint to VALUE_STROKE_PURE to really achieve the desired look.
g
- the graphics to paint tofraction
- a fractional value between [0,1] indicating how far
the angle has progress. As this value increases the highlighted line
segment moves clockwise. The default behavior is for this value to iterate
from [0,1] in approximately 1 second.foreground
- the color of the darkest line segment. All other line
segments are calculated as translucent shades of this color.centerX
- the x-value of the center of this circle.centerY
- the y-value of the center of this circle.r1
- the radius of one end point of a line segment in this circle. The default value is 5.r2
- the radius of the other end point of a line segment in this circle. The default value is 8.strokeWidth
- the width of the stroke. The default value is 1.9f.protected void paintForeground(java.awt.Graphics2D g, javax.swing.JComponent jc, java.awt.Dimension size)
SpinningProgressBarUI
paintForeground
in class SpinningProgressBarUI
g
- the graphics to paint to.jc
- the component to paint.size
- the dimensions to paint to.
Assume these are the dimensions of the component you
are painting (the Graphics2D has been transformed to
work within these dimensions).public void installUI(javax.swing.JComponent c)
SpinningProgressBarUI
ChangeListener
to make sure this
idler repaints appropriately.installUI
in class SpinningProgressBarUI
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
getPreferredSize
in class SpinningProgressBarUI