Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.swing.plaf.windows8;
import java.awt.Color;
import java.awt.Font;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.border.MatteBorder;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.FontUIResource;
import javax.swing.text.StyleContext;
import org.netbeans.swing.plaf.LFCustoms;
import org.netbeans.swing.plaf.util.UIBootstrapValue;
import org.netbeans.swing.plaf.util.UIUtils;
/** Default system-provided customizer for Windows Vista LF
* Public only to be accessible by ProxyLazyValue, please don't abuse.
* @since 1.30
*/
public final class Windows8LFCustoms extends LFCustoms {
private static final String TAB_FOCUS_FILL_UPPER = "tab_focus_fill_upper"; //NOI18N
private static final String TAB_FOCUS_FILL_LOWER = "tab_focus_fill_lower"; //NOI18N
private static final String TAB_UNSEL_FILL_UPPER = "tab_unsel_fill_upper"; //NOI18N
private static final String TAB_UNSEL_FILL_LOWER = "tab_unsel_fill_lower"; //NOI18N
private static final String TAB_SEL_FILL = "tab_sel_fill"; //NOI18N
private static final String TAB_MOUSE_OVER_FILL_UPPER = "tab_mouse_over_fill_upper"; //NOI18N
private static final String TAB_MOUSE_OVER_FILL_LOWER = "tab_mouse_over_fill_lower"; //NOI18N
private static final String TAB_ATTENTION_FILL_UPPER = "tab_attention_fill_upper"; //NOI18N
private static final String TAB_ATTENTION_FILL_LOWER = "tab_attention_fill_lower"; //NOI18N
private static final String TAB_BORDER = "tab_border"; //NOI18N
private static final String TAB_SEL_BORDER = "tab_sel_border"; //NOI18N
private static final String TAB_BORDER_INNER = "tab_border_inner"; //NOI18N
// There is also a SCROLLPANE_BORDER_COLOR constant in the superclass. Both seem to be in use.
static final String SCROLLPANE_BORDER_COLOR2 = "scrollpane_border"; //NOI18N
/**
* A list of {@link UIDefaults} font properties which may need adjustment of the font family
* and/or font size.
*/
private static final String[] DEFAULT_GUI_FONT_PROPERTIES = new String[] {
/* These font properties are usually set to Tahoma 11 by Swing's Windows LAF. Since
Windows Vista, the default Windows font has switched to Segoe UI 12. Swing kept Tahoma 11
for backwards compatibility reasons only; see https://www.pushing-pixels.org/page/213?m and
JDK-6669448.
There's also a JDK Swing LAF bug which causes these font properties to be assigned the wrong
size under certain HiDPI configurations. Currently, JDK's WindowsLookAndFeel derives font
properties such as Label.font from the Windows API call GetStockObject(DEFAULT_GUI_FONT),
which appears to be unreliable when HiDPI display configurations are changed without logging
out of Windows and back in again (as may frequently happen, for instance, when an external
monitor is connected or disconnected). See the "win.defaultGUI.font" property in
WindowsLookAndFeel and
java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp . The
"win.messagebox.font" property is not affected by this problem, however, so we fetch the
default font using that one instead. FlatLAF does the same, in
com.formdev.flatlaf.FlatLaf.initialize(). Note that the font size in the
"win.defaultGUI.font" property may still be affected by the "Make text bigger" option in the
Windows 10 control panel, which exists independently of monitor-level HiDPI scaling
settings. */
"TitledBorder.font", "Slider.font", "PasswordField.font", "TableHeader.font", "TextPane.font",
"ProgressBar.font", "Viewport.font", "TabbedPane.font", "List.font", "CheckBox.font",
"Table.font", "ScrollPane.font", "ToggleButton.font", "Panel.font", "RadioButton.font",
"FormattedTextField.font", "TextField.font", "Spinner.font", "Button.font", "EditorPane.font",
"Label.font", "ComboBox.font", "Tree.font",
/* This one is Monospaced 13 by default, but should be switched to the standard UI font.
(This particular font substitution has been part of NetBeans since at least 2004.) */
"TextArea.font",
/* These font properties seem to be unaffected by the aforementioned HiDPI bug, and are also
set to Segoe UI 12 by Swing's Windows LAF. But include them in the list of fonts to update,
for consistency in case of future changes. */
"CheckBoxMenuItem.font", "OptionPane.font", "Menu.font", "ToolTip.font", "PopupMenu.font",
"RadioButtonMenuItem.font", "MenuItem.font", "ToolBar.font", "MenuBar.font",
/* This one is usually set to "Dialog 12" by default. Include it in the list to switch it to
Segoe UI as well. */
"ColorChooser.font"
}; //NOI18N
// Copied from com.formdev.flatlaf.FlatLAF.createCompositeFont.
private static FontUIResource createCompositeFont(String family, int style, int size) {
// using StyleContext.getFont() here because it uses
// sun.font.FontUtilities.getCompositeFontUIResource()
// and creates a composite font that is able to display all Unicode characters
Font font = StyleContext.getDefaultStyleContext().getFont(family, style, size);
return (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource(font);
}
final Color TAB_CONTENT_BORDER_COLOR = new Color(156, 156, 156);
@Override
public Object[] createLookAndFeelCustomizationKeysAndValues() {
Object[] constants = new Object[] {
EDITOR_PREFERRED_COLOR_PROFILE, "NetBeans", //NOI18N
EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS, new Insets(17, 0, 17, 0),
/* NETBEANS-1249: Remove excessive spacing between menu items, which appeared going from
Java 8 to Java 9. See screeshots in the JIRA ticket. The spacing
appeared during the fix for JDK-8067346; it should be safe to set
top/bottom margins to zero, however, like they were before. See
http://hg.openjdk.java.net/jdk10/master/annotate/be620a591379/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java .
Current Swing defaults are [2,2,2,2] for all of these (set in
javax.swing.plaf.basic.BasicLookAndFeel). */
"Menu.margin", new Insets(0, 2, 0, 2), //NOI18N
"MenuItem.margin", new Insets(0, 2, 0, 2), //NOI18N
"CheckBoxMenuItem.margin", new Insets(0, 2, 0, 2), //NOI18N
"RadioButtonMenuItem.margin", new Insets(0, 2, 0, 2), //NOI18N
/* Note that menu separators are still 3 pixels too tall on Windows compared to native
apps. Fixing that would be a bigger job, though (replacing WindowsPopupMenuSeparatorUI
to override getPreferredSize). */
/* Let the quick search area be flush with the rest of the menu bar. There's already a
thin border under the menu bar, and the quick search icon + the "Search (Ctrl+I)" string
to show the user that the quick search component is there. */
"nb.quicksearch.border", new EmptyBorder(0, 0, 0, 0),
// Let the HeapView component be flush with the toolbar background.
"nb.heapview.background", new Color(240, 240, 240),
"nb.heapview.foreground", new Color(45, 45, 45),
"nb.heapview.highlight", new Color(240, 240, 240, 240),
// Use the same color as EditorTab/ViewTab.underlineColor.
"nb.heapview.chart", new Color(61, 129, 245)
};
List