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.BasicProgressBarUIUI for progress bars in Radiance look and feel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classRadianceProgressBarUI.RadianceChangeListener
-
Field Summary
Fields Modifier and Type Field Description private floatanimationPositionThe current position of the indeterminate animation's cycle.private intdisplayedValueprivate TimelinedisplayTimelineprivate TimelineindeterminateLoopTimelineprivate intmarginInner margin.private static RadianceSurfacePainterprogressSurfacePainterprivate java.beans.PropertyChangeListenerradiancePropertyChangeListenerProperty change listener.private javax.swing.event.ChangeListenerradianceValueChangeListenerValue change listener on the associated progress bar.
-
Constructor Summary
Constructors Modifier Constructor Description protectedRadianceProgressBarUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent comp)private voiddrawDeterminateBackground(java.awt.Graphics2D g, javax.swing.JProgressBar bar, int width, int height, ContainerColorTokens colorTokens, RadianceSurfacePainter surfacePainter, int orientation, ComponentState currState)private voiddrawDeterminateProgress(java.awt.Graphics2D g, javax.swing.JProgressBar bar, int width, int height, boolean isFull, ContainerColorTokens colorTokens, RadianceSurfacePainter surfacePainter, int orientation, ComponentState currState)private voiddrawStripe1X(java.awt.Graphics2D g, int baseSize, java.awt.Color color)protected intgetAmountFull(java.awt.Insets b, int width, int height)protected java.awt.RectanglegetBox(java.awt.Rectangle r)private ComponentStategetFillState()protected java.awt.DimensiongetPreferredInnerHorizontal()protected java.awt.DimensiongetPreferredInnerVertical()private ComponentStategetProgressState()protected java.awt.ColorgetSelectionBackground()protected java.awt.ColorgetSelectionForeground()private java.awt.RectanglegetStringRectangle(java.lang.String progressString, int x, int y, int width, int height)Returns the rectangle for the progress bar string.protected voidinstallDefaults()protected voidinstallListeners()voidpaintDeterminate(java.awt.Graphics g, javax.swing.JComponent c)voidpaintIndeterminate(java.awt.Graphics g, javax.swing.JComponent c)private voidpaintRectangularStripedBackground(java.awt.Graphics g, int startX, int startY, int width, int height, ContainerColorTokens colorTokens, int stripeOffset, float borderAlpha, ComponentState currState, boolean isVertical)private voidpaintString(java.awt.Graphics g, int x, int y, int width, int height, int fillStart, int amountFull)Paints the progress string.protected voidpaintString(java.awt.Graphics g, int x, int y, int width, int height, int amountFull, java.awt.Insets b)protected voidstartAnimationTimer()protected voidstopAnimationTimer()protected voiduninstallListeners()voidupdate(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
-
progressSurfacePainter
private static final RadianceSurfacePainter progressSurfacePainter
-
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, theindeterminateLoopTimelineis 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 thefontproperty.
-
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:
installDefaultsin classjavax.swing.plaf.basic.BasicProgressBarUI
-
installListeners
protected void installListeners()
- Overrides:
installListenersin classjavax.swing.plaf.basic.BasicProgressBarUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListenersin 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, ContainerColorTokens colorTokens, RadianceSurfacePainter surfacePainter, int orientation, ComponentState currState)
-
drawDeterminateProgress
private void drawDeterminateProgress(java.awt.Graphics2D g, javax.swing.JProgressBar bar, int width, int height, boolean isFull, ContainerColorTokens colorTokens, RadianceSurfacePainter surfacePainter, int orientation, ComponentState currState)
-
paintDeterminate
public void paintDeterminate(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
paintDeterminatein classjavax.swing.plaf.basic.BasicProgressBarUI
-
getSelectionBackground
protected java.awt.Color getSelectionBackground()
- Overrides:
getSelectionBackgroundin classjavax.swing.plaf.basic.BasicProgressBarUI
-
getSelectionForeground
protected java.awt.Color getSelectionForeground()
- Overrides:
getSelectionForegroundin classjavax.swing.plaf.basic.BasicProgressBarUI
-
paintRectangularStripedBackground
private void paintRectangularStripedBackground(java.awt.Graphics g, int startX, int startY, int width, int height, ContainerColorTokens colorTokens, int stripeOffset, float borderAlpha, ComponentState currState, boolean isVertical)
-
paintIndeterminate
public void paintIndeterminate(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
paintIndeterminatein classjavax.swing.plaf.basic.BasicProgressBarUI
-
getFillState
private ComponentState getFillState()
-
getProgressState
private ComponentState getProgressState()
-
getBox
protected java.awt.Rectangle getBox(java.awt.Rectangle r)
- Overrides:
getBoxin classjavax.swing.plaf.basic.BasicProgressBarUI
-
startAnimationTimer
protected void startAnimationTimer()
- Overrides:
startAnimationTimerin classjavax.swing.plaf.basic.BasicProgressBarUI
-
stopAnimationTimer
protected void stopAnimationTimer()
- Overrides:
stopAnimationTimerin classjavax.swing.plaf.basic.BasicProgressBarUI
-
getAmountFull
protected int getAmountFull(java.awt.Insets b, int width, int height)- Overrides:
getAmountFullin classjavax.swing.plaf.basic.BasicProgressBarUI
-
getPreferredInnerHorizontal
protected java.awt.Dimension getPreferredInnerHorizontal()
- Overrides:
getPreferredInnerHorizontalin classjavax.swing.plaf.basic.BasicProgressBarUI
-
getPreferredInnerVertical
protected java.awt.Dimension getPreferredInnerVertical()
- Overrides:
getPreferredInnerVerticalin 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:
paintStringin 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:
updatein classjavax.swing.plaf.ComponentUI
-
-