예제 #1
0
 protected void paintString(
     Graphics g, int x, int y, int width, int height, int amountFull, Insets b) {
   boolean indeterminate = false;
   if (Utilities.getJavaVersion() >= 1.6) {
     indeterminate = progressBar.isIndeterminate();
   }
   if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
     if (Utilities.isLeftToRight(progressBar)) {
       if (indeterminate) {
         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 (indeterminate) {
       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);
     }
   }
 }
예제 #2
0
 public void paint(Graphics g, JComponent c) {
   if (Utilities.getJavaVersion() >= 1.4) {
     if (progressBar.isIndeterminate()) {
       paintIndeterminate(g, c);
     } else {
       paintDeterminate(g, c);
     }
   } else {
     paintDeterminate(g, c);
   }
 }