Class AquaThrobberUI



  • public class AquaThrobberUI
    extends ThrobberUI
    Twelve short line segments that rotate in a clockwise direction. The line segments are painted in the component's foreground color, with varying levels of opacity.

    AquaThrobberUI AquaThrobberUI Magnified 2x AquaThrobberUI Magnified 4x

    On installation: the component's foreground is set to gray, but if that is changed then that color is used to render this animation.

    The default period for this animation is 500, but you can modify this with the period client properties ThrobberUI.PERIOD_KEY or ThrobberUI.PERIOD_MULTIPLIER_KEY.

    • Field Detail

      • DEFAULT_PERIOD

        public static final int DEFAULT_PERIOD
        The number of milliseconds for the default period (500).
        See Also:
        Constant Field Values
    • Constructor Detail

      • AquaThrobberUI

        public AquaThrobberUI()
    • Method Detail

      • paint

        public static void paint(Graphics2D g,
                                 float fraction,
                                 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.

        It is strongly recommended that you use quality rendering hints (include stroke control) to achieve an aesthetic look.

        Parameters:
        g - the graphics to paint to
        fraction - 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.
      • getPreferredSize

        public Dimension getPreferredSize()
      • paintForeground

        public void paintForeground(Graphics2D g,
                                    JComponent jc,
                                    Dimension size,
                                    Float fixedFraction)
        Description copied from class: ThrobberUI
        Paints the foreground. The Graphics2D passed to this object is configured as if you were painting size argument (which is the preferred size). So if the preferred size of this ThrobberUI is 16x16, you always paint as if you're painting to a 16x16 area.
        Specified by:
        paintForeground in class  ThrobberUI
        Parameters:
        g - the graphics to paint to.
        jc - the component to paint, this may be null if used as an Icon.
        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).
        fixedFraction - an optional fixed fraction from [0, 1] representing the state of this animation. If null: then this should be derived from the current time.
      • getDefaultForeground

        public Color getDefaultForeground()
        Description copied from class: ThrobberUI
        Return the default foreground color for this throbber. If this is not null: then during installUI() this will be assigned as the new foreground color.