Class RadianceProgressBarUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ProgressBarUI
-
- javax.swing.plaf.basic.BasicProgressBarUI
-
- org.pushingpixels.radiance.theming.internal.ui.RadianceProgressBarUI
-
public class RadianceProgressBarUI extends javax.swing.plaf.basic.BasicProgressBarUI
UI for progress bars in Radiance look and feel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
RadianceProgressBarUI.RadianceChangeListener
-
Field Summary
Fields Modifier and Type Field Description private float
animationPosition
The current position of the indeterminate animation's cycle.private int
displayedValue
private Timeline
displayTimeline
private Timeline
indeterminateLoopTimeline
private int
margin
Inner margin.private static RadianceFillPainter
progressFillPainter
private java.beans.PropertyChangeListener
radiancePropertyChangeListener
Property change listener.private javax.swing.event.ChangeListener
radianceValueChangeListener
Value change listener on the associated progress bar.
-
Constructor Summary
Constructors Modifier Constructor Description protected
RadianceProgressBarUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent comp)
private void
drawDeterminateBackground(java.awt.Graphics2D g, javax.swing.JProgressBar bar, int width, int height, RadianceColorScheme scheme, RadianceFillPainter fillPainter, int orientation)
private void
drawDeterminateProgress(java.awt.Graphics2D g, javax.swing.JProgressBar bar, int width, int height, boolean isFull, RadianceColorScheme scheme, RadianceFillPainter fillPainter, int orientation, java.awt.ComponentOrientation componentOrientation)
private void
drawStripe1X(java.awt.Graphics2D g, int baseSize, java.awt.Color color)
protected int
getAmountFull(java.awt.Insets b, int width, int height)
protected java.awt.Rectangle
getBox(java.awt.Rectangle r)
private ComponentState
getFillState()
protected java.awt.Dimension
getPreferredInnerHorizontal()
protected java.awt.Dimension
getPreferredInnerVertical()
private ComponentState
getProgressState()
protected java.awt.Color
getSelectionBackground()
protected java.awt.Color
getSelectionForeground()
private java.awt.Rectangle
getStringRectangle(java.lang.String progressString, int x, int y, int width, int height)
Returns the rectangle for the progress bar string.protected void
installDefaults()
protected void
installListeners()
void
paintDeterminate(java.awt.Graphics g, javax.swing.JComponent c)
void
paintIndeterminate(java.awt.Graphics g, javax.swing.JComponent c)
private void
paintRectangularStripedBackground(java.awt.Graphics g, int startX, int startY, int width, int height, RadianceColorScheme colorScheme, int stripeOffset, float borderAlpha, boolean isVertical)
private void
paintString(java.awt.Graphics g, int x, int y, int width, int height, int fillStart, int amountFull)
Paints the progress string.protected void
paintString(java.awt.Graphics g, int x, int y, int width, int height, int amountFull, java.awt.Insets b)
protected void
startAnimationTimer()
protected void
stopAnimationTimer()
protected void
uninstallListeners()
void
update(java.awt.Graphics g, javax.swing.JComponent c)
-
Methods inherited from class javax.swing.plaf.basic.BasicProgressBarUI
getAnimationIndex, getBaseline, getBaselineResizeBehavior, getBoxLength, getCellLength, getCellSpacing, getFrameCount, getMaximumSize, getMinimumSize, getPreferredSize, getStringPlacement, incrementAnimationIndex, installUI, paint, setAnimationIndex, setCellLength, setCellSpacing, uninstallDefaults, uninstallUI
-
-
-
-
Field Detail
-
progressFillPainter
private static final RadianceFillPainter progressFillPainter
-
animationPosition
private float animationPosition
The current position of the indeterminate animation's cycle. 0, the initial value, means paint the first frame. When the progress bar is indeterminate and showing, theindeterminateLoopTimeline
is updating this value.
-
radianceValueChangeListener
private javax.swing.event.ChangeListener radianceValueChangeListener
Value change listener on the associated progress bar.
-
radiancePropertyChangeListener
private java.beans.PropertyChangeListener radiancePropertyChangeListener
Property change listener. Tracks changes to thefont
property.
-
margin
private int margin
Inner margin.
-
displayedValue
private int displayedValue
-
displayTimeline
private Timeline displayTimeline
-
indeterminateLoopTimeline
private Timeline indeterminateLoopTimeline
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent comp)
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
drawStripe1X
private void drawStripe1X(java.awt.Graphics2D g, int baseSize, java.awt.Color color)
-
drawDeterminateBackground
private void drawDeterminateBackground(java.awt.Graphics2D g, javax.swing.JProgressBar bar, int width, int height, RadianceColorScheme scheme, RadianceFillPainter fillPainter, int orientation)
-
drawDeterminateProgress
private void drawDeterminateProgress(java.awt.Graphics2D g, javax.swing.JProgressBar bar, int width, int height, boolean isFull, RadianceColorScheme scheme, RadianceFillPainter fillPainter, int orientation, java.awt.ComponentOrientation componentOrientation)
-
paintDeterminate
public void paintDeterminate(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
paintDeterminate
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
getSelectionBackground
protected java.awt.Color getSelectionBackground()
- Overrides:
getSelectionBackground
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
getSelectionForeground
protected java.awt.Color getSelectionForeground()
- Overrides:
getSelectionForeground
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
paintRectangularStripedBackground
private void paintRectangularStripedBackground(java.awt.Graphics g, int startX, int startY, int width, int height, RadianceColorScheme colorScheme, int stripeOffset, float borderAlpha, boolean isVertical)
-
paintIndeterminate
public void paintIndeterminate(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
paintIndeterminate
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
getFillState
private ComponentState getFillState()
-
getProgressState
private ComponentState getProgressState()
-
getBox
protected java.awt.Rectangle getBox(java.awt.Rectangle r)
- Overrides:
getBox
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
startAnimationTimer
protected void startAnimationTimer()
- Overrides:
startAnimationTimer
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
stopAnimationTimer
protected void stopAnimationTimer()
- Overrides:
stopAnimationTimer
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
getAmountFull
protected int getAmountFull(java.awt.Insets b, int width, int height)
- Overrides:
getAmountFull
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
getPreferredInnerHorizontal
protected java.awt.Dimension getPreferredInnerHorizontal()
- Overrides:
getPreferredInnerHorizontal
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
getPreferredInnerVertical
protected java.awt.Dimension getPreferredInnerVertical()
- Overrides:
getPreferredInnerVertical
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
paintString
protected void paintString(java.awt.Graphics g, int x, int y, int width, int height, int amountFull, java.awt.Insets b)
- Overrides:
paintString
in classjavax.swing.plaf.basic.BasicProgressBarUI
-
paintString
private void paintString(java.awt.Graphics g, int x, int y, int width, int height, int fillStart, int amountFull)
Paints the progress string.- Parameters:
g
- Graphics used for drawing.x
- x location of bounding boxy
- y location of bounding boxwidth
- width of bounding boxheight
- height of bounding boxfillStart
- start location, in x or y depending on orientation, of the filled portion of the progress bar.amountFull
- size of the fill region, either width or height depending upon orientation.
-
getStringRectangle
private java.awt.Rectangle getStringRectangle(java.lang.String progressString, int x, int y, int width, int height)
Returns the rectangle for the progress bar string.- Parameters:
progressString
- Progress bar string.x
- x location of bounding boxy
- y location of bounding boxwidth
- width of bounding boxheight
- height of bounding box- Returns:
- The rectangle for the progress bar string.
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
update
in classjavax.swing.plaf.ComponentUI
-
-