org.jvnet.substance
Class SubstanceProgressBarUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ProgressBarUI
          extended by javax.swing.plaf.basic.BasicProgressBarUI
              extended by org.jvnet.substance.SubstanceProgressBarUI

public class SubstanceProgressBarUI
extends javax.swing.plaf.basic.BasicProgressBarUI

UI for progress bars in Substance look and feel.

Author:
Kirill Grouchnikov

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicProgressBarUI
javax.swing.plaf.basic.BasicProgressBarUI.ChangeHandler
 
Field Summary
protected  int margin
          Inner margin.
static org.jvnet.lafwidget.animation.FadeKind PROGRESS_BAR_VALUE_CHANGED
          Fade kind for the progress bar value change.
protected  float speed
          The speed factor for the indeterminate progress bars.
protected  java.beans.PropertyChangeListener substancePropertyChangeListener
          Property change listener.
protected  javax.swing.event.ChangeListener substanceValueChangeListener
          Value change listener on the associated progress bar.
 
Fields inherited from class javax.swing.plaf.basic.BasicProgressBarUI
boxRect, changeListener, progressBar
 
Constructor Summary
SubstanceProgressBarUI()
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent comp)
           
protected  int getAmountFull(java.awt.Insets b, int width, int height)
           
protected  java.awt.Rectangle getBox(java.awt.Rectangle r)
           
static java.lang.String getMemoryUsage()
          Returns the memory usage string.
protected  java.awt.Dimension getPreferredInnerHorizontal()
           
protected  java.awt.Dimension getPreferredInnerVertical()
           
protected  java.awt.Color getSelectionBackground()
           
protected  java.awt.Color getSelectionForeground()
           
protected  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 incrementAnimationIndex()
           
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)
           
protected  void paintString(java.awt.Graphics g, int x, int y, int width, int height, int amountFull, java.awt.Insets b)
           
protected  void uninstallListeners()
           
 
Methods inherited from class javax.swing.plaf.basic.BasicProgressBarUI
getAnimationIndex, getBaseline, getBaselineResizeBehavior, getBoxLength, getCellLength, getCellSpacing, getFrameCount, getMaximumSize, getMinimumSize, getPreferredSize, getStringPlacement, installUI, paint, setAnimationIndex, setCellLength, setCellSpacing, startAnimationTimer, stopAnimationTimer, uninstallDefaults, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

substanceValueChangeListener

protected javax.swing.event.ChangeListener substanceValueChangeListener
Value change listener on the associated progress bar.


substancePropertyChangeListener

protected java.beans.PropertyChangeListener substancePropertyChangeListener
Property change listener. Tracks changes to the font property.


margin

protected int margin
Inner margin.


speed

protected float speed
The speed factor for the indeterminate progress bars.


PROGRESS_BAR_VALUE_CHANGED

public static final org.jvnet.lafwidget.animation.FadeKind PROGRESS_BAR_VALUE_CHANGED
Fade kind for the progress bar value change.

Constructor Detail

SubstanceProgressBarUI

public SubstanceProgressBarUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent comp)

installDefaults

protected void installDefaults()
Overrides:
installDefaults in class javax.swing.plaf.basic.BasicProgressBarUI

installListeners

protected void installListeners()
Overrides:
installListeners in class javax.swing.plaf.basic.BasicProgressBarUI

uninstallListeners

protected void uninstallListeners()
Overrides:
uninstallListeners in class javax.swing.plaf.basic.BasicProgressBarUI

paintDeterminate

public void paintDeterminate(java.awt.Graphics g,
                             javax.swing.JComponent c)
Overrides:
paintDeterminate in class javax.swing.plaf.basic.BasicProgressBarUI

getSelectionBackground

protected java.awt.Color getSelectionBackground()
Overrides:
getSelectionBackground in class javax.swing.plaf.basic.BasicProgressBarUI

getSelectionForeground

protected java.awt.Color getSelectionForeground()
Overrides:
getSelectionForeground in class javax.swing.plaf.basic.BasicProgressBarUI

paintIndeterminate

public void paintIndeterminate(java.awt.Graphics g,
                               javax.swing.JComponent c)
Overrides:
paintIndeterminate in class javax.swing.plaf.basic.BasicProgressBarUI

getBox

protected java.awt.Rectangle getBox(java.awt.Rectangle r)
Overrides:
getBox in class javax.swing.plaf.basic.BasicProgressBarUI

incrementAnimationIndex

protected void incrementAnimationIndex()
Overrides:
incrementAnimationIndex in class javax.swing.plaf.basic.BasicProgressBarUI

getMemoryUsage

public static java.lang.String getMemoryUsage()
Returns the memory usage string.

Returns:
The memory usage string.

getAmountFull

protected int getAmountFull(java.awt.Insets b,
                            int width,
                            int height)
Overrides:
getAmountFull in class javax.swing.plaf.basic.BasicProgressBarUI

getPreferredInnerHorizontal

protected java.awt.Dimension getPreferredInnerHorizontal()
Overrides:
getPreferredInnerHorizontal in class javax.swing.plaf.basic.BasicProgressBarUI

getPreferredInnerVertical

protected java.awt.Dimension getPreferredInnerVertical()
Overrides:
getPreferredInnerVertical in class javax.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 class javax.swing.plaf.basic.BasicProgressBarUI

getStringRectangle

protected 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 box
y - y location of bounding box
width - width of bounding box
height - height of bounding box
Returns:
The rectangle for the progress bar string.