< prev index next >

src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java

Print this page

        

@@ -121,10 +121,12 @@
     boolean selectionInProgress = false;
 
     // The accessoryPanel is a container to place the JFileChooser accessory component
     private JPanel accessoryPanel = null;
 
+    private TextUIDrawing textUIDrawing;
+
     //
     // ComponentUI Interface Implementation methods
     //
     public static ComponentUI createUI(final JComponent c) {
         return new AquaFileChooserUI((JFileChooser)c);

@@ -206,10 +208,11 @@
     protected void installDefaults(final JFileChooser fc) {
         installIcons(fc);
         installStrings(fc);
         setPackageIsTraversable(fc.getClientProperty(PACKAGE_TRAVERSABLE_PROPERTY));
         setApplicationIsTraversable(fc.getClientProperty(APPLICATION_TRAVERSABLE_PROPERTY));
+        textUIDrawing = SwingUtilities2.getTextUIDrawing(textUIDrawing);
     }
 
     protected void installIcons(final JFileChooser fc) {
         directoryIcon = UIManager.getIcon("FileView.directoryIcon");
         fileIcon = UIManager.getIcon("FileView.fileIcon");

@@ -294,10 +297,14 @@
     }
 
     protected void uninstallDefaults(final JFileChooser fc) {
         uninstallIcons(fc);
         uninstallStrings(fc);
+        if (textUIDrawing != SwingUtilities2.DEFAULT_UI_TEXT_DRAWING
+                && textUIDrawing instanceof UIResource) {
+            textUIDrawing = SwingUtilities2.DEFAULT_UI_TEXT_DRAWING;
+        }
     }
 
     protected void uninstallIcons(final JFileChooser fc) {
         directoryIcon = null;
         fileIcon = null;

@@ -1074,20 +1081,20 @@
 
                     g.setColor(background);
                     g.fillRect(textX - 1, paintTextR.y, paintTextR.width + 2, fm.getAscent() + 2);
 
                     g.setColor(getForeground());
-                    SwingUtilities2.drawString(filechooser, g, clippedText, textX, textY);
+                    textUIDrawing.drawString(filechooser, g, clippedText, textX, textY);
                 } else {
                     final Color background = getBackground();
                     g.setColor(background);
                     g.fillRect(textX - 1, paintTextR.y, paintTextR.width + 2, fm.getAscent() + 2);
 
                     g.setColor(background.brighter());
-                    SwingUtilities2.drawString(filechooser, g, clippedText, textX, textY);
+                    textUIDrawing.drawString(filechooser, g, clippedText, textX, textY);
                     g.setColor(background.darker());
-                    SwingUtilities2.drawString(filechooser, g, clippedText, textX + 1, textY + 1);
+                    textUIDrawing.drawString(filechooser, g, clippedText, textX + 1, textY + 1);
                 }
             }
         }
 
     }
< prev index next >