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


Java Disposer类代码示例

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


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

示例1: initDeserializedWindow

import sun.java2d.Disposer; //导入依赖的package包/类
private void initDeserializedWindow() {
    setWarningString();
    inputContextLock = new Object();

    // Deserialized Windows are not yet visible.
    visible = false;

    weakThis = new WeakReference<>(this);

    anchor = new Object();
    disposerRecord = new WindowDisposerRecord(appContext, this);
    sun.java2d.Disposer.addRecord(anchor, disposerRecord);

    addToWindowList();
    initGC(null);
    ownedWindowList = new Vector<>();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:Window.java

示例2: 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

示例3: 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

示例4: 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

示例5: CGLGraphicsConfig

import sun.java2d.Disposer; //导入依赖的package包/类
private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt,
                          long configInfo, int maxTextureSize,
                          ContextCapabilities oglCaps) {
    super(device);

    this.pixfmt = pixfmt;
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    this.maxTextureSize = maxTextureSize;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);

    // add a record to the Disposer so that we destroy the native
    // CGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new CGLGCDisposerRecord(pConfigInfo));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:CGLGraphicsConfig.java

示例6: X11GraphicsConfig

import sun.java2d.Disposer; //导入依赖的package包/类
protected X11GraphicsConfig(X11GraphicsDevice device,
                            int visualnum, int depth,
                            int colormap, boolean doubleBuffer)
{
    this.screen = device;
    this.visual = visualnum;
    this.doubleBuffer = doubleBuffer;
    this.depth = depth;
    this.colormap = colormap;
    init (visualnum, screen.getScreen());

    // add a record to the Disposer so that we destroy the native
    // AwtGraphicsConfigData when this object goes away (i.e. after a
    // display change event)
    long x11CfgData = getAData();
    Disposer.addRecord(disposerReferent,
                       new X11GCDisposerRecord(x11CfgData));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:X11GraphicsConfig.java

示例7: 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

示例8: main

import sun.java2d.Disposer; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    Robot r = new Robot();
    for (int i = 0; i < 100; i++) {
        Frame f = new Frame();
        f.pack();
        f.dispose();
    }
    r.waitForIdle();

    Disposer.addRecord(new Object(), () -> disposerPhantomComplete = true);

    while (!disposerPhantomComplete) {
        Util.generateOOME();
    }

    Vector<WeakReference<Window>> windowList =
                    (Vector<WeakReference<Window>>) AppContext.getAppContext().get(Window.class);

    if (windowList != null && !windowList.isEmpty()) {
        throw new RuntimeException("Test FAILED: Window list is not empty: " + windowList.size());
    }

    System.out.println("Test PASSED");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:WindowsLeak.java

示例9: 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

示例10: 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

示例11: CGLGraphicsConfig

import sun.java2d.Disposer; //导入依赖的package包/类
private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt,
                          long configInfo, int maxTextureSize,
                          ContextCapabilities oglCaps) {
    super(device);

    this.pixfmt = pixfmt;
    this.pConfigInfo = configInfo;
    this.oglCaps = oglCaps;
    this.maxTextureSize = maxTextureSize;
    context = new OGLContext(OGLRenderQueue.getInstance(), this);
    refPConfigInfo(pConfigInfo);
    // add a record to the Disposer so that we destroy the native
    // CGLGraphicsConfigInfo data when this object goes away
    Disposer.addRecord(disposerReferent,
                       new CGLGCDisposerRecord(pConfigInfo));
}
 
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:17,代码来源:CGLGraphicsConfig.java


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