本文整理汇总了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);
}
示例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;
}
示例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.");
}
}
}
示例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);
}
示例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);
}
示例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.");
}
}
}
示例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);
}
}
示例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();
}
示例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;
}
示例10: setFileToRemove
import sun.java2d.Disposer; //导入方法依赖的package包/类
void setFileToRemove(File file, CreatedFontTracker tracker) {
Disposer.addObjectRecord(this,
new CreatedFontFileDisposerRecord(file, tracker));
}