本文整理汇总了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<>();
}
示例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);
}
示例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;
}
示例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.");
}
}
}
示例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));
}
示例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));
}
示例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);
}
示例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");
}
示例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);
}
示例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.");
}
}
}
示例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));
}