java.awt.Toolkit#getDesktopProperty ( )源码实例Demo

下面列出了java.awt.Toolkit#getDesktopProperty ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-8   文件: Win32ShellFolder2.java
/**
 * Gets an icon from the Windows system icon list as an <code>Image</code>
 */
static Image getShell32Icon(int iconID, boolean getLargeIcon) {
    boolean useVGAColors = true; // Will be ignored on XP and later

    int size = getLargeIcon ? 32 : 16;

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
    if (shellIconBPP != null) {
        useVGAColors = shellIconBPP.equals("4");
    }

    long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
    if (hIcon != 0) {
        Image icon = makeIcon(hIcon, getLargeIcon);
        disposeIcon(hIcon);
        return icon;
    }
    return null;
}
 
源代码2 项目: TencentKona-8   文件: Win32ShellFolder2.java
/**
 * Gets an icon from the Windows system icon list as an <code>Image</code>
 */
static Image getShell32Icon(int iconID, boolean getLargeIcon) {
    boolean useVGAColors = true; // Will be ignored on XP and later

    int size = getLargeIcon ? 32 : 16;

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
    if (shellIconBPP != null) {
        useVGAColors = shellIconBPP.equals("4");
    }

    long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
    if (hIcon != 0) {
        Image icon = makeIcon(hIcon, getLargeIcon);
        disposeIcon(hIcon);
        return icon;
    }
    return null;
}
 
源代码3 项目: jdk8u60   文件: Win32ShellFolder2.java
/**
 * Gets an icon from the Windows system icon list as an <code>Image</code>
 */
static Image getShell32Icon(int iconID, boolean getLargeIcon) {
    boolean useVGAColors = true; // Will be ignored on XP and later

    int size = getLargeIcon ? 32 : 16;

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
    if (shellIconBPP != null) {
        useVGAColors = shellIconBPP.equals("4");
    }

    long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
    if (hIcon != 0) {
        Image icon = makeIcon(hIcon, getLargeIcon);
        disposeIcon(hIcon);
        return icon;
    }
    return null;
}
 
源代码4 项目: jdk8u-jdk   文件: Win32ShellFolder2.java
/**
 * Gets an icon from the Windows system icon list as an <code>Image</code>
 */
static Image getShell32Icon(int iconID, boolean getLargeIcon) {
    boolean useVGAColors = true; // Will be ignored on XP and later

    int size = getLargeIcon ? 32 : 16;

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
    if (shellIconBPP != null) {
        useVGAColors = shellIconBPP.equals("4");
    }

    long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
    if (hIcon != 0) {
        Image icon = makeIcon(hIcon, getLargeIcon);
        disposeIcon(hIcon);
        return icon;
    }
    return null;
}
 
源代码5 项目: openjdk-jdk8u   文件: Win32ShellFolder2.java
/**
 * Gets an icon from the Windows system icon list as an <code>Image</code>
 */
static Image getShell32Icon(int iconID, boolean getLargeIcon) {
    boolean useVGAColors = true; // Will be ignored on XP and later

    int size = getLargeIcon ? 32 : 16;

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
    if (shellIconBPP != null) {
        useVGAColors = shellIconBPP.equals("4");
    }

    long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
    if (hIcon != 0) {
        Image icon = makeIcon(hIcon, getLargeIcon);
        disposeIcon(hIcon);
        return icon;
    }
    return null;
}
 
源代码6 项目: hottub   文件: Win32ShellFolder2.java
/**
 * Gets an icon from the Windows system icon list as an <code>Image</code>
 */
static Image getShell32Icon(int iconID, boolean getLargeIcon) {
    boolean useVGAColors = true; // Will be ignored on XP and later

    int size = getLargeIcon ? 32 : 16;

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
    if (shellIconBPP != null) {
        useVGAColors = shellIconBPP.equals("4");
    }

    long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
    if (hIcon != 0) {
        Image icon = makeIcon(hIcon, getLargeIcon);
        disposeIcon(hIcon);
        return icon;
    }
    return null;
}
 
源代码7 项目: openjdk-jdk8u-backup   文件: Win32ShellFolder2.java
/**
 * Gets an icon from the Windows system icon list as an <code>Image</code>
 */
static Image getShell32Icon(int iconID, boolean getLargeIcon) {
    boolean useVGAColors = true; // Will be ignored on XP and later

    int size = getLargeIcon ? 32 : 16;

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
    if (shellIconBPP != null) {
        useVGAColors = shellIconBPP.equals("4");
    }

    long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
    if (hIcon != 0) {
        Image icon = makeIcon(hIcon, getLargeIcon);
        disposeIcon(hIcon);
        return icon;
    }
    return null;
}
 
源代码8 项目: Bytecoder   文件: SwingUtilities2.java
@SuppressWarnings("unchecked")
public static void putAATextInfo(boolean lafCondition,
        Map<Object, Object> map) {
    SunToolkit.setAAFontSettingsCondition(lafCondition);
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object desktopHints = tk.getDesktopProperty(SunToolkit.DESKTOPFONTHINTS);

    if (desktopHints instanceof Map) {
        Map<Object, Object> hints = (Map<Object, Object>) desktopHints;
        Object aaHint = hints.get(KEY_TEXT_ANTIALIASING);
        if (aaHint == null
                || aaHint == VALUE_TEXT_ANTIALIAS_OFF
                || aaHint == VALUE_TEXT_ANTIALIAS_DEFAULT) {
            return;
        }
        map.put(KEY_TEXT_ANTIALIASING, aaHint);
        map.put(KEY_TEXT_LCD_CONTRAST, hints.get(KEY_TEXT_LCD_CONTRAST));
    }
}
 
源代码9 项目: openjdk-jdk9   文件: Win32ShellFolder2.java
/**
 * Gets an icon from the Windows system icon list as an {@code Image}
 */
static Image getShell32Icon(int iconID, boolean getLargeIcon) {
    boolean useVGAColors = true; // Will be ignored on XP and later

    int size = getLargeIcon ? 32 : 16;

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
    if (shellIconBPP != null) {
        useVGAColors = shellIconBPP.equals("4");
    }

    long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
    if (hIcon != 0) {
        Image icon = makeIcon(hIcon, getLargeIcon);
        disposeIcon(hIcon);
        return icon;
    }
    return null;
}
 
源代码10 项目: jdk8u-jdk   文件: Win32ShellFolder2.java
/**
 * Gets an icon from the Windows system icon list as an <code>Image</code>
 */
static Image getShell32Icon(int iconID, boolean getLargeIcon) {
    boolean useVGAColors = true; // Will be ignored on XP and later

    int size = getLargeIcon ? 32 : 16;

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
    if (shellIconBPP != null) {
        useVGAColors = shellIconBPP.equals("4");
    }

    long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
    if (hIcon != 0) {
        Image icon = makeIcon(hIcon, getLargeIcon);
        disposeIcon(hIcon);
        return icon;
    }
    return null;
}
 
源代码11 项目: jdk1.8-source-analysis   文件: JFileChooser.java
private void installShowFilesListener() {
    // Track native setting for showing hidden files
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object showHiddenProperty = tk.getDesktopProperty(SHOW_HIDDEN_PROP);
    if (showHiddenProperty instanceof Boolean) {
        useFileHiding = !((Boolean)showHiddenProperty).booleanValue();
        showFilesListener = new WeakPCL(this);
        tk.addPropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
    }
}
 
源代码12 项目: FlatLaf   文件: JBRCustomDecorations.java
private Color calculateActiveBorderColor() {
	if( !colorizationAffectsBorders )
		return defaultActiveBorder;

	Toolkit toolkit = Toolkit.getDefaultToolkit();
	Color colorizationColor = (Color) toolkit.getDesktopProperty( "win.dwm.colorizationColor" );
	if( colorizationColor != null ) {
		Object colorizationColorBalanceObj = toolkit.getDesktopProperty( "win.dwm.colorizationColorBalance" );
		if( colorizationColorBalanceObj instanceof Integer ) {
			int colorizationColorBalance = (Integer) colorizationColorBalanceObj;
			if( colorizationColorBalance < 0 )
				colorizationColorBalance = 100;

			if( colorizationColorBalance == 0 )
				return new Color( 0xD9D9D9 );
			if( colorizationColorBalance == 100 )
				return colorizationColor;

			float alpha = colorizationColorBalance / 100.0f;
			float remainder = 1 - alpha;
			int r = Math.round( (colorizationColor.getRed() * alpha + 0xD9 * remainder) );
			int g = Math.round( (colorizationColor.getGreen() * alpha + 0xD9 * remainder) );
			int b = Math.round( (colorizationColor.getBlue() * alpha + 0xD9 * remainder) );
			return new Color( r, g, b );
		}
		return colorizationColor;
	}

	Color activeBorderColor = (Color) toolkit.getDesktopProperty( "win.frame.activeBorderColor" );
	return (activeBorderColor != null) ? activeBorderColor : UIManager.getColor( "MenuBar.borderColor" );
}
 
源代码13 项目: dragonwell8_jdk   文件: JFileChooser.java
private void installShowFilesListener() {
    // Track native setting for showing hidden files
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object showHiddenProperty = tk.getDesktopProperty(SHOW_HIDDEN_PROP);
    if (showHiddenProperty instanceof Boolean) {
        useFileHiding = !((Boolean)showHiddenProperty).booleanValue();
        showFilesListener = new WeakPCL(this);
        tk.addPropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
    }
}
 
源代码14 项目: Java8CN   文件: JFileChooser.java
private void installShowFilesListener() {
    // Track native setting for showing hidden files
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object showHiddenProperty = tk.getDesktopProperty(SHOW_HIDDEN_PROP);
    if (showHiddenProperty instanceof Boolean) {
        useFileHiding = !((Boolean)showHiddenProperty).booleanValue();
        showFilesListener = new WeakPCL(this);
        tk.addPropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
    }
}
 
源代码15 项目: hottub   文件: JFileChooser.java
private void installShowFilesListener() {
    // Track native setting for showing hidden files
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object showHiddenProperty = tk.getDesktopProperty(SHOW_HIDDEN_PROP);
    if (showHiddenProperty instanceof Boolean) {
        useFileHiding = !((Boolean)showHiddenProperty).booleanValue();
        showFilesListener = new WeakPCL(this);
        tk.addPropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
    }
}
 
源代码16 项目: openjdk-jdk8u   文件: JFileChooser.java
private void installShowFilesListener() {
    // Track native setting for showing hidden files
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object showHiddenProperty = tk.getDesktopProperty(SHOW_HIDDEN_PROP);
    if (showHiddenProperty instanceof Boolean) {
        useFileHiding = !((Boolean)showHiddenProperty).booleanValue();
        showFilesListener = new WeakPCL(this);
        tk.addPropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
    }
}
 
源代码17 项目: Bytecoder   文件: DesktopProperty.java
/**
 * Returns the value from the desktop.
 */
protected Object getValueFromDesktop() {
    Toolkit toolkit = Toolkit.getDefaultToolkit();

    if (pcl == null) {
        pcl = new WeakPCL(this, getKey(), UIManager.getLookAndFeel());
        toolkit.addPropertyChangeListener(getKey(), pcl);
    }

    return toolkit.getDesktopProperty(getKey());
}
 
源代码18 项目: Bytecoder   文件: JFileChooser.java
private void installShowFilesListener() {
    // Track native setting for showing hidden files
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object showHiddenProperty = tk.getDesktopProperty(SHOW_HIDDEN_PROP);
    if (showHiddenProperty instanceof Boolean) {
        useFileHiding = !((Boolean)showHiddenProperty).booleanValue();
        showFilesListener = new WeakPCL(this);
        tk.addPropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
    }
}
 
源代码19 项目: openjdk-jdk9   文件: JFileChooser.java
private void installShowFilesListener() {
    // Track native setting for showing hidden files
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object showHiddenProperty = tk.getDesktopProperty(SHOW_HIDDEN_PROP);
    if (showHiddenProperty instanceof Boolean) {
        useFileHiding = !((Boolean)showHiddenProperty).booleanValue();
        showFilesListener = new WeakPCL(this);
        tk.addPropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
    }
}
 
源代码20 项目: openjdk-8-source   文件: JFileChooser.java
private void installShowFilesListener() {
    // Track native setting for showing hidden files
    Toolkit tk = Toolkit.getDefaultToolkit();
    Object showHiddenProperty = tk.getDesktopProperty(SHOW_HIDDEN_PROP);
    if (showHiddenProperty instanceof Boolean) {
        useFileHiding = !((Boolean)showHiddenProperty).booleanValue();
        showFilesListener = new WeakPCL(this);
        tk.addPropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
    }
}