< prev index next >

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

Print this page




1059             Rectangle paintIconR = new Rectangle();
1060             Rectangle paintTextR = new Rectangle();
1061 
1062             final String clippedText = layoutCL(this, fm, text, icon, paintViewR, paintIconR, paintTextR);
1063 
1064             if (icon != null) {
1065                 icon.paintIcon(this, g, paintIconR.x + 5, paintIconR.y);
1066             }
1067 
1068             if (text != null) {
1069                 final int textX = paintTextR.x;
1070                 final int textY = paintTextR.y + fm.getAscent() + 1;
1071                 if (isEnabled()) {
1072                     // Color background = fIsSelected ? getForeground() : getBackground();
1073                     final Color background = getBackground();
1074 
1075                     g.setColor(background);
1076                     g.fillRect(textX - 1, paintTextR.y, paintTextR.width + 2, fm.getAscent() + 2);
1077 
1078                     g.setColor(getForeground());
1079                     SwingUtilities2.drawString(filechooser, g, clippedText, textX, textY);
1080                 } else {
1081                     final Color background = getBackground();
1082                     g.setColor(background);
1083                     g.fillRect(textX - 1, paintTextR.y, paintTextR.width + 2, fm.getAscent() + 2);
1084 
1085                     g.setColor(background.brighter());
1086                     SwingUtilities2.drawString(filechooser, g, clippedText, textX, textY);
1087                     g.setColor(background.darker());
1088                     SwingUtilities2.drawString(filechooser, g, clippedText, textX + 1, textY + 1);
1089                 }
1090             }
1091         }
1092 
1093     }
1094 
1095     @SuppressWarnings("serial") // Superclass is not serializable across versions
1096     protected class FileRenderer extends MacFCTableCellRenderer {
1097         public FileRenderer(final Font f) {
1098             super(f);
1099         }
1100 
1101         public Component getTableCellRendererComponent(final JTable list,
1102                                                        final Object value,
1103                                                        final boolean isSelected,
1104                                                        final boolean cellHasFocus,
1105                                                        final int index,
1106                                                        final int col) {
1107             super.getTableCellRendererComponent(list, value, isSelected, false,
1108                                                 index,




1059             Rectangle paintIconR = new Rectangle();
1060             Rectangle paintTextR = new Rectangle();
1061 
1062             final String clippedText = layoutCL(this, fm, text, icon, paintViewR, paintIconR, paintTextR);
1063 
1064             if (icon != null) {
1065                 icon.paintIcon(this, g, paintIconR.x + 5, paintIconR.y);
1066             }
1067 
1068             if (text != null) {
1069                 final int textX = paintTextR.x;
1070                 final int textY = paintTextR.y + fm.getAscent() + 1;
1071                 if (isEnabled()) {
1072                     // Color background = fIsSelected ? getForeground() : getBackground();
1073                     final Color background = getBackground();
1074 
1075                     g.setColor(background);
1076                     g.fillRect(textX - 1, paintTextR.y, paintTextR.width + 2, fm.getAscent() + 2);
1077 
1078                     g.setColor(getForeground());
1079                     getTextUIDrawing().drawString(filechooser, g, clippedText, textX, textY);
1080                 } else {
1081                     final Color background = getBackground();
1082                     g.setColor(background);
1083                     g.fillRect(textX - 1, paintTextR.y, paintTextR.width + 2, fm.getAscent() + 2);
1084 
1085                     g.setColor(background.brighter());
1086                     getTextUIDrawing().drawString(filechooser, g, clippedText, textX, textY);
1087                     g.setColor(background.darker());
1088                     getTextUIDrawing().drawString(filechooser, g, clippedText, textX + 1, textY + 1);
1089                 }
1090             }
1091         }
1092 
1093     }
1094 
1095     @SuppressWarnings("serial") // Superclass is not serializable across versions
1096     protected class FileRenderer extends MacFCTableCellRenderer {
1097         public FileRenderer(final Font f) {
1098             super(f);
1099         }
1100 
1101         public Component getTableCellRendererComponent(final JTable list,
1102                                                        final Object value,
1103                                                        final boolean isSelected,
1104                                                        final boolean cellHasFocus,
1105                                                        final int index,
1106                                                        final int col) {
1107             super.getTableCellRendererComponent(list, value, isSelected, false,
1108                                                 index,


< prev index next >