/** Delegates painting to one of two methods: paintDeterminate or paintIndeterminate. */
 public void paint(Graphics g, JComponent c) {
   if (progressBar.isIndeterminate()) {
     paintIndeterminate(g, c);
   } else {
     paintDeterminate(g, c);
   }
 }
 public void uninstallUI(JComponent c) {
   if (progressBar.isIndeterminate()) {
     cleanUpIndeterminateValues();
   }
   uninstallDefaults();
   uninstallListeners();
   progressBar = null;
 }
 public void installUI(JComponent c) {
   progressBar = (JProgressBar) c;
   installDefaults();
   installListeners();
   if (progressBar.isIndeterminate()) {
     initIndeterminateValues();
   }
 }
 protected void paintString(
     Graphics g, int x, int y, int width, int height, int amountFull, Insets b) {
   if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
     if (BasicGraphicsUtils.isLeftToRight(progressBar)) {
       if (progressBar.isIndeterminate()) {
         boxRect = getBox(boxRect);
         paintString(g, x, y, width, height, boxRect.x, boxRect.width, b);
       } else {
         paintString(g, x, y, width, height, x, amountFull, b);
       }
     } else {
       paintString(g, x, y, width, height, x + width - amountFull, amountFull, b);
     }
   } else {
     if (progressBar.isIndeterminate()) {
       boxRect = getBox(boxRect);
       paintString(g, x, y, width, height, boxRect.y, boxRect.height, b);
     } else {
       paintString(g, x, y, width, height, y + height - amountFull, amountFull, b);
     }
   }
 }