# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: F:\Sources\MainTrunk\core\swing\plaf\src\org\netbeans\swing\plaf\winxp # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: XPLFCustoms.java *** F:\Sources\MainTrunk\core\swing\plaf\src\org\netbeans\swing\plaf\winxp\XPLFCustoms.java Base (1.17) --- F:\Sources\MainTrunk\core\swing\plaf\src\org\netbeans\swing\plaf\winxp\XPLFCustoms.java Locally Modified (Based On 1.17) *************** *** 19,29 **** package org.netbeans.swing.plaf.winxp; - import java.awt.GraphicsEnvironment; - import java.util.Locale; import javax.swing.UIManager; import javax.swing.plaf.ColorUIResource; - import javax.swing.plaf.FontUIResource; import org.netbeans.swing.plaf.LFCustoms; import org.netbeans.swing.plaf.util.GuaranteedValue; import org.netbeans.swing.plaf.util.UIBootstrapValue; --- 19,26 ---- *************** *** 59,66 **** private static final String TAB_CLOSE_BUTTON_BORDER_UNSEL = "close_button_border_unsel"; //NOI18N private static final String TAB_SEL_BOTTOM_BORDER = "tab_sel_bottom_border"; //NOI18N - private static final String TAHOMA_FONT_NAME = "Tahoma"; - static final String SCROLLPANE_BORDER_COLOR = "scrollpane_border"; //NOI18N public Object[] createLookAndFeelCustomizationKeysAndValues() { --- 56,61 ---- *************** *** 70,123 **** fontsize = in.intValue(); } ! Object[] result; ! ! if (shouldWeUseTahoma()) { ! result = new Object[] { ! //Changes default fonts to Tahoma based ones, for consistent Windows look ! // XXX Note that manual Tahoma setting is workaround for JDK bug 5079742. ! // Please remove when JDK 1.4 is no longer supported, ! // when only JDK 1.5_02 and higher are supported ! "Button.font", patch2Tahoma("Button.font"), //NOI18N ! "CheckBox.font", patch2Tahoma("CheckBox.font"), //NOI18N ! "ComboBox.font", patch2Tahoma("ComboBox.font"), //NOI18N ! "EditorPane.font", patch2Tahoma("EditorPane.font"), //NOI18N ! "Label.font", patch2Tahoma("Label.font"), //NOI18N ! "List.font", patch2Tahoma("List.font"), //NOI18N ! "RadioButton.font", patch2Tahoma("RadioButton.font"), //NOI18N ! "Panel.font", patch2Tahoma("Panel.font"), //NOI18N ! "PasswordField.font", patch2Tahoma("PasswordField.font"), //NOI18N ! "ProgressBar.font", patch2Tahoma("ProgressBar.font"), //NOI18N ! "ScrollPane.font", patch2Tahoma("ScrollPane.font"), //NOI18N ! "Spinner.font", patch2Tahoma("Spinner.font"), //NOI18N ! "TabbedPane.font", patch2Tahoma("TabbedPane.font"), //NOI18N ! "Table.font", patch2Tahoma("Table.font"), //NOI18N ! "TableHeader.font", patch2Tahoma("TableHeader.font"), //NOI18N ! "TextField.font", patch2Tahoma("TextField.font"), //NOI18N ! "TextPane.font", patch2Tahoma("TextPane.font"), //NOI18N ! "TitledBorder.font", patch2Tahoma("TitledBorder.font"), //NOI18N ! "ToggleButton.font", patch2Tahoma("ToggleButton.font"), //NOI18N ! "Tree.font", patch2Tahoma("Tree.font"), //NOI18N ! "Viewport.font", patch2Tahoma("Viewport.font"), //NOI18N ! "windowTitleFont", patch2Tahoma("windowTitleFont"), //NOI18N ! "controlFont", patch2Tahoma("controlFont"), //NOI18N ! //Work around a bug in windows which sets the text area font to //"MonoSpaced", causing all accessible dialogs to have monospaced text "TextArea.font", new GuaranteedValue ("Label.font", new Font("Dialog", Font.PLAIN, fontsize)), EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS, new Insets(17, 0, 17, 0), }; - } else { - result = new Object[] { - //Work around a bug in windows which sets the text area font to - //"MonoSpaced", causing all accessible dialogs to have monospaced text - "TextArea.font", new GuaranteedValue ("Label.font", new Font("Dialog", Font.PLAIN, fontsize)), - EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS, new Insets(17, 0, 17, 0), - }; - } - return result; } --- 65,81 ---- fontsize = in.intValue(); } ! Object[] result = new Object[] { //Work around a bug in windows which sets the text area font to //"MonoSpaced", causing all accessible dialogs to have monospaced text "TextArea.font", new GuaranteedValue ("Label.font", new Font("Dialog", Font.PLAIN, fontsize)), EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS, new Insets(17, 0, 17, 0), }; return result; } *************** *** 188,236 **** } } - // XXX Note this is workaround for JDK bug 5079742. - // Please remove when JDK 1.4 is no longer supported, - // when only JDK 1.5_02 and higher are supported - /** Takes given font uiresource and creates Tahoma based font of same style - * and size. - */ - private FontUIResource patch2Tahoma(String uiResource) { - Font originalFont = UIManager.getFont(uiResource); - FontUIResource result; - if (originalFont != null) { - result = new FontUIResource(TAHOMA_FONT_NAME, originalFont.getStyle(), originalFont.getSize()); - } else { - result = new FontUIResource(TAHOMA_FONT_NAME, Font.PLAIN, 11); - } - return result; - } - - /** Finds out if tahoma font is proper to use on current system (locale, availability) - * @return true if tahoma font is available, false otherwise - */ - private static boolean shouldWeUseTahoma () { - // don't try to use Tahoma for East Asian languages - Locale curLocale = Locale.getDefault(); - if (Locale.JAPANESE.getLanguage().equals(curLocale.getLanguage()) || - Locale.KOREAN.getLanguage().equals(curLocale.getLanguage()) || - Locale.CHINESE.getLanguage().equals(curLocale.getLanguage())) { - return false; - } - - // check if Tahoma is really available - GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); - String[] familyNames = env.getAvailableFontFamilyNames(); - - for (int i = 0; i < familyNames.length; i++) { - if (TAHOMA_FONT_NAME.equals(familyNames[i])) { - return true; - } - } - - return false; - } - - protected Object[] additionalKeys() { Object[] kv = new XPEditorColorings("").createKeysAndValues(); Object[] kv2 = new XPPropertySheetColorings().createKeysAndValues(); --- 143,148 ----