< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java

Print this page

        

@@ -825,28 +825,28 @@
                                                   x, y, width, height);
         Rectangle oldClip = g2.getClipBounds();
 
         if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
             g2.setColor(getSelectionBackground());
-            SwingUtilities2.drawString(progressBar, g2, progressString,
+            getTextUIDrawing().drawString(progressBar, g2, progressString,
                                        renderLocation.x, renderLocation.y);
             g2.setColor(getSelectionForeground());
             g2.clipRect(fillStart, y, amountFull, height);
-            SwingUtilities2.drawString(progressBar, g2, progressString,
+            getTextUIDrawing().drawString(progressBar, g2, progressString,
                                        renderLocation.x, renderLocation.y);
         } else { // VERTICAL
             g2.setColor(getSelectionBackground());
             AffineTransform rotate =
                     AffineTransform.getRotateInstance(Math.PI/2);
             g2.setFont(progressBar.getFont().deriveFont(rotate));
             renderLocation = getStringPlacement(g2, progressString,
                                                   x, y, width, height);
-            SwingUtilities2.drawString(progressBar, g2, progressString,
+            getTextUIDrawing().drawString(progressBar, g2, progressString,
                                        renderLocation.x, renderLocation.y);
             g2.setColor(getSelectionForeground());
             g2.clipRect(x, fillStart, width, amountFull);
-            SwingUtilities2.drawString(progressBar, g2, progressString,
+            getTextUIDrawing().drawString(progressBar, g2, progressString,
                                        renderLocation.x, renderLocation.y);
         }
         g2.setClip(oldClip);
     }
 

@@ -868,11 +868,11 @@
      */
     protected Point getStringPlacement(Graphics g, String progressString,
                                        int x,int y,int width,int height) {
         FontMetrics fontSizer = SwingUtilities2.getFontMetrics(progressBar, g,
                                             progressBar.getFont());
-        int stringWidth = SwingUtilities2.stringWidth(progressBar, fontSizer,
+        int stringWidth = getTextUIDrawing().getStringWidth(progressBar, fontSizer,
                                                       progressString);
 
         if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
             return new Point(x + Math.round(width/2 - stringWidth/2),
                              y + ((height +

@@ -897,11 +897,11 @@
             size = new Dimension(getPreferredInnerHorizontal());
             // Ensure that the progress string will fit
             if (progressBar.isStringPainted()) {
                 // I'm doing this for completeness.
                 String progString = progressBar.getString();
-                int stringWidth = SwingUtilities2.stringWidth(
+                int stringWidth = getTextUIDrawing().getStringWidth(
                           progressBar, fontSizer, progString);
                 if (stringWidth > size.width) {
                     size.width = stringWidth;
                 }
                 // This uses both Height and Descent to be sure that

@@ -924,11 +924,11 @@
                         fontSizer.getDescent();
                 if (stringHeight > size.width) {
                     size.width = stringHeight;
                 }
                 // This is also for completeness.
-                int stringWidth = SwingUtilities2.stringWidth(
+                int stringWidth = getTextUIDrawing().getStringWidth(
                                        progressBar, fontSizer, progString);
                 if (stringWidth > size.height) {
                     size.height = stringWidth;
                 }
             }
< prev index next >