当前位置: 首页>>代码示例>>Java>>正文


Java Disposer.addObjectRecord方法代码示例

本文整理汇总了Java中sun.java2d.Disposer.addObjectRecord方法的典型用法代码示例。如果您正苦于以下问题:Java Disposer.addObjectRecord方法的具体用法?Java Disposer.addObjectRecord怎么用?Java Disposer.addObjectRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.java2d.Disposer的用法示例。


在下文中一共展示了Disposer.addObjectRecord方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TrueTypeFont

import sun.java2d.Disposer; //导入方法依赖的package包/类
/**
 * - does basic verification of the file
 * - reads the header table for this font (within a collection)
 * - reads the names (full, family).
 * - determines the style of the font.
 * - initializes the CMAP
 * @throws FontFormatException - if the font can't be opened
 * or fails verification,  or there's no usable cmap
 */
public TrueTypeFont(String platname, Object nativeNames, int fIndex,
             boolean javaRasterizer)
    throws FontFormatException {
    super(platname, nativeNames);
    useJavaRasterizer = javaRasterizer;
    fontRank = Font2D.TTF_RANK;
    try {
        verify();
        init(fIndex);
    } catch (Throwable t) {
        close();
        if (t instanceof FontFormatException) {
            throw (FontFormatException)t;
        } else {
            throw new FontFormatException("Unexpected runtime exception.");
        }
    }
    Disposer.addObjectRecord(this, disposerRecord);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:TrueTypeFont.java

示例2: getScaler

import sun.java2d.Disposer; //导入方法依赖的package包/类
public static FontScaler getScaler(Font2D font,
                            int indexInCollection,
                            boolean supportsCJK,
                            int filesize) {
    FontScaler scaler = null;

    try {
        Object args[] = new Object[] {font, indexInCollection,
                                      supportsCJK, filesize};
        scaler = scalerConstructor.newInstance(args);
        Disposer.addObjectRecord(font, scaler);
    } catch (Throwable e) {
        scaler = nullScaler;

        //if we can not instantiate scaler assume bad font
        //NB: technically it could be also because of internal scaler
        //    error but here we are assuming scaler is ok.
        FontManager fm = FontManagerFactory.getInstance();
        fm.deRegisterBadFont(font);
    }
    return scaler;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:FontScaler.java

示例3: Type1Font

import sun.java2d.Disposer; //导入方法依赖的package包/类
/**
 * - does basic verification of the file
 * - reads the names (full, family).
 * - determines the style of the font.
 * @throws FontFormatException - if the font can't be opened
 * or fails verification,  or there's no usable cmap
 */
public Type1Font(String platname, Object nativeNames, boolean createdCopy)
    throws FontFormatException {
    super(platname, nativeNames);
    fontRank = Font2D.TYPE1_RANK;
    checkedNatives = true;
    try {
        verify();
    } catch (Throwable t) {
        if (createdCopy) {
            T1DisposerRecord ref = new T1DisposerRecord(platname);
            Disposer.addObjectRecord(bufferRef, ref);
            bufferRef = null;
        }
        if (t instanceof FontFormatException) {
            throw (FontFormatException)t;
        } else {
            throw new FontFormatException("Unexpected runtime exception.");
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:Type1Font.java

示例4: TrueTypeFont

import sun.java2d.Disposer; //导入方法依赖的package包/类
/**
 * - does basic verification of the file
 * - reads the header table for this font (within a collection)
 * - reads the names (full, family).
 * - determines the style of the font.
 * - initializes the CMAP
 * @throws FontFormatException - if the font can't be opened
 * or fails verification,  or there's no usable cmap
 */
public TrueTypeFont(String platname, Object nativeNames, int fIndex,
             boolean javaRasterizer, boolean useFilePool)
    throws FontFormatException {
    super(platname, nativeNames);
    useJavaRasterizer = javaRasterizer;
    fontRank = Font2D.TTF_RANK;
    try {
        verify(useFilePool);
        init(fIndex);
        if (!useFilePool) {
           close();
        }
    } catch (Throwable t) {
        close();
        if (t instanceof FontFormatException) {
            throw (FontFormatException)t;
        } else {
            throw new FontFormatException("Unexpected runtime exception.");
        }
    }
    Disposer.addObjectRecord(this, disposerRecord);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:32,代码来源:TrueTypeFont.java

示例5: TrueTypeFont

import sun.java2d.Disposer; //导入方法依赖的package包/类
/**
 * - does basic verification of the file
 * - reads the header table for this font (within a collection)
 * - reads the names (full, family).
 * - determines the style of the font.
 * - initializes the CMAP
 * @throws FontFormatException if the font can't be opened
 * or fails verification,  or there's no usable cmap
 */
public TrueTypeFont(String platname, Object nativeNames, int fIndex,
             boolean javaRasterizer, boolean useFilePool)
    throws FontFormatException {
    super(platname, nativeNames);
    useJavaRasterizer = javaRasterizer;
    fontRank = Font2D.TTF_RANK;
    try {
        verify(useFilePool);
        init(fIndex);
        if (!useFilePool) {
           close();
        }
    } catch (Throwable t) {
        close();
        if (t instanceof FontFormatException) {
            throw (FontFormatException)t;
        } else {
            throw new FontFormatException("Unexpected runtime exception.");
        }
    }
    Disposer.addObjectRecord(this, disposerRecord);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:TrueTypeFont.java

示例6: Type1Font

import sun.java2d.Disposer; //导入方法依赖的package包/类
/**
 * - does basic verification of the file
 * - reads the names (full, family).
 * - determines the style of the font.
 * @throws FontFormatException if the font can't be opened
 * or fails verification,  or there's no usable cmap
 */
public Type1Font(String platname, Object nativeNames, boolean createdCopy)
    throws FontFormatException {
    super(platname, nativeNames);
    fontRank = Font2D.TYPE1_RANK;
    checkedNatives = true;
    try {
        verify();
    } catch (Throwable t) {
        if (createdCopy) {
            T1DisposerRecord ref = new T1DisposerRecord(platname);
            Disposer.addObjectRecord(bufferRef, ref);
            bufferRef = null;
        }
        if (t instanceof FontFormatException) {
            throw (FontFormatException)t;
        } else {
            throw new FontFormatException("Unexpected runtime exception.");
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:Type1Font.java

示例7: setFileToRemove

import sun.java2d.Disposer; //导入方法依赖的package包/类
static void setFileToRemove(List<Font2D> fonts,
                            File file, int cnt,
                            CreatedFontTracker tracker)
{
    CreatedFontFileDisposerRecord dr =
        new CreatedFontFileDisposerRecord(file, cnt, tracker);

    for (Font2D f : fonts) {
        Disposer.addObjectRecord(f, dr);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:FileFont.java

示例8: testLeak

import sun.java2d.Disposer; //导入方法依赖的package包/类
public void testLeak() throws Exception {
    MyDisposerRec disposerRecord = new MyDisposerRec();
    for (int i = 0; i < 30000; i++) {
        Disposer.addObjectRecord(new Object(), disposerRecord);
    }
    generateOOME();
    readyForDispose = true;
    Disposer.addObjectRecord(new Object(), new EndRec());
    generateOOME();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:TestDisposerLeak.java

示例9: getHarfbuzzFacePtr

import sun.java2d.Disposer; //导入方法依赖的package包/类
synchronized long getHarfbuzzFacePtr() {
    if (harfbuzzFaceRef == null) {
        long harfbuzzFaceNativePtr = createHarfbuzzFace(isAAT(), getPlatformNativeFontPtr());
        if (harfbuzzFaceNativePtr == 0) return 0;
        harfbuzzFaceRef = new HarfbuzzFaceRef(harfbuzzFaceNativePtr);
        Disposer.addObjectRecord(this, harfbuzzFaceRef);
    }
    return harfbuzzFaceRef.harfbuzzFaceNativePtr;
}
 
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:10,代码来源:Font2D.java

示例10: setFileToRemove

import sun.java2d.Disposer; //导入方法依赖的package包/类
void setFileToRemove(File file, CreatedFontTracker tracker) {
    Disposer.addObjectRecord(this,
                     new CreatedFontFileDisposerRecord(file, tracker));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:FileFont.java


注:本文中的sun.java2d.Disposer.addObjectRecord方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。