类sun.font.FontManagerForSGE源码实例Demo

下面列出了怎么用sun.font.FontManagerForSGE的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码2 项目: dragonwell8_jdk   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码3 项目: TencentKona-8   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码4 项目: TencentKona-8   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码5 项目: jdk8u60   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码6 项目: jdk8u60   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码7 项目: openjdk-jdk8u   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码8 项目: openjdk-jdk8u   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码11 项目: Bytecoder   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码12 项目: Bytecoder   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码13 项目: openjdk-jdk9   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码14 项目: openjdk-jdk9   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码15 项目: jdk8u-jdk   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码16 项目: jdk8u-jdk   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码17 项目: hottub   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码18 项目: hottub   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码19 项目: openjdk-8-source   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码20 项目: openjdk-8-source   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码21 项目: openjdk-8   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码22 项目: openjdk-8   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码23 项目: jdk8u-jdk   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码24 项目: jdk8u-jdk   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码25 项目: jdk8u-dev-jdk   文件: SunGraphicsEnvironment.java
/**
 * Returns all fonts available in this environment.
 */
public Font[] getAllFonts() {
    FontManagerForSGE fm = getFontManagerForSGE();
    Font[] installedFonts = fm.getAllInstalledFonts();
    Font[] created = fm.getCreatedFonts();
    if (created == null || created.length == 0) {
        return installedFonts;
    } else {
        int newlen = installedFonts.length + created.length;
        Font [] fonts = java.util.Arrays.copyOf(installedFonts, newlen);
        System.arraycopy(created, 0, fonts,
                         installedFonts.length, created.length);
        return fonts;
    }
}
 
源代码26 项目: jdk8u-dev-jdk   文件: SunGraphicsEnvironment.java
public String[] getAvailableFontFamilyNames(Locale requestedLocale) {
    FontManagerForSGE fm = getFontManagerForSGE();
    String[] installed = fm.getInstalledFontFamilyNames(requestedLocale);
    /* Use a new TreeMap as used in getInstalledFontFamilyNames
     * and insert all the keys in lower case, so that the sort order
     * is the same as the installed families. This preserves historical
     * behaviour and inserts new families in the right place.
     * It would have been marginally more efficient to directly obtain
     * the tree map and just insert new entries, but not so much as
     * to justify the extra internal interface.
     */
    TreeMap<String, String> map = fm.getCreatedFontFamilyNames();
    if (map == null || map.size() == 0) {
        return installed;
    } else {
        for (int i=0; i<installed.length; i++) {
            map.put(installed[i].toLowerCase(requestedLocale),
                    installed[i]);
        }
        String[] retval =  new String[map.size()];
        Object [] keyNames = map.keySet().toArray();
        for (int i=0; i < keyNames.length; i++) {
            retval[i] = (String)map.get(keyNames[i]);
        }
        return retval;
    }
}
 
源代码27 项目: dragonwell8_jdk   文件: SunGraphicsEnvironment.java
public static FontManagerForSGE getFontManagerForSGE() {
    FontManager fm = FontManagerFactory.getInstance();
    return (FontManagerForSGE) fm;
}
 
源代码28 项目: TencentKona-8   文件: SunGraphicsEnvironment.java
public static FontManagerForSGE getFontManagerForSGE() {
    FontManager fm = FontManagerFactory.getInstance();
    return (FontManagerForSGE) fm;
}
 
源代码29 项目: jdk8u60   文件: SunGraphicsEnvironment.java
public static FontManagerForSGE getFontManagerForSGE() {
    FontManager fm = FontManagerFactory.getInstance();
    return (FontManagerForSGE) fm;
}
 
源代码30 项目: openjdk-jdk8u   文件: SunGraphicsEnvironment.java
public static FontManagerForSGE getFontManagerForSGE() {
    FontManager fm = FontManagerFactory.getInstance();
    return (FontManagerForSGE) fm;
}