public abstract class ThrobberUI extends ComponentUI
JThrobber.
| Modifier and Type | Field and Description |
|---|---|
static String |
PERIOD_KEY
An optional client property to define the period of this animation (if the animation has a period).
|
static String |
PERIOD_MULTIPLIER_KEY
An optional client property to slow the default period by a fixed interval.
|
protected int |
repaintInterval
|
protected static String |
TIMER_KEY
|
| Modifier | Constructor and Description |
|---|---|
protected |
ThrobberUI(int repaintInterval)
|
| Modifier and Type | Method and Description |
|---|---|
Icon |
createIcon(Float
Create an Icon representation of this ThrobberUI.
|
static ComponentUI |
createUI(JComponent
|
abstract Color |
getDefaultForeground()
Return the default foreground color for this throbber.
|
int |
getPeriod(JComponent
Return the period (in milliseconds) of this throbber.
|
abstract Dimension |
getPreferredSize()
|
Dimension |
getPreferredSize(JComponent
|
void |
installUI(JComponent
|
void |
paint(Graphics
|
protected void |
paint(Graphics
|
protected void |
paintBackground(Graphics2D
Paint the background color, if the argument is opaque.
|
protected abstract void |
paintForeground(Graphics2D
Paints the foreground.
|
void |
uninstallUI(JComponent
|
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, updateprotected static StringTIMER_KEY
public static final StringPERIOD_KEY
public static final StringPERIOD_MULTIPLIER_KEY
protected final int repaintInterval
protected ThrobberUI(int repaintInterval)
repaintInterval - The number of milliseconds between repaints.
public static ComponentUIcreateUI(JComponent c)
public int getPeriod(JComponentjc, int defaultPeriod)
This is a convenience method that takes the argument defaultPeriod and modifies it according to PERIOD_KEY or PERIOD_MULTIPLIER_KEY
jc - the component to inspect. If null then the default period is immediately returned.
defaultPeriod - the value to return if no customizations are defined..
public void paint(Graphicsg, JComponent jc)
protected void paint(Graphicsg0, JComponent jc, Float fixedFraction)
g0 -
jc - the component may be null
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.
protected void paintBackground(Graphics2Dg, JComponent jc)
protected abstract void paintForeground(Graphics2Dg, JComponent jc, Dimension size, Float fixedFraction)
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.
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.
public void installUI(JComponentc)
public DimensiongetPreferredSize(JComponent c)
public abstract ColorgetDefaultForeground()
installUI() this will be assigned as the new foreground color.
public abstract DimensiongetPreferredSize()
public void uninstallUI(JComponentc)
public IconcreateIcon(Float fixedFraction, Dimension size)
fixedFraction - the fraction from [0,1] indicating this icon's animation progress, or null if this icon should update based on
System.currentTimeMillis().
size - the dimensions of this icon, or null if the default size should be used.