javax.swing.plaf.basic
Class BasicProgressBarUI

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.plaf.ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI 
      extended by javax.swing.plaf.ProgressBarUI sample code for javax.swing.plaf.ProgressBarUI definition code for javax.swing.plaf.ProgressBarUI 
          extended by javax.swing.plaf.basic.BasicProgressBarUI
Direct Known Subclasses:
MetalProgressBarUI sample code for javax.swing.plaf.metal.MetalProgressBarUI definition code for javax.swing.plaf.metal.MetalProgressBarUI

public class BasicProgressBarUI
extends ProgressBarUI sample code for javax.swing.plaf.ProgressBarUI definition code for javax.swing.plaf.ProgressBarUI

A Basic L&F implementation of ProgressBarUI.


Nested Class Summary
 class BasicProgressBarUI.ChangeHandler sample code for javax.swing.plaf.basic.BasicProgressBarUI.ChangeHandler definition code for javax.swing.plaf.basic.BasicProgressBarUI.ChangeHandler
          This inner class is marked "public" due to a compiler bug.
 
Field Summary
protected  Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle boxRect sample code for javax.swing.plaf.basic.BasicProgressBarUI.boxRect definition code for javax.swing.plaf.basic.BasicProgressBarUI.boxRect
          Used to hold the location and size of the bouncing box (returned by getBox) to be painted.
protected  ChangeListener sample code for javax.swing.event.ChangeListener definition code for javax.swing.event.ChangeListener changeListener sample code for javax.swing.plaf.basic.BasicProgressBarUI.changeListener definition code for javax.swing.plaf.basic.BasicProgressBarUI.changeListener
           
protected  JProgressBar sample code for javax.swing.JProgressBar definition code for javax.swing.JProgressBar progressBar sample code for javax.swing.plaf.basic.BasicProgressBarUI.progressBar definition code for javax.swing.plaf.basic.BasicProgressBarUI.progressBar
           
 
Constructor Summary
BasicProgressBarUI sample code for javax.swing.plaf.basic.BasicProgressBarUI.BasicProgressBarUI() definition code for javax.swing.plaf.basic.BasicProgressBarUI.BasicProgressBarUI() ()
           
 
Method Summary
static ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI createUI sample code for javax.swing.plaf.basic.BasicProgressBarUI.createUI(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.createUI(javax.swing.JComponent) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  x)
           
protected  int getAmountFull sample code for javax.swing.plaf.basic.BasicProgressBarUI.getAmountFull(java.awt.Insets, int, int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getAmountFull(java.awt.Insets, int, int) (Insets sample code for java.awt.Insets definition code for java.awt.Insets  b, int width, int height)
          This determines the amount of the progress bar that should be filled based on the percent done gathered from the model.
protected  int getAnimationIndex sample code for javax.swing.plaf.basic.BasicProgressBarUI.getAnimationIndex() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getAnimationIndex() ()
          Gets the index of the current animation frame.
protected  Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getBox sample code for javax.swing.plaf.basic.BasicProgressBarUI.getBox(java.awt.Rectangle) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getBox(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  r)
          Stores the position and size of the bouncing box that would be painted for the current animation index in r and returns r.
protected  int getBoxLength sample code for javax.swing.plaf.basic.BasicProgressBarUI.getBoxLength(int, int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getBoxLength(int, int) (int availableLength, int otherDimension)
          Returns the length of the "bouncing box" to be painted.
protected  int getCellLength sample code for javax.swing.plaf.basic.BasicProgressBarUI.getCellLength() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getCellLength() ()
          Returns the width (if HORIZONTAL) or height (if VERTICAL) of each of the indivdual cells/units to be rendered in the progress bar.
protected  int getCellSpacing sample code for javax.swing.plaf.basic.BasicProgressBarUI.getCellSpacing() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getCellSpacing() ()
          Returns the spacing between each of the cells/units in the progress bar.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getMaximumSize sample code for javax.swing.plaf.basic.BasicProgressBarUI.getMaximumSize(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getMaximumSize(javax.swing.JComponent) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
          Returns the specified component's maximum size appropriate for the look and feel.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getMinimumSize sample code for javax.swing.plaf.basic.BasicProgressBarUI.getMinimumSize(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getMinimumSize(javax.swing.JComponent) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
          The Minimum size for this component is 10.
protected  Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getPreferredInnerHorizontal sample code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerHorizontal() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerHorizontal() ()
           
protected  Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getPreferredInnerVertical sample code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerVertical() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerVertical() ()
           
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getPreferredSize sample code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize(javax.swing.JComponent) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
          Returns the specified component's preferred size appropriate for the look and feel.
protected  Color sample code for java.awt.Color definition code for java.awt.Color getSelectionBackground sample code for javax.swing.plaf.basic.BasicProgressBarUI.getSelectionBackground() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getSelectionBackground() ()
          The "selectionBackground" is the color of the text when it is painted over an unfilled area of the progress bar.
protected  Color sample code for java.awt.Color definition code for java.awt.Color getSelectionForeground sample code for javax.swing.plaf.basic.BasicProgressBarUI.getSelectionForeground() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getSelectionForeground() ()
          The "selectionForeground" is the color of the text when it is painted over a filled area of the progress bar.
protected  Point sample code for java.awt.Point definition code for java.awt.Point getStringPlacement sample code for javax.swing.plaf.basic.BasicProgressBarUI.getStringPlacement(java.awt.Graphics, java.lang.String, int, int, int, int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getStringPlacement(java.awt.Graphics, java.lang.String, int, int, int, int) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, String sample code for java.lang.String definition code for java.lang.String  progressString, int x, int y, int width, int height)
          Designate the place where the progress string will be painted.
protected  void incrementAnimationIndex sample code for javax.swing.plaf.basic.BasicProgressBarUI.incrementAnimationIndex() definition code for javax.swing.plaf.basic.BasicProgressBarUI.incrementAnimationIndex() ()
          Sets the index of the current animation frame, to the next valid value, which results in the progress bar being repainted.
protected  void installDefaults sample code for javax.swing.plaf.basic.BasicProgressBarUI.installDefaults() definition code for javax.swing.plaf.basic.BasicProgressBarUI.installDefaults() ()
           
protected  void installListeners sample code for javax.swing.plaf.basic.BasicProgressBarUI.installListeners() definition code for javax.swing.plaf.basic.BasicProgressBarUI.installListeners() ()
           
 void installUI sample code for javax.swing.plaf.basic.BasicProgressBarUI.installUI(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.installUI(javax.swing.JComponent) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
          Configures the specified component appropriate for the look and feel.
 void paint sample code for javax.swing.plaf.basic.BasicProgressBarUI.paint(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paint(java.awt.Graphics, javax.swing.JComponent) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
          Delegates painting to one of two methods: paintDeterminate or paintIndeterminate.
protected  void paintDeterminate sample code for javax.swing.plaf.basic.BasicProgressBarUI.paintDeterminate(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paintDeterminate(java.awt.Graphics, javax.swing.JComponent) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
          All purpose paint method that should do the right thing for almost all linear, determinate progress bars.
protected  void paintIndeterminate sample code for javax.swing.plaf.basic.BasicProgressBarUI.paintIndeterminate(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paintIndeterminate(java.awt.Graphics, javax.swing.JComponent) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
          All purpose paint method that should do the right thing for all linear bouncing-box progress bars.
protected  void paintString sample code for javax.swing.plaf.basic.BasicProgressBarUI.paintString(java.awt.Graphics, int, int, int, int, int, java.awt.Insets) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paintString(java.awt.Graphics, int, int, int, int, int, java.awt.Insets) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, int x, int y, int width, int height, int amountFull, Insets sample code for java.awt.Insets definition code for java.awt.Insets  b)
           
protected  void setAnimationIndex sample code for javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(int) (int newValue)
          Sets the index of the current animation frame to the specified value and requests that the progress bar be repainted.
protected  void setCellLength sample code for javax.swing.plaf.basic.BasicProgressBarUI.setCellLength(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setCellLength(int) (int cellLen)
           
protected  void setCellSpacing sample code for javax.swing.plaf.basic.BasicProgressBarUI.setCellSpacing(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setCellSpacing(int) (int cellSpace)
           
protected  void startAnimationTimer sample code for javax.swing.plaf.basic.BasicProgressBarUI.startAnimationTimer() definition code for javax.swing.plaf.basic.BasicProgressBarUI.startAnimationTimer() ()
          Starts the animation thread, creating and initializing it if necessary.
protected  void stopAnimationTimer sample code for javax.swing.plaf.basic.BasicProgressBarUI.stopAnimationTimer() definition code for javax.swing.plaf.basic.BasicProgressBarUI.stopAnimationTimer() ()
          Stops the animation thread.
protected  void uninstallDefaults sample code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallDefaults() definition code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallDefaults() ()
           
protected  void uninstallListeners sample code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallListeners() definition code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallListeners() ()
          Removes all listeners installed by this object.
 void uninstallUI sample code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallUI(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallUI(javax.swing.JComponent) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
          Reverses configuration which was done on the specified component during installUI.
 
Methods inherited from class javax.swing.plaf.ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI
contains sample code for javax.swing.plaf.ComponentUI.contains(javax.swing.JComponent, int, int) definition code for javax.swing.plaf.ComponentUI.contains(javax.swing.JComponent, int, int) , getAccessibleChild sample code for javax.swing.plaf.ComponentUI.getAccessibleChild(javax.swing.JComponent, int) definition code for javax.swing.plaf.ComponentUI.getAccessibleChild(javax.swing.JComponent, int) , getAccessibleChildrenCount sample code for javax.swing.plaf.ComponentUI.getAccessibleChildrenCount(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getAccessibleChildrenCount(javax.swing.JComponent) , update sample code for javax.swing.plaf.ComponentUI.update(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

progressBar sample code for javax.swing.plaf.basic.BasicProgressBarUI.progressBar

protected JProgressBar sample code for javax.swing.JProgressBar definition code for javax.swing.JProgressBar  progressBar

changeListener sample code for javax.swing.plaf.basic.BasicProgressBarUI.changeListener

protected ChangeListener sample code for javax.swing.event.ChangeListener definition code for javax.swing.event.ChangeListener  changeListener

boxRect sample code for javax.swing.plaf.basic.BasicProgressBarUI.boxRect

protected Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  boxRect
Used to hold the location and size of the bouncing box (returned by getBox) to be painted.

Since:
1.5
Constructor Detail

BasicProgressBarUI sample code for javax.swing.plaf.basic.BasicProgressBarUI() definition code for javax.swing.plaf.basic.BasicProgressBarUI()

public BasicProgressBarUI()
Method Detail

createUI sample code for javax.swing.plaf.basic.BasicProgressBarUI.createUI(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.createUI(javax.swing.JComponent)

public static ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI  createUI(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  x)

installUI sample code for javax.swing.plaf.basic.BasicProgressBarUI.installUI(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.installUI(javax.swing.JComponent)

public void installUI(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
Description copied from class: ComponentUI sample code for javax.swing.plaf.ComponentUI.installUI(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.installUI(javax.swing.JComponent)
Configures the specified component appropriate for the look and feel. This method is invoked when the ComponentUI instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:
  1. Install any default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.

Overrides:
installUI sample code for javax.swing.plaf.ComponentUI.installUI(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.installUI(javax.swing.JComponent) in class ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI
Parameters:
c - the component where this UI delegate is being installed
See Also:
ComponentUI.uninstallUI(javax.swing.JComponent) sample code for javax.swing.plaf.ComponentUI.uninstallUI(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.uninstallUI(javax.swing.JComponent) , JComponent.setUI(javax.swing.plaf.ComponentUI) sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) , JComponent.updateUI() sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI()

uninstallUI sample code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallUI(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallUI(javax.swing.JComponent)

public void uninstallUI(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
Description copied from class: ComponentUI sample code for javax.swing.plaf.ComponentUI.uninstallUI(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.uninstallUI(javax.swing.JComponent)
Reverses configuration which was done on the specified component during installUI. This method is invoked when this UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in installUI, being careful to leave the JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:
  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.

Overrides:
uninstallUI sample code for javax.swing.plaf.ComponentUI.uninstallUI(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.uninstallUI(javax.swing.JComponent) in class ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI
Parameters:
c - the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
ComponentUI.installUI(javax.swing.JComponent) sample code for javax.swing.plaf.ComponentUI.installUI(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.installUI(javax.swing.JComponent) , JComponent.updateUI() sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI()

installDefaults sample code for javax.swing.plaf.basic.BasicProgressBarUI.installDefaults() definition code for javax.swing.plaf.basic.BasicProgressBarUI.installDefaults()

protected void installDefaults()

uninstallDefaults sample code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallDefaults() definition code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallDefaults()

protected void uninstallDefaults()

installListeners sample code for javax.swing.plaf.basic.BasicProgressBarUI.installListeners() definition code for javax.swing.plaf.basic.BasicProgressBarUI.installListeners()

protected void installListeners()

startAnimationTimer sample code for javax.swing.plaf.basic.BasicProgressBarUI.startAnimationTimer() definition code for javax.swing.plaf.basic.BasicProgressBarUI.startAnimationTimer()

protected void startAnimationTimer()
Starts the animation thread, creating and initializing it if necessary. This method is invoked when an indeterminate progress bar should start animating. Reasons for this may include: If you implement your own animation thread, you must override this method.

Since:
1.4
See Also:
stopAnimationTimer() sample code for javax.swing.plaf.basic.BasicProgressBarUI.stopAnimationTimer() definition code for javax.swing.plaf.basic.BasicProgressBarUI.stopAnimationTimer()

stopAnimationTimer sample code for javax.swing.plaf.basic.BasicProgressBarUI.stopAnimationTimer() definition code for javax.swing.plaf.basic.BasicProgressBarUI.stopAnimationTimer()

protected void stopAnimationTimer()
Stops the animation thread. This method is invoked when the indeterminate animation should be stopped. Reasons for this may include: If you implement your own animation thread, you must override this method.

Since:
1.4
See Also:
startAnimationTimer() sample code for javax.swing.plaf.basic.BasicProgressBarUI.startAnimationTimer() definition code for javax.swing.plaf.basic.BasicProgressBarUI.startAnimationTimer()

uninstallListeners sample code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallListeners() definition code for javax.swing.plaf.basic.BasicProgressBarUI.uninstallListeners()

protected void uninstallListeners()
Removes all listeners installed by this object.


getPreferredInnerHorizontal sample code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerHorizontal() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerHorizontal()

protected Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getPreferredInnerHorizontal()

getPreferredInnerVertical sample code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerVertical() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredInnerVertical()

protected Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getPreferredInnerVertical()

getSelectionForeground sample code for javax.swing.plaf.basic.BasicProgressBarUI.getSelectionForeground() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getSelectionForeground()

protected Color sample code for java.awt.Color definition code for java.awt.Color  getSelectionForeground()
The "selectionForeground" is the color of the text when it is painted over a filled area of the progress bar.


getSelectionBackground sample code for javax.swing.plaf.basic.BasicProgressBarUI.getSelectionBackground() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getSelectionBackground()

protected Color sample code for java.awt.Color definition code for java.awt.Color  getSelectionBackground()
The "selectionBackground" is the color of the text when it is painted over an unfilled area of the progress bar.


getCellLength sample code for javax.swing.plaf.basic.BasicProgressBarUI.getCellLength() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getCellLength()

protected int getCellLength()
Returns the width (if HORIZONTAL) or height (if VERTICAL) of each of the indivdual cells/units to be rendered in the progress bar. However, for text rendering simplification and aesthetic considerations, this function will return 1 when the progress string is being rendered.

Returns:
the value representing the spacing between cells
See Also:
setCellLength(int) sample code for javax.swing.plaf.basic.BasicProgressBarUI.setCellLength(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setCellLength(int) , JProgressBar.isStringPainted() sample code for javax.swing.JProgressBar.isStringPainted() definition code for javax.swing.JProgressBar.isStringPainted()

setCellLength sample code for javax.swing.plaf.basic.BasicProgressBarUI.setCellLength(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setCellLength(int)

protected void setCellLength(int cellLen)

getCellSpacing sample code for javax.swing.plaf.basic.BasicProgressBarUI.getCellSpacing() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getCellSpacing()

protected int getCellSpacing()
Returns the spacing between each of the cells/units in the progress bar. However, for text rendering simplification and aesthetic considerations, this function will return 0 when the progress string is being rendered.

Returns:
the value representing the spacing between cells
See Also:
setCellSpacing(int) sample code for javax.swing.plaf.basic.BasicProgressBarUI.setCellSpacing(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setCellSpacing(int) , JProgressBar.isStringPainted() sample code for javax.swing.JProgressBar.isStringPainted() definition code for javax.swing.JProgressBar.isStringPainted()

setCellSpacing sample code for javax.swing.plaf.basic.BasicProgressBarUI.setCellSpacing(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setCellSpacing(int)

protected void setCellSpacing(int cellSpace)

getAmountFull sample code for javax.swing.plaf.basic.BasicProgressBarUI.getAmountFull(java.awt.Insets, int, int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getAmountFull(java.awt.Insets, int, int)

protected int getAmountFull(Insets sample code for java.awt.Insets definition code for java.awt.Insets  b,
                            int width,
                            int height)
This determines the amount of the progress bar that should be filled based on the percent done gathered from the model. This is a common operation so it was abstracted out. It assumes that your progress bar is linear. That is, if you are making a circular progress indicator, you will want to override this method.


paint sample code for javax.swing.plaf.basic.BasicProgressBarUI.paint(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paint(java.awt.Graphics, javax.swing.JComponent)

public void paint(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
                  JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
Delegates painting to one of two methods: paintDeterminate or paintIndeterminate.

Overrides:
paint sample code for javax.swing.plaf.ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent) in class ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI
Parameters:
g - the Graphics context in which to paint
c - the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent) sample code for javax.swing.plaf.ComponentUI.update(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)

getBox sample code for javax.swing.plaf.basic.BasicProgressBarUI.getBox(java.awt.Rectangle) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getBox(java.awt.Rectangle)

protected Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getBox(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  r)
Stores the position and size of the bouncing box that would be painted for the current animation index in r and returns r. Subclasses that add to the painting performed in this class's implementation of paintIndeterminate -- to draw an outline around the bouncing box, for example -- can use this method to get the location of the bouncing box that was just painted. By overriding this method, you have complete control over the size and position of the bouncing box, without having to reimplement paintIndeterminate.

Parameters:
r - the Rectangle instance to be modified; may be null
Returns:
null if no box should be drawn; otherwise, returns the passed-in rectangle (if non-null) or a new rectangle
Since:
1.4
See Also:
setAnimationIndex(int) sample code for javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(int)

getBoxLength sample code for javax.swing.plaf.basic.BasicProgressBarUI.getBoxLength(int, int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getBoxLength(int, int)

protected int getBoxLength(int availableLength,
                           int otherDimension)
Returns the length of the "bouncing box" to be painted. This method is invoked by the default implementation of paintIndeterminate to get the width (if the progress bar is horizontal) or height (if vertical) of the box. For example:
boxRect.width = getBoxLength(componentInnards.width,
                             componentInnards.height);
 

Parameters:
availableLength - the amount of space available for the bouncing box to move in; for a horizontal progress bar, for example, this should be the inside width of the progress bar (the component width minus borders)
otherDimension - for a horizontal progress bar, this should be the inside height of the progress bar; this value might be used to constrain or determine the return value
Returns:
the size of the box dimension being determined; must be no larger than availableLength
Since:
1.5
See Also:
SwingUtilities.calculateInnerArea(javax.swing.JComponent, java.awt.Rectangle) sample code for javax.swing.SwingUtilities.calculateInnerArea(javax.swing.JComponent, java.awt.Rectangle) definition code for javax.swing.SwingUtilities.calculateInnerArea(javax.swing.JComponent, java.awt.Rectangle)

paintIndeterminate sample code for javax.swing.plaf.basic.BasicProgressBarUI.paintIndeterminate(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paintIndeterminate(java.awt.Graphics, javax.swing.JComponent)

protected void paintIndeterminate(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
                                  JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
All purpose paint method that should do the right thing for all linear bouncing-box progress bars. Override this if you are making another kind of progress bar.

Since:
1.4
See Also:
paintDeterminate(java.awt.Graphics, javax.swing.JComponent) sample code for javax.swing.plaf.basic.BasicProgressBarUI.paintDeterminate(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paintDeterminate(java.awt.Graphics, javax.swing.JComponent)

paintDeterminate sample code for javax.swing.plaf.basic.BasicProgressBarUI.paintDeterminate(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paintDeterminate(java.awt.Graphics, javax.swing.JComponent)

protected void paintDeterminate(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
                                JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
All purpose paint method that should do the right thing for almost all linear, determinate progress bars. By setting a few values in the defaults table, things should work just fine to paint your progress bar. Naturally, override this if you are making a circular or semi-circular progress bar.

Since:
1.4
See Also:
paintIndeterminate(java.awt.Graphics, javax.swing.JComponent) sample code for javax.swing.plaf.basic.BasicProgressBarUI.paintIndeterminate(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paintIndeterminate(java.awt.Graphics, javax.swing.JComponent)

paintString sample code for javax.swing.plaf.basic.BasicProgressBarUI.paintString(java.awt.Graphics, int, int, int, int, int, java.awt.Insets) definition code for javax.swing.plaf.basic.BasicProgressBarUI.paintString(java.awt.Graphics, int, int, int, int, int, java.awt.Insets)

protected void paintString(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
                           int x,
                           int y,
                           int width,
                           int height,
                           int amountFull,
                           Insets sample code for java.awt.Insets definition code for java.awt.Insets  b)

getStringPlacement sample code for javax.swing.plaf.basic.BasicProgressBarUI.getStringPlacement(java.awt.Graphics, java.lang.String, int, int, int, int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getStringPlacement(java.awt.Graphics, java.lang.String, int, int, int, int)

protected Point sample code for java.awt.Point definition code for java.awt.Point  getStringPlacement(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
                                   String sample code for java.lang.String definition code for java.lang.String  progressString,
                                   int x,
                                   int y,
                                   int width,
                                   int height)
Designate the place where the progress string will be painted. This implementation places it at the center of the progress bar (in both x and y). Override this if you want to right, left, top, or bottom align the progress string or if you need to nudge it around for any reason.


getPreferredSize sample code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getPreferredSize(javax.swing.JComponent)

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getPreferredSize(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
Description copied from class: ComponentUI sample code for javax.swing.plaf.ComponentUI.getPreferredSize(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getPreferredSize(javax.swing.JComponent)
Returns the specified component's preferred size appropriate for the look and feel. If null is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returns null.

Overrides:
getPreferredSize sample code for javax.swing.plaf.ComponentUI.getPreferredSize(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getPreferredSize(javax.swing.JComponent) in class ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI
Parameters:
c - the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
JComponent.getPreferredSize() sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize() , LayoutManager.preferredLayoutSize(java.awt.Container) sample code for java.awt.LayoutManager.preferredLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager.preferredLayoutSize(java.awt.Container)

getMinimumSize sample code for javax.swing.plaf.basic.BasicProgressBarUI.getMinimumSize(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getMinimumSize(javax.swing.JComponent)

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getMinimumSize(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
The Minimum size for this component is 10. The rationale here is that there should be at least one pixel per 10 percent.

Overrides:
getMinimumSize sample code for javax.swing.plaf.ComponentUI.getMinimumSize(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getMinimumSize(javax.swing.JComponent) in class ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI
Parameters:
c - the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
Returns:
a Dimension object or null
See Also:
JComponent.getMinimumSize() sample code for javax.swing.JComponent.getMinimumSize() definition code for javax.swing.JComponent.getMinimumSize() , LayoutManager.minimumLayoutSize(java.awt.Container) sample code for java.awt.LayoutManager.minimumLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager.minimumLayoutSize(java.awt.Container) , ComponentUI.getPreferredSize(javax.swing.JComponent) sample code for javax.swing.plaf.ComponentUI.getPreferredSize(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getPreferredSize(javax.swing.JComponent)

getMaximumSize sample code for javax.swing.plaf.basic.BasicProgressBarUI.getMaximumSize(javax.swing.JComponent) definition code for javax.swing.plaf.basic.BasicProgressBarUI.getMaximumSize(javax.swing.JComponent)

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getMaximumSize(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c)
Description copied from class: ComponentUI sample code for javax.swing.plaf.ComponentUI.getMaximumSize(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getMaximumSize(javax.swing.JComponent)
Returns the specified component's maximum size appropriate for the look and feel. If null is returned, the maximum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes getPreferredSize and returns that value.

Overrides:
getMaximumSize sample code for javax.swing.plaf.ComponentUI.getMaximumSize(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getMaximumSize(javax.swing.JComponent) in class ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI
Parameters:
c - the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
Returns:
a Dimension object or null
See Also:
JComponent.getMaximumSize() sample code for javax.swing.JComponent.getMaximumSize() definition code for javax.swing.JComponent.getMaximumSize() , LayoutManager2.maximumLayoutSize(java.awt.Container) sample code for java.awt.LayoutManager2.maximumLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager2.maximumLayoutSize(java.awt.Container)

getAnimationIndex sample code for javax.swing.plaf.basic.BasicProgressBarUI.getAnimationIndex() definition code for javax.swing.plaf.basic.BasicProgressBarUI.getAnimationIndex()

protected int getAnimationIndex()
Gets the index of the current animation frame.

Since:
1.4

setAnimationIndex sample code for javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(int)

protected void setAnimationIndex(int newValue)
Sets the index of the current animation frame to the specified value and requests that the progress bar be repainted. Subclasses that don't use the default painting code might need to override this method to change the way that the repaint method is invoked.

Parameters:
newValue - the new animation index; no checking is performed on its value
Since:
1.4
See Also:
incrementAnimationIndex() sample code for javax.swing.plaf.basic.BasicProgressBarUI.incrementAnimationIndex() definition code for javax.swing.plaf.basic.BasicProgressBarUI.incrementAnimationIndex()

incrementAnimationIndex sample code for javax.swing.plaf.basic.BasicProgressBarUI.incrementAnimationIndex() definition code for javax.swing.plaf.basic.BasicProgressBarUI.incrementAnimationIndex()

protected void incrementAnimationIndex()
Sets the index of the current animation frame, to the next valid value, which results in the progress bar being repainted. The next valid value is, by default, the current animation index plus one. If the new value would be too large, this method sets the index to 0. Subclasses might need to override this method to ensure that the index does not go over the number of frames needed for the particular progress bar instance. This method is invoked by the default animation thread every X milliseconds, where X is specified by the "ProgressBar.repaintInterval" UI default.

Since:
1.4
See Also:
setAnimationIndex(int) sample code for javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(int) definition code for javax.swing.plaf.basic.BasicProgressBarUI.setAnimationIndex(int)